/* DD 俱乐部 —— Material 3 样式。手机优先，≥600 平板，≥840 桌面。颜色令牌来自 theme.css。 */

:root {
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --md-ref-typeface-brand: var(--font);
  --md-ref-typeface-plain: var(--font);

  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-emph: cubic-bezier(.05, .7, .1, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);

  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 24px; --r-xl: 28px;
  --gutter: 16px;
  --bar-h: 64px;
  --nav-h: 76px;
  --side-w: 248px;

  --ok: #1f8a4c; --ok-bg: #dff5e7;
  --warn: #9a5b00; --warn-bg: #ffecc7;
  --info: #0b62c4; --info-bg: #dcebff;
  --bad: #b3261e; --bad-bg: #fde4e1;

  /* Material Web 组件的形状/尺寸微调 */
  --md-outlined-text-field-container-shape: 14px;
  --md-outlined-select-text-field-container-shape: 14px;
  --md-filled-button-container-height: 48px;
  --md-filled-tonal-button-container-height: 48px;
  --md-outlined-button-container-height: 48px;
  --md-text-button-container-height: 44px;
  --md-dialog-container-shape: 28px;
}
html[data-theme="dark"] {
  --ok: #7fd9a5; --ok-bg: #12301f;
  --warn: #ffcf70; --warn-bg: #3a2a08;
  --info: #a7caff; --info-bg: #0f2a4a;
  --bad: #ffb4ab; --bad-bg: #4a1613;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 400 15px/1.6 var(--font);
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}
a { color: var(--md-sys-color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- 排版 */
.h1 { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -.2px; }
.h2 { font-size: 20px; line-height: 28px; font-weight: 600; }
.h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.muted { color: var(--md-sys-color-on-surface-variant); }
.small { font-size: 13px; line-height: 20px; }
.tiny { font-size: 12px; line-height: 16px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.actions--center { justify-content: center; }
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: grid; place-items: center; }
.cover--blank {
  font-size: 56px; font-weight: 800; color: var(--md-sys-color-on-primary-container);
  background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
}
.pad { padding: 18px; }
.break { overflow-wrap: anywhere; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; color: var(--md-sys-color-primary); font-variant-numeric: tabular-nums; }
.price small { font-size: .62em; font-weight: 600; margin-right: 1px; }
.price--lg { font-size: 30px; line-height: 36px; }
.price--md { font-size: 20px; line-height: 26px; }

/* ---------------------------------------------------------------- 布局 */
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px var(--gutter) 40px;
}
.page--narrow { max-width: 560px; }
.page--mid { max-width: 760px; }
.page > * + * { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 28px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--tight { gap: 8px; }
.row--between { justify-content: space-between; }
.row--start { align-items: flex-start; }
.row--end { justify-content: flex-end; }
.row--nowrap { flex-wrap: nowrap; }
.grow { flex: 1 1 0; min-width: 0; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.full { width: 100%; }

@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .h1 { font-size: 30px; line-height: 38px; }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 840px) {
  .split { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- 顶栏 */
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--md-sys-color-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 55%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--md-sys-color-on-surface); font-weight: 700; font-size: 18px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand__mark {
  flex: none; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; font-weight: 800;
  color: var(--md-sys-color-on-primary);
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  box-shadow: 0 4px 14px color-mix(in srgb, var(--md-sys-color-primary) 38%, transparent);
}
.brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar__nav { display: none; gap: 4px; margin-left: 20px; }
.appbar__end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar__end md-text-button, .appbar__end md-filled-tonal-button { --md-filled-tonal-button-container-height: 40px; --md-text-button-container-height: 40px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: var(--md-sys-color-on-primary-container);
  background: var(--md-sys-color-primary-container);
}
.avatar:hover { text-decoration: none; }
.navlink {
  padding: 8px 16px; border-radius: 999px; color: var(--md-sys-color-on-surface-variant); font-weight: 500;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.navlink:hover { text-decoration: none; background: var(--md-sys-color-surface-container-high); }
.navlink.is-active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
@media (min-width: 840px) { .appbar__nav { display: flex; } }
@media (max-width: 599px) { .hide-sm { display: none !important; } }

/* ---------------------------------------------------------------- 底部导航（手机） */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 8px 8px env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; align-items: flex-start;
  background: var(--md-sys-color-surface-container);
  border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
}
.bn-item {
  flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 0; color: var(--md-sys-color-on-surface-variant); font-size: 12px; font-weight: 500;
}
.bn-item:hover { text-decoration: none; }
.bn-item__pill {
  width: 64px; height: 32px; border-radius: 16px; display: grid; place-items: center; position: relative;
  transition: background .3s var(--ease), transform .3s var(--ease-spring);
}
.bn-item:active .bn-item__pill { transform: scale(.92); }
.bn-item.is-active { color: var(--md-sys-color-on-surface); font-weight: 700; }
.bn-item.is-active .bn-item__pill { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.bn-item__dot {
  position: absolute; top: 2px; right: 14px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); font-size: 11px; line-height: 16px; text-align: center; font-weight: 700;
}
body.has-bottom-nav .page { padding-bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
@media (min-width: 840px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav .page { padding-bottom: 40px; }
}

/* ---------------------------------------------------------------- 后台外壳 */
.shell { display: block; }
.sidebar { display: none; }
.subnav {
  position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gutter);
  background: var(--md-sys-color-surface); scrollbar-width: none;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent);
}
.subnav::-webkit-scrollbar { display: none; }
.subnav .pill { flex: none; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); max-width: 1480px; margin: 0 auto; }
  .subnav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: var(--bar-h); align-self: start;
    height: calc(100vh - var(--bar-h)); padding: 16px 12px; overflow-y: auto;
  }
  .sidebar__link {
    display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 20px; border-radius: 999px;
    color: var(--md-sys-color-on-surface-variant); font-weight: 500;
    transition: background .25s var(--ease), color .25s var(--ease);
  }
  .sidebar__link:hover { text-decoration: none; background: var(--md-sys-color-surface-container-high); }
  .sidebar__link.is-active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); font-weight: 700; }
  .sidebar form { margin-top: auto; }
  .sidebar__logout { width: 100%; border: 0; background: none; font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
  .sidebar__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); font-size: 12px; line-height: 22px; text-align: center; font-weight: 700; }
  .shell > .page { max-width: 1100px; margin: 0; }
}

