/* ============================================================
   admin.css — 命理专属 · 运营后台（深邃星空 × 鎏金 v4）
   v4：桌面端左侧导航 + 移动端横滚页签；顶栏品牌/操作分区；
       页头、分区标题组件化；统一间距与层次，去除内联样式杂乱。
   结构/类名契约不变（.tab、.panel、.record、.tag 系列、.kv、.ca-form 等），仅视觉与布局重构。
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
    --bg: #05060d;
    --card: #0b0e17;
    --line: rgba(203,164,78,.28);
    --line-soft: rgba(168,176,196,.16);
    --gold: #cba44e;
    --gold-2: #e8cc8c;
    --ink: #e9edf5;
    --ink-2: #abb9d0;
    --red: #f2b3a8;
    --green: #88ceb2;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --shadow-card: 0 6px 18px rgba(2,3,8,.42), inset 0 1px 0 rgba(252,243,208,.14);
    --topbar-h: 60px;
}
html, body { min-height: 100%; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(120% 58% at 10% 4%,  rgba(88,84,110,.30) 0%, rgba(88,84,110,0) 56%),
        radial-gradient(95% 52% at 90% 16%,  rgba(56,66,100,.28) 0%, rgba(56,66,100,0) 60%),
        radial-gradient(125% 72% at 86% 90%, rgba(36,46,74,.40) 0%, rgba(36,46,74,0) 63%),
        linear-gradient(180deg, #0b0e17 0%, #05060d 54%, #030409 100%);
    background-attachment: fixed;
    color: var(--ink); font-size: 14px; line-height: 1.6;
}
/* 静态星点 + 斜贯银河（与 H5 深邃星空同源） */
body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(1.4px 1.4px at 12% 18%, rgba(232,238,255,.85), transparent 60%),
        radial-gradient(1px 1px at 28% 62%, rgba(232,204,140,.7), transparent 60%),
        radial-gradient(1.2px 1.2px at 47% 30%, rgba(207,224,255,.8), transparent 60%),
        radial-gradient(1px 1px at 63% 74%, rgba(232,204,140,.55), transparent 60%),
        radial-gradient(1.5px 1.5px at 78% 22%, rgba(222,232,255,.9), transparent 60%),
        radial-gradient(1px 1px at 88% 58%, rgba(207,224,255,.6), transparent 60%),
        radial-gradient(1px 1px at 8% 82%, rgba(207,224,255,.55), transparent 60%),
        radial-gradient(1.3px 1.3px at 36% 88%, rgba(232,238,255,.7), transparent 60%),
        radial-gradient(1px 1px at 72% 90%, rgba(232,204,140,.5), transparent 60%),
        linear-gradient(124deg, transparent 41%, rgba(150,156,190,.05) 48%, rgba(168,160,186,.09) 50%, rgba(150,156,190,.05) 52%, transparent 59%);
}
.app, .login-mask { position: relative; z-index: 1; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(203,164,78,.35); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
select option { background: var(--card); color: var(--ink); }

/* ---------- 登录 ---------- */
.login-mask { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box {
    width: 100%; max-width: 380px;
    background: linear-gradient(162deg, rgba(26,30,44,.28) 0%, rgba(13,16,24,.62) 44%, rgba(7,9,15,.72) 100%);
    border: 1px solid rgba(203,164,78,.34); border-radius: var(--r-lg); padding: 34px 26px;
    box-shadow: 0 16px 48px rgba(2,3,8,.6), inset 0 1px 0 rgba(252,243,208,.2), inset 0 0 26px rgba(96,108,148,.12);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.login-title {
    font-family: "Songti SC","STSong","STZhongsong","SimSun",serif;
    font-size: 22px; font-weight: 700;
    background: linear-gradient(180deg, #f7ecd0, #cba44e 60%, #6b521f);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    text-align: center; letter-spacing: 3px;
}
.login-sub { font-size: 12px; color: var(--ink-2); text-align: center; margin: 10px 0 22px; }
.login-input {
    width: 100%; height: 44px; border-radius: 10px;
    border: 1px solid var(--line); background: rgba(4,6,12,.35); color: var(--ink);
    padding: 0 12px; font-size: 14px; margin-bottom: 12px; outline: none;
}
.login-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(203,164,78,.14); }
.login-tip { font-size: 11px; color: var(--ink-2); text-align: center; margin-top: 14px; opacity: .75; }

/* ---------- 按钮 ---------- */
.btn-primary {
    height: 44px; border: none; border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 42%),
                linear-gradient(180deg, #f7ecd0 0%, #e8cc8c 46%, #cba44e 52%, #96752f 100%);
    color: #2a1f06; font-size: 15px; font-weight: 600; letter-spacing: 2px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.4), 0 0 14px rgba(203,164,78,.22);
}
.login-box .btn-primary { width: 100%; }
.btn-primary:active { transform: scale(.99); filter: brightness(1.06); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: rgba(203,164,78,.06); border: 1px solid var(--line); color: var(--gold-2); border-radius: var(--r-sm); cursor: pointer; transition: background .15s, border-color .15s; }
.btn-ghost:hover { background: rgba(203,164,78,.14); border-color: rgba(203,164,78,.5); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-danger { background: rgba(181,72,60,.1); border: 1px solid rgba(181,72,60,.55); color: var(--red); border-radius: var(--r-sm); height: 32px; padding: 0 12px; font-size: 12px; cursor: pointer; }
.btn-danger:hover { background: rgba(181,72,60,.2); }
.btn-ok { background: rgba(143,203,181,.08); border: 1px solid rgba(143,203,181,.5); color: var(--green); border-radius: var(--r-sm); height: 32px; padding: 0 12px; font-size: 12px; cursor: pointer; }
.btn-ok:hover { background: rgba(143,203,181,.18); }

/* ---------- 顶栏：品牌区 + 操作区 ---------- */
.app { min-height: 100vh; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: var(--topbar-h); padding: 0 20px;
    background: linear-gradient(180deg, rgba(5,7,12,.96), rgba(8,10,17,.9));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(203,164,78,.28);
    position: sticky; top: 0; z-index: 20;
}
.topbar__brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-family: "Songti SC","STSong","SimSun",serif; font-size: 19px; font-weight: 700; color: #241a05;
    background: linear-gradient(160deg, #f7ecd0, #cba44e 55%, #96752f);
    box-shadow: 0 2px 10px rgba(0,0,0,.45), 0 0 12px rgba(203,164,78,.35), inset 0 1px 0 rgba(255,255,255,.5);
}
.topbar__title {
    font-family: "Songti SC","STSong","STZhongsong","SimSun",serif;
    color: var(--gold-2); font-weight: 700; letter-spacing: 2px; font-size: 16px;
    text-shadow: 0 0 10px rgba(203,164,78,.35);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- 布局：侧栏 + 内容 ---------- */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.sidenav {
    flex: 0 0 208px; width: 208px;
    position: sticky; top: var(--topbar-h); align-self: flex-start;
    height: calc(100vh - var(--topbar-h)); overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 3px;
    padding: 16px 12px;
    background: rgba(8,10,17,.55);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-right: 1px solid var(--line-soft);
}
.tab {
    position: relative; display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 9px; border: 1px solid transparent;
    color: var(--ink-2); font-size: 13.5px; white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.tab:hover { background: rgba(203,164,78,.08); color: var(--ink); }
.tab.on {
    background: linear-gradient(90deg, rgba(203,164,78,.18), rgba(203,164,78,.04));
    color: var(--gold-2); font-weight: 600; border-color: rgba(203,164,78,.32);
}
.tab.on::before {
    content: ''; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 3px; background: linear-gradient(180deg, var(--gold-2), var(--gold));
    box-shadow: 0 0 8px rgba(240,220,152,.7);
}
.content { flex: 1; min-width: 0; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 26px 48px; }

/* 页头（返回 + 标题）与分区标题 */
.page-head {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 18px; padding-bottom: 14px;
    border-bottom: 1px solid var(--line-soft);
}
.page-head__title {
    font-family: "Songti SC","STSong","STZhongsong","SimSun",serif;
    color: var(--gold-2); font-size: 18px; font-weight: 700; letter-spacing: 1.5px;
}
.section-label { font-size: 13px; font-weight: 600; color: var(--gold-2); letter-spacing: .5px; margin: 20px 0 10px; }
.section-label:first-child { margin-top: 0; }

/* ---------- 概览卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-card {
    min-width: 0;
    background: linear-gradient(162deg, rgba(26,30,44,.26) 0%, rgba(13,16,24,.60) 44%, rgba(7,9,15,.70) 100%);
    border: 1px solid rgba(203,164,78,.28); border-radius: var(--r-md); padding: 15px 16px;
    box-shadow: var(--shadow-card);
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(203,164,78,.5); box-shadow: 0 10px 24px rgba(2,3,8,.5), inset 0 1px 0 rgba(252,243,208,.18); }
.stat-card--warn { border-color: rgba(181,72,60,.6); box-shadow: 0 0 0 1px rgba(181,72,60,.25), 0 6px 18px rgba(2,3,8,.45); }
.stat-card--warn .stat-card__val { color: var(--red); }
.stat-card__label { font-size: 12px; color: var(--ink-2); }
.stat-card__val { font-size: 23px; font-weight: 700; color: var(--gold-2); margin-top: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- 筛选条 / 子页签 ---------- */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-bar select, .filter-input {
    height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: rgba(4,6,12,.4); color: var(--ink); padding: 0 10px; font-size: 13px; outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.filter-bar select:focus, .filter-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(203,164,78,.12); }
.filter-input { flex: 1; min-width: 140px; }
.sub-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sub-tab {
    padding: 6px 16px; border-radius: 16px; border: 1px solid var(--line);
    color: var(--ink-2); font-size: 13px; cursor: pointer; background: rgba(4,6,12,.25);
    transition: background .15s, color .15s, border-color .15s;
}
.sub-tab:hover { background: rgba(203,164,78,.1); color: var(--ink); }
.sub-tab.on { background: rgba(203,164,78,.16); color: var(--gold-2); border-color: var(--gold); font-weight: 600; }

/* ---------- 卡片列表 ---------- */
.card-list { display: flex; flex-direction: column; gap: 10px; }
.record {
    background: linear-gradient(162deg, rgba(26,30,44,.22) 0%, rgba(13,16,24,.55) 44%, rgba(7,9,15,.66) 100%);
    border: 1px solid rgba(203,164,78,.24); border-radius: var(--r-md); padding: 13px 16px;
    box-shadow: var(--shadow-card);
    transition: border-color .15s;
}
.record:hover { border-color: rgba(203,164,78,.45); }
.record__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.record__title { font-weight: 600; color: var(--ink); }
.record__amt { color: var(--gold-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.record__meta { font-size: 12px; color: var(--ink-2); margin-top: 5px; word-break: break-all; }
.record__ops { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-left: 6px; }
.tag--green { background: rgba(143,203,181,.14); color: var(--green); border: 1px solid rgba(143,203,181,.35); }
.tag--gold { background: rgba(203,164,78,.16); color: var(--gold-2); border: 1px solid rgba(203,164,78,.4); }
.tag--red { background: rgba(181,72,60,.12); color: var(--red); border: 1px solid rgba(181,72,60,.45); }
.tag--gray { background: rgba(255,255,255,.07); color: var(--ink-2); border: 1px solid var(--line-soft); }
.link-btn { color: var(--gold-2); font-size: 12px; background: none; border: none; text-decoration: underline; cursor: pointer; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 18px; }
.empty { text-align: center; color: var(--ink-2); padding: 44px 0; font-size: 13px; }

/* ---------- 弹层 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(4,6,12,.7); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px; overflow-y: auto; }
.modal {
    width: 100%; max-width: 560px;
    background: linear-gradient(180deg, #121626, #0a0e1a);
    border: 1px solid rgba(203,164,78,.34); border-radius: 14px;
    box-shadow: 0 18px 54px rgba(2,3,8,.65), inset 0 1px 0 rgba(252,243,208,.16);
}
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--gold-2); font-weight: 600; letter-spacing: 1px; }
.modal__close { font-size: 22px; color: var(--ink-2); cursor: pointer; line-height: 1; background: none; border: none; }
.modal__close:hover { color: var(--ink); }
.modal__body { padding: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(168,176,196,.12); font-size: 13px; }
.kv__k { color: var(--ink-2); flex: 0 0 96px; }
.kv__v { color: var(--ink); text-align: right; word-break: break-all; }
.modal-section { margin-top: 14px; }
.modal-section h4 { color: var(--gold-2); font-size: 13px; margin-bottom: 8px; }
.op-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.op-row select, .op-row input {
    height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: rgba(4,6,12,.4); color: var(--ink); padding: 0 10px; outline: none;
}

/* ---------- 合规评估长文表单 ---------- */
.kv--block { display: block; padding: 10px 0; }
.kv--block .kv__k { display: block; flex: none; margin-bottom: 4px; color: var(--gold-2); }
.kv--block .kv__v { display: block; text-align: left; white-space: pre-wrap; word-break: break-word; line-height: 1.7; color: var(--ink); }
.ca-form label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--ink-2); }
.ca-form input, .ca-form select, .ca-form textarea {
    width: 100%; box-sizing: border-box; border-radius: var(--r-sm); border: 1px solid var(--line);
    background: rgba(4,6,12,.4); color: var(--ink); padding: 8px 10px; font-size: 13px;
    outline: none; font-family: inherit;
}
.ca-form input:focus, .ca-form select:focus, .ca-form textarea:focus { border-color: var(--gold); }
.ca-form textarea { min-height: 88px; line-height: 1.65; resize: vertical; }
.ca-form .ca-hint { margin-top: 3px; font-size: 11px; color: var(--ink-2); opacity: .85; }
.ca-form .ca-row2 { display: flex; gap: 8px; }
.ca-form .ca-row2 > div { flex: 1; min-width: 0; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: rgba(7,9,15,.95); border: 1px solid rgba(203,164,78,.4); color: #f7ecd0; padding: 10px 18px; border-radius: 20px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; max-width: 86%; text-align: center; box-shadow: 0 8px 26px rgba(2,3,8,.6); }
.toast.show { opacity: 1; }

/* ---------- 移动端：侧栏降级为横滚页签 ---------- */
@media (max-width: 900px) {
    .topbar { padding: 0 14px; }
    .layout { flex-direction: column; }
    .sidenav {
        position: sticky; top: var(--topbar-h); z-index: 9;
        flex: 0 0 auto; width: 100%; height: auto;
        flex-direction: row; align-items: center; gap: 6px;
        overflow-x: auto; overflow-y: hidden;
        padding: 8px 10px;
        border-right: none; border-bottom: 1px solid var(--line-soft);
    }
    .tab { flex: 0 0 auto; padding: 8px 14px; }
    .tab.on::before { display: none; }
    /* 横滚页签不显示鎏金滚动条（那条粗杠视觉上是杂音），靠滑动本身暗示可滚 */
    .sidenav { scrollbar-width: none; }
    .sidenav::-webkit-scrollbar { display: none; }
    .stat-card__val { font-size: 20px; }
    .content { padding: 16px 14px 36px; }
    .page-head__title { font-size: 16px; }
}
