/* ============================================================
   律所 AI 运营中枢 · 样式层
   配色：藏蓝(权威) + 铜金(专业) + 浅灰底(内容区)
   ============================================================ */

:root {
    --navy-900: #0B1E36;
    --navy-800: #102A47;
    --navy-700: #17395E;
    --navy-600: #1F4A78;
    --navy-500: #2C6699;
    --navy-100: #E8F0F8;
    --navy-050: #F2F6FA;

    --gold-600: #A8813F;
    --gold-500: #C29A4E;
    --gold-100: #F7EFDD;

    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --surface-2: #FAFBFC;
    --border: #E3E8EF;
    --border-strong: #D2DAE5;

    --text-1: #16202E;
    --text-2: #4A5768;
    --text-3: #7C8899;
    --text-inv: #FFFFFF;

    --green: #14875A;
    --green-bg: #E6F5EE;
    --red: #C4362F;
    --red-bg: #FCECEB;
    --amber: #B5761B;
    --amber-bg: #FDF3E2;
    --blue: #1F6FBF;
    --blue-bg: #E9F2FC;
    --purple: #6B4BB5;
    --purple-bg: #F0EBFB;

    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 2px rgba(16, 42, 71, .06), 0 1px 3px rgba(16, 42, 71, .04);
    --shadow: 0 4px 12px rgba(16, 42, 71, .08);
    --shadow-lg: 0 12px 32px rgba(16, 42, 71, .14);
    --sidebar-w: 244px;
    --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD4E0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #AAB6C6; }

/* ============ 布局骨架 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: var(--text-inv);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

.brand {
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.10);
}
.brand-mark { display: flex; align-items: center; gap: 11px; }
.brand-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 700; color: #fff;
    letter-spacing: -.5px;
    box-shadow: 0 3px 8px rgba(168,129,63,.35);
}
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: .3px; line-height: 1.25; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.52); letter-spacing: 1.4px; margin-top: 2px; }

.nav-group { padding: 16px 12px 8px; }
.nav-label {
    font-size: 10.5px; color: rgba(255,255,255,.38);
    letter-spacing: 1.6px; padding: 0 10px 8px; font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; margin-bottom: 3px;
    border-radius: 8px; cursor: pointer;
    color: rgba(255,255,255,.74);
    font-size: 13.5px; font-weight: 500;
    transition: background .16s, color .16s;
    border: 1px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
    background: rgba(194,154,78,.16);
    color: #F0D9A8;
    border-color: rgba(194,154,78,.32);
}
.nav-ico { width: 17px; height: 17px; flex-shrink: 0; opacity: .95; }
.nav-badge {
    margin-left: auto; font-size: 10px; padding: 1px 6px;
    background: var(--red); color: #fff; border-radius: 8px; font-weight: 700;
}
.nav-badge.gold { background: var(--gold-600); }
.nav-badge.dim { background: rgba(255,255,255,.16); color: rgba(255,255,255,.8); }

.sidebar-foot {
    margin-top: auto; padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.10);
    font-size: 11px; color: rgba(255,255,255,.42); line-height: 1.7;
}
.sidebar-foot b { color: rgba(255,255,255,.72); font-weight: 600; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ 顶栏 ============ */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 26px; height: 62px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 90;
}
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.topbar .crumb { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.tb-chip {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text-2);
    background: var(--navy-050); border: 1px solid var(--border);
    padding: 5px 11px; border-radius: 20px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.dot.live { animation: pulse 1.8s infinite; }

.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 12.5px; font-weight: 700;
}

.content { padding: 22px 26px 60px; }
.page { display: none; animation: fadeUp .3s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ 通用组件 ============ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.card-head {
    padding: 15px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-head h2 { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }

/* KPI */
.kpi {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px;
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--navy-600);
}
.kpi.gold::before { background: var(--gold-500); }
.kpi.green::before { background: var(--green); }
.kpi.red::before { background: var(--red); }
.kpi.purple::before { background: var(--purple); }
.kpi-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -.8px; margin: 5px 0 3px; line-height: 1.1; }
.kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.trend-up { color: var(--red); font-weight: 600; }
.trend-down { color: var(--green); font-weight: 600; }
.trend-flat { color: var(--text-3); font-weight: 600; }

/* 按钮 */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text-1); font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font);
    transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--navy-050); border-color: var(--navy-500); color: var(--navy-600); }
