/* 「來前」H5 全局样式（设计规范：docs/UI_APPLE.md；换算：1rpx = 0.5px）。
 *
 * 这是 web/ 里唯一允许写十六进制颜色的样式文件，而且只能写在 §1 / §2 的 :root 令牌块里。
 * 页面样式（web/assets/pages_*.css）和页面 JS 一律 var(--xxx)，不许写死色值，深色模式才不会出现白底黑字。
 *
 * 目录
 *   1 令牌（浅色）   2 令牌（深色）   3 基础与重置   4 字号与颜色工具类   5 应用外壳（顶栏 / 内容 / 标签栏 / 宽屏居中）
 *   6 卡片、分组列表、行   7 按钮   8 表单控件   9 状态标签、奖牌、头像、统计块、空状态
 *   10 反馈：骨架、转圈、行内提示、字段错误   11 浮层：遮罩、sheet、modal、toast、loading   12 底部操作栏   13 工具类   14 减弱动效
 *
 * 兼容性底线：iOS Safari 14 / Android Chrome 90。所以不用 inset 简写、flex gap、aspect-ratio、:is()/:where()、dvh。
 * 动画只动 transform 和 opacity。
 */

/* ------------------------------------------------------------------ 1 令牌：浅色 */
:root {
  color-scheme: light dark;

  /* 品牌色 */
  --tint: #00785D;
  --medal-gold-hi: #ffe89a; --medal-gold: #d4a017; --medal-gold-lo: #a8770b; --medal-gold-ink: #4a3200;
  --medal-silver-hi: #ffffff; --medal-silver: #c4cad2; --medal-silver-lo: #8e96a1; --medal-silver-ink: #2c3440;
  --medal-bronze-hi: #f5c7a0; --medal-bronze: #b87333; --medal-bronze-lo: #7a4a1d; --medal-bronze-ink: #ffffff;
  --wall-top: #6b3a1f; --wall-bottom: #24100a; --wall-spot: rgba(255, 214, 140, 0.42); --wall-text: #fbf0dc; --wall-dim: rgba(251, 240, 220, 0.66); --wall-gold-text: #ffd98a;
  --medal-shine: rgba(255, 255, 255, 0.55); --medal-glow-gold: rgba(255, 213, 107, 0.55); --medal-glow-silver: rgba(214, 224, 240, 0.5); --medal-glow-bronze: rgba(222, 150, 90, 0.5);
  --fellow-hi: #f9e28a; --fellow-lo: #d9a441; --fellow-ink: #5a3b00;
  --honorary-hi: #f0f0f0; --honorary-lo: #b9bec6; --honorary-ink: #2c3440;
  --tint-soft: rgba(0, 120, 93, 0.12);
  --on-tint: #FFFFFF;           /* 品牌色底上的文字 */
  --hero-a: rgba(0, 120, 93, 0.94); --hero-b: rgba(0, 83, 65, 0.90); --hero-ink: #FFFFFF;
  --me-accent: #00785D; --me-accent-soft: rgba(0, 120, 93, 0.12);
  --fab-blue: #00785D; --on-fab: #FFFFFF; /* 社區發帖按鈕 */

  /* 背景与文字 */
  --bg: #FFFFFF;
  --bg-outer: #FFFFFF;
  --bg-elevated: rgba(255, 255, 255, 0.94);
  --glass: rgba(255, 255, 255, 0.82);
  --glass-stroke: rgba(255, 255, 255, 0.92);
  --glass-shadow: 0 10px 30px rgba(64, 68, 80, 0.10);
  --page-glow: none;
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.60);
  --label-3: rgba(60, 60, 67, 0.30);
  --separator: rgba(60, 60, 67, 0.29);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.32);   /* 开关关闭时的轨道 */

  /* 语义色 */
  --green: #34C759;
  --red: #00785D;
  --orange: #FF9500;
  --green-soft: rgba(52, 199, 89, 0.12);
  --red-soft: rgba(0, 120, 93, 0.12);
  --orange-soft: rgba(255, 149, 0, 0.12);
  --white: #FFFFFF;             /* 红底、绿底上的文字，两种模式都是纯白 */
  /* 文字用的语义色（浅色下比填充色更深，白底上对比度 >= 4.5:1；深色下与填充色相同） */
  --green-ink: #1E7A3A;
  --red-ink: #005341;
  --orange-ink: #A15C00;

  /* 奖牌色（排行榜前三名、奖项徽章），两种模式同值 */
  --gold: #C9A227;
  --silver: #A7A9AC;
  --bronze: #B8804A;
  --on-medal: #1C1C1E;
  --vermeil: #D4AF37;
  --vermeil-soft: rgba(212, 175, 55, 0.20);
  --vermeil-ink: #7A5F00;

  /* 材质与遮罩 */
  --material: rgba(255, 255, 255, 0.72);
  --material-solid: rgba(255, 255, 255, 0.94);   /* backdrop-filter 不可用时的降级底 */
  --scrim: rgba(0, 0, 0, 0.30);
  --toast-bg: rgba(44, 44, 46, 0.94);
  --toast-fg: #FFFFFF;
  --tab-inactive: #6E6E73;

  /* 分段控件选中块、阴影 */
  --segment-selected: #FFFFFF;
  --shadow-small: 0 1px 4px rgba(0, 0, 0, 0.12);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* 间距阶梯（8/16/24/32/48rpx）、圆角 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --gutter: 16px;
  --radius: 18px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --tap: 44px;                  /* 最小点击热区 */
  --hairline: 1px;

  /* 动效：临界阻尼弹簧的近似曲线，不回弹 */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
  --dur-fast: 200ms;
  --dur: 350ms;

  /* 外壳尺寸 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-h: 44px;
  --tabbar-h: 58px;
  --col: 480px;                 /* 宽屏时应用栏宽度 */

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "PingFang SC", "Helvetica Neue", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}
@media (min-resolution: 2dppx) {
  :root { --hairline: 0.5px; }
}

