:root {
    --bg: #f4f6fa;
    --panel: #ffffff;
    --panel-soft: #fafbfe;
    --border: #e4e8f0;
    --border-strong: #d5dbe7;
    --text: #1c2434;
    --text-soft: #4a5568;
    --muted: #8b95a7;
    --primary: #2f6bff;
    --primary-dark: #2054d6;
    --primary-soft: #eef3ff;
    /* 界面成功色；微信绿 #07C160 仅用于品牌图形标的「已接入在线」状态点，勿混用 */
    --green: #16a34a;
    --green-soft: #eaf8ef;
    --red: #dc2626;
    --red-soft: #fdeeee;
    --amber: #d97706;
    --amber-soft: #fff6e7;
    --purple: #7c3aed;
    --purple-soft: #f3edff;
    --shadow: 0 1px 2px rgba(24, 39, 75, .04), 0 6px 20px rgba(24, 39, 75, .05);
    --radius: 10px;
}

* { box-sizing: border-box; }

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

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12.5px; }

/* ---------- 布局 ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 232px;
    background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 20;
}
.brand { height: 64px; display: flex; align-items: center; gap: 11px; padding: 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; border-radius: 11px; overflow: hidden; box-shadow: 0 4px 12px rgba(47, 107, 255, .22); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-copy { min-width: 0; overflow: hidden; }
.brand-text { font-size: 14.5px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 14px 10px 24px; }
.nav-group { margin-bottom: 14px; }
.nav-title { padding: 6px 12px; font-size: 11px; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 1px 0;
    border-radius: 8px; color: var(--text-soft); font-size: 13.5px; font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; flex: none; stroke-width: 1.7; }
.nav-item:hover { background: var(--panel-soft); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }

.main { margin-left: 232px; min-height: 100vh; }
.topbar {
    height: 64px; background: #fff; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 15;
}
/* 顶栏与内容区共用同一宽度上限，宽屏下左右一起居中，不留单侧空白 */
.topbar-inner {
    width: 100%; max-width: 2200px; height: 100%; margin-inline: auto;
    padding-inline: clamp(20px, 2vw, 44px);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.account-switch select {
    appearance: none; padding: 7px 30px 7px 12px; border: 1px solid var(--border-strong);
    border-radius: 8px; background: #fff 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='%238b95a7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    font-size: 13px; color: var(--text); min-width: 180px; cursor: pointer;
}
.account-switch select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-soft); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.content { width: 100%; max-width: 2200px; margin-inline: auto; padding: 24px clamp(20px, 2vw, 44px) 56px; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 20px; letter-spacing: -.3px; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 卡片 ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 14.5px; font-weight: 600; }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.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)); }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; }
.split-wide { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }

/* ---------- 统计 ---------- */
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { color: var(--muted); font-size: 12.5px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; margin: 6px 0 2px; }
.stat-hint { color: var(--muted); font-size: 12px; }
.stat-icon { float: right; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 8px;
    background: #fff; color: var(--text-soft); font-size: 13px; font-weight: 500;
    cursor: pointer; line-height: 1.4; white-space: nowrap; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--red); border-color: #f1c9c9; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.link-danger { color: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: var(--panel-soft); color: var(--muted); font-weight: 600; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcff; }
