/* ============================================================
   好好聊 · 组件层
   少即是多：每一个组件都必须对应一个真实动作
   ============================================================ */

/* ---------- 顶栏 ---------- */
.topbar {
  --topbar-side: clamp(80px, 23vw, 108px);
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: var(--topbar-side) minmax(0, 1fr) var(--topbar-side);
  align-items: center;
  min-height: calc(53px + env(safe-area-inset-top));
  margin-inline: calc(-1 * var(--screen-start)) calc(-1 * var(--screen-end));
  padding: env(safe-area-inset-top) var(--screen-end) 0 var(--screen-start);
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line);
}

.topbar__back {
  grid-area: 1 / 1;
  justify-self: start;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  margin-left: -6px;
  border-radius: var(--r-full);
  color: var(--fg-2);
  font-size: 28px;
  line-height: 1;
  transition: background var(--dur-1), color var(--dur-1);
}

.topbar__back:active {
  background: var(--surface-2);
  color: var(--fg);
}

.topbar__title {
  grid-area: 1 / 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.topbar__end { grid-area: 1 / 3; justify-self: end; }
.topbar__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -6px;
  border-radius: var(--r-full);
  font-size: 24px;
  line-height: 1;
}
.topbar__icon:is(:hover, :active) { background: var(--surface-2); }

/* ---------- 屏幕 ---------- */
/* ⚠️ 入场动画挂在**稳定的容器**（.view-host）上，不要挂在 .screen 上。
   .screen 会在页面局部重画时被整体替换（会员页切「按月/按年」、展开 FAQ），
   动画挂在它身上就每次从头重播 —— 弱网下整屏闪一下。
   .view-host 每次「真的换页」才换一个新节点，所以动画只在换页时播一次。 */
.view-host {
  animation: fadeIn var(--dur-1) var(--ease-out) both;
}

:root:has(#nav:empty) { --nav-offset: 0px; }
:root:has(#nav:not(:empty)) { --nav-offset: var(--nav-h); }

.screen {
  --screen-start: max(var(--sp-4), env(safe-area-inset-left));
  --screen-end: max(var(--sp-4), env(safe-area-inset-right));
  flex: 1;
  padding: 0 var(--screen-end) calc(var(--nav-offset, 0px) + env(safe-area-inset-bottom) + 24px) var(--screen-start);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
}

body:has(#app) .btn--primary {
  background: var(--accent);
  box-shadow: none;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1);
}
[data-theme="paper"] body:has(#app) .btn--primary { background: var(--accent-hi); }

.card--quiet {
  background: transparent;
  box-shadow: none;
}

.card--tap {
  transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-1);
}

.card--tap:active {
  transform: scale(0.985);
  border-color: var(--line-2);
}

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), opacity var(--dur-1),
    background var(--dur-1), border-color var(--dur-1);
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  box-shadow: 0 10px 26px -12px var(--accent-line);
}

.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--fg);
}

.btn--quiet {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg-2);
}

/* 危险动作（注销账号）—— 用 ember（风险色），别跟主色的「确认」混在一起 */
.btn--danger {
  box-shadow: 0 10px 26px -12px var(--ember-soft);
}

.btn--block { display: flex; width: 100%; }

/* ---------- 芯片 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  height: auto;
  padding: 0 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg-2);
  font-size: 13.5px;
  white-space: nowrap;
  transition: all var(--dur-1) var(--ease-out);
}

.chip:active { transform: scale(0.95); }

.chip[aria-pressed="true"],
.chip.is-on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-hi);
}

.chip--sm {
  min-height: 44px;
  height: auto;
  padding: 0 11px;
  font-size: 12.5px;
}

.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, #000 0 88%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0 88%, transparent 100%);
}

.chip-row::-webkit-scrollbar { display: none; }
.chip-row > .chip { scroll-snap-align: start; flex: none; }

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-xs);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  color: var(--fg-3);
  white-space: nowrap;
}

.tag--accent { background: var(--accent-soft); color: var(--accent-hi); }
.tag--ember { background: var(--ember-soft); color: var(--ember); }

/* ---------- 表单 ---------- */
.field { display: block; }
.field > .input,
.field > .textarea { display: block; }

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: 9px;
  font-size: 13px;
  color: var(--fg-3);
  letter-spacing: 0.03em;
}