/* ------------------------------------------------------------------ 2 令牌：深色 */
@media (prefers-color-scheme: dark) {
  :root {
    --tint: #53C7A8;
    --tint-soft: rgba(83, 199, 168, 0.18);
    --on-tint: #00251D;
    --hero-a: rgba(0, 120, 93, 0.72); --hero-b: rgba(0, 48, 38, 0.90); --hero-ink: #FFFFFF;
    --me-accent: #53C7A8; --me-accent-soft: rgba(83, 199, 168, 0.18);
    --fab-blue: #168B70; --on-fab: #FFFFFF;

    --bg: #000000;
    --bg-outer: #000000;
    --bg-elevated: rgba(34, 34, 38, 0.78);
    --glass: rgba(30, 30, 34, 0.62);
    --glass-stroke: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --page-glow: radial-gradient(circle at 90% 0%, rgba(0, 120, 93, 0.20), transparent 33%), radial-gradient(circle at 0% 60%, rgba(55, 66, 84, 0.15), transparent 42%);
    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, 0.60);
    --label-3: rgba(235, 235, 245, 0.30);
    --separator: rgba(84, 84, 88, 0.65);
    --fill: rgba(120, 120, 128, 0.24);
    --fill-strong: rgba(120, 120, 128, 0.42);

    --green: #30D158;
    --red: #53C7A8;
    --orange: #FF9F0A;
    --green-soft: rgba(48, 209, 88, 0.18);
    --red-soft: rgba(83, 199, 168, 0.18);
    --orange-soft: rgba(255, 159, 10, 0.18);
    --green-ink: #30D158;
    --red-ink: #53C7A8;
    --orange-ink: #FF9F0A;
    --tab-inactive: #98989D;

    --vermeil-soft: rgba(212, 175, 55, 0.26);
    --vermeil-ink: #E6C75A;

    --material: rgba(28, 28, 30, 0.72);
    --material-solid: rgba(28, 28, 30, 0.94);
    --scrim: rgba(0, 0, 0, 0.50);
    --toast-bg: rgba(72, 72, 74, 0.96);

    --segment-selected: #636366;
    --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
}

