/* ========================================
   PDF加密系统 - 主样式表
   现代、简洁、美观的设计
   ======================================== */

/* --- CSS Variables --- */
:root {
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1e2d;
    --bg-sidebar-hover: #2a2a3d;
    --bg-sidebar-active: linear-gradient(135deg, #667eea, #764ba2);
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    --border: #e5e7eb;
    --border-focus: #667eea;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --sidebar-width: 300px;
    --topbar-height: 64px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-tap-highlight-color: transparent;
}

button, a, [role="button"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn:active, .btn-icon-sm:active, .nav-item:active {
    transform: scale(0.96);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* --- Login Page --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 20s infinite linear;
    pointer-events: none;
}
@keyframes float {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.login-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    width: 100%;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
}
.login-decoration {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
}
.deco-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
}
.deco-1 {
    width: 150px;
    height: 150px;
    background: var(--primary);
    top: 0;
    right: 0;
    animation: pulse 4s infinite;
}
.deco-2 {
    width: 100px;
    height: 100px;
    background: var(--secondary);
    bottom: 0;
    left: 0;
    animation: pulse 6s infinite reverse;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header .logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(102,126,234,0.3);
}
.login-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.login-header .subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}
.login-form { margin-bottom: 20px; }
.input-group {
    position: relative;
    margin-bottom: 16px;
}
.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: #f9fafb;
    transition: var(--transition);
    box-sizing: border-box;
}
.input-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1);
}
.input-group input::placeholder { color: var(--text-light); }
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
}
.toggle-password:hover { color: var(--text-secondary); }
.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.4);
}
.btn-login:active { transform: translateY(0); }
.login-footer { text-align: center; }
.login-footer p { font-size: 12px; color: var(--text-light); }
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert svg { flex-shrink: 0; }

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}
.sidebar.collapsed { width: 64px; }
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-title { display: none; }
.sidebar-nav {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.6);
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: rgba(255,255,255,0.9);
}
.nav-item.active {
    background: var(--bg-sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar.collapsed .user-details { display: none; }
.version-info {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    flex-shrink: 0;
}
.sidebar.collapsed .version-info { display: none; }
.btn-logout {
    color: rgba(255,255,255,0.5);
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); }

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}
.sidebar.collapsed + .main-content { margin-left: 64px; }
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.menu-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    display: none;
}
.menu-toggle:hover { background: var(--bg); }
.page-title { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.top-bar-actions { display: flex; gap: 8px; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    min-width: 44px;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}
.btn-outline {
    background: #fff;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-link {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }
.btn-icon-danger:hover { color: var(--danger); background: #fef2f2; }
.btn-share {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
}
.btn-share:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* --- Content Body --- */
.content-body {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height));
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-body { display: flex; flex-direction: column; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* --- Card --- */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-table {
    overflow: visible;
}
.card-table > .card-body {
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 24px; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state svg { margin-bottom: 16px; }
.empty-state p { font-size: 15px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state .sub { font-size: 13px; color: var(--text-light); }
.empty-state .btn { margin-top: 16px; }

/* --- File List --- */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}
.file-item:hover { background: var(--bg); border-color: var(--border); }
.file-icon { flex-shrink: 0; display: flex; }
.file-info { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 14px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { display: block; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.file-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.file-status.encrypted { background: #ecfdf5; color: #065f46; }

/* --- Data Table --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
.data-table tr:active td { background: #f3f4f6; }
.cell-file { display: flex; align-items: center; gap: 10px; }
.cell-file span { font-weight: 500; }
.table-actions { display: flex; gap: 4px; align-items: center; }
.table-wrap { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.table-wrap .data-table th,
.table-wrap .data-table td { white-space: nowrap; }
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 140px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 4px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.dropdown-item:hover {
    background: #f3f4f6;
}
.dropdown-item svg {
    flex-shrink: 0;
    color: #6b7280;
}
.dropdown-item-danger {
    color: #ef4444;
}
.dropdown-item-danger:hover {
    background: #fef2f2;
}
.dropdown-item-danger svg {
    color: #ef4444;
}
.share-link-cell input {
    width: 200px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    background: #f9fafb;
    cursor: pointer;
}
.share-link-text {
    font-size: 12px;
    color: #6366f1;
    cursor: pointer;
    word-break: break-all;
    transition: color .15s;
}
.share-link-text:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: #eff6ff; color: #1e40af; }

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}
.modal-sm { max-width: 440px; }
.modal-lg { max-width: 800px; }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.upload-zone:hover { border-color: var(--primary); background: rgba(102,126,234,0.03); }
.upload-zone p { font-size: 14px; color: var(--text-secondary); margin-top: 12px; }
.upload-zone .upload-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.upload-zone .btn { margin-top: 16px; }
.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 13px;
}
.file-preview span.file-size { color: var(--text-light); }

/* --- Form Groups --- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="time"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    box-sizing: border-box;
    font-family: inherit;
}
.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-group small { display: block; margin-top: 4px; }

/* --- Settings Grid Cards --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    padding: 4px;
}
.settings-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.settings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.06);
}
.settings-card-icon {
    width: 64px;
    height: 64px;
    margin: 24px 24px 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.settings-card-body {
    padding: 20px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.settings-card-body h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}
.settings-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.info-row:last-child {
    border-bottom: none;
}
.info-label {
    font-size: 14px;
    color: #6b7280;
}
.info-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-form .form-group {
    margin-bottom: 0;
}
.settings-form .btn-sm {
    align-self: flex-start;
    padding: 8px 16px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .settings-card-icon {
        width: 56px;
        height: 56px;
        margin: 20px 20px 0;
    }
    .settings-card-body {
        padding: 16px 20px 20px;
    }
}

/* ===== 文件管理 - 分类侧边栏布局 ===== */
.files-manager-layout {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: visible;
    min-height: 500px;
}

.category-sidebar {
    width: 240px;
    min-width: 240px;
    background: #f8f9fb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.category-sidebar .category-header {
    padding: 16px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
}

.category-sidebar .category-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.category-sidebar .category-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 2px;
}

.category-item:hover {
    background: #eef0f5;
}

.category-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.category-item.active .cat-count {
    color: rgba(255,255,255,0.8);
}

.category-item.active .cat-btn {
    color: rgba(255,255,255,0.8);
}

.category-item.active .cat-btn:hover {
    color: #fff;
}

.cat-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cat-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-count {
    font-size: 11px;
    color: #9ca3af;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
    white-space: nowrap;
}

.cat-actions {
    display: none;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.category-item:hover .cat-actions {
    display: flex;
}

.cat-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.15s ease;
}

.cat-btn:hover {
    background: rgba(0,0,0,0.08);
    color: var(--text-primary);
}

.cat-btn-danger:hover {
    background: #fee2e2;
    color: #ef4444;
}

.category-loading, .category-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* 右侧文件面板 */
.files-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.files-panel-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.files-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.files-panel-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.files-count {
    font-size: 13px;
    color: #9ca3af;
}

.files-panel-actions {
    display: flex;
    gap: 8px;
}

/* btn-icon-sm */
.btn-icon-sm {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s ease;
}

.btn-icon-sm:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    .sidebar.show { transform: translateX(0); }
    .sidebar.collapsed { transform: translateX(-100%); }
    .main-content, .sidebar.collapsed + .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .top-bar { padding: 0 16px; }
    .content-body { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .share-link-cell input { width: 120px; }
    .login-container { 
        padding: 12px; 
        max-width: 100%;
    }
    .login-card { 
        padding: 28px 20px; 
        border-radius: 16px;
    }
    .login-header .logo {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }
    .login-header h1 {
        font-size: 20px;
    }
    .login-header .subtitle {
        font-size: 13px;
    }
    .input-group input {
        padding: 12px 14px 12px 44px;
        font-size: 14px;
    }
    .btn-login {
        padding: 13px;
        font-size: 15px;
    }
    .btn-icon-sm { width: 44px; height: 44px; }
    .table-actions { gap: 8px; }
    /* 表格容器 - 水平滚动 */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrap .data-table th,
    .table-wrap .data-table td { white-space: nowrap; }
    .card-body .table-wrap { margin: -8px -12px; padding: 8px 12px; }
    /* 弹窗 - 全屏 */
    .modal-overlay { padding: 0; align-items: flex-end; }
    .modal-overlay .modal,
    .modal-overlay .modal-sm,
    .modal-overlay .modal-lg {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }
    .modal .modal-header { padding: 16px 20px; }
    .modal .modal-body { padding: 20px; }
    .modal .modal-footer { padding: 14px 20px; }
    /* 预览弹窗 */
    #previewModal .modal { max-height: 100vh; border-radius: 0; }
    #previewModal .modal.preview-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
    }
    #previewModal .modal-body { height: calc(100vh - 57px); }
    #previewModal .preview-modal-body { padding: 0; height: calc(100vh - 57px); }
    /* 上传区域 */
    .upload-zone { padding: 24px 16px; }
    /* 二维码弹窗 */
    #qrModal .modal-body img { max-width: 200px !important; }
    
    .files-manager-layout {
        flex-direction: column;
    }
    .category-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .category-sidebar .category-list {
        max-height: 200px;
    }
    .files-panel-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .files-panel-actions {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .files-panel-actions .btn {
        width: 100%;
        justify-content: center;
    }
    /* 分享管理表格 */
    .share-link-cell input { width: 100%; min-width: 100px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* --- 小屏幕文件列表卡片式布局 --- */
@media (max-width: 640px) {
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr {
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    .data-table tr:last-child { border-bottom: none; }
    .data-table tr:hover td { background: transparent; }
    .data-table td {
        padding: 0;
        border: none;
        white-space: normal;
    }
    /* 复选框列 */
    .data-table td:first-child {
        width: auto;
        flex-shrink: 0;
    }
    /* 文件名列 */
    .data-table td:nth-child(2) {
        flex: 1;
        min-width: 0;
    }
    .data-table .cell-file span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* 大小 - 变为标签 */
    .data-table td:nth-child(3) {
        width: auto;
        flex-shrink: 0;
        font-size: 12px;
        color: var(--text-light);
        background: #f3f4f6;
        padding: 2px 8px;
        border-radius: 10px;
    }
    /* 时间 - 隐藏 */
    .data-table td:nth-child(4) {
        display: none;
    }
    /* 操作列 */
    .data-table td:last-child {
        width: 100%;
        margin-top: 4px;
    }
    .data-table .table-actions {
        justify-content: flex-start;
        gap: 4px;
    }
    .data-table .btn-icon {
        width: 36px;
        height: 36px;
    }
    .fm-toolbar {
        padding: 8px 12px;
        gap: 8px;
    }
    .fm-search {
        max-width: 100%;
    }
    .login-card {
        padding: 24px 16px;
        border-radius: 14px;
    }
    .login-header .logo {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
    }
    .login-header h1 {
        font-size: 18px;
    }
    .login-header .subtitle {
        font-size: 12px;
    }
    .input-group {
        margin-bottom: 14px;
    }
    .input-group input {
        padding: 11px 12px 11px 40px;
        font-size: 14px;
    }
    .btn-login {
        padding: 12px;
        font-size: 14px;
    }
    .login-decoration {
        display: none;
    }
}

/* --- Print Protection --- */
@media print {
    body { display: none !important; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* --- Category Select in File Table --- */
.cat-select {
    width: 100%;
    min-width: 90px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 6px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.cat-select:hover { border-color: var(--primary); }
.cat-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(102,126,234,0.15); }

/* --- PDF Preview Modal --- */
#previewModal .modal.preview-modal {
    max-width: 900px;
    width: 70vw;
    max-height: 80vh;
    height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}
#previewModal .preview-modal-body {
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- Table Footer & Pagination --- */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #fafafa;
    flex-wrap: wrap;
    gap: 12px;
}
.table-footer-info {
    font-size: 13px;
    color: var(--text-light);
}
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    cursor: default;
}
.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    color: var(--text-light);
}
.page-btn.disabled:hover {
    border-color: var(--border);
    color: var(--text-light);
}
.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-size: 13px;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .table-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .pagination {
        justify-content: center;
    }
    .table-footer-info {
        text-align: center;
    }
}

/* --- QR Modal --- */
#qrModal .modal-body img {
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    background: #fff;
}
#qrModal .modal-body a {
    text-decoration: none;
}
#qrModal .modal-body a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* --- Toast --- */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

/* --- Cover Upload --- */
.cover-upload-area {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}
.cover-upload-area:hover {
    border-color: #6366f1;
    background: #f0f1ff;
}
.cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 8px;
    color: #9ca3af;
}
.cover-placeholder span {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
}
.cover-placeholder small {
    font-size: 12px;
    color: #9ca3af;
}
.cover-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cover-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.cover-remove-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* ===== 封面图片库 ===== */
.cover-actions {
    margin-top: 8px;
}
.cover-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px;
}
.cover-library-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
    background: #f9fafb;
}
.cover-library-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}
.cover-library-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}
.cover-library-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-library-info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cover-library-name {
    font-size: 12px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.cover-library-meta {
    font-size: 11px;
    color: #9ca3af;
}
.cover-library-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    padding: 0;
}
.cover-library-item:hover .cover-library-delete {
    opacity: 1;
}
.cover-library-delete:hover {
    background: #ef4444;
}