/* ---------------------------------------------------------------- 卡片 */
.card {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--r-lg);
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 40%, transparent);
}
.card--flat { border: 0; background: var(--md-sys-color-surface-container); }
.card--tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border: 0; }
.card--primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border: 0; }
.card--error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); border: 0; }
.card--tight { padding: 14px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card.is-link { display: block; color: inherit; transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease), background .25s var(--ease); }
.card.is-link:hover { text-decoration: none; background: var(--md-sys-color-surface-container); box-shadow: 0 6px 20px color-mix(in srgb, var(--md-sys-color-shadow) 10%, transparent); }
.card.is-link:active { transform: scale(.985); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 24px 2px 10px; }
.section-title:first-child { margin-top: 4px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--info-bg); color: var(--info); }
.banner--warn { background: var(--warn-bg); color: var(--warn); }
.banner--error { background: var(--bad-bg); color: var(--bad); }
.banner--ok { background: var(--ok-bg); color: var(--ok); }
.banner .ic { flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- 图标 / 状态标签 / 过滤胶囊 */
.ic { width: 24px; height: 24px; fill: currentColor; flex: none; }
.ic--sm { width: 18px; height: 18px; }
.ic--lg { width: 40px; height: 40px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant);
}
button.chip { border: 0; cursor: pointer; font-family: inherit; height: 30px; font-size: 13px; transition: transform .25s var(--ease-spring); }
button.chip:active { transform: scale(.94); }
.chip--primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.chip--tertiary { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.chip--info { background: var(--info-bg); color: var(--info); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.chip--success { background: var(--ok-bg); color: var(--ok); }
.chip--error { background: var(--bad-bg); color: var(--bad); }
.chip--muted { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--md-sys-color-outline-variant); color: var(--md-sys-color-on-surface-variant);
  font-weight: 500; font-size: 14px; white-space: nowrap; background: transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.pill:hover { text-decoration: none; background: var(--md-sys-color-surface-container-high); }
.pill.is-active { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-color: transparent; font-weight: 700; }
.pill__n { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; text-align: center; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill:has(input:checked) { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); border-color: transparent; font-weight: 700; }
.pill:has(input:focus-visible) { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
@media (min-width: 840px) { .grid--2-lg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- 首页 */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 24px 22px;
  background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
  color: var(--md-sys-color-on-primary-container);
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--md-sys-color-primary) 28%, transparent), transparent 70%);
  pointer-events: none;
}
.hero__title { font-size: 28px; line-height: 36px; font-weight: 800; letter-spacing: -.3px; position: relative; }
.hero__sub { margin-top: 6px; opacity: .85; position: relative; }
.hero__notice { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--md-sys-color-surface) 55%, transparent); font-size: 14px; position: relative; }
@media (min-width: 840px) { .hero { padding: 36px 40px; } .hero__title { font-size: 38px; line-height: 46px; } }

