/* ==========================================================================
   总后台管理系统 · 暗 indigo 主题
   --------------------------------------------------------------------------
   零外部依赖：没有 CDN、没有 web font、没有任何远程请求。
   这样即使服务器在墙内、或者访客网络屏蔽了外部域名，样式也一定完整 ——
   后台「样式加载不出来」比「不好看」严重得多（按钮位置错乱会点错东西）。

   图标全部用 Unicode 几何字符（◆ ⛨ ▤ …），不用图标字体：
   少一个 .woff2 请求，也少一个字体文件缺失就满屏方框的坑。
   ========================================================================== */

:root {
    --bg: #0a0e1c;
    --bg-soft: #0e1326;
    --sidebar: #0d1224;
    --panel: #141930;
    --panel-2: #191f3a;
    --panel-3: #1e2543;
    --line: #242c4d;
    --line-2: #2d3763;
    --text: #e7eaf7;
    --text-2: #b9c0dc;
    --muted: #868fb4;
    --indigo: #6c7cff;
    --indigo-2: #8a97ff;
    --violet: #a06cff;
    --cyan: #39c7e0;
    --green: #39c98a;
    --amber: #f0b13c;
    --red: #ff6b81;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --sidebar-w: 232px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: #b3bcff;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: .92em;
    background: rgba(108, 124, 255, .12);
    color: #cdd4ff;
    padding: 1px 5px;
    border-radius: 5px;
    word-break: break-all;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-weight: 650;
    letter-spacing: .2px;
}

hr.hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12.5px;
}

.ok {
    color: var(--green);
}

.bad {
    color: var(--red);
}

.warn {
    color: var(--amber);
}

.hint {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.5;
}

.sub-h {
    font-size: 13.5px;
    color: var(--text-2);
    margin: 0 0 6px;
}

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

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 18px 22px 60px;
    flex: 1;
    min-width: 0;
}

/* ── 侧边栏 ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden auto;
    transition: width .18s ease, flex-basis .18s ease;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #2a3357;
}

body.side-collapsed .sidebar {
    width: 60px;
    flex-basis: 60px;
}

body.side-collapsed .brand-text,
body.side-collapsed .nav-group-title,
body.side-collapsed .nav-item span,
body.side-collapsed .nav-empty,
body.side-collapsed .badge-mini,
body.side-collapsed .sidebar-foot .ver {
    display: none;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--indigo), var(--violet));
    color: #fff;
    font-size: 13px;
    flex: 0 0 26px;
}

.brand-text {
    font-weight: 650;
    font-size: 14.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav {
    padding: 10px 8px 16px;
}

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

.nav-group-title {
    font-size: 11px;
    letter-spacing: 1.2px;
    color: #5f688f;
    padding: 10px 10px 6px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-group-title em {
    font-style: normal;
    background: #222a4a;
    color: #9aa3c9;
    border-radius: 20px;
    padding: 0 7px;
    font-size: 10.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8.5px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13.5px;
    margin-bottom: 2px;
    transition: background .12s, color .12s;
    white-space: nowrap;
}

.nav-item:hover {
    background: #171e3a;
    color: var(--text);
}

.nav-item.on {
    background: linear-gradient(90deg, rgba(108, 124, 255, .22), rgba(108, 124, 255, .06));
    color: #fff;
    box-shadow: inset 2px 0 0 var(--indigo);
}

.nav-item.off {
    opacity: .55;
}

.nav-item .ni {
    font-style: normal;
    width: 18px;
    text-align: center;
    color: #7c86b3;
    font-size: 13px;
    flex: 0 0 18px;
}

.nav-item.on .ni {
    color: var(--indigo-2);
}

.nav-item .ni.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 9px;
    margin: 0 4.5px;
}

.nav-empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.badge-mini {
    font-style: normal;
    font-size: 10px;
    background: #3a2a1c;
    color: var(--amber);
    border-radius: 4px;
    padding: 0 4px;
    margin-left: auto;
}

.sidebar-foot {
    margin-top: auto;
    padding: 12px 12px 14px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ver {
    color: #5f688f;
    font-size: 11.5px;
}

/* ── 顶栏 ───────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(13, 18, 36, .88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}

.page-title {
    font-size: 16px;
    font-weight: 650;
    flex: 0 0 auto;
}

.icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-2);
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    cursor: pointer;
}

.icon-btn:hover {
    background: #1a2140;
    color: #fff;
    border-color: var(--line);
}

.top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trust {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #161d38;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12.5px;
    color: var(--text-2);
    white-space: nowrap;
}

.trust .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 3px rgba(57, 201, 138, .14);
}

.trust.is-expired {
    border-color: #513041;
    color: var(--amber);
}

.who {
    color: var(--muted);
    font-size: 13px;
    padding-left: 10px;
    border-left: 1px solid var(--line);
}

/* ── 标签条 ─────────────────────────────────────────────── */
.tabstrip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg-soft);
}

