:root {
    --primary: #fb923c; --primary-light: #fdba74; --primary-dark: #f97316;
    --danger: #ef4444; --success: #10b981; --warning: #f59e0b;
    --bg: #f9f6f0; --card: #ffffff; --border: #e2e8f0; --text: #1e293b;
    --text-secondary: #64748b; --text-light: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem; --radius-md: 0.5rem; --radius-lg: 0.75rem; --radius-xl: 1rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* 身份验证卡片 */
.auth-card {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
    margin: 80px auto;
    text-align: center;
    transition: var(--transition);
}

.auth-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-2px);
}

.auth-card h2 {
    margin-bottom: 20px;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
}

.auth-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 16px;
    background: #f8fafc;
}

.auth-card input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--card);
}

/* 头部协调布局 */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-tabs button {
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.nav-tabs button:hover {
    color: var(--primary);
}

.nav-tabs button.active {
    background: var(--card);
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-logout:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
    color: var(--primary);
}

/* 上传卡片 */
.upload-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.upload-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.input-row input {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    background: #f8fafc;
}

.input-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--card);
}

.input-row input::placeholder {
    color: var(--text-light);
}

.file-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.custom-file-upload {
    flex: 1;
    border: 2px dashed var(--border);
    padding: 10px;
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    background: #f8fafc;
    font-weight: 500;
    font-size: 0.8125rem;
    position: relative;
    overflow: hidden;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-file-upload::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.1), transparent);
    transition: 0.5s;
}

.custom-file-upload:hover::before {
    left: 100%;
}

.custom-file-upload:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-1px);
}

.custom-file-upload i {
    font-size: 1.25rem;
    margin-right: 8px;
}

input[type="file"] {
    display: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* 搜索容器 */
.search-container {
    position: relative;
    margin-bottom: 24px;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.875rem;
}

.search-container input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), var(--shadow-sm);
}

.search-container input::placeholder {
    color: var(--text-light);
}

/* 列表美化 */
.file-list-v {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-card {
    background: var(--card);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.file-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    white-space: nowrap;
}

.file-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: var(--transition);
}

.file-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.file-card:hover::before {
    transform: scaleY(1);
}

.file-card input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
    margin-top: 3px;
    flex-shrink: 0;
}

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

.file-title {
    display: block;
    font-weight: 600;
    text-decoration: none;
    color: #10b981;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9375rem;
    margin-bottom: 4px;
    transition: var(--transition);
}

.file-title:hover {
    color: #059669;
    text-decoration: underline;
}

.file-info div {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-card button {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.file-card button:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    transform: scale(1.1);
}

.file-card button:nth-child(1):hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.file-card button:nth-child(2):hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.file-card button:nth-child(3):hover {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* 批量操作栏 */
.batch-bar {
    background: var(--card);
    padding: 8px 12px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease-out;
    gap: 8px;
}

.batch-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.select-all-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
    cursor: pointer;
}

.select-all-label:hover {
    color: var(--primary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#batch-count {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.batch-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-del-sec {
    background: var(--danger);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.7rem;
    box-shadow: var(--shadow-sm);
}

.btn-del-sec:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-link {
    background: transparent;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.btn-link:hover {
    background: #f1f5f9;
    border-color: var(--primary-light);
    color: var(--primary);
}

/* Toast 修改 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 28px;
    border-radius: 50px;
    color: white;
    opacity: 0;
    transition: var(--transition);
    z-index: 9999;
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* 进度条 */
.progress-wrap {
    height: 10px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    margin-top: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    padding-right: 40px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    width: 0%;
    transition: width 0.3s ease-out;
    border-radius: var(--radius-md);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

#progress-val {
    position: absolute;
    right: 8px;
    top: -22px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--card);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .logo-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
    }

    .nav-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .nav-tabs button {
        flex: 1;
        text-align: center;
        padding: 6px 10px;
        white-space: nowrap;
        font-size: 0.75rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .file-action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .custom-file-upload {
        order: 1;
        white-space: nowrap;
    }

    #addBtn {
        order: 2;
        white-space: nowrap;
    }

    .file-card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
    }

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

    .file-info div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .file-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .file-card input[type="checkbox"] {
        flex-shrink: 0;
    }

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

    .file-card button {
        white-space: nowrap;
    }

    .batch-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .batch-bar-left {
        white-space: nowrap;
        overflow: hidden;
    }

    .batch-btns {
        justify-content: center;
        white-space: nowrap;
    }

    .batch-btns button {
        white-space: nowrap;
    }

    .search-container input {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .upload-card {
        white-space: nowrap;
    }

    .input-row input {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 24px;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: var(--text);
    color: #fff;
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    font-weight: 500;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 确认框组件 */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.confirm-content {
    background: var(--card);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.confirm-content h3 {
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.confirm-content p {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons button {
    flex: 1;
    max-width: 120px;
}