.btn-primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn-primary:hover { background: var(--navy-600); border-color: var(--navy-600); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); border-color: var(--gold-600); color: #fff; }
.btn-gold:hover { filter: brightness(1.07); color: #fff; }
.btn-danger { color: var(--red); border-color: #EDC5C2; background: var(--red-bg); }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 11.5px; border-radius: 5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 标签 */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 5px;
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--navy-100); color: var(--navy-600);
}
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.purple { background: var(--purple-bg); color: var(--purple); }
.tag.gray { background: #EEF1F5; color: var(--text-2); }
.tag.gold { background: var(--gold-100); color: var(--gold-600); }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
    text-align: left; padding: 10px 14px;
    background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: 11.5px; font-weight: 700; color: var(--text-2);
    letter-spacing: .4px; white-space: nowrap;
}
table.tbl td {
    padding: 11px 14px; border-bottom: 1px solid #F0F3F7; vertical-align: middle;
}
table.tbl tbody tr:hover { background: #FAFCFE; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .strong { font-weight: 600; }
.tbl .muted { color: var(--text-3); font-size: 12px; }
.row-danger { background: #FEF9F9 !important; }
.row-danger:hover { background: #FDF3F2 !important; }

/* 进度条 */
.bar { height: 6px; background: #EDF1F6; border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar-in { height: 100%; border-radius: 3px; background: var(--navy-600); transition: width .5s ease; }
.bar-in.green { background: var(--green); }
.bar-in.gold { background: var(--gold-500); }
.bar-in.red { background: var(--red); }
.bar-in.amber { background: var(--amber); }

/* Tabs */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); padding: 0 20px; background: var(--surface-2); flex-wrap: wrap; }
.tab {
    padding: 11px 16px; font-size: 13.5px; font-weight: 600;
    color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all .15s; white-space: nowrap;
}
.tab:hover { color: var(--navy-600); }
.tab.active { color: var(--navy-700); border-bottom-color: var(--gold-500); }
.tabpanel { display: none; padding: 18px 20px; }
.tabpanel.active { display: block; animation: fadeUp .28s ease; }

/* 表单 */
.form-row { display: grid; gap: 14px; margin-bottom: 14px; }
.fr2 { grid-template-columns: 1fr 1fr; }
.fr3 { grid-template-columns: 1fr 1fr 1fr; }
.field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-2); margin-bottom: 5px;
}
.field label .req { color: var(--red); }
input[type=text], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], select, textarea {
    width: 100%; padding: 8px 11px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 13px; font-family: var(--font); color: var(--text-1);
    background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--navy-500);
    box-shadow: 0 0 0 3px rgba(44,102,153,.10);
}
textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

