/*
 * 用途：后台管理端通用布局、组件与品牌样式
 * 生成时间：2026-07-16
 * 最后修改时间：2026-07-16
 * 性质：正式代码
 * 注意：.admin-container 锁定为视口高度，仅 .page-body / .sidebar-nav 内部滚动，
 *       侧栏与顶栏不得随整页滚动消失；改布局高度只动 --layout-header-height。
 *       .sidebar 必须 overflow:visible，否则右侧伸出的伸缩键会被裁掉。
 */
/* 后台通用样式 — 对齐 uupm.cc Liquid Glass（ui-ux-pro-max · WCAG AA） */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* —— 主色：uupm 电光蓝 —— */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --on-primary: #ffffff;

    /* —— 表面：亮色 glass-card（官网同款） —— */
    --bg: #f3f4f6;
    --bg-card-solid: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(229, 231, 235, 0.8);
    --glass-blur: 16px;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --mesh-a: rgba(37, 99, 235, 0.08);
    --mesh-b: rgba(59, 130, 246, 0.06);
    --mesh-c: rgba(148, 163, 184, 0.08);

    /* —— 文字 —— */
    --text: #0f172a;
    --text-muted: #64748b;

    /* —— 嵌套抬升层（金额卡/chip；绝不能回退成纯白） —— */
    --muted: #eef2f7;
    --muted-foreground: #64748b;
    --surface: #ffffff;
    --card-bg: #ffffff;
    --elevated: rgba(15, 23, 42, 0.04);

    /* —— 边框 / 输入 —— */
    --border: #e5e7eb;
    --border-color: #e5e7eb;
    --input-bg: #ffffff;

    /* —— 导航 —— */
    --nav-active-bg: rgba(37, 99, 235, 0.1);
    --nav-hover-bg: rgba(37, 99, 235, 0.06);

    /* —— 表格（实色，避免 sticky 透底） —— */
    --table-head-bg: #f1f5f9;
    --table-row-hover: rgba(37, 99, 235, 0.06);
    --table-row-hover-solid: #e8eef9;

    --overlay-scrim: rgba(15, 23, 42, 0.4);
    --focus-ring: rgba(37, 99, 235, 0.28);

    /* —— 语义色 —— */
    --danger: #dc2626;
    --danger-text: #b91c1c;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --danger-border: rgba(220, 38, 38, 0.28);
    --danger-text-hover: #991b1b;
    --success: #16a34a;
    --success-text: #15803d;
    --success-bg: rgba(22, 163, 74, 0.1);
    --success-border: rgba(22, 163, 74, 0.28);
    --warning-text: #b45309;
    --warning-text-hover: #92400e;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --warning-border: rgba(217, 119, 6, 0.3);
    --info-bg: rgba(37, 99, 235, 0.08);
    --info-text: #1d4ed8;
    --info-border: rgba(37, 99, 235, 0.25);

    --accent-subtle: rgba(37, 99, 235, 0.1);
    --accent-subtle-hover: rgba(37, 99, 235, 0.16);
    --accent-muted: rgba(37, 99, 235, 0.07);
    --toggle-hover-bg: rgba(37, 99, 235, 0.08);
    --disabled-bg: #eef2f7;
    --sticky-bar-bg: rgba(255, 255, 255, 0.92);

    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --layout-header-height: 72px;
    --layout-header-padding-x: 24px;
    color-scheme: light;
}

[data-theme="dark"] {
    /* —— 主色：暗底提亮蓝（官网同系） —— */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --on-primary: #ffffff;

    /* —— 表面：uupm dark glass-card —— */
    --bg: #0b0b10;
    --bg-card-solid: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --glass-bg: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 18px;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --mesh-a: rgba(37, 99, 235, 0.14);
    --mesh-b: rgba(59, 130, 246, 0.1);
    --mesh-c: rgba(255, 255, 255, 0.03);

    --text: #f8fafc;
    --text-muted: #94a3b8;

    /* 嵌套抬升：白 8% 玻璃层（金额卡），禁止纯白硬块 */
    --muted: rgba(255, 255, 255, 0.08);
    --muted-foreground: #94a3b8;
    --surface: #111827;
    --card-bg: #111827;
    --elevated: rgba(255, 255, 255, 0.08);

    --border: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.05);

    --nav-active-bg: rgba(59, 130, 246, 0.16);
    --nav-hover-bg: rgba(255, 255, 255, 0.06);

    --table-head-bg: #161b26;
    --table-row-hover: rgba(59, 130, 246, 0.08);
    --table-row-hover-solid: #1a2234;

    --overlay-scrim: rgba(0, 0, 0, 0.6);
    --focus-ring: rgba(59, 130, 246, 0.4);

    --danger: #f87171;
    --danger-text: #fca5a5;
    --danger-text-hover: #fecaca;
    --danger-bg: rgba(248, 113, 113, 0.14);
    --danger-border: rgba(248, 113, 113, 0.32);
    --success: #4ade80;
    --success-text: #86efac;
    --success-bg: rgba(74, 222, 128, 0.12);
    --success-border: rgba(74, 222, 128, 0.28);
    --warning-text: #fbbf24;
    --warning-text-hover: #fde68a;
    --warning-bg: rgba(251, 191, 36, 0.12);
    --warning-border: rgba(251, 191, 36, 0.28);
    --info-bg: rgba(59, 130, 246, 0.14);
    --info-text: #93c5fd;
    --info-border: rgba(59, 130, 246, 0.3);

    --accent-subtle: rgba(59, 130, 246, 0.16);
    --accent-subtle-hover: rgba(59, 130, 246, 0.24);
    --accent-muted: rgba(59, 130, 246, 0.1);
    --toggle-hover-bg: rgba(255, 255, 255, 0.08);
    --disabled-bg: rgba(255, 255, 255, 0.06);
    --sticky-bar-bg: rgba(17, 24, 39, 0.92);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
}

.glass-surface {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-surface,
    .sidebar,
    .top-header,
    .card,
    .login-card,
    .stat-card,
    .recent-section,
    .profile-section {
        background: var(--bg-card-solid);
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background:
        radial-gradient(ellipse 80% 60% at 12% 18%, var(--mesh-a), transparent 55%),
        radial-gradient(ellipse 70% 50% at 88% 12%, var(--mesh-b), transparent 50%),
        radial-gradient(ellipse 60% 55% at 50% 95%, var(--mesh-c), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse 80% 60% at 12% 18%, var(--mesh-a), transparent 55%),
        radial-gradient(ellipse 70% 50% at 88% 12%, var(--mesh-b), transparent 50%),
        radial-gradient(ellipse 60% 55% at 50% 95%, var(--mesh-c), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--glass-shadow);
}

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

.login-logo .icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
}

.login-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--on-primary);
}

.login-card .btn-primary {
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-ghost:hover {
    background: var(--nav-hover-bg);
    color: var(--text);
    border-color: var(--primary);
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info-text);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.form-name-dup-hint {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
    padding: 6px 8px;
    border-radius: 6px;
}

.form-name-dup-error {
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
}

.form-name-dup-warn {
    color: var(--warning-text);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
}

.topbar-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.login-theme-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ========== 后台布局 ========== */
/* 注意：锁死视口高度 + overflow hidden，避免侧栏/顶栏随文档滚动消失 */
.admin-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    position: relative;
    width: 240px;
    height: 100%;
    max-height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    /* 注意：勿用 overflow:hidden，会裁掉右侧伸出的 .sidebar-collapse-toggle */
    overflow: visible;
    transition: width 0.2s ease;
}

.sidebar-header {
    position: relative;
    height: var(--layout-header-height);
    min-height: var(--layout-header-height);
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    --sidebar-logo-width: 208px;
}

.logo-img {
    display: block;
    width: var(--sidebar-logo-width);
    height: auto;
    max-height: 60px;
    max-width: none;
    flex-shrink: 0;
    object-fit: contain;
    object-position: left center;
}

.logo-mini {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
}

.sidebar-collapse-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    /* 叠住侧栏右边框 1px，避免玻璃底与主区交界露出缝 */
    left: 100%;
    right: auto;
    margin-left: -1px;
    width: 15px;
    height: 46px;
    padding: 0;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: var(--bg-card-solid, var(--glass-bg));
    color: var(--text-muted);
    cursor: pointer;
    z-index: 120;
    opacity: 0.5;
    transform: translateY(-50%);
    transition: background 0.15s, color 0.15s, opacity 0.15s;
}

.sidebar-collapse-toggle .ui-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.sidebar:hover .sidebar-collapse-toggle {
    opacity: 1;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
    background: var(--nav-hover-bg);
    color: var(--primary);
    opacity: 1;
    outline: none;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    padding: 16px 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
    background: var(--nav-hover-bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--nav-active-bg);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.nav-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    color: inherit;
}

.nav-icon .ui-icon {
    width: 18px;
    height: 18px;
}

.ui-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.nav-text {
    font-weight: 500;
}

.nav-group {
    margin-bottom: 4px;
}

.nav-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}

.nav-group-title:hover,
.nav-group.active > .nav-group-title {
    background: var(--nav-hover-bg);
    color: var(--text);
}

.nav-group-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.nav-group.open .nav-group-arrow {
    transform: rotate(180deg);
}

.nav-group-items {
    display: none;
    padding-bottom: 4px;
}

.nav-group.open .nav-group-items {
    display: block;
}

.nav-subitem {
    padding: 10px 24px 10px 48px;
    font-size: 13px;
}

.nav-subitem.active {
    border-left: 3px solid var(--primary);
}

body.sidebar-collapsed .sidebar {
    width: 72px;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0 10px;
}

body.sidebar-collapsed .logo {
    justify-content: center;
}

body.sidebar-collapsed .logo-img {
    display: none;
}

body.sidebar-collapsed .logo-mini {
    display: block;
}

/* 注意：只翻转图标，勿 rotate 整颗按钮，否则圆角外框会跟着反掉并露出接缝 */
body.sidebar-collapsed .sidebar-collapse-toggle {
    transform: translateY(-50%);
}

body.sidebar-collapsed .sidebar-collapse-toggle .ui-icon {
    transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-nav {
    padding-top: 12px;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .nav-group-title {
    justify-content: center;
    gap: 0;
    padding: 12px 0;
}

body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-group-arrow,
body.sidebar-collapsed .nav-group-items {
    display: none !important;
}

body.sidebar-collapsed .nav-icon {
    width: 24px;
}

body.sidebar-collapsed .nav-icon .ui-icon {
    width: 20px;
    height: 20px;
}

body.sidebar-collapsed .nav-item.active,
body.sidebar-collapsed .nav-subitem.active {
    border-left-width: 0;
    box-shadow: inset 3px 0 0 var(--primary);
}

.org-tabs,
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.org-tabs .btn.active,
.settings-tabs .btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--nav-active-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

/* 注意：顶栏在 main-content 内固定不滚，滚动只发生在下方 .page-body */
.top-header {
    position: relative;
    z-index: 95;
    height: var(--layout-header-height);
    min-height: var(--layout-header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 var(--layout-header-padding-x);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
}

.theme-toggle-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    margin-right: 12px;
    padding: 0;
    line-height: 0;
    background: var(--bg-card-solid);
    border: 1px solid rgba(100, 116, 139, 0.38);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    vertical-align: middle;
}

html[data-theme="dark"] .theme-toggle-btn {
    background: var(--input-bg);
    border-color: var(--border);
    box-shadow: none;
    color: var(--text);
}

.theme-toggle-btn:hover {
    background: var(--nav-hover-bg);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.18);
}

.theme-toggle-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.theme-toggle-btn .theme-icon-moon path {
    fill: currentColor;
}

.theme-toggle-btn .theme-icon-sun circle {
    fill: currentColor;
}

.theme-toggle-btn .theme-icon-sun path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
}

.theme-toggle-btn .theme-icon-moon {
    display: block;
}

html[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
    display: none;
}

.theme-toggle-btn svg[hidden] {
    display: none !important;
}

.header-start {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 90;
}

.sidebar-overlay.open {
    display: block;
}

.top-header .page-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.page-header .page-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.page-header .page-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 0;
}

[data-theme="dark"] .top-header {
    box-shadow: none;
    border-bottom-color: var(--border);
}

