/* HuQin 狐沁 · 草莓手帐控制台。仅重做视觉与布局，保留业务 DOM 契约。 */
:root {
  /* primitive palette */
  --hq-cream: oklch(0.972 0.012 82);
  --hq-paper: oklch(0.987 0.009 82);
  --hq-coral: oklch(0.638 0.206 31);
  --hq-blush: oklch(0.91 0.045 15);
  --hq-ink: oklch(0.36 0.038 18);
  --hq-cocoa: oklch(0.47 0.045 20);
  --hq-line: oklch(0.84 0.035 20);
  --hq-sage: oklch(0.63 0.065 145);
  --hq-honey: oklch(0.79 0.11 78);
  /* semantic */
  --bg: var(--hq-cream);
  --card: color-mix(in oklch, var(--hq-paper) 76%, transparent);
  --card-strong: color-mix(in oklch, var(--hq-paper) 94%, transparent);
  --border: var(--hq-line);
  --text: var(--hq-ink);
  --dim: var(--hq-cocoa);
  --accent: var(--hq-coral);
  --accent2: var(--hq-blush);
  --danger: oklch(0.48 0.15 15);
  --ok: oklch(0.47 0.09 145);
  --warn: oklch(0.48 0.1 65);
  --shadow: 0 16px 44px color-mix(in oklch, var(--hq-ink) 10%, transparent);
  --glow: 0 7px 18px color-mix(in oklch, var(--hq-coral) 18%, transparent);
  --radius: 22px;
  --bar: var(--hq-coral);
  --veil: color-mix(in oklch, var(--hq-cream) 38%, transparent);
  --hero-op: .9;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --display: Georgia, "Songti SC", "STSong", "SimSun", serif;
}

html { scroll-behavior: smooth; }
html, body { touch-action: manipulation; }
body {
  min-height: 100dvh;
  background-color: var(--hq-cream);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}
body::before {
  inset: 0;
  z-index: 1;
  background: rgb(247 242 237 / var(--hq-bg-veil, .2));
  animation: none;
}
body::after {
  inset: -5%;
  z-index: 0;
  background: url("custom/huqin-background.png") center / cover no-repeat;
  filter: brightness(var(--hq-bg-brightness, .72));
  animation: hq-background-drift var(--hq-bg-duration, 43.64s) ease-in-out infinite alternate;
}
html[data-fx="off"] body::after { animation: none; }
@keyframes hq-background-drift {
  from { transform: translate3d(0, 0, 0) scale(1.03); }
  to { transform: translate3d(-1.2%, -.8%, 0) scale(1.08); }
}
.auth-hero { z-index: 0; }
#view-auth, #view-console { position: relative; z-index: 2; }
::selection { background: var(--hq-blush); color: var(--hq-ink); }
:focus-visible { outline: 3px solid var(--hq-coral); outline-offset: 3px; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }

.glass {
  background: var(--card);
  border-color: color-mix(in oklch, var(--hq-line) 76%, transparent);
  backdrop-filter: blur(12px) saturate(1.04);
  -webkit-backdrop-filter: blur(12px) saturate(1.04);
  box-shadow: var(--shadow);
}
.btn {
  min-height: 44px;
  border: 1px solid var(--hq-line);
  border-radius: 999px;
  background: color-mix(in oklch, var(--hq-paper) 84%, transparent);
  color: var(--hq-ink);
  font-weight: 650;
  transition: color 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}
.btn:hover:not(:disabled) { border-color: var(--hq-coral); box-shadow: none; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn.primary, .mode-tab.active, .seg-btn.active, .mode-chip.active {
  border: 1px solid var(--hq-coral);
  background: var(--hq-coral);
  color: oklch(0.25 0.035 20);
  box-shadow: none;
  font-weight: 800;
}
.btn.primary:hover:not(:disabled) { background: oklch(0.68 0.19 31); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 42%, transparent); }
.inp {
  min-height: 48px;
  border-color: var(--hq-line);
  border-radius: 12px;
  background: color-mix(in oklch, var(--hq-paper) 90%, transparent);
  color: var(--hq-ink);
  font-size: 16px;
}
.inp:focus { border-color: var(--hq-coral); box-shadow: 0 0 0 3px color-mix(in oklch, var(--hq-coral) 18%, transparent); }
.fld-label { color: var(--hq-cocoa); font-weight: 700; }
.brand b, .auth-brand h1 { background: none; color: var(--hq-ink); -webkit-text-fill-color: currentColor; }

