:root {
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.08);
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* ---- 登录页 ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d9488 0%, #0369a1 100%);
}
.login-card {
    background: var(--card);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 48px 40px;
    width: 380px;
    max-width: 90vw;
}
.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 4px;
}
.login-card .subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 32px;
}
.login-card .form-control {
    padding: 12px 16px;
    border-radius: 8px;
}
.login-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
}

/* ---- 管理后台 ---- */
.admin-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header .brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-header .brand i { color: var(--primary); font-size: 22px; }

.admin-body { padding: 28px; max-width: 1200px; margin: 0 auto; }

/* 统计卡片 */
.stat-row { display: flex; gap: 16px; margin-bottom: 28px; }
.stat-card {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.stat-card .stat-num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* 工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.toolbar .search-box {
    flex: 1;
    position: relative;
}
.toolbar .search-box i {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
}
.toolbar .search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--card);
}
.toolbar .search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,148,136,.12);
}

/* 文档表格 */
.doc-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.doc-table { width: 100%; border-collapse: collapse; }
.doc-table thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.doc-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover { background: var(--primary-light); }

.doc-title-cell { font-weight: 600; color: var(--text); }
.doc-title-cell small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; }
.project-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.views-count { color: var(--muted); font-size: 13px; }
.views-count i { margin-right: 4px; }

.action-btns { display: flex; gap: 6px; }
.action-btns .btn {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
}
.action-btns .btn:hover { border-color: var(--primary); color: var(--primary); }
.action-btns .btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: #cbd5e1; }

/* ---- 上传页 ---- */
.upload-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 680px;
    margin: 0 auto;
}
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    margin-bottom: 24px;
}
.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.drop-zone i { font-size: 36px; color: var(--primary); margin-bottom: 12px; }
.drop-zone p { margin: 0; color: var(--muted); font-size: 14px; }
.drop-zone .filename { color: var(--primary); font-weight: 600; }

.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control, .form-select { border-radius: 8px; padding: 10px 14px; }

/* ---- 客户端查看页 ---- */
.view-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.view-header .doc-info { display: flex; align-items: center; gap: 12px; }
.view-header .doc-info h5 { margin: 0; font-size: 16px; font-weight: 600; }
.view-header .doc-info .project-tag {
    font-size: 12px; color: var(--muted);
    background: #f1f5f9; padding: 2px 8px; border-radius: 4px;
}
.view-frame { width: 100%; border: none; height: calc(100vh - 56px); }

/* Toast */
.toast-msg {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--text); color: #fff;
    padding: 12px 20px; border-radius: 8px;
    font-size: 14px; z-index: 9999;
    animation: slideUp .3s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* ======================== 科技感表头预览（设置页用） ========================
.tech-header-preview {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 35%, #0c4a6e 70%, #0f172a 100%);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.tech-header-preview::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #00e0ff 20%, #7c3aed 50%, #00e0ff 80%, transparent);
}
.tech-header-preview .th-logo { height: 30px; filter: drop-shadow(0 0 4px rgba(0,224,255,.3)); }
.tech-header-preview .th-logo-placeholder {
    width: 30px; height: 30px; border-radius: 6px;
    background: linear-gradient(135deg, rgba(0,224,255,.15), rgba(124,58,237,.15));
    border: 1px solid rgba(0,224,255,.3);
    display: inline-flex; align-items: center; justify-content: center;
    color: #00e0ff; font-size: 15px;
}
.tech-header-preview .th-company {
    color: #e0f2fe; font-weight: 700; font-size: 15px; letter-spacing: 1px;
}
.tech-header-preview .th-info { color: #cbd5e1; font-size: 12px; }
.tech-header-preview .th-info i { color: #00e0ff; margin-right: 3px; }