/* ===== 文件管理器新样式 ===== */
.file-manager-container {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-height: 600px;
    flex: 1;
}

.fm-sidebar {
    width: 300px;
    min-width: 300px;
    background: #f8f9fb;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.fm-sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.fm-sidebar-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.fm-sidebar-header .btn {
    padding: 6px 10px;
    font-size: 12px;
}

.fm-folder-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.fm-sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.fm-tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    margin-bottom: 2px;
}

.fm-tree-item:hover {
    background: #eef0f5;
}

.fm-tree-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.fm-tree-item.active .fm-tree-count {
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
}

.fm-tree-bottom {
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
}

.fm-tree-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
    opacity: 1;
}

.fm-tree-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
}

.fm-tree-action-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #374151;
}

.fm-tree-item.active .fm-tree-action-btn {
    color: rgba(255,255,255,0.9);
}

.fm-tree-item.active .fm-tree-action-btn:hover {
    background: rgba(255,255,255,0.2);
}

.fm-tree-action-delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.fm-tree-bottom:hover {
    background: #eef0f5;
}

.fm-tree-bottom.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.fm-tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    flex-shrink: 0;
}

.fm-tree-toggle svg {
    transition: transform 0.2s ease;
}

.fm-tree-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.fm-tree-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-tree-count {
    font-size: 11px;
    color: #9ca3af;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,0.06);
    white-space: nowrap;
    flex-shrink: 0;
}

