/* ============================================================
   智能政府门户集群网站系统 · 后台管理设计系统
   无第三方依赖，离线可用；浅色主题 + 政务蓝金配色
   ============================================================ */

:root {
    --c-primary: #1a4f8a;
    --c-primary-dark: #123a63;
    --c-primary-light: #2b83c8;
    --c-accent: #c0272d;
    --c-accent-light: #e04b45;
    --c-gold: #d4a017;

    --c-bg: #f2f5f9;
    --c-surface: #ffffff;
    --c-surface-2: #f8fafc;
    --c-border: #e4e9f0;
    --c-border-strong: #d3dbe6;

    --c-text: #1e2a38;
    --c-text-2: #55657a;
    --c-text-3: #8b98a9;

    --c-ok: #12966b;
    --c-warn: #e0941a;
    --c-danger: #d0342c;
    --c-info: #2b83c8;
    --c-purple: #7a4a8a;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(20, 40, 70, .06), 0 1px 2px rgba(20, 40, 70, .04);
    --shadow: 0 4px 16px rgba(20, 40, 70, .08);
    --shadow-lg: 0 12px 40px rgba(20, 40, 70, .14);
    --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.65;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4,h5 { margin: 0; font-weight: 600; line-height: 1.4; }
p { margin: 0 0 10px; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: 14px; color: inherit; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c3ccd8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8b4c4; }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 18px; height: 18px; fill: currentColor; flex: none; vertical-align: -3px; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ===== 布局 ===== */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 236px;
    flex: none;
    background: linear-gradient(180deg, #0d2540 0%, #123a63 55%, #17456f 100%);
    color: #cfe0f2;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    box-shadow: 2px 0 12px rgba(10,30,55,.18);
}
.sidebar-brand {
    padding: 18px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.09);
    display: flex; align-items: center; gap: 11px;
}
.brand-mark {
    width: 40px; height: 40px; border-radius: 10px; flex: none;
    background: linear-gradient(135deg, var(--c-accent), #e0613c);
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(192,39,45,.4);
}
.brand-mark svg { width: 24px; height: 24px; fill: #fff; }
.brand-text { overflow: hidden; }
.brand-title { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.brand-sub { font-size: 11px; color: #90aecd; letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 10px 24px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

.nav-group { margin-bottom: 4px; }
.nav-group-title {
    font-size: 11px; color: #7f9cbe; letter-spacing: 1.5px; padding: 12px 12px 6px;
    text-transform: uppercase; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px; margin-bottom: 2px;
    color: #c6d8ec; font-size: 13.5px; cursor: pointer; position: relative;
    transition: background .18s, color .18s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(192,39,45,.9), rgba(192,39,45,.55));
    color: #fff; font-weight: 600;
    box-shadow: 0 3px 10px rgba(192,39,45,.3);
}
.nav-item.active::before {
    content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 20px; border-radius: 0 3px 3px 0; background: var(--c-accent);
}
.nav-item .badge-dot {
    margin-left: auto; background: var(--c-accent); color: #fff;
    font-size: 11px; padding: 1px 7px; border-radius: 10px; font-weight: 700;
}
.nav-item .nav-icon { width: 19px; height: 19px; opacity: .95; }

.main-wrap { flex: 1; min-width: 0; margin-left: 236px; display: flex; flex-direction: column; }

.topbar {
    height: 62px; background: #fff; border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 16px; padding: 0 22px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-crumb { font-size: 13px; color: var(--c-text-3); }
.page-crumb b { color: var(--c-text); font-weight: 600; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--c-text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.site-switch {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface-2);
    font-size: 13px; cursor: pointer; transition: border-color .18s;
}
.site-switch:hover { border-color: var(--c-primary-light); }
.top-icon-btn {
    width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center;
    color: var(--c-text-2); position: relative; cursor: pointer; transition: background .18s;
}
.top-icon-btn:hover { background: var(--c-surface-2); }
.top-icon-btn .dot {
    position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--c-accent); border: 1.5px solid #fff;
}

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 30px; cursor: pointer; }
.user-chip:hover { background: var(--c-surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.user-meta { line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--c-text-3); }

.page { padding: 20px 22px 40px; flex: 1; }

/* ===== 通用元素 ===== */
.card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-head {
    padding: 14px 18px; border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 10px;
}
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--c-text-3); font-weight: 400; }
.card-head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1400px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1100px) {
    .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}