/* ------------------------------------------------------------------ 3 基础与重置 */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;           /* 只裁视口，不创建滚动容器（不影响 sticky） */
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--label);
  background: var(--bg-outer);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;      /* 长单词、长编号不撑破布局 */
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; border: 0; }
a { color: var(--tint); text-decoration: none; -webkit-touch-callout: none; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { -webkit-appearance: none; appearance: none; touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ------------------------------------------------------------------ 4 字号与颜色工具类（1pt = 1px） */
.t-large { font-size: 34px; font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
.t-title1 { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; }
.t-title2 { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.t-title3 { font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
.t-headline { font-size: 17px; font-weight: 600; line-height: 1.35; }
.t-body { font-size: 17px; font-weight: 400; line-height: 1.47; }
.t-callout { font-size: 16px; font-weight: 400; line-height: 1.4; }
.t-subhead { font-size: 15px; font-weight: 400; line-height: 1.35; }
.t-footnote { font-size: 13px; font-weight: 400; line-height: 1.35; letter-spacing: 0.01em; }
.t-caption { font-size: 12px; font-weight: 500; line-height: 1.3; letter-spacing: 0.02em; }

/* 分数、金额、名次：等宽数字，避免变化时跳动 */
.num { font-variant-numeric: tabular-nums; }

.c-label { color: var(--label); }
.c-2 { color: var(--label-2); }
.c-3 { color: var(--label-3); }
.c-tint { color: var(--tint); }
.c-red { color: var(--red-ink); }
.c-green { color: var(--green-ink); }
.c-orange { color: var(--orange-ink); }

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ellipsis-2 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pre-wrap { white-space: pre-wrap; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ------------------------------------------------------------------ 5 应用外壳 */
.app {
  position: relative;
  min-height: 100vh;
  background: var(--page-glow), var(--bg);
}
@media (min-width: 600px) {
  .app {
    max-width: var(--col);
    margin: 0 auto;
    box-shadow: 0 0 0 var(--hairline) var(--separator);
  }
}

/* 顶栏：固定；背景是单独一层，滚动后 opacity 淡入，不动尺寸 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: var(--col);
  z-index: 100;
  padding-top: var(--safe-top);
}
.topbar__bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--material-solid);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.topbar__line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--hairline);
  background: var(--separator);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.topbar__inner {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 var(--sp-1);
}
.topbar__side {
  flex: 0 0 96px;
  display: flex;
  align-items: center;
  min-width: 0;
}
.topbar__side--right { justify-content: flex-end; }
@media (max-width: 359px) {
  .topbar__side { flex-basis: 72px; }
  .topbar__btn { padding: 0 var(--sp-1); }
  .stat__value { font-size: 24px; }
  .large-title, .login-hero__title { font-size: 30px; }
}
.topbar__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  line-height: var(--topbar-h);
  color: var(--label);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.topbar__btn {
  display: inline-flex;
  align-items: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 var(--sp-2);
  border: 0;
  background: transparent;
  color: var(--tint);
  font-size: 17px;
  white-space: nowrap;
}
.topbar__btn:active, .topbar__btn.is-pressed { opacity: 0.5; }
.topbar__chevron {
  width: 10px;
  height: 10px;
  margin: 0 6px 0 4px;
  border-left: 2.5px solid currentColor;
  border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg);
}
/* 大标题页：滚动前顶栏标题隐藏、背景透明；滚动过阈值后（.is-collapsed）出现 */
.app.has-large .topbar__title { opacity: 0; }
.app.has-large.is-collapsed .topbar__title { opacity: 1; }
.app.has-large.is-collapsed .topbar__bg,
.app.has-large.is-collapsed .topbar__line { opacity: 1; }
/* 普通页：标题常驻；离开顶部后才出现背景和发丝线 */
.app:not(.has-large).is-scrolled .topbar__bg,
.app:not(.has-large).is-scrolled .topbar__line { opacity: 1; }
/* 无顶栏的页面（登录页自己画标题） */
.app.no-bar .topbar { display: none; }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar__bg,
  .tabbar,
  .action-bar,
  .material-bar {
    background: var(--material);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
  }
}
.material-bar { background: var(--material-solid); }

/* 内容区 */
.view {
  min-height: 100vh;
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(var(--sp-5) + var(--safe-bottom));
}
.app.no-bar .view { padding-top: var(--safe-top); }
@supports (-webkit-touch-callout: none) {
  .app, .view { min-height: -webkit-fill-available; }
  .sheet { max-height: calc(100% - 24px); }
  .modal { max-height: calc(100% - 64px); }
}
.app.has-tabbar .view { padding-bottom: calc(var(--tabbar-h) + var(--sp-5) + var(--safe-bottom)); }
.page--enter { animation: lq-fade-in 150ms ease-out both; }
.page[hidden] { display: none; }
.large-title {
  padding: var(--sp-1) var(--gutter) var(--sp-2);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.large-title__right { float: right; }
.page__body { min-height: 40vh; }
.page-pad { padding-left: var(--gutter); padding-right: var(--gutter); }
/* .page-pad 已经给了 gutter，里面的 .group / .card / .inline-tip 不能再叠一层，否则左右各缩 32px */
.page-pad .group,
.page-pad .card,
.page-pad .inline-tip,
.page-pad .mx-gutter,
.page-pad .form-actions,
.page-pad .axh-block,
.page-pad .axh-preview,
.page-pad .ash-top-actions,
.page-pad .ash-block-label,
.page-pad .jn-intro { margin-left: 0; margin-right: 0; }
.section { margin-bottom: var(--sp-5); }

/* 标签栏 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: var(--col);
  z-index: 100;
  display: none;
  padding-bottom: var(--safe-bottom);
  border-top: var(--hairline) solid var(--glass-stroke);
  background: var(--glass);
  box-shadow: 0 -8px 28px rgba(0, 50, 38, 0.06);
  -webkit-backdrop-filter: saturate(170%) blur(24px);
  backdrop-filter: saturate(170%) blur(24px);
}
.app.has-tabbar .tabbar { display: flex; }
.tabbar__item {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 0 0;
  border: 0;
  background: transparent;
  color: var(--tab-inactive);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.tabbar__item.is-active { color: var(--tint); }
.tabbar__item:active { opacity: 0.6; }
.tabbar__icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 30px; margin-bottom: 2px; border-radius: var(--radius-pill); }
.tabbar__icon::before { display: block; width: 24px; height: 24px; background: currentColor; content: ''; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.tabbar__item.is-active .tabbar__icon { background: var(--tint-soft); }
.tabbar__item[data-tab="home"] .tabbar__icon::before { -webkit-mask-image: url('icons/tab-home-outline.svg'); mask-image: url('icons/tab-home-outline.svg'); }
.tabbar__item[data-tab="home"].is-active .tabbar__icon::before { -webkit-mask-image: url('icons/tab-home-solid.svg'); mask-image: url('icons/tab-home-solid.svg'); }
.tabbar__item[data-tab="community"] .tabbar__icon::before { -webkit-mask-image: url('icons/tab-chat-bubble-left-right-outline.svg'); mask-image: url('icons/tab-chat-bubble-left-right-outline.svg'); }
.tabbar__item[data-tab="community"].is-active .tabbar__icon::before { -webkit-mask-image: url('icons/tab-chat-bubble-left-right-solid.svg'); mask-image: url('icons/tab-chat-bubble-left-right-solid.svg'); }
.tabbar__item[data-tab="shop"] .tabbar__icon::before { -webkit-mask-image: url('icons/tab-shopping-bag-outline.svg'); mask-image: url('icons/tab-shopping-bag-outline.svg'); }
.tabbar__item[data-tab="shop"].is-active .tabbar__icon::before { -webkit-mask-image: url('icons/tab-shopping-bag-solid.svg'); mask-image: url('icons/tab-shopping-bag-solid.svg'); }
.tabbar__item[data-tab="me"] .tabbar__icon::before { -webkit-mask-image: url('icons/tab-user-circle-outline.svg'); mask-image: url('icons/tab-user-circle-outline.svg'); }
.tabbar__item[data-tab="me"].is-active .tabbar__icon::before { -webkit-mask-image: url('icons/tab-user-circle-solid.svg'); mask-image: url('icons/tab-user-circle-solid.svg'); }

/* ------------------------------------------------------------------ 6 卡片、分组列表、行 */
/* 卡片不加阴影，靠 --bg 与 --bg-elevated 的对比分层 */
.card {
  margin: 0 var(--gutter) var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius);
  background: var(--glass);
  border: var(--hairline) solid var(--glass-stroke);
  box-shadow: var(--glass-shadow);
}
.card--flush { padding: 0; overflow: hidden; }
.card--tint { background: var(--tint-soft); }
.card__title { margin-bottom: var(--sp-2); color: var(--label-2); font-size: 13px; }

/* 分组列表（iOS「设置」风格）：<div class="group"><div class="group__title">…</div><div class="group__body"><a class="row">…</a>…</div><div class="group__footer">…</div></div> */
.group { margin: 0 var(--gutter) var(--sp-5); }
.group--flush { margin-left: 0; margin-right: 0; }
.group__title {
  padding: 0 var(--sp-4) var(--sp-2);
  font-size: 13px;
  line-height: 1.35;
  color: var(--label-2);
}
.group__body {
  overflow: hidden;             /* 圆角裁掉行按下时的灰底 */
  border-radius: var(--radius);
  background: var(--glass);
  border: var(--hairline) solid var(--glass-stroke);
  box-shadow: var(--glass-shadow);
}
.home-stage { padding: var(--sp-4) var(--gutter) var(--sp-5); }
.home-showcase { display: flex; min-height: 104px; flex-direction: column; justify-content: center; margin: 0 0 var(--sp-3); padding: var(--sp-4); border-radius: var(--radius); color: var(--hero-ink); background: linear-gradient(120deg, var(--hero-a), var(--hero-b)); box-shadow: var(--shadow-small); text-decoration: none; }
.home-showcase__eyebrow { font-size: 12px; opacity: .82; }
.home-carousel { margin-bottom: var(--sp-3); min-width: 0; }
.home-carousel__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: var(--radius); }
.home-carousel__track::-webkit-scrollbar { display: none; }
.home-carousel__track .home-showcase { flex: 0 0 100%; box-sizing: border-box; min-width: 0; margin: 0 12px 0 0; scroll-snap-align: start; scroll-snap-stop: always; box-shadow: none; }
.home-carousel__track .home-showcase:last-child { margin-right: 0; }
.home-carousel__dots { display: flex; justify-content: center; }
.home-carousel__dot { display: flex; align-items: center; justify-content: center; width: 32px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.home-carousel__dot span { width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--label-3); opacity: .35; }
.home-carousel__dot[aria-current="true"] span { width: 18px; background: var(--tint); opacity: 1; }
.home-carousel__dot:focus-visible { outline: 2px solid var(--tint); border-radius: var(--radius-sm); }
.home-showcase strong { margin-top: 2px; font-size: 20px; line-height: 1.25; }
.home-showcase > span:last-child { margin-top: 4px; font-size: 12px; line-height: 1.35; opacity: .9; }
.home-stage__links { display: grid; grid-template-columns: 1fr 1fr; grid-gap: var(--sp-2); margin-bottom: var(--sp-4); }
.home-stage__tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 104px;
  min-width: 0;
  padding: var(--sp-3);
  border: var(--hairline) solid var(--glass-stroke);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: saturate(170%) blur(22px);
  backdrop-filter: saturate(170%) blur(22px);
  color: var(--label);
}
.home-stage__tile--rank { background: linear-gradient(125deg, var(--hero-a), var(--hero-b)); color: var(--hero-ink); }
.home-stage__tile strong { font-size: 20px; line-height: 1.2; }
.home-stage__tile span { margin-top: var(--sp-2); font-size: 12px; line-height: 1.35; opacity: 0.8; }
.home-stage > .group, .home-stage > .card { margin-left: 0; margin-right: 0; margin-bottom: var(--sp-4); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .card, .group__body {
    -webkit-backdrop-filter: saturate(170%) blur(22px);
    backdrop-filter: saturate(170%) blur(22px);
  }
}
.group__footer {
  padding: var(--sp-2) var(--sp-4) 0;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--label-2);
}

/* 行：最小 48px。可以是 div / a / button；可点的加 .is-pressable（a、button 自带）。 */
.row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: var(--sp-2) var(--sp-4);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--label);
  font: inherit;
  text-align: left;
  text-decoration: none;
  -webkit-touch-callout: none;
}
/* 行间发丝线：从文字起点开始（缩进 16px，有图标时 60px），不贯穿整行 */
.group__body > .row:not(:last-child)::after,
.group__body > .fade-in:not(:last-child)::after {
  content: '';
  position: absolute;
  left: var(--sp-4);
  right: 0;
  bottom: 0;
  height: var(--hairline);
  background: var(--separator);
}
.group__body > .row--icon:not(:last-child)::after { left: 60px; }
a.row, button.row, .row.is-pressable { cursor: pointer; touch-action: manipulation; }
a.row:active, button.row:active, .row.is-pressable:active, .row.is-pressed { background: var(--fill); }
.row.is-disabled { opacity: 0.4; pointer-events: none; }
.row__icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-right: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  background: var(--tint);
  color: var(--on-tint);
}
.row__icon.tone-green { background: var(--green); color: var(--white); }
.row__icon.tone-red { background: var(--red); color: var(--white); }
.row__icon.tone-orange { background: var(--orange); color: var(--white); }
.row__icon.tone-gray { background: var(--silver); color: var(--white); }
.row__main { flex: 1 1 auto; min-width: 0; }
.row__title { font-size: 17px; line-height: 1.35; color: var(--label); overflow-wrap: anywhere; }
.row__title.is-danger { color: var(--red-ink); }
.row__sub { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--label-2); overflow-wrap: anywhere; }
.row__right {
  flex: 0 1 auto;
  max-width: 56%;
  margin-left: var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.row__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
/* 右箭头「›」与对勾：纯 CSS，不引图库 */
.row__chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: var(--sp-2);
  margin-right: 2px;
  border-top: 2px solid var(--label-3);
  border-right: 2px solid var(--label-3);
  transform: rotate(45deg);
}
.row__check {
  flex: 0 0 auto;
  width: 7px;
  height: 14px;
  margin: 0 4px 4px var(--sp-2);
  border-right: 3px solid var(--tint);
  border-bottom: 3px solid var(--tint);
  transform: rotate(45deg);
}

