/* =============================================================
   AHP-FCE 综合评价系统 - 主样式
   纯原生 + HTML5 + 响应式
   ============================================================= */

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

:root {
    /* 品牌色 — OKLCH 感知均匀色彩空间 */
    --primary: oklch(0.55 0.18 265);
    --primary-dark: oklch(0.45 0.17 265);
    --primary-light: oklch(0.92 0.04 265);
    --primary-glow: oklch(0.55 0.18 265 / 0.15);
    --success: oklch(0.55 0.18 155);
    --success-light: oklch(0.92 0.04 155);
    --danger: oklch(0.55 0.22 30);
    --danger-light: oklch(0.92 0.05 30);
    --warning: oklch(0.65 0.18 85);
    --warning-light: oklch(0.94 0.05 85);
    --info: oklch(0.55 0.15 220);
    --info-light: oklch(0.92 0.04 220);

    /* 中性色 — 暖色调灰，不冰冷 */
    --gray-50: oklch(0.985 0.005 80);
    --gray-100: oklch(0.96 0.007 80);
    --gray-200: oklch(0.92 0.01 80);
    --gray-300: oklch(0.85 0.015 80);
    --gray-400: oklch(0.72 0.02 80);
    --gray-500: oklch(0.6 0.025 80);
    --gray-600: oklch(0.45 0.03 80);
    --gray-700: oklch(0.35 0.03 80);
    --gray-800: oklch(0.25 0.025 80);
    --gray-900: oklch(0.15 0.02 80);

    /* 字体 — 有性格但不花哨 */
    --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
    --font-brand: "Sora", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;

    /* 间距系统 — 8px 基数 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --space-8: 48px;
    --space-9: 64px;

    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* 阴影 */
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.05);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.08);
    --shadow-lg: 0 8px 30px oklch(0 0 0 / 0.12);
    --shadow-xl: 0 20px 60px oklch(0 0 0 / 0.15);

    /* 过渡 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

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

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

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

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

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.container-sm {
    max-width: 600px;
}

.container-md {
    max-width: 900px;
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
}

.btn-info {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.btn-info:hover {
    background: #0e7490;
    border-color: #0e7490;
}

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1.0625rem;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.5;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: #15803d; }
.badge-danger { background: var(--danger-light); color: #b91c1c; }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-info { background: var(--info-light); color: #0e7490; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.alert-success {
    background: var(--success-light);
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--warning-light);
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

/* ---- Cards ---- */
.card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.card-header h2 {
    margin-bottom: 0;
}

.card-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 16px;
    margin-top: 16px;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--gray-700);
    font-size: 0.9375rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-family: inherit;
    transition: border-color 0.15s ease;
    background: #fff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

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

.form-hint {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.form-error {
    font-size: 0.8125rem;
    color: var(--danger);
    margin-top: 2px;
}

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

.form-select {
    cursor: pointer;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

table th,
table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

table tr:hover {
    background: var(--gray-50);
}

table .actions {
    white-space: nowrap;
    text-align: right;
}

table .actions .btn {
    margin-left: 4px;
}

/* ---- Navbar ---- */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.navbar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.navbar-brand:hover {
    text-decoration: none;
    color: var(--primary);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.navbar-nav a,
.navbar-nav .nav-link {
    padding: 8px 12px;
    color: var(--gray-600);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.navbar-nav a:hover,
.navbar-nav .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
}

.navbar-nav a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.nav-user .user-name {
    font-weight: 500;
}

/* ---- Install Page ---- */
.install-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 24px;
}

.install-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.install-card h1 {
    text-align: center;
    margin-bottom: 4px;
}

.install-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.install-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.install-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--gray-200);
    color: var(--gray-500);
}

.install-step.active {
    background: var(--primary);
    color: #fff;
}

.install-step.done {
    background: var(--success);
    color: #fff;
}

.step-divider {
    width: 40px;
    height: 2px;
    background: var(--gray-200);
    align-self: center;
}