.tabstrip[hidden] {
    display: none;
}

.tabs-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 8px;
}

.tabs-scroll::-webkit-scrollbar {
    display: none;
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 18px;
    background: #161d38;
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12.5px;
    white-space: nowrap;
}

.tab:hover {
    border-color: var(--line-2);
    color: #fff;
}

.tab.on {
    background: rgba(108, 124, 255, .18);
    border-color: rgba(108, 124, 255, .5);
    color: #fff;
}

.tab-kill {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 16px;
    padding: 4px 11px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.tab-kill:hover {
    color: var(--red);
    border-color: #4a2b38;
}

/* ── 提示条 ─────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    border: 1px solid var(--line-2);
    background: var(--panel-2);
    color: var(--text-2);
    line-height: 1.7;
}

.alert.ok {
    background: rgba(57, 201, 138, .1);
    border-color: rgba(57, 201, 138, .35);
    color: #a9ecd0;
}

.alert.warn {
    background: rgba(240, 177, 60, .1);
    border-color: rgba(240, 177, 60, .34);
    color: #f6d79a;
}

.alert.bad {
    background: rgba(255, 107, 129, .1);
    border-color: rgba(255, 107, 129, .34);
    color: #ffbcc5;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

.page-sub {
    margin-bottom: 14px;
}

/* ── 面板 ───────────────────────────────────────────────── */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(108, 124, 255, .06), transparent);
}

.panel-head h3 {
    font-size: 14px;
    flex: 0 0 auto;
}

.panel-extra {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-body {
    padding: 16px;
}

.panel-body > :first-child {
    margin-top: 0;
}

.panel-body > :last-child {
    margin-bottom: 0;
}

/* ── 网格 ───────────────────────────────────────────────── */
.grid {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

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

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

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

.grid .panel {
    margin-bottom: 0;
}

.grid-2 > .panel {
    grid-column: span 1;
}

/* ── KPI 卡片 ───────────────────────────────────────────── */
.kpi {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    position: relative;
    overflow: hidden;
}

.kpi::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--indigo);
    opacity: .5;
}

.kpi.good::after {
    background: var(--green);
}

.kpi.warn::after {
    background: var(--amber);
}

.kpi.bad::after {
    background: var(--red);
}

.kpi-label {
    color: var(--muted);
    font-size: 12.5px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .4px;
    margin: 4px 0 2px;
    word-break: break-all;
}

.kpi-hint {
    color: var(--muted);
    font-size: 12px;
}

.kpi.good .kpi-value {
    color: #b6f0d3;
}

.kpi.warn .kpi-value {
    color: #f7d79d;
}

.kpi.bad .kpi-value {
    color: #ffc0c9;
}

/* ── 徽标 / 圆点 ────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #1e2545;
    color: #a3abcf;
    border: 1px solid var(--line-2);
    white-space: nowrap;
}

.badge.ok {
    background: rgba(57, 201, 138, .14);
    color: #8fe4bd;
    border-color: rgba(57, 201, 138, .3);
}

.badge.warn {
    background: rgba(240, 177, 60, .14);
    color: #f3cf8c;
    border-color: rgba(240, 177, 60, .3);
}

.badge.bad {
    background: rgba(255, 107, 129, .14);
    color: #ffaeb9;
    border-color: rgba(255, 107, 129, .3);
}

.dot-inline {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}

/* ── 表格 ───────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .3px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
    background: rgba(255, 255, 255, .015);
}

.table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

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

.table tbody tr:hover {
    background: rgba(108, 124, 255, .05);
}

.table.dense td,
.table.dense th {
    padding: 6px 9px;
    font-size: 12.5px;
}

.table tr.on {
    background: rgba(108, 124, 255, .07);
}

.table tr.bad td {
    color: #ffc0c9;
}

.table tr.warn td {
    color: #f7d79d;
}

.table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

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

.table td.act .btn,
.table td.act form {
    margin-left: 4px;
}

.table td.path-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-cell {
    width: 90px;
}

.mini-bar {
    display: block;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--indigo), var(--violet));
    min-width: 2px;
}

.sub {
    margin-top: 2px;
}

/* ── 分页 ───────────────────────────────────────────────── */
.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px 2px 2px;
    font-size: 12.5px;
}