.stat-card {
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius);
    padding: 16px 18px; display: flex; align-items: flex-start; gap: 14px;
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::after {
    content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
    border-radius: 50%; background: currentColor; opacity: .07;
}
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
    color: #fff;
}
.stat-icon svg { width: 24px; height: 24px; fill: #fff; }
.stat-info { min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--c-text-3); display: flex; align-items: center; gap: 5px; }
.stat-value { font-size: 27px; font-weight: 700; line-height: 1.25; letter-spacing: -.5px; font-feature-settings: "tnum"; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--c-text-3); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--c-text-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--c-ok); }
.trend-down { color: var(--c-danger); }

/* 标签式按钮（图表类型切换、下钻维度切换） */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .spacer { flex: 1; }
.chip {
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
    padding: 5px 12px; font-size: 12.5px; border-radius: 999px;
    border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-text-2);
    transition: all .16s; white-space: nowrap;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip-on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.chip-on:hover { color: #fff; opacity: .92; }
.chip-ai { border-style: dashed; border-color: var(--c-primary); color: var(--c-primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 15px; border-radius: 8px; border: 1px solid transparent;
    background: var(--c-primary); color: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500;
    transition: all .18s; white-space: nowrap;
}
.btn:hover { background: var(--c-primary-dark); box-shadow: 0 3px 10px rgba(26,79,138,.25); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-outline { background: #fff; border-color: var(--c-border-strong); color: var(--c-text); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); background: #f5f9ff; box-shadow: none; }
.btn-danger { background: var(--c-danger); }
.btn-danger:hover { background: #b02a24; box-shadow: 0 3px 10px rgba(208,52,44,.25); }
.btn-success { background: var(--c-ok); }
.btn-success:hover { background: #0d7d59; }
.btn-warn { background: var(--c-warn); }
.btn-ghost { background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); box-shadow: none; }
.btn-accent { background: linear-gradient(135deg, var(--c-accent), var(--c-accent-light)); }
.btn-accent:hover { box-shadow: 0 3px 12px rgba(192,39,45,.3); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--c-text); }
.form-label .req { color: var(--c-danger); margin-left: 2px; }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid var(--c-border-strong); border-radius: 8px;
    background: #fff; transition: border-color .18s, box-shadow .18s; font-size: 13.5px;
}
.form-control:focus { outline: none; border-color: var(--c-primary-light); box-shadow: 0 0 0 3px rgba(43,131,200,.13); }
.form-control[readonly] { background: var(--c-surface-2); }
textarea.form-control { min-height: 120px; line-height: 1.7; resize: vertical; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2355657a'><path d='M7 10l5 5 5-5z'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.form-hint { font-size: 12px; color: var(--c-text-3); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 20px; background: #cfd8e3; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--c-primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.checkline { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; }
.checkline input { accent-color: var(--c-primary); width: 15px; height: 15px; }

.table { width: 100%; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 600; color: var(--c-text-2); background: var(--c-surface-2);
    padding: 11px 14px; border-bottom: 1px solid var(--c-border); font-size: 12.5px; white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #f7fafd; }
.table tbody tr:last-child td { border-bottom: none; }
.table .actions { display: flex; gap: 6px; }
.table-img-thumb { width: 46px; height: 34px; border-radius: 6px; background: #ddd; object-fit: cover; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.7; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-gray { background: #eef1f5; color: #61718a; }
.badge-blue { background: #e6f0fb; color: #1a5fb0; }
.badge-green { background: #e3f6ee; color: #0d7d59; }
.badge-orange { background: #fdf1de; color: #b3720b; }
.badge-red { background: #fdeaea; color: #b52d28; }
.badge-purple { background: #f2e9f8; color: #6b3b82; }
.badge-outline { background: transparent; border: 1px solid var(--c-border-strong); color: var(--c-text-2); }

.alert { padding: 12px 15px; border-radius: 10px; display: flex; gap: 10px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert svg { flex: none; margin-top: 2px; }
.alert-success { background: #e8f8f1; border-color: #b5e5d2; color: #0c6b4c; }
.alert-info { background: #e9f2fc; border-color: #bcdcf8; color: #14518f; }
.alert-warn { background: #fdf6e6; border-color: #f4dfae; color: #96630c; }
.alert-error { background: #fdeeec; border-color: #f6c8c4; color: #a52a24; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 16px; font-size: 13.5px; color: var(--c-text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: all .18s; }
.tab:hover { color: var(--c-primary); }
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }
.tab .count { font-size: 11px; background: #eef1f5; padding: 1px 6px; border-radius: 10px; margin-left: 5px; }
.tab.active .count { background: var(--c-primary); color: #fff; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box input { padding-left: 36px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--c-text-3); }

.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.page-link { padding: 6px 12px; border: 1px solid var(--c-border); border-radius: 7px; font-size: 13px; color: var(--c-text-2); background: #fff; }
.page-link:hover { border-color: var(--c-primary); color: var(--c-primary); }
.page-link.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.page-link.disabled { opacity: .5; pointer-events: none; }
.page-info { font-size: 12.5px; color: var(--c-text-3); margin-left: 8px; }

.empty { text-align: center; padding: 50px 20px; color: var(--c-text-3); }
.empty svg { width: 58px; height: 58px; opacity: .35; margin-bottom: 12px; }
.empty-title { font-size: 15px; color: var(--c-text-2); font-weight: 600; margin-bottom: 4px; }

/* 进度条 */
.progress { height: 7px; background: #e9eef4; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--c-primary-light), var(--c-primary)); border-radius: 10px; transition: width .6s ease; }
.progress-bar.ok { background: linear-gradient(90deg, #35c08a, var(--c-ok)); }
.progress-bar.warn { background: linear-gradient(90deg, #f3c366, var(--c-warn)); }
.progress-bar.danger { background: linear-gradient(90deg, #ef7b74, var(--c-danger)); }

/* 时间线 */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--c-border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
    content: ''; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px;
    border-radius: 50%; background: #fff; border: 2px solid var(--c-primary-light);
}
.timeline-item.ok::before { border-color: var(--c-ok); background: var(--c-ok); }
.timeline-item.warn::before { border-color: var(--c-warn); background: var(--c-warn); }
.timeline-title { font-size: 13.5px; font-weight: 600; }
.timeline-meta { font-size: 12px; color: var(--c-text-3); }

/* 列表项 */
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--c-border); }
.list-item:last-child { border-bottom: none; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-title:hover { color: var(--c-primary); }
.list-item .li-meta { font-size: 12px; color: var(--c-text-3); }
.list-index { width: 22px; height: 22px; border-radius: 6px; background: var(--c-surface-2); color: var(--c-text-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.list-index.top { background: linear-gradient(135deg, var(--c-accent), #e0613c); color: #fff; }

/* 助手ları: AI 面板 */
.ai-panel {
    background: linear-gradient(135deg, #f3f8ff 0%, #fdf5f7 100%);
    border: 1px solid #dbe6f5; border-radius: var(--radius); padding: 16px;
}
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ai-btn {
    padding: 7px 13px; border-radius: 20px; border: 1px solid #d3def0; background: #fff;
    font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    transition: all .18s; box-shadow: var(--shadow-sm);
}
.ai-btn:hover { border-color: var(--c-primary-light); color: var(--c-primary); transform: translateY(-1px); }
.ai-btn.primary { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light)); color: #fff; border-color: transparent; }
.ai-btn.primary:hover { color: #fff; }
.ai-result { background: #fff; border: 1px solid var(--c-border); border-radius: 10px; padding: 14px; margin-top: 12px; max-height: 320px; overflow-y: auto; line-height: 1.85; font-size: 14px; }
.ai-thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--c-text-2); font-size: 13px; }
/* AI 伴写：光标续写候选提示 */
.ai-ghost { margin-top: -6px; padding: 10px 12px; background: linear-gradient(90deg, rgba(26,79,138,.08), rgba(26,79,138,.02)); border: 1px dashed var(--c-primary-light); border-radius: 0 0 8px 8px; font-size: 14px; color: var(--c-text-2); line-height: 1.8; max-height: 130px; overflow: auto; }
.ai-ghost .gk { display:inline-block; font-size:11px; padding:1px 6px; border-radius:4px; background: var(--c-primary); color:#fff; margin-right:6px; vertical-align:1px; }
.ai-ghost .gidx { color: var(--c-text-3); font-size: 12px; margin-left: 8px; }
.ai-round { padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; font-size: 13px; line-height: 1.7; }
.ai-round.user { background: #eef4fb; text-align: right; }
.ai-round.ai { background: #f6f6f8; }
kbd { display:inline-block; padding:1px 5px; font-size:11px; line-height:16px; border:1px solid var(--c-border); border-bottom-width:2px; border-radius:4px; background:#fff; color: var(--c-text-2); font-family:inherit; }
.dot-typing { display: inline-flex; gap: 3px; }
.dot-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--c-primary-light); animation: bounce 1.2s infinite; }
.dot-typing span:nth-child(2) { animation-delay: .2s; }
.dot-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* 聊天 */
.chat-box { display: flex; flex-direction: column; height: 460px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; background: #f7f9fc; }
.chat-msg { display: flex; gap: 10px; margin-bottom: 16px; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; font-size: 12px; }
.chat-bubble {
    max-width: 74%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.75;
    background: #fff; border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.chat-msg.user .chat-bubble { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light)); color: #fff; border-color: transparent; }
.chat-bubble .sources { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--c-border); font-size: 12px; color: var(--c-text-3); }
.chat-input-bar { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--c-border); background: #fff; }
.chat-input-bar input { flex: 1; }

/* 看板 */
.dashboard-hero {
    background: linear-gradient(120deg, #0d2540 0%, #1a4f8a 50%, #2b83c8 100%);
    border-radius: 16px; padding: 22px 26px; color: #fff; margin-bottom: 18px;
    position: relative; overflow: hidden; box-shadow: var(--shadow);
}
.dashboard-hero::after {
    content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%);
}
.hero-title { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { font-size: 13px; opacity: .85; margin-top: 3px; }
.hero-stats { display: flex; gap: 28px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stat .hs-value { font-size: 22px; font-weight: 700; }
.hero-stat .hs-label { font-size: 12px; opacity: .82; }

.chart-box { width: 100%; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--c-text-2); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* 站点树 */
.site-tree { font-size: 13.5px; }
.tree-node { border-left: 2px solid var(--c-border); margin-left: 8px; }
.tree-row {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 14px; border-radius: 8px;
    cursor: pointer; transition: background .15s; position: relative;
}
.tree-row:hover { background: var(--c-surface-2); }
.tree-row.selected { background: #e8f1fb; color: var(--c-primary); font-weight: 600; }
.tree-caret { width: 16px; height: 16px; color: var(--c-text-3); transition: transform .2s; flex: none; }
.tree-caret.open { transform: rotate(90deg); }
.tree-children { margin-left: 14px; }

/* 模板卡片 */
.tpl-card {
    border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: #fff;
    transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.tpl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tpl-preview { height: 132px; position: relative; }
.tpl-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.35)); }
.tpl-preview .mock { position: absolute; inset: 0; padding: 14px; color: #fff; }
.tpl-preview .mock .bar { height: 7px; background: rgba(255,255,255,.85); border-radius: 4px; margin-bottom: 6px; }
.tpl-preview .mock .bar.t { width: 42%; height: 11px; }
.tpl-preview .mock .bar.s { width: 68%; }
.tpl-preview .mock .bar.m { width: 86%; }
.tpl-badge { position: absolute; top: 10px; right: 10px; z-index: 2; }
.tpl-info { padding: 12px 14px; }
.tpl-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.tpl-desc { font-size: 12px; color: var(--c-text-3); line-height: 1.5; min-height: 36px; }

/* 模块开关列表 */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.module-item {
    border: 1px solid var(--c-border); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start;
    transition: border-color .18s, background .18s;
}
.module-item:hover { border-color: var(--c-primary-light); background: #f8fbff; }
.module-item.off { opacity: .6; }
.module-item .mi-icon { width: 34px; height: 34px; border-radius: 9px; background: #eef4fb; color: var(--c-primary); display: grid; place-items: center; flex: none; }
.module-item .mi-title { font-size: 13.5px; font-weight: 600; }
.module-item .mi-cate { font-size: 11.5px; color: var(--c-text-3); }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,30,50,.5); display: none; z-index: 200; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 900px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; }
.modal-head h3 { font-size: 16px; }
.modal-close { margin-left: auto; cursor: pointer; color: var(--c-text-3); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 10px; background: var(--c-surface-2); }

/* Toast */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
    padding: 11px 18px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px; font-size: 13.5px; border-left: 4px solid var(--c-ok);
    animation: toastIn .3s ease;
}
.toast.error { border-left-color: var(--c-danger); }
.toast.info { border-left-color: var(--c-info); }
.toast.warn { border-left-color: var(--c-warn); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* 抽屉/富文本工具栏 */
.editor-toolbar {
    display: flex; gap: 4px; padding: 8px 10px; border: 1px solid var(--c-border-strong);
    border-bottom: none; border-radius: 8px 8px 0 0; background: var(--c-surface-2); flex-wrap: wrap; align-items: center;
}
.editor-toolbar button {
    padding: 4px 9px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--c-text-2);
}
.editor-toolbar button:hover { background: #e7eef6; color: var(--c-primary); }
.editor-area { border: 1px solid var(--c-border-strong); border-radius: 0 0 8px 8px; min-height: 360px; padding: 16px; background: #fff; outline: none; line-height: 1.9; font-size: 14.5px; }
.editor-area:focus { border-color: var(--c-primary-light); }
.editor-area p { margin-bottom: 14px; }
.editor-area img { max-width: 100%; border-radius: 8px; }
.editor-area h2, .editor-area h3 { margin: 18px 0 10px; }
.editor-area blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--c-primary); background: #f5f9ff; color: var(--c-text-2); }
.editor-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1200px) { .editor-split { grid-template-columns: 1fr; } }

/* AI 侧栏 */
.ai-side { position: sticky; top: 80px; }
.ai-feature {
    border: 1px solid var(--c-border); border-radius: 10px; padding: 12px; margin-bottom: 10px;
    background: #fff; transition: all .18s; cursor: pointer;
}
.ai-feature:hover { border-color: var(--c-primary-light); box-shadow: var(--shadow-sm); }
.ai-feature h4 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.ai-feature p { font-size: 12px; color: var(--c-text-3); margin: 4px 0 0; }
.spark-badge {
    display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
    background: linear-gradient(135deg, #7a4a8a, #ba88c9); color: #fff;
}

/* 权限矩阵 */
.perm-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; }
.perm-item:hover { background: var(--c-surface-2); }
.perm-group-title { font-size: 13px; font-weight: 600; padding: 10px 0 4px; }

/* 登录页 */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(135deg, #0d2540 0%, #1a4f8a 45%, #2b83c8 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
    background: radial-gradient(circle, rgba(192,39,45,.28), transparent 65%); top: -220px; right: -160px;
}
.login-card {
    background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
    padding: 34px 34px 28px; position: relative; z-index: 1;
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .mark {
    width: 58px; height: 58px; border-radius: 15px; margin: 0 auto 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--c-accent), #e0613c); box-shadow: 0 8px 20px rgba(192,39,45,.32);
}
.login-brand .mark svg { width: 34px; height: 34px; fill: #fff; }
.login-brand h1 { font-size: 21px; letter-spacing: 1px; }
.login-brand p { font-size: 12.5px; color: var(--c-text-3); margin-top: 2px; letter-spacing: .5px; }
.login-input-wrap { position: relative; margin-bottom: 14px; }
.login-input-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--c-text-3); }
.login-input-wrap input { padding: 12px 14px 12px 40px; border-radius: 10px; }
.login-tip { font-size: 12px; color: var(--c-text-3); text-align: center; margin-top: 14px; line-height: 1.7; }
.quick-login { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.quick-login span {
    font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--c-surface-2);
    border: 1px solid var(--c-border); cursor: pointer; transition: all .18s;
}
.quick-login span:hover { border-color: var(--c-primary); color: var(--c-primary); background: #f5f9ff; }

/* ===== 演示账户面板（仅 DEMO_MODE 开启时渲染）===== */
.login-card-wide { max-width: 520px; }
.demo-panel {
    margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--c-border);
}
.demo-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 10px;
}
.demo-tag { font-size: 12.5px; font-weight: 600; color: var(--c-primary); letter-spacing: .3px; }
.demo-pass { font-size: 11.5px; color: var(--c-text-3); }
.demo-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    max-height: 268px; overflow-y: auto; padding-right: 2px;
}
.demo-chip {
    display: flex; flex-direction: column; gap: 3px; text-align: left;
    padding: 8px 10px; border-radius: 9px; cursor: pointer;
    background: var(--c-surface-2); border: 1px solid var(--c-border);
    transition: border-color .16s, background .16s, transform .16s;
    font: inherit; color: inherit;
}
.demo-chip:hover {
    border-color: var(--c-primary); background: #f5f9ff; transform: translateY(-1px);
}
.dc-line1 {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 6px; font-size: 12.5px;
}
.dc-user { font-size: 11px; color: var(--c-text-3); }
.dc-line2 {
    font-size: 11px; color: var(--c-text-3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dc-mfa {
    font-style: normal; font-size: 10px; padding: 0 5px; margin-left: 4px;
    border-radius: 8px; background: #fff4e5; color: #b26a00; border: 1px solid #ffdca8;
}
.demo-note {
    font-size: 11.5px; color: var(--c-text-3); line-height: 1.65;
    margin-top: 10px; text-align: left;
}
@media (max-width: 520px) {
    .demo-grid { grid-template-columns: 1fr; }
}

/* 响应式 */
@media (max-width: 1000px) {
    .sidebar { width: 64px; }
    .sidebar .brand-text, .sidebar .nav-group-title, .sidebar .nav-item span { display: none; }
    .main-wrap { margin-left: 64px; }
    .nav-item { justify-content: center; padding: 11px; }
}

/* 工具 */
.text-el { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--c-text-3); }
.text-sm { font-size: 12.5px; }
.text-danger { color: var(--c-danger); }
.text-ok { color: var(--c-ok); }
.text-primary { color: var(--c-primary); }
.fw6 { font-weight: 600; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 14px; } .gap-3 { gap: 20px; }
.wrap { flex-wrap: wrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* 高对比度 / 无障碍（后台） */
body.a11y-contrast { --c-text: #000; --c-text-2: #1a1a1a; --c-border: #999; background: #fff; }
body.a11y-large { font-size: 16px; }
body.a11y-large .stat-value { font-size: 30px; }

/* ===== 3.14 智能无障碍服务：手语数字人舞台 / 播报分句 ===== */
.sign-stage {
    background: linear-gradient(160deg, #f2f6fb, #e8eff7);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.sign-avatar {
    width: 190px; height: 190px; margin: 0 auto 10px;
    color: var(--c-primary);
    background: #fff; border-radius: 50%;
    box-shadow: 0 6px 20px rgba(26, 79, 138, .12);
    display: grid; place-items: center;
}
.sign-svg { width: 150px; height: 150px; }
#sign-hands { transition: transform .45s cubic-bezier(.34, 1.3, .64, 1); transform-origin: 60px 66px; }
.sign-caption {
    min-height: 46px; font-size: 16px; font-weight: 600; color: var(--c-text);
    padding: 8px 12px; background: #fff; border-radius: 8px; border: 1px dashed var(--c-border-strong);
}
.sign-progress { height: 6px; background: #dbe4ee; border-radius: 3px; margin-top: 12px; overflow: hidden; }
.sign-progress > i { display: block; height: 100%; width: 0; background: var(--c-primary); transition: width .4s; }
.script-lines { max-height: 260px; overflow: auto; border: 1px solid var(--c-border); border-radius: 8px; }
.script-line { padding: 7px 12px; border-bottom: 1px solid var(--c-border); font-size: 13.5px; line-height: 1.7; }
.script-line:last-child { border-bottom: 0; }
.script-line.on { background: #eaf2fc; color: var(--c-primary); font-weight: 600; }
.form-check { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.form-check input { width: 16px; height: 16px; }

/* ===== 3.9 千人千面：布局入口 / 身份预览 ===== */
.layout-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.le-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff;
    border: 1px solid var(--c-border); border-radius: 10px; transition: all .18s; color: inherit;
}
.le-item:hover { border-color: var(--c-primary); box-shadow: 0 4px 14px rgba(26, 79, 138, .1); transform: translateY(-1px); }
.le-ico { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.le-ico .icon { width: 20px; height: 20px; }
.le-main { flex: 1; min-width: 0; }
.le-main b { display: block; font-size: 14px; }
.le-main small { display: block; font-size: 12px; color: var(--c-text-3, #8a94a6); margin-top: 2px; }
.le-go { flex: none; font-size: 12.5px; color: var(--c-primary); }