.fm-tree-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 4px;
}

.fm-tree-children {
    overflow: hidden;
}

.fm-tree-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.fm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fm-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: #fff;
    flex-wrap: wrap;
}

.fm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.fm-breadcrumb-item {
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.fm-breadcrumb-item:hover {
    background: var(--bg);
    color: var(--primary);
}

.fm-breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
}

.fm-breadcrumb-item.active:hover {
    background: none;
    color: var(--text-primary);
}

.fm-breadcrumb-sep {
    color: #d1d5db;
    font-size: 12px;
}

.fm-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.fm-search svg {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    pointer-events: none;
}

.fm-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: #f9fafb;
    transition: all 0.15s ease;
}

.fm-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.fm-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.btn-danger-outline {
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger-outline:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

.fm-content {
    flex: 1;
    overflow: auto;
}

.fm-content .card {
    height: 100%;
}

/* 复选框样式 */
.fm-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.fm-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.fm-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    transition: all 0.15s ease;
    position: relative;
}

.fm-checkbox:hover input ~ .fm-checkmark {
    border-color: var(--primary);
}

.fm-checkbox input:checked ~ .fm-checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.fm-checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fm-checkbox input:checked ~ .fm-checkmark::after {
    display: block;
}

.fm-checkbox input:indeterminate ~ .fm-checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.fm-checkbox input:indeterminate ~ .fm-checkmark::after {
    display: block;
    left: 3px;
    top: 6px;
    width: 10px;
    height: 2px;
    border: none;
    background: white;
    transform: none;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 4px;
    z-index: 9999;
    display: none;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.context-menu-item:hover {
    background: #f3f4f6;
}

.context-menu-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.context-menu-danger {
    color: var(--danger);
}

.context-menu-danger:hover {
    background: #fef2f2;
}

.context-menu-danger svg {
    color: var(--danger);
}

/* 移动文件夹树 */
.fm-move-tree {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.fm-move-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.fm-move-item:hover {
    background: #f3f4f6;
}

.fm-move-item.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
}

.fm-move-item.selected svg {
    color: #fff;
}

/* 版本管理 */
.fm-version-list {
    max-height: 400px;
    overflow-y: auto;
}

.fm-version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.15s ease;
}