.product {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px; border-radius: var(--r-lg); color: inherit;
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 40%, transparent);
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease), background .25s var(--ease);
}
.product:hover { text-decoration: none; background: var(--md-sys-color-surface-container); box-shadow: 0 8px 24px color-mix(in srgb, var(--md-sys-color-shadow) 11%, transparent); }
.product:active { transform: scale(.985); }
.product__thumb {
  width: 76px; height: 76px; border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: var(--md-sys-color-on-primary-container);
  background: linear-gradient(135deg, var(--md-sys-color-primary-container), var(--md-sys-color-tertiary-container));
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }
.product__title { font-weight: 600; line-height: 22px; color: var(--md-sys-color-on-surface); }
.product__desc { font-size: 13px; line-height: 19px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }
.product__price { text-align: right; white-space: nowrap; }
.product__price .unit { display: block; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.product.is-off { opacity: .55; }
@media (min-width: 600px) { .grid--products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid--products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------------------------------------------------------------- 键值 / 列表 / 时间线 */
.kv { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; align-items: baseline; }
.kv dt { color: var(--md-sys-color-on-surface-variant); font-size: 14px; white-space: nowrap; }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.kv--left dd { text-align: left; }
.divider { height: 1px; background: color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent); margin: 14px 0; border: 0; }
md-divider { --md-divider-color: color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent); }

.item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: inherit;
  transition: background .2s var(--ease);
}
.item:hover { text-decoration: none; background: var(--md-sys-color-surface-container); }
.item + .item { border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent); }
.item__lead { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.item__body { flex: 1; min-width: 0; }
.item__title { font-weight: 600; }
.item__trail { flex: none; color: var(--md-sys-color-on-surface-variant); }

.ocard { display: block; color: inherit; }
.ocard:hover { text-decoration: none; }
.ocard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.ocard__title { font-weight: 600; font-size: 16px; line-height: 22px; }
.ocard__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 6px; }
.ocard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--md-sys-color-primary); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: -2px; width: 2px; background: var(--md-sys-color-outline-variant); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline__msg { line-height: 22px; }
.timeline__time { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 88px; height: 88px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--md-sys-color-outline-variant); background: var(--md-sys-color-surface-container); padding: 0; cursor: zoom-in; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- 统计 */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 840px) { .stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 16px; border-radius: var(--r-lg); background: var(--md-sys-color-surface-container-low); border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 40%, transparent); }
.stat--accent { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border: 0; }
.stat--warn { background: var(--warn-bg); color: var(--warn); border: 0; }
.stat--error { background: var(--bad-bg); color: var(--bad); border: 0; }
.stat__label { font-size: 13px; opacity: .8; }
.stat__value { font-size: 26px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat__value small { font-size: .55em; font-weight: 600; margin-right: 1px; }
.stat__sub { font-size: 12px; opacity: .75; margin-top: 2px; }
.wallet-hero { padding: 22px; border-radius: var(--r-xl); color: var(--md-sys-color-on-primary); background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary)); box-shadow: 0 10px 30px color-mix(in srgb, var(--md-sys-color-primary) 35%, transparent); }
.wallet-hero__label { opacity: .85; font-size: 14px; }
.wallet-hero__value { font-size: 40px; line-height: 48px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.wallet-hero__value small { font-size: .5em; font-weight: 700; margin-right: 2px; }
.wallet-hero__row { display: flex; gap: 22px; margin-top: 14px; font-size: 13px; opacity: .92; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 表单 */
.form { display: grid; gap: 16px; }
md-outlined-text-field, md-outlined-select { width: 100%; }
.field-row { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .field-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hint { font-size: 13px; line-height: 19px; color: var(--md-sys-color-on-surface-variant); }
.checkline { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; }
.checkline > span { flex: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions--end { justify-content: flex-end; }
.actions--full > * { flex: 1 1 0; }
.filebtn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--md-sys-color-on-secondary-container); background: var(--md-sys-color-secondary-container); transition: transform .25s var(--ease-spring); }
.filebtn:active { transform: scale(.96); }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filebtn:focus-within { outline: 2px solid var(--md-sys-color-primary); outline-offset: 2px; }
.filename { font-size: 13px; color: var(--md-sys-color-on-surface-variant); }
.qty { display: flex; align-items: center; gap: 12px; }
.qty__total { margin-left: auto; text-align: right; }
.paybox { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.paybox > * { width: 100%; }
.sticky-cta {
  position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) - 4px); z-index: 15;
  padding: 12px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--md-sys-color-surface-container-high) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--md-sys-color-shadow) 18%, transparent);
}
body:not(.has-bottom-nav) .sticky-cta { bottom: calc(12px + env(safe-area-inset-bottom)); }
@media (min-width: 840px) { .sticky-cta { position: static; box-shadow: none; background: transparent; padding: 0; } }