/* 公告等可展开的行 */
.row--stack { display: block; }
.row--stack .row__head { display: flex; align-items: center; }
.dot { flex: 0 0 auto; width: 8px; height: 8px; margin-right: var(--sp-2); border-radius: 50%; background: var(--tint); }

/* ------------------------------------------------------------------ 7 按钮 */
/* <button class="btn btn--primary">。四种样式：primary（实心品牌色）/ secondary（浅底品牌字）/ destructive（红）/ plain（只有字）
   修饰：.btn--inline 按内容宽度、.btn--pill 胶囊、.btn--sm（仍然满足 44px 热区）、.is-loading 转圈、[disabled] 或 .is-disabled 置灰 */
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  margin: 0;
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 100ms ease-out, opacity 100ms ease-out;
}
.btn--primary { background: var(--tint); color: var(--on-tint); }
.btn--secondary { background: var(--tint-soft); color: var(--tint); }
.btn--destructive { background: var(--red-soft); color: var(--red-ink); }
.btn--destructive.is-filled { background: var(--red); color: var(--white); }
.btn--plain { min-height: var(--tap); background: transparent; color: var(--tint); font-weight: 500; }
.btn--inline { display: inline-flex; width: auto; padding: 0 var(--sp-5); }
.btn--pill { border-radius: var(--radius-pill); }
.btn--sm { min-height: var(--tap); padding: 0 var(--sp-4); font-size: 15px; }
.btn:active, .btn.is-pressed { transform: scale(0.97); opacity: 0.85; }
.btn[disabled], .btn.is-disabled { opacity: 0.4; pointer-events: none; }
.btn.is-loading { opacity: 0.7; pointer-events: none; }
.btn.is-loading::before {
  content: '';
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-right: var(--sp-2);
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lq-spin 0.8s linear infinite;
}
.btn-row { display: flex; }
.btn-row > .btn { flex: 1 1 0; min-width: 0; }
.btn-row > .btn + .btn { margin-left: var(--sp-3); }
.btn-stack > .btn + .btn { margin-top: var(--sp-3); }