.header-right {
    display: flex;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-name {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 16px;
}

.action-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.action-link:hover {
    color: var(--primary-light);
}

/* 注意：唯一主内容滚动容器；min-height:0 才能在 flex 布局下真正出现内部滚动条 */
.page-body {
    padding: 32px;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== 仪表盘 ========== */
.dashboard {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-subtle);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-light);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.recent-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 20px 24px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

/* ========== 个人资料 ========== */
.profile-page {
    max-width: 600px;
}

.profile-section {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.profile-section .section-title {
    padding: 0 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== 按钮样式扩展 ========== */
.btn-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

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

/* ========== 表单样式扩展 ========== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 20px;
    margin-bottom: 8px;
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-row-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 16px 0 8px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 0;
}

.checkbox-inline {
    margin: 0;
    white-space: nowrap;
}

.client-autocomplete-wrap {
    position: relative;
}

.autocomplete-dropdown {
    display: none;
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-card-solid);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow-y: auto;
}

.autocomplete-dropdown.open {
    display: block;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--accent-subtle);
    color: var(--primary);
}

.form-col-span-2 {
    grid-column: span 2;
}

.form-col-full {
    grid-column: 1 / -1;
}

.form-section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-section-label:first-child {
    margin-top: 0;
}

/* ========== 项目表单分区 ========== */
.project-form > form {
    display: flex;
    flex-direction: column;
}

.form-section {
    padding: 28px 32px;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.form-section:has(.multi-select.is-open) {
    z-index: 10;
}

.form-section-last {
    border-bottom: none;
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.form-section-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: var(--accent-subtle);
    border: 1px solid var(--info-border);
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.form-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px;
    line-height: 1.3;
}

.form-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.form-section-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-section-body .form-grid {
    margin-bottom: 0;
}

.form-section-body .form-group {
    margin-bottom: 0;
}

.form-group-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.form-hint-inline {
    margin-top: 0;
}

.region-manual-input {
    margin-top: 8px;
}

/* ========== 多选下拉 ========== */
.multi-select {
    position: relative;
}

.multi-select.is-open {
    z-index: 50;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 8px 12px 8px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.multi-select-trigger:hover {
    border-color: var(--primary);
}

.multi-select.is-open .multi-select-trigger,
.multi-select-trigger:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.multi-select.is-invalid .multi-select-trigger {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.multi-select-value {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.multi-select-placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

.multi-select.has-value .multi-select-placeholder {
    display: none;
}

.multi-select-tags {
    display: contents;
}

.multi-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 3px 8px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--primary);
    background: var(--accent-subtle);
    border: 1px solid var(--info-border);
    border-radius: 6px;
}

.multi-select-tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multi-select-tag-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.multi-select-tag-remove:hover {
    color: var(--text);
    background: var(--toggle-hover-bg);
}

.multi-select-chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s, border-color 0.2s;
}

.multi-select.is-open .multi-select-chevron {
    transform: rotate(225deg) translateY(2px);
    border-color: var(--primary-light);
}

.multi-select-panel {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-card-solid);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 240px;
    overflow-y: auto;
}

.multi-select-panel[hidden] {
    display: none !important;
}

.multi-select.is-open .multi-select-panel:not([hidden]) {
    display: block;
}

.multi-select-options {
    padding: 6px;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.multi-select-option:hover {
    background: var(--nav-hover-bg);
}

.multi-select-option:has(input:checked) {
    background: var(--accent-subtle);
    color: var(--primary);
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox-toggle {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--disabled-bg);
    transition: border-color 0.2s, background 0.2s;
}

.checkbox-toggle:has(input:checked) {
    border-color: var(--success);
    background: var(--success-bg);
}

.project-form .form-actions {
    margin-top: 0;
    padding: 0;
    border-top: none;
}

.form-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--sticky-bar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
}

.form-actions-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-control:disabled,
.form-control[readonly]:not([type="date"]) {
    opacity: 0.85;
    background: var(--disabled-bg);
    cursor: not-allowed;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========== 立项页紧凑布局 ========== */
.page-body:has(.project-form-compact) {
    padding: 20px;
}

.page-header-compact {
    margin-bottom: 16px;
    align-items: center;
}

.page-header-compact .page-title {
    font-size: 16px;
    margin-bottom: 2px;
}

.page-header-compact .page-desc {
    font-size: 12px;
}

.page-header-inline-desc {
    align-items: center;
    gap: 12px;
}

.page-header-inline-desc .page-header__main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    min-width: 0;
    flex: 1;
}

.page-header-inline-desc .page-title {
    margin-bottom: 0;
    flex-shrink: 0;
}

.page-header-inline-desc .page-desc {
    flex: 1 1 220px;
    min-width: 0;
    margin: 0;
    line-height: 1.45;
}

/* 添加报告存档：压紧页头与 AI 面板间距 */
.archive-add-toolbar {
    margin-bottom: 8px;
    align-items: center;
    gap: 10px 16px;
}

.archive-add-toolbar .page-header__main {
    align-items: center;
}

.archive-add-toolbar .page-title {
    font-size: 16px;
    line-height: 1.25;
}

.archive-add-toolbar .page-desc {
    font-size: 12px;
    line-height: 1.35;
}

.archive-add-toolbar__back {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.archive-add-toolbar + .ai-extract-panel {
    margin-top: 0;
    margin-bottom: 12px;
    padding: 14px 16px;
}

.archive-add-toolbar + .ai-extract-panel .ai-extract-panel__head {
    margin-bottom: 10px;
}

.project-form-layout {
    display: flex;
    flex-direction: column;
}

.project-form-col-right {
    display: flex;
    flex-direction: column;
}

.project-form-compact .form-section {
    padding: 16px 20px;
}

.project-form-compact .form-section-title-compact {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
}

.project-form-compact .form-section-body {
    gap: 10px;
}

.project-form-compact .form-row-label {
    font-size: 11px;
    margin: 4px 0 2px;
    text-transform: none;
    letter-spacing: 0.02em;
}

.project-form-compact .form-grid {
    gap: 10px 14px;
}

.project-form-compact .form-group label {
    font-size: 13px;
    margin-bottom: 4px;
}

.project-form-compact .form-control {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    min-height: 36px;
}

.project-form-compact select.form-control {
    padding-right: 28px;
}

.project-form-compact textarea.form-control {
    min-height: 56px;
    padding: 8px 12px;
    font-size: 14px;
}

.project-form-compact .form-hint {
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.4;
}

/* ========== 报告表单紧凑布局 ========== */
.report-form-compact {
    padding: 20px 24px;
}

.report-form-compact .form-row-label {
    font-size: 12px;
    margin: 12px 0 6px;
}

.report-form-compact .form-row-label:first-child {
    margin-top: 0;
}

.report-form-compact .form-grid {
    gap: 8px 12px;
    margin-bottom: 0;
}

.report-form-compact .form-group {
    margin-bottom: 0;
}

.report-form-compact .form-group label {
    font-size: 12px;
    margin-bottom: 3px;
}

.report-form-compact .form-control {
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 6px;
    min-height: 34px;
}

.report-form-compact select.form-control {
    padding-right: 26px;
}

.report-form-compact .form-hint {
    font-size: 11px;
    margin-top: 2px;
    line-height: 1.3;
}

.report-form-compact .form-actions {
    margin-top: 16px;
    padding-top: 12px;
}

.report-form-compact .form-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-form-compact .report-tpl-block {
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .report-form-compact .form-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .report-form-compact .form-grid,
    .report-form-compact .form-grid-4,
    .report-form-compact .form-grid-5 {
        grid-template-columns: 1fr 1fr;
    }
    .report-form-compact .form-col-span-2,
    .report-form-compact .form-col-full {
        grid-column: 1 / -1;
    }
}

/* ========== 报告存档表单紧凑布局 ========== */
.archive-form-compact {
    padding: 16px 20px 18px;
}

.archive-form-compact .form-row-label {
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.archive-form-compact .form-row-label:first-of-type {
    margin-top: 0;
}

.archive-form-compact .form-grid {
    gap: 8px 12px;
}

.archive-form-compact .form-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.archive-form-compact .form-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-form-compact .form-col-span-2 {
    grid-column: span 2;
}

.archive-form-compact .form-grid + .form-grid {
    margin-top: 8px;
}

.archive-form-compact .form-actions {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.archive-form-compact .archive-radio-row {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 34px;
    flex-wrap: wrap;
}

.archive-form-compact .archive-radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 13px;
    font-weight: 400;
}

.archive-form-compact .archive-attach-list {
    margin: 4px 0 0;
    padding-left: 16px;
}

.archive-third-sheet-group.is-need-upload {
    padding: 10px;
    margin: -4px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--color-warning, #d97706) 55%, transparent);
    background: color-mix(in srgb, var(--color-warning, #d97706) 10%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-warning, #d97706) 12%, transparent);
}
.archive-third-sheet-req {
    color: var(--color-danger, #dc2626);
    font-weight: 600;
}
.archive-third-sheet-banner {
    color: var(--color-warning, #b45309);
    font-weight: 500;
}
[data-theme="dark"] .archive-third-sheet-banner,
html.theme-dark .archive-third-sheet-banner {
    color: #fbbf24;
}

.archive-form-compact .multi-select-trigger {
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 6px;
}

.archive-form-compact .multi-select-placeholder,
.archive-form-compact .multi-select-tag {
    font-size: 12px;
}

@media (max-width: 1100px) {
    .archive-form-compact .form-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .archive-form-compact .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .archive-form-compact .form-grid-5,
    .archive-form-compact .form-grid-4,
    .archive-form-compact .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .archive-form-compact .form-col-span-2 {
        grid-column: 1 / -1;
    }
}

/* ========== 存档表单统一布局 ca-dense（合同 / 中标 / 报告） ========== */
.page-header-compact.archive-page-header,
.page-header-compact.contract-archive-header {
    margin-bottom: 8px;
}

.page-header-compact.archive-page-header .page-desc,
.page-header-compact.contract-archive-header .page-desc {
    margin-top: 2px;
    font-size: 12px;
}

.ca-dense {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 1360px;
}

/* AI 工具条：单行紧凑（主色蓝，避免多套「炫光」面板） */
.ca-dense__ai {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(37, 99, 235, 0.02));
}

.ca-dense__ai-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-size: 13px;
    white-space: nowrap;
}

.ca-dense__ai-label span {
    color: var(--text-muted, #64748b);
    font-weight: 400;
    font-size: 12px;
}

.ca-dense__ai-file {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 360px;
    min-height: 30px !important;
    padding: 2px 8px !important;
    font-size: 12px !important;
}

.ca-dense__ai .form-hint {
    margin: 0;
    font-size: 12px;
}

.ca-dense__ai-progress {
    flex: 1 1 100%;
    margin: 0;
}

.ca-dense__ai .ai-extract-status {
    flex: 1 1 100%;
    margin: 0;
    font-size: 12px;
}

.ca-dense__form.card-form {
    padding: 10px 12px 8px !important;
}

.ca-dense__tip {
    margin: 0 0 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    background: var(--muted, rgba(0, 0, 0, 0.03));
    border-radius: 6px;
}

.ca-dense__band {
    margin: 10px 0 6px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--primary, #2563eb);
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 6px;
}

.ca-dense__band:first-of-type {
    margin-top: 0;
}

/* 12 列高密度网格：gap 8px */
.ca-dense__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px 8px;
    align-items: start;
}

.ca-field {
    min-width: 0;
    margin: 0;
}

.ca-field label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text, #1e293b);
}

.ca-field .form-control {
    width: 100%;
    min-height: 30px;
    padding: 3px 8px;
    font-size: 13px;
    border-radius: 6px;
    line-height: 1.3;
}

.ca-field select.form-control {
    padding-right: 22px;
}

.ca-field textarea.form-control {
    min-height: 52px;
    line-height: 1.45;
    resize: vertical;
}

.ca-field .ca-file {
    font-size: 12px;
    padding: 2px 6px;
    min-height: 28px;
}

.ca-span-2 { grid-column: span 2; }
.ca-span-3 { grid-column: span 3; }
.ca-span-4 { grid-column: span 4; }
.ca-span-5 { grid-column: span 5; }
.ca-span-6 { grid-column: span 6; }
.ca-span-12 { grid-column: span 12; }

.ca-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.ca-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 2px 8px 2px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--input-bg, #fff);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.25;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ca-chip input {
    margin: 0;
    width: 13px;
    height: 13px;
}

.ca-chip:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.ca-dense .ca-multi-select .multi-select-trigger {
    min-height: 30px;
    padding: 3px 8px;
    font-size: 13px;
    border-radius: 6px;
}

.ca-dense .ca-multi-select .multi-select-placeholder,
.ca-dense .ca-multi-select .multi-select-tag {
    font-size: 12px;
}

.ca-file-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    font-size: 11px;
}

.ca-file-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.ca-file-list a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ca-file-del {
    flex-shrink: 0;
    color: var(--danger, #dc2626);
}

.ca-dense__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1200px) {
    .ca-dense__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
    .ca-span-2 { grid-column: span 2; }
    .ca-span-3 { grid-column: span 3; }
    .ca-span-4 { grid-column: span 4; }
    .ca-span-5,
    .ca-span-6,
    .ca-span-12 { grid-column: span 6; }
}

@media (max-width: 768px) {
    .ca-dense__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .ca-span-2,
    .ca-span-3,
    .ca-span-4,
    .ca-span-5,
    .ca-span-6,
    .ca-span-12 {
        grid-column: span 2;
    }
    .ca-dense__ai-file {
        max-width: none;
        flex-basis: 100%;
    }
}

.project-form-compact .region-manual-input {
    margin-top: 6px;
}

.project-form-compact .multi-select-trigger {
    min-height: 36px;
    padding: 6px 10px 6px 12px;
    font-size: 14px;
    border-radius: 6px;
}

.project-form-compact .multi-select-placeholder {
    font-size: 14px;
}

.project-form-compact .multi-select-tag {
    font-size: 12px;
    padding: 2px 6px;
}

.project-form-compact .multi-select-option {
    padding: 8px 10px;
    font-size: 13px;
}

.project-form-compact .form-actions-sticky {
    padding: 10px 20px;
}

.project-form-compact .form-actions-inner .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.project-form-compact .form-section-col-left {
    height: 100%;
}

@media (min-width: 1280px) {
    .project-form-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .project-form-col-right {
        border-left: 1px solid var(--border);
    }

    .project-form-compact .form-section-col-left {
        border-bottom: none;
    }

    .project-form-col-right .form-section:first-child {
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 1279px) {
    .project-form-compact .form-section-col-left {
        border-bottom: 1px solid var(--border);
    }
}

/* ========== 表格样式扩展 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--table-head-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.data-table tbody tr:hover {
    background: var(--table-row-hover);
}

.data-table a:not(.btn) {
    color: var(--primary-light);
    text-decoration: none;
}

.data-table a:not(.btn):hover {
    text-decoration: underline;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========== 列表 & 表单 ========== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header-desc-only {
    align-items: center;
}

.btn-sm { padding: 10px 18px; font-size: 14px; width: auto; }
.btn-xs { padding: 6px 12px; font-size: 13px; width: auto; }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

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

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-form {
    padding: 32px;
    max-width: none;
    width: 100%;
}

.card-form.project-form {
    padding: 0;
    overflow: visible;
}

.card-form-narrow {
    max-width: 640px;
}

.card-section {
    padding: 20px;
    margin-bottom: 20px;
}

.card-section-spaced {
    margin-top: 24px;
    padding: 24px;
}

.filter-card {
    max-width: 100%;
    margin-bottom: 20px;
    padding: 20px;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 报告存档列表筛选：主行紧凑 + 更多筛选折叠 */
.archive-filter-card {
    margin-bottom: 12px;
    padding: 10px 12px;
}
.archive-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.archive-filter-primary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.archive-filter-field {
    margin: 0;
    min-width: 0;
}
.archive-filter-field--kw {
    flex: 1 1 220px;
    min-width: 180px;
}
.archive-filter-primary > .archive-filter-field:not(.archive-filter-field--kw) {
    flex: 0 1 132px;
}
.archive-filter-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.archive-filter-more {
    cursor: pointer;
    white-space: nowrap;
}
.archive-filter-more[aria-expanded="true"] {
    color: var(--primary-light);
}
.archive-filter-advanced {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.archive-filter-advanced[hidden] {
    display: none !important;
}
.archive-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 10px;
}
.archive-filter-field--span2 {
    grid-column: span 2;
}
.archive-filter-hint {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--text-muted);
}
.archive-filter-card .form-control {
    height: 34px;
    min-height: 34px;
    padding: 4px 10px;
    font-size: 13px;
}
.archive-filter-range {
    display: flex;
    align-items: center;
    gap: 6px;
}
.archive-filter-range .form-control {
    min-width: 0;
    flex: 1;
}
.archive-filter-sep {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
@media (max-width: 1100px) {
    .archive-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .archive-filter-grid {
        grid-template-columns: 1fr;
    }
    .archive-filter-field--span2 {
        grid-column: span 1;
    }
    .archive-filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
}

/* 宽列表统一布局：横纵滚动 + 表头/首尾列粘滞（所有列表页共用） */
.card.table-wrap.table-wrap--hscroll {
    overflow: auto;
    max-width: 100%;
    max-height: calc(100vh - 220px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.table-wrap--hscroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.table-wrap--hscroll .data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-wrap--hscroll .data-table th,
.table-wrap--hscroll .data-table td {
    white-space: nowrap;
    vertical-align: middle;
    background: var(--bg-card-solid, #ffffff);
}
.table-wrap--hscroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-card-solid, #ffffff) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    box-shadow: inset 0 -1px 0 var(--border, #e5e7eb);
}
.table-wrap--hscroll .data-table th:first-child,
.table-wrap--hscroll .data-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card-solid, #ffffff) !important;
    box-shadow: 4px 0 8px -6px rgba(15, 23, 42, 0.18);
}
.table-wrap--hscroll .data-table thead th:first-child {
    z-index: 4;
    background: var(--bg-card-solid, #ffffff) !important;
}
.table-wrap--hscroll .data-table th:last-child,
.table-wrap--hscroll .data-table td:last-child,
.table-wrap--hscroll .data-table td.table-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--bg-card-solid, #ffffff) !important;
    box-shadow: -4px 0 8px -6px rgba(15, 23, 42, 0.18);
}
.table-wrap--hscroll .data-table thead th:last-child {
    z-index: 4;
    background: var(--bg-card-solid, #ffffff) !important;
}
.table-wrap--hscroll .data-table tbody tr:hover > td {
    background: var(--table-row-hover-solid, #f1f5f9) !important;
}
.table-wrap--hscroll .data-table thead th:hover {
    background: var(--bg-card-solid, #ffffff) !important;
    opacity: 1 !important;
}
.table-wrap--hscroll .data-table td.td-title {
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
}

[data-theme="dark"] .table-wrap--hscroll .data-table th,
[data-theme="dark"] .table-wrap--hscroll .data-table td,
[data-theme="dark"] .table-wrap--hscroll .data-table thead th,
[data-theme="dark"] .table-wrap--hscroll .data-table thead th:hover,
[data-theme="dark"] .table-wrap--hscroll .data-table th:first-child,
[data-theme="dark"] .table-wrap--hscroll .data-table td:first-child,
[data-theme="dark"] .table-wrap--hscroll .data-table th:last-child,
[data-theme="dark"] .table-wrap--hscroll .data-table td:last-child,
[data-theme="dark"] .table-wrap--hscroll .data-table td.table-actions,
html.theme-dark .table-wrap--hscroll .data-table th,
html.theme-dark .table-wrap--hscroll .data-table td,
html.theme-dark .table-wrap--hscroll .data-table thead th,
html.theme-dark .table-wrap--hscroll .data-table thead th:hover,
html.theme-dark .table-wrap--hscroll .data-table th:first-child,
html.theme-dark .table-wrap--hscroll .data-table td:first-child,
html.theme-dark .table-wrap--hscroll .data-table th:last-child,
html.theme-dark .table-wrap--hscroll .data-table td:last-child,
html.theme-dark .table-wrap--hscroll .data-table td.table-actions {
    background: var(--bg-card-solid, #1e293b) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
}
[data-theme="dark"] .table-wrap--hscroll .data-table tbody tr:hover > td,
html.theme-dark .table-wrap--hscroll .data-table tbody tr:hover > td {
    background: var(--table-row-hover-solid, #312e81) !important;
}

@media (max-width: 768px) {
    .card.table-wrap.table-wrap--hscroll {
        max-height: calc(100vh - 180px);
    }
}

/* 报告存档列表：右键附件下载菜单 */
.archive-ctx-menu {
    position: fixed;
    z-index: 1200;
    min-width: 168px;
    padding: 6px;
    margin: 0;
    list-style: none;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--bg-card-solid);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}
.archive-ctx-menu[hidden] {
    display: none !important;
}
.archive-ctx-menu li[hidden] {
    display: none !important;
}
.archive-ctx-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.archive-ctx-menu button:hover {
    background: var(--nav-hover-bg);
    color: var(--primary-light);
}
.archive-ctx-menu .is-divider {
    height: 1px;
    margin: 4px 6px;
    background: var(--border);
}
.data-table tr[data-archive-id] {
    cursor: context-menu;
}

/* ========== 组织架构树 ========== */
.dept-tree-wrap { padding: 0; }
.dept-tree-table .dept-tree-cell { min-width: 280px; }
.dept-tree-name-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
}
.dept-tree-lines {
    flex-shrink: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    line-height: 1;
    color: var(--text-muted);
    white-space: pre;
    user-select: none;
    letter-spacing: 0;
    font-variant-ligatures: none;
}
.dept-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    flex-shrink: 0;
    border-radius: 4px;
}
.dept-tree-toggle:hover {
    color: var(--text);
    background: var(--toggle-hover-bg);
}
.dept-tree-toggle-placeholder {
    display: inline-block;
    width: 20px;
    flex-shrink: 0;
}
.dept-tree-name { font-weight: 500; }
.dept-tree-type-badge { margin-left: 4px; font-size: 11px; }
.dept-tree-row[data-depth="0"] > .dept-tree-cell .dept-tree-name {
    font-weight: 600;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.project-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.project-thumb.placeholder {
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.text-muted { color: var(--text-muted); font-size: 13px; }

.link-external {
    color: var(--primary-light);
    text-decoration: none;
    word-break: break-all;
}

.link-external:hover { text-decoration: underline; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge-muted {
    background: var(--accent-muted);
    color: var(--text-muted);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.badge-primary {
    background: var(--info-bg);
    color: var(--info-text);
}

/* ========== 详情页双栏布局 ========== */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.detail-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-aside {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-aside-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 4px 0 0;
}

/* 详情页紧凑模式 */
.detail-layout--compact {
    gap: 16px;
}

.detail-layout--compact .detail-main {
    gap: 16px;
}

.detail-layout--compact .detail-aside {
    gap: 12px;
    top: 16px;
}

.detail-page--compact .page-header {
    margin-bottom: 16px;
}

.detail-page--compact .card-section {
    padding: 14px 18px;
}

.detail-page--compact .card-section .section-title {
    padding: 0 0 10px;
    margin: 0 0 10px;
}

.detail-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.detail-module {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 0;
}

.detail-module__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 10px;
    letter-spacing: 0.02em;
}

.detail-module__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.detail-module--attach {
    grid-column: 1 / -1;
}

/* 附件卡片列表 */
.detail-module__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: var(--accent-subtle);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    vertical-align: middle;
}

.attach-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.attach-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.attach-item:hover {
    border-color: var(--primary);
    box-shadow: var(--glass-shadow);
    transform: translateY(-1px);
}

.attach-item__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-subtle);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.attach-item__icon[data-ext="PDF"] {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.attach-item__icon[data-ext="DOC"],
.attach-item__icon[data-ext="DOCX"] {
    background: var(--info-bg);
    color: var(--info-text);
}

.attach-item__icon[data-ext="XLS"],
.attach-item__icon[data-ext="XLSX"],
.attach-item__icon[data-ext="CSV"] {
    background: var(--success-bg);
    color: var(--success-text);
}

.attach-item__icon[data-ext="JPG"],
.attach-item__icon[data-ext="JPEG"],
.attach-item__icon[data-ext="PNG"],
.attach-item__icon[data-ext="GIF"],
.attach-item__icon[data-ext="WEBP"] {
    background: var(--warning-bg);
    color: var(--warning-text);
}

.attach-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.attach-item__name {
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attach-item__kind {
    align-self: flex-start;
    max-width: 100%;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--muted);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.attach-item__action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--accent-subtle);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.attach-item__action:hover {
    background: var(--primary);
    color: var(--on-primary);
}

.attach-item__action--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.attach-item__action--ghost:hover {
    background: var(--muted);
    border-color: var(--primary);
    color: var(--primary);
}

/* 附件在线预览弹窗 */
.attach-preview {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1100px, 92vw);
    max-width: 92vw;
    height: min(88vh, 960px);
    max-height: 92vh;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.attach-preview::backdrop {
    background: var(--overlay-scrim);
    backdrop-filter: blur(2px);
}

.attach-preview__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.attach-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.attach-preview__title {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attach-preview__tools {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-preview__stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    overflow: auto;
}

.attach-preview__frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.attach-preview__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.attach-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.detail-module--related {
    grid-column: 1 / -1;
}

.related-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.related-item:first-of-type {
    padding-top: 0;
}

.related-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.related-item__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.related-item__header a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.related-item__header a:hover {
    color: var(--primary);
}

.detail-modules--maintain-summary {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-upload-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.detail-upload-form input[type="file"] {
    font-size: 13px;
    max-width: 220px;
}

.detail-attach-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.detail-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.detail-link-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.detail-link-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-link-list a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.detail-link-list a:hover {
    color: var(--primary);
}

.detail-aside .workflow-tree {
    padding: 12px 14px;
}

.detail-aside .workflow-tree:not(.workflow-tree--compact) .workflow-step {
    padding-bottom: 8px;
}

.detail-aside .workflow-tree:not(.workflow-tree--compact) .workflow-step__marker {
    width: 24px;
    height: 24px;
}

.detail-aside .workflow-tree:not(.workflow-tree--compact) .workflow-step__connector {
    left: 11px;
    top: 24px;
}

.detail-aside .workflow-tree:not(.workflow-tree--compact) .workflow-step__label {
    font-size: 13px;
}

.detail-aside .workflow-tree__header {
    margin-bottom: 8px;
}

.info-item--inline {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    line-height: 1.35;
    min-width: 0;
}

.info-item--inline .info-item__label {
    display: inline;
    margin: 0;
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.info-item--inline .info-item__label::after {
    content: '：';
}

.info-item--inline .info-item__value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-item--inline.info-item--full {
    grid-column: 1 / -1;
}

.info-item--inline.info-item--full .info-item__value {
    white-space: normal;
}

.detail-card__footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 13px;
}

.detail-log-compact {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.detail-log-compact__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.detail-log-compact__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.detail-log-compact__item {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

.detail-log-compact__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-log-compact__time {
    color: var(--text-muted);
    margin-right: 6px;
}

.detail-log-compact__meta {
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .detail-modules {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .detail-module__grid {
        grid-template-columns: 1fr;
    }
}

.page-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

/* ========== 项目信息分组 ========== */
.info-grid {
    display: grid;
    gap: 20px;
}

.info-group {
    padding: 0;
}

.info-group__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.info-group__rows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 20px;
}

.info-item {
    font-size: 14px;
    line-height: 1.5;
}

.info-item__label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-item__value {
    color: var(--text);
    word-break: break-word;
}

.info-item--full {
    grid-column: 1 / -1;
}

/* ========== 流程树 ========== */
.workflow-tree {
    padding: 18px 20px;
    border-radius: var(--radius);
}

.workflow-tree__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.workflow-tree__title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}

.workflow-tree__title-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.workflow-tree__title-link:hover {
    color: var(--primary);
}

.workflow-tree__subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.workflow-tree-empty {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    padding: 8px 0;
}

.workflow-stepper {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-step {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 0 12px;
    padding-bottom: 18px;
}

.workflow-step:last-child {
    padding-bottom: 0;
}

.workflow-step__marker {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-solid);
    border: 2px solid var(--border);
    color: var(--text-muted);
    flex-shrink: 0;
}

.workflow-step__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.workflow-step__dot--pulse {
    background: var(--primary);
}

.workflow-step__connector {
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.workflow-step.is-done .workflow-step__marker {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success-text);
}

.workflow-step.is-done .workflow-step__connector {
    background: var(--success-border);
}

.workflow-step.is-current .workflow-step__marker {
    background: var(--info-bg);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.workflow-step.is-rejected .workflow-step__marker {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger-text);
}

.workflow-step.is-upcoming .workflow-step__marker {
    background: var(--disabled-bg);
    border-color: var(--border);
    color: var(--text-muted);
}

.workflow-step__body {
    padding-top: 4px;
    min-width: 0;
}

.workflow-step__label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.workflow-step.is-upcoming .workflow-step__label {
    color: var(--text-muted);
}

.workflow-step.is-current .workflow-step__label {
    color: var(--primary);
    font-weight: 600;
}

.workflow-step.is-rejected .workflow-step__label {
    color: var(--danger-text);
}

.workflow-step__state-tag {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger-text);
}

.workflow-step__hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.workflow-tree--compact {
    padding: 14px 16px;
}

.workflow-tree--compact .workflow-tree__title,
.workflow-tree--compact .workflow-tree__title-link {
    font-size: 14px;
}

.workflow-tree--compact .workflow-step {
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 0 10px;
    padding-bottom: 12px;
}

.workflow-tree--compact .workflow-step__marker {
    width: 26px;
    height: 26px;
}

.workflow-tree--compact .workflow-step__connector {
    left: 12px;
    top: 26px;
}

.workflow-tree--compact .workflow-step__label {
    font-size: 13px;
}

@media (prefers-reduced-motion: no-preference) {
    .workflow-step.is-current .workflow-step__dot--pulse {
        animation: workflow-pulse 2s ease-in-out infinite;
    }
}

@keyframes workflow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

/* ========== 审批时间线 ========== */
.workflow-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.workflow-timeline__item {
    position: relative;
    padding: 0 0 20px 28px;
}

.workflow-timeline__item:last-child {
    padding-bottom: 0;
}

.workflow-timeline__item::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.workflow-timeline__item:last-child::before {
    display: none;
}

.workflow-timeline__dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card-solid);
    box-shadow: 0 0 0 2px var(--primary);
}

.workflow-timeline__time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.workflow-timeline__action {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.workflow-timeline__meta {
    font-size: 13px;
    color: var(--text-muted);
}

.workflow-timeline__comment {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text);
    padding: 8px 12px;
    background: var(--accent-muted);
    border-radius: 8px;
}

.card-section {
    padding: 24px;
}

.card-section .section-title {
    padding: 0 0 16px;
    margin: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.approve-card {
    padding: 20px 24px;
    border-left: 4px solid var(--primary);
}

.approve-card .section-title {
    padding: 0 0 12px;
    margin: 0 0 12px;
}

.approve-card--compact {
    padding: 12px 14px;
}

.approve-card--compact .section-title {
    padding: 0;
    margin: 0;
    border: none;
    font-size: 13px;
}

.approve-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    margin-bottom: 10px;
}

.approve-card__hint {
    font-size: 12px;
    color: var(--text-muted);
}

.approve-card__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.approve-card__row .form-control {
    flex: 1;
    min-width: 160px;
}

.approve-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.approve-card__upload {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.approve-card__upload input[type="file"] {
    font-size: 13px;
    max-width: 220px;
}

.approve-card__files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.detail-module--full {
    grid-column: 1 / -1;
}

.detail-modules--contract {
    grid-template-columns: 1fr;
}

.detail-module__grid--dense {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 16px;
}

@media (max-width: 1200px) {
    .detail-module__grid--dense {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .detail-module__grid--dense {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.contract-party-create {
    display: grid;
    grid-template-columns: 110px minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.contract-pool-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contract-pool-form .form-group {
    margin: 0;
}

.contract-pool-form .form-group label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.contract-pool-subform {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.contract-pool-form input[type="file"] {
    font-size: 13px;
    max-width: 100%;
}

.report-detail .detail-layout--compact {
    grid-template-columns: minmax(0, 1fr) 280px;
}

.report-attach-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.report-attach-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.report-attach-row__label {
    flex: 0 0 110px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 4px;
}

.report-attach-row__files {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

@media (max-width: 1024px) {
    .report-detail .detail-layout--compact {
        grid-template-columns: 1fr;
    }
}

.data-table--compact th,
.data-table--compact td {
    padding: 6px 8px;
    font-size: 13px;
}

.contract-detail .detail-layout--compact {
    grid-template-columns: minmax(0, 1fr) 280px;
}

@media (max-width: 1100px) {
    .contract-party-create {
        grid-template-columns: 1fr 1fr;
    }
    .contract-party-create button {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 1024px) {
    .contract-detail .detail-layout--compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-aside {
        position: static;
        order: -1;
    }

    .workflow-stepper {
        display: flex;
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .workflow-step {
        flex: 0 0 auto;
        min-width: 120px;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        justify-items: center;
        text-align: center;
        padding-bottom: 0;
        padding-right: 16px;
    }

    .workflow-step__connector {
        display: none;
    }

    .workflow-step__body {
        padding-top: 8px;
    }

    .workflow-tree--compact .workflow-stepper {
        flex-direction: column;
        overflow-x: visible;
    }

    .workflow-tree--compact .workflow-step {
        grid-template-columns: 26px minmax(0, 1fr);
        grid-template-rows: auto;
        justify-items: start;
        text-align: left;
        padding-right: 0;
        padding-bottom: 12px;
    }

    .workflow-tree--compact .workflow-step__connector {
        display: block;
    }
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions--leading {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    white-space: nowrap;
}

.table-actions--leading .btn {
    padding: 2px 6px;
    min-height: 0;
    line-height: 1.35;
    font-size: 12px;
}

.table-wrap--hscroll .data-table th.col-actions,
.table-wrap--hscroll .data-table td.table-actions.table-actions--leading {
    width: 1%;
    max-width: none;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}

.table-wrap--hscroll .data-table td.table-actions.table-actions--leading {
    position: sticky;
    left: 0;
    right: auto;
    z-index: 2;
    box-shadow: 4px 0 8px -6px rgba(15, 23, 42, 0.18);
}

.table-actions form { display: inline; }

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    align-items: end;
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* 左侧表单收窄，右侧列表占满剩余宽度 */
.settings-grid--form-narrow {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-grid--form-narrow .card-form {
    padding: 16px;
}

.settings-grid--form-narrow .settings-form-title {
    margin-bottom: 12px;
    font-size: 15px;
}

.settings-grid--form-narrow .form-group {
    margin-bottom: 10px;
}

.settings-grid--form-narrow .form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.settings-grid--form-narrow .form-hint {
    font-size: 11px;
    line-height: 1.4;
    margin-top: 4px;
}

.settings-grid--form-narrow .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

.settings-grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.settings-grid .card-form {
    padding: 24px;
}

.settings-grid .card-form form {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.settings-grid .card-form form > .btn {
    margin-top: auto;
}

.settings-grid .table-wrap {
    padding: 0;
}

.settings-form-title {
    margin-bottom: 16px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.page-actions form {
    display: inline;
}

.form-control[type="number"] { appearance: textfield; }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

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

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

@media (max-width: 768px) {
    .sidebar-collapse-toggle {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 100;
        transition: left 0.25s ease;
        border-right: 1px solid var(--border);
        border-bottom: none;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .top-header {
        padding: 0 16px;
    }

    .page-body {
        padding: 20px;
    }

    .page-header {
        flex-direction: column;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

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

    .card-form {
        padding: 20px;
    }

    .card-form.project-form {
        padding: 0;
    }

    .form-section {
        padding: 20px;
    }

    .form-actions-sticky {
        padding: 14px 20px;
    }

    .form-section-head {
        gap: 12px;
        margin-bottom: 20px;
    }

    .form-section-num {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .project-form-compact .form-section {
        padding: 14px 16px;
    }

    .project-form-compact .form-actions-sticky {
        padding: 10px 16px;
    }

    .page-body:has(.project-form-compact) {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-col-span-2 {
        grid-column: span 2;
    }

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

    .user-menu {
        flex-wrap: wrap;
    }
}

@media (max-width: 1100px) {
    .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .page-body {
        padding: 16px;
    }

    .top-header .page-title {
        font-size: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

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

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

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

    .form-col-span-2 {
        grid-column: span 1;
    }
}

/* 项目列表行悬停：合同/报告进度 */
tr.project-row-hover {
    cursor: default;
}

tr.project-row-hover:hover > td {
    background: color-mix(in srgb, var(--bg-card-solid, #1e293b) 88%, var(--primary, #3b82f6) 12%);
}

.project-row-tip-float {
    position: fixed;
    z-index: 1200;
    pointer-events: none;
    max-width: min(320px, calc(100vw - 24px));
}

.project-row-tip__card {
    background: var(--bg-card-solid, #0f172a);
    border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
    padding: 10px 12px;
    color: var(--text, #e2e8f0);
    font-size: 13px;
    line-height: 1.5;
}

.project-row-tip__title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted, #94a3b8);
    font-size: 12px;
}

.project-row-tip__line + .project-row-tip__line {
    margin-top: 4px;
}

/* ========== 项目详情页（可读密度 + Bento 金额） ========== */
.project-detail .detail-layout--compact {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
}

.project-detail .detail-main {
    gap: 12px;
    min-width: 0;
}

.project-detail .detail-modules--project {
    gap: 12px;
}

.project-detail .page-header {
    margin-bottom: 14px;
}

.project-detail .page-title {
    font-size: 1.25rem;
    line-height: 1.35;
}

.project-detail .project-detail-unified {
    padding: 18px 20px;
    border-radius: 12px;
}

.project-detail .project-merge-fold {
    padding: 0;
    overflow: hidden;
}
.project-detail .project-merge-fold__summary {
    cursor: pointer;
    list-style: none;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    user-select: none;
}
.project-detail .project-merge-fold__summary::-webkit-details-marker {
    display: none;
}
.project-detail .project-merge-fold__summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s ease;
}
.project-detail .project-merge-fold[open] .project-merge-fold__summary::before {
    transform: rotate(90deg);
}
.project-detail .project-merge-fold[open] .project-merge-fold__summary {
    border-bottom: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 80%, transparent);
    margin-bottom: 10px;
}
.project-detail .project-merge-fold > :not(summary) {
    margin-left: 14px;
    margin-right: 14px;
}
.project-detail .project-merge-fold > :last-child {
    margin-bottom: 12px;
}

.project-detail .pd-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px 16px;
}
.project-detail .pd-field-grid--primary {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 75%, transparent);
}
.project-detail .pd-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.project-detail .pd-field--full {
    grid-column: 1 / -1;
}
.project-detail .pd-field__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.01em;
}
.project-detail .pd-field__value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #0f172a);
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-detail .pd-field__value--wrap {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-weight: 400;
}

.project-detail .pd-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 14px;
}
.project-detail .pd-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted, #f1f5f9) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 70%, transparent);
    font-size: 13px;
}
.project-detail .pd-status-chip__label {
    color: var(--text-muted, #64748b);
    font-weight: 500;
}
.project-detail .pd-status-chip__count {
    color: var(--text-muted, #94a3b8);
    font-size: 12px;
}
.project-detail .pd-status-chip--link {
    text-decoration: none;
    color: var(--primary, #4f46e5);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.project-detail .pd-status-chip--link:hover {
    background: color-mix(in srgb, var(--primary, #4f46e5) 10%, transparent);
}

.project-detail .pd-archive-block {
    margin-top: 4px;
    padding: 14px 0 4px;
}
.project-detail .pd-archive-block + .pd-archive-block {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 75%, transparent);
}
.project-detail .pd-archive-block__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.project-detail .pd-archive-block__title,
.project-detail .pd-archive-block__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #0f172a);
    text-decoration: none;
}
.project-detail .pd-archive-block__title:hover,
.project-detail .pd-archive-block__link:hover {
    color: var(--primary, #4f46e5);
}
.project-detail .pd-archive-block__link {
    color: var(--primary, #4f46e5);
}

.project-detail .pd-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.project-detail .pd-metric {
    padding: 12px 14px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--muted, #f8fafc) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 65%, transparent);
    min-width: 0;
}
.project-detail .pd-metric--accent {
    background: color-mix(in srgb, var(--primary, #4f46e5) 8%, transparent);
    border-color: color-mix(in srgb, var(--primary, #4f46e5) 22%, transparent);
}
.project-detail .pd-metric__label {
    display: block;
    font-size: 12px;
    color: var(--text-muted, #64748b);
    margin-bottom: 6px;
}
.project-detail .pd-metric__value {
    display: block;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text, #0f172a);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}
.project-detail .pd-metric--accent .pd-metric__value {
    color: var(--primary, #4338ca);
}

.project-detail .pd-perm-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--text-muted, #64748b);
}

.project-detail .project-detail-unified__attach {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 75%, transparent);
}

[data-theme="dark"] .project-detail .pd-metric--accent,
html.theme-dark .project-detail .pd-metric--accent {
    background: color-mix(in srgb, var(--primary, #818cf8) 14%, transparent);
}
[data-theme="dark"] .project-detail .pd-metric--accent .pd-metric__value,
html.theme-dark .project-detail .pd-metric--accent .pd-metric__value {
    color: #c7d2fe;
}

@media (max-width: 1280px) {
    .project-detail .pd-field-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .project-detail .pd-metrics {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 640px) {
    .project-detail .pd-field-grid,
    .project-detail .pd-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .project-detail .pd-metric__value {
        font-size: 16px;
    }
}

.related-summary-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.related-summary-grid--pd {
    gap: 14px;
}

.related-summary-grid--pd:has(> :only-child) {
    grid-template-columns: 1fr;
}

.related-summary-grid .detail-module--related,
.related-summary-grid .pd-related-card {
    grid-column: auto;
    padding: 16px 18px;
    border-radius: 12px;
    min-height: 100%;
}

.project-detail .pd-related-card__title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 650;
    color: var(--text, #0f172a);
    letter-spacing: 0.01em;
}

.project-detail .pd-related-card .pd-archive-block {
    padding-top: 0;
}
.project-detail .pd-related-card .pd-archive-block + .pd-archive-block {
    margin-top: 14px;
    padding-top: 14px;
}

.project-detail .pd-related-card .pd-metrics {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.related-summary-block {
    margin-top: 8px;
}
.related-summary-block + .related-summary-block {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--border-color, #e5e7eb) 80%, transparent);
}
.related-summary-block__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.related-item {
    padding: 6px 0;
}

.related-item__header {
    margin-bottom: 4px;
    gap: 6px;
}

.related-item__header a {
    font-size: 13px;
}

.detail-aside--project {
    gap: 10px;
    top: 12px;
    max-height: calc(100vh - 72px);
    overflow: auto;
    padding-right: 2px;
}

.workflow-panel {
    padding: 0;
    overflow: hidden;
}

.workflow-panel__tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card-solid, #1e293b) 92%, transparent);
}

.workflow-panel__tab {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 10px 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.workflow-panel__tab:hover {
    color: var(--text);
}

.workflow-panel__tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.workflow-panel__count {
    display: inline-flex;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    color: var(--primary);
}

.workflow-panel__pane {
    display: none;
    padding: 10px 12px 12px;
}

.workflow-panel__pane.is-active {
    display: block;
}

.workflow-panel__hint {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.workflow-tree--embedded {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
    backdrop-filter: none;
}

.workflow-tree--embedded .workflow-tree__header {
    margin-bottom: 8px;
}

.workflow-tree--embedded.workflow-tree--compact .workflow-step {
    padding-bottom: 8px;
}

.workflow-tree--embedded.workflow-tree--compact .workflow-step__label {
    font-size: 12px;
}

.workflow-tree--embedded.workflow-tree--compact .workflow-step__hint {
    font-size: 10px;
}

.detail-log-compact--fold {
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.detail-log-compact--fold > summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.detail-log-compact--fold > summary::-webkit-details-marker {
    display: none;
}

.detail-log-compact--fold .detail-log-compact__list {
    margin-top: 8px;
    max-height: 180px;
    overflow: auto;
}

@media (max-width: 1100px) {
    .related-summary-grid {
        grid-template-columns: 1fr;
    }

    .project-detail .detail-layout--compact {
        grid-template-columns: 1fr;
    }

    .detail-aside--project {
        max-height: none;
        overflow: visible;
        position: static;
    }
}

/* ========== API 设置统一布局（Data-Dense，density 8） ========== */
.api-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1120px;
}

.api-settings--wide {
    max-width: none;
}

.api-settings .settings-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 4px;
    border-radius: 10px;
    background: var(--muted, rgba(0, 0, 0, 0.04));
    border: 1px solid var(--border);
}

.api-settings .settings-tabs .btn {
    margin: 0;
    border: 0;
    box-shadow: none;
    border-radius: 7px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    background: transparent;
}

.api-settings .settings-tabs .btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
}

.api-settings .settings-tabs .btn.active {
    color: var(--primary);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .api-settings .settings-tabs .btn.active {
    background: var(--card-bg, #1e293b);
}

.api-settings__panel {
    padding: 14px 16px 12px;
}

.api-settings__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.api-settings__title {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.api-settings__desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 400;
    color: var(--muted-foreground, var(--text-muted));
    max-width: 640px;
}

.api-settings__head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: min(100%, 360px);
}

.api-settings__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.api-settings__toolbar form {
    margin: 0;
    display: inline-flex;
}

.api-toolbar-btn {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    min-height: 34px;
}

.api-toolbar-btn:hover:not(:disabled) {
    background: var(--accent-subtle);
    color: var(--primary);
    border-color: var(--primary);
}

.api-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.api-settings-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    flex-wrap: wrap;
}

.api-balance-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
}

.api-balance-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary, #5b7cfa);
    letter-spacing: 0.02em;
}

.api-balance-line {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.api-balance-meta {
    font-size: 12px;
    color: var(--text-muted, #8b93a7);
    line-height: 1.4;
}

.api-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--muted);
    border: 1px solid var(--border);
}

.api-status-badge--ok {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: var(--success-border);
}

/* 双列高密度表单 */
.api-settings__form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}

.api-settings__form .form-group {
    margin: 0;
}

/* 一级：字段名 / 模块标签 — 深色、加粗，一眼可扫读 */
.api-settings__form .form-group > label {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

.api-settings__form .form-control {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* 二级：说明 / 提示 — 浅灰、常规字重，明确低于标签层级 */
.api-settings__form .form-hint,
.api-settings__section-hint,
.api-settings__desc {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--muted-foreground, var(--text-muted));
}

.api-settings__form .form-row-label,
.api-settings__section-title {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    padding: 10px 0 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.api-settings__section-title:first-of-type {
    margin-top: 0;
}

.api-settings__enable {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--elevated);
    border: 1px solid var(--border);
}

.api-settings__section-hint {
    margin: 0 0 12px;
}

.api-settings__active-box {
    display: grid;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--elevated);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
}

.api-settings__active-box--row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
    align-items: start;
}

.api-settings__active-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.api-settings__active-item--remain .api-settings__active-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

/* 一级：状态项标题 */
.api-settings__active-label {
    color: var(--text);
    font-weight: 600;
    font-size: 12px;
}

/* 一级内容值；副说明走二级灰字 */
.api-settings__active-value {
    color: var(--text);
    word-break: break-word;
}

.api-settings__active-sub {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    color: var(--muted-foreground, var(--text-muted));
}

.api-settings__span-2 {
    grid-column: 1 / -1;
}

.api-settings__model-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}

.api-creds {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.api-creds__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.api-creds__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-creds__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
    align-items: start;
}

.api-creds__fields[hidden] {
    display: none !important;
}

.api-creds:not(.is-collapsed) .api-creds__summary {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border);
}


.api-settings__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.api-settings__form .js-ep-manual {
    margin-top: 6px;
}

.api-settings__form .js-ep-manual.is-hidden {
    display: none;
}

/* 火山免费额度阶梯卡片 */
.volcano-tier-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.volcano-tier-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.volcano-tier-card__fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 12px;
}

.volcano-tier-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.volcano-tier-caps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.volcano-cap-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--elevated);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.volcano-cap-chip input {
    margin: 0;
    accent-color: var(--primary);
}

.volcano-cap-chip:has(input:checked) {
    color: var(--primary);
    background: var(--accent-subtle);
    border-color: var(--primary);
}

.volcano-tier-usage {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--muted);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
}

.volcano-tier-usage.is-active {
    color: var(--primary);
    background: var(--accent-subtle);
}

.volcano-tier-usage__tag {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-size: 11px;
    font-weight: 600;
}

.volcano-tier-add {
    margin: 0;
}

/* 使用情况 */
.api-usage-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.api-usage-stat {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius, 10px);
    background: var(--card-bg, #fff);
}

/* 一级：统计卡片标题、筛选项标签 */
.api-usage-stat__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.api-usage-stat__value {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.55;
    font-weight: 400;
    color: var(--muted-foreground, var(--text-muted));
}

.api-usage-filters {
    padding: 10px 12px;
}

.api-usage-filters .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
}

.api-usage-filters .form-group {
    margin: 0;
}

.api-usage-filters .form-group > label {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.api-usage-filters .form-control {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 13px;
}

.api-usage-filters .form-group--grow {
    flex: 1 1 200px;
    min-width: 180px;
}

.api-usage-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

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

.api-usage-table .data-table th,
.api-usage-table .data-table td {
    padding: 8px 10px;
    vertical-align: top;
}

.api-usage-summary {
    max-width: 320px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
    white-space: pre-wrap;
    word-break: break-word;
}

.api-usage-pager {
    margin: 0;
    font-size: 13px;
}

@media (max-width: 900px) {
    .api-settings__form {
        grid-template-columns: 1fr;
    }
    .api-settings__span-2,
    .api-settings__form .form-row-label,
    .api-settings__section-title,
    .api-settings__actions {
        grid-column: 1;
    }
    .api-settings__head-side {
        align-items: stretch;
        min-width: 0;
        width: 100%;
    }
    .api-balance-panel,
    .api-settings__toolbar {
        align-items: stretch;
        justify-content: flex-start;
    }
    .api-balance-line {
        align-items: flex-start;
    }
    .api-settings__toolbar .api-toolbar-btn {
        width: 100%;
    }
    .api-settings__model-row,
    .api-creds__grid,
    .api-settings__active-box--row {
        grid-template-columns: 1fr;
    }
    .volcano-tier-card__fields {
        grid-template-columns: 1fr;
    }
    .volcano-tier-card__meta {
        align-items: flex-start;
    }
    .api-usage-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .volcano-tier-card__meta {
        flex-direction: column;
    }
}

/* OCR 全文只读面板（报告存档） */
.archive-ocr-text {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    max-height: 70vh;
    overflow: auto;
    padding: 12px;
    border-radius: 6px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
}

/* ========== 通用拖拽上传（FileUpload 模块） ========== */
.fu-dropzone {
    position: relative;
    width: 100%;
    border-radius: 10px;
    border: 1px dashed rgba(99, 102, 241, 0.32);
    background: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.fu-dropzone:hover,
.fu-dropzone:focus-visible {
    border-color: rgba(99, 102, 241, 0.55);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.fu-dropzone.is-dragover {
    border-style: solid;
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.fu-dropzone.has-file {
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.05);
}

[data-theme="dark"] .fu-dropzone {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .fu-dropzone:hover,
[data-theme="dark"] .fu-dropzone:focus-visible,
[data-theme="dark"] .fu-dropzone.is-dragover {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(129, 140, 248, 0.55);
}

[data-theme="dark"] .fu-dropzone.has-file {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(129, 140, 248, 0.45);
}

.fu-dropzone__surface {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    pointer-events: none;
}

.fu-dropzone__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--primary);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.14), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] .fu-dropzone__icon {
    color: var(--primary-light);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.24), rgba(56, 189, 248, 0.1));
}

.fu-dropzone__copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fu-dropzone__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.fu-dropzone__hint,
.fu-dropzone__filename {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    word-break: break-all;
}

.fu-dropzone__filename {
    color: var(--primary);
    font-weight: 500;
}

[data-theme="dark"] .fu-dropzone__filename {
    color: var(--primary-light);
}

.fu-dropzone__clear {
    pointer-events: auto;
    flex-shrink: 0;
    margin-left: auto;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.fu-dropzone__clear:hover {
    color: var(--danger-text);
    border-color: var(--danger-border);
    background: var(--danger-bg);
}

.fu-dropzone__input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}

/* 嵌入 AI 上传槽：去掉双重外框感 */
.fu-dropzone--embedded {
    border-color: rgba(99, 102, 241, 0.25);
    background: var(--input-bg);
}

.fu-dropzone--embedded .fu-dropzone__surface {
    padding: 10px 8px;
}

.fu-dropzone--embedded .fu-dropzone__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
}

/* 详情/审批行内紧凑版 */
.fu-dropzone--compact {
    width: auto;
    min-width: 220px;
    max-width: 360px;
    display: inline-block;
    vertical-align: middle;
}

.fu-dropzone--compact .fu-dropzone__surface {
    padding: 8px 10px;
    gap: 8px;
}

.fu-dropzone--compact .fu-dropzone__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.fu-dropzone--compact .fu-dropzone__icon svg {
    width: 16px;
    height: 16px;
}

.fu-dropzone--compact .fu-dropzone__title {
    font-size: 12px;
}

.fu-dropzone--compact .fu-dropzone__hint,
.fu-dropzone--compact .fu-dropzone__filename {
    font-size: 11px;
}

.detail-upload-form,
.approve-card__upload {
    flex-wrap: wrap;
}

.detail-upload-form .fu-dropzone--compact,
.approve-card__upload .fu-dropzone--compact {
    flex: 1 1 220px;
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    .fu-dropzone {
        transition: none;
    }
}

/* AI 智能识别面板 — 轻量玻璃拟态，贴合 Liquid Glass 主题 */
.ai-extract-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, 0.18);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.07) 0%, rgba(56, 189, 248, 0.05) 48%, rgba(255, 255, 255, 0.92) 100%);
    box-shadow:
        0 10px 28px rgba(99, 102, 241, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.75) inset;
    isolation: isolate;
}

.ai-extract-panel__glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 280px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
}

.ai-extract-panel__glow::after {
    content: '';
    position: absolute;
    left: 220px;
    top: 40px;
    width: 160px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, transparent 70%);
}

.ai-extract-panel > *:not(.ai-extract-panel__glow) {
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .ai-extract-panel {
    border-color: rgba(129, 140, 248, 0.22);
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(56, 189, 248, 0.06) 42%, rgba(30, 41, 59, 0.72) 100%);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

[data-theme="dark"] .ai-extract-panel__glow {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, transparent 70%);
}

.ai-extract-panel__head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 14px;
}

.ai-extract-panel__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-extract-panel__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--primary);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.16), rgba(56, 189, 248, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .ai-extract-panel__icon {
    color: var(--primary-light);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.28), rgba(56, 189, 248, 0.12));
    border-color: rgba(129, 140, 248, 0.28);
}

.ai-extract-panel__titles {
    min-width: 0;
    flex: 1;
}

.ai-extract-panel__title-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 0;
}

.ai-extract-panel__title {
    font-size: 15px;
    font-weight: 650;
    letter-spacing: 0.01em;
    color: var(--text);
    flex-shrink: 0;
}

.ai-extract-panel__badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.18);
    flex-shrink: 0;
}

[data-theme="dark"] .ai-extract-panel__badge {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(129, 140, 248, 0.28);
}

.ai-extract-panel__desc {
    display: block;
    flex: 1 1 200px;
    min-width: 0;
    max-width: none;
    margin: 0;
    line-height: 1.45;
    color: var(--text-muted);
}

.ai-extract-panel__body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.ai-extract-slot {
    flex: 1 1 200px;
    min-width: 200px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(99, 102, 241, 0.28);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ai-extract-slot:hover,
.ai-extract-slot:focus-within {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-theme="dark"] .ai-extract-slot {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(129, 140, 248, 0.28);
}

[data-theme="dark"] .ai-extract-slot:hover,
[data-theme="dark"] .ai-extract-slot:focus-within {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(129, 140, 248, 0.45);
}

.ai-extract-slot label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 550;
    color: var(--text-muted);
}

.ai-extract-slot .form-control[type="file"] {
    padding: 8px 10px;
    font-size: 13px;
    background: var(--input-bg);
    border-color: var(--border);
    cursor: pointer;
}

.ai-extract-slot .fu-dropzone {
    margin-top: 0;
}

.ai-extract-slot:has(.fu-dropzone) {
    padding: 10px;
}

.ai-extract-panel__cta {
    align-self: flex-end;
    min-height: 40px;
    padding-inline: 18px;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.ai-extract-panel__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.ai-extract-panel__cta:active {
    transform: translateY(0) scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
    .ai-extract-slot,
    .ai-extract-panel__cta {
        transition: none;
    }
    .ai-extract-panel__cta:hover,
    .ai-extract-panel__cta:active {
        transform: none;
    }
}

.ai-extract-status {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
}

.ai-extract-status.is-loading {
    background: #eef4ff;
    color: #2f5bb7;
    border: 1px solid #c7d7fe;
}

.ai-extract-status.is-success {
    background: #eef9f0;
    color: #1f7a3a;
    border: 1px solid #b7e4c0;
}

.ai-extract-status.is-error {
    background: #fff1f0;
    color: #b42318;
    border: 1px solid #fecaca;
}

.ai-extract-status.is-warning {
    background: #fff8e6;
    color: #9a6700;
    border: 1px solid #fde68a;
}

[data-theme="dark"] .ai-extract-status.is-loading {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .ai-extract-status.is-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

[data-theme="dark"] .ai-extract-status.is-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .ai-extract-status.is-warning {
    background: rgba(234, 179, 8, 0.18);
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.35);
}

.ai-extract-progress {
    margin: 10px 0 4px;
}
.ai-extract-progress__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    overflow: hidden;
}
.ai-extract-progress__bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
    transition: width 0.35s ease;
}
.ai-extract-progress__text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted, #64748b);
}
[data-theme="dark"] .ai-extract-progress__bar {
    background: rgba(51, 65, 85, 0.8);
}

/* AI 一审问题清单 */
.ai-review-panel {
    margin-top: 14px;
    padding: 0;
    border: 1px solid var(--border, #d8dde8);
    border-radius: 10px;
    background: var(--surface, #fff);
    overflow: hidden;
}
.ai-review-panel.is-fail {
    border-color: #fca5a5;
}
.ai-review-panel.is-pass {
    border-color: #86efac;
}
.ai-review-panel__head {
    display: block;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: #f8fafc;
}
.ai-review-panel.is-fail .ai-review-panel__head {
    background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}
.ai-review-panel.is-pass .ai-review-panel__head {
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}
.ai-review-panel__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 8px;
}
.ai-review-panel__title {
    font-size: 15px;
    color: var(--text, #0f172a);
}
.ai-review-panel__tip {
    display: inline-flex;
    align-items: center;
    flex: 1 1 260px;
    min-width: 0;
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    line-height: 1.5;
}
.ai-review-panel__tip[hidden] {
    display: none;
}
.ai-review-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
}
.ai-review-badge.is-pass {
    background: #16a34a;
    color: #fff;
}
.ai-review-badge.is-fail {
    background: #dc2626;
    color: #fff;
}
.ai-review-counts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}
.ai-review-counts__err,
.ai-review-counts__warn,
.ai-review-counts__ok {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.ai-review-counts__err {
    background: #fee2e2;
    color: #b91c1c;
}
.ai-review-counts__warn {
    background: #fef3c7;
    color: #b45309;
}
.ai-review-counts__ok {
    background: #dcfce7;
    color: #15803d;
}
.ai-review-panel__summary {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted, #475569);
    line-height: 1.55;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.03);
}
.ai-review-panel__body {
    padding: 12px 14px 14px;
}
.ai-review-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    padding: 14px 16px;
    border-top: 2px solid #f59e0b;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}
.ai-review-panel__actions[hidden] {
    display: none !important;
}
.ai-review-panel__actions-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 220px;
}
.ai-review-panel__actions-copy strong {
    font-size: 14px;
    color: #92400e;
    line-height: 1.4;
}
.ai-review-panel__actions-copy span {
    font-size: 13px;
    color: #a16207;
    line-height: 1.45;
}
.ai-review-panel__actions #report-ai-ignore-btn {
    flex: 0 0 auto;
    font-weight: 700;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
.ai-review-group + .ai-review-group {
    margin-top: 14px;
}
.ai-review-group__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ai-review-group__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ai-review-group--error .ai-review-group__dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
.ai-review-group--warning .ai-review-group__dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}
.ai-review-group__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text, #1e293b);
}
.ai-review-group--error .ai-review-group__title {
    color: #b91c1c;
}
.ai-review-group--warning .ai-review-group__title {
    color: #b45309;
}
.ai-review-group__count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    background: #e2e8f0;
    color: #334155;
}
.ai-review-group--error .ai-review-group__count {
    background: #fecaca;
    color: #991b1b;
}
.ai-review-group--warning .ai-review-group__count {
    background: #fde68a;
    color: #92400e;
}
.ai-review-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-review-item {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ai-review-item--error {
    border-left-color: #ef4444;
    background: #fffafa;
    border-color: #fecaca;
}
.ai-review-item--warning {
    border-left-color: #f59e0b;
    background: #fffdf5;
    border-color: #fde68a;
}
.ai-review-item__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 8px;
}
.ai-review-item__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}
.ai-review-item--error .ai-review-item__index {
    background: #fecaca;
    color: #991b1b;
}
.ai-review-item--warning .ai-review-item__index {
    background: #fde68a;
    color: #92400e;
}
.ai-review-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e0e7ff;
    color: #3730a3;
}
.ai-review-sev {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}
.ai-review-sev--error {
    background: #fee2e2;
    color: #b91c1c;
}
.ai-review-sev--warning {
    background: #fef3c7;
    color: #b45309;
}
.ai-review-loc {
    font-size: 12px;
    color: #64748b;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-review-loc::before {
    content: '位置';
    display: inline-block;
    margin-right: 6px;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    background: #e2e8f0;
    color: #475569;
    vertical-align: 1px;
}
.ai-review-item__msg {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text, #0f172a);
    margin-bottom: 2px;
}
.ai-review-quote,
.ai-review-suggest {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
}
.ai-review-quote {
    background: #f1f5f9;
    color: #475569;
    border: 1px dashed #cbd5e1;
}
.ai-review-suggest {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}
.ai-review-quote__label,
.ai-review-suggest__label {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
}
.ai-review-quote__label {
    background: #cbd5e1;
    color: #334155;
}
.ai-review-suggest__label {
    background: #2563eb;
    color: #fff;
}
.ai-review-quote__text,
.ai-review-suggest__text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.ai-review-empty {
    font-size: 13px;
    font-weight: 600;
    color: #15803d;
    padding: 14px;
    text-align: center;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px dashed #86efac;
}

[data-theme="dark"] .ai-review-panel {
    background: var(--surface, #1e293b);
    border-color: var(--border, #334155);
}
[data-theme="dark"] .ai-review-panel.is-fail {
    border-color: rgba(248, 113, 113, 0.55);
}
[data-theme="dark"] .ai-review-panel.is-pass {
    border-color: rgba(74, 222, 128, 0.55);
}
[data-theme="dark"] .ai-review-panel__head {
    background: rgba(15, 23, 42, 0.45);
    border-bottom-color: var(--border, #334155);
}
[data-theme="dark"] .ai-review-panel.is-fail .ai-review-panel__head {
    background: rgba(239, 68, 68, 0.1);
}
[data-theme="dark"] .ai-review-panel.is-pass .ai-review-panel__head {
    background: rgba(34, 197, 94, 0.1);
}
[data-theme="dark"] .ai-review-panel__summary {
    background: rgba(15, 23, 42, 0.35);
    color: #94a3b8;
}
[data-theme="dark"] .ai-review-panel__tip {
    border-color: rgba(96, 165, 250, 0.35);
    background: rgba(30, 64, 175, 0.25);
    color: #bfdbfe;
}
[data-theme="dark"] .ai-review-panel__actions {
    border-top-color: #d97706;
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.35) 0%, rgba(146, 64, 14, 0.28) 100%);
}
[data-theme="dark"] .ai-review-panel__actions-copy strong {
    color: #fcd34d;
}
[data-theme="dark"] .ai-review-panel__actions-copy span {
    color: #fbbf24;
}
[data-theme="dark"] .ai-review-badge.is-pass {
    background: #16a34a;
    color: #fff;
}
[data-theme="dark"] .ai-review-badge.is-fail {
    background: #dc2626;
    color: #fff;
}
[data-theme="dark"] .ai-review-item {
    background: rgba(30, 41, 59, 0.9);
    border-color: #334155;
    box-shadow: none;
}
[data-theme="dark"] .ai-review-item--error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(248, 113, 113, 0.35);
}
[data-theme="dark"] .ai-review-item--warning {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(251, 191, 36, 0.35);
}
[data-theme="dark"] .ai-review-tag {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
}
[data-theme="dark"] .ai-review-item__msg {
    color: #e2e8f0;
}
[data-theme="dark"] .ai-review-loc {
    color: #94a3b8;
}
[data-theme="dark"] .ai-review-loc::before {
    background: #475569;
    color: #e2e8f0;
}
[data-theme="dark"] .ai-review-quote {
    background: rgba(15, 23, 42, 0.55);
    border-color: #475569;
    color: #cbd5e1;
}
[data-theme="dark"] .ai-review-suggest {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.4);
    color: #bfdbfe;
}
[data-theme="dark"] .ai-review-quote__label {
    background: #475569;
    color: #e2e8f0;
}
[data-theme="dark"] .ai-review-empty {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(74, 222, 128, 0.4);
    color: #86efac;
}

@keyframes ai-fill-flash {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
    40% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }
    100% { box-shadow: inset 0 0 0 1px #f0d56a; }
}
#archive-form .ai-filled-flash,
#report-form .ai-filled-flash,
#contract-form .ai-filled-flash {
    animation: ai-fill-flash 0.85s ease;
}

/* 盖章提示 form-hint 四态 */
#ai-stamp-hint.form-hint {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    line-height: 1.5;
}

#ai-stamp-hint.form-hint.is-loading {
    background: #eef4ff;
    color: #2f5bb7;
}

