/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.logo h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.features {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    text-align: left;
}

.features h3 {
    margin-bottom: 15px;
    color: #333;
}

.features ul {
    list-style: none;
}

.features li {
    padding: 5px 0;
    color: #666;
}

/* 上传页面样式 */
.upload-container {
    min-height: 100vh;
    background: #f5f7fa;
}

.header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header h1 {
    display: inline-block;
    margin: 0;
}

.header-actions {
    float: right;
    margin-top: 5px;
}

.user-info {
    margin-right: 20px;
    opacity: 0.9;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 40px;
}

.upload-box {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover, .upload-box.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-box h3 {
    margin-bottom: 15px;
    color: #333;
}

.upload-info {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.upload-buttons {
    margin-top: 20px;
    position: relative;
}

/* 子级 <input type=file>：必须完全隐藏。仅用 clip/绝对定位 时部分浏览器仍会出现左侧系统「选择文件+文件名」条；display:none 后由外层 label 负责点击、一次只弹一个框 */
.file-select-label {
    margin: 0 5px;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.file-select-label .file-input-sr,
.file-select-label input[type="file"] {
    display: none !important;
    position: absolute;
    width: 0 !important;
    height: 0 !important;
    margin: 0;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.file-select-text {
    pointer-events: none;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin: 2px;
}

/* 上传进度 */
.upload-progress {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.progress-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-filename {
    flex: 1;
    margin-right: 15px;
    font-weight: 500;
}

.progress-bar {
    flex: 2;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-status {
    min-width: 60px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
}

/* 文件列表区域 */
.files-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.section-actions .btn {
    margin-left: 10px;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.file-item-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    transition: background 0.2s ease;
}

.file-item-row:last-child {
    border-bottom: none;
}

.file-item-row:hover {
    background: #f0f2f5;
}

.file-type-icon {
    flex-shrink: 0;
    font-size: 1.35em;
    line-height: 1;
    width: 2.2em;
    text-align: center;
}

.file-info-row {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.file-name {
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    color: #666;
    font-size: 12px;
    margin: 0;
}

.file-actions-row {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0;
}

.btn-copy {
    background: #28a745;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.no-files {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.1em;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    z-index: 1001;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        text-align: center;
    }
    
    .header-actions {
        float: none;
        margin-top: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .section-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .file-item-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions-row {
        width: 100%;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item {
    animation: fadeInUp 0.5s ease forwards;
}

/* 拖拽状态 */
.upload-box.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}