.field__label b { color: var(--fg); font-weight: 500; font-size: 14px; }
.field__label em { color: var(--fg-4); font-style: normal; font-size: 12px; }
.field__hint { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--fg-4); }
.form-feedback { margin: 8px 0 0; font-size: 12.5px; line-height: 1.6; }
.form-feedback:empty { margin: 0; }
.contact-editor .field + .field { margin-top: var(--field-gap); }
.contact-familiarity-custom { margin-block: var(--sp-3) var(--field-gap); }
.contact-editor .contact-familiarity-custom[hidden] + .field { margin-top: var(--field-gap); }
.contact-editor #edit-save { margin-top: 20px; }
.screen--profile textarea.input,
.contact-editor textarea.input,
.report-form textarea.input { height: auto; }
.report-form .field + .field { margin-top: var(--field-gap); }
.profile-detail--privacy,
.profile-detail--report,
.report-form {
  display: flex;
  flex-direction: column;
}
.profile-detail--privacy,
.profile-detail--report { min-height: var(--visual-height, 100dvh); }
.report-form { flex: 1; margin-top: var(--sp-4); }
.page-end-action { margin-block-start: auto; padding-block-start: 32px; }

/* ---------- 折叠区 ---------- */
.more {
  margin-top: var(--sp-4);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
}

.more__sum {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--fg-2);
  cursor: pointer;
  list-style: none;
}

.more__sum::-webkit-details-marker { display: none; }
.more__sum::after {
  content: "";
  margin-inline-start: auto;
  transform: rotate(90deg);
}
details[open] > .more__sum::after { transform: rotate(-90deg); }
.more[open] > .more__sum { border-bottom: 1px solid var(--line-2); }

.more__body { padding: 14px; }
.more__body .field { margin-top: 0; }
.more__body .field + .field { margin-top: var(--field-gap); }
.profile__help { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--fg-2); }
.field + .profile__help { margin-top: 8px; }
.contact-editor > .more { margin-top: var(--field-gap); }
.contact-editor > #edit-save { margin-top: var(--sp-2); }

/* ---------- 登录 / 注册 ---------- */
.screen--auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px calc(env(safe-area-inset-bottom) + 30px);
}

.auth { width: 100%; max-width: 380px; }
.screen--login {
  align-items: flex-start;
  padding-top: calc(env(safe-area-inset-top) + clamp(32px, 9dvh, 84px));
}
.screen--login .auth__title {
  font-family: var(--font-body);
  font-size: 25px;
  font-weight: 600;
}
.screen--login .auth__mark { margin-bottom: 12px; }
.consent-content { margin: 16px auto 0; }
.profile-detail--consent:has(#cs-agree:not([hidden])) {
  display: flex;
  flex-direction: column;
  min-height: var(--visual-height, 100dvh);
  padding-bottom: calc(env(safe-area-inset-bottom) + clamp(24px, 6dvh, 56px));
}
.consent-content:has(#cs-agree:not([hidden])) {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.consent-actions {
  display: flow-root;
  margin-block-start: auto;
}

.auth__mark {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--accent-hi);
  margin-bottom: 20px;
}

.auth__title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth__sub,
.auth__pitch {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--fg-3);
  margin-bottom: 22px;
}
.auth__update-heading {
  margin-block: 14px 4px;
  color: var(--fg-2);
  font-size: 14px;
  font-weight: 600;
}
.auth__actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.auth__version { font-size: 12.5px; margin: 10px 0 0; }
.auth__actions > [hidden] { display: none; }
#au-form [hidden], #legal-retry[hidden] { display: none; }
.auth__demo {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.7;
}
.auth__demo h2 { font-size: 14px; }
.auth__demo p { margin-top: 6px; }