.pg-info {
    color: var(--muted);
    margin-right: 6px;
}

.pg {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #161d38;
    color: var(--text-2);
}

.pg:hover {
    border-color: var(--line-2);
    color: #fff;
}

.pg.on {
    background: var(--indigo);
    border-color: var(--indigo);
    color: #fff;
}

/* ── 按钮 ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-2);
    background: var(--panel-3);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: transform .06s, background .12s, border-color .12s;
    white-space: nowrap;
}

.btn:hover {
    background: #242c52;
    border-color: #3a4573;
    color: #fff;
}

.btn:active {
    transform: translateY(1px);
}

.btn.primary {
    background: linear-gradient(135deg, var(--indigo), #7b6cff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 5px 16px rgba(108, 124, 255, .28);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #7b89ff, #8f7bff);
}

.btn.danger {
    background: rgba(255, 107, 129, .12);
    border-color: rgba(255, 107, 129, .38);
    color: #ffb2bd;
}

.btn.danger:hover {
    background: rgba(255, 107, 129, .2);
    color: #fff;
}

.btn.ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text-2);
}

.btn.ghost:hover {
    background: #171e3a;
    color: #fff;
}

.btn.sm {
    padding: 5px 11px;
    font-size: 12.5px;
}

.btn.xs {
    padding: 3px 9px;
    font-size: 12px;
}

.btn.block {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
}

.btn[disabled] {
    opacity: .6;
    cursor: default;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
    margin-top: 12px;
}

/* ── 表单 ───────────────────────────────────────────────── */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 13px;
}

.form-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.field {
    display: block;
}

.field > span {
    display: block;
    font-size: 12.5px;
    color: var(--text-2);
    margin-bottom: 5px;
}

.field > span b {
    color: var(--text);
}

.input {
    width: 100%;
    background: #0f1428;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    padding: 8px 11px;
    outline: none;
    transition: border-color .12s, box-shadow .12s;
}

.input:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(108, 124, 255, .16);
}

.input::placeholder {
    color: #5c6685;
}

textarea.input {
    resize: vertical;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
}

.input.sm {
    padding: 5px 9px;
    font-size: 12.5px;
    width: auto;
    min-width: 120px;
}

.input.wide {
    min-width: 320px;
}

select.input {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #7b84ad 50%),
        linear-gradient(135deg, #7b84ad 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-2);
    cursor: pointer;
}

.check input {
    accent-color: var(--indigo);
    width: 15px;
    height: 15px;
}

.warn-line {
    background: rgba(240, 177, 60, .1);
    border: 1px solid rgba(240, 177, 60, .3);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: #f6d79a;
}

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

.filterbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--line);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.code-input {
    max-width: 200px;
    letter-spacing: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px;
    text-align: center;
}

/* 开关 */
.switch-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #121731;
    cursor: pointer;
}

.switch-row > span {
    flex: 1;
    min-width: 0;
}

.switch-row > span b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}

.switch-row > span em {
    display: block;
    font-style: normal;
    margin-top: 3px;
    line-height: 1.55;
}

.switch-row input {
    display: none;
}

.switch-row .sw {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 23px;
    border-radius: 20px;
    background: #2a3255;
    transition: background .16s;
    margin-top: 2px;
}

.switch-row .sw::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #8b93b5;
    transition: transform .16s, background .16s;
}

.switch-row input:checked + .sw {
    background: rgba(108, 124, 255, .5);
}

.switch-row input:checked + .sw::after {
    transform: translateX(19px);
    background: #fff;
}

/* ── 分段切换 ───────────────────────────────────────────── */
.segbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.seg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #121731;
    color: var(--text-2);
    font-size: 13px;
}

.seg:hover {
    border-color: var(--line-2);
    color: #fff;
}