/* ------------------------------------------------------------------ 8 表单控件 */
/* 输入框：字号 ≥16px，避免 iOS 聚焦时页面被放大 */
.input, .textarea, .select select {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  color: var(--label);
  font-size: 17px;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { min-height: 96px; padding: var(--sp-3); resize: none; }
.input::placeholder, .textarea::placeholder { color: var(--label-3); }
.input[disabled], .textarea[disabled], .select select[disabled] { opacity: 0.4; }
.input.is-invalid, .textarea.is-invalid, .form-row.is-invalid .form-row__input { box-shadow: 0 0 0 1.5px var(--red); }

/* 下拉：<div class="select"><select>…</select></div>（外层负责箭头） */
.select { position: relative; }
.select select { padding-right: 32px; }
.select::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--label-3);
  border-bottom: 2px solid var(--label-3);
  transform: rotate(45deg);
  pointer-events: none;
}

/* 表单行（放在 .group__body 里）：标签在左，输入在右 */
.form-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--sp-2) var(--sp-4);
  background: transparent;
}
.group__body > .form-row:not(:last-child)::after {
  content: '';
  position: absolute;
  left: var(--sp-4);
  right: 0;
  bottom: 0;
  height: var(--hairline);
  background: var(--separator);
}
.form-row__label {
  flex: 0 0 auto;
  min-width: 84px;
  max-width: 40%;
  margin-right: var(--sp-3);
  font-size: 17px;
  color: var(--label);
}
.form-row__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--label);
  font-size: 17px;
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
}
.form-row__input::placeholder { color: var(--label-3); }
.form-row--block { display: block; }
.form-row--block .form-row__label { display: block; max-width: none; margin: 0 0 var(--sp-2); }
.form-row--block .form-row__input { display: block; width: 100%; text-align: left; }
textarea.form-row__input { min-height: 88px; padding: var(--sp-2) 0; resize: none; }
.form-row__hint { margin-top: var(--sp-1); font-size: 13px; color: var(--label-2); }

/* 开关：<label class="switch"><input class="switch__input" type="checkbox" role="switch"><span class="switch__track"></span></label> */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 51px;
  min-height: var(--tap);
}
.switch__input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch__track {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--fill-strong);
  transition: background-color var(--dur-fast) var(--ease-out);
  pointer-events: none;
}
.switch__track::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow-small);
  transition: transform var(--dur-fast) var(--ease-spring);
}
.switch__input:checked + .switch__track { background: var(--tint); }
.switch__input:checked + .switch__track::after { transform: translateX(20px); }
.switch__input:focus-visible + .switch__track { outline: 2px solid var(--tint); outline-offset: 2px; }
.switch__input:disabled + .switch__track { opacity: 0.4; }

/* 分段控件：轨道 --fill；选中块用 transform 平移（--seg-index / --seg-count 由 LQ.ui.segmented 写好）
   <div class="seg" style="--seg-count:2;--seg-index:0"><span class="seg__block"></span><button class="seg__item is-selected" data-value="a">…</button>…</div> */
.seg {
  position: relative;
  display: flex;
  padding: 0 2px;
  border-radius: 10px;
  background: var(--fill);
}
.seg.is-disabled { opacity: 0.4; pointer-events: none; }
.seg__block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc((100% - 4px) / var(--seg-count, 1));
  border-radius: 8px;
  background: var(--segment-selected);
  box-shadow: var(--shadow-small);
  transform: translateX(calc(var(--seg-index, 0) * 100%));
  transition: transform 250ms var(--ease-spring);
}
.seg--none .seg__block { opacity: 0; }
.seg__item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  padding: 0 var(--sp-2);
  border: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--label);
  font-size: 16px;
  font-weight: 500;
}
.seg__item.is-selected { font-weight: 600; }
.seg__item:active { opacity: 0.6; }

.field-error {
  padding: var(--sp-1) var(--sp-4) 0;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--red);
}
.form-actions { margin: var(--sp-5) var(--gutter) 0; }

/* ------------------------------------------------------------------ 9 状态标签、奖牌、头像、统计块、空状态 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--fill);
  color: var(--label-2);
}
.tag--orange { background: var(--orange-soft); color: var(--orange-ink); }
.tag--green { background: var(--green-soft); color: var(--green-ink); }
.tag--red { background: var(--red-soft); color: var(--red-ink); }
.tag--gray { background: var(--fill); color: var(--label-2); }

.medal {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  background: var(--fill);
  color: var(--label-2);
}
.medal.is-large { font-weight: 700; }
.medal--gold { background: var(--gold); color: var(--on-medal); }
.medal--vermeil { background: var(--vermeil-soft); color: var(--vermeil-ink); }
.medal--silver { background: var(--silver); color: var(--on-medal); }
.medal--bronze { background: var(--bronze); color: var(--on-medal); }
.medal--plain { background: var(--fill); color: var(--label-2); }

/* 圆形头像：有图用 <img>，没图显示姓氏首字 */
.avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--56 { width: 56px; height: 56px; font-size: 24px; }
.avatar--64 { width: 64px; height: 64px; font-size: 28px; }

/* 统计块：<div class="stat"><div class="stat__label">…</div><div class="stat__value">…</div></div> */
.stat { min-width: 0; }
.stat--center { text-align: center; }
.stat__label { font-size: 13px; line-height: 1.35; color: var(--label-2); }
.overview .stat__label { white-space: nowrap; font-size: 12px; }
.stat__value {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--label);
  font-variant-numeric: tabular-nums;
}
.stat--tint .stat__value { color: var(--tint); }
/* 非数字的值（如「未上榜」）：缩小字号，避免被省略号截掉 */
.stat__value--text { font-size: 20px; line-height: 1.5; letter-spacing: 0; }
.stat-row { display: flex; align-items: flex-start; }
.stat-row > .stat { flex: 1 1 0; min-width: 0; padding-right: var(--sp-1); }
.stat-row > .stat--wide { flex: 1.6 1 0; }
.stat-row > .stat--narrow { flex: 0.8 1 0; }
.rank-chips { display: flex; flex-wrap: wrap; margin-top: var(--sp-3); }
.rank-chip { min-width: 0; margin-right: var(--sp-5); }
.rank-chip:last-child { margin-right: 0; }
.rank-chip__label { font-size: 13px; line-height: 1.35; color: var(--label-2); }
.rank-chip__value { font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; }
.rank-chip__value--text { font-size: 16px; font-weight: 500; line-height: 1.6; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: var(--sp-3); }
.stat-grid > .stat { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius); background: var(--bg-elevated); }

