:root {
  color: #1c1915;
  background: #f3f0ea;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 15px;
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e4ddd2;
  --card: #fffdf9;
  --accent: #0e7c66;
  --accent-ink: #fff;
  --side: #f7f4ef;
  --side-ink: #1c1915;
  --side-muted: #7a7168;
  --side-active: #e7f3ef;
  --chip: #e7f3ef;
  --chip-ink: #0e7c66;
  --hero: #123f38;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas, #f3f0ea); }
a { color: var(--accent); }
h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.02em; }
h2 { margin: 0 0 12px; font-size: 18px; }
button, input, select { font: inherit; }
button {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: #9f3040; color: #fff; }
button:disabled { opacity: .55; cursor: default; }
svg { display: block; }

.theme-admin {
  --canvas: #f4f1ea;
  --accent: #c9862a;
  --accent-ink: #1c1408;
  --side: #1c140c;
  --side-ink: #f6efe4;
  --side-muted: #c3b4a2;
  --side-active: rgba(201, 134, 42, .18);
  --chip: #f8ecd8;
  --chip-ink: #8a5a12;
  --card: #fffdf8;
  --line: #eadfce;
}

.shell { display: flex; min-height: 100vh; }
.side {
  width: 248px;
  flex: 0 0 248px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--side);
  color: var(--side-ink);
  border-right: 1px solid var(--line);
}
.theme-admin .side { border-right: 0; }
.side a { color: inherit; text-decoration: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 8px 22px;
}
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; margin-top: 2px; color: var(--side-muted); letter-spacing: .08em; }
.brand-mark, .hero-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
}
.theme-admin .brand-mark { background: #c9862a; color: #1c1408; }
.brand-mark svg, .hero-mark svg { width: 26px; height: 26px; }
.side nav, .side-foot { display: flex; flex-direction: column; gap: 4px; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(127, 116, 104, .25); }
.side nav a, .side-foot a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--side-ink);
}
.nav-ico {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(127, 116, 104, .12);
  flex: 0 0 28px;
}
.nav-ico svg { width: 16px; height: 16px; }
.side nav a.active, .side-foot a.active {
  background: var(--side-active);
  color: var(--accent);
  font-weight: 700;
}
.theme-admin .side nav a.active, .theme-admin .side-foot a.active { color: #f0c27a; }
.side nav a:hover, .side-foot a:hover { background: var(--side-active); }
.side em {
  margin-left: auto;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: #d85a3a;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 253, 249, .9);
  border-bottom: 1px solid var(--line);
}
.topbar-title, .topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.notice-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}
.notice-bell svg { width: 18px; height: 18px; }
.notice-bell.active, .notice-bell:hover { color: var(--accent); border-color: var(--accent); }
.notice-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #d85a3a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.notice-bell.has-unread .notice-count { animation: notice-pulse 1.4s ease-in-out infinite; }
@keyframes notice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.topbar-brand { display: none; }
.topbar-link .short { display: none; }
.topbar-link svg { width: 15px; height: 15px; }
.topbar-link.active, .topbar-link:hover { color: var(--accent); border-color: var(--accent); }
button.topbar-link { cursor: pointer; font: inherit; }
button.linkish { display: inline; padding: 0; border: 0; border-radius: 0; background: none; color: var(--accent); cursor: pointer; }
.topbar-link.needs-bind { border-color: #e2b15a; }
.topbar-link.needs-bind::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d85a3a;
}
.bind-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6e8;
  color: #8a5a10;
  border: 1px solid #f0d7a8;
}
.role-chip {
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--chip);
  color: var(--chip-ink);
  font-size: 12px;
  font-weight: 700;
}
.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.main { flex: 1; padding: 28px; min-width: 0; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(380px, .85fr); }
.login-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
  color: #f6f1e8;
  background:
    radial-gradient(circle at 12% 18%, rgba(246, 215, 162, .22), transparent 28%),
    linear-gradient(165deg, #0f3d36 0%, #143f38 55%, #1b2923 100%);
  overflow: hidden;
}
.hero-mark { width: 42px; height: 42px; background: #f6d7a2; color: #123f38; flex: 0 0 42px; }
.hero-kicker { margin: 0 0 2px; letter-spacing: .14em; font-size: 12px; color: #f6d7a2; }
.tour { width: min(560px, 100%); }
.tour-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tour-head strong { display: block; font-size: 22px; }
.tour-count { margin-left: auto; color: #d7e4df; font-variant-numeric: tabular-nums; }
.tour-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tour-steps button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #d7e4df;
}
.tour-steps button i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  font-style: normal;
  font-size: 11px;
}
.tour-steps button[aria-selected="true"] { background: #f6d7a2; color: #1c1408; }
.tour-steps button[aria-selected="true"] i { background: #1c1408; color: #f6d7a2; }
.tour-progress { height: 3px; margin: 12px 0 14px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.tour-progress span { display: block; height: 100%; width: 0; background: #f6d7a2; transform-origin: left; }
@keyframes tour-bar { from { width: 0; } to { width: 100%; } }
.tour-stage {
  position: relative;
  height: 280px;
  border-radius: 22px;
  background: rgba(255, 253, 249, .96);
  color: #1c1915;
  box-shadow: 0 24px 50px rgba(0, 0, 0, .18);
  overflow: hidden;
}
.scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 26px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}
.scene:not(.is-on) { visibility: hidden; }
.scene.is-on { visibility: visible; opacity: 1; transform: none; transition: opacity .35s ease, transform .35s ease; }
.scene-card {
  border: 1px solid #eadfce;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}
.scene-label { display: block; margin-bottom: 8px; color: #8a5a12; font-size: 13px; }
.key-code { display: block; font-size: 20px; letter-spacing: .04em; }
.scene-btn {
  margin-top: 12px;
  background: #0e7c66;
  color: #fff;
}
.scene.is-on .key-card { animation: rise .55s ease both; }
.scene.is-on .scene-btn { animation: press 1.1s ease .45s both; }
.scene.is-on .scene-result { animation: rise .45s ease .7s both; }
.scene-result { margin: 0; color: #3d5c54; }
.scene-result b { color: #0e7c66; }
.fake-row, .range-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.fake-row + .fake-row { border-top: 1px solid #f0e8dc; }
.fake-row span, .range-line span { color: #6f675e; }
.scene.is-on .fake-row { animation: rise .4s ease both; }
.scene.is-on .fake-row:nth-child(2) { animation-delay: .15s; }
.scene.is-on .fake-row:nth-child(3) { animation-delay: .3s; }
.range-track { flex: 1; height: 8px; border-radius: 99px; background: #efe6d8; overflow: hidden; }
.range-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0e7c66, #f0c27a); }
.scene.is-on .range-track i { animation: fill-range .9s ease .2s forwards; }
.order-card { display: flex; justify-content: space-between; align-items: center; }
.order-card small { display: block; margin-top: 4px; color: #6f675e; }
.order-card strong { font-size: 28px; color: #0e7c66; }
.scene.is-on .order-card { animation: slide-in .5s ease both; }
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #123f38;
  color: #f6f1e8;
}
.toast svg { width: 16px; height: 16px; }
.scene.is-on .toast { animation: drop .45s ease .35s both; }
.revenue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.revenue-grid article { padding: 12px; border-radius: 14px; background: #fff; border: 1px solid #eadfce; }
.revenue-grid span { display: block; color: #6f675e; font-size: 12px; }
.revenue-grid strong { display: block; margin-top: 4px; font-size: 22px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 54px; }
.bars i { flex: 1; height: 20%; border-radius: 6px 6px 2px 2px; background: #0e7c66; opacity: .35; }
.bars i:nth-child(3), .bars i:nth-child(5) { background: #c9862a; opacity: .8; }
.scene.is-on .bars i { animation: grow .7s ease forwards; }
.scene.is-on .bars i:nth-child(1) { animation-delay: .05s; }
.scene.is-on .bars i:nth-child(2) { animation-delay: .12s; }
.scene.is-on .bars i:nth-child(3) { animation-delay: .2s; }
.scene.is-on .bars i:nth-child(4) { animation-delay: .28s; }
.scene.is-on .bars i:nth-child(5) { animation-delay: .36s; }
.tour-caption { min-height: 48px; margin: 14px 0 0; color: #d7e4df; line-height: 1.6; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes press { 0%, 100% { transform: none; } 45% { transform: scale(.96); } 70% { background: #0b6453; } }
@keyframes fill-range { to { width: 68%; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { height: 12%; } to { height: var(--h, 70%); } }
.bars i:nth-child(1) { --h: 35%; }
.bars i:nth-child(2) { --h: 55%; }
.bars i:nth-child(3) { --h: 86%; }
.bars i:nth-child(4) { --h: 48%; }
.bars i:nth-child(5) { --h: 74%; }
@media (prefers-reduced-motion: reduce) {
  .scene, .scene.is-on .key-card, .scene.is-on .scene-btn, .scene.is-on .scene-result,
  .scene.is-on .fake-row, .scene.is-on .order-card, .scene.is-on .toast, .tour-progress span,
  .notice-bell.has-unread .notice-count {
    animation: none;
    transition: none;
  }
}
.login-panel { display: grid; place-items: center; padding: 32px; background: #f6f3ee; }
.login-card { width: min(440px, 100%); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--accent); font-weight: 700; }
.eyebrow svg { width: 16px; height: 16px; }
.lede { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.auth-form button { width: 100%; margin-top: 6px; min-height: 44px; }
.auth-switch { color: var(--muted); }
.field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; }
.field svg { width: 16px; height: 16px; color: #8a8176; flex: 0 0 16px; }
.field input { border: 0; padding: 12px 0; width: 100%; background: transparent; outline: none; }
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 124, 102, .12); }

.page-head, .stats, .split { display: flex; gap: 16px; }
.page-head { justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.page-title { flex: 1; min-width: 0; }
.page-title-row { display: flex; align-items: center; gap: 18px; min-height: 40px; }
.page-title-row h1 { margin: 0; }
.run-stats { flex: 1; min-width: 0; }
.run-stats p { margin: 0; color: var(--muted); white-space: nowrap; }
.stats { flex-wrap: wrap; margin-bottom: 18px; }
.stats article, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.stats article { min-width: 160px; flex: 1; position: relative; }
.stat-ico {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--chip);
  color: var(--chip-ink);
}
.stat-ico svg { width: 16px; height: 16px; }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 6px; font-size: 26px; letter-spacing: -0.03em; }
.panel { margin: 0 0 16px; }
.split { align-items: flex-start; }
.split .panel { flex: 1; min-width: 0; }
.flash { margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; }
.flash-ok { background: #e5f6ee; color: #0d6b45; }
.flash-error { background: #fde8ea; color: #9f3040; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; }
.ok { color: #0d6b45; }
.bad { color: #9f3040; }
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
input, select { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
label input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
label select,
label textarea { width: 100%; min-width: 0; }
.form-grid { display: grid; gap: 0 16px; }
.narrow { max-width: 560px; }
.check { flex-direction: row; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 12px; }
.actions, .inline-form { display: inline-flex; gap: 8px; margin: 0 8px 16px 0; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.notice pre { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }
.notice.unread { outline: 1px solid #e7b56a; }
.log-box { max-height: 320px; overflow: auto; scrollbar-width: none; background: #17241f; color: #e7f3ef; border-radius: 12px; padding: 12px; font-size: 13px; }
.theme-admin .log-box { background: #1c140c; color: #f6efe4; }
.log-box time { color: #b7c7c0; margin-right: 8px; }
.log-success { color: #9ddeb8; }
.log-error { color: #ffb4b4; }
.log-warning { color: #ffd59a; }
.log-muted { color: #b7c7c0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pager { display: flex; gap: 12px; align-items: center; }
.domain-row { display: flex; gap: 10px; align-items: center; }
.domain-row input[name="url"] { flex: 1; }
.inline-stats { margin-top: 0; }
.head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.head-actions form { margin: 0; }
.head-actions button { display: inline-flex; align-items: center; gap: 8px; color: #fff; white-space: nowrap; }
.head-actions .tone-reset { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.head-actions .tone-records { background: #2f6fdb; }
.head-actions .tone-notices { background: #c47b12; }
.head-actions .tone-logs { background: #3d5a80; }
.head-actions em {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .28);
  color: #fff;
  font-style: normal;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}
.card-dialog, .app-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  height: fit-content;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(28, 25, 21, .22);
}
.card-dialog[open], .app-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  overflow: hidden;
}
.app-dialog-wide { width: min(760px, calc(100vw - 32px)); }
.card-dialog::backdrop, .app-dialog::backdrop { background: rgba(28, 25, 21, .45); }
.dialog-body { max-height: calc(100vh - 180px); overflow: auto; scrollbar-width: none; }
.dialog-body::-webkit-scrollbar, .log-box::-webkit-scrollbar { width: 0; height: 0; display: none; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 18px 0; }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 12px 18px 18px; }
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  gap: 12px;
  padding: 0 18px 18px;
}
#guide-dialog .dialog-actions:has(#guide-prev[hidden]) {
  justify-content: center;
}
#card-dialog .dialog-actions:has(#card-delete-button[hidden]) {
  justify-content: center;
}
#mail-dialog .dialog-actions { justify-content: center; }
.mail-split { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 0 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 8px 0 32px; align-items: stretch; }
.vip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  padding: 22px 22px 18px;
  overflow: hidden;
  border-radius: 22px;
}
.vip-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 28%, rgba(255,255,255,.28) 46%, transparent 62%),
    repeating-linear-gradient(125deg, rgba(255,255,255,.14) 0 1px, transparent 1px 7px);
}
.vip-top, .vip-price, .vip-perk, .vip-note, .vip-card form { position: relative; z-index: 1; }
.vip-top { display: flex; justify-content: space-between; align-items: center; }
.vip-rank {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}
.vip-name { font-weight: 700; }
.vip-price { font-size: 48px; line-height: 1; letter-spacing: -0.04em; }
.vip-price small { margin-right: 2px; font-size: 20px; }
.vip-perk { margin: 0; font-weight: 700; }
.vip-note { margin: 0; font-size: 13px; opacity: .8; }
.vip-card form { margin-top: auto; }
.vip-card button { width: 100%; border-radius: 12px; }
.vip-silver {
  color: #243044;
  background:
    radial-gradient(140px 90px at 100% 0%, rgba(255,255,255,.9), transparent 60%),
    linear-gradient(155deg, #f8fafc 0%, #d5dee9 48%, #b9c6d6 100%);
  border: 1px solid #c5d0de;
  box-shadow: 0 16px 34px rgba(70, 86, 110, .16);
}
.vip-silver .vip-rank { background: rgba(255,255,255,.55); color: #3d4d64; }
.vip-silver button { background: #31445f; color: #fff; }
.vip-gold {
  color: #4a2e08;
  background:
    radial-gradient(150px 90px at 100% 0%, rgba(255,255,255,.7), transparent 58%),
    linear-gradient(155deg, #fff6d2 0%, #f0c14d 42%, #c8881c 100%);
  border: 1px solid #e4b23a;
  box-shadow: 0 20px 40px rgba(168, 112, 18, .24);
  transform: translateY(-10px);
}
.vip-gold .vip-rank { background: rgba(92, 56, 8, .12); color: #6a3e09; }
.vip-gold button { background: #5c3908; color: #fff8e6; }
.vip-diamond {
  color: #f8f1e4;
  background:
    radial-gradient(160px 100px at 100% 0%, rgba(243, 212, 138, .42), transparent 56%),
    linear-gradient(155deg, #3a3126 0%, #14110e 58%, #2c2216 100%);
  border: 1px solid rgba(232, 196, 122, .6);
  box-shadow: 0 22px 44px rgba(16, 12, 8, .38);
}
.vip-diamond::after {
  background:
    linear-gradient(115deg, transparent 30%, rgba(243,212,138,.22) 48%, transparent 64%),
    repeating-linear-gradient(125deg, rgba(243,212,138,.1) 0 1px, transparent 1px 8px);
}
.vip-diamond .vip-rank { background: rgba(243, 212, 138, .16); color: #f3d48a; }
.vip-diamond .vip-price { color: #f6e2b4; }
.vip-diamond button { background: linear-gradient(180deg, #f6e2b0, #d7a64a); color: #2c210c; }
.install-app {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 45;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(28, 25, 21, .18);
}
.install-app:not([hidden]) { display: inline-flex; }
.theme-user .install-app { bottom: 84px; }
@media (display-mode: standalone) {
  .install-app { display: none !important; }
}
.support-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(14, 124, 102, .32);
  cursor: pointer;
}
.support-fab svg { width: 20px; height: 20px; }
.support-note { white-space: pre-wrap; line-height: 1.7; margin: 0; }
.guide-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.guide-nav button { padding: 6px 10px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.guide-nav button.is-on { background: var(--accent); color: #fff; }
.guide-pane { display: none; }
.guide-pane.is-on { display: block; }
.guide-pane h3 { margin: 0 0 8px; }
.guide-pane p, .guide-pane li { line-height: 1.7; }
.guide-pane ol { margin: 0; padding-left: 18px; }
.pay-note { white-space: pre-wrap; line-height: 1.6; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
.card-empty { margin: 48px 0; text-align: center; color: var(--muted); font-size: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.bank-wrap { position: relative; width: 100%; }
button.bank-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  height: auto;
  aspect-ratio: 1.7 / 1;
  padding: 20px 22px 16px;
  border: 0;
  border-radius: 18px;
  text-align: left;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(90px 60px at 100% 0%, rgba(255,255,255,.34), transparent 62%),
    linear-gradient(145deg, color-mix(in srgb, var(--card-color, var(--accent)) 62%, #fff), var(--card-color, var(--accent)) 46%, color-mix(in srgb, var(--card-color, var(--accent)) 62%, #111));
  box-shadow: 0 12px 22px rgba(28, 25, 21, .16), inset 0 1px 0 rgba(255,255,255,.4);
}
button.bank-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 28%, rgba(255,255,255,.2) 44%, transparent 58%),
    repeating-linear-gradient(128deg, rgba(255,255,255,.07) 0 1px, transparent 1px 6px);
  pointer-events: none;
}
.bank-top, .bank-foot { display: flex; width: 100%; justify-content: space-between; align-items: center; position: relative; }
.chip {
  width: 38px;
  height: 28px;
  border-radius: 5px;
  background: linear-gradient(135deg, #f8e7b6, #c49645 42%, #f4d48a 68%, #8d6a2f);
  box-shadow: inset 0 0 0 1px rgba(90, 60, 16, .35);
  position: relative;
}
.chip::after {
  content: "";
  position: absolute;
  inset: 4px 3px;
  background:
    linear-gradient(rgba(90, 60, 16, .55), rgba(90, 60, 16, .55)) center / 100% 1px no-repeat,
    linear-gradient(rgba(90, 60, 16, .55), rgba(90, 60, 16, .55)) center / 1px 100% no-repeat;
}
.bank-brand { font-size: 14px; letter-spacing: .14em; opacity: .9; }
.bank-name { position: relative; font-size: 24px; font-weight: 700; letter-spacing: .04em; text-shadow: 0 1px 1px rgba(0,0,0,.2); }
.bank-range, .bank-foot { position: relative; font-size: 15px; }
.bank-restart { position: absolute; right: 10px; bottom: 10px; margin: 0; }
.bank-restart button { padding: 4px 8px; font-size: 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(28, 25, 21, .2);
}
.swatch.is-on { box-shadow: 0 0 0 2px var(--ink); }
input[type="color"] { width: 52px; height: 36px; padding: 2px; }

.goods-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.goods-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.goods-card img, .goods-ph {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3efe8;
}
.goods-ph { display: grid; place-items: center; color: #8a8176; font-size: 22px; font-weight: 700; }
.goods-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.goods-body strong { color: var(--ink); font-size: 15px; line-height: 1.3; }
.goods-price { color: var(--ink); font-size: 18px; letter-spacing: -0.03em; }
.goods-sold, .goods-unsold {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
}
.goods-sold { background: #e5f6ee; color: #0d6b45; }
.goods-unsold { background: #fff4e2; color: #8a5a10; }
.goods-empty { margin: 8px 0 0; }
.record-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 6px; }
td small { display: block; margin-top: 4px; }

@media (max-width: 1080px) {
  .card-grid, .shop-grid, .goods-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vip-gold { transform: none; }
}

@media (max-width: 760px) {
  h1 { font-size: 22px; }
  .login-page { display: flex; flex-direction: column; }
  .login-panel { order: -1; padding: 24px 16px 8px; }
  .login-hero { padding: 8px 16px 28px; }
  .tour-head strong { font-size: 18px; }
  .tour-steps { gap: 6px; }
  .tour-steps button { min-height: 34px; padding: 0; font-size: 0; }
  .tour-steps button i { width: 28px; height: 28px; font-size: 12px; }
  .tour-stage { height: 240px; }
  .scene { padding: 16px; }
  .key-code { font-size: 16px; overflow-wrap: anywhere; }
  .order-card strong { font-size: 22px; }
  .shell { display: block; }
  .side {
    position: static;
    width: auto;
    flex: none;
    height: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }
  .side-brand { display: none; }
  .brand { margin: 0; }
  .side nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--side);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(28, 25, 21, .08);
  }
  .theme-admin .side nav { border-top-color: rgba(255, 255, 255, .08); }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a {
    position: relative;
    flex: 1 0 68px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 4px 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
  }
  .side nav .nav-ico {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    background: transparent;
  }
  .side nav a.active .nav-ico { background: transparent; }
  .side em { position: absolute; top: 2px; right: calc(50% - 18px); margin: 0; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-areas:
      "brand brand brand tools tools"
      "guide redeem mail password logout";
    align-items: center;
    height: auto;
    gap: 8px 10px;
    padding: 8px 12px 10px;
    background: var(--side);
    border-bottom: 1px solid var(--line);
  }
  .topbar-brand { display: flex; grid-area: brand; min-width: 0; }
  .role-chip, .topbar-email, .topbar-title { display: none; }
  .theme-user .topbar-user { display: contents; }
  .theme-user .notice-bell,
  .theme-user .avatar { grid-area: tools; justify-self: end; align-self: center; }
  .theme-user .notice-bell { margin-right: 44px; }
  .theme-user #open-guide { grid-area: guide; }
  .theme-user #open-redeem { grid-area: redeem; }
  .theme-user #open-settings { grid-area: mail; }
  .theme-user #open-password { grid-area: password; }
  .theme-user .topbar-user > a.topbar-link { grid-area: logout; }
  .theme-user .topbar-link {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px;
    border-radius: 14px;
    font-size: 11px;
    line-height: 1.1;
  }
  .theme-user .topbar-link .full { display: none; }
  .theme-user .topbar-link .short { display: inline; }
  .theme-user .topbar-link.needs-bind { position: relative; }
  .theme-user .topbar-link.needs-bind::after { position: absolute; top: 6px; right: 8px; }
  .theme-admin .topbar { display: flex; flex-wrap: wrap; }
  .theme-admin .topbar-user { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
  .theme-admin .topbar-link { min-height: 36px; }
  .bind-banner { margin-bottom: 12px; line-height: 1.6; }
  .page-head, .split { display: block; }
  .page-title-row { display: block; }
  .run-stats { margin-top: 8px; }
  .run-stats p { white-space: normal; }
  .head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }
  .head-actions form { display: flex; }
  .head-actions form button, .head-actions > button { width: 100%; justify-content: center; }
  .head-actions form:last-child { grid-column: 1 / -1; }
  .stats { display: grid; grid-template-columns: 1fr 1fr; }
  .stats article { min-width: 0; }
  .stats strong { font-size: 22px; }
  .main { padding: 16px 14px calc(84px + env(safe-area-inset-bottom)); }
  .card-grid, .shop-grid, .goods-grid { grid-template-columns: 1fr; }
  .vip-price { font-size: 40px; }
  .bank-name { font-size: 20px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { min-width: 680px; }
  .domain-row { flex-wrap: wrap; }
  .domain-row input[name="url"] { flex: 1 1 100%; }
  .pager { flex-wrap: wrap; }
  .guide-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .guide-nav::-webkit-scrollbar { display: none; }
  .guide-nav button { flex: 0 0 auto; }
  .mail-split { grid-template-columns: 1fr; }
  .card-dialog, .app-dialog, .app-dialog-wide {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }
  .dialog-body { max-height: calc(100dvh - 140px); }
  .shell .install-app {
    left: 50%;
    right: auto;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
  }
  .support-fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  input, select, textarea { font-size: 16px; }
}