.step-divider.done {
    background: var(--success);
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, oklch(0.6 0.22 270 / 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, oklch(0.55 0.18 220 / 0.25) 0%, transparent 50%),
        linear-gradient(160deg, oklch(0.35 0.15 270) 0%, oklch(0.25 0.12 250) 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

/* 背景装饰粒子 */
.login-page::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: oklch(0.65 0.2 280 / 0.08);
    top: -100px;
    right: -100px;
    filter: blur(80px);
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: oklch(0.6 0.15 200 / 0.06);
    bottom: -80px;
    left: -80px;
    filter: blur(60px);
}

.login-card {
    background: oklch(1 0 0 / 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-6);
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl), 0 0 0 1px oklch(1 0 0 / 0.1);
    position: relative;
    z-index: 1;
    animation: login-card-in var(--duration-slow) var(--ease-out) both;
}

@keyframes login-card-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card h1 {
    text-align: center;
    margin-bottom: var(--space-1);
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.625rem;
    letter-spacing: -0.02em;
    color: oklch(0.35 0.12 270);
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-400);
    margin-bottom: var(--space-6);
    font-size: 0.9375rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* 登录卡片 — 品牌徽章 */
.login-brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.login-brand-badge .logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), oklch(0.5 0.18 280));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.login-brand-badge .brand-text {
    text-align: left;
}

.login-brand-badge .brand-text .brand-name {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.3;
    color: var(--gray-800);
    display: block;
}

.login-brand-badge .brand-text .brand-desc {
    font-size: 0.8125rem;
    color: var(--gray-400);
    display: block;
}

/* 登录表单项 */
.login-card .form-group {
    margin-bottom: var(--space-5);
}

.login-card .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-2);
    transition: color var(--duration-fast) var(--ease-out);
}

.login-card .form-input {
    height: 46px;
    padding: 0 var(--space-4);
    font-size: 0.9375rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: oklch(0.99 0.003 80);
    transition: all var(--duration-fast) var(--ease-out);
    color: var(--gray-800);
}

.login-card .form-input::placeholder {
    color: var(--gray-300);
}

.login-card .form-input:hover {
    border-color: var(--gray-300);
}

.login-card .form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.login-card .form-input.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px oklch(0.55 0.22 30 / 0.1);
}

/* 登录按钮 */
.login-card .btn-primary.btn-lg {
    height: 48px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), oklch(0.5 0.18 280));
    border: none;
    position: relative;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
    letter-spacing: 0.02em;
    cursor: pointer;
}

.login-card .btn-primary.btn-lg:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

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

.login-card .btn-primary.btn-lg:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.login-card .btn-primary.btn-lg:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 登录按钮 Loading 状态 */
.login-card .btn-primary.btn-lg.is-loading {
    color: transparent;
    pointer-events: none;
}

.login-card .btn-primary.btn-lg.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2.5px solid oklch(1 0 0 / 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* 登录错误提示 */
.login-card .alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}

.login-card .alert-danger {
    background: oklch(0.95 0.03 30);
    color: oklch(0.4 0.2 30);
    border: 1px solid oklch(0.88 0.06 30);
}

.login-card .alert-danger::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    background: oklch(0.55 0.22 30);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2px;
}

/* 登录页页脚链接 */
.login-card .login-footer {
    text-align: center;
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--gray-100);
}

.login-card .login-footer a {
    font-size: 0.875rem;
    color: var(--gray-400);
    transition: color var(--duration-fast) var(--ease-out);
    text-decoration: none;
}

.login-card .login-footer a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* 专家登录页 — 邀请码输入框 */
.login-card .invite-code-input {
    font-size: 1.35rem;
    letter-spacing: 6px;
    text-align: center;
    font-family: var(--font-mono);
    height: 52px;
}

/* 尊敬 prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }
    .login-card .btn-primary.btn-lg,
    .login-card .form-input {
        transition: none;
    }
}

/* ---- Auth Switch ---- */
.auth-switch {
    display: flex;
    margin-bottom: 24px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.auth-switch-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--gray-50);
    color: var(--gray-500);
    border: none;
    font-family: inherit;
    transition: all 0.15s;
}

.auth-switch-btn.active {
    background: var(--primary);
    color: #fff;
}