/* 登录：编辑式大标题在左，账号表单像一页薄手帐在右。 */
.auth-wrap {
  width: min(1280px, 100%);
  min-height: 100dvh;
  grid-template-columns: minmax(0, .92fr) minmax(400px, .78fr);
  gap: clamp(48px, 8vw, 120px);
  padding: max(48px, env(safe-area-inset-top)) 40px max(48px, env(safe-area-inset-bottom));
}
.auth-brand { position: relative; grid-column: 1; grid-row: 1; text-align: left; padding: 0; }
.auth-brand .brand-line { justify-content: flex-start; align-items: flex-start; }
.brand-logo-lg { width: 76px; height: 76px; border-radius: 50%; box-shadow: none; object-fit: contain; }
.auth-kicker { color: var(--hq-coral); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-brand h1 {
  margin-top: 8px;
  font-family: var(--display);
  font-size: clamp(72px, 9vw, 126px);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.07em;
  animation: none;
}
.auth-brand .slogan { margin: 28px 0 0 5vw; max-width: 370px; color: var(--hq-cocoa); font-size: 16px; line-height: 1.85; }
.auth-mascot { width: min(300px, 66%); margin: 8px 0 0 13vw; animation: hq-drift 7s ease-in-out infinite alternate; filter: drop-shadow(0 16px 20px rgba(93,52,47,.08)); }
.auth-orbits { justify-content: flex-start; max-width: 410px; margin: 24px 0 0 5vw; gap: 8px; }
.orbit-chip { border: 0; border-bottom: 1px solid var(--hq-line); border-radius: 0; color: var(--hq-cocoa); animation: none; }
.auth-card {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  padding: 34px 36px 30px;
  border-radius: 8px 32px 8px 32px;
  background: color-mix(in oklch, var(--hq-paper) 74%, transparent);
  box-shadow: 14px 18px 0 color-mix(in oklch, var(--hq-blush) 45%, transparent);
}
.auth-top { margin-bottom: 24px; }
.auth-welcome { font-family: var(--display); font-size: 25px; font-weight: 600; }
.auth-subtitle { display: block; margin-top: 3px; }
.auth-cloud { display: none; }
.auth-tabs { gap: 4px 14px; margin-bottom: 24px; border-bottom-color: var(--hq-line); }
.auth-tab { min-height: 44px; padding: 8px 2px; border-bottom-width: 2px; color: var(--hq-cocoa); transition: color 160ms ease-out, border-color 160ms ease-out; }
.auth-tab.active { color: var(--hq-coral); border-bottom-color: var(--hq-coral); }
.ts-demo { border: 1px dashed var(--hq-coral); border-radius: 12px; background: color-mix(in oklch, var(--hq-blush) 40%, transparent); color: var(--hq-ink); }

/* 控制台：横向工作条 + 主账号长页 + 右侧数据批注。 */
#view-console:not(.hidden-view) { display: block; }
.topbar {
  position: sticky;
  inset: 0 0 auto;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 12px max(24px, calc((100vw - 1480px) / 2));
  border: 0;
  border-bottom: 1px solid var(--hq-line);
  border-radius: 0;
  background: color-mix(in oklch, var(--hq-cream) 84%, transparent);
  box-shadow: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.topbar-row { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; width: auto; }
.topbar-row:first-child { flex: initial; }
.topbar-row2 { position: static; display: flex; flex-direction: row; justify-content: flex-end; gap: 8px; margin: 0; }
.topbar .brand { justify-content: flex-start; margin: 0 16px 0 0; text-align: left; }
.topbar .brand > span { display: inline-flex; flex-direction: row; align-items: baseline; gap: 6px; }
.topbar .brand > span::after { content: 'HuQin'; margin-left: 5px; color: var(--hq-coral); font-family: var(--display); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.brand-logo { width: 42px; height: 42px; margin: 0; border-radius: 50%; object-fit: contain; }
.topbar .user-email { max-width: 210px; padding: 5px 12px; border-color: var(--hq-line); background: transparent; }
.topbar .token-chip { display: inline-flex; flex-direction: row; gap: 5px; padding: 6px 13px; border: 1px solid var(--hq-line); border-radius: 999px; background: transparent; text-align: left; }
.topbar .token-chip b { display: inline; color: var(--hq-coral); font-size: 18px; }
.topbar-row .spacer { display: none; }
.topbar #conn-state { font-size: 12px; }
.topbar-row #btn-refresh-balance { width: auto; margin: 0; }
.topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: auto; }
.topbar::after { display: none; }
.topbar .more-menu { top: calc(100% + 8px); bottom: auto; }

.console-wrap {
  width: min(1480px, 100%);
  max-width: none;
  margin: 0 auto;
  padding: 30px 30px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  grid-template-areas: 'notice notice' 'desk desk' 'accounts stats' 'accounts spark' 'accounts add';
  gap: 20px 24px;
  align-items: start;
}
#notice-stack { grid-area: notice; display: grid; gap: 12px; min-width: 0; }
#notice-stack:not(:has(> :not(.hidden))) { display: none; }
.console-hero {
  grid-area: desk;
  min-height: 176px;
  padding: 10px 210px 26px 4vw;
  border: 0;
  border-bottom: 1px solid var(--hq-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.console-hero h2 { margin: 0; font-family: var(--display); font-size: clamp(32px, 4.2vw, 58px); font-weight: 500; line-height: 1.16; letter-spacing: -.045em; }
.console-hero h2 span { color: var(--hq-coral); }
.console-hero p { max-width: 560px; margin: 14px 0 0 7vw; color: var(--hq-cocoa); font-size: 15px; }
.console-hero img { width: 176px; right: 24px; bottom: -4px; animation: hq-drift 8s ease-in-out infinite alternate; }
.hero-note { margin: 14px 0 0 7vw; padding: 0; background: transparent; color: var(--hq-cocoa); font-size: 12px; letter-spacing: .08em; }
#announcement, #space-notice, #automatch, #kick-notes { grid-column: 1 / -1; }
.stat-grid { grid-area: stats; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { min-width: 0; min-height: 116px; padding: 18px; border-radius: 6px 22px 6px 22px; background: color-mix(in oklch, var(--hq-paper) 68%, transparent); }
.stat-card:nth-child(2) { background: color-mix(in oklch, var(--hq-blush) 46%, transparent); }
.stat-card:nth-child(3) { background: color-mix(in oklch, var(--hq-paper) 76%, transparent); }
.stat-card:nth-child(4) { background: color-mix(in oklch, var(--hq-honey) 18%, transparent); }
.stat-card .stat-k { font-size: 12px; }
.stat-card .stat-v { color: var(--hq-ink); font-family: var(--display); font-size: 29px; font-weight: 600; }
.stat-io { font-size: 12px; }
.tok-spark { grid-area: spark; margin: 0; border-radius: 18px; }
.card { padding: 24px; border-radius: 22px; }
.acc-sec { grid-area: accounts; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.acc-head { display: grid; grid-template-columns: 1fr; gap: 16px; }
.acc-title { font-family: var(--display); font-size: 28px; font-weight: 600; }
.mode-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; padding: 0; border: 0; border-bottom: 1px solid var(--hq-line); border-radius: 0; background: transparent; }
.mode-tab { justify-content: center; min-width: 0; min-height: 70px; padding: 8px 4px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--hq-cocoa); transition: color 160ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out; }
.mode-tab:hover { color: var(--hq-coral); background: color-mix(in oklch, var(--hq-blush) 28%, transparent); transform: none; }
.mode-tab.active { border: 0; border-bottom: 3px solid var(--hq-coral); background: transparent; color: var(--hq-coral); box-shadow: none; }
.mode-icon { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(125, 75, 66, .12)); transition: transform 180ms ease-out; }
.mode-tab:hover .mode-icon, .mode-tab.active .mode-icon { transform: translateY(-2px) rotate(-4deg); }
.mode-menu-icon { width: 34px; height: 34px; object-fit: contain; }
.ops-row { display: flex; gap: 8px; margin-top: 18px; }
.ops-row .btn { min-width: 0; flex: 0 1 auto; padding-inline: 14px; }
.ops-row .spacer { display: block; }
#fish-ops { display: inline-flex; }
#mode-ops { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.acc-table-wrap { margin-top: 16px; overflow-x: auto; border-top: 1px solid var(--hq-line); }
.acc-table { min-width: 780px; font-size: 13px; }
.acc-table th { padding: 12px 10px; background: transparent; color: var(--hq-cocoa); }
.acc-table td { padding: 13px 10px; }
.acc-row:hover, .acc-row.open { background: color-mix(in oklch, var(--hq-paper) 58%, transparent); }
#add-sec {
  grid-area: add;
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .82);
  background: linear-gradient(145deg, rgba(255, 253, 250, .9), rgba(255, 239, 234, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 45px rgba(112, 72, 61, .1);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}
#add-sec::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 44%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .42), transparent);
}
#add-sec > * { position: relative; }
#add-sec .add-sec-mascot { width: 58px; height: 58px; margin: -14px -4px -14px auto; object-fit: contain; transform: rotate(5deg); }
#add-sec .add-form { grid-template-columns: 1fr; gap: 10px; }
.empty-art { width: 140px; }
.back-top { bottom: calc(20px + env(safe-area-inset-bottom)); }
.user-email, .token-chip { backdrop-filter: none; }

/* 动态表单、弹窗和小票共用狐沁纸面，而非另一套视觉。 */
.modal {
  background: color-mix(in oklch, var(--hq-paper) 96%, transparent);
  border: 1px solid var(--hq-line);
  border-radius: 8px 26px 8px 26px;
  box-shadow: 0 24px 70px color-mix(in oklch, var(--hq-ink) 22%, transparent);
  color: var(--hq-ink);
}
.modal-mask { background: color-mix(in oklch, var(--hq-ink) 38%, transparent); }
.modal-body { color: var(--hq-ink); }
.modal-title { font-family: var(--display); font-size: 21px; }
.modal-x { min-width: 44px; min-height: 44px; }
.room-lead { margin-bottom: 12px; line-height: 1.65; }
.wan-hint { display: inline-flex; width: fit-content; margin-top: 5px; padding: 3px 8px; border-radius: 8px; background: var(--hq-blush); color: var(--hq-ink); font-size: 13px; font-weight: 750; }
.amount-link { min-height: 44px; padding: 4px 2px; border: 0; background: transparent; color: var(--hq-coral); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.op-group { margin: 0; padding: 14px 0; }
.op-group:first-child { padding-top: 0; }
.op-group + .op-group { border-top: 1px solid var(--hq-line); }
.op-group-name { color: var(--hq-cocoa); font-weight: 700; }
.op-grid-two, .row-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-action-grid { display: grid; gap: 8px; }
.row-action-grid .btn { min-width: 0; min-height: 44px; padding: 9px 8px; white-space: normal; }
.op-group-note, .row-menu-note { color: var(--hq-cocoa); font-size: 12px; line-height: 1.6; }
.row-menu-note { padding: 10px 12px; border-top: 1px solid var(--hq-line); }
.optional-sec { padding: 0; }
.optional-sec summary { min-height: 44px; display: flex; align-items: center; color: var(--hq-ink); font-weight: 700; cursor: pointer; }
.optional-sec[open] summary { margin-bottom: 12px; }
.mojin-item-target { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hq-line); }
.mojin-item-fields { margin-top: 10px; transition: opacity 160ms ease-out; }
.mojin-item-fields.is-disabled { opacity: .52; }
.map-pick { position: relative; min-height: 48px; border-radius: 14px; background: var(--card-strong); }
.map-closed { display: block; margin-top: 3px; color: var(--hq-cocoa); font-size: 12px; font-weight: 500; }
.target-seg { margin-bottom: 12px; }
.target-seg .seg-btn.hidden { display: none; }
.modal .btn, .modal .seg-btn, .modal .step-btn, .modal .ws-tg { min-height: 44px; }
.op-btn:disabled, .map-pick:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }
.seg, .theme-menu, .row-menu { border-color: var(--hq-line); background: var(--card-strong); }
.map-pick:hover { border-color: var(--hq-coral); box-shadow: none; }
.mini-progress-fill, .bar { background: var(--hq-coral); }
.badge-blue { color: var(--hq-coral); border-color: var(--hq-coral); }
.chip.tag { background: var(--hq-coral); color: oklch(0.25 0.035 20); }

.receipt-entry {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: auto; min-width: 58px; max-width: 100%; min-height: 36px; padding: 5px 11px;
  border: 1px solid var(--hq-coral); border-radius: 999px;
  background: var(--hq-coral); color: oklch(0.25 0.035 20); font: inherit; font-size: 12px; font-weight: 800;
  line-height: 1; white-space: nowrap; cursor: pointer;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}
.receipt-entry:hover { background: oklch(0.68 0.19 31); }
.receipt-entry:active { transform: scale(.96); }
.receipt-amount { font-variant-numeric: tabular-nums; }
.receipt-arrow { color: currentColor; font-size: 16px; }
.modal-wrap.receipt-popover { display: block; padding: 0; }
.receipt-popover .modal-mask { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.receipt-popover .modal { position: absolute; width: min(430px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); border-radius: 18px; background: var(--hq-paper); transform: translateY(6px) scale(.98); transform-origin: top center; }
.receipt-popover.open .modal { transform: none; }
.receipt-popover .modal-head { padding: 14px 16px 10px; }
.receipt-popover .modal-title { font-size: 18px; }
.receipt-popover .modal-body { padding: 4px 16px 16px; }
.receipt-popover .mini-table { font-size: 12px; }
.receipt-popover .mini-table th, .receipt-popover .mini-table td { padding: 6px; }
.receipt-choice-list { display: grid; gap: 8px; }
.receipt-choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 1px solid var(--hq-line); border-radius: 12px; background: var(--card); color: var(--hq-ink); text-align: left; cursor: pointer; }
.receipt-choice:hover { background: var(--hq-blush); }
.receipt-choice span { min-width: 0; display: grid; gap: 3px; }
.receipt-choice b, .receipt-choice small { overflow-wrap: anywhere; }
.receipt-choice small { color: var(--hq-cocoa); }
.receipt-choice strong { flex-shrink: 0; color: var(--hq-coral); }
.rate-chip { border-color: var(--hq-sage); background: color-mix(in oklch, var(--hq-sage) 15%, transparent); }
.receipt-filter-note { margin-top: 10px; color: var(--hq-cocoa); font-size: 12px; line-height: 1.6; }
.receipt-empty { padding: 18px 0; text-align: center; }

.stats-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 8px; margin-bottom: 8px; }
.stats-filter .inp { width: 100%; min-width: 0; max-width: none; }
.stats-retention { margin-bottom: 12px; color: var(--hq-cocoa); font-size: 12px; line-height: 1.6; }
.stats-record-list { display: grid; gap: 8px; }
.stats-record { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--hq-line); border-radius: 12px; background: var(--card); }
.stats-record-main { flex: 1; min-width: 0; }
.stats-record-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stats-record-head span { color: var(--hq-cocoa); font-size: 12px; }
.stats-record-line, .stats-record-bigs { margin-top: 5px; font-size: 13px; overflow-wrap: anywhere; }
.stats-record-bigs { color: var(--hq-coral); }
.stats-record-delete { flex-shrink: 0; }
.stats-record-empty { padding: 16px 0; text-align: center; }
.stats-preview { max-width: 100%; margin-top: 12px; }
.stats-preview img { max-width: 100%; height: auto; }