.data-table .nowrap { white-space: nowrap; }
.data-table .actions { white-space: nowrap; text-align: right; }
.table-empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.table-empty strong { display: block; color: var(--text-soft); margin-bottom: 4px; font-size: 14px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-row { margin-bottom: 16px; }
.form-row.full { grid-column: 1 / -1; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.form-label .req { color: var(--red); }
.form-control {
    width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
    background: #fff; color: var(--text); font-size: 13px; font-family: inherit; line-height: 1.5;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.form-control { min-height: 92px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.form-error { color: var(--red); font-size: 12px; margin-top: 5px; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-soft); cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--primary); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .form-control { width: auto; min-width: 160px; }
.inline-form { display: inline; }
.readonly-box {
    width: 100%; padding: 8px 11px; border: 1px dashed var(--border-strong); border-radius: 8px;
    background: #f7f9fc; color: var(--text-soft); font-size: 13px; line-height: 1.5;
}
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 4px 0; }
.checkbox-item {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft);
    border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: #fff; cursor: pointer;
}
.checkbox-item.is-primary { background: #f3f7ff; border-color: #cfe0ff; cursor: default; }
.checkbox-item input { width: 15px; height: 15px; accent-color: var(--primary); }
.checkbox-item.is-primary input { cursor: not-allowed; }

/* ---------- 提示 ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); border-color: #c7ecd4; color: #146c3a; }
.alert-error { background: var(--red-soft); border-color: #f4cccc; color: #a71f1f; }
.alert-info { background: var(--primary-soft); border-color: #d5e2ff; color: #1e4bb8; }
.alert-warning { background: var(--amber-soft); border-color: #f7dfb3; color: #96540a; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef1f6; color: var(--text-soft); white-space: nowrap; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--primary-soft); color: var(--primary-dark); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-muted { background: #f1f3f7; color: var(--muted); }

.code-box { background: #f7f9fc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; word-break: break-all; color: var(--text-soft); }
.ip-whitelist-box { border: 1px solid #e6e9f0; background: #fafbfd; border-radius: 10px; padding: 12px 14px; }
.ip-whitelist-box .code-box { font-size: 13.5px; font-weight: 600; color: var(--text); }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 0; font-size: 13px; }
.kv dt { color: var(--muted); padding: 8px 0; border-bottom: 1px solid #eef1f6; }
.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid #eef1f6; word-break: break-all; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pagination .btn { padding: 5px 10px; font-size: 12px; }

/* ---------- 其它 ---------- */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-bar { width: 100%; max-width: 46px; min-height: 3px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #5b8bff, #2f6bff); transition: height .2s; }
.chart-label { font-size: 11px; color: var(--muted); }
.chart-value { font-size: 11px; color: var(--text-soft); font-weight: 600; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: none; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }

.thumb { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--panel-soft); border: 1px solid var(--border); }
.thumb-lg { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; }
.thumb-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 16px; font-weight: 700; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.repeat-row { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; background: var(--panel-soft); position: relative; }
.repeat-row .row-index { font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.repeat-remove { position: absolute; right: 10px; top: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 9px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding: 0 0 16px 34px; counter-increment: step; font-size: 13px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.steps li::after { content: ''; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 1px; background: var(--border); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; margin-bottom: 2px; }

.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; }

/* 菜单编辑器 */
.menu-editor { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
.menu-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.menu-preview-head { background: #f7f9fc; border-bottom: 1px solid var(--border); padding: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.menu-list { padding: 8px; }
.menu-node { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fff; }
.menu-node-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; cursor: pointer; }
.menu-node-head:hover { background: var(--panel-soft); }
.menu-node.selected > .menu-node-head { background: var(--primary-soft); }
.menu-node-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.menu-children { border-top: 1px dashed var(--border); padding: 4px 8px 6px 22px; }
.menu-child { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.menu-child:hover, .menu-child.selected { background: var(--primary-soft); }
.menu-child .menu-node-name { flex: 1; }
.mini-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; font-size: 12px; line-height: 1; }
.mini-btn:hover { color: var(--primary); }
.menu-add { padding: 8px; }
.phone-bar { display: flex; border-top: 1px solid var(--border); background: #fafbfe; }
.phone-bar span { flex: 1; text-align: center; padding: 9px 4px; font-size: 12px; border-right: 1px solid var(--border); }
.phone-bar span:last-child { border-right: 0; }

/* ---------- 登录页：桌面双栏品牌封面 + 纯白表单；移动端折叠为单卡片 ---------- */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
    background:
        radial-gradient(1000px 620px at 8% 4%, #dce8ff 0%, transparent 62%),
        radial-gradient(900px 600px at 92% 96%, #dff5e9 0%, transparent 62%),
        linear-gradient(135deg, #eef3ff 0%, #f7f9fc 55%, #eef8f3 100%);
}
.login-shell {
    width: 100%; max-width: 1040px; min-height: 620px;
    display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    background: #fff; border: 1px solid var(--border); border-radius: 22px;
    box-shadow: 0 32px 80px rgba(31, 62, 120, .16); overflow: hidden;
}

/* 左侧品牌封面：VI 渐变仅用于封面 / 主视觉，表单与按钮一律纯色 */
.login-brand {
    position: relative; isolation: isolate; overflow: hidden;
    background: linear-gradient(135deg, #5b8bff 0%, #2f6bff 55%, #1b4bd0 100%);
    color: #fff; padding: 38px 44px;
    display: flex; flex-direction: column;
}
.login-brand-grid {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 38px 38px;
    -webkit-mask-image: linear-gradient(135deg, rgba(0, 0, 0, .9), transparent 78%);
    mask-image: linear-gradient(135deg, rgba(0, 0, 0, .9), transparent 78%);
}
.login-brand-orb { position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .07); }
.login-brand-orb-a { width: 340px; height: 340px; right: -110px; top: -110px; }
.login-brand-orb-b { width: 260px; height: 260px; right: 60px; bottom: -150px; background: rgba(255, 255, 255, .05); }
.login-brand-inner { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.login-brand-top { display: flex; align-items: center; gap: 13px; }
.login-brand-mark { flex: none; width: 44px; height: 44px; border-radius: 13px; overflow: hidden; box-shadow: 0 10px 26px rgba(10, 35, 90, .3); }
.login-brand-mark svg { display: block; }
.login-brand-name { font-size: 19px; font-weight: 700; letter-spacing: .6px; line-height: 1.35; }
.login-brand-tag { font-size: 11.5px; opacity: .95; letter-spacing: .4px; }
.login-brand-body { margin-top: auto; padding: 40px 0 30px; }
.login-eyebrow {
    display: inline-flex; align-items: center; font-size: 12px; letter-spacing: 1.5px;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 999px; padding: 5px 13px;
}
.login-headline { font-size: 38px; line-height: 1.26; letter-spacing: 1px; font-weight: 700; margin: 18px 0 14px; }
.login-intro { font-size: 14px; line-height: 1.85; opacity: .96; max-width: 410px; margin: 0 0 26px; }
.login-highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.login-highlights li { display: flex; align-items: flex-start; gap: 13px; }
.login-highlight-num {
    flex: none; font-size: 11px; letter-spacing: .5px; opacity: .95;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; padding: 2px 6px; margin-top: 3px;
}
.login-highlight-title { font-size: 14.5px; font-weight: 600; letter-spacing: .3px; }
.login-highlight-desc { font-size: 12.5px; opacity: .92; line-height: 1.65; margin-top: 1px; }
.login-brand-foot {
    padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .28);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-size: 12px; opacity: .95; letter-spacing: .3px;
}
.login-badge { border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }

/* 右侧表单：桌面不再套第二层卡片，避免「卡中卡」 */
.login-panel { display: grid; place-items: center; padding: 40px 46px; }
.login-card { width: 100%; max-width: 360px; }
.login-logo { display: none; align-items: center; gap: 13px; margin-bottom: 14px; }
.login-logo .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
.login-title { font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.login-brand-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; letter-spacing: .3px; }
.login-mobile-slogan { display: none; }
.login-form-head { margin-bottom: 24px; }
.login-form-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.2px; margin: 0 0 5px; }
.login-form-head p { font-size: 13px; color: var(--text-soft); margin: 0; }
.login-foot { margin-top: 22px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-foot-meta { font-size: 11.5px; opacity: .85; }

@media (max-width: 899px) {
    .login-shell { grid-template-columns: 1fr; max-width: 440px; min-height: 0; }
    .login-brand { display: none; }
    .login-panel { padding: 34px 30px; }
    .login-card { max-width: none; }
    .login-logo { display: flex; }
    .login-mobile-slogan {
        display: block; margin: 0 0 22px; font-size: 12px; letter-spacing: 1.5px;
        color: var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 7px 11px; text-align: center;
    }
    .login-form-head { margin-bottom: 20px; }
    .login-form-head h2 { font-size: 18px; }
}
@media (max-width: 480px) {
    .login-page { padding: 16px 12px; }
    .login-panel { padding: 26px 20px; }
    .login-foot { margin-top: 18px; }
}
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row .form-control { flex: 1; min-width: 0; letter-spacing: .5px; }
.captcha-img { width: 150px; height: 42px; flex: none; object-fit: cover; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer; }
.captcha-img:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.captcha-img.is-loading { opacity: .45; }
.captcha-loading {
    flex: none; width: 15px; height: 15px; align-self: center;
    border: 2px solid var(--primary-soft); border-top-color: var(--primary);
    border-radius: 50%; animation: captcha-spin .7s linear infinite;
}
@keyframes captcha-spin { to { transform: rotate(360deg); } }
.warn-hint { color: var(--amber); }

/* 登录页全局错误横幅（凭据错误 / 锁定提示） */
.login-alert {
    display: flex; align-items: flex-start; gap: 9px;
    background: var(--red-soft); color: #b91c1c;
    border: 1px solid #f5c2c2; border-radius: 9px;
    padding: 10px 12px; margin-bottom: 16px; font-size: 13px; line-height: 1.5;
}
.login-alert svg { flex: none; margin-top: 2px; }
.login-alert-text { flex: 1; min-width: 0; }
.login-alert-close {
    flex: none; width: 20px; height: 20px; padding: 0; margin: -2px -4px 0 0;
    border: 0; background: transparent; color: #b91c1c; font-size: 16px;
    line-height: 20px; border-radius: 5px; cursor: pointer;
}
.login-alert-close:hover { background: rgba(185, 28, 28, .1); }

/* 密码框显隐切换 */
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap .form-control { padding-right: 40px; }
.pwd-toggle {
    position: absolute; right: 6px; width: 30px; height: 30px; padding: 0;
    display: grid; place-items: center; border: 0; background: transparent;
    color: var(--muted); border-radius: 7px; cursor: pointer;
}
.pwd-toggle:hover { color: var(--text-soft); background: var(--panel-soft); }

.login-foot-sep { margin: 0 7px; opacity: .55; }

/* 校验失败时卡片抖一下，配合红字给足反馈 */
.login-card.is-shake { animation: login-shake .46s cubic-bezier(.36, .07, .19, .97); }
@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    12% { transform: translateX(-9px); }
    28% { transform: translateX(7px); }
    44% { transform: translateX(-5px); }
    60% { transform: translateX(4px); }
    78% { transform: translateX(-2px); }
}
.form-control[aria-invalid="true"]:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }

@media (max-width: 1080px) {
    .grid-4, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split, .split-wide, .menu-editor { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .sidebar { width: 62px; }
    .sidebar .brand-copy, .sidebar .nav-title, .sidebar .nav-item span, .sidebar .sidebar-foot { display: none; }
    .sidebar .brand { justify-content: center; padding: 0; }
    .sidebar .nav-item { justify-content: center; padding: 10px 0; }
    .main { margin-left: 62px; }
    .content { padding: 18px 14px 40px; }
    .topbar-inner { padding-inline: 14px; }
    .topbar-actions { gap: 8px; }
    .user-chip span:last-child { display: none; }
    .account-switch select { max-width: 150px; }
    .grid-2, .grid-3, .grid-4, .stat-grid, .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 宽屏适配 ---------- */
@media (min-width: 1500px) {
    .split-wide { grid-template-columns: minmax(0, 1fr) clamp(320px, 22%, 420px); }
    .menu-editor { grid-template-columns: 340px minmax(0, 1fr); }
    .card-head { padding: 16px 22px; }
    .card-body { padding: 20px 22px; }
    .card-foot { padding: 16px 22px; }
    .data-table th, .data-table td { padding-left: 20px; padding-right: 20px; }
    .stat { padding: 18px 22px; }
    .chart { height: 180px; gap: 18px; }
    .chart-bar { max-width: 64px; }
}
@media (min-width: 1680px) {
    /* 仪表盘 KPI 在宽屏收成一行，避免两行大卡片显得空旷；其它页面的 4 卡布局保持 4 列 */
    .stat-grid:not(.stat-grid-4) { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
    .stat-grid .stat { padding: 15px 16px; }
    .stat-grid .stat-value { font-size: 22px; }
    .stat-grid .stat-label { font-size: 12px; }
    .stat-grid-4 .stat { padding: 18px 22px; }
    .stat-grid-4 .stat-value { font-size: 26px; }
}

/* ---------- 微信菜单手机模拟器 ---------- */
.phone { width: 300px; max-width: 100%; margin: 0 auto; background: #ededed; border: 9px solid #2b303b; border-radius: 26px; overflow: hidden; box-shadow: 0 12px 30px rgba(20, 30, 55, .14); }
.phone-header { height: 46px; background: #f7f7f7; border-bottom: 1px solid #e2e2e2; display: grid; place-items: center; font-size: 13px; font-weight: 600; color: #333; }
.phone-body { min-height: 360px; padding: 16px 12px 26px; background: #ededed; }
.phone-bubble { background: #fff; border-radius: 6px; padding: 10px 12px; font-size: 12.5px; color: #4a5568; max-width: 84%; position: relative; }
.phone-bubble::before { content: ''; position: absolute; left: -5px; top: 13px; width: 9px; height: 9px; background: #fff; transform: rotate(45deg); }
.phone-avatar { width: 30px; height: 30px; border-radius: 4px; background: #cfd6e4; float: left; margin-right: 9px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.phone-tip { text-align: center; color: #a6adba; font-size: 11.5px; margin-top: 18px; }
.wx-menu-bar { display: flex; align-items: stretch; min-height: 46px; border-top: 1px solid #d9d9d9; background: #f8f8f8; }
.wx-menu-top { flex: 1; position: relative; display: grid; place-items: center; font-size: 12.5px; color: #333; border-right: 1px solid #d9d9d9; cursor: pointer; min-width: 0; padding: 0 4px; }
.wx-menu-top:last-child { border-right: 0; }
.wx-menu-top.selected { color: var(--primary); background: #eef3ff; }
.wx-menu-top .wx-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-menu-add { flex: 1; display: grid; place-items: center; color: #9aa3b2; font-size: 20px; cursor: pointer; border-right: 1px solid #d9d9d9; }
.wx-menu-add:hover { color: var(--primary); background: #eef3ff; }
.wx-submenu { position: absolute; bottom: calc(100% + 5px); left: 3px; right: 3px; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.10); z-index: 3; }
.wx-submenu::after { content: ''; position: absolute; bottom: -6px; left: 50%; width: 10px; height: 10px; background: #fff; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; transform: translateX(-50%) rotate(45deg); }
.wx-submenu-item { padding: 9px 8px; font-size: 12.5px; text-align: center; border-bottom: 1px solid #eee; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-submenu-item:last-child { border-bottom: 0; }
.wx-submenu-item.selected { color: var(--primary); background: #f2f6ff; }
.wx-submenu-item.wx-add { color: #9aa3b2; }
.menu-toolbar { display: flex; gap: 4px; justify-content: center; padding: 8px; background: #fff; border-top: 1px solid var(--border); }
.menu-hint { background: #fff; padding: 10px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.selected-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12.5px; font-weight: 600; }

/* ---------- RBAC 与个人设置 ---------- */
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.rbac-form { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rbac-col { display: grid; gap: 16px; align-content: start; min-width: 0; }

.perm-matrix { display: grid; gap: 12px; }
.perm-group { border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; background: var(--panel-soft); }
.perm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.perm-group-title { font-size: 13px; font-weight: 600; color: var(--text); }
.perm-group-head .mini-btn { padding: 2px 6px; font-size: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 6px 8px; }
.perm-item { display: flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font-size: 12.5px; color: var(--text-soft); cursor: pointer; min-width: 0; }
.perm-item:hover { border-color: var(--primary); }
.perm-item.checked { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.perm-item.locked { opacity: .55; cursor: not-allowed; }
.perm-item input { width: 14px; height: 14px; accent-color: var(--primary); flex: none; }
.perm-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-locked { font-size: 11px; color: var(--red); flex: none; }

.role-card { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; margin-bottom: 8px; cursor: pointer; }
.role-card:last-child { margin-bottom: 0; }
.role-card:hover { border-color: var(--primary); }
.role-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.role-card.locked { opacity: .6; cursor: not-allowed; }
.role-card > input { margin-top: 4px; width: 15px; height: 15px; accent-color: var(--primary); flex: none; }
.role-card-body { flex: 1; min-width: 0; }
.role-card-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; flex-wrap: wrap; }
.role-card-count { flex: none; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.role-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.role-panel-locked { background: linear-gradient(140deg, #f7f4ff, #fff 60%); border-color: #e4d9ff; }
.role-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--primary); }
.role-panel-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; color: var(--text); }
.role-panel-desc { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); min-height: 42px; }
.role-panel-stats { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); }
.role-panel-stats strong { font-size: 17px; color: var(--text); margin-right: 3px; }
.role-panel-actions { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--border); padding-top: 12px; margin-top: auto; }

.profile-tabs { overflow-x: auto; }
.profile-tabs .tab { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; border-bottom: 2px solid transparent; font: inherit; cursor: pointer; white-space: nowrap; }
.profile-tabs .tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.avatar-lg { width: 52px; height: 52px; font-size: 20px; flex: none; }
.profile-identity { display: flex; align-items: center; gap: 14px; }
.kv > span { color: var(--muted); padding: 8px 0; border-bottom: 1px solid #eef1f6; }
.kv > strong { padding: 8px 0; border-bottom: 1px solid #eef1f6; font-weight: 600; word-break: break-all; }
.hint-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-soft); line-height: 1.9; }

.timeline { padding: 8px 18px 14px; }
.timeline-item { display: flex; gap: 12px; position: relative; padding: 10px 0 12px 2px; }
.timeline-item:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 22px; bottom: -2px; width: 1px; background: var(--border); }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; z-index: 1; }
.timeline-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.timeline-dot.fail { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.timeline-title { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.timeline-title .mono { font-weight: 400; color: var(--muted); }

.session-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef1f6; color: var(--primary-dark); }
.session-item:last-of-type { border-bottom: 0; }
.session-info { flex: 1; min-width: 0; color: var(--text); }
.session-info .badge { margin-left: 6px; }
.session-logout .form-row { margin-bottom: 10px; }

.perm-readonly { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.perm-tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 6px; font-size: 12px; background: #f1f3f7; color: var(--muted); }
.perm-tag.granted { background: var(--green-soft); color: var(--green); }

/* ---------- 仪表盘：系统信息 / 运行检查 ---------- */
.kv-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; }
.kv-2 .kv { grid-template-columns: 128px minmax(0, 1fr); }
.sys-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.sys-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef1f6; font-size: 13px; }
.sys-item-body { flex: 1; min-width: 0; }
.sys-item-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sys-item-desc { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.6; word-break: break-word; }
.sys-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--muted); }
.sys-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sys-dot.warn { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.sys-dot.fail { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

@media (max-width: 1080px) {
    .rbac-form { grid-template-columns: minmax(0, 1fr); }
    .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kv-2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 760px) {
    .stat-grid-4 { grid-template-columns: minmax(0, 1fr); }
    .check-grid, .perm-readonly { grid-template-columns: minmax(0, 1fr); }
    .role-grid { grid-template-columns: minmax(0, 1fr); }
    .sys-checks { grid-template-columns: minmax(0, 1fr); }
    .kv-2 .kv { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ---------- 运营报表 ---------- */
.seg { display: inline-flex; padding: 3px; background: #eef1f7; border-radius: 9px; gap: 2px; }
.seg-item { padding: 5px 13px; border-radius: 7px; font-size: 12.5px; color: var(--text-soft); white-space: nowrap; transition: background .15s, color .15s; }
.seg-item:hover { color: var(--text); }
.seg-item.is-active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(24, 39, 75, .1); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px 14px; box-shadow: var(--shadow); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.8px; margin: 6px 0 4px; line-height: 1.15; }
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.kpi-delta { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.kpi-delta.is-good { color: var(--green); background: var(--green-soft); }
.kpi-delta.is-bad { color: var(--red); background: var(--red-soft); }
.kpi-delta.is-flat { color: var(--muted); background: #f1f3f7; }
.kpi-delta.is-new { color: var(--primary); background: var(--primary-soft); }

.chart-wrap { min-width: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chart-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); background: #f7f9fc; border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; cursor: pointer; transition: opacity .15s, border-color .15s; }
.chart-legend-item:hover { border-color: var(--border-strong); }
.chart-legend-item i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chart-legend-item.is-off { opacity: .4; }
.chart-canvas { position: relative; width: 100%; }
.chart-canvas svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-axis { fill: #98a2b3; font-size: 10.5px; font-family: inherit; }
.chart-empty { display: grid; place-items: center; color: var(--muted); font-size: 12.5px; background: #fafbfe; border: 1px dashed var(--border); border-radius: 10px; }
.chart-note { color: var(--muted); font-size: 11.5px; }
.chart-tip { position: absolute; top: 8px; transform: translateX(-50%); background: #1c2434; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 11.5px; line-height: 1.6; pointer-events: none; min-width: 116px; box-shadow: 0 8px 22px rgba(15, 23, 42, .22); z-index: 3; }
.chart-tip-date { font-weight: 600; margin-bottom: 3px; color: #e6ebf5; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart-tip-row i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chart-tip-row span { color: #b9c2d4; }
.chart-tip-row b { margin-left: auto; font-weight: 600; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-wrap svg { flex: none; }
.donut-total { fill: var(--text); font-size: 22px; font-weight: 700; font-family: inherit; }
.donut-label { fill: var(--muted); font-size: 11px; font-family: inherit; }
.donut-legend { flex: 1; min-width: 190px; display: grid; gap: 7px; }
.donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-legend-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend-name { color: var(--text-soft); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend-value { font-weight: 600; }
.donut-legend-pct { color: var(--muted); font-size: 11.5px; width: 46px; text-align: right; }

.bar-list { display: grid; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-rank { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: #f1f4fa; color: var(--muted); font-size: 10.5px; font-weight: 600; flex: none; }
.bar-row:nth-child(1) .bar-rank { background: var(--primary-soft); color: var(--primary); }
.bar-label { width: 132px; flex: none; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: #f1f4fa; border-radius: 20px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 20px; transition: width .35s ease; }
.bar-value { width: 62px; text-align: right; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.hour-chart { padding-top: 4px; }
.hour-bars { display: flex; align-items: flex-end; gap: 3px; height: 132px; }
.hour-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.hour-bar { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, #93b4ff, #c9daff); }
.hour-bar.is-peak { background: linear-gradient(180deg, #2f6bff, #7aa2ff); }
.hour-axis { position: relative; height: 18px; margin-top: 6px; }
.hour-axis span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.hour-axis span:first-child { transform: none; }
.hour-axis span:last-child { transform: translateX(-100%); }
.hour-foot { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.hour-foot b { color: var(--text-soft); }

.insight-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.insight-list li { display: flex; gap: 10px; font-size: 12.8px; line-height: 1.7; color: var(--text-soft); }
.insight-list b { color: var(--text); font-weight: 600; }
.insight-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: none; }
.report-note { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 11.5px; line-height: 1.7; }

@media (min-width: 1680px) {
    .kpi-value { font-size: 30px; }
    .bar-label { width: 160px; }
}
@media (max-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .kpi-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .kpi-value { font-size: 24px; }
    .bar-label { width: 96px; }
    .bar-value { width: 52px; }
    .donut-wrap { justify-content: center; gap: 16px; }
    .page-actions .seg { width: 100%; justify-content: space-between; }
}

/* ---------- 键盘可达性 ---------- */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 100;
    background: #fff; color: var(--primary); padding: 8px 14px; border-radius: 8px;
    box-shadow: var(--shadow); font-size: 13px;
}
.skip-link:focus { left: 12px; }
.form-control[aria-invalid="true"] { border-color: var(--red); background: var(--red-soft); }

/* ---------- 开放平台 ---------- */
.cell-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; line-height: 1.5; }

.secret-box { background: #fffbeb; border: 1px solid #f5d59a; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.secret-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #8a5a00; margin-bottom: 10px; }
.secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-value { flex: 1; min-width: 220px; background: #fff; border: 1px solid #f0dfb8; border-radius: 8px; padding: 8px 12px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: #6b4a00; word-break: break-all; }
.secret-hint { margin-top: 9px; color: #8a6b2e; font-size: 11.5px; line-height: 1.6; }

.api-doc { display: grid; gap: 20px; }
.api-doc h4 { font-size: 13px; font-weight: 600; color: var(--text-soft); margin: 0 0 8px; }
.code-block { background: #1b2233; color: #dbe3f0; border-radius: 10px; padding: 13px 16px; margin: 0; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12px; line-height: 1.75; overflow-x: auto; white-space: pre; tab-size: 4; }
.code-block::selection, .code-block *::selection { background: rgba(120, 170, 255, .35); }

@media (max-width: 760px) {
    .secret-value { min-width: 100%; }
    .code-block { font-size: 11px; padding: 11px 13px; }
}

/* 窄屏：表格与代码块内部滚动，不撑破外层卡片 */
.card, .card-body, .split-wide > *, .grid > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.api-doc > div { min-width: 0; }

/* ---------- 图文编辑：多文章 Tab 与底部操作 ---------- */
.news-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.news-tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; color: var(--text-soft);
    font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.news-tab.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.news-tab .news-tab-x { color: var(--muted); font-size: 13px; line-height: 1; }
.news-tab .news-tab-x:hover { color: var(--red); }
.news-sticky-actions {
    position: sticky; bottom: 0; z-index: 5; margin-top: 14px; padding: 12px 0;
    display: flex; gap: 10px; align-items: center;
    background: linear-gradient(to top, var(--bg) 62%, rgba(244, 246, 250, 0));
}

/* ---------- 文颜（Wenyan）Markdown 图文编辑器 ---------- */
.wy {
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    position: relative;
}
.wy-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 12px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
}
.wy-themes { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.wy-theme {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px 4px 5px; border-radius: 20px;
    border: 1px solid var(--border); background: #fff;
    color: var(--text-soft); font-size: 12px; font-family: inherit;
    cursor: pointer; transition: all .15s;
}
.wy-theme:hover { border-color: var(--primary); color: var(--text); }
.wy-theme.is-active {
    border-color: var(--primary); background: var(--primary-soft);
    color: var(--primary-dark); font-weight: 600;
}
.wy-theme-dot {
    width: 13px; height: 13px; border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .08); flex-shrink: 0;
}
.wy-theme-name { white-space: nowrap; }

.wy-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wy-select {
    height: 26px; padding: 0 6px; border: 1px solid var(--border);
    border-radius: 6px; background: #fff; color: var(--text-soft);
    font-size: 12px; font-family: inherit; cursor: pointer;
}
.wy-check {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--text-soft); cursor: pointer; user-select: none;
}
.wy-check input { width: 13px; height: 13px; accent-color: var(--primary); cursor: pointer; }

.wy-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 560px;
}
.wy-pane { display: flex; flex-direction: column; min-width: 0; }
.wy-pane + .wy-pane { border-left: 1px solid var(--border); }

.wy-md-bar {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    padding: 6px 8px; border-bottom: 1px solid var(--border); background: #fbfcfe;
}
.wy-tool {
    min-width: 26px; height: 26px; padding: 0 5px;
    display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 5px;
    background: transparent; color: var(--text-soft);
    font-size: 12px; font-family: inherit; line-height: 1; cursor: pointer;
}
.wy-tool:hover { background: var(--primary-soft); color: var(--primary-dark); }
.wy-tool.is-bold { font-weight: 800; }
.wy-tool.is-italic { font-style: italic; font-family: Georgia, serif; }
.wy-md-count { margin-left: auto; font-size: 11px; color: var(--muted); padding-right: 2px; }

.wy-md {
    flex: 1; width: 100%; min-height: 480px; padding: 16px 18px;
    border: 0; outline: none; resize: none;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px; line-height: 1.85; color: #1f2937; background: #fff;
    tab-size: 4;
}
.wy-md::placeholder { color: #b9c0cc; }

.wy-preview-pane { background: #f5f6f9; }
.wy-preview-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 12px; border-bottom: 1px solid var(--border);
    background: #fbfcfe; font-size: 11.5px; color: var(--muted);
}
.wy-rendering { color: var(--primary); }
.wy-preview-scroll { flex: 1; overflow-y: auto; padding: 14px; max-height: 640px; }
.wy-preview-body {
    background: #fff; border-radius: 8px; padding: 22px 20px;
    box-shadow: 0 2px 10px rgba(24, 39, 75, .06);
    font-size: 16px; color: #2b2b2b; word-break: break-word;
    margin: 0 auto; transition: max-width .2s;
}
.wy-preview-body.is-narrow { max-width: 375px; }
/* 兜底：主题内联样式优先级更高，这里只保证没被覆盖的元素不难看 */
.wy-preview-body img { max-width: 100%; height: auto; }
.wy-preview-body a { color: #1d4ed8; }
.wy-preview-empty {
    color: var(--muted); font-size: 13px; text-align: center;
    padding: 80px 20px; line-height: 1.9;
}

.wy-error {
    padding: 8px 12px; font-size: 12px; color: var(--red);
    background: var(--red-soft); border-top: 1px solid #f6d5d5;
}
.wy-toast {
    position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
    padding: 7px 16px; border-radius: 18px;
    background: rgba(28, 36, 52, .92); color: #fff;
    font-size: 12px; white-space: nowrap; pointer-events: none;
    animation: wy-toast-in .2s ease-out;
}
@keyframes wy-toast-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 1080px) {
    .wy-split { grid-template-columns: minmax(0, 1fr); }
    .wy-pane + .wy-pane { border-left: 0; border-top: 1px solid var(--border); }
    .wy-preview-scroll { max-height: none; }
}

/* ---------- 编辑器工具栏分组与素材库插图 ---------- */
.wy-sep {
    width: 1px; height: 15px; margin: 0 3px;
    background: var(--border); flex-shrink: 0;
}
.wy-tool.is-strike { text-decoration: line-through; font-weight: 600; }

.wy-lib {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center;
    background: rgba(20, 26, 38, .42); padding: 24px;
}
.wy-lib-body {
    width: min(720px, 100%); max-height: 78vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .26);
}
.wy-lib-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text);
}
.wy-lib-x {
    border: 0; background: transparent; font-size: 20px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.wy-lib-x:hover { color: var(--text); }
.wy-lib-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px; padding: 16px 18px; overflow-y: auto;
}
.wy-lib-item {
    display: flex; flex-direction: column; gap: 5px;
    padding: 5px; border: 1px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-family: inherit; text-align: left;
}
.wy-lib-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.wy-lib-item img { width: 100%; height: 84px; object-fit: cover; border-radius: 6px; background: #f2f4f8; display: block; }
.wy-lib-name {
    font-size: 11.5px; color: var(--text-soft); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; padding: 0 2px;
}
.wy-lib-noimg {
    height: 84px; display: grid; place-items: center;
    background: #f2f4f8; border-radius: 6px; color: var(--muted); font-size: 12px;
}
.wy-lib-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

/* ---------- 图文封面选择器 ---------- */
.cover-picker { display: flex; gap: 12px; align-items: flex-start; }
.cover-thumb {
    width: 132px; height: 80px; flex-shrink: 0; cursor: pointer;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: #f5f7fb; overflow: hidden; display: grid; place-items: center;
}
.cover-thumb:hover { border-color: var(--primary); }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-thumb-empty { font-size: 12px; color: var(--muted); }
.cover-side { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cover-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cover-meta { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.cover-meta code { font-size: 11px; background: #f2f4f8; padding: 2px 5px; border-radius: 4px; }
.cover-error { width: 100%; font-size: 12px; color: var(--red); }

.cover-modal {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center;
    background: rgba(20, 26, 38, .42); padding: 24px;
}
.cover-modal-body {
    width: min(760px, 100%); max-height: 78vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .26);
}
.cover-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text);
}
.cover-modal-head-right { display: flex; align-items: center; gap: 8px; }
.cover-modal-x {
    border: 0; background: transparent; font-size: 20px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.cover-modal-x:hover { color: var(--text); }
.cover-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px; padding: 16px; overflow-y: auto;
}
.cover-item {
    display: flex; flex-direction: column; gap: 4px; position: relative;
    padding: 5px; border: 1px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-family: inherit; text-align: left;
}
.cover-item:hover:not(:disabled) { border-color: var(--primary); }
.cover-item.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cover-item:disabled { opacity: .6; cursor: wait; }
.cover-item img { width: 100%; height: 86px; object-fit: cover; border-radius: 6px; background: #f2f4f8; display: block; }
.cover-item-empty {
    height: 86px; display: grid; place-items: center;
    background: #f2f4f8; border-radius: 6px; color: var(--muted); font-size: 12px;
}
.cover-item-name {
    font-size: 11.5px; color: var(--text-soft); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; padding: 0 2px;
}
.cover-item-tag {
    position: absolute; top: 9px; right: 9px;
    padding: 1px 5px; border-radius: 4px;
    background: rgba(217, 119, 6, .92); color: #fff; font-size: 10px;
}
.cover-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

/* ---------- 品牌规范页（/brand，VI v1.0） ---------- */
/* 渐变仅用于封面，与 public/brand/social-card.svg 一致；其余一律纯色 + 细线分隔 */
.brand-hero {
    position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 26px 28px; margin-bottom: 18px; border-radius: 16px; overflow: hidden;
    background: linear-gradient(135deg, #5b8bff 0%, #2f6bff 55%, #2054d6 100%);
    color: #fff; box-shadow: var(--shadow);
}
.brand-hero::after {
    content: ''; position: absolute; right: -70px; top: -110px; width: 300px; height: 300px;
    border: 1px solid rgba(255, 255, 255, .16); border-radius: 50%; pointer-events: none;
}
.brand-hero-mark { flex: none; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .16)); }
.brand-hero-copy { min-width: 0; position: relative; z-index: 1; }
.brand-hero-name { display: flex; align-items: center; gap: 12px; font-size: 34px; font-weight: 700; letter-spacing: 2px; line-height: 1.2; }
.brand-hero-ver { font-size: 11px; font-weight: 600; letter-spacing: .5px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.brand-hero-full { font-size: 14px; opacity: .92; margin-top: 4px; }
.brand-hero-slogan { font-size: 19px; font-weight: 600; letter-spacing: 2px; margin-top: 12px; }
.brand-hero-meta { margin-left: auto; display: grid; gap: 7px; font-size: 12px; text-align: right; position: relative; z-index: 1; }
.brand-hero-meta > div { display: flex; gap: 10px; justify-content: flex-end; align-items: baseline; }
.brand-hero-meta span { opacity: .75; }
.brand-hero-meta code, .brand-hero-meta b { color: #fff; font-weight: 600; }

.brand-statement { font-size: 20px; font-weight: 700; line-height: 1.6; padding-left: 14px; border-left: 3px solid var(--primary); }
.brand-lead { color: var(--text-soft); font-size: 13px; line-height: 1.8; margin: 14px 0 0; }
.brand-who { padding: 11px 13px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 8px; margin-bottom: 12px; }
.brand-who:last-child { margin-bottom: 0; }
.brand-who-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.brand-who p, .brand-meaning p, .brand-note, .brand-usage p { color: var(--text-soft); font-size: 12.5px; line-height: 1.75; margin: 7px 0 0; }
.brand-list { list-style: none; padding: 0; margin: 0; }
.brand-list li { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; line-height: 1.65; }
.brand-list li:last-child { border-bottom: 0; }
.brand-list li b { flex: none; color: var(--primary-dark); }
.brand-list li span { color: var(--text-soft); }
.brand-list-plain li::before { content: ''; flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); margin-top: 7px; }
.brand-list + .alert { margin-top: 14px; margin-bottom: 0; }

.brand-persona { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-persona span { padding: 5px 16px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 600; }
.brand-tone { margin-top: 14px; font-size: 12.5px; }
.brand-tone > div { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.brand-tone > div:last-child { border-bottom: 0; }
.brand-tone-key { flex: none; padding: 1px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.brand-tone-key.ok { background: var(--green-soft); color: var(--green); }
.brand-tone-key.no { background: var(--red-soft); color: var(--red); }

.brand-slogan-main { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: 12px; background: var(--primary-soft); margin-bottom: 14px; }
.brand-slogan-text { font-size: 26px; font-weight: 700; letter-spacing: 3px; color: var(--primary-dark); }
.brand-slogan-main span { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); }
.brand-slogan-alts { display: grid; gap: 8px; }
.brand-slogan-alts > div { display: flex; align-items: baseline; gap: 12px; font-size: 13px; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.brand-slogan-alts > div:last-child { border-bottom: 0; }
.brand-slogan-alts b { flex: none; width: 68px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.brand-slogan-alts span { color: var(--text-soft); }

.brand-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.brand-swatch { border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px 12px; background: var(--panel-soft); min-width: 0; }
.brand-swatch-chip { height: 42px; border-radius: 7px; border: 1px solid rgba(28, 36, 52, .08); margin-bottom: 9px; }
.brand-swatch-name { font-size: 12.5px; font-weight: 600; }
.brand-swatch code, .brand-swatch-var { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.brand-swatch-var { color: var(--primary-dark); }
.brand-swatch-use { font-size: 11.5px; color: var(--text-soft); line-height: 1.5; margin: 7px 0 9px; min-height: 34px; }
.brand-swatch-copy { width: 100%; }
.brand-swatches + .alert { margin-top: 16px; margin-bottom: 0; }

.brand-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 12px; }
.brand-asset { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px; color: inherit; transition: border-color .15s, box-shadow .15s; }
.brand-asset:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); color: inherit; }
.brand-asset-preview { height: 92px; display: grid; place-items: center; background: #f2f4f8; border-radius: 7px; margin-bottom: 9px; overflow: hidden; }
.brand-asset-preview.is-dark { background: #1c2434; }
.brand-asset-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-asset-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.brand-asset-file { display: block; font-size: 11px; color: var(--primary-dark); margin: 2px 0 6px; word-break: break-all; }
.brand-asset-use { font-size: 11.5px; color: var(--muted); }

.brand-meaning { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.brand-meaning:last-child { border-bottom: 0; }
.brand-meaning > code { flex: none; min-width: 62px; text-align: center; padding: 3px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-dark); }
.brand-meaning b { font-size: 13px; }
.brand-meaning p { margin-top: 3px; }
.brand-usage .alert { margin-top: 14px; margin-bottom: 0; }
.brand-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; padding: 4px 2px 12px; }
.brand-footer a { display: inline-flex; align-items: center; gap: 5px; }

@media (max-width: 1080px) {
    .brand-hero-meta { margin-left: 0; text-align: left; }
    .brand-hero-meta > div { justify-content: flex-start; }
}
@media (max-width: 760px) {
    .brand-hero { padding: 20px; }
    .brand-hero-name { font-size: 28px; }
    .brand-slogan-text { font-size: 21px; }
}

/* ---------- 编辑器工具栏分组与素材库插图 ---------- */
.wy-sep {
    width: 1px; height: 15px; margin: 0 3px;
    background: var(--border); flex-shrink: 0;
}
.wy-tool.is-strike { text-decoration: line-through; font-weight: 600; }

.wy-lib {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center;
    background: rgba(20, 26, 38, .42); padding: 24px;
}
.wy-lib-body {
    width: min(720px, 100%); max-height: 78vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .26);
}
.wy-lib-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 18px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text);
}
.wy-lib-x {
    border: 0; background: transparent; font-size: 20px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.wy-lib-x:hover { color: var(--text); }
.wy-lib-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px; padding: 16px 18px; overflow-y: auto;
}
.wy-lib-item {
    display: flex; flex-direction: column; gap: 5px;
    padding: 5px; border: 1px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-family: inherit; text-align: left;
}
.wy-lib-item:hover { border-color: var(--primary); background: var(--primary-soft); }
.wy-lib-item img { width: 100%; height: 84px; object-fit: cover; border-radius: 6px; background: #f2f4f8; display: block; }
.wy-lib-name {
    font-size: 11.5px; color: var(--text-soft); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; padding: 0 2px;
}
.wy-lib-noimg {
    height: 84px; display: grid; place-items: center;
    background: #f2f4f8; border-radius: 6px; color: var(--muted); font-size: 12px;
}
.wy-lib-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }

/* ---------- 图文封面选择器 ---------- */
.cover-picker { display: flex; gap: 12px; align-items: flex-start; }
.cover-thumb {
    width: 132px; height: 80px; flex-shrink: 0; cursor: pointer;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: #f5f7fb; overflow: hidden; display: grid; place-items: center;
}
.cover-thumb:hover { border-color: var(--primary); }
.cover-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-thumb-empty { font-size: 12px; color: var(--muted); }
.cover-side { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cover-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cover-meta { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.cover-meta code { font-size: 11px; background: #f2f4f8; padding: 2px 5px; border-radius: 4px; }
.cover-error { width: 100%; font-size: 12px; color: var(--red); }

.cover-modal {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center;
    background: rgba(20, 26, 38, .42); padding: 24px;
}
.cover-modal-body {
    width: min(760px, 100%); max-height: 78vh; overflow: hidden;
    display: flex; flex-direction: column;
    background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(16, 24, 40, .26);
}
.cover-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 600; color: var(--text);
}
.cover-modal-head-right { display: flex; align-items: center; gap: 8px; }
.cover-modal-x {
    border: 0; background: transparent; font-size: 20px; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 4px;
}
.cover-modal-x:hover { color: var(--text); }
.cover-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 10px; padding: 16px; overflow-y: auto;
}
.cover-item {
    display: flex; flex-direction: column; gap: 4px; position: relative;
    padding: 5px; border: 1px solid var(--border); border-radius: 9px;
    background: #fff; cursor: pointer; font-family: inherit; text-align: left;
}
.cover-item:hover:not(:disabled) { border-color: var(--primary); }
.cover-item.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cover-item:disabled { opacity: .6; cursor: wait; }
.cover-item img { width: 100%; height: 86px; object-fit: cover; border-radius: 6px; background: #f2f4f8; display: block; }
.cover-item-empty {
    height: 86px; display: grid; place-items: center;
    background: #f2f4f8; border-radius: 6px; color: var(--muted); font-size: 12px;
}
.cover-item-name {
    font-size: 11.5px; color: var(--text-soft); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; padding: 0 2px;
}
.cover-item-tag {
    position: absolute; top: 9px; right: 9px;
    padding: 1px 5px; border-radius: 4px;
    background: rgba(217, 119, 6, .92); color: #fff; font-size: 10px;
}
.cover-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }
