:root {
  --bg: #f5f6f8; --card: #fff; --line: #e3e5e9; --text: #1c1e21; --muted: #6a6f76;
  --jd: #2a78d6; --tm: #eb6834; --ok: #1f8a4c; --warn: #b26a00; --danger: #c93a3a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }

.shell { height: 100vh; }
.aside { background: #fff; border-right: 1px solid var(--line); transition: width .2s; overflow-x: hidden; overflow-y: auto; }
.aside .el-menu { border-right: 0; }
.aside .el-menu-item { height: 42px; line-height: 42px; }
.brand { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 18px; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--jd); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.menu-group { padding: 14px 20px 4px; font-size: 12px; color: var(--muted); }
.menu-tag { margin-left: 6px; transform: scale(.85); }
.menu-badge { margin-left: 6px; background: var(--danger); color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; line-height: 17px; }

.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.grow { flex: 1; }
.proto-flag { font-size: 12px; color: var(--warn); background: #fff6e5; border: 1px solid #f3d9a4; padding: 1px 8px; border-radius: 10px; }
.global-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.global-switch.off { background: #fdecec; color: var(--danger); }
.user { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.main { padding: 20px; overflow-y: auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 760px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sync-note { font-size: 12px; color: var(--muted); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-row.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.kpi-link { cursor: pointer; }
.kpi-link:hover { border-color: var(--jd); }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-warn { border-left: 3px solid #e6a23c; }
.kpi-danger { border-left: 3px solid var(--danger); }
.kpi-ok { border-left: 3px solid var(--ok); }

.block { margin-bottom: 16px; }
.card-h { display: flex; justify-content: space-between; align-items: center; }
.el-card__header { padding: 12px 16px; font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sum-bar { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.sum-bar b { color: var(--text); }

.plat { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 5px; border-radius: 4px; color: #fff; vertical-align: 1px; }
.plat-JD { background: var(--jd); }
.plat-TM { background: var(--tm); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.txt-danger { color: var(--danger); }
.txt-warn { color: var(--warn); }
.txt-ok { color: var(--ok); }
.clickable { cursor: pointer; }

.todo { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.todo:last-child { border-bottom: 0; }
.todo:hover .todo-body > div:first-child { color: var(--jd); }

.status-strip { display: flex; flex-wrap: wrap; gap: 8px 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; }
.status-strip > div { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.profit-calc { margin-top: 14px; max-width: 420px; margin-left: auto; }
.profit-calc > div { display: flex; justify-content: space-between; padding: 3px 0; }
.profit-calc .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.fee-chip { display: inline-block; background: #f2f3f5; border-radius: 4px; padding: 0 6px; margin: 1px 4px 1px 0; font-size: 12px; }
.comp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; width: 100%; }
ul.plain { margin: 0; padding-left: 18px; color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 4px; }

.mask { display: none; }
@media (max-width: 767px) {
  .aside { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; width: 208px !important; transform: translateX(-100%); transition: transform .2s; }
  .aside.open { transform: none; }
  .mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 20; }
  .main { padding: 16px; }
  .proto-flag, .global-switch > span { display: none; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

.scene-list { display: flex; flex-direction: column; align-items: flex-start; }
.scene-list .el-radio { height: auto; margin: 0 0 8px; align-items: flex-start; white-space: normal; line-height: 1.5; }
.scene-list .el-radio__input { margin-top: 3px; }

.log-row { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: #f7f8fa; }
.code-h { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
pre.code { margin: 0 0 8px; background: #f6f7f9; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; max-height: 360px; overflow: auto; }

.trace-link { display: inline-flex; align-items: center; gap: 4px; }
.trace-copy { cursor: pointer; color: var(--muted); }
.trace-copy:hover { color: var(--jd); }
.trace-item-h { display: flex; align-items: center; gap: 8px; width: 100%; padding-right: 8px; }
.trace-no { width: 20px; height: 20px; border-radius: 50%; background: #eef0f3; font-size: 11px; display: grid; place-items: center; flex: none; }
.el-collapse-item__title { flex: 1; min-width: 0; }
.trace-item-h { line-height: 1.4; text-align: left; }
.trace-no { line-height: 20px; }
.guide-preview { margin-top: 10px; background: #f7f9fc; border: 1px dashed #cfd8e6; border-radius: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.6; width: 100%; }
.global-search { width: 380px; }
.sr { display: flex; align-items: center; gap: 8px; line-height: 1.4; padding: 4px 0; }
.sr-main { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.search-pop li { height: auto !important; }
.dd-h { padding: 6px 16px; font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .global-search { width: 220px; } }
@media (max-width: 767px) { .global-search { display: none; } }
.tpl-body { white-space: pre-wrap; font: inherit; font-size: 12.5px; line-height: 1.6; margin: 0; }
.phone { max-width: 320px; margin: 0 auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fafafa; }
.phone-h { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; font-weight: 600; }
.phone-b { margin: 12px; background: #fff; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font: 13px/1.6 inherit; font-family: inherit; }
.mode-card ol.flow { margin: 0 0 10px; padding-left: 20px; line-height: 1.8; }
.pros > div { line-height: 1.7; }