/* 空状态与错误态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 32px;
  text-align: center;
}
.empty__symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 2px solid var(--label-3);
  border-radius: 50%;
  color: var(--label-3);
}
.empty__symbol--error { border-color: var(--orange); color: var(--orange-ink); }
.empty__glyph { font-size: 32px; font-weight: 300; line-height: 1; }
.empty__dash { width: 20px; height: 2px; border-radius: 1px; background: currentColor; }
.empty__title { margin-top: var(--sp-4); font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--label); }
.empty__text { margin-top: var(--sp-2); font-size: 16px; line-height: 1.4; color: var(--label-2); }
.empty__action { margin-top: 20px; }

/* ------------------------------------------------------------------ 10 反馈 */
/* 骨架：--fill 色块，圆角同内容。只动 opacity。 */
.skeleton {
  background: var(--fill);
  border-radius: var(--radius-sm);
  animation: lq-skeleton 1.2s ease-in-out infinite;
}
.skeleton-line { height: 16px; margin-bottom: var(--sp-2); }
.skeleton-line--short { width: 60%; }
.skeleton-card { height: 80px; margin-bottom: var(--sp-3); border-radius: var(--radius); }
.skeleton-wrap { padding: var(--sp-2) var(--gutter); }
@keyframes lq-skeleton {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: lq-spin 0.8s linear infinite;
}
@keyframes lq-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.load-more { padding: var(--sp-2) var(--gutter); margin-bottom: var(--sp-3); text-align: center; font-size: 13px; color: var(--label-2); }

/* 列表首屏数据到达：只用 opacity 淡入，不做逐条飞入 */
.fade-in { animation: lq-fade-in 150ms ease-out both; }
@keyframes lq-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 行内提示条（警告类：系数版本混用、库存为 0、余额不足），不弹窗 */
.inline-tip {
  margin: 0 var(--gutter) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--orange-soft);
  color: var(--label);
  font-size: 15px;
  line-height: 1.4;
}
.inline-tip--red { background: var(--red-soft); }

/* ------------------------------------------------------------------ 11 浮层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}
.overlay__scrim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}
.overlay.is-open .overlay__scrim { opacity: 1; }

/* 底部弹层：从底部升起、回到底部 */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: var(--col);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0 var(--sp-4);
  border-radius: 16px 16px 0 0;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-float);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease-spring);
}
.overlay.is-open .sheet { transform: translateY(0); }
.sheet__grabber { flex: 0 0 auto; width: 36px; height: 5px; margin: 8px auto 4px; border-radius: 3px; background: var(--fill-strong); }
.sheet__title { flex: 0 0 auto; padding: var(--sp-2) 0 var(--sp-1); text-align: center; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--label); }
.sheet__message { flex: 0 0 auto; padding: 0 0 var(--sp-2); text-align: center; font-size: 13px; color: var(--label-2); }
.sheet__body { flex: 1 1 auto; min-height: 0; padding: var(--sp-2) 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet__footer { flex: 0 0 auto; }
.sheet__cancel { flex: 0 0 auto; margin-top: var(--sp-2); }
.sheet__safe { flex: 0 0 auto; height: calc(var(--sp-4) + var(--safe-bottom)); }
.sheet__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 var(--sp-4);
  border: 0;
  border-bottom: var(--hairline) solid var(--separator);
  background: transparent;
  color: var(--tint);
  font-size: 19px;
}
.sheet__action:last-child { border-bottom: 0; }
.sheet__action:active { background: var(--fill); }
.sheet__action.is-danger { color: var(--red-ink); }
.sheet__action[disabled] { opacity: 0.4; pointer-events: none; }

/* 对话框（alert / confirm） */
.overlay--center { display: flex; align-items: center; justify-content: center; padding: 0 32px; }
.modal {
  position: relative;
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-float);
  text-align: center;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.overlay.is-open .modal { opacity: 1; transform: scale(1); }
.modal__content { flex: 1 1 auto; min-height: 0; padding: 20px var(--sp-4) var(--sp-4); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; overflow-wrap: anywhere; }
.modal__title { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--label); }
.modal__body { margin-top: var(--sp-1); font-size: 15px; line-height: 1.4; color: var(--label); white-space: pre-wrap; }
.modal__actions { flex: 0 0 auto; display: flex; border-top: var(--hairline) solid var(--separator); }
.modal__actions.is-stack { display: block; }
.modal__btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  padding: 0 var(--sp-2);
  border: 0;
  background: transparent;
  color: var(--tint);
  font-size: 17px;
}
.modal__btn + .modal__btn { border-left: var(--hairline) solid var(--separator); }
.modal__actions.is-stack .modal__btn { display: block; width: 100%; border-left: 0; border-top: var(--hairline) solid var(--separator); }
.modal__actions.is-stack .modal__btn:first-child { border-top: 0; }
.modal__btn.is-strong { font-weight: 600; }
.modal__btn.is-danger { color: var(--red-ink); }
.modal__btn:active { background: var(--fill); }
.modal__btn:focus-visible, .sheet__action:focus-visible, .tabbar__item:focus-visible { outline-offset: -3px; }

/* toast */
.toast-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 88px);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
html.has-tabbar .toast-root { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-5)); }
.toast {
  display: flex;
  align-items: center;
  max-width: min(86vw, 360px);
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: 15px;
  line-height: 1.35;
  box-shadow: var(--shadow-float);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.toast.is-open { opacity: 1; transform: translateY(0); }
.toast__dot { flex: 0 0 auto; width: 8px; height: 8px; margin-right: var(--sp-2); border-radius: 50%; background: var(--green); }
.toast--error .toast__dot { background: var(--red); }
.toast--info .toast__dot { display: none; }

/* 全屏加载：先延迟 200ms 才显示，避免一闪而过 */
.loading-veil {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast) ease-out;
}
.loading-veil.is-open { opacity: 1; }
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  font-size: 15px;
}
.loading-box .spinner { width: 28px; height: 28px; border-width: 3px; }
.loading-box__text { margin-top: var(--sp-3); }

