:root {
  --bg: #f6f4f1;
  --ink: #1b1a18;
  --ink-2: #5f5b55;
  --muted: #9b968e;
  --line: #e9e5df;
  --line-strong: #ddd7cf;
  --soft: #f7f4f0;
  --soft-2: #fbf9f6;
  --inv: #ffffff;
  --line-2: #f1ede7;
  --shadow-sm: 0 1px 2px rgba(28, 25, 22, .04);
  --shadow-card: 0 1px 2px rgba(28, 25, 22, .04), 0 10px 30px -24px rgba(28, 25, 22, .32);
  --accent: #ff6a1a;
  --accent-2: #ff8f4d;
  --accent-soft: #fff2e9;
  --accent-line: #ffd9c2;
  --accent-ink: #c9520f;
  --accent-2: #ff8f4d;
  --night: #12151b;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.label {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Login ---------- */
.login-wrap { display: grid; grid-template-columns: 1.1fr .9fr; min-height: 100vh; }
.login-hero {
  background: #0b0b0c; color: #fff; padding: 64px; display: flex; flex-direction: column;
  justify-content: space-between; position: relative; overflow: hidden;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 56px 56px; pointer-events: none;
}
.login-hero .brand { font-size: 13px; letter-spacing: .34em; text-transform: uppercase; position: relative; z-index: 1; }
.login-hero h1 {
  font-size: clamp(44px, 6vw, 82px); line-height: .94; letter-spacing: -.045em;
  font-weight: 600; margin: 0; position: relative; z-index: 1;
}
.login-hero p { color: #a9a9ae; max-width: 380px; position: relative; z-index: 1; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-box { width: 100%; max-width: 340px; }
.login-box h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 600; }
.login-box .hint { color: var(--muted); font-size: 13px; margin-bottom: 32px; }
.login-box .field { margin-bottom: 18px; }
.login-foot { margin-top: 26px; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.mobile-brand { display: none; font-size: 11px; letter-spacing: .32em; color: var(--muted); margin-bottom: 28px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; background: #fff;
}
.side .brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 22px; }
.side .brand .mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #ff7a2a, #ff5a05); box-shadow: 0 6px 16px rgba(255, 106, 26, .28);
  overflow: hidden;
}
.side .brand .mark svg { width: 18px; height: 18px; }
.side .brand .mark img { width: 100%; height: 100%; object-fit: cover; }
.side .brand .txt b { display: block; font-size: 12px; letter-spacing: .12em; font-weight: 700; line-height: 1.2; }
.side .brand .txt span { display: block; font-size: 9px; letter-spacing: .22em; color: var(--muted); margin-top: 2px; }
.side .role { padding: 0 8px 20px; font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 10px 9px 12px; font-size: 13.5px; color: var(--ink-2); border-radius: 8px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a { position: relative; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a .cnt { font-size: 10px; font-family: var(--mono); opacity: .5; letter-spacing: .06em; }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.side-foot .who { font-size: 12px; }
.side-foot .who b { display: block; font-size: 13px; font-weight: 600; }
.side-foot .who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 36px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: rgba(246,244,241,.86); backdrop-filter: blur(10px); z-index: 20;
}
.crumb { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.topbar .right { display: flex; align-items: center; gap: 10px; }
.view { padding: 30px 36px 80px; max-width: 1240px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; letter-spacing: -.035em; margin: 0; font-weight: 600; line-height: 1.1; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border: 1px solid transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, #ff7d33 100%);
  font-size: 13px; border-radius: 9px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(255, 106, 26, .2);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(255, 106, 26, .26); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line-strong); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); box-shadow: none; transform: none; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.link {
  background: none; border: none; height: auto; padding: 0; color: var(--ink-2); box-shadow: none;
  font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
}
.btn.link:hover { color: var(--accent-ink); text-decoration-color: var(--accent); opacity: 1; }
.btn.link.bad:hover { text-decoration-color: var(--ink); }

input[type=text], input[type=password], input[type=number], input[type=email], input[type=search], input[type=date], select, textarea {
  width: 100%; height: 42px; padding: 0 13px; background: #fff; font-size: 13.5px;
  border: 1px solid #e6dfd6; border-radius: 10px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input[type=text]:hover, input[type=number]:hover, input[type=date]:hover, select:hover, textarea:hover { border-color: #d5cabd; }
textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,106,26,.12); }
input::placeholder, textarea::placeholder { color: #aaaab0; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8b8f98 50%), linear-gradient(135deg, #8b8f98 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field { margin-bottom: 16px; }
.field > .label {
  display: block; margin-bottom: 7px; font-size: 12px; font-weight: 600;
  letter-spacing: .01em; text-transform: none; color: #3d3831;
}
.field > .label .req { color: var(--accent); font-weight: 700; margin-left: 3px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
/* 列表筛选条保持紧凑的小字标签 */
.filters .field > .label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- Cards / KPI ---------- */
.card { border: 1px solid var(--line); background: #fff; padding: 22px 24px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.card.tight { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: 13px; font-weight: 600; letter-spacing: .01em; margin: 0; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1fr 1fr; }
.kpi { border: 1px solid var(--line); padding: 20px 22px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.kpi .k { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--mono); font-size: 32px; letter-spacing: -.03em; margin-top: 10px; line-height: 1; }
.kpi .v small { font-size: 12px; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi .d { font-size: 11.5px; color: var(--muted); margin-top: 9px; }
.kpi.inv { background: linear-gradient(150deg, #23201c, #17130f); border-color: #23201c; color: #fff; }
.kpi.inv .v { color: #ffb98c; }
.kpi.inv .k, .kpi.inv .d, .kpi.inv .v small { color: rgba(255,255,255,.6); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--soft-2); white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fffaf6; }
td.num, th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Status / badges ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.st.off::before { background: transparent; border: 1px solid var(--ink); }
.st.mute::before { background: var(--line-strong); }
.tag {
  display: inline-block; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 5px;
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.tag.inv { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.tag.dash { border-style: dashed; color: var(--muted); }

/* ---------- Progress ---------- */
.bar { height: 4px; background: #f0f0f3; border-radius: 3px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.bar.hot > i { background: #0b0b0c; }
.quota-cell { min-width: 150px; }
.quota-cell .top { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; font-family: var(--mono); margin-bottom: 6px; }
.quota-cell .top .muted { font-family: var(--sans); }

/* ---------- Charts ---------- */
.chart {
  display: flex; align-items: stretch; gap: 8px; height: 132px; padding-top: 10px;
  background-image: linear-gradient(to top, var(--line) 1px, transparent 1px);
  background-size: 100% 33.33%; background-position: 0 0;
}
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 8px; }
.chart .col i { display: block; width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 2px; transition: height .4s var(--ease); }
.chart .col i:hover { filter: brightness(.94); }
.chart .col span { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }
.chart.soft .col i { background: #f0f0f3; }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted); }
.legend b { color: var(--ink); font-family: var(--mono); font-weight: 500; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 18px; }
.filters .field { margin: 0; width: 130px; }
.filters .field.dual { width: 188px; }
.filters .field.act { width: auto; }
.filters .dual-inner { display: flex; gap: 6px; }
.filters .dual-inner select { flex: 1; min-width: 0; padding-right: 24px; padding-left: 9px; }
.filters .field.grow { flex: 1; min-width: 120px; }
.filters .field > select, .filters .field > input { height: 34px; font-size: 13px; }
.filters .field > select { background-position: calc(100% - 16px) 14px, calc(100% - 11px) 14px; }
.filters .field .btn { height: 36px; }
.filters .field > .label { margin-bottom: 5px; }

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(11,11,12,.36); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 20px; z-index: 100; animation: fade .16s var(--ease);
}
.modal {
  background: #fff; width: 100%; max-width: 520px; border-radius: 12px; padding: 26px 28px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.22); animation: rise .2s var(--ease); max-height: 88vh; overflow: auto;
}
.modal.wide { max-width: 760px; }
.modal h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 600; }
.modal .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.modal-close { position: absolute; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
  background: var(--night); color: #fff; padding: 12px 16px; border-radius: 9px; font-size: 13px;
  min-width: 220px; max-width: 420px; box-shadow: 0 12px 30px rgba(0,0,0,.18); animation: rise .2s var(--ease);
}
.toast.bad { background: #fff; color: #b3300a; border: 1px solid var(--accent-line); }
.toast.bad::before { content: "! "; font-weight: 700; }

/* ---------- Chat ---------- */
.chat-head { align-items: center; margin-bottom: 18px; }
.chat-head h1 { font-size: 27px; }
.chat-head .sub { margin-top: 6px; }
.model-select {
  position: relative; display: inline-flex; align-items: center; height: 34px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; padding-left: 12px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.model-select::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,106,26,.14); flex: none;
}
.model-select:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(255,106,26,.09); }
.model-select select {
  height: 32px; border: 0; background-color: transparent; box-shadow: none !important;
  font-size: 12.5px; color: var(--ink); padding: 0 30px 0 8px; border-radius: 999px; min-width: 180px;
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px;
}
.model-select select:focus { box-shadow: none; }

.chat-layout {
  display: grid; grid-template-columns: 246px 1fr;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden;
  height: calc(100vh - 178px); min-height: 500px;
  box-shadow: 0 1px 2px rgba(28,25,22,.04), 0 18px 40px -34px rgba(28,25,22,.45);
}
.chat-side { border-right: 1px solid var(--line-2); display: flex; flex-direction: column; min-height: 0; background: #fcfaf7; }
.chat-side .head { padding: 11px 11px 10px; border-bottom: 1px solid var(--line-2); }
.chat-newbtn {
  width: 100%; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--accent-line); border-radius: 9px; background: #fff; color: var(--accent-ink);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease);
}
.chat-newbtn:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.chat-newbtn svg { width: 13px; height: 13px; }
.chat-side .list { overflow: auto; flex: 1; padding: 6px; }
.chat-side .item {
  padding: 10px 11px; border-radius: 9px; cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.chat-side .item + .item { margin-top: 2px; }
.chat-side .item:hover { background: #fff; color: var(--ink); }
.chat-side .item.active { background: #fff; color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.chat-side .item.active .t { font-weight: 500; }
.chat-side .item .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-side .item .m { font-size: 10.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.chat-side .item.active .m { color: #c08a68; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.chat-top {
  padding: 11px 16px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px;
}
.chat-top .meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-log {
  flex: 1; overflow: auto; padding: 24px 22px 12px; display: flex; flex-direction: column; gap: 22px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
}
.chat-log::-webkit-scrollbar { width: 9px; }
.chat-log::-webkit-scrollbar-thumb { background: #e6e1da; border-radius: 9px; }

.msg { max-width: 78%; display: flex; flex-direction: column; animation: rise .22s var(--ease); }
.msg .who { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.msg .bubble {
  padding: 12px 15px; font-size: 14px; line-height: 1.78; white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--line); background: #fcfaf7; border-radius: 14px 14px 14px 5px;
}
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .who { text-align: right; }
.msg.me .bubble {
  background: linear-gradient(135deg, #ff7f36, #ff6512); color: #fff; border-color: transparent;
  border-radius: 14px 14px 5px 14px; box-shadow: 0 10px 22px -14px rgba(255,106,26,.75);
}
.msg .bubble strong { font-weight: 600; }
.msg .bubble code {
  font-family: var(--mono); font-size: 12.5px; padding: 1px 5px; border-radius: 5px;
  background: rgba(27,26,24,.06);
}
.msg.me .bubble code { background: rgba(255,255,255,.22); }
.msg .meta { font-size: 10.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.msg.me .meta { text-align: right; }

.chat-compose { padding: 8px 16px 14px; }
.compose-box {
  border: 1px solid var(--line-strong); border-radius: 14px; background: #fff; padding: 9px 10px 8px 14px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.compose-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(255,106,26,.09); }
.compose-box textarea {
  width: 100%; border: 0; background: transparent; padding: 2px 0; min-height: 42px; max-height: 170px;
  resize: none; line-height: 1.7; box-shadow: none !important; outline: none;
}
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.compose-foot .hint { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.send-btn {
  height: 34px; padding: 0 18px; border: 0; border-radius: 9px; cursor: pointer; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, #ff7f36, #ff6512);
  box-shadow: 0 8px 18px -10px rgba(255,106,26,.85);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), opacity .16s var(--ease);
}
.send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 22px -12px rgba(255,106,26,.9); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; }

.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 420px; padding: 10px 18px 26px; }
.chat-empty .ico {
  width: 48px; height: 48px; margin: 0 auto 15px; border-radius: 15px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line);
}
.chat-empty .ico svg { width: 22px; height: 22px; }
.chat-empty b { display: block; color: var(--ink); font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 7px; }
.chat-empty .tip { font-size: 12.5px; line-height: 1.85; }
.chat-empty .picks { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chat-empty .picks button {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: 12px; color: var(--ink-2); cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease), background .16s var(--ease);
}
.chat-empty .picks button:hover { border-color: var(--accent-line); color: var(--accent-ink); background: var(--accent-soft); }

/* ---------- Drawer ---------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(11,11,12,.38); z-index: 90; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 92vw; background: #fff; border-radius: 12px 0 0 12px;
  border-left: 1px solid var(--line); padding: 26px 28px; overflow: auto; z-index: 91; animation: slide .22s var(--ease);
}
@keyframes slide { from { transform: translateX(20px); opacity: .6; } }
.drawer h2 { font-size: 16px; margin: 0 0 18px; letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.kv dd { margin: 0; word-break: break-word; }
pre.code {
  background: var(--soft); border: 1px solid var(--line); padding: 14px 16px; font-family: var(--mono);
  font-size: 11.5px; line-height: 1.7; overflow: auto; white-space: pre; border-radius: 2px;
}
.secret-box { border: 1px dashed var(--accent-line); background: #fffaf6; padding: 14px; font-family: var(--mono); font-size: 12px; word-break: break-all; margin: 10px 0 4px; }

/* ---------- List rows ---------- */
.rows { display: flex; flex-direction: column; }
.rows .r { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows .r:last-child { border-bottom: none; }
.rows .r .name { font-size: 13px; }
.rows .r .sub { font-size: 11px; color: var(--muted); }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .grow { grid-column: span 2; }
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-side { display: none; }
  .chat-main { min-height: 0; }
  .chat-log { min-height: 38vh; padding: 18px 14px 8px; }
  .chat-compose { padding: 8px 12px 12px; }
  .chat-head .page-actions { width: 100%; }
  .model-select { flex: 1; }
  .model-select select { min-width: 0; width: 100%; }
}
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; }
  .mobile-brand { display: block; }
  .login-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 12.5px; }
  .side { padding: 18px 14px; }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .view, .topbar { padding-left: 18px; padding-right: 18px; }
  .row, .row-3, .g4 { grid-template-columns: 1fr; }
  .msg { max-width: 92%; }
  .kv { grid-template-columns: 96px 1fr; }
}

/* ---------- 站点装修 ---------- */
.imgfield { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.imgfield .thumb {
  width: 108px; height: 66px; flex: none; border-radius: 8px; border: 1px dashed var(--line-strong);
  background: #fafafb center/cover no-repeat; display: grid; place-items: center;
  font-size: 10.5px; color: var(--muted); overflow: hidden;
}
.imgfield .thumb.has { border-style: solid; border-color: var(--line); }
.imgfield .body { flex: 1; min-width: 0; }
.imgfield .body > .label { display: block; margin-bottom: 6px; }
.imgfield input { height: 34px; font-size: 12px; }
.imgfield .actions { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.imgfield .actions .btn { height: 27px; padding: 0 10px; font-size: 11.5px; }

.list-editor { border-top: 1px solid var(--line); margin-top: 6px; }
.le-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.le-row:last-child { border-bottom: none; }
.le-thumb {
  width: 72px; height: 54px; border-radius: 7px; border: 1px dashed var(--line-strong);
  background: #fafafb center/cover no-repeat; display: grid; place-items: center; font-size: 10px;
  color: var(--muted); cursor: pointer; overflow: hidden;
}
.le-thumb.has { border-style: solid; border-color: var(--line); }
.le-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.le-fields .full { grid-column: span 2; }
.le-fields input { height: 32px; font-size: 12px; }
.le-tools { display: flex; flex-direction: column; gap: 6px; }
.le-tools .btn { height: 28px; padding: 0 9px; font-size: 11.5px; }
.le-empty { padding: 18px 0; text-align: center; color: var(--muted); font-size: 12px; }

.sect-anchor { scroll-margin-top: 90px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.form-note { font-size: 11.5px; color: var(--muted); line-height: 1.8; margin-top: 4px; }
.range-line { display: flex; align-items: center; gap: 12px; }
.range-line input[type=range] { flex: 1; accent-color: var(--accent); }
.range-line b { font-family: var(--mono); font-size: 12px; min-width: 46px; text-align: right; }

@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .le-row { grid-template-columns: 1fr; }
  .le-thumb { width: 100%; height: 120px; }
  .le-fields { grid-template-columns: 1fr; }
  .le-fields .full { grid-column: auto; }
  .le-tools { flex-direction: row; }
  .imgfield { flex-direction: column; }
  .imgfield .thumb { width: 100%; height: 130px; }
}

/* ================= 会员体系：卡密 / 套餐 / 会员服务 ================= */
.st.inv::before { background: #2f9e6f; }

.text-input {
  height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; width: 100%; font-size: 13px; transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.text-input::placeholder { color: var(--muted); }

.seg { display: inline-flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg-btn {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; transition: background .16s var(--ease), color .16s var(--ease);
}
.seg-btn:hover { background: var(--soft); }
.seg-btn.on { background: var(--accent); color: #fff; }

/* 批次卡片 */
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 12px; }
.batch-card {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.batch-card:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--shadow-card); }
.batch-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bc-name { font-weight: 600; font-size: 13.5px; }
.bc-sub { font-size: 12px; color: var(--muted); }
.bc-meta { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.bc-meta .ok { color: #2f9e6f; }
.bc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.btn.link.danger { color: #c0392b; }

/* 卡密明文列表 */
.code-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 6px;
  max-height: 336px; overflow: auto; background: var(--soft-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px;
}
.code-list code {
  font-family: var(--mono); font-size: 12.5px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 6px; padding: 6px 8px; letter-spacing: .04em;
}

/* 会员状态卡 */
.member-hero {
  position: relative; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  padding: 26px 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-card);
}
.member-hero.on { background: linear-gradient(118deg, #17161a 0%, #26221f 58%, #3b2a1f 100%); border-color: #2a2723; color: #fff; }
.member-hero.on::after {
  content: ""; position: absolute; right: -50px; top: -70px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 26, .38), transparent 66%);
}
.mh-l { position: relative; z-index: 1; }
.mh-label { font-size: 10px; letter-spacing: .22em; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.member-hero.on .mh-label { color: rgba(255, 255, 255, .55); }
.mh-name { font-size: 23px; font-weight: 600; letter-spacing: -.01em; margin-top: 8px; }
.mh-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.member-hero.on .mh-sub { color: rgba(255, 255, 255, .66); }
.mh-r { position: relative; z-index: 1; display: flex; gap: 28px; }
.mh-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 82px; }
.mh-kpi b { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mh-kpi span { font-size: 11px; color: var(--muted); }
.member-hero.on .mh-kpi span { color: rgba(255, 255, 255, .55); }

.activate-row { display: flex; gap: 10px; }
.activate-row .text-input { flex: 1; font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* 激活码 banner（默认收起，点「立即激活」展开输入区） */
.act-banner {
  display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 16px 20px;
  background: var(--inv); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.ab-ic {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent-line);
}
.ab-main { flex: 1; min-width: 0; }
.ab-t { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.ab-s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.act-banner .btn { flex: none; }
.act-panel { margin-top: 12px; padding: 16px 20px 14px; background: var(--soft-2); border: 1px solid var(--line); border-radius: 14px; }

/* 套餐卡片：皇冠标题 + 大号价格 + 划线价 + 勾选权益 + 浅橙按钮 */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-head h3 { font-size: 14px; font-weight: 600; margin: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(198px, 1fr)); gap: 14px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; padding: 20px 18px 18px;
  background: var(--inv); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--line-strong); }
.plan-card.hot { border-color: var(--accent-line); }
.plan-card.hot:hover { border-color: var(--accent-2); }
.pc-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.pc-crown { flex: none; display: inline-flex; color: var(--ink); opacity: .82; }
.pc-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.pc-badge {
  margin-left: auto; flex: none; padding: 1px 8px; border-radius: 7px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 500; letter-spacing: .04em;
}
.pc-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pc-price {
  margin-top: 14px; display: flex; align-items: baseline; gap: 2px;
  font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.pc-price i { font-style: normal; font-size: 15px; font-weight: 500; margin-right: 1px; }
.pc-price span { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.pc-origin { min-height: 17px; font-size: 12px; color: var(--muted); text-decoration: line-through; margin-top: 3px; }
.pc-hr { height: 1px; background: var(--line-2); margin: 13px 0 14px; }
.pc-feats { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.pc-feats li { position: relative; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.pc-feats li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 9px; height: 5px;
  border-left: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent); transform: rotate(-45deg);
}
.pc-buy, .plan-buy {
  width: 100%; margin-top: auto; height: 36px; border-radius: 9px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink);
  font-size: 13px; font-weight: 500;
}
.pc-buy:hover, .plan-buy:hover { background: #ffe8d8; border-color: var(--accent-2); color: var(--accent-ink); }
.pc-buy[disabled] { opacity: .55; cursor: not-allowed; }

/* 会员权益说明 */
.benefit-box {
  margin-top: 22px; padding: 20px 22px; background: var(--inv); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.bb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bb-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.benefit-grid { display: grid; grid-template-columns: repeat(var(--bn, 3), minmax(0, 1fr)); gap: 26px; margin-top: 16px; }
.bn { display: flex; gap: 11px; }
.bn-ic {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-ink);
}
.bn-txt b { display: block; font-size: 12.5px; font-weight: 600; }
.bn-txt p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

@media (max-width: 1080px) {
  .benefit-grid { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 720px) {
  .member-hero { flex-direction: column; padding: 22px; }
  .mh-r { gap: 20px; flex-wrap: wrap; }
  .act-banner { flex-wrap: wrap; align-items: flex-start; padding: 14px 16px; gap: 10px 12px; }
  .ab-ic { order: 1; width: 32px; height: 32px; border-radius: 9px; }
  .ab-main { order: 2; flex: 1 1 calc(100% - 52px); padding-top: 3px; }
  .act-banner .btn { order: 3; flex: 1 1 100%; margin-top: 2px; }
  .activate-row { flex-direction: column; }
  .plan-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* 登录方式绑定 */
.bind-rows { display: flex; flex-direction: column; }
.bind-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.bind-row:last-child { border-bottom: 0; padding-bottom: 0; }
.br-main { display: flex; flex-direction: column; gap: 3px; }
.br-k { font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.br-v { font-size: 13.5px; font-weight: 500; }
.br-v.off { color: var(--muted); font-weight: 400; }

/* 收银台 */
.pay-amount { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.pay-opts { display: flex; flex-direction: column; gap: 8px; }
.pay-opt {
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left;
  padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.pay-opt b { font-size: 13.5px; font-weight: 600; }
.pay-opt span { font-size: 11.5px; color: var(--muted); }
.pay-opt:hover:not([disabled]) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pay-opt[disabled] { opacity: .5; cursor: not-allowed; }

/* ================= 弹窗与表单 · 视觉升级（v2 精细版） ================= */
.modal-mask {
  background: radial-gradient(130% 120% at 50% -10%, rgba(38, 29, 21, .30), rgba(16, 13, 10, .52));
  -webkit-backdrop-filter: blur(10px) saturate(1.06);
  backdrop-filter: blur(10px) saturate(1.06);
  padding: 7vh 24px 8vh;
}
.modal {
  position: relative; border-radius: 20px; padding: 30px 34px 28px;
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 2px 6px rgba(28, 25, 22, .05),
    0 30px 70px -20px rgba(28, 25, 22, .30),
    0 90px 150px -70px rgba(28, 25, 22, .42);
  animation: modalRise .26s var(--ease);
  max-height: 86vh;
}
.modal::before {
  content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 106, 26, .5), transparent);
  pointer-events: none;
}
.modal::-webkit-scrollbar { width: 8px; }
.modal::-webkit-scrollbar-thumb { background: #e4dcd2; border-radius: 8px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal.wide { max-width: 800px; }
.modal h2 { font-size: 21px; font-weight: 600; letter-spacing: -.03em; line-height: 1.3; margin: 0; color: #17140f; }
.modal .sub { font-size: 13px; line-height: 1.72; color: #7c766c; margin: 9px 0 26px; max-width: 64ch; }

.modal-actions {
  margin: 28px -34px -28px; padding: 18px 34px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fdfcfa 0%, #f7f4f0 100%);
  border-radius: 0 0 20px 20px;
}
.modal-actions .btn { height: 40px; padding: 0 20px; border-radius: 10px; font-size: 13.5px; }
.modal-actions .btn.ghost { background: rgba(255, 255, 255, .92); }
@keyframes modalRise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* 表单：标签与输入 */
.modal .field { margin-bottom: 18px; }
.modal .field > .label {
  display: block; margin-bottom: 8px; padding: 0;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  text-transform: none; color: #3d3831;
}
.modal .field > .label .req { color: var(--accent); font-weight: 700; margin-left: 3px; }
.modal .field .help { font-size: 12px; line-height: 1.6; color: #9c968d; margin-top: 8px; }
.modal input[type=text], .modal input[type=password], .modal input[type=number],
.modal input[type=email], .modal input[type=search], .modal input[type=date],
.modal select, .modal textarea {
  height: 44px; padding: 0 14px; font-size: 13.5px; border-radius: 11px;
  border: 1px solid #e4ddd4; background: #fdfcfb;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.modal textarea { height: auto; min-height: 126px; padding: 12px 14px; line-height: 1.7; }
.modal select { padding-right: 38px; background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; }
.modal input[type=text]:hover, .modal input[type=number]:hover, .modal input[type=date]:hover,
.modal select:hover, .modal textarea:hover { border-color: #d5cabd; }
.modal input:focus, .modal select:focus, .modal textarea:focus {
  background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 106, 26, .12);
}
.modal input::placeholder, .modal textarea::placeholder { color: #b3aca3; }
.modal input[type=date] { color: #3d3831; }

/* 两列布局：默认整行，加 half 的字段两两并排 */
#mForm.form-cols2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-items: start; }
#mForm.form-cols2 > .field { grid-column: 1 / -1; min-width: 0; }
#mForm.form-cols2 > .field.half { grid-column: auto; }

/* 卡片式单选 */
.modal .choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .choice-opt {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; padding: 13px 16px; border-radius: 12px; border: 1px solid #e6dfd5;
  background: #fbfaf8; cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.modal .choice-opt b { font-size: 13.5px; font-weight: 600; color: #2b2723; letter-spacing: -.01em; }
.modal .choice-opt span { font-size: 11.5px; line-height: 1.5; color: #9c968d; }
.modal .choice-opt:hover { border-color: #d6cbbc; background: #fff; }
.modal .choice-opt:active { transform: translateY(1px); }
.modal .choice-opt.on {
  border-color: var(--accent); background: linear-gradient(180deg, #fff8f2 0%, #fff 100%);
  box-shadow: 0 0 0 3px rgba(255, 106, 26, .10), 0 10px 24px -18px rgba(255, 106, 26, .9);
}
.modal .choice-opt.on b { color: var(--accent-ink); }
.modal .choice-opt.on::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center/11px 11px no-repeat;
  box-shadow: 0 6px 12px -6px rgba(255, 106, 26, .8);
}

/* 卡密明文列表在弹窗里更收敛 */
.modal .code-list { background: #fbfaf8; border-color: #ece5dc; border-radius: 12px; }
.modal .code-list code { border-color: #eee7de; }

@media (max-width: 760px) {
  .modal { padding: 24px 20px 22px; border-radius: 16px; max-height: 90vh; }
  .modal h2 { font-size: 19px; }
  .modal .sub { margin-bottom: 20px; }
  .modal-actions { margin: 22px -20px -22px; padding: 14px 20px; border-radius: 0 0 16px 16px; }
  .modal.wide { max-width: 100%; }
  #mForm.form-cols2 { grid-template-columns: 1fr; }
  #mForm.form-cols2 > .field.half { grid-column: 1 / -1; }
  .modal .choice { grid-template-columns: 1fr; }
}

/* ================= 布局与卡片 · 视觉升级（v2 大气版） ================= */
.topbar {
  padding: 15px 40px;
  background: rgba(248, 246, 243, .84);
  border-bottom-color: #ece7e0;
}
.crumb { font-size: 10.5px; letter-spacing: .2em; color: #a8a29a; }
.view { padding: 34px 40px 96px; max-width: 1280px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 33px; letter-spacing: -.04em; font-weight: 650; }
.page-head .sub { font-size: 13.5px; margin-top: 10px; color: #8d867c; }

.side {
  background: linear-gradient(180deg, #fffefd 0%, #fbf9f6 100%);
  border-right-color: #ece7e0; padding: 22px 14px 18px;
}
.side .brand { padding-bottom: 24px; }
.side .brand .mark { border-radius: 10px; box-shadow: 0 8px 18px -8px rgba(255, 106, 26, .55); }
.nav { gap: 3px; }
.nav a { padding: 10px 12px; font-size: 13px; border-radius: 10px; }
.nav a.active {
  background: #fff; border: 1px solid #f4e5d9; color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(28, 25, 22, .04), 0 10px 24px -20px rgba(28, 25, 22, .55);
}
.nav a.active::before { height: 16px; border-radius: 0 3px 3px 0; }
.side-foot { border-top-color: #ece7e0; }

.card {
  border-radius: 16px; border-color: #eee9e2; padding: 24px 26px;
  box-shadow: 0 1px 2px rgba(28, 25, 22, .03), 0 18px 44px -34px rgba(28, 25, 22, .5);
}
.card-head { margin-bottom: 20px; }
.card-head h3 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.kpi {
  position: relative; overflow: hidden;
  border-radius: 16px; border-color: #eee9e2; padding: 22px 24px;
  box-shadow: 0 1px 2px rgba(28, 25, 22, .03), 0 18px 44px -34px rgba(28, 25, 22, .5);
}
.kpi .k { font-size: 10.5px; letter-spacing: .18em; color: #a29c93; }
.kpi .v { font-size: 36px; margin-top: 12px; letter-spacing: -.035em; }
.kpi .d { font-size: 11.5px; margin-top: 10px; color: #a09a91; }
.kpi.inv {
  background: radial-gradient(130% 150% at 100% 0%, #3d2c20 0%, #1d1813 55%, #15110d 100%);
  border-color: #2a231d;
}
.kpi.inv::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 200px; height: 200px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 106, 26, .28), transparent 68%);
  pointer-events: none;
}

.table-wrap {
  border-radius: 16px; border-color: #eee9e2;
  box-shadow: 0 1px 2px rgba(28, 25, 22, .03), 0 18px 44px -34px rgba(28, 25, 22, .5);
}
th { background: #fbf9f6; border-bottom-color: #ece7e0; padding: 13px 18px; letter-spacing: .16em; }
td { padding: 15px 18px; border-bottom-color: #f2ede6; }
tbody tr:hover { background: #fffaf5; }
.empty { color: #a29c93; }

/* 卡片内嵌表格去掉“卡中卡” */
.card > .table-wrap { border: 0; box-shadow: none; border-radius: 12px; }
.card.tight { overflow: hidden; }
.card.tight > .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.card > .table-wrap th:first-child, .card > .table-wrap td:first-child { padding-left: 10px; }
.form-note { font-size: 12px; line-height: 1.8; color: #8d867c; }
.grid.g2 { align-items: start; }
.batch-card { border-radius: 14px; }
.batch-card.on { box-shadow: 0 0 0 3px var(--accent-soft), 0 14px 30px -24px rgba(255, 106, 26, .8); }

/* 批次卡：避免 flex 子项被压缩导致文字行距变挤 */
.batch-card > * { flex: 0 0 auto; }
.batch-card { align-items: stretch; }

/* 表格表头：中文用正常字距，避免散乱 */
th { font-size: 11.5px; letter-spacing: .05em; color: #8d867c; font-weight: 600; }
/* 行内操作链接：去掉常驻下划线，hover 再提示 */
.btn.link { text-decoration: none; color: #6e675f; }
.btn.link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
.btn.link.danger { color: #bd4530; }
.btn.link.danger:hover { color: #a5391f; text-decoration-color: #f0c4bb; }
/* 下架状态用灰点代替空心圈 */
.st.off::before { background: #c6c0b7; border: 0; }
.tag { font-size: 11px; border-radius: 6px; padding: 2px 8px; letter-spacing: .04em; }

.card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* 弹窗右上角关闭 */
.modal h2 { padding-right: 34px; }
.modal-x {
  position: absolute; top: 18px; right: 20px; width: 32px; height: 32px; border: 0; border-radius: 10px;
  background: transparent; color: #a8a199; font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .16s var(--ease), color .16s var(--ease);
}
.modal-x:hover { background: #f4f0ea; color: #4a443c; }

/* 中文说明不按 ch 限宽（ch 对中文偏窄，会折出孤字） */
.modal .sub { max-width: none; }
.modal-x { color: #948d84; font-size: 21px; }