/* 文件上传区 */
.drop {
    border: 2px dashed var(--border-strong); border-radius: var(--radius);
    padding: 26px 20px; text-align: center; cursor: pointer;
    background: var(--surface-2); transition: all .18s;
}
.drop:hover { border-color: var(--navy-500); background: var(--navy-050); }
.drop-ico { font-size: 26px; margin-bottom: 6px; opacity: .55; }
.drop-title { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.drop-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.thumbs { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 11px; }
.thumb {
    width: 78px; height: 78px; border-radius: 7px; position: relative;
    background: linear-gradient(135deg, var(--navy-100), #DDE7F1);
    border: 1px solid var(--border); display: flex; align-items: center;
    justify-content: center; font-size: 11px; color: var(--navy-600);
    font-weight: 600; text-align: center; padding: 5px; overflow: hidden;
}
.thumb .x {
    position: absolute; top: 2px; right: 3px; width: 16px; height: 16px;
    background: rgba(0,0,0,.55); color: #fff; border-radius: 50%;
    font-size: 11px; line-height: 16px; cursor: pointer; text-align: center;
}

/* 时间线 */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
    content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px;
    width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
    position: absolute; left: -24px; top: 3px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--surface);
    border: 2px solid var(--navy-500);
}
.tl-dot.done { background: var(--green); border-color: var(--green); }
.tl-dot.now { background: var(--gold-500); border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(194,154,78,.2); }
.tl-dot.risk { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 3px rgba(196,54,47,.16); }
.tl-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tl-meta { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tl-desc { font-size: 12.5px; color: var(--text-2); margin-top: 5px; line-height: 1.6; }

/* 聊天气泡 */
.chat-box {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; max-height: 300px;
    overflow-y: auto;
}
.bubble { display: flex; gap: 9px; margin-bottom: 12px; }
.bubble:last-child { margin-bottom: 0; }
.bubble.me { flex-direction: row-reverse; }
.bub-av {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff;
    background: var(--navy-600);
}
.bubble.me .bub-av { background: var(--gold-600); }
.bub-body { max-width: 76%; }
.bub-name { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.bubble.me .bub-name { text-align: right; }
.bub-text {
    background: var(--surface); border: 1px solid var(--border);
    padding: 9px 12px; border-radius: 9px; font-size: 12.5px;
    line-height: 1.65; color: var(--text-1);
}
.bubble.me .bub-text { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.bub-time { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.bubble.me .bub-time { text-align: right; }

/* 提示条 */
.alert {
    display: flex; gap: 10px; padding: 12px 14px;
    border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.6;
    margin-bottom: 14px; border: 1px solid;
}
.alert-ico { font-size: 15px; flex-shrink: 0; line-height: 1.35; }
.alert b { font-weight: 700; }
.alert.info { background: var(--blue-bg); border-color: #C7DFF5; color: #14507F; }
.alert.warn { background: var(--amber-bg); border-color: #F0DCB4; color: #7A4F10; }
.alert.danger { background: var(--red-bg); border-color: #F0C9C6; color: #8E2621; }
.alert.ok { background: var(--green-bg); border-color: #BFE5D3; color: #0E6544; }

/* 步骤条 */
.steps { display: flex; align-items: flex-start; margin-bottom: 6px; }
.step { flex: 1; text-align: center; position: relative; }
.step::after {
    content: ''; position: absolute; top: 15px; left: 50%; width: 100%;
    height: 2px; background: var(--border); z-index: 0;
}
.step:last-child::after { display: none; }
.step.done::after { background: var(--green); }
.step-num {
    width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; position: relative; z-index: 1;
    background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-3);
}
.step.done .step-num { background: var(--green); border-color: var(--green); color: #fff; }
.step.active .step-num {
    background: var(--gold-500); border-color: var(--gold-500); color: #fff;
    box-shadow: 0 0 0 4px rgba(194,154,78,.18);
}
.step-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.step.done .step-name, .step.active .step-name { color: var(--text-1); }
.step-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 看板列 */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kb-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.kb-head {
    padding: 10px 12px; font-size: 12.5px; font-weight: 700;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px;
}
.kb-count { margin-left: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; font-size: 11px; color: var(--text-2); }
.kb-body { padding: 9px; display: flex; flex-direction: column; gap: 8px; min-height: 130px; }
.kb-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 9px 10px;
    box-shadow: var(--shadow-sm); cursor: grab;
}
.kb-card:hover { border-color: var(--navy-500); box-shadow: var(--shadow); }
.kb-title { font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.kb-meta { font-size: 11px; color: var(--text-3); margin-top: 5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* 日志终端 */
.term {
    background: var(--navy-900); color: #B8D4EA;
    border-radius: var(--radius-sm); padding: 13px 15px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 11.5px; line-height: 1.85; max-height: 250px; overflow-y: auto;
}
.term .t { color: #5C7A93; }
.term .ok { color: #6FD398; }
.term .w { color: #E8C169; }
.term .e { color: #F08A84; }
.term .hl { color: #F0D9A8; }

/* 图表容器 */
.chart-box { padding: 14px 4px 4px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; }
.spark-bar { flex: 1; background: var(--navy-600); border-radius: 2px 2px 0 0; min-height: 3px; transition: height .4s; }
.spark-bar.gold { background: var(--gold-500); }
.spark-bar.green { background: var(--green); }

/* 雷达 / 环形 */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.ring-info { flex: 1; }
.ring-line { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.ring-swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.ring-val { margin-left: auto; font-weight: 700; }

/* 卡片列表 */
.list-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px solid #F0F3F7; align-items: flex-start;
}
.list-item:last-child { border-bottom: none; }
.li-ico {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; background: var(--navy-100);
}
.li-title { font-size: 13px; font-weight: 600; }
.li-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.6; }
.li-right { margin-left: auto; text-align: right; flex-shrink: 0; }

/* 开关 */
.switch { position: relative; width: 38px; height: 21px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #C9D2DD; border-radius: 21px; transition: .2s;
}
.slider::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    left: 2.5px; top: 2.5px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(17px); }

/* 开关行 */
.switch-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid #F0F3F7;
}
.switch-row:last-child { border-bottom: none; }
.sr-text { flex: 1; }
.sr-title { font-size: 13px; font-weight: 600; }
.sr-desc { font-size: 11.5px; color: var(--text-3); margin-top: 1px; line-height: 1.5; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(11,30,54,.5);
    z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
    backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; animation: fadeUp .2s ease; }
.modal {
    background: var(--surface); border-radius: 12px;
    width: 100%; max-width: 620px; max-height: 86vh; overflow: hidden;
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.modal-head {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    margin-left: auto; width: 28px; height: 28px; border-radius: 6px;
    border: none; background: var(--navy-050); cursor: pointer;
    font-size: 17px; color: var(--text-2); line-height: 1;
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
    padding: 13px 20px; border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 9px; background: var(--surface-2);
}

/* Toast */
.toast-wrap { position: fixed; top: 74px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 9px; }
.toast {
    background: var(--navy-900); color: #fff; padding: 11px 16px;
    border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 9px;
    animation: slideIn .28s ease; max-width: 340px;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.ok { border-left: 3px solid var(--green); }
.toast.warn { border-left: 3px solid var(--gold-500); }
.toast.err { border-left: 3px solid var(--red); }

/* 手机预览框 */
.phone {
    width: 268px; border-radius: 22px; flex-shrink: 0;
    border: 9px solid #22344A; background: #fff; overflow: hidden;
    box-shadow: var(--shadow-lg); margin: 0 auto;
}
.phone-bar {
    background: #EDEDED; padding: 7px 12px; font-size: 11px;
    color: #333; display: flex; align-items: center; gap: 6px; font-weight: 600;
}
.phone-body { padding: 12px; background: #F7F7F7; }
.wx-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.wx-cover {
    height: 118px; background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12.5px; font-weight: 700; text-align: center;
    padding: 10px; position: relative;
}
.wx-title { font-size: 13px; font-weight: 700; padding: 9px 11px 5px; line-height: 1.45; }
.wx-sum { font-size: 11.5px; color: #8A8A8A; padding: 0 11px 9px; line-height: 1.6; }
.wx-foot { padding: 7px 11px; border-top: 1px solid #F0F0F0; font-size: 10.5px; color: #AAA; display: flex; }

/* 分案匹配结果 */
.match-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; background: var(--surface); transition: all .18s;
}
.match-card:hover { border-color: var(--navy-500); box-shadow: var(--shadow); }
.match-card.top { border-color: var(--gold-500); background: linear-gradient(180deg, #FEFBF5, #fff); }
.mc-head { display: flex; align-items: center; gap: 10px; }
.mc-av {
    width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.match-card.top .mc-av { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); }
.mc-name { font-size: 14px; font-weight: 700; }
.mc-role { font-size: 11.5px; color: var(--text-3); }
.mc-score { margin-left: auto; text-align: right; }
.mc-score-n { font-size: 21px; font-weight: 700; color: var(--gold-600); line-height: 1; }
.mc-score-l { font-size: 10.5px; color: var(--text-3); }
.mc-dims { margin-top: 11px; display: flex; flex-direction: column; gap: 6px; }
.mc-dim { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.mc-dim-name { width: 62px; color: var(--text-3); flex-shrink: 0; }
.mc-dim .bar { flex: 1; }
.mc-dim-val { width: 30px; text-align: right; font-weight: 600; color: var(--text-2); }
.mc-reason {
    margin-top: 11px; padding: 9px 11px; background: var(--navy-050);
    border-radius: var(--radius-sm); font-size: 11.5px; color: var(--text-2); line-height: 1.65;
}
.mc-reason b { color: var(--navy-700); }

/* 渠道卡片 */
.ch-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 13px 14px; background: var(--surface);
}
.ch-head { display: flex; align-items: center; gap: 9px; }
.ch-logo {
    width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff;
}
.ch-name { font-size: 13px; font-weight: 700; }
.ch-stat { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.ch-nums { display: flex; gap: 14px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #F0F3F7; }
.ch-num { flex: 1; }
.ch-num-v { font-size: 16px; font-weight: 700; }
.ch-num-l { font-size: 10.5px; color: var(--text-3); }

/* 关键词矩阵 */
.kw-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid #F0F3F7;
}
.kw-row:last-child { border-bottom: none; }
.kw-word { font-size: 13px; font-weight: 600; width: 158px; flex-shrink: 0; }
.kw-plat { display: flex; gap: 4px; }
.kw-pill {
    width: 26px; height: 22px; border-radius: 4px; font-size: 10.5px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; background: #EEF1F5; color: var(--text-3);
}
.kw-pill.p1 { background: #D9F0E4; color: #0E6544; }
.kw-pill.p2 { background: #FDF0DA; color: #8A5B0E; }
.kw-pill.p3 { background: #FBE3E1; color: #96271F; }
.kw-trend { margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 11.5px; }

/* 风险评分 */
.risk-ring { display: flex; align-items: center; gap: 14px; }
.risk-n { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -1px; }

/* 响应式 */
@media (max-width: 1400px) {
    .g5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1180px) {
    .g4 { grid-template-columns: repeat(2, 1fr); }
    .g3 { grid-template-columns: repeat(2, 1fr); }
    .kanban { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
    .fr2, .fr3 { grid-template-columns: 1fr; }
    .kanban { grid-template-columns: 1fr; }
    .content { padding: 16px 14px 40px; }
}

/* 打印 */
@media print {
    .sidebar, .topbar, .btn, .tabs { display: none !important; }
    .main { margin-left: 0; }
    .card { break-inside: avoid; box-shadow: none; }
}