#ai-stamp-hint.form-hint.is-success {
    background: #eef9f0;
    color: #1f7a3a;
}

#ai-stamp-hint.form-hint.is-error {
    background: #fff1f0;
    color: #b42318;
}

#ai-stamp-hint.form-hint.is-warning {
    background: #fff8e6;
    color: #9a6700;
    border: 1px solid #f0d56a;
}

[data-theme="dark"] #ai-stamp-hint.form-hint.is-loading {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

[data-theme="dark"] #ai-stamp-hint.form-hint.is-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

[data-theme="dark"] #ai-stamp-hint.form-hint.is-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] #ai-stamp-hint.form-hint.is-warning {
    background: rgba(234, 179, 8, 0.18);
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.45);
}

#ai-duration-hint.form-hint.is-warning {
    color: #9a6700;
    background: #fff8e6;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #f0d56a;
}
[data-theme="dark"] #ai-duration-hint.form-hint.is-warning {
    background: rgba(234, 179, 8, 0.18);
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.45);
}

/* 回填高亮：浅色底必须配深色字，深色主题用深琥珀底 + 浅字 */
#archive-form .ai-filled,
#report-form .ai-filled,
#contract-form .ai-filled {
    background-color: #fff8db !important;
    color: #0f172a !important;
    box-shadow: inset 0 0 0 1px #f0d56a;
    -webkit-text-fill-color: #0f172a;
}

