/* ============================================
   程序版本管理网站 - 全局样式
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #06060f;
    --bg-secondary: #0c0c1d;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    --accent-1: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #a78bfa;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 68px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-3); text-decoration: none; transition: var(--transition); }
a:hover { color: #c4b5fd; }

/* ---- Background Decoration ---- */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: blobFloat 20s ease-in-out infinite;
}
.bg-blob-1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -200px; right: -100px;
    animation-delay: 0s;
}
.bg-blob-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -150px; left: -100px;
    animation-delay: -7s;
}
.bg-blob-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 35px) scale(1.02); }
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: var(--transition);
}
.glass-card:hover {
    border-color: var(--glass-border-hover);
}

/* ---- Navbar ---- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: rgba(6, 6, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}
.nav-brand i {
    font-size: 1.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.15);
}
.nav-link.active i { color: var(--accent-3); }

.nav-user {
    position: relative;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
.user-info:hover { background: rgba(255, 255, 255, 0.06); }

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

.user-info > .fa-chevron-down {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: var(--transition);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1001;
}
.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dropdown-header strong { font-size: 0.95rem; }
.dropdown-header span { font-size: 0.8rem; color: var(--text-muted); }

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}
.dropdown-item.text-danger:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    animation: flashSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid;
}
.flash-success {
    background: var(--success-bg);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--success);
}
.flash-error {
    background: var(--error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error);
}
.flash-warning {
    background: var(--warning-bg);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--warning);
}
.flash-info {
    background: var(--info-bg);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.flash-icon { font-size: 1.1rem; flex-shrink: 0; }
.flash-text { flex: 1; font-size: 0.9rem; font-weight: 500; }
.flash-close {
    background: none; border: none; color: inherit; cursor: pointer;
    opacity: 0.6; padding: 4px; font-size: 0.85rem;
    transition: var(--transition);
}
.flash-close:hover { opacity: 1; }

@keyframes flashSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.flash-message.flash-out {
    animation: flashSlideOut 0.3s forwards;
}
@keyframes flashSlideOut {
    to { opacity: 0; transform: translateX(40px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* ---- Main Content ---- */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--nav-height) + 24px);
    min-height: 100vh;
}
.main-content.no-nav { padding-top: 0; }

.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title h1 i {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-title p {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.95rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-glow);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-download {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.btn-download:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Form Elements ---- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-group label i { margin-right: 4px; }

.required { color: var(--error); }

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select option {
    background-color: #121226;
    color: #f1f5f9;
    padding: 10px;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.8rem;
    margin-top: 4px;
}
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--error); }

.input-icon-wrapper {
    position: relative;
}
.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: var(--transition);
    z-index: 1;
}
.form-input.with-icon { padding-left: 42px; }
.form-input.with-icon:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon { color: var(--accent-3); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.flex-1 { flex: 1; }
.flex-0 { flex: 0 0 auto; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

/* ---- Stats Row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(24px);
    transition: var(--transition);
}
.stat-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.region-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.region-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}
.region-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
.region-pill.active {
    color: white;
    background: var(--gradient);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.search-wrapper {
    position: relative;
    min-width: 250px;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}
.search-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-input::placeholder { color: var(--text-muted); }

/* ---- File Table ---- */
.file-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.file-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}
.file-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.file-table tbody tr:last-child { border-bottom: none; }

.file-table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}
.file-icon {
    color: var(--accent-3);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.file-name {
    font-weight: 500;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.version-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-3);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.region-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.desc-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    color: var(--text-secondary);
}

.date-text { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.uploader-text { color: var(--text-secondary); }
.size-text { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}
.inline-form { display: inline; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}
.empty-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}
.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ---- Login Page ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(30px);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    animation: cardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border-radius: var(--radius-lg);
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 30px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 8px 30px var(--accent-glow); }
    50% { box-shadow: 0 8px 50px rgba(99, 102, 241, 0.5); }
}

.login-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form .form-group { margin-bottom: 20px; }
.login-form .form-input {
    padding: 12px 14px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.06);
}
.login-form .form-input.with-icon { padding-left: 44px; }

.login-form .btn-block {
    padding: 13px;
    font-size: 1rem;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}
.login-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---- Upload Page ---- */
.upload-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
    position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone-content {}
.drop-icon {
    font-size: 3rem;
    color: var(--accent-3);
    margin-bottom: 12px;
    opacity: 0.7;
}
.drop-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.drop-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(99, 102, 241, 0.2);
}
.drop-zone-preview > i {
    font-size: 2rem;
    color: var(--accent-3);
}
.preview-info {
    flex: 1;
    text-align: left;
}
.preview-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}
.preview-size {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ---- Admin Page ---- */
.admin-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

.section-card { padding: 24px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 i {
    color: var(--accent-3);
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-3);
}

.add-form {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 0;
}
.add-form .form-group { margin-bottom: 8px; }
.add-form label { font-size: 0.8rem; }

.divider {
    height: 1px;
    background: var(--glass-border);
    margin: 20px 0;
}

.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
}
.data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}
.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.data-table td {
    padding: 10px 14px;
    font-size: 0.85rem;
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-avatar-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-3);
    flex-shrink: 0;
}
.user-avatar-sm.avatar-admin {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.role-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.role-admin {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.role-user {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.empty-cell {
    text-align: center;
    padding: 20px !important;
    color: var(--text-muted);
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    width: 90%;
    max-width: 440px;
    background: rgba(15, 15, 35, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(30px);
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
}
.modal-overlay.active .modal-card { transform: scale(1); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}
.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 i { color: var(--accent-3); }
.modal-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 4px; font-size: 1rem;
    transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-body .form-group { margin-bottom: 16px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html { font-size: 13px; }
    .nav-container { padding: 0 16px; gap: 16px; }
    .nav-link span { display: none; }
    .user-details { display: none; }
    .page-container { padding: 0 16px 32px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-row { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .search-wrapper { min-width: auto; }
    .form-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .upload-card { padding: 20px; }
    .drop-zone { padding: 32px 16px; }
    .login-card { padding: 32px 24px; }

    /* 文件表格移动端适配 */
    .file-table thead { display: none; }
    .file-table tbody tr {
        display: block;
        padding: 16px;
        margin-bottom: 8px;
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
    }
    .file-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none;
    }
    .file-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-right: 12px;
    }
    .file-name-cell { min-width: auto; }
    .file-name { max-width: 180px; }
    .desc-text { max-width: 180px; }
}

@media (max-width: 480px) {
    .flash-container { left: 16px; right: 16px; max-width: none; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }

/* ---- Selection ---- */
::selection {
    background: rgba(99, 102, 241, 0.4);
    color: white;
}