.fm-version-item:hover {
    border-color: var(--primary);
}

.fm-version-item.latest {
    border-color: #10b981;
    background: #f0fdf4;
}

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

.fm-version-number {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.fm-version-number svg {
    color: var(--primary);
}

.fm-version-item.latest .fm-version-number svg {
    color: #10b981;
}

.fm-version-number span {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.fm-version-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #10b981;
    color: #fff;
    font-weight: 500;
}

.fm-version-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.fm-version-loading,
.fm-version-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .file-manager-container {
        flex-direction: column;
    }

    .fm-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 250px;
    }

    .fm-toolbar {
        padding: 10px 12px;
        gap: 10px;
    }

    .fm-breadcrumb {
        width: 100%;
        order: 1;
    }

    .fm-search {
        order: 2;
        max-width: 100%;
        width: 100%;
    }

    .fm-toolbar-actions {
        order: 3;
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .fm-toolbar-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .batch-actions {
        width: 100%;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: 8px;
        flex-wrap: wrap;
    }

    .batch-actions .btn {
        flex: 1;
        min-width: 100px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

.shares-header {
    margin-bottom: 28px;
}

.shares-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.shares-header-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

.shares-stats-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 20px;
}

.share-stat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.share-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.share-stat-card:hover::before {
    opacity: 1;
}

.share-stat-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.share-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.share-stat-icon svg {
    width: 18px;
    height: 18px;
}

.share-stat-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.share-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.share-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shares-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #fff;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.shares-toolbar-left,
.shares-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shares-selected-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.shares-selected-count strong {
    color: var(--primary);
    font-weight: 600;
    margin: 0 2px;
}

.share-card-select {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-card:hover .share-card-select,
.share-card:has(.share-checkbox:checked) .share-card-select {
    opacity: 1;
}

.shares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.share-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
}

.share-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.share-card:hover::before {
    opacity: 1;
}

.share-card:hover {
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.12), 0 8px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-6px);
    border-color: rgba(102, 126, 234, 0.15);
}