.seg.on {
    background: rgba(108, 124, 255, .2);
    border-color: rgba(108, 124, 255, .55);
    color: #fff;
}

.segbar-sm .seg {
    padding: 4px 11px;
    font-size: 12.5px;
}

/* ── chips ──────────────────────────────────────────────── */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #121731;
    color: var(--text-2);
    font-size: 12.5px;
}

.chip:hover {
    color: #fff;
    border-color: var(--line-2);
}

.chip.on {
    background: rgba(108, 124, 255, .18);
    border-color: rgba(108, 124, 255, .5);
    color: #fff;
}

.chip.api {
    border-style: dashed;
    color: #8fddff;
}

.mod-nav {
    padding: 2px 0 4px;
}

/* ── 键值网格 ───────────────────────────────────────────── */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.kv {
    background: #121731;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
}

.kv > span {
    display: block;
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 3px;
}

.kv > b {
    font-weight: 600;
    font-size: 13px;
    word-break: break-all;
}

/* ── 待办 / 步骤 ────────────────────────────────────────── */
.todo-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.todo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}

.todo:last-child {
    border-bottom: 0;
}

.todo > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.todo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--indigo);
    flex: 0 0 8px;
}

.todo.warn .todo-dot {
    background: var(--amber);
}

.todo.bad .todo-dot {
    background: var(--red);
}

.steps,
.plain {
    margin: 0 0 14px;
    padding-left: 20px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.9;
}

.steps li,
.plain li {
    margin-bottom: 3px;
}

.steps b,
.plain b {
    color: var(--text);
}

.steps code {
    font-size: 12.5px;
}

/* ── 空状态 ─────────────────────────────────────────────── */
.empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    background: #111631;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
}

.empty a {
    text-decoration: underline;
}

/* ── 图表 ───────────────────────────────────────────────── */
.chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    background: #111631;
    border: 1px dashed var(--line-2);
    border-radius: var(--radius-sm);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-2);
}

.chart-legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    margin-right: 5px;
}

.donut {
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
}