html.is-locked, html.is-locked body { overflow: hidden; }

/* ------------------------------------------------------------------ 12 底部操作栏 */
/* 固定在底部的主操作条（提交、兑换、发布）。用法：页面根节点加 .has-action-bar 给内容留位，再放 <div class="action-bar">…</div> */
.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: var(--col);
  z-index: 90;
  display: flex;
  align-items: center;
  padding: var(--sp-2) var(--gutter) calc(var(--sp-2) + var(--safe-bottom));
  background: var(--material-solid);
  box-shadow: 0 calc(-1 * var(--hairline)) 0 var(--separator);
}
.action-bar > .btn { flex: 1 1 0; min-width: 0; }
.action-bar > .btn + .btn { margin-left: var(--sp-3); }
.action-bar__info { flex: 1 1 auto; min-width: 0; margin-right: var(--sp-3); }
.action-bar__info + .btn { flex: 0 0 auto; width: auto; min-width: 120px; }
.has-action-bar { padding-bottom: calc(66px + var(--safe-bottom)); }

/* ------------------------------------------------------------------ 13 工具类 */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.flex { display: flex; }
.flex-1 { flex: 1 1 0; min-width: 0; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; grid-gap: var(--sp-3); }
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.mx-gutter { margin-left: var(--gutter); margin-right: var(--gutter); }
.p-gutter { padding-left: var(--gutter); padding-right: var(--gutter); }

/* ------------------------------------------------------------------ 14 减弱动效 */
@media (prefers-reduced-motion: reduce) {
  .overlay__scrim, .sheet, .modal, .toast, .loading-veil, .btn, .seg__block, .switch__track, .switch__track::after,
  .topbar__bg, .topbar__line, .topbar__title {
    transition: opacity 200ms ease !important;
    transform: none !important;
  }
  .overlay.is-open .sheet { transform: none !important; }
  .sheet { opacity: 0; }
  .overlay.is-open .sheet { opacity: 1; }
  .toast { transform: none !important; }
  .seg__block { transform: translateX(calc(var(--seg-index, 0) * 100%)) !important; }
  .switch__input:checked + .switch__track::after { transform: translateX(20px) !important; }
  .skeleton, .fade-in, .page--enter { animation: none !important; }
  .btn:active, .btn.is-pressed { transform: none !important; }
}

/* ------------------------------------------------------------------ 15 首页与登录页（外壳自带的两个页面） */
.overview { margin: var(--sp-1) var(--gutter) var(--sp-3); padding: var(--sp-3); }
.overview__title { margin-bottom: var(--sp-2); font-size: 13px; color: var(--label-2); }
.overview__btn { margin-top: var(--sp-3); }
.overview__error { color: var(--orange-ink); font-size: 16px; line-height: 1.4; }
.overview__guide { color: var(--label-2); font-size: 16px; line-height: 1.4; }
.overview .stat-row > .stat--wide { flex: 1.6 1 0; }
.entries { display: flex; padding: 0 var(--gutter); margin-bottom: var(--sp-5); }
.entry {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--tap);
  padding: var(--sp-3);
  border-radius: var(--radius);
  background: var(--tint-soft);
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}
.entry + .entry { margin-left: var(--sp-2); }
.entry:active { opacity: 0.7; }
.entry__title { color: var(--tint); font-size: 17px; font-weight: 600; line-height: 1.35; }
.entry__sub { margin-top: 2px; color: var(--label-2); font-size: 13px; line-height: 1.35; }
.ann { display: block; cursor: pointer; }
.ann__title { min-width: 0; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.ann__body { margin-top: var(--sp-1); color: var(--label-2); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.ann__date { margin-top: var(--sp-1); color: var(--label-2); font-size: 12px; font-weight: 500; }
.login-hero { padding: var(--sp-5) var(--gutter) var(--sp-3); }
.login-hero__title { font-size: 34px; font-weight: 700; line-height: 1.12; letter-spacing: -0.02em; }
.login-hero__text { margin-top: var(--sp-2); color: var(--label-2); font-size: 16px; line-height: 1.4; }
.login-version { padding: var(--sp-4) var(--gutter); text-align: center; color: var(--label-3); font-size: 12px; }

.fellow-pill { display: inline-block; margin-left: var(--sp-2); padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 18px; font-weight: 600; vertical-align: middle; color: var(--fellow-ink); background: linear-gradient(135deg, var(--fellow-hi), var(--fellow-lo)); box-shadow: inset 0 0 0 1px rgba(122, 79, 0, 0.35); }
.fellow-pill[data-fellow="名譽會士"] { background: linear-gradient(135deg, var(--honorary-hi), var(--honorary-lo)); color: var(--honorary-ink); box-shadow: inset 0 0 0 1px rgba(44, 52, 64, 0.3); }
.medal-chips { display: inline-flex; align-items: center; margin-left: var(--sp-2); vertical-align: middle; }
.medal-summary { display: flex; align-items: center; margin-top: var(--sp-2); }
.medal-summary > * + * { margin-left: var(--sp-2); }
.medal-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-right: 4px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--medal-bronze-ink); }
.medal-chip--gold { background: radial-gradient(circle at 35% 30%, var(--medal-gold-hi), var(--medal-gold) 60%, var(--medal-gold-lo)); color: var(--medal-gold-ink); }
.medal-chip--silver { background: radial-gradient(circle at 35% 30%, var(--medal-silver-hi), var(--medal-silver) 60%, var(--medal-silver-lo)); color: var(--medal-silver-ink); }
.medal-chip--bronze { background: radial-gradient(circle at 35% 30%, var(--medal-bronze-hi), var(--medal-bronze) 60%, var(--medal-bronze-lo)); color: var(--medal-bronze-ink); }
.medal-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); padding: 0 var(--gutter) var(--sp-3); }
.medal-tile { text-align: center; min-width: 0; }
.medal-tile__disc { width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.35); }
.medal-tile--gold .medal-tile__disc { background: radial-gradient(circle at 35% 30%, var(--medal-gold-hi), var(--medal-gold) 60%, var(--medal-gold-lo)); }
.medal-tile--silver .medal-tile__disc { background: radial-gradient(circle at 35% 30%, var(--medal-silver-hi), var(--medal-silver) 60%, var(--medal-silver-lo)); }
.medal-tile--bronze .medal-tile__disc { background: radial-gradient(circle at 35% 30%, var(--medal-bronze-hi), var(--medal-bronze) 60%, var(--medal-bronze-lo)); }
.medal-tile__tier { font-size: 12px; font-weight: 700; line-height: 1.25; padding: 0 6px; color: var(--medal-gold-ink); }
.medal-tile--bronze .medal-tile__tier, .medal-tile--silver .medal-tile__tier { color: var(--medal-silver-ink); }
.medal-tile__name { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--label-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.medal-tile__year { font-size: 11px; color: var(--label-3); }

.flag { display: inline-block; margin-left: 4px; font-size: 14px; line-height: 1; vertical-align: middle; }
.avatar { position: relative; }
.avatar-flag { position: absolute; right: -4px; bottom: -4px; font-size: 13px; line-height: 1; border-radius: 50%; }

.medal-coin { display: block; width: 84px; height: 84px; margin: 0 auto; padding: 0; border: 0; background: none; border-radius: 50%; perspective: 600px; cursor: pointer; }
.medal-coin__inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s; }
.medal-coin.is-flipped .medal-coin__inner { transform: rotateY(180deg); }
.medal-coin__face { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.medal-coin__face--back { transform: rotateY(180deg); }
.medal-coin__face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.medal-tile--gold .medal-coin__face { box-shadow: 0 0 0 3px var(--medal-gold), 0 2px 6px rgba(0, 0, 0, 0.3); }
.medal-tile--silver .medal-coin__face { box-shadow: 0 0 0 3px var(--medal-silver), 0 2px 6px rgba(0, 0, 0, 0.3); }
.medal-tile--bronze .medal-coin__face { box-shadow: 0 0 0 3px var(--medal-bronze), 0 2px 6px rgba(0, 0, 0, 0.3); }
.medal-tile__tierline { margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--label-2); }
@media (prefers-reduced-motion: reduce) { .medal-coin__inner { transition: none; } }