.share-card-cover {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: linear-gradient(135deg, #fafbfc 0%, #f3f4f6 100%);
    border-radius: 20px 20px 0 0;
}

.share-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-card:hover .share-card-cover img {
    transform: scale(1.08);
}

.share-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.share-card-cover-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.share-card:hover .share-card-cover-placeholder svg {
    opacity: 0.7;
    transform: scale(1.1);
}

.share-card-status {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.share-card-status .badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-card-body {
    padding: 20px;
}

.share-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.share-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 18px;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 12px 14px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.share-card:hover .share-card-desc {
    border-left-color: #764ba2;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.share-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.share-card-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 500;
    transition: all 0.2s ease;
}

.share-card-info-icon {
    color: #6366f1;
    flex-shrink: 0;
}

.share-access-type.access-public {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.share-access-type.access-public .share-card-info-icon {
    color: #22c55e;
}

.share-access-type.access-password {
    background: linear-gradient(135deg, #ffedd5, #fed7aa);
    color: #9a3412;
}

.share-access-type.access-password .share-card-info-icon {
    color: #f97316;
}

.share-access-type.access-email {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.share-access-type.access-email .share-card-info-icon {
    color: #3b82f6;
}

.share-access-type.access-phone {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5b21b6;
}

.share-access-type.access-phone .share-card-info-icon {
    color: #8b5cf6;
}

.share-card-url {
    margin-bottom: 18px;
    position: relative;
}

.share-card-url input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 12px;
    color: #64748b;
    background: linear-gradient(135deg, #fefefe 0%, #f8fafc 100%);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    transition: all 0.3s ease;
    cursor: pointer;
}

.share-card-url input:hover {
    border-color: #cbd5e1;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.share-card-url input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    background: #fff;
}

.share-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.share-card-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 10px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.share-card-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.share-card-action-btn svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.share-card-action-btn span {
    position: relative;
    z-index: 1;
}

.share-card-action-btn:hover {
    color: #fff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}

.share-card-action-btn:hover::before {
    opacity: 1;
}

.share-card-action-btn:hover svg {
    transform: scale(1.15);
}

.share-card-action-delete::before {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.share-card-action-delete:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.shares-pagination {
    margin-top: 36px;
    text-align: center;
}

@media (max-width: 768px) {
    .shares-toolbar {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .shares-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .share-card-cover {
        height: 160px;
    }
    
    .share-card-body {
        padding: 16px;
    }
    
    .share-card-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .share-card-action-btn {
        flex-direction: row;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .share-card-action-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ==================== 分享限制标签 ==================== */
.share-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}
.share-tab {
    flex: 1;
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
}
.share-tab:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px 8px 0 0;
}
.share-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.share-tab-content {
    display: none;
    animation: tabFadeIn 0.25s ease;
}
.share-tab-content.active {
    display: block;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .share-tabs {
        margin-bottom: 16px;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0;
        border-bottom: none;
        padding-bottom: 8px;
    }
    .share-tab {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 13px;
        border-bottom: none;
        border-radius: 8px;
        white-space: nowrap;
    }
    .share-tab.active {
        border-bottom: none;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: #fff;
    }
    .share-tab:hover {
        border-radius: 8px;
    }
}

.restrict-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #eff6ff;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #1e40af;
}
.restrict-hint svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.share-card-restrictions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}
.restriction-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
    transition: all 0.2s ease;
}
.restriction-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.restriction-tag.tag-blocked {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.restriction-tag.tag-time {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.restriction-tag.tag-daily {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}
.restriction-tag.tag-session {
    background: #faf5ff;
    color: #6b21a8;
    border-color: #e9d5ff;
}

/* ==================== 数据分析页面 ==================== */
.analytics-header {
    margin-bottom: 24px;
}
.analytics-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}
.analytics-header-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 6px 0 0;
}

.analytics-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.analytics-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.analytics-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
.analytics-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.analytics-stat-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.analytics-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}
.analytics-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}
.analytics-stat-trend {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.analytics-chart-section {
    margin-bottom: 24px;
}
.analytics-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 240px;
    padding: 10px 0;
}
.analytics-chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
    min-width: 0;
}
.analytics-chart-bar-fill {
    width: 70%;
    max-width: 40px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 6px 6px 0 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4px;
    position: relative;
}
.analytics-chart-bar:hover .analytics-chart-bar-fill {
    background: linear-gradient(180deg, #764ba2, #667eea);
    box-shadow: 0 0 12px rgba(102, 126, 234, 0.4);
}
.analytics-chart-bar-value {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}
.analytics-chart-bar-label {
    font-size: 10px;
    color: var(--text-light);
    margin-top: 6px;
    white-space: nowrap;
}

.analytics-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.analytics-ranking {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ranking-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.ranking-num.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.ranking-num.rank-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.ranking-num.rank-3 { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.ranking-content {
    flex: 1;
    min-width: 0;
}
.ranking-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.ranking-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
.ranking-views {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.ranking-bar {
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.ranking-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.ranking-bar-fill.access-public { background: linear-gradient(90deg, #22c55e, #16a34a); }
.ranking-bar-fill.access-password { background: linear-gradient(90deg, #f97316, #ea580c); }
.ranking-bar-fill.access-email { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.ranking-bar-fill.access-phone { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.ranking-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-light);
}
.ranking-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.ranking-type.access-public { background: #dcfce7; color: #166534; }
.ranking-type.access-password { background: #ffedd5; color: #9a3412; }
.ranking-type.access-email { background: #dbeafe; color: #1e40af; }
.ranking-type.access-phone { background: #ede9fe; color: #5b21b6; }

.analytics-type-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.analytics-type-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.analytics-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.analytics-type-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.analytics-type-num {
    font-size: 12px;
    color: var(--text-secondary);
}
.analytics-type-progress {
    height: 10px;
    background: #f1f5f9;
    border-radius: 5px;
    overflow: hidden;
}
.analytics-type-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}
.analytics-type-percent {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    align-self: flex-end;
}

.analytics-log-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: normal;
}
.analytics-log-table {
    display: flex;
    flex-direction: column;
}
.analytics-log-header,
.analytics-log-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1.2fr 1.5fr 1.3fr;
    gap: 12px;
    padding: 12px 20px;
    align-items: center;
}
.analytics-log-header {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.analytics-log-row {
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.2s ease;
}
.analytics-log-row:hover {
    background: #f8fafc;
}
.analytics-log-row:last-child {
    border-bottom: none;
}
.al-col-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.al-col-ip {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}
.al-col-ua {
    font-size: 12px;
    color: var(--text-secondary);
}
.al-col-time {
    font-size: 12px;
    color: var(--text-light);
}
.log-type-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.log-type-tag.access-public { background: #dcfce7; color: #166534; }
.log-type-tag.access-password { background: #ffedd5; color: #9a3412; }
.log-type-tag.access-email { background: #dbeafe; color: #1e40af; }
.log-type-tag.access-phone { background: #ede9fe; color: #5b21b6; }

@media (max-width: 1400px) {
    .shares-stats-grid {
        flex-wrap: wrap;
    }
    .share-stat-card {
        flex: 0 0 calc(25% - 8px);
    }
}

@media (max-width: 1024px) {
    .shares-stats-grid {
        flex-wrap: wrap;
    }
    .share-stat-card {
        flex: 0 0 calc(33.333% - 7px);
    }
    .analytics-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .analytics-two-col {
        grid-template-columns: 1fr;
    }
    .analytics-log-header,
    .analytics-log-row {
        grid-template-columns: 1.5fr 0.8fr 1fr 1.2fr 1fr;
        font-size: 12px;
    }
}
@media (max-width: 768px) {
    .shares-stats-grid {
        flex-wrap: wrap;
        gap: 10px;
    }
    .share-stat-card {
        flex: 1 1 calc(33.333% - 7px);
        min-width: 0;
        padding: 12px 8px;
        gap: 8px;
        flex-direction: column;
        text-align: center;
    }
    .share-stat-card:nth-last-child(-n+2) {
        flex: 1 1 calc(50% - 5px);
    }
    .share-stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .share-stat-icon svg {
        width: 16px;
        height: 16px;
    }
    .share-stat-num {
        font-size: 17px;
    }
    .share-stat-label {
        font-size: 11px;
    }
    .analytics-overview-grid {
        grid-template-columns: 1fr;
    }
    .analytics-stat-card {
        padding: 16px;
    }
    .analytics-stat-num {
        font-size: 22px;
    }
    .analytics-chart {
        height: 180px;
        gap: 4px;
    }
    .analytics-chart-bar-label {
        font-size: 9px;
    }
    .analytics-log-header {
        display: none;
    }
    .analytics-log-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 14px 16px;
    }

    /* 图片库管理 */
    .image-library-stats { flex-wrap: wrap; gap: 10px; }
    .image-library-stats .stat-card { flex: 1 1 calc(50% - 5px); min-width: 130px; padding: 14px 16px !important; }
    .image-library-container { padding: 20px !important; }
    #imageLibraryGrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 14px !important; }
}

@media (max-width: 480px) {
    .shares-stats-grid {
        gap: 8px;
    }
    .share-stat-card {
        flex: 0 0 calc(50% - 4px);
        flex-direction: row;
        text-align: left;
        padding: 12px 12px;
        justify-content: flex-start;
    }
    .share-stat-icon {
        width: 36px;
        height: 36px;
    }
    .share-stat-num {
        font-size: 18px;
    }
    .share-stat-label {
        font-size: 11px;
    }
}

/* ==================== 超小屏幕适配 (<=480px) ==================== */
@media (max-width: 480px) {
    /* 顶栏 */
    .top-bar { padding: 0 12px; height: 56px; }
    .page-title { font-size: 16px; }
    .menu-toggle { padding: 6px; }
    .menu-toggle svg { width: 22px; height: 22px; }
    .top-bar-actions .btn { padding: 8px 12px; font-size: 13px; min-height: 40px; }
    .top-bar-actions .btn svg { width: 16px; height: 16px; }
    .top-bar-actions .btn span { display: none; }

    /* 内容区 */
    .content-body { padding: 12px; }

    /* 侧边栏 */
    .sidebar { width: 260px !important; }
    .sidebar-header { padding: 16px; }
    .sidebar-logo { width: 32px; height: 32px; }
    .sidebar-title { font-size: 15px; }
    .nav-item { padding: 11px 10px; font-size: 14px; }
    .nav-item svg { width: 18px; height: 18px; }

    /* 统计卡片 */
    .stats-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
    .stat-card { padding: 16px; gap: 12px; border-radius: 12px; }
    .stat-icon { width: 44px; height: 44px; border-radius: 12px; }
    .stat-icon svg { width: 20px; height: 20px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 12px; }

    /* 卡片 */
    .card { border-radius: 12px; }
    .card-header { padding: 14px 16px; }
    .card-header h3 { font-size: 15px; }
    .card-body { padding: 14px 16px; }

    /* 按钮 */
    .btn { padding: 10px 16px; font-size: 13px; min-height: 40px; }
    .btn-sm { padding: 7px 12px; font-size: 12px; min-height: 34px; }
    .btn-icon-sm { width: 40px; height: 40px; }
    .btn-icon { padding: 5px; }
    .btn-icon svg { width: 18px; height: 18px; }

    /* 表格 */
    .data-table { font-size: 12px; }
    .data-table tr { padding: 10px 12px; gap: 6px; }

    /* 弹窗 */
    .modal-overlay { padding: 0; }
    .modal { max-width: 100% !important; max-height: 94vh; border-radius: 14px 14px 0 0; }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 15px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; gap: 8px; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1; min-width: 100px; }
    .modal-close { width: 28px; height: 28px; font-size: 20px; }

    /* 上传区域 */
    .upload-zone { padding: 20px 14px; border-radius: 12px; }
    .upload-zone svg { width: 36px; height: 36px; }

    /* 表单 */
    .form-group input, .form-group select, .form-group textarea {
        padding: 10px 12px; font-size: 14px;
    }

    /* 分享卡片 */
    .share-card-actions { grid-template-columns: 1fr; gap: 8px; }
    .share-card-action-btn { padding: 10px; font-size: 13px; }

    /* 分享统计 */
    .share-stat-card { padding: 10px; gap: 8px; flex: 1 1 calc(50% - 4px); }
    .share-stat-card:last-child { flex: 1 1 100%; }
    .share-stat-icon { width: 32px; height: 32px; border-radius: 8px; }
    .share-stat-num { font-size: 16px; }

    /* 数据分析 */
    .analytics-header h3 { font-size: 19px; }
    .analytics-stat-card { padding: 14px; gap: 12px; border-radius: 12px; }
    .analytics-stat-icon { width: 44px; height: 44px; border-radius: 12px; }
    .analytics-stat-num { font-size: 20px; }
    .analytics-chart { height: 150px; gap: 3px; }
    .analytics-chart-bar-label { font-size: 8px; }
    .analytics-log-row { padding: 12px 14px; }

    /* 封面库 */
    .cover-library-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

    /* 图片库管理 */
    .image-library-stats { flex-wrap: wrap; gap: 12px; }
    .image-library-stats .stat-card { flex: 1 1 calc(50% - 6px); min-width: 140px; }
    .image-library-container { padding: 16px !important; }
    #imageLibraryGrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 12px !important; }

    /* 分页 */
    .page-btn { min-width: 36px; height: 36px; padding: 6px 10px; font-size: 13px; }
    .page-dots { min-width: 28px; height: 36px; font-size: 12px; }

    /* 登录页 */
    .login-container { padding: 10px; }
    .login-card { padding: 24px 18px; border-radius: 16px; }
    .login-header { margin-bottom: 22px; }
    .login-header .logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 10px; }
    .login-header .logo svg { width: 24px; height: 24px; }
    .login-header h1 { font-size: 19px; }
    .login-header .subtitle { font-size: 12px; }
    .input-group { margin-bottom: 12px; }
    .input-group input { padding: 11px 12px 11px 40px; font-size: 14px; border-radius: 10px; }
    .input-icon { left: 12px; }
    .input-icon svg { width: 18px; height: 18px; }
    .toggle-password { right: 10px; }
    .btn-login { padding: 12px; font-size: 14px; border-radius: 10px; }
    .alert { padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
    .login-footer p { font-size: 11px; }
    .login-decoration { top: -60px; right: -60px; width: 150px; height: 150px; }
    .deco-1 { width: 110px; height: 110px; }
    .deco-2 { width: 75px; height: 75px; }

    /* 文件管理器 */
    .files-manager-layout { min-height: 400px; }
    .category-sidebar .category-list { max-height: 160px; }
    .files-panel-header { padding: 12px 14px; gap: 6px; }
    .files-panel-title h3 { font-size: 14px; }
    .files-panel-actions { gap: 6px; }
    .files-panel-actions .btn { font-size: 12px; padding: 8px 10px; }
}

/* ==================== 极小屏幕适配 (<=360px) ==================== */
@media (max-width: 360px) {
    .top-bar { padding: 0 10px; }
    .page-title { font-size: 15px; }
    .content-body { padding: 10px; }
    .stats-grid { gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 40px; height: 40px; }
    .stat-value { font-size: 20px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 12px 14px; }
    .modal-body { padding: 14px; }
    .modal-footer { padding: 10px 14px; }
    .login-card { padding: 20px 16px; }
    .login-header .logo { width: 48px; height: 48px; }
    .login-header h1 { font-size: 17px; }
    .share-stat-card { flex: 0 0 100%; }
    .analytics-chart { height: 120px; }
    .cover-library-grid { grid-template-columns: 1fr; }
}
