/* ==========================================================================
   公交智能报站系统 · 后台管理样式
   风格：政务交通 / 专业清爽 / 深蓝主色
   ========================================================================== */

:root {
    --navy: #0e2a47;
    --navy-2: #14395e;
    --navy-3: #1b4a76;
    --accent: #1668d9;
    --accent-dark: #0f57bb;
    --accent-soft: #e9f1fd;
    --bg: #f3f6fa;
    --card: #ffffff;
    --line: #e2e8f0;
    --text: #17293f;
    --muted: #6a7c93;
    --muted-2: #94a3b8;
    --ok: #0f9d58;
    --ok-soft: #e7f6ee;
    --warn: #c77700;
    --warn-soft: #fdf3e2;
    --danger: #c0392b;
    --danger-soft: #fdecea;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 42, 71, .04), 0 8px 24px -12px rgba(15, 42, 71, .12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

button, input, select, textarea { font: inherit; color: inherit; }

/* ---------------- 侧边栏 ---------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    background: linear-gradient(180deg, var(--navy) 0%, #0b2340 100%);
    color: #dbe6f2;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .24s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: linear-gradient(145deg, #2b7cf0, #1668d9);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 12px rgba(22, 104, 217, .35);
    flex: 0 0 38px;
}
.brand-mark svg { width: 21px; height: 21px; fill: #fff; }

.brand-text strong {
    display: block;
    font-size: 15px;
    letter-spacing: .5px;
    color: #fff;
    font-weight: 600;
}
.brand-text span {
    display: block;
    font-size: 11px;
    color: #8ba7c4;
    letter-spacing: 1px;
}

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group-title {
    font-size: 11px;
    color: #7d95b0;
    letter-spacing: 1.4px;
    padding: 12px 12px 6px;
}
.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: 7px;
    color: #c8d6e5;
    font-size: 13.5px;
    position: relative;
    transition: background .15s, color .15s;
}
.nav a svg { width: 17px; height: 17px; opacity: .85; flex: 0 0 17px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active {
    background: linear-gradient(90deg, rgba(43, 124, 240, .22), rgba(43, 124, 240, .06));
    color: #fff;
    box-shadow: inset 3px 0 0 #4d9bff;
}
.nav a.active svg { opacity: 1; }
.nav .badge-dot {
    margin-left: auto;
    font-size: 10px;
    background: #2b7cf0;
    color: #fff;
    border-radius: 9px;
    padding: 1px 7px;
    line-height: 1.5;
}

.sidebar-foot {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: 11.5px;
    color: #7f97b2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-foot a { color: #a8bed6; }

/* ---------------- 主区域 ---------------- */
.main { margin-left: 238px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(150%) blur(8px);
    border-bottom: 1px solid var(--line);
    padding: 14px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--navy);
}
.topbar p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 11px 5px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}
.user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 600;
}
.user-chip { white-space: nowrap; }
.user-chip b { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.user-chip a { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.user-chip a:hover { color: var(--danger); }

.menu-toggle {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }

.content { padding: 22px 26px 30px; flex: 1; }

.footer {
    padding: 14px 26px;
    font-size: 12px;
    color: var(--muted-2);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------------- 通用组件 ---------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid #eef2f7;
}
.card-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-head h2 svg { width: 17px; height: 17px; opacity: .7; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: #c3d1e0; background: #f8fafc; color: var(--text); }
.btn.soft { background: var(--accent-soft); color: var(--accent-dark); }
.btn.soft:hover { background: #dce9fc; }
.btn.danger { background: #fff; border-color: #f0cfcb; color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: #e7b6b0; color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row.right { justify-content: flex-end; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data th {
    text-align: left;
    font-weight: 500;
    font-size: 12.5px;
    color: var(--muted);
    background: #f8fafc;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
table.data td {
    padding: 11px 14px;
    border-bottom: 1px solid #eff3f8;
    vertical-align: middle;
}
table.data tbody tr:hover { background: #f9fbfe; }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { color: var(--muted-2); font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 5px;
    background: #eef2f7;
    color: var(--muted);
    white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #0a7c45; }
.badge.off { background: #f1f4f8; color: var(--muted-2); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--accent-soft); color: var(--accent-dark); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 500;
}
.field > label em {
    color: var(--danger);
    font-style: normal;
    margin-left: 3px;
}
.field .hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

.input, .select, .textarea {
    width: 100%;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid #d7e0ea;
    border-radius: 7px;
    background: #fff;
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(22, 104, 217, .12);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; font-family: "SFMono-Regular", Consolas, "PingFang SC", monospace; }
.textarea.short { min-height: 84px; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7c93' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #cfd8e3; border-radius: 999px; transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); }
.range-row output {
    min-width: 44px;
    text-align: center;
    font-size: 12px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-radius: 5px;
    padding: 3px 6px;
    font-variant-numeric: tabular-nums;
}

/* 搜索栏 */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid #eef2f7;
}
.toolbar form.filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 34px; min-height: 34px; padding-top: 0; padding-bottom: 0; }

/* 提示条 */
.flash {
    margin: 0 26px 0;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}
.flash.success { background: var(--ok-soft); color: #0a7c45; border-color: #c6e9d7; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #f0cfcb; }
.flash.info { background: var(--accent-soft); color: var(--accent-dark); border-color: #d3e4fb; }
.flash svg { width: 16px; height: 16px; flex: 0 0 16px; }

.empty {
    padding: 46px 20px;
    text-align: center;
    color: var(--muted-2);
    font-size: 13px;
}
.empty svg { width: 38px; height: 38px; opacity: .35; display: block; margin: 0 auto 10px; }
.empty a { font-size: 13px; }

.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }

/* ---------------- 登录页 ---------------- */
body.login-page {
    background: #0b2340;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}
.login-shell { display: flex; width: 100%; min-height: 100vh; }

.login-aside {
    flex: 1.15;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1100px 600px at 12% 8%, rgba(45, 124, 240, .32), transparent 60%),
        linear-gradient(155deg, #0e2a47 0%, #0a1f38 60%, #081a2f 100%);
    color: #fff;
    padding: 52px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.login-aside::after {
    content: "";
    position: absolute;
    left: -60px; right: -60px; bottom: -140px;
    height: 320px;
    background: repeating-linear-gradient(115deg, rgba(255,255,255,.045) 0 2px, transparent 2px 74px);
    transform: rotate(-8deg);
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.login-brand .brand-mark { width: 46px; height: 46px; flex: 0 0 46px; }
.login-brand strong { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.login-brand small { display: block; font-size: 11px; letter-spacing: 2px; color: #8fb0d2; margin-top: 2px; }

.login-hero { position: relative; z-index: 2; max-width: 480px; margin: 30px 0; }
.login-hero .kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    letter-spacing: 1px;
    color: #9fc3e8;
    background: rgba(45, 124, 240, .16);
    border: 1px solid rgba(120, 175, 255, .25);
    padding: 5px 10px;
    border-radius: 5px;
}
.login-hero h1 {
    margin: 18px 0 12px;
    font-size: 36px;
    line-height: 1.28;
    font-weight: 600;
    letter-spacing: 1px;
}
.login-hero h1 span { color: #7db4ff; }
.login-hero p { color: #a9c1da; font-size: 13.5px; line-height: 1.9; max-width: 430px; }

.login-facts { display: flex; gap: 26px; flex-wrap: wrap; position: relative; z-index: 2; }
.login-facts div strong { display: block; font-size: 20px; font-weight: 600; color: #fff; letter-spacing: .5px; }
.login-facts div span { font-size: 11.5px; color: #8fa9c4; }

.login-panel {
    flex: .85;
    background: #f5f8fc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.login-card {
    width: 100%;
    max-width: 372px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px -20px rgba(15, 42, 71, .25);
    padding: 32px 30px 28px;
    border: 1px solid #e8eef5;
}
.login-card h2 { margin: 0 0 4px; font-size: 20px; color: var(--navy); font-weight: 600; }
.login-card .tip { font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; height: 42px; font-size: 14px; }
.login-error {
    background: var(--danger-soft);
    border: 1px solid #f0cfcb;
    color: var(--danger);
    font-size: 12.5px;
    padding: 9px 11px;
    border-radius: 7px;
    margin-bottom: 16px;
}
.login-note { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #e2e8f0; font-size: 11.5px; color: var(--muted-2); line-height: 1.8; }
.login-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 仪表盘 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 17px 18px;
    position: relative;
    overflow: hidden;
}
.stat::after {
    content: "";
    position: absolute;
    right: -14px; top: -14px;
    width: 66px; height: 66px;
    border-radius: 50%;
    background: var(--accent-soft);
    opacity: .8;
}
.stat .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; position: relative; z-index: 2; }
.stat .label svg { width: 15px; height: 15px; opacity: .7; }
.stat .value { margin-top: 8px; font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: .5px; color: var(--navy); font-variant-numeric: tabular-nums; position: relative; z-index: 2; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted-2); margin-left: 4px; letter-spacing: 0; }
.stat .meta { margin-top: 9px; font-size: 11.5px; color: var(--muted-2); position: relative; z-index: 2; }
.stat.accent .value { color: var(--accent); }
.stat.accent::after { background: #dcebfc; }

.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-top: 16px; }
.chart-box { padding: 20px 20px 12px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 100%; min-width: 0; }
.bar-col .bar-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-col .bar {
    width: 100%;
    max-width: 42px;
    background: linear-gradient(180deg, #4d9bff, #1668d9);
    border-radius: 4px 4px 2px 2px;
    min-height: 3px;
    transition: height .3s;
}
.bar-col.today .bar { background: linear-gradient(180deg, #ffb84d, #e59300); }
.bar-col .bar-day { font-size: 11px; color: var(--muted-2); }

.rank-list { padding: 8px 18px 14px; }
.rank-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; }
.rank-item:last-child { border-bottom: 0; }
.rank-no { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; background: #eef2f7; color: var(--muted); font-size: 11.5px; flex: 0 0 22px; }
.rank-item:first-child .rank-no { background: var(--accent); color: #fff; }
.rank-name { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-name a { color: var(--text); }
.rank-val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-bar { height: 3px; background: #eef2f7; border-radius: 3px; overflow: hidden; width: 68px; flex: 0 0 68px; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.sys-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 18px; font-size: 12.5px; }
.sys-grid div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed #eff3f8; }
.sys-grid span { color: var(--muted); }
.sys-grid b { font-weight: 500; color: var(--text); text-align: right; word-break: break-all; }

/* ---------------- 线路 ---------------- */
.line-flag {
    width: 3px; height: 30px; border-radius: 2px; display: inline-block; vertical-align: middle;
    margin-right: 9px; background: var(--accent);
}
.line-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.line-code {
    flex: 0 0 auto;
    min-width: 34px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border-radius: 5px;
    padding: 3px 7px;
    letter-spacing: .3px;
}
.line-name { font-weight: 500; color: var(--navy); }
.line-dir { font-size: 11.5px; color: var(--muted-2); }
.line-city { font-size: 11.5px; color: var(--muted); }

.station-list { counter-reset: st; }
.station-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #eff3f8;
    background: #fff;
    cursor: default;
}
.station-row:last-child { border-bottom: 0; }
.station-row .seq {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-dark);
    display: grid; place-items: center; font-size: 12px; flex: 0 0 26px;
    font-variant-numeric: tabular-nums;
}
.station-row .st-name { flex: 1; min-width: 0; font-size: 13.5px; }
.station-row .st-extra { font-size: 11.5px; color: var(--muted-2); }
.station-row .drag { cursor: grab; color: #b7c4d4; display: grid; place-items: center; width: 22px; }
.station-row .drag svg { width: 15px; height: 15px; }
.station-row.dragging { opacity: .5; background: var(--accent-soft); }
.station-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* ---------------- 音色 ---------------- */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 18px; }
.voice-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 15px 16px;
    background: #fff;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
}
.voice-card:hover { border-color: #c4d6ea; box-shadow: 0 8px 20px -14px rgba(15,42,71,.35); }
.voice-card.default { border-color: #bcd7f7; background: linear-gradient(180deg, #fbfdff, #f2f8ff); }
.voice-head { display: flex; align-items: center; gap: 9px; }
.voice-avatar {
    width: 36px; height: 36px; border-radius: 9px;
    display: grid; place-items: center; flex: 0 0 36px;
    background: var(--accent-soft); color: var(--accent-dark);
}
.voice-avatar svg { width: 19px; height: 19px; }
.voice-card.male .voice-avatar { background: #e9eef5; color: #37506b; }
.voice-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.voice-sub { font-size: 11.5px; color: var(--muted-2); }
.voice-meta { margin-top: 11px; display: flex; gap: 6px; flex-wrap: wrap; }
.voice-actions { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.voice-badge {
    position: absolute; top: 11px; right: 12px;
    font-size: 10.5px; color: #0a7c45; background: var(--ok-soft);
    border-radius: 4px; padding: 2px 7px;
}
.voice-play {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid #cfe0f5; background: #fff; color: var(--accent);
    display: grid; place-items: center; cursor: pointer; flex: 0 0 30px;
}
.voice-play svg { width: 13px; height: 13px; }
.voice-play:hover { background: var(--accent-soft); }

/* ---------------- 模板 ---------------- */
.tpl-row { display: flex; gap: 14px; padding: 15px 18px; border-bottom: 1px solid #eff3f8; align-items: flex-start; }
.tpl-row:last-child { border-bottom: 0; }
.tpl-key { flex: 0 0 132px; }
.tpl-key b { display: block; font-size: 13px; color: var(--navy); font-weight: 600; }
.tpl-key code { font-size: 10.5px; color: var(--muted-2); background: #f4f7fb; padding: 1px 5px; border-radius: 3px; }
.tpl-content { flex: 1; }
.tpl-tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag-var { font-size: 10.5px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; }

/* ---------------- 采集 ---------------- */
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid #eef2f7; background: #fbfcfe; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.tabs button {
    border: 0; background: transparent; padding: 13px 14px 12px; font-size: 13px; color: var(--muted);
    cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tab-panel { padding: 20px 18px; }
.tab-panel[hidden] { display: none; }

.preview-result { margin-top: 16px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 13px; }
.preview-list { max-height: 260px; overflow: auto; padding: 6px 0; }
.preview-list div { padding: 6px 16px; font-size: 13px; display: flex; gap: 10px; }
.preview-list i { color: var(--muted-2); font-style: normal; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }

.source-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #eff3f8; }
.source-row:last-child { border-bottom: 0; }
.source-row .st-name { flex: 1; }
.source-row .type-pill { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: #eef2f7; color: var(--muted); }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(8, 24, 42, .45);
    display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
    backdrop-filter: blur(2px);
}
.modal-mask.open { display: flex; }
.modal {
    width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
    background: #fff; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 16px; color: var(--navy); }
.modal-close { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: 1fr; }
    .form-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: 12px 0 40px rgba(0,0,0,.2); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 16px 14px 26px; }
    .topbar { padding: 12px 14px; }
    .flash { margin: 12px 14px 0; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 14px; }
    .stat .value { font-size: 22px; }
    .topbar p { display: none; }
    .user-chip a { display: none; }
    .login-aside { display: none; }
    .login-panel { flex: 1; padding: 24px 16px; }
    .login-card { padding: 26px 22px; }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .topbar-actions .btn.ghost span { display: none; }
    .toolbar form.filter { width: 100%; }
    .toolbar .input, .toolbar .select { flex: 1; min-width: 0; }
    .card-head { flex-wrap: wrap; }
    .btn-row.right { width: 100%; }
    .tpl-row { flex-direction: column; gap: 8px; }
    .tpl-key { flex: none; }
    table.data { font-size: 12.5px; }
    table.data th, table.data td { padding: 9px 10px; }
}

/* Toast */
.toast-wrap {
    position: fixed;
    right: 22px;
    bottom: 26px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.toast {
    background: #0e2a47;
    color: #fff;
    font-size: 13px;
    padding: 9px 15px;
    border-radius: 8px;
    box-shadow: 0 12px 30px -10px rgba(14, 42, 71, .5);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .22s, transform .22s;
    max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #b53b2e; }

/* 打印 */
@media print {
    .sidebar, .topbar, .footer, .toolbar { display: none !important; }
    .main { margin: 0; }
    .card { box-shadow: none; }
}