[data-theme="dark"] #archive-form .ai-filled,
[data-theme="dark"] #report-form .ai-filled,
[data-theme="dark"] #contract-form .ai-filled {
    background-color: #3f3420 !important;
    color: #fef3c7 !important;
    box-shadow: inset 0 0 0 1px #ca8a04;
    -webkit-text-fill-color: #fef3c7;
}

[data-theme="dark"] #archive-form select.ai-filled option,
[data-theme="dark"] #report-form select.ai-filled option,
[data-theme="dark"] #contract-form select.ai-filled option {
    background-color: #1e293b;
    color: #f1f5f9;
}

/* 存档强关联：项目主档选择器 */
.archive-project-picker__row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.archive-project-picker__row .form-control {
    flex: 1 1 220px;
    min-width: 180px;
}
.archive-project-picker__list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    border: 1px solid var(--border, #d8dee6);
    border-radius: 8px;
    background: var(--card-bg, #fff);
    max-height: 260px;
    overflow: auto;
    z-index: 20;
    position: relative;
}
.archive-project-picker__item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #eef2f6);
}
.archive-project-picker__item:last-child {
    border-bottom: 0;
}
.archive-project-picker__item:hover,
.archive-project-picker__item.is-recommend {
    background: #f0f7ff;
}
[data-theme="dark"] .archive-project-picker__item:hover,
[data-theme="dark"] .archive-project-picker__item.is-recommend {
    background: rgba(59, 130, 246, 0.15);
}
.archive-project-picker__item-title {
    font-weight: 600;
    font-size: 13px;
}
.archive-project-picker__item-sub {
    font-size: 12px;
    color: var(--muted, #64748b);
    margin-top: 2px;
}
.archive-project-picker__empty {
    padding: 10px 12px;
    color: var(--muted, #64748b);
    font-size: 13px;
}
.archive-project-picker__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
}
.archive-project-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    border: 1px solid var(--border, #d8dee6);
    border-radius: 12px;
    padding: 0;
    max-width: min(560px, 94vw);
    width: 560px;
    max-height: min(90vh, 720px);
    overflow: auto;
    background: var(--bg-card-solid, #fff);
    color: var(--text, #0f172a);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}
.archive-project-dialog::backdrop {
    background: var(--overlay-scrim, rgba(15, 23, 42, 0.35));
}
.archive-project-dialog__inner {
    padding: 18px 20px;
    margin: 0;
}
.archive-project-dialog__title {
    margin: 0 0 10px;
    font-size: 16px;
}
.archive-project-dialog__meta {
    display: grid;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--soft-bg, #f8fafc);
    border-radius: 8px;
}
.archive-project-dialog__details {
    max-height: 220px;
    overflow: auto;
    font-size: 13px;
    margin-bottom: 14px;
}
.archive-project-dialog__section {
    margin-bottom: 10px;
}
.archive-project-dialog__section ul {
    margin: 4px 0 0;
    padding-left: 18px;
}
.archive-project-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.archive-project-dialog__error {
    color: #b91c1c;
}

/* 报告识别：公章澄清右侧面板 */
.ai-clarify-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1200;
    width: min(400px, 100vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #fff);
    border-left: 1px solid var(--border, #e5e7eb);
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08);
}
.ai-clarify-drawer[hidden] {
    display: none !important;
}
.ai-clarify-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.ai-clarify-drawer__title {
    font-size: 15px;
}
.ai-clarify-drawer__close {
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted, #64748b);
    padding: 2px 6px;
}
.ai-clarify-drawer__body {
    flex: 1;
    overflow: auto;
    padding: 14px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-clarify-drawer__preview {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #f8fafc;
    min-height: 180px;
    max-height: 42vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-clarify-drawer__preview img {
    display: block;
    max-width: 100%;
    height: auto;
}
.ai-clarify-drawer__preview-empty {
    margin: 0;
    padding: 24px 12px;
    color: var(--muted, #64748b);
    font-size: 13px;
    text-align: center;
}
.ai-clarify-drawer__question {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #9a6700;
    background: #fff8e6;
    border: 1px solid #f0d56a;
    border-radius: 6px;
    padding: 8px 10px;
}
.ai-clarify-drawer__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ai-clarify-chip {
    border: 1px solid var(--border, #cbd5e1);
    background: #fff;
    color: #0f172a;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.3;
}
.ai-clarify-chip:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}
.ai-clarify-drawer__label {
    font-size: 12px;
    color: var(--muted, #64748b);
    margin: 2px 0 0;
}
.ai-clarify-drawer__answer {
    resize: vertical;
    min-height: 72px;
}
.ai-clarify-drawer__status {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}
.ai-clarify-drawer__status.is-loading {
    color: #2f5bb7;
}
.ai-clarify-drawer__status.is-error {
    color: #b42318;
}
.ai-clarify-drawer__send {
    align-self: flex-start;
    margin-top: 4px;
}
body.ai-clarify-open {
    overflow-x: hidden;
}
@media (max-width: 640px) {
    .ai-clarify-drawer {
        width: 100vw;
    }
}
[data-theme="dark"] .ai-clarify-drawer {
    background: var(--card-bg, #1e293b);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .ai-clarify-drawer__preview {
    background: #0f172a;
}
[data-theme="dark"] .ai-clarify-drawer__question {
    background: rgba(234, 179, 8, 0.18);
    color: #fde68a;
    border-color: rgba(234, 179, 8, 0.45);
}
[data-theme="dark"] .ai-clarify-chip {
    background: #0f172a;
    color: #e2e8f0;
    border-color: #334155;
}
[data-theme="dark"] .ai-clarify-chip:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: #60a5fa;
    color: #93c5fd;
}

/* 向量维护双栏 */
.vec-maintain__page-header {
    align-items: flex-start;
}

.vec-maintain__page-header .page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.vec-maintain__action-form {
    display: inline-flex;
    margin: 0;
}

.vec-maintain__page-header .btn-ghost,
.vec-maintain__ocr-actions .btn-ghost,
.vec-maintain__item-actions .btn-ghost,
.vec-maintain__ocr-footer .btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.vec-maintain__page-header .btn-ghost:hover,
.vec-maintain__ocr-actions .btn-ghost:hover,
.vec-maintain__item-actions .btn-ghost:hover,
.vec-maintain__ocr-footer .btn-ghost:hover {
    background: var(--accent-subtle);
    color: var(--primary);
    border-color: var(--primary);
}

.vec-maintain .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.vec-maintain {
    display: grid;
    grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    min-height: calc(100vh - 180px);
}

.vec-maintain__list,
.vec-maintain__ocr {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.vec-maintain__list-head,
.vec-maintain__ocr-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.vec-maintain__ocr-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.vec-maintain__ocr-head > div:first-child {
    flex: 1 1 360px;
    min-width: 0;
}

.vec-maintain__ocr-head strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}

.vec-maintain__ocr-meta {
    margin: 5px 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.vec-maintain__ocr-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vec-maintain__items {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: auto;
    flex: 1;
}

.vec-maintain__item {
    position: relative;
    border-bottom: 1px solid var(--border);
}

.vec-maintain__item.is-active {
    background: var(--accent-muted);
    box-shadow: inset 3px 0 0 var(--primary);
}

.vec-maintain__item-main {
    display: block;
    padding: 12px 16px 8px;
    color: inherit;
    text-decoration: none;
}

.vec-maintain__item-main:hover {
    background: var(--nav-hover-bg);
}

.vec-maintain__item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
}

.vec-maintain__item-meta,
.vec-maintain__item-status {
    font-size: 12px;
    margin-top: 5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.vec-maintain__chunk-count {
    display: inline;
    margin: 0 0 0 5px;
    color: var(--text-muted);
}

.vec-maintain__item-error {
    color: var(--danger-text);
    margin-top: 5px;
}

.vec-maintain__item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 16px 12px;
}

.vec-maintain__item-actions .btn {
    min-height: 30px;
}

.vec-maintain__empty {
    padding: 16px;
    margin: 0;
    color: var(--text-muted);
}

.vec-maintain__ocr-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px 16px;
    min-height: 0;
}

.vec-maintain__textarea {
    flex: 1;
    width: 100%;
    min-height: 420px;
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    resize: vertical;
}

pre.vec-maintain__textarea {
    margin: 0;
    overflow: auto;
    background: var(--elevated);
    border-radius: 8px;
    padding: 14px;
}

.vec-maintain__ocr-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.vec-maintain__ocr-footer .form-hint {
    flex: 1 1 260px;
    margin: 0;
    color: var(--text-muted);
}

[data-theme="dark"] .vec-maintain__item.is-active {
    background: var(--accent-muted);
}

[data-theme="dark"] pre.vec-maintain__textarea {
    background: var(--elevated);
}

@media (max-width: 1180px) {
    .vec-maintain {
        grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
    }

    .vec-maintain__page-header .page-actions {
        flex: 1 1 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 960px) {
    .vec-maintain {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .vec-maintain__list {
        max-height: 40vh;
    }
}

/* 向量分片结构核对 */
.vec-maintain__tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    padding: 7px 12px 0;
    background: var(--elevated);
}

.vec-maintain__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    border-radius: 8px 8px 0 0;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.vec-maintain__tab:hover {
    color: var(--primary);
    background: var(--accent-subtle);
}

.vec-maintain__tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--surface);
    font-weight: 600;
}

.vec-maintain__chunks {
    flex: 1;
    overflow: auto;
    padding: 14px 16px 16px;
}

.vec-maintain__chunk-summary {
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 14px;
    color: var(--text);
}

.vec-maintain__chunk-table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.vec-maintain__chunk-table {
    min-width: 1050px;
    font-size: 12px;
}

.vec-maintain__chunk-table td,
.vec-maintain__chunk-table th {
    vertical-align: top;
    line-height: 1.45;
}

.vec-maintain__chunk-table details summary {
    cursor: pointer;
    line-height: 1.4;
    color: var(--text);
}

.vec-maintain__chunk-text {
    margin: 8px 0;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    background: var(--elevated);
    border-radius: 6px;
}

@media (max-width: 640px) {
    .vec-maintain__page-header .page-actions,
    .vec-maintain__ocr-actions,
    .vec-maintain__ocr-footer {
        align-items: stretch;
    }

    .vec-maintain__page-header .btn,
    .vec-maintain__ocr-actions .btn {
        justify-content: center;
    }

    .vec-maintain__tabs {
        padding-inline: 8px;
    }

    .vec-maintain__tab {
        flex: 1;
        padding-inline: 10px;
    }
}

/* ========== 品牌 Logo（侧栏 / 登录 / 系统预设） ========== */
.login-logo__img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 56px;
    width: auto;
    margin: 0 auto 16px;
    object-fit: contain;
}
.brand-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.brand-preset-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated, var(--glass-bg));
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.brand-preset-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.brand-preset-card.is-active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.brand-preset-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.brand-preset-card__logo {
    height: 36px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.brand-preset-card__fav {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.85;
}
.brand-preset-card__label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.3;
}
.brand-preset-card__custom {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-subtle, rgba(37, 99, 235, 0.08));
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}
.brand-size-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px auto;
    gap: 8px;
    align-items: center;
}
.brand-size-control__range {
    padding-left: 0;
    padding-right: 0;
}
.brand-size-control__number {
    text-align: center;
}
.brand-size-control__unit {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}
.brand-sidebar-preview {
    width: 240px;
    max-width: 100%;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--glass-bg);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.brand-sidebar-preview__header {
    display: flex;
    align-items: center;
    height: var(--layout-header-height);
    padding: 0 14px;
    border-bottom: 1px solid var(--border);
    --sidebar-logo-width: 208px;
}
.brand-sidebar-preview__logo {
    display: block;
    width: var(--sidebar-logo-width);
    height: auto;
    max-height: 52px;
    max-width: none;
    flex-shrink: 0;
    object-fit: contain;
    object-position: left center;
}
.brand-sidebar-preview__nav {
    display: grid;
    gap: 10px;
    padding: 14px;
}
.brand-sidebar-preview__nav span {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.16);
}
.brand-sidebar-preview__nav span:nth-child(1) {
    width: 62%;
}
.brand-sidebar-preview__nav span:nth-child(2) {
    width: 78%;
}
.brand-sidebar-preview__nav span:nth-child(3) {
    width: 54%;
}
.brand-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 18px;
    border-radius: 12px;
}
.brand-preview__logo {
    height: 44px;
    width: auto;
    max-width: min(100%, 360px);
    object-fit: contain;
}
.brand-preview__fav {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}
[data-theme="dark"] .brand-preset-card {
    background: rgba(15, 23, 42, 0.55);
}