.auth-switch-btn:hover:not(.active) {
    background: var(--gray-100);
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-top: 24px;
}

.page-header h1 {
    margin-bottom: 0;
}

/* ---- Status Dots ---- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-active { background: var(--success); }
.status-draft { background: var(--gray-400); }
.status-paused { background: var(--warning); }
.status-closed { background: var(--gray-500); }
.status-deleted { background: var(--danger); }

/* ---- Matrix Table ---- */
.matrix-table {
    min-width: 400px;
    table-layout: fixed;
}

.matrix-table th {
}

.matrix-table td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #d1d5db;
}

.matrix-table th {
    border: 1px solid #d1d5db;
    padding: 8px 6px;
}

.matrix-table input {
    width: 72px;
    text-align: center;
    padding: 6px 4px;
    font-size: 0.875rem;
}

.matrix-table .diagonal {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-600);
}

.matrix-table .auto-cell {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* ---- CR Indicator ---- */
.cr-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.cr-pass {
    background: var(--success-light);
    color: #15803d;
}

.cr-fail {
    background: var(--danger-light);
    color: #b91c1c;
}

.cr-warn {
    background: #fef9c3;
    color: #92400e;
}

.cr-suggestion {
    background: #fef9c3;
    border: 1px solid #facc15;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 0.875rem;
}

.cr-suggestion table {
    margin-top: 8px;
    font-size: 0.8125rem;
}

.cr-suggestion table th,
.cr-suggestion table td {
    padding: 4px 8px;
    border: 1px solid #fde68a;
    text-align: center;
}

.cr-suggestion .suggest-val {
    color: #92400e;
    font-weight: 700;
}

.cr-suggestion .current-val {
    text-decoration: line-through;
    color: #9ca3af;
}

/* ---- Expert Status ---- */
.expert-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expert-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

/* ---- Loading ---- */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    color: var(--gray-600);
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow: hidden;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    font-size: 0.9375rem;
    text-decoration: none;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---- Progress ---- */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

/* ---- Tree View ---- */
.tree-view {
    padding-left: 0;
    list-style: none;
}

.tree-view ul {
    padding-left: 24px;
    list-style: none;
}

.tree-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.tree-item:hover {
    background: var(--gray-50);
}

.tree-item .toggle-icon {
    cursor: pointer;
    color: var(--gray-400);
    width: 20px;
    display: inline-block;
}

/* ---- Flex Utilities ---- */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 24px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 12px;
    }

    .card {
        padding: 16px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .install-card,
    .login-card {
        padding: 24px;
    }

    .navbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 0;
    }

    .navbar-nav {
        flex-wrap: wrap;
    }

    table th,
    table td {
        padding: 8px;
        font-size: 0.8125rem;
    }

    .matrix-table input {
        width: 56px;
        font-size: 0.8125rem;
    }

    .modal {
        padding: 20px;
    }

    .tabs {
        gap: 0;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 6px 14px;
        font-size: 0.8125rem;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 0.9375rem;
    }

    .matrix-table input {
        width: 44px;
    }

    .install-card,
    .login-card {
        padding: 16px;
    }
}

/* ---- FCE 只读指标 - 评价说明 & 参考材料 ---- */
.tree-item.readonly {
    flex-direction: column;
    align-items: stretch;
}

.tree-item.readonly > .flex:first-child {
    padding-bottom: 4px;
}

.indicator-extra {
    margin-top: 4px;
    padding: 10px 12px;
    background: #fafbfc;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.indicator-note {
    margin-bottom: 10px;
}

.indicator-note .note-textarea {
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-family: var(--font);
    line-height: 1.5;
    transition: border-color 0.15s;
}

.indicator-note .note-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.indicator-material {
    padding-top: 2px;
}

.upload-form .file-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.upload-form input[type="file"] {
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px dashed var(--gray-300);
    border-radius: 4px;
    background: #fff;
    max-width: 260px;
    cursor: pointer;
}

.upload-form input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.material-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}

.material-preview .badge {
    font-size: 0.75rem;
    padding: 2px 8px;
}

.material-preview .file-name {
    font-size: 0.85rem;
    color: var(--gray-700);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-preview .file-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