.auth .field { margin-bottom: var(--field-gap); }
.auth__policies { font-size: 12.5px; line-height: 1.7; color: var(--fg-3); }
.auth .auth__confirmation { margin-top: 18px; }
.auth__sms-status,
.auth__error { font-size: 12.5px; line-height: 1.6; }
.auth__sms-status { margin: 6px 0 0; color: var(--fg-3); }
.auth__error { margin: 0 0 8px; color: var(--ember); }
/* 空提示不占位，保留实时提示节点供读屏读取后续状态。 */
.auth__sms-status:empty,
.auth__error:empty { margin: 0; }
.auth #au-submit { margin-top: 24px; }

.auth__note {
  margin-top: 24px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--fg-4);
  text-align: center;
}

.input,
.textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 13px 14px;
  color: var(--fg);
  font-size: 16px;
  line-height: 1.6;
  transition: border-color var(--dur-1), background var(--dur-1);
}

.input::placeholder,
.textarea::placeholder { color: var(--fg-4); }

:is(input, textarea, select, button):is(.input, .textarea):focus {
  background: var(--surface-2);
  /* 描边贴在框内，避免滚动弹窗裁掉边缘。 */
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

:is(.input, .textarea)[aria-invalid="true"]:focus {
  outline-color: var(--ember);
}

.field > .contact-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: start;
}
.choice-row { min-height: 48px; }
.choice-row[aria-pressed="true"], .choice-row__mark { color: var(--accent-hi); }
.choice-row:active { background: var(--surface-2); }


.textarea {
  font-family: var(--font-body);
}

.textarea--chat { min-height: 132px; font-size: 16px; line-height: 1.75; }

/* ---------- 段落标题 ---------- */
.sec { margin-top: var(--sp-6); }

.sec__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sec__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

.sec__note {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--fg-3);
}

/* ---------- 底部导航 ---------- */
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: var(--shell);
  display: flex;
  justify-content: center;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
}

.nav:empty { display:none; }

.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--nav-h) - 1px);
  padding: 5px 0;
  color: var(--fg-4);
  border-radius: var(--r-md);
  transition: color var(--dur-1);
}

.nav__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.nav__notice {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: -9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.nav__item.is-on { color: var(--accent); }
.nav__item svg { width: 22px; height: 22px; stroke-width: 1.6; }

.nav__label {
  font-size: 12px;
  letter-spacing: 0.06em;
}

.nav__item.is-on .nav__label { color: var(--accent-hi); }

/* ---------- 弹层 ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--scrim);
  animation: fadeIn var(--dur-2) var(--ease-out) both;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 61;
  width: 100%;
  max-width: var(--shell);
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface-solid);
  border-radius: var(--r-md) var(--r-md) 0 0;
  border: 1px solid var(--line-2);
  border-bottom: none;
  padding: 10px var(--sp-4) calc(env(safe-area-inset-bottom) + var(--sp-5));
  box-shadow: var(--shadow-pop);
  animation: sheetUp var(--dur-3) var(--ease-out) both;
}

@keyframes sheetUp {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}

.sheet__grip {
  width: 38px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  margin: 4px auto 14px;
}

.sheet__title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: var(--sp-2);
}
.sheet__actions { margin-top: 18px; }

.sheet.sheet--signout {
  top: calc(var(--visual-top, 0px) + var(--visual-height, 100dvh) / 2);
  bottom: auto;
  width: min(320px, calc(100% - 32px));
  padding: 22px 0 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: fadeIn var(--dur-2) var(--ease-out) both;
}
.sheet--signout .sheet__grip,
.sheet--signout .sheet__body:empty { display: none; }
.sheet--signout .sheet__title { padding-inline: var(--sp-4); }
.sheet--signout .sheet__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.sheet--signout .sheet__actions > .btn {
  margin: 0;
  min-height: var(--control-height-lg);
  border: 0;
  border-radius: 0;
  background: transparent;
}
.sheet--signout .sheet__actions > .btn:active {
  background: var(--surface-2);
  transform: none;
}
.sheet--signout .sheet__actions > .btn:focus-visible { outline-offset: -3px; }
.sheet--signout .sheet__actions > .btn + .btn {
  border-inline-start: 1px solid var(--line);
  color: var(--ember);
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-offset, 0px) + env(safe-area-inset-bottom) + 22px);
  transform: translate(-50%, 12px);
  z-index: 80;
  width: max-content;
  max-width: min(calc(var(--shell) - 40px), calc(100vw - 32px));
  overflow-wrap: anywhere;
  padding: 11px 18px;
  border-radius: var(--r-full);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  font-size: 13.5px;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease-out);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 温度计 ---------- */
.meter {
  --pct: 50%;
  position: relative;
  height: 7px;
  border-radius: var(--r-full);
  background: linear-gradient(
    90deg,
    var(--dusk) 0%, var(--dusk) 18%,
    var(--sage) 46%, var(--accent) 74%, var(--ember) 100%
  );
  opacity: 0.9;
}

.meter__pin {
  position: absolute;
  top: 50%;
  left: var(--pct);
  width: 15px;
  height: 15px;
  border-radius: var(--r-full);
  background: var(--fg);
  border: 3px solid var(--bg-deep);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 16px 2px var(--accent-line);
  transition: left 900ms var(--ease-out);
}

/* ---------- 列表项 ---------- */
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.row:last-child { border-bottom: none; }
.row__icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--fg-3);
}
.row__main { flex: 1; min-width: 0; }