/* ========== 通知中心 ========== */
.notif-wrap {
    position: relative;
}
.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.notif-bell:hover,
.notif-bell[aria-expanded="true"] {
    background: var(--accent-subtle, rgba(37, 99, 235, 0.08));
    color: var(--primary);
}
.notif-badge {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    display: none;
}
.notif-badge.is-visible {
    display: inline-block;
}
.notif-center {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(380px, calc(100vw - 24px));
    max-height: min(520px, 70vh);
    display: flex;
    flex-direction: column;
    z-index: 80;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-card-solid, #ffffff);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
[data-theme="dark"] .notif-center {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.notif-center[hidden] {
    display: none !important;
}
.notif-center__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-center__tabs {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}
.notif-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.notif-tab.is-active,
.notif-tab:hover {
    background: var(--accent-subtle, rgba(37, 99, 235, 0.08));
    color: var(--primary);
}
.notif-center__list {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}
.notif-empty {
    padding: 28px 12px;
    text-align: center;
    font-size: 13px;
}
.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.notif-list--scroll {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}
.notif-item--compact {
    padding: 8px 10px;
}
.notif-item--compact .notif-item__title {
    font-size: 13px;
    font-weight: 600;
}
.notif-item--compact .notif-item__body {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}
.notif-item--compact .notif-item__meta {
    margin-top: 2px;
    font-size: 11px;
}
.notif-item--row {
    align-items: center;
    gap: 16px;
}
.notif-item--row .notif-item__main {
    min-width: 0;
}
.notif-item--row .notif-item__title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item__side {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    white-space: nowrap;
}
.notif-item__time {
    font-size: 12px;
    color: var(--text-muted);
}
.notif-item__link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}
.notif-item__link:hover {
    text-decoration: underline;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    transition: background 0.15s;
}
.notif-item:hover {
    background: var(--accent-subtle, rgba(37, 99, 235, 0.06));
}
.notif-item.is-unread {
    background: rgba(37, 99, 235, 0.06);
}
.notif-item__main {
    flex: 1;
    min-width: 0;
}
.notif-item__title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}
a.notif-item__title:hover {
    color: var(--primary);
}
.notif-item__body {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}
.notif-item__meta {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
[data-theme="dark"] .notif-item.is-unread {
    background: rgba(59, 130, 246, 0.12);
}

/* ========== 仪表盘增强 ========== */
.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}
[data-theme="dark"] .stat-trend {
    color: #34d399;
}
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.dash-panel {
    padding: 20px 22px;
    border-radius: var(--radius);
    min-width: 0;
}
.dash-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.dash-panel__head .section-title {
    margin: 0;
    font-size: 16px;
}
.approval-list__items,
.doc-list__items,
.activity-list__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.approval-list__item,
.doc-list__item,
.activity-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .approval-list__item,
[data-theme="dark"] .doc-list__item,
[data-theme="dark"] .activity-list__item {
    background: rgba(15, 23, 42, 0.35);
}
.approval-list__main,
.doc-list__main,
.activity-list__main {
    flex: 1;
    min-width: 0;
}
.approval-list__title,
.doc-list__title,
.activity-list__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}
a.doc-list__title:hover,
a.activity-list__title:hover {
    color: var(--primary);
}
.approval-list__meta,
.doc-list__meta,
.activity-list__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
}
.approval-list__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}
.doc-list__type {
    flex-shrink: 0;
    min-width: 44px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--accent-subtle, rgba(37, 99, 235, 0.08));
}
.activity-list__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle, rgba(37, 99, 235, 0.08));
    color: var(--primary);
    flex-shrink: 0;
}
.wf-stepper__title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text);
}
.wf-stepper__elapsed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--text-muted);
}
.wf-stepper__elapsed.is-alert {
    color: #d97706;
}
.wf-stepper {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.wf-stepper__step {
    position: relative;
    display: grid;
    grid-template-columns: 16px 1fr;
    column-gap: 12px;
    padding: 0 0 18px 0;
}
.wf-stepper__step:last-child {
    padding-bottom: 0;
}
.wf-stepper__step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 16px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.wf-stepper__dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg, #fff);
    margin-top: 2px;
    z-index: 1;
}
.wf-stepper__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    grid-column: 2;
}
.wf-stepper__hint {
    grid-column: 2;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.wf-stepper__step.is-done .wf-stepper__dot {
    border-color: #059669;
    background: #059669;
    box-shadow: inset 0 0 0 3px #fff;
}
.wf-stepper__step.is-current .wf-stepper__dot {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}
.wf-stepper__step.is-pending .wf-stepper__label,
.wf-stepper__step.is-pending .wf-stepper__hint {
    color: var(--text-muted);
}
[data-theme="dark"] .wf-stepper__dot {
    background: #0f172a;
}
[data-theme="dark"] .wf-stepper__step.is-done .wf-stepper__dot {
    box-shadow: inset 0 0 0 3px #0f172a;
}
@media (max-width: 960px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
    .approval-list__item {
        flex-wrap: wrap;
    }
    .approval-list__actions {
        flex-direction: row;
        width: 100%;
    }
}
@media (max-width: 480px) {
    .brand-preset-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .notif-center {
        position: fixed;
        left: 12px;
        right: 12px;
        top: calc(var(--layout-header-height) + 8px);
        width: auto;
    }
}

/* ========== 向量维护表格 ========== */
.data-table th.col-center,
.data-table td.col-center { text-align: center; }
.data-table th.col-right,
.data-table td.col-right { text-align: right; }
.vector-table { min-width: 860px; }
.vector-table col.vc-project { width: auto; }
.vector-table col.vc-client { width: 22%; }
.vector-table col.vc-num { width: 76px; }
.vector-table col.vc-need { width: 170px; }
.vector-table col.vc-action { width: 92px; }
.vector-table th { white-space: nowrap; }
.vector-table__name {
    font-weight: 600;
    display: inline-block;
    max-width: 100%;
}
.vector-table__client {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