.bg-settings { display: grid; gap: 18px; }
.bg-settings-note { margin: 0; line-height: 1.6; }
.bg-setting { display: grid; gap: 6px; }
.bg-setting-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; font-weight: 600; }
.bg-setting-head output { color: var(--hq-cocoa); font-size: 13px; font-variant-numeric: tabular-nums; }
.bg-range { width: 100%; height: 44px; margin: 0; accent-color: var(--hq-coral); cursor: pointer; }
.bg-settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

@keyframes hq-drift {
  from { transform: translate3d(0, 0, 0) rotate(-1deg); }
  to { transform: translate3d(0, -9px, 0) rotate(1deg); }
}
@keyframes hq-fox-breathe {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1) rotate(-1deg); }
  50% { transform: translate3d(0, -5px, 0) scale(1.025) rotate(1deg); }
}
.auth-mascot, .console-hero img, .mode-icon, .mode-menu-icon,
#add-sec .add-sec-mascot, .empty-art {
  transform-origin: 50% 82%;
  animation: hq-fox-breathe 4.8s ease-in-out infinite;
}
.mode-tab:nth-child(2n) .mode-icon { animation-delay: -1.4s; }
.mode-tab:nth-child(3n) .mode-icon { animation-delay: -2.8s; }
#add-sec .add-sec-mascot { animation-duration: 5.6s; animation-delay: -.9s; }
html[data-fx="off"] .auth-mascot, html[data-fx="off"] .console-hero img,
html[data-fx="off"] .mode-icon, html[data-fx="off"] .mode-menu-icon,
html[data-fx="off"] #add-sec .add-sec-mascot { animation: none; }