/* ---------------------------------------------------------------- 表格（手机上折叠为卡片） */
.table-wrap { border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent); background: var(--md-sys-color-surface-container-low); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface-variant); padding: 12px 16px; background: var(--md-sys-color-surface-container); white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 40%, transparent); vertical-align: middle; }
.table tr:hover td { background: color-mix(in srgb, var(--md-sys-color-surface-container) 70%, transparent); }
.table .r { text-align: right; }
@media (max-width: 719px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent); }
  .table tr:first-child { border-top: 0; }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--md-sys-color-on-surface-variant); font-size: 13px; text-align: left; flex: none; }
  .table td[data-label=""]::before, .table td:not([data-label])::before { content: none; }
  .table td.full-row { display: block; text-align: left; padding-top: 8px; }
  .table tr:hover td { background: none; }
}

/* ---------------------------------------------------------------- 空状态 / 提示 / 分页 */
.empty { text-align: center; padding: 44px 20px; color: var(--md-sys-color-on-surface-variant); }
.empty .ic { width: 56px; height: 56px; opacity: .45; margin: 0 auto 10px; }
.empty__title { font-weight: 600; font-size: 16px; color: var(--md-sys-color-on-surface); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

.snack-host {
  position: fixed; left: 0; right: 0; z-index: 80; pointer-events: none;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px;
}
body:not(.has-bottom-nav) .snack-host { bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 840px) { .snack-host, body.has-bottom-nav .snack-host { bottom: 24px; } }
.snack {
  pointer-events: auto; max-width: 560px; width: fit-content; padding: 14px 18px; border-radius: var(--r-sm);
  background: var(--md-sys-color-inverse-surface); color: var(--md-sys-color-inverse-on-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--md-sys-color-shadow) 28%, transparent);
  animation: snack-in .45s var(--ease-spring) both; cursor: pointer;
}
.snack--err { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.snack.is-leaving { animation: snack-out .25s var(--ease) both; }
@keyframes snack-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes snack-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }

.lightbox-img { max-width: min(92vw, 720px); max-height: 78vh; border-radius: var(--r-md); margin: 0 auto; }
md-dialog { max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- 认证页 */
.auth { min-height: calc(100dvh - var(--bar-h) - 40px); display: grid; align-content: center; }
.auth__card { padding: 26px 22px; border-radius: var(--r-xl); }
.auth__title { font-size: 26px; line-height: 34px; font-weight: 800; }

/* ---------------------------------------------------------------- 错误页 */
.errpage { text-align: center; padding: 72px 16px; }
.errpage__code { font-size: 88px; line-height: 1; font-weight: 800; letter-spacing: -3px; background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------------------------------------------------------------- 动效 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page > * { animation: rise .55s var(--ease-emph) both; }
.page > *:nth-child(2) { animation-delay: .04s; }
.page > *:nth-child(3) { animation-delay: .08s; }
.page > *:nth-child(4) { animation-delay: .12s; }
.page > *:nth-child(5) { animation-delay: .16s; }
.page > *:nth-child(n+6) { animation-delay: .2s; }
.pop { animation: pop .5s var(--ease-spring) both; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--md-sys-color-primary); display: inline-block; animation: pulse 1.8s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