/* 危险行（注销账号）—— 标题用风险色，但别做得太刺眼，
   平时它在列表里只是「一眼能分辨」，不是「一直在喊」 */
.row--danger .row__title { color: var(--ember); }
.row--danger .row__sub { color: var(--fg-3); }

/* ---------- 单独同意勾选框（注册页） ---------- */
.au-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--fg-3);
  cursor: pointer;
}
.au-consent input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.auth__policies a { color: var(--accent-hi); }
.au-consent a {
  color: var(--fg-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.au-consent a:active, .auth__policies a:active { color: var(--accent-hi); }

/* ⚠️ 这两个必须 display:block —— 它们是 <span>，
   不显式声明的话会跟后面的内容挤在同一行
   （标题、副标题、状态全连成一句，读起来很难受）。 */
.row__title {
  display: block;
  font-size: 14.5px;
  color: var(--fg);
  line-height: 1.45;
}

.row__sub {
  display: block;
  font-size: 12.5px;
  color: var(--fg-3);
  margin-top: 3px;
  line-height: 1.5;
}
.cell-group {
  margin: 12px calc(-1 * var(--screen-end)) 0 calc(-1 * var(--screen-start));
  padding: 0;
  border-inline: 0;
  border-radius: 0;
  background: var(--surface-solid);
}
.settings-group__title { margin-top: 16px; color: var(--fg-3); font-size: 13px; font-weight: 500; }
.settings-group__title + .cell-group { margin-top: 6px; }
.cell-group > .row,
.about-section > .row {
  position: relative;
  min-height: 52px;
  padding-inline: var(--screen-start) var(--screen-end);
  border-bottom-color: transparent;
}
.cell-group > .row:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-inline: var(--screen-start) var(--screen-end);
  inset-block-end: -1px;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}
.cell-group > .row:active,
.about-section > .row:active,
.about-form .row:active { background: var(--surface-2); }
.cell-group > .row:focus-visible,
.about-section > .row:focus-visible,
.about-form .row:focus-visible { outline-offset: -2px; }
.profile-signout > .cell-group { margin-top: 32px; }
.profile-signout .row { justify-content: center; color: var(--ember); font-size: 16px; }
.profile-about { margin-top: 16px; }
.profile-about > .cell-group { margin-top: 16px; }
.about-form,
.about-form__fields,
.about-form__fields > .field + .field,
.about-samples { border-top: 1px solid var(--line); }
.about-section > .row {
  color: var(--fg);
  font-size: 14.5px;
}
.about-form {
  padding: 14px var(--screen-end) 14px var(--screen-start);
}
.about-form .input { border-color: transparent; }
.about-form__fields > .field { padding-block: 12px; }
.about-background > .row,
.about-form__action {
  min-height: 44px;
  border-block: 0;
  color: var(--fg);
  font-size: 14px;
}
.about-background > .row,
.about-form__action {
  margin-inline: calc(-1 * var(--screen-start)) calc(-1 * var(--screen-end));
  width: calc(100% + var(--screen-start) + var(--screen-end));
  padding-inline: var(--screen-start) var(--screen-end);
}
.about-background,
.about-form__action { border-top: 1px solid var(--line); }
.about-form__action { margin-top: 14px; }
.about-samples { padding-top: 12px; }
.about-samples > .profile__help { margin-bottom: 0; }
.about-samples__text { font-size: 14px; overflow-wrap: anywhere; }
.row__value { flex: none; color: var(--fg-3); font-size: 14px; }

.row__chev,
.more__sum::after {
  --chevron-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m6 4 4 4-4 4' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  display: block;
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--fg-3);
  background-color: currentColor;
  -webkit-mask: var(--chevron-shape) center / contain no-repeat;
  mask: var(--chevron-shape) center / contain no-repeat;
  forced-color-adjust: none;
}
.row__chev--external {
  --chevron-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 11l6-6M6 5h5v5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (forced-colors: active) {
  .row__chev,
  .more__sum::after { color: CanvasText; }
}

/* ---------- 删除按钮 ---------- */
/* ⚠️ 这个类以前**根本不存在** —— 「我的」页里的删除 × 是个没有样式的裸按钮，
   热区只有 9×24px，手机上根本点不中。
   视觉上要克制（一个小 ×），但热区必须够大：至少 44×44。
   做法：按钮本身 44×44，用负 margin 把它在视觉上「收」回去，
   旁边的行不会因为它被撑开。 */
.row__del {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -12px -8px 0;
  padding: 0;
  border: none;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--fg-4);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1),
    transform var(--dur-1) var(--ease-out);
}