.donut-legend {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.panel-body:has(> .donut) {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.dl-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.dl-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex: 0 0 9px;
}

.dl-name {
    flex: 1;
    min-width: 0;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-val {
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.dl-pct {
    color: var(--muted);
    width: 46px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.hbars {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.hb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
}

.hb-label {
    width: 46%;
    min-width: 90px;
    color: var(--text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-track {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #1b2242;
    overflow: hidden;
}

.hb-track span {
    display: block;
    height: 100%;
    border-radius: 5px;
    min-width: 2px;
}

.hb-val {
    width: 62px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.spark {
    width: 100%;
    height: 30px;
    display: block;
    margin-top: 6px;
}

.spark-empty {
    height: 30px;
}

/* ── 代码块 / 二维码 ────────────────────────────────────── */
.code-block {
    background: #0b1024;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 10px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    color: #b8c4ff;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.75;
    overflow-x: auto;
}

code.copyable,
.code-block.copyable {
    display: block;
}

.qr-box {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: #fff;
    border-radius: var(--radius);
    margin: 14px auto;
    width: fit-content;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
}

.qr-box svg {
    width: 200px;
    height: 200px;
    display: block;
}

.qr-box.small svg {
    width: 168px;
    height: 168px;
}

.key-box {
    background: #121731;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 12px 0;
    text-align: center;
}

.key-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.key-val {
    display: block;
    font-size: 15px;
    letter-spacing: 2px;
    color: #cdd4ff;
    background: transparent;
    word-break: break-all;
    line-height: 1.7;
}

.key-meta {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.key-meta b {
    color: var(--text-2);
}

/* 恢复码 */
.recovery-box {
    background: rgba(240, 177, 60, .07);
    border: 1px solid rgba(240, 177, 60, .3);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 14px 0;
}

.recovery-box h3 {
    font-size: 14px;
    color: #f6d79a;
    margin-bottom: 6px;
}

.recovery-list {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.recovery-list li {
    background: #0b1024;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    text-align: center;
}

.recovery-list code {
    background: transparent;
    font-size: 14px;
    letter-spacing: 1.5px;
    color: #ffe1a8;
}

/* 2FA 窗口选择 */
.grace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.grace-opt {
    margin: 0;
}

.grace-opt button {
    width: 100%;
    text-align: left;
    background: #121731;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    color: var(--text-2);
    font-family: inherit;
    cursor: pointer;
    position: relative;
    transition: border-color .12s, background .12s;
}

.grace-opt button:hover {
    border-color: var(--line-2);
    background: #171e3a;
}

.grace-opt button b {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 3px;
}

.grace-opt button span {
    font-size: 12px;
    color: var(--muted);
    display: block;
    line-height: 1.5;
}

.grace-opt button em {
    position: absolute;
    top: 9px;
    right: 11px;
    font-style: normal;
    font-size: 11px;
    background: var(--indigo);
    color: #fff;
    border-radius: 12px;
    padding: 1px 8px;
}

.grace-opt.on button {
    border-color: rgba(108, 124, 255, .6);
    background: rgba(108, 124, 255, .1);
}

.grace-opt.on button:hover {
    background: rgba(108, 124, 255, .14);
}

/* 规则自测 */
.verdict {
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-size: 13.5px;
    margin: 12px 0;
    border: 1px solid var(--line-2);
}

.verdict.ok {
    background: rgba(57, 201, 138, .1);
    border-color: rgba(57, 201, 138, .35);
    color: #a9ecd0;
}

.verdict.bad {
    background: rgba(255, 107, 129, .1);
    border-color: rgba(255, 107, 129, .35);
    color: #ffbcc5;
}

.seg-chip {
    display: inline-block;
    background: #1b2242;
    border-radius: 5px;
    padding: 1px 7px;
    margin: 2px 0;
    font-size: 12px;
    color: var(--text-2);
}

.seg-chip.deep {
    background: rgba(108, 124, 255, .2);
    color: #cdd4ff;
}

.seg-slash {
    color: var(--muted);
    margin: 0 3px;
}

/* 2FA 动态码倒计时 */
.code-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 4px;
}

.cm-track {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #1b2242;
    overflow: hidden;
}

.cm-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--cyan), var(--indigo));
    transition: width 1s linear;
}

.cm-fill.low {
    background: linear-gradient(90deg, var(--amber), var(--red));
}

.cm-text {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.cm-text b {
    color: var(--text-2);
}

/* ── 独立认证页（登录 / 扫码 / 动态码 / 邮箱）─────────────── */
.auth-body {
    background:
        radial-gradient(1000px 500px at 12% -10%, rgba(108, 124, 255, .16), transparent 60%),
        radial-gradient(900px 500px at 92% 0%, rgba(160, 108, 255, .14), transparent 60%),
        var(--bg);
    min-height: 100vh;
}

.auth-wrap {
    max-width: 520px;
    margin: 0 auto;
    padding: 6vh 18px 40px;
}

.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 26px 24px;
    box-shadow: var(--shadow);
}

.auth-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-head .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    font-size: 16px;
    flex: 0 0 34px;
}

.auth-head h1 {
    font-size: 17px;
}

.auth-head p {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 16px;
}

.auth-form .field > span {
    font-size: 12.5px;
}

.auth-lead {
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.8;
    margin: 0 0 14px;
}

.auth-tips {
    border-top: 1px dashed var(--line);
    padding-top: 14px;
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.85;
}

.auth-tips b {
    display: block;
    color: var(--text-2);
    margin-bottom: 6px;
    font-size: 13px;
}

.auth-tips .plain {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
}

.auth-note {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.75;
    margin: 14px 0 0;
}

.auth-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.auth-foot {
    text-align: center;
    color: #5f688f;
    font-size: 12px;
    margin: 18px 0 0;
    line-height: 1.7;
}

.field-hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: 8px 0 0;
    line-height: 1.7;
}

.field-hint b {
    color: var(--text-2);
}

/* ── 滚动条 ─────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a3357;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a4573;
}

/* ── 响应式：窄屏改成上下布局，侧栏变成横向滚动条 ─────────── */
@media (max-width: 1180px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

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

@media (max-width: 820px) {
    .shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 260px;
    }

    .nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-group {
        width: 100%;
    }

    .nav-item {
        display: inline-flex;
        margin: 0 4px 4px 0;
    }

    .content {
        padding: 14px 14px 50px;
    }

    .topbar {
        padding: 10px 14px;
    }

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

    .hb-label {
        width: 40%;
    }

    .input.wide {
        min-width: 0;
        width: 100%;
    }

    .trust {
        font-size: 11.5px;
        padding: 4px 9px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