@media (max-width: 1100px) {
  .topbar { padding-inline: 20px; }
  .console-wrap { padding: 22px 20px 52px; grid-template-columns: minmax(0, 1fr) 270px; }
  .console-hero { padding-left: 2vw; }
  .console-hero p, .hero-note { margin-left: 3vw; }
  .mode-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-row .btn { width: 100%; padding-inline: 8px; }
  .ops-row .spacer { display: none; }
  #fish-ops, #mode-ops { display: contents; }
}

@media (max-width: 900px) {
  body { background-attachment: scroll; }
  .auth-wrap { grid-template-columns: 1fr; gap: 22px; padding: 30px 22px 42px; }
  .auth-brand { grid-column: 1; grid-row: 1; min-height: 265px; }
  .auth-brand h1 { font-size: 72px; }
  .auth-brand .slogan { margin: 16px 180px 0 0; }
  .auth-mascot { position: absolute; right: 0; bottom: 0; width: 180px; margin: 0; }
  .auth-orbits { margin: 18px 170px 0 0; }
  .auth-card { grid-column: 1; grid-row: 2; padding: 28px; }
  .topbar { position: sticky; grid-template-columns: 1fr; padding: 10px 14px; }
  .topbar-row2 { justify-content: flex-start; }
  .topbar .user-email { max-width: 180px; }
  .topbar #conn-state, .topbar #token-est { display: none; }
  .console-wrap { padding: 18px 14px 48px; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'notice' 'desk' 'stats' 'accounts' 'spark' 'add'; gap: 14px; }
  .console-hero { min-height: 152px; padding: 8px 170px 20px 10px; }
  .console-hero h2 { font-size: 34px; }
  .console-hero p, .hero-note { margin-left: 0; }
  .console-hero img { width: 150px; right: 8px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-card { min-height: 98px; padding: 13px; }
  .stat-card .stat-v { font-size: 24px; }
  .card { padding: 18px; }
  .acc-head { display: flex; }
  .mode-tabs { display: none; }
  .mode-select { display: inline-flex; }
  .acc-table { min-width: 680px; }
  .stats-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-filter .btn { width: 100%; min-width: 0; padding-inline: 8px; }
  .modal-wrap { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .modal { max-height: calc(100dvh - 24px); }
  .glass, .auth-card, .topbar, .stat-card, .tok-spark, #add-sec { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

@media (max-width: 600px) {
  .auth-wrap { padding: 22px 14px 34px; }
  .auth-brand { min-height: 242px; }
  .auth-brand .brand-line { gap: 10px; }
  .brand-logo-lg { width: 56px; height: 56px; }
  .auth-brand h1 { font-size: 58px; }
  .auth-brand .slogan { margin-right: 126px; font-size: 14px; }
  .auth-mascot { width: 134px; }
  .auth-orbits { display: none; }
  .auth-card { padding: 22px 18px; border-radius: 6px 24px 6px 24px; box-shadow: 8px 10px 0 color-mix(in oklch, var(--hq-blush) 45%, transparent); }
  .auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
  .auth-tab { width: 100%; padding-inline: 0; }
  .topbar .brand { margin-right: 0; }
  .topbar .brand > span::after { display: none; }
  .topbar .user-email { order: 3; max-width: 100%; }
  .topbar .token-chip { flex: 1 1 150px; }
  .topbar-row2 { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: 100%; }
  .console-wrap { padding-inline: 12px; }
  .console-hero { min-height: 152px; padding-right: 118px; }
  .console-hero h2 { font-size: 28px; }
  .console-hero p { font-size: 13px; }
  .console-hero img { width: 116px; right: -2px; }
  .hero-note { font-size: 11px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .ops-row .btn { min-height: 44px; font-size: 12px; }
  .card { padding: 14px; }

  /* 手机账号变为信息卡，保留表格行与全部 JS 钩子。 */
  .acc-table-wrap { overflow: visible; border-top: 0; }
  .acc-table, .acc-table tbody { display: block; width: 100%; min-width: 0; }
  .acc-table thead { display: none; }
  .acc-table .acc-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; grid-template-areas: 'check name name menu' '. state amount map' '. ready ready ready'; gap: 10px 8px; align-items: center; margin-bottom: 10px; padding: 14px 10px; border: 1px solid var(--hq-line); border-radius: 16px; background: var(--card); }
  .acc-table .acc-row td { display: block; width: auto; padding: 0; border: 0; overflow: visible; text-overflow: clip; white-space: normal; }
  .acc-table .col-check { grid-area: check; min-height: 44px; align-items: center; display: flex !important; }
  .acc-table td.acc-name { grid-area: name; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
  .acc-table .col-state { grid-area: state; }
  .acc-table .col-amount { grid-area: amount; text-align: right; font-size: 13px; }
  .acc-table .col-map { grid-area: map; text-align: right; font-size: 13px; }
  .acc-table .col-ready { grid-area: ready; color: var(--hq-cocoa); font-size: 12px; }
  .acc-table .col-menu { grid-area: menu; }
  .acc-table .acc-row > .col-game, .acc-table .acc-row > .col-note { display: none; }
  .acc-table .col-amount::before, .acc-table .col-map::before { display: block; margin-bottom: 3px; color: var(--hq-cocoa); font-size: 11px; }
  .acc-table .col-amount::before { content: '金额'; }
  .acc-table .col-map::before { content: '地图·房间'; }
  .acc-table .col-ready::before { content: '准备 · '; }
  .acc-table .acc-sub, .acc-table .acc-sub.open { display: none; }
  .receipt-popover .modal { max-height: min(68dvh, calc(100dvh - 24px)); }
  .stats-record { align-items: stretch; flex-direction: column; gap: 8px; }
  .stats-record-delete { align-self: flex-end; }
}

@media (max-width: 600px), (pointer: coarse) {
  /* 可见胶囊收窄至 32px，按钮本身仍保留 44px 触摸高度。 */
  .receipt-entry {
    position: relative;
    isolation: isolate;
    min-width: 52px;
    min-height: 44px;
    padding: 0 8px;
    gap: 3px;
    border-color: transparent;
    background: transparent;
  }
  .receipt-entry::before {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    height: 32px;
    box-sizing: border-box;
    transform: translateY(-50%);
    z-index: -1;
    border: 1px solid var(--hq-coral);
    border-radius: 999px;
    background: var(--hq-coral);
  }
  .receipt-entry:hover { background: transparent; }
  .receipt-entry:hover::before { background: oklch(0.68 0.19 31); }
  .receipt-arrow { font-size: 14px; }
}

@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .btn, .auth-tab, .mode-tab, .stats-record-delete { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::after, .auth-mascot, .console-hero img, .mode-icon, .mode-menu-icon,
  #add-sec .add-sec-mascot { animation: none; }
  .mojin-item-fields, .receipt-entry, .btn, .auth-tab, .mode-tab { transition: none; }
}