.medal-case { position: relative; margin: var(--sp-3) var(--gutter); padding: var(--sp-4) var(--sp-3) var(--sp-5); border-radius: 20px; overflow: hidden; color: var(--wall-text); background: radial-gradient(ellipse at 50% -8%, var(--wall-spot), transparent 58%), linear-gradient(180deg, var(--wall-top), var(--wall-bottom)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.medal-case::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 14% 18%, var(--wall-dim), transparent), radial-gradient(1px 1px at 72% 12%, var(--wall-dim), transparent), radial-gradient(1.5px 1.5px at 40% 36%, var(--wall-dim), transparent), radial-gradient(1px 1px at 88% 44%, var(--wall-dim), transparent), radial-gradient(1px 1px at 8% 66%, var(--wall-dim), transparent), radial-gradient(1.5px 1.5px at 58% 78%, var(--wall-dim), transparent); opacity: 0.55; pointer-events: none; }
.medal-case__title { position: relative; padding: 0 var(--sp-1) var(--sp-3); font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--wall-gold-text); }
.medal-case .medal-wall { position: relative; padding: 0; gap: var(--sp-4) var(--sp-2); }
.medal-case .medal-tile__name { color: var(--wall-text); }
.medal-case .medal-tile__year { color: var(--wall-dim); }
.medal-case .medal-tile__tierline { color: var(--wall-gold-text); letter-spacing: 0.5px; }
.medal-case .medal-tile { position: relative; padding-bottom: 10px; animation: medal-float 6s ease-in-out infinite; }
.medal-case .medal-tile:nth-child(3n+2) { animation-delay: -2s; }
.medal-case .medal-tile:nth-child(3n) { animation-delay: -4s; }
.medal-case .medal-tile::after { content: ""; position: absolute; left: 50%; top: 78px; width: 70px; height: 12px; margin-left: -35px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 70%); filter: blur(2px); z-index: 0; }
.medal-case .medal-coin { position: relative; z-index: 1; }
.medal-case .medal-coin::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; z-index: -1; background: radial-gradient(circle, var(--medal-glow-gold), transparent 68%); }
.medal-case .medal-tile--silver .medal-coin::before { background: radial-gradient(circle, var(--medal-glow-silver), transparent 68%); }
.medal-case .medal-tile--bronze .medal-coin::before { background: radial-gradient(circle, var(--medal-glow-bronze), transparent 68%); }
.medal-case .medal-coin__face { box-shadow: 0 0 0 2px var(--medal-gold), 0 6px 14px rgba(0, 0, 0, 0.55); }
.medal-case .medal-tile--silver .medal-coin__face { box-shadow: 0 0 0 2px var(--medal-silver), 0 6px 14px rgba(0, 0, 0, 0.55); }
.medal-case .medal-tile--bronze .medal-coin__face { box-shadow: 0 0 0 2px var(--medal-bronze), 0 6px 14px rgba(0, 0, 0, 0.55); }
.medal-case .medal-coin__face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: linear-gradient(130deg, var(--medal-shine) 0%, transparent 38%, transparent 62%, var(--medal-shine) 100%); mix-blend-mode: soft-light; }
.medal-case .medal-tile__disc { position: relative; z-index: 1; }
@keyframes medal-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .medal-case .medal-tile { animation: none; } }

.medal-coin--plaque { width: 62px; height: 84px; border-radius: 10px; }
.medal-coin--plaque .medal-coin__face, .medal-coin--plaque .medal-coin__face::after, .medal-case .medal-coin--plaque::before { border-radius: 10px; }
.medal-coin--plaque .medal-coin__face img { object-fit: contain; }

.jn-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0; }
.jn-choices--wrap { gap: 8px 12px; }
.jn-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; }
.jn-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--tint); }
.jn-choice--agree { padding: 8px 0; }
