:root {
    --primary: #4361ee;
    --primary-hover: #3a56d4;
    --primary-bg: #eef2ff;
    --bg: #f8f9fc;
    --card: #ffffff;
    --border: #e8ecf1;
    --border-light: #f1f3f8;
    --text: #1e2a3b;
    --text-secondary: #5a6a85;
    --text-muted: #8c97a8;
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;
    --sidebar-w: 240px;
    --header-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: none; }

/* ===== 侧边栏 - 白色极简风 ===== */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--card);
    border-right: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-light);
}
.sidebar-brand .brand-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.sidebar-brand .brand-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.2px;
}
.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.2;
}

.sidebar-nav { padding: 12px 8px; flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: var(--text-secondary);
    font-size: 13.5px;
    border-radius: 8px;
    transition: all .15s;
    margin-bottom: 1px;
    font-weight: 450;
}
.sidebar-nav a:hover {
    background: var(--bg);
    color: var(--text);
}
.sidebar-nav a.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}
.sidebar-nav a .nav-icon {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav a .nav-icon svg { width: 18px; height: 18px; }
.sidebar-nav a.active .nav-icon { opacity: 1; }

.nav-group-label {
    padding: 16px 12px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .5px;
    text-transform: uppercase;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border-light);
}
.sidebar-footer a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; color: var(--text-muted);
    font-size: 13px; border-radius: 8px;
    transition: all .15s;
}
.sidebar-footer a:hover { background: var(--danger-bg); color: var(--danger); }

/* ===== 主内容区 ===== */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.top-header {
    height: var(--header-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.top-header .page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.top-header .header-right {
    display: flex; align-items: center; gap: 16px;
}
.top-header .user-info {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 8px;
}
.top-header .user-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}
.top-header .breadcrumb-nav {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-muted);
}
.top-header .breadcrumb-nav span { color: var(--text); font-weight: 500; }

.content-body { padding: 24px 28px; }

/* ===== 统计卡片 ===== */
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.04); }
.stat-card .stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-top: 12px;
    line-height: 1;
}
.stat-card .stat-value .unit {
    font-size: 13px; font-weight: 400; color: var(--text-muted); margin-left: 2px;
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.stat-card .stat-change {
    font-size: 11px; margin-top: 8px; font-weight: 500;
}
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* ===== 卡片 ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 14px;
    background: transparent;
}
.card-body { padding: 20px; }

/* ===== 表格 ===== */
.table { font-size: 13px; margin-bottom: 0; }
.table thead th {
    background: #fafbfd;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    white-space: nowrap;
}
.table tbody td {
    padding: 11px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfd; }

/* ===== 状态标签 ===== */
.badge-status {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
}
.badge-draft       { background: #f1f5f9; color: #64748b; }
.badge-pending-pay  { background: var(--warning-bg); color: #b45309; }
.badge-pending-review { background: var(--info-bg); color: #1d4ed8; }
.badge-wechat-review  { background: #faf5ff; color: #7c3aed; }
.badge-pending-sign   { background: #ecfdf5; color: #059669; }
.badge-completed      { background: var(--success-bg); color: #15803d; }
.badge-rejected       { background: var(--danger-bg); color: #b91c1c; }

/* ===== 表单 ===== */
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 5px;
}
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    padding: 8px 12px;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}
.form-control::placeholder { color: var(--text-muted); }

/* ===== 按钮 ===== */
.btn {
    font-size: 13px;
    border-radius: 7px;
    padding: 7px 16px;
    font-weight: 500;
    transition: all .15s;
}
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline-secondary { border-color: var(--border); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); border-color: var(--border); }

/* ===== 快捷入口 ===== */
.quick-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: color .15s;
}
.quick-link:last-child { border-bottom: none; }
.quick-link:hover { color: var(--primary); }
.quick-link .arrow { color: var(--text-muted); font-size: 16px; }

/* ===== Flash 消息 ===== */
.flash-message {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 9999;
    min-width: 280px;
    animation: slideIn .3s ease;
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.flash-message .alert { border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.08); font-size: 13px; }

/* ===== 登录/注册 ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.auth-card {
    width: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 24px rgba(0,0,0,.04);
}
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-card .subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

/* ===== 步骤条 ===== */
.steps {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    counter-reset: step;
}
.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding-top: 36px;
    font-size: 12px;
    color: var(--text-muted);
}
.step-item::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}
.step-item.active::before { background: var(--primary); color: #fff; }
.step-item.done::before { background: var(--success); color: #fff; content: '✓'; }
.step-item.active { color: var(--primary); font-weight: 500; }
.step-item.done { color: var(--success); }
.step-item + .step-item::after {
    content: '';
    position: absolute;
    top: 12px;
    left: -50%; right: 50%;
    height: 2px;
    background: var(--border);
}
.step-item.done + .step-item::after,
.step-item.active + .step-item::after { background: var(--success); }

/* ===== 文件上传 ===== */
.upload-preview {
    width: 120px; height: 90px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s;
    background: #fafbfc;
}
.upload-preview:hover { border-color: var(--primary); }
.upload-preview img { max-width: 100%; max-height: 100%; object-fit: cover; }

/* ===== 时间线 ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 8px; top: 4px; bottom: 4px;
    width: 2px;
    background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px; top: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
}
.timeline-item.active::before { background: var(--primary); }
.timeline-item .time { font-size: 12px; color: var(--text-muted); }

.status-timeline { position: relative; padding-left: 24px; }
.status-timeline .timeline-item {
    position: relative;
    padding-bottom: 24px;
    padding-left: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.status-timeline .timeline-item:last-child { padding-bottom: 0; }
.status-timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: -16px; top: 28px; bottom: -4px;
    width: 2px;
    background: var(--border);
}
.status-timeline .timeline-item:last-child::before { display: none; }
.timeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    margin-top: 5px;
    position: relative;
    z-index: 1;
}
.timeline-dot.done { background: var(--primary); }
.timeline-dot.dot-rejected { background: var(--danger); }
.timeline-dot.dot-success { background: var(--success); }

/* ===== 健康度指示器 ===== */
.health-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.health-item:last-child { border-bottom: none; }
.health-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.health-dot.ok { background: var(--success); }
.health-dot.warn { background: var(--warning); }
.health-dot.err { background: var(--danger); }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .empty-icon {
    width: 48px; height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.empty-state .empty-icon svg { width: 22px; height: 22px; }

/* ===== 响应式 ===== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
@media (max-width: 576px) {
    .auth-card { width: 90%; padding: 28px; }
    .content-body { padding: 16px; }
}
