/* Neptune Cloud Desk — 独立布局层，仅负责视觉与排列，不改变业务钩子。 */
:root {
  --bg: #eef8fb;
  --card: rgba(255, 255, 253, .9);
  --card-strong: #ffffff;
  --border: #c9e0e9;
  --text: #294c5e;
  --dim: #587280;
  --accent: #71b9da;
  --accent2: #a6dcee;
  --shadow: 0 14px 40px rgba(57, 112, 135, .11);
  --glow: 0 8px 20px rgba(78, 153, 187, .16);
  --radius: 24px;
  --veil: linear-gradient(115deg, rgba(238,248,251,.8), rgba(238,248,251,.44) 52%, rgba(238,248,251,.8));
  --hero-op: .72;
}

body {
  background:
    radial-gradient(circle at 78% 10%, rgba(255,255,255,.9), transparent 24%),
    radial-gradient(circle at 8% 92%, rgba(255,219,228,.24), transparent 28%),
    #eef8fb;
}

/* 视频必须位于不透明页面底色之上、内容之下，登录后继续保持播放。 */
.auth-hero { z-index: 0; }
body::before {
  inset: 0;
  z-index: 1;
  background: var(--veil);
  animation: none;
}
body::after {
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 8% 92%, rgba(255,219,228,.18), transparent 30%);
  animation: none;
}
#view-auth, #view-console { position: relative; z-index: 2; }
#view-auth::before { display: none; }
.glass { background: var(--card); border-color: rgba(184, 213, 225, .74); }
.btn.primary, .mode-tab.active, .seg-btn.active, .mode-chip.active {
  color: #173f56;
  background: #a8dfef;
  border: 1px solid #83c6df;
  box-shadow: 0 5px 0 #d2edf5;
}
.btn.primary:hover:not(:disabled) { background: #b9e7f4; }

/* 登录区示例布局：接手项目应独立重设计，不沿用既有品牌视觉。 */
.auth-wrap {
  max-width: 1220px;
  grid-template-columns: minmax(450px, 520px) minmax(0, 1fr);
  gap: clamp(48px, 7vw, 100px);
  padding: 48px 32px;
}
.auth-card {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-self: center;
  padding: 0;
  overflow: hidden;
  border-radius: 30px;
  box-shadow: 0 24px 60px rgba(64, 119, 141, .15);
}
.auth-top {
  grid-column: 1 / -1;
  padding: 24px 26px 0;
  margin: 0;
}
.auth-tabs {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-self: stretch;
  gap: 8px;
  margin: 22px 0 0;
  padding: 18px 12px;
  border: 0;
  border-radius: 0;
  background: #eaf5f9;
}
.auth-tab {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}
.auth-tab.active { color: #28566e; box-shadow: 0 5px 14px rgba(67, 123, 145, .1); }
.auth-pane { grid-column: 2; grid-row: 2; min-width: 0; padding: 22px 24px 26px 4px; }
.auth-brand {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  padding: 0;
}
.auth-brand .brand-line { justify-content: center; }
.auth-brand h1 { font-size: clamp(64px, 7vw, 96px); }
.auth-brand .slogan { margin: 18px auto 0; max-width: 400px; }
.auth-mascot { width: min(360px, 82%); margin-top: 22px; }
.auth-orbits { justify-content: center; max-width: none; }
.auth-cloud { background: #d8edf5; }
.auth-cloud::before, .auth-cloud::after { background: #d8edf5; }

/* 桌面控制台：固定侧栏 + 非对称工作区。 */
#view-console:not(.hidden-view) { display: block; }
.topbar {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 50;
  width: 224px;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  border: 1px solid #c6dee8;
  border-radius: 28px;
  background: rgba(255,255,253,.94);
  box-shadow: 0 18px 46px rgba(54, 110, 132, .12);
}
.topbar-row { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 12px; width: 100%; }
.topbar-row:first-child { flex: 1; }
.topbar .brand { justify-content: center; margin-bottom: 12px; text-align: center; }
.topbar .brand > span { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.35; }
.topbar .brand > span::after { content: 'CLOUD DESK'; margin-top: 4px; color: #7291a1; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.brand-logo { width: 58px; height: 58px; margin-bottom: 7px; }
.topbar .user-email { max-width: 100%; padding: 6px 8px; text-align: center; }
.topbar .token-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 10px;
  border-radius: 20px;
  background: #e7f5fa;
  text-align: center;
}
.topbar .token-chip b { display: block; color: #2e647e; font-size: 25px; line-height: 1.2; }
.topbar .token-chip .peak-badge { margin-top: 6px; }
.topbar-row .spacer { display: block; flex: 1; min-height: 12px; }
.topbar #token-est { text-align: center; line-height: 1.5; }
.topbar #conn-state { text-align: center; font-size: 11px; }
.topbar-row #btn-refresh-balance { width: 100%; margin: 0; }
.topbar-row2 { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: 100%; }
.topbar::after { content: 'NEPTUNE · 云朵工作台'; display: block; margin-top: 16px; color: #7893a0; font-size: 10px; letter-spacing: .08em; text-align: center; }

.console-wrap {
  max-width: none;
  margin: 0;
  padding: 26px 28px 48px 270px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-areas:
    'notice notice'
    'desk desk'
    'accounts stats'
    'accounts spark'
    'accounts add';
  gap: 18px;
  align-items: start;
}
.console-hero {
  grid-area: desk;
  min-height: 92px;
  padding: 4px 150px 12px 4px;
  border: 0;
  border-bottom: 1px solid #cfe3eb;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.console-hero h2 { font-size: 28px; }
.console-hero p { font-size: 13px; }
.console-hero img { width: 140px; right: 6px; bottom: -2px; }
.hero-note { margin-top: 8px; background: #e2f1f7; }
.stat-grid { grid-area: stats; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card { padding: 16px; border-radius: 20px; }
.stat-card .stat-v { font-size: 24px; }
.stat-card:nth-child(1) { background: #fff; }
.stat-card:nth-child(2) { background: #e5f4fa; }
.stat-card:nth-child(3) { background: #fff1f4; }
.stat-card:nth-child(4) { background: #fff8df; }
.tok-spark { grid-area: spark; margin: 0; }
.acc-sec { grid-area: accounts; min-width: 0; }
#add-sec { grid-area: add; margin: 0; }
#notice-stack { grid-area: notice; display: grid; gap: 12px; min-width: 0; }
#notice-stack:not(:has(> :not(.hidden))) { display: none; }
#automatch, #kick-notes { grid-column: 1 / -1; }
.card { padding: 22px; border-radius: 26px; }
.acc-head { display: grid; grid-template-columns: 1fr; gap: 16px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px; border-radius: 20px; }
.mode-tab { justify-content: flex-start; min-height: 48px; padding: 8px 12px; }
.mode-icon { width: 28px; height: 28px; }
.ops-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ops-row .btn { min-width: 0; padding-left: 10px; padding-right: 10px; }
.ops-row .spacer { display: none; }
#fish-ops, #mode-ops { display: contents; }
.acc-table-wrap { overflow-x: auto; }
.acc-table { min-width: 720px; font-size: 12px; }
#add-sec { background: #f9fdfd; border-style: solid; }
#add-sec .add-form { grid-template-columns: 1fr; gap: 10px; }
.empty-art { width: 150px; }
.back-top { bottom: 20px; }

/* 平板与手机：侧栏变为紧凑工作条，内容按使用顺序重排。 */
@media (max-width: 1100px) {
  .topbar {
    position: sticky;
    inset: 0 auto auto;
    width: calc(100% - 24px);
    margin: 12px auto 0;
    padding: 12px 14px;
    border-radius: 24px;
  }
  .topbar-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .topbar .brand { margin: 0; text-align: left; }
  .topbar .brand > span { align-items: flex-start; }
  .topbar .brand > span::after { display: none; }
  .brand-logo { width: 40px; height: 40px; margin: 0; }
  .topbar .user-email { max-width: 180px; }
  .topbar .token-chip { flex: 1 1 170px; flex-direction: row; justify-content: center; padding: 8px 12px; }
  .topbar .token-chip b { display: inline; font-size: inherit; }
  .topbar-row .spacer { display: none; }
  .topbar #conn-state { display: none; }
  .topbar-row #btn-refresh-balance { width: auto; }
  .topbar-row2 { display: flex; flex-direction: row; justify-content: flex-end; margin-top: 0; }
  .topbar-row2 .theme-anchor, .topbar-row2 .theme-anchor .btn, .topbar-row2 .btn { width: auto; }
  .topbar::after { display: none; }
  .console-wrap {
    padding: 18px 14px 44px;
    grid-template-columns: minmax(0, 1fr) 250px;
    grid-template-areas:
      'notice notice'
      'desk desk'
      'stats stats'
      'accounts accounts'
      'spark add';
  }
  .console-hero { min-height: 82px; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 20px; padding: 28px 18px 36px; }
  .auth-brand { grid-column: 1; grid-row: 1; text-align: left; }
  .auth-brand .brand-line { justify-content: flex-start; }
  .auth-brand .slogan { margin: 14px 0 0; }
  .auth-mascot { position: absolute; width: 150px; right: 0; bottom: 38px; margin: 0; }
  .auth-orbits { justify-content: flex-start; max-width: calc(100% - 130px); }
  .auth-card { grid-column: 1; grid-row: 2; display: block; padding: 22px; border-radius: 26px; }
  .auth-top { padding: 0; }
  .auth-tabs { display: flex; flex-direction: row; flex-wrap: wrap; margin: 20px 0; padding: 5px; border-radius: 16px; }
  .auth-tab { width: auto; min-height: 44px; text-align: center; }
  .auth-pane { padding: 0; }
  .console-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'notice' 'desk' 'stats' 'accounts' 'spark' 'add';
    gap: 12px;
    padding: 16px 10px 42px;
  }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-hero { padding-right: 124px; }
  .console-hero h2 { font-size: 22px; }
  .console-hero img { width: 124px; }
  .acc-head { display: flex; }
  .mode-tabs { display: none; }
  .mode-select { display: inline-flex; }
  .ops-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acc-table { min-width: 0; }
  .acc-table .col-game { display: none; }
  .acc-table .col-name { width: 88px; }
  .card { padding: 14px; border-radius: 22px; }
  .back-top { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

.ts-demo {
  padding: 12px 14px;
  border: 1px dashed #a9cbd9;
  border-radius: 14px;
  background: #edf7fa;
  color: #466777;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .auth-wrap { padding: 20px 12px 28px; }
  .auth-brand h1 { font-size: 48px; }
  .auth-mascot { width: 124px; bottom: 46px; }
  .auth-card { padding: 18px 16px; }
  .auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); }
  .auth-tab { width: 100%; padding: 8px 4px; }
  .topbar { width: calc(100% - 20px); margin-top: 10px; padding: 10px; }
  .topbar .brand > span { font-size: 13px; }
  .topbar .user-email { order: 3; max-width: 100%; }
  .topbar .token-chip { flex-basis: 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-hero { min-height: 108px; padding: 10px 104px 12px 4px; }
  .console-hero h2 { font-size: 19px; }
  .console-hero p { font-size: 12px; line-height: 1.55; }
  .console-hero img { width: 112px; right: -4px; }
  .hero-note, .stat-io { font-size: 12px; }
  .stat-card { padding: 13px; }
  .stat-card .stat-v { font-size: 22px; }
  .ops-row .btn { font-size: 12px; }
  .card { padding: 12px; }

  /* 手机账号改为信息卡，不再把桌面表格硬挤进窄屏。 */
  .acc-table-wrap { overflow: visible; }
  .acc-table, .acc-table tbody { display: block; width: 100%; }
  .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;
    padding: 14px 4px;
    border-bottom: 1px solid #dcebf0;
  }
  .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; }
  .acc-table .col-check { 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(--dim); 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(--dim);
    font-size: 12px;
  }
  .acc-table .col-amount::before { content: '金额'; }
  .acc-table .col-map::before { content: '地图·房间'; }
  .acc-table .col-ready::before { content: '准备 · '; }
  .acc-table .badge { font-size: 12px; padding: 4px 7px; }
  .acc-table .sess-check { width: 18px; height: 18px; }
  .acc-table .acc-sub, .acc-table .acc-sub.open { display: none; }
}

/* 轻透磨砂表面：减弱页面遮罩与大面积卡片，让云朵动态贯穿整个工作区。 */
:root {
  --card: rgba(255, 255, 253, .38);
  --veil: linear-gradient(115deg, rgba(238,248,251,.22), rgba(238,248,251,.06) 52%, rgba(238,248,251,.22));
  --hero-op: .92;
}
.auth-hero { filter: saturate(.82) brightness(.72); }
.glass {
  background: var(--card);
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
}
.auth-card, .topbar { background: rgba(255,255,253,.44); }
.auth-card, .topbar, .stat-card, .tok-spark, #add-sec {
  backdrop-filter: blur(12px) saturate(1.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.08);
}
.auth-tabs { background: rgba(234,245,249,.34); }
.topbar .token-chip { background: rgba(231,245,250,.4); }
.stat-card:nth-child(1) { background: rgba(255,255,255,.32); }
.stat-card:nth-child(2) { background: rgba(229,244,250,.34); }
.stat-card:nth-child(3) { background: rgba(255,241,244,.34); }
.stat-card:nth-child(4) { background: rgba(255,248,223,.36); }
.tok-spark, #add-sec { background: rgba(249,253,253,.34); }
.mode-tabs { background: rgba(237,246,249,.34); }
.acc-table th { background: rgba(239,247,250,.32); }

@media (max-width: 900px) {
  .glass, .auth-card, .topbar, .stat-card, .tok-spark, #add-sec {
    backdrop-filter: blur(7px) saturate(1.06);
    -webkit-backdrop-filter: blur(7px) saturate(1.06);
  }
}

/* 固定侧栏底部的菜单向上展开，紧凑顶栏则保持向下展开。 */
.topbar .more-menu { top: auto; bottom: calc(100% + 8px); }
@media (max-width: 1100px) {
  .topbar .more-menu { top: calc(100% + 8px); bottom: 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(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.bg-range { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.bg-range:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.bg-settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

@media (prefers-reduced-motion: reduce) {
  .auth-mascot { animation: none; }
}


/* 2026-11 操作台终版：高可读弹窗、清晰金额与更舒展的桌面工作区。 */
.modal {
  background: rgba(255, 255, 253, .94);
  border: 1px solid rgba(176, 205, 216, .92);
  box-shadow: 0 24px 70px rgba(38, 76, 94, .22);
}
.modal-body { color: #294c5e; }
.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: #e4f0f4;
  color: #234f63;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}
.amount-link {
  min-height: 44px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #24566c;
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: #8eb9c9;
  text-underline-offset: 4px;
  cursor: pointer;
}
.amount-link:hover { color: #123e53; text-decoration-color: currentColor; }
.amount-link:focus-visible, .map-pick:focus-visible, .optional-sec summary:focus-visible {
  outline: 3px solid #4b91ad;
  outline-offset: 3px;
}
.op-group { margin: 0; padding: 14px 0; }
.op-group:first-child { padding-top: 0; }
.op-group + .op-group { border-top: 1px solid #dce8ed; }
.op-group-name { color: #3f6373; font-weight: 700; }
.op-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.op-group-note { margin: 8px 0 0; color: #587280; font-size: 12px; line-height: 1.6; }
.op-btn:disabled, .map-pick:disabled { opacity: .52; cursor: not-allowed; box-shadow: none; }
.row-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.row-action-grid .btn { min-width: 0; min-height: 44px; padding: 9px 8px; white-space: normal; }
.row-menu-note { padding: 10px 12px; border-top: 1px solid #dce8ed; color: #587280; font-size: 12px; line-height: 1.5; }
.optional-sec { padding: 0; }
.optional-sec summary { min-height: 44px; display: flex; align-items: center; color: #31586c; 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 #cfdee4; }
.mojin-item-fields { margin-top: 10px; transition: opacity .18s ease-out; }
.mojin-item-fields.is-disabled { opacity: .52; }
.map-pick { position: relative; min-height: 48px; }
.map-closed { display: block; margin-top: 3px; color: #667b85; font-size: 11px; 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; }

@media (min-width: 1101px) {
  .console-wrap {
    grid-template-columns: minmax(0, 1fr) 292px;
    grid-template-areas:
      'notice notice'
      'desk desk'
      'stats stats'
      'accounts accounts'
      'spark add';
  }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-card { min-height: 112px; }
  .acc-head { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .acc-title { white-space: nowrap; }
  .mode-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .mode-tab { justify-content: center; padding-inline: 8px; }
  .ops-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .modal { background: rgba(255, 255, 253, .97); }
  .modal .grid2, .modal .grid3 { gap: 8px; }
  .row-action-grid { gap: 7px; }
  .op-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .amount-link { padding-inline: 4px; }
}

/* 小票入口就在金额列：金额替代参考图横线，配色跟随当前蓝色主题。 */
.receipt-entry {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: auto; min-width: 58px; max-width: 100%; min-height: 30px; padding: 4px 9px;
  border: 1px solid #739fb2; border-radius: 999px;
  background: #31586c; color: #f3fbff; font: inherit; font-size: 12px; font-weight: 800;
  line-height: 1; white-space: nowrap; cursor: pointer;
  box-shadow: 0 3px 9px rgba(49, 88, 108, .14);
  transition: transform .16s ease-out, background-color .16s ease-out;
}
.receipt-entry:hover { background: #244a5e; }
.receipt-entry:active { transform: scale(.96); }
.receipt-amount { font-variant-numeric: tabular-nums; }
.receipt-arrow { color: #bce8f7; font-size: 16px; }
.receipt-entry:focus-visible, .receipt-choice:focus-visible, .stats-record-delete:focus-visible {
  outline: 3px solid #4b91ad; outline-offset: 3px;
}

/* 小票为金额旁的小浮层，不再占满底部或居中弹窗。 */
.modal-wrap.receipt-popover { display: block; padding: 0; }
.receipt-popover .modal-mask {
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.receipt-popover .mini-table { font-size: 12px; }
.receipt-popover .mini-table th, .receipt-popover .mini-table td { padding: 6px; }
.receipt-popover .mini-table th:nth-child(1) { width: 28%; }
.receipt-popover .mini-table th:nth-child(2) { width: 24%; }
.receipt-popover .mini-table th:nth-child(3) { width: 22%; }
.receipt-popover .mini-table th:nth-child(4) { width: 26%; }
.receipt-popover .mini-table td:nth-child(2) { overflow-wrap: normal; word-break: keep-all; }
.receipt-popover .modal {
  position: absolute; width: min(430px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100dvh - 24px); border-radius: 20px;
  background: rgba(255, 255, 253, .98); box-shadow: 0 18px 50px rgba(36, 74, 94, .24);
  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: 16px; }
.receipt-popover .modal-body { padding: 4px 16px 16px; }
@media (max-width: 520px) {
  .receipt-entry { min-height: 30px; padding: 4px 8px; }
  .receipt-popover .modal { max-height: min(62dvh, calc(100dvh - 24px)); }
}
.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 #d5e4ea;
  border-radius: 14px; background: #f6fbfd; color: #31586c; text-align: left; cursor: pointer;
}
.receipt-choice:hover { background: #eaf6fa; }
.receipt-choice span { min-width: 0; display: grid; gap: 3px; }
.receipt-choice b, .receipt-choice small { overflow-wrap: anywhere; }
.receipt-choice small { color: #617b88; }
.receipt-choice strong { flex-shrink: 0; color: #9b681d; }
.rate-chip { border-color: #a9d3c2; background: #edf8f2; }
.receipt-filter-note { margin-top: 10px; color: #526e7c; 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: #526e7c; 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 #d8e6eb; border-radius: 14px; background: rgba(247, 252, 254, .94);
}
.stats-record-main { flex: 1; min-width: 0; }
.stats-record-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: #31586c; }
.stats-record-head span { color: #617b88; font-size: 12px; }
.stats-record-line { margin-top: 5px; color: #3f6373; font-size: 13px; overflow-wrap: anywhere; }
.stats-record-bigs { margin-top: 5px; color: #946116; font-size: 13px; overflow-wrap: anywhere; }
.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; }

@media (max-width: 900px) {
  .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); }
  .stats-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-filter .btn { width: 100%; min-width: 0; padding-inline: 8px; }
}

@media (max-width: 420px) {
  .stats-record { align-items: stretch; flex-direction: column; gap: 8px; }
  .stats-record-delete { align-self: flex-end; }
}

/* 小票与账号“更多”共用底部弹出层，不再居中挡住整张页面。 */
.modal-wrap.sheet-bottom { align-items: flex-end; padding: 0; }
.modal-wrap.sheet-bottom .modal {
  width: 100%; max-width: 760px; max-height: 85vh; max-height: calc(100dvh - 48px);
  border-radius: 26px 26px 0 0; transform: translateY(100%);
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-wrap.sheet-bottom.open .modal { transform: none; }
.modal-wrap.sheet-bottom .modal-head { padding-top: 18px; }
.modal-wrap.sheet-bottom .modal-body { padding-bottom: max(18px, env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .mojin-item-fields, .receipt-entry { transition: none; }
}

/* 实时详情：电脑常驻副行；手机把同一个 .sub-inner 移到地图下方。
 * 不复制 [data-reel]，因此 WebSocket 收线数据始终只有唯一更新目标。 */
.acc-sub.open { display: table-row; }
.sub-inner, .sess-chips, .sess-chips .chip { min-width: 0; max-width: 100%; }
.sess-chips { flex-wrap: wrap; }
.sess-chips .chip {
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}
.sess-chips .chip > i { flex: 0 0 auto; }

@media (max-width: 520px) {
  .acc-table .acc-row {
    grid-template-areas:
      'check name name menu'
      '. state state state'
      '. amount ready ready'
      '. map map map';
  }
  .acc-table .col-map { min-width: 0; text-align: left; }
  .acc-table .acc-sub, .acc-table .acc-sub.open { display: none; }
  .acc-table .acc-row > .col-map > .sub-inner {
    min-width: 0;
    max-width: 100%;
    margin-top: 12px;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    animation: none;
  }
  .acc-table .acc-row .sess-chips { min-width: 0; max-width: 100%; }
  .acc-table .acc-row .sess-chips .chip {
    min-width: 0;
    max-width: 100%;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}