.row__del:hover {
  color: var(--ember);
  background: var(--ember-soft);
}

.row__del:active {
  transform: scale(0.92);
}

/* ---------- 开关 ---------- */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-3);
  cursor: pointer;
}

.switch__box {
  width: 40px;
  height: 23px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  position: relative;
  transition: background var(--dur-2) var(--ease-out);
  flex: none;
}

.switch__box::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: var(--r-full);
  background: var(--fg-2);
  transition: transform var(--dur-2) var(--ease-soft), background var(--dur-2);
}

.switch[aria-checked="true"] .switch__box {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.switch[aria-checked="true"] .switch__box::after {
  transform: translateX(17px);
  background: var(--accent);
}

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--fg-3);
}

.empty__glyph {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 44px;
  color: var(--line-strong);
  margin-bottom: 10px;
}

/* ---------- 运营位：站内公告 / 维护提示 ---------- */

.ops-banner {
  align-items: start;
  gap: var(--sp-2);
  margin-inline: calc(-1 * var(--screen-start, 0px)) calc(-1 * var(--screen-end, 0px));
  padding-inline: var(--screen-start, 16px) var(--screen-end, 16px);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--fg-2);
  background: var(--surface);
}

.ops-banner:not([hidden]) { display: grid; }
.ops-banner--announcement {
  grid-template-columns: minmax(0, 1fr) auto;
}

.ops-banner__text { margin: 0; padding-block: 11px; }
.ops-banner__open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.ops-banner__open .ops-banner__text {
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ops-banner__icon { color: var(--fg-3); }
.announcement-detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.ops-banner__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
}
@media (hover: hover) {
  .ops-banner__close:hover { color: var(--fg); }
}
.ops-banner__open:focus-visible,
.ops-banner__close:focus-visible { outline-offset: -3px; }
.auth .ops-banner {
  margin: 0 0 var(--sp-4);
  padding-inline: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.auth .ops-banner:has(+ .ops-banner:not([hidden])) { margin-bottom: var(--sp-2); }

.ops-banner--announcement.ops-banner--warn {
  color: var(--accent-hi);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.ops-banner--warn .ops-banner__icon { color: inherit; }

.ops-banner--maintenance {
  grid-template-columns: auto minmax(0, 1fr);
}
.ops-banner__label {
  margin-block-start: 11px;
  padding-inline: 7px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  line-height: 21px;
  color: var(--ember);
  background: var(--ember-soft);
}

/* ---------- 《用户协议》《隐私政策》长文页 ---------- */
.screen--legal {
  min-height: 100dvh;
  padding-bottom: calc(env(safe-area-inset-bottom) + 40px);
}

.legal {
  max-width: 720px;
  margin: 0 auto;
  padding-top: var(--sp-4);
}

.legal__load {
  font-size: 13.5px;
  color: var(--fg-3);
  padding: var(--sp-5) 0;
}
.legal__load[hidden] { display: none; }

.legal__doc { font-size: 14px; line-height: 1.9; color: var(--fg-2); }

.legal__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--fg);
  margin: var(--sp-3) 0 4px;
}

.legal__ver {
  font-size: 12px;
  color: var(--fg-4);
  margin-bottom: var(--sp-4);
}

.legal__intro {
  padding: 14px 16px;
  border-left: 2px solid var(--accent-line);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--fg-2);
}

.legal__sec { margin-top: var(--sp-5); }

.legal__sec h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.legal__sec p { margin: 8px 0; }

.legal__sec ul {
  margin: 8px 0;
  padding-left: 20px;
}

.legal__sec li { margin: 6px 0; }

.legal__doc b { color: var(--fg); font-weight: 600; }
.legal__doc code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
}

/* 触屏按压只改透明度，不缩小命中区域。 */
@media (pointer:coarse) {
  .btn:active, .chip:active { transform:none; opacity:0.8; }
}

.redeem-history-pager { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding-top:14px; font-size:13px; color:var(--fg-2); }
.redeem-history-pager button { min-height:44px; }

/* 投诉与举报 */
.report-history-link {
  grid-area: 1 / 3;
  justify-self: end;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding-inline: var(--sp-2);
  color: var(--fg-2);
  white-space: nowrap;
}
.report-form__type {
  min-height: 48px;
  gap: var(--sp-2);
  margin-bottom: var(--field-gap);
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-solid);
}
.report-form__type:active { background: var(--surface-2); }
.report-form__type #rp-kind-value { text-align: right; }
#rp-order,
.report-form__attachments { margin-top: var(--field-gap); }
.report-form__attachments .field__hint { margin-block: var(--sp-1) var(--sp-2); }
.report-images { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.report-images:not(:empty) { margin-block-end: var(--sp-2); }
.report-image { display: flex; flex-direction: column; width: 76px; }
.report-image [data-preview] { width: 100%; height: 76px; padding: 0; border-radius: var(--r-md); }
.report-image img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.report-image__remove {
  min-height: 44px;
  border-radius: var(--r-md);
  color: var(--fg-2);
  font-size: 14px;
}
.report-image-preview { display: block; max-width: 100%; max-height: 65dvh; object-fit: contain; margin-inline: auto; }
.report-history { padding-block: var(--sp-4); }
.report-history__item:first-child { margin-top: 0; }
.report-history__item .more__sum { gap: var(--sp-2); }
.report-history__item .more__sum::after { margin-inline-start: 0; }
.report-history__item small { display: block; color: var(--fg-3); }
.report-history__state { margin-inline-start: auto; white-space: nowrap; }
.report-history__item .more__body > * + * { margin-top: var(--sp-2); }
.report-history__item [data-image] { margin-inline-end: var(--sp-2); }
.report-history__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.report-history__empty {
  max-width: 17rem;
  margin-inline: auto;
  padding-block: clamp(48px, 16dvh, 144px) 24px;
  text-align: center;
}
.report-history__empty-icon { display: block; width: 36px; height: 36px; margin: 0 auto 12px; color: var(--fg-4); }
.report-history__empty h2 { color: var(--fg-3); font-size: 16px; font-weight: 600; }
.report-history__empty p { margin-top: 6px; color: var(--fg-4); font-size: 14px; line-height: 1.6; }
.report-history__receipt { margin-block-end: var(--sp-3); overflow-wrap: anywhere; color: var(--fg-2); }
.report-history__receipt strong { color: var(--accent-hi); }
.report-history__reply { padding-block-start: var(--sp-2); border-top: 1px solid var(--line); }
.report-history__pager { display: flex; justify-content: space-between; margin-top: var(--sp-4); }
.report-image-consent { display: flex; align-items: baseline; gap: var(--sp-2); margin-top: var(--sp-2); }
.report-image-consent[hidden] { display: none; }
