:root {
  color-scheme: light;
  --canvas: oklch(97% 0.008 45);
  --surface: oklch(99% 0.004 45);
  --surface-2: oklch(94.5% 0.01 45);
  --ink: oklch(22% 0.018 255);
  --muted: oklch(52% 0.016 255);
  --faint: oklch(67% 0.012 255);
  --line: oklch(89% 0.012 45);
  --line-strong: oklch(81% 0.014 45);
  --accent: oklch(62% 0.2 24);
  --accent-hover: oklch(57% 0.2 24);
  --accent-soft: oklch(94% 0.035 24);
  --success: oklch(55% 0.13 150);
  --success-soft: oklch(95% 0.035 150);
  --warning: oklch(66% 0.13 75);
  --warning-soft: oklch(95% 0.04 75);
  --danger: oklch(54% 0.18 25);
  --danger-soft: oklch(95% 0.04 25);
  /* 收益分级只强调数值，色值保持小字号下的清晰对比。 */
  --yield-low: oklch(50% 0.15 250);
  --yield-medium: oklch(54% 0.16 55);
  --yield-high: var(--danger);
  --shadow: 0 18px 55px oklch(28% 0.025 255 / 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body.consumer-app {
  /* 外层与应用壳统一使用动态视口，避免移动浏览器工具栏展开时滚出底部空白。 */
  min-height: 100vh;
  min-height: 100dvh;
  touch-action: pan-x pan-y;
}

body.consumer-app.dashboard-active {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid oklch(62% 0.2 24 / 0.22);
  outline-offset: 2px;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.auth-screen {
  width: min(420px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 0 max(40px, env(safe-area-inset-bottom));
}

.auth-mark,
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  font-weight: 850;
}

.auth-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border-radius: 8px;
  font-size: 22px;
}

.auth-copy h1 {
  font-size: 24px;
  line-height: 1.2;
}

.auth-copy p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.code-form {
  margin-top: 26px;
}

.local-login {
  margin-top: 12px;
}

.auth-error {
  margin-top: 8px;
}

.turnstile-slot {
  min-height: 65px;
  overflow: hidden;
}

.code-sent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.code-sent-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.code-sent-row .text-button {
  flex: 0 0 auto;
}

.code-email-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
}

.auth-foot {
  margin-top: 28px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
}

.legal-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.legal-consent input {
  flex: 0 0 auto;
  width: 17px;
  min-height: 17px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.legal-consent span {
  display: inline;
}

.legal-consent a {
  color: var(--accent-hover);
  font-weight: 700;
}

.third-party-notice {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 12px 13px;
}

.third-party-notice strong {
  font-size: 12px;
}

.third-party-notice p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

label small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

textarea {
  min-height: 70px;
  padding: 8px;
  font-style: 12px;
  line-height: 1.55;
  resize: vertical;
}

@media (max-width: 767px) {
  /* iOS 会自动放大字号小于 16px 的文本控件。 */
  .consumer-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  .consumer-app select,
  .consumer-app textarea {
    font-size: 16px;
  }
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(62% 0.2 24 / 0.1);
}

input::placeholder,
textarea::placeholder {
  font-size: 12px;
  color: var(--faint);
}

.button,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
  transition: transform 140ms ease-out, border-color 140ms ease-out, background-color 140ms ease-out;
}

.button:hover {
  border-color: var(--muted);
}

.button:active {
  transform: translateY(1px);
}

.button:disabled,
.button[aria-disabled="true"],
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: oklch(98% 0.006 45);
}

.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.button.accent-light {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* 高影响批量操作保持克制，但与普通次要按钮有明确区分。 */
.button.danger {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.button.danger:hover {
  background: oklch(92% 0.055 25);
}

.button.subtle {
  border-color: transparent;
  background: var(--surface-2);
}

.button.full {
  width: 100%;
  min-height: 46px;
}

.button.loading {
  color: transparent;
  position: relative;
}

.button.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  color: var(--ink);
}

.button.primary.loading::after {
  color: oklch(98% 0.006 45);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.text-button {
  min-height: 32px;
  background: transparent;
  color: var(--accent-hover);
  padding: 0;
  font-weight: 700;
}

.danger-text {
  color: var(--danger);
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.user-shell {
  width: min(720px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(18px, env(safe-area-inset-top)) 20px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 7px;
  font-size: 17px;
}

.brand-lockup div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 17px;
}

.brand-lockup span:not(.brand-mark) {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.service-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.service-strip > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 18px;
  background: var(--surface);
}

.service-strip span {
  color: var(--muted);
  font-size: 11px;
}

.service-strip strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.state-inline i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.state-inline.running i {
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.renewal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 16px 0;
  padding: 13px 14px;
  border: 1px solid oklch(88% 0.06 75);
  border-radius: 7px;
  background: var(--warning-soft);
}

.compliance-strip {
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.renewal-banner > div {
  display: grid;
  gap: 3px;
}

.renewal-banner strong {
  font-size: 13px;
}

.renewal-banner span {
  color: var(--muted);
  font-size: 12px;
}

.product-section {
  padding: 22px 20px 0;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.section-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.section-toolbar h2 {
  font-size: 16px;
}

.section-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.product-list {
  display: grid;
}

.product-scroll {
  min-height: 0;
}

/* 手机首屏稳定展示四项，新增银行超出可用宽度后沿 X 轴滚动。 */
.bank-filter {
  display: grid;
  grid-auto-columns: calc((100% - 12px) / 4);
  grid-auto-flow: column;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 1px solid oklch(90% 0.012 24);
  border-radius: 999px;
  background: oklch(96% 0.012 24);
  padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.bank-filter::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.bank-filter-shell {
  position: relative;
  min-width: 0;
}

.product-section > .bank-filter-shell {
  margin-top: 14px;
}

.bank-filter-shell > .bank-filter {
  width: 100%;
}

/* 边缘渐隐和轻量箭头只提示滑动方向，不做成抢眼的悬浮按钮。 */
.bank-filter-cue {
  position: absolute;
  top: 1px;
  bottom: 1px;
  z-index: 2;
  display: flex;
  width: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: oklch(48% 0.025 255 / 0.78);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
}

.bank-filter-cue-left {
  left: 1px;
  background: linear-gradient(90deg, oklch(96% 0.012 24 / 0.98) 48%, oklch(96% 0.012 24 / 0));
}

.bank-filter-cue-right {
  right: 1px;
  background: linear-gradient(270deg, oklch(96% 0.012 24 / 0.98) 48%, oklch(96% 0.012 24 / 0));
}

.bank-filter-shell.can-scroll-left .bank-filter-cue-left,
.bank-filter-shell.can-scroll-right .bank-filter-cue-right {
  opacity: 1;
}

.bank-filter-button {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.bank-filter-button:hover {
  color: var(--ink);
}

.bank-filter-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.bank-filter-button.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px oklch(34% 0.025 255 / 0.09);
}

.bank-filter-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: oklch(90% 0.022 24);
  color: var(--muted);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.bank-filter-button.active .bank-filter-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.new-product-mode-notice {
  flex: 0 0 auto;
  min-height: 16px;
  margin: 5px 4px 0;
  overflow: hidden;
  color: oklch(46% 0.11 70);
  font-size: 11px;
  font-weight: 650;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-filter-empty {
  padding: 30px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bank-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

/* 银行标签保留文字识别，并使用固定低饱和色帮助快速扫视跨行产品。 */
.bank-badge[data-bank="BOC"] {
  border-color: oklch(82% 0.055 25);
  background: oklch(96% 0.025 25);
  color: oklch(45% 0.135 25);
}

.bank-badge[data-bank="CITIC"] {
  border-color: oklch(82% 0.055 235);
  background: oklch(96% 0.025 235);
  color: oklch(43% 0.12 235);
}

.bank-badge[data-bank="CCB"] {
  border-color: oklch(83% 0.05 275);
  background: oklch(96% 0.022 275);
  color: oklch(44% 0.115 275);
}

.bank-badge[data-bank="SPDB"] {
  border-color: oklch(82% 0.055 155);
  background: oklch(96% 0.025 155);
  color: oklch(43% 0.115 155);
}

.bank-badge[data-bank="NBCB"] {
  border-color: oklch(82% 0.055 75);
  background: oklch(96% 0.025 75);
  color: oklch(45% 0.12 75);
}

.bank-badge[data-bank="BOB"] {
  border-color: oklch(82% 0.05 330);
  background: oklch(96% 0.022 330);
  color: oklch(44% 0.11 330);
}

.bank-badge[data-bank="CIB"] {
  border-color: oklch(82% 0.055 205);
  background: oklch(96% 0.025 205);
  color: oklch(43% 0.115 205);
}

.bank-badge[data-bank="PSBC"] {
  border-color: oklch(82% 0.055 75);
  background: oklch(96% 0.025 75);
  color: oklch(45% 0.12 75);
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.product-main {
  min-width: 0;
}

.product-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.product-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.product-title-line h3 {
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-title-line > strong {
  color: var(--ink);
  font-size: 15px;
  white-space: nowrap;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 7px;
  color: var(--faint);
  font-size: 11px;
}

.product-yield {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-status-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 750;
}

.status-badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.warning {
  background: var(--warning-soft);
  color: oklch(53% 0.12 75);
}

.status-badge.error {
  background: var(--danger-soft);
  color: var(--danger);
}

.product-error {
  max-width: 100%;
  color: var(--danger);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.product-error.pending {
  color: oklch(53% 0.12 75);
}

.product-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.delete-button {
  color: var(--faint);
  font-size: 11px;
}

.switch {
  display: inline-block;
  position: relative;
  font-size: 0;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  display: block;
  width: 40px;
  height: 23px;
  border-radius: 999px;
  background: oklch(83% 0.012 255);
  cursor: pointer;
  transition: background-color 160ms ease-out;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 7px oklch(25% 0.02 255 / 0.22);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(17px);
}

.switch input:focus-visible + span {
  outline: 3px solid oklch(62% 0.2 24 / 0.2);
  outline-offset: 2px;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 54px 24px;
  text-align: center;
}

.empty-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 15px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
  font-size: 23px;
}

.empty-state strong {
  font-size: 15px;
}

.empty-state p {
  max-width: 280px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.bottom-spacer {
  height: 102px;
}

.monitor-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(720px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px;
  align-items: center;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -12px 36px oklch(28% 0.025 255 / 0.08);
}

.monitor-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.monitor-summary span {
  font-size: 13px;
  font-weight: 750;
}

.monitor-summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monitor-button {
  min-height: 46px;
}

.monitor-button.stop {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--danger);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: oklch(18% 0.02 255 / 0.36);
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(620px, 100%);
  max-height: min(82vh, 760px);
  overflow-y: auto;
  transform: translateX(-50%);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}

/* 公告是登录后的短时阻断信息，采用居中对话框并限制富文本尺寸。 */
.announcement-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(520px, calc(100% - 32px));
  max-height: min(78vh, 680px);
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.announcement-dialog .sheet-head {
  flex: 0 0 auto;
  margin-bottom: 16px;
}

.announcement-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.announcement-content > :first-child {
  margin-top: 0;
}

.announcement-content > :last-child {
  margin-bottom: 0;
}

.announcement-content h1,
.announcement-content h2,
.announcement-content h3,
.announcement-content h4 {
  margin: 18px 0 8px;
  line-height: 1.4;
}

.announcement-content h1 { font-size: 20px; }
.announcement-content h2 { font-size: 18px; }
.announcement-content h3,
.announcement-content h4 { font-size: 16px; }

.announcement-content p,
.announcement-content ul,
.announcement-content ol,
.announcement-content blockquote,
.announcement-content pre,
.announcement-content table {
  margin: 10px 0;
}

.announcement-content ul,
.announcement-content ol {
  padding-left: 22px;
}

.announcement-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.announcement-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.announcement-content blockquote,
.announcement-content pre {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 10px 12px;
}

.announcement-content pre,
.announcement-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.announcement-content pre {
  overflow-x: auto;
  white-space: pre-wrap;
}

.announcement-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.announcement-content th,
.announcement-content td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  white-space: nowrap;
}

.announcement-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  /* 长公告只滚动正文，确认按钮始终保留在公告底部。 */
}

/* 产品少时抽屉按内容收缩，超出屏幕时只滚动目录列表。 */
#productSheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#productSheet > .sheet-head {
  flex: 0 0 auto;
}

#productSheet > .catalog-picker {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  /* 银行筛选、搜索和排序固定，目录列表占据最后的可收缩滚动轨道。 */
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

#productSheet .catalog-scroll {
  /* 自主添加展开时允许目录随剩余空间收缩，避免列表覆盖后续操作区。 */
  min-height: 0;
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#productSheet .catalog-options {
  align-content: start;
}

.catalog-more-loading {
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.catalog-refreshing {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  margin: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  box-shadow: 0 2px 8px oklch(34% 0.025 255 / 0.12);
}

.catalog-options.is-refreshing {
  opacity: 0.58;
  pointer-events: none;
}

#productSheet > .custom-product-section {
  flex: 0 0 auto;
}

#productSheet > #addCatalogProductsBtn {
  flex: 0 0 auto;
  margin-top: 8px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.sheet-head h2 {
  margin-top: 3px;
  font-size: 19px;
}

.sheet-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.close-sheet {
  font-size: 24px;
  font-weight: 400;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.notification-modes {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  border: 0;
  padding: 0;
}

/* 渠道差异提示随选择切换，使用弱化文字避免抢占表单重点。 */
.notification-modes .channel-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* 最低额度紧跟 Bark 地址展示，同时与通知方式保持清晰分组。 */
.minimum-quota-field {
  margin-top: 16px;
}

.notification-modes legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.mode-option {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 9px 11px;
  cursor: pointer;
}

.mode-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mode-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.mode-option span {
  display: grid;
  gap: 2px;
}

.mode-option strong {
  color: var(--ink);
  font-size: 13px;
}

.mode-option small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.alert-fields {
  margin-top: 16px;
}

#volumeField {
  grid-column: 1 / -1;
  grid-template-columns: 1fr auto;
  align-items: center;
}

#volumeField input {
  grid-column: 1;
  min-height: 28px;
  padding: 0;
}

#volumeField output {
  grid-column: 2;
  grid-row: 2;
  min-width: 30px;
  color: var(--ink);
  text-align: right;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.sheet-actions + .text-button {
  margin-top: 13px;
}

.catalog-picker,
.custom-product-body {
  display: grid;
  gap: 14px;
}

.catalog-picker-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.catalog-picker-title {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.catalog-picker-head strong {
  font-size: 14px;
}

.catalog-picker-head small {
  color: var(--muted);
  font-size: 11px;
}

.catalog-sort-field {
  min-width: 0;
  overflow: hidden;
}

.catalog-sort-options {
  display: flex;
  min-width: max-content;
  overflow-x: auto;
  padding: 2px 4px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.catalog-sort-options::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.catalog-sort-option {
  flex: 0 0 auto;
  height: 18px;
  line-height: 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-sort-option.active {
  background: var(--accent);
  color: var(--surface);
}

.catalog-added-filter {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 18px;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.catalog-added-filter input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

/* 排序属于中性浏览操作，聚焦态不能与珊瑚色的提醒或校验失败混淆。 */
.catalog-sort-option:focus-visible {
  outline: 2px solid oklch(22% 0.018 255 / 0.24);
  outline-offset: 2px;
}

/* 添加抽屉的银行筛选与参考标签一致，选中项使用实心强调，未选项保持轻量文字。 */
#productSheet #catalogBankFilter .bank-filter-button.active {
  background: var(--accent);
  color: var(--surface);
  box-shadow: none;
}

#productSheet #catalogBankFilter .bank-filter-button.active .bank-filter-count {
  background: var(--surface);
  color: var(--accent);
}

.catalog-options {
  display: grid;
  border-top: 1px solid var(--line);
}

.catalog-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 9px 2px;
  cursor: pointer;
}

.catalog-option input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.catalog-option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.catalog-option-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.catalog-option-side {
  display: grid;
  min-width: 76px;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

/* 产品名称完整换行展示，避免较长名称在添加列表中被省略。 */
.catalog-option-name strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.catalog-option small,
.catalog-option em,
.catalog-empty {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

/* 最近查询摘要保持单行，避免额度和时间增加目录行高度。 */
.catalog-option-query {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--faint);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-option-query.success {
  color: var(--success);
}

.catalog-option-query.pending {
  color: oklch(53% 0.12 75);
}

.catalog-option-query.error {
  color: var(--danger);
}

.catalog-option-yield {
  display: block;
  max-width: 100%;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.catalog-empty {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.custom-product-section {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.custom-product-summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.custom-product-summary::-webkit-details-marker {
  display: none;
}

.custom-product-summary > span:first-child {
  display: grid;
  gap: 3px;
}

.custom-product-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.custom-product-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.disclosure-icon {
  color: var(--muted);
  font-size: 18px;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.custom-product-section[open] .disclosure-icon {
  transform: rotate(180deg);
}

.custom-product-body {
  margin-top: 14px;
}

.preview-block {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

#productForm {
  display: grid;
  gap: 16px;
}

.preview-block > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.preview-block > strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  line-height: 1.45;
}

.preview-block dl {
  margin: 14px 0 18px;
}

.preview-block dl > div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.preview-block dt {
  color: var(--muted);
  font-size: 12px;
}

.preview-block dd {
  overflow-wrap: anywhere;
  font-size: 12px;
  text-align: right;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  padding: 11px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

/* C 端强调状态和核心操作，使用轻量分隔减少移动端的卡片堆叠感。 */
.consumer-app {
  background: var(--canvas);
  box-shadow: inset 0 4px 0 var(--surface-2);
}

.consumer-app .auth-screen {
  width: min(392px, calc(100vw - 40px));
  justify-content: center;
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.consumer-app .auth-copy {
  position: relative;
  padding-top: 18px;
}

.consumer-app .auth-copy::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.consumer-app .auth-copy h1 {
  font-size: 22px;
  line-height: 1.25;
}

.consumer-app .auth-copy p {
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.consumer-app .auth-form {
  gap: 11px;
  margin-top: 26px;
}

.consumer-app .code-form {
  margin-top: 22px;
}

.consumer-app .auth-form > label:not(.legal-consent) {
  color: var(--ink);
  font-size: 12px;
}

.consumer-app .auth-form > input {
  min-height: 50px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 1px 0 oklch(28% 0.02 255 / 0.03);
}

.consumer-app .auth-form .button.full {
  min-height: 48px;
}

.consumer-app .turnstile-slot {
  display: grid;
  min-height: 46px;
  align-items: center;
  overflow: visible;
}

.consumer-app .turnstile-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.consumer-app .turnstile-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.consumer-app .turnstile-slot.loaded .turnstile-loading,
.consumer-app .turnstile-slot.load-error .turnstile-loading {
  display: none;
}

.consumer-app .turnstile-slot.loaded {
  min-height: 65px;
}

.consumer-app .turnstile-slot.loaded.compact {
  min-height: 0;
}

.consumer-app .turnstile-slot.loaded.compact > div {
  height: 0;
  min-height: 0;
  overflow: hidden;
}

.consumer-app .code-sent-row {
  align-items: flex-start;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
}

.consumer-app .legal-consent {
  margin-top: 1px;
}

.consumer-app .auth-error:empty {
  min-height: 0;
  margin-top: 0;
}

.consumer-app .third-party-notice {
  margin-top: 18px;
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  padding: 1px 0 1px 12px;
}

.consumer-app .third-party-notice strong {
  color: var(--muted);
  font-size: 11px;
}

.consumer-app .third-party-notice p {
  margin-top: 3px;
  color: var(--faint);
  line-height: 1.55;
}

.consumer-app .auth-foot {
  margin-top: 12px;
  line-height: 1.5;
}

.consumer-app .user-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.consumer-app .account-bar {
  min-height: 56px;
  flex: 0 0 auto;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 10px;
  background: var(--surface);
}

.consumer-app .brand-lockup strong {
  font-size: 15px;
}

.consumer-app .brand-lockup span:not(.brand-mark) {
  max-width: 420px;
  font-size: 11px;
}

.consumer-app .header-actions {
  gap: 2px;
}

.consumer-app .header-actions .button.subtle {
  min-height: 36px;
  background: transparent;
}

/* 公告入口用小面积品牌色提示，不增加标题栏高度。 */
.consumer-app .announcement-trigger {
  min-height: 36px;
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 0 9px;
  font-size: 12px;
}

.consumer-app .announcement-trigger:hover {
  border-color: oklch(89% 0.065 24);
  background: oklch(92% 0.05 24);
}

.consumer-app .header-actions .icon-button {
  min-width: 36px;
  height: 36px;
}

.consumer-app .service-strip {
  grid-template-columns: 1.3fr 1fr 0.7fr;
  gap: 0;
  flex: 0 0 auto;
  border-bottom: 0;
  background: var(--surface-2);
  padding: 0 20px;
}

.consumer-app .service-strip > div {
  position: relative;
  gap: 3px;
  padding: 10px 14px;
  background: transparent;
}

.consumer-app .service-strip > div:first-child {
  padding-left: 0;
}

.consumer-app .service-strip > div:last-child {
  padding-right: 0;
}

.consumer-app .service-strip > div + div::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 1px;
  background: var(--line);
}

.consumer-app .service-strip span {
  color: var(--faint);
  font-size: 10px;
}

.consumer-app .service-strip strong {
  font-size: 12px;
}

.consumer-app .state-inline i {
  width: 6px;
  height: 6px;
}

.consumer-app .compliance-strip {
  flex: 0 0 auto;
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 0;
  background: var(--surface);
  color: var(--faint);
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consumer-app .renewal-banner {
  min-height: 32px;
  flex: 0 0 auto;
  flex-direction: row;
  margin-top: 6px;
  margin-right: 20px;
  margin-left: 20px;
  padding: 5px 9px;
}

.consumer-app .renewal-banner > div {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
}

.consumer-app .renewal-banner strong,
.consumer-app .renewal-banner span {
  white-space: nowrap;
}

.consumer-app .renewal-banner strong {
  font-size: 11px;
}

.consumer-app .renewal-banner span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

.consumer-app .renewal-banner.renewal-compact {
  min-height: 28px;
  border-color: oklch(89% 0.045 75);
  padding-top: 4px;
  padding-bottom: 4px;
}

.consumer-app .renewal-banner .text-button {
  min-height: 24px;
  font-size: 10px;
}

.consumer-app .product-section {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow: hidden;
  padding-top: 10px;
}

.consumer-app .section-toolbar {
  flex: 0 0 auto;
  align-items: center;
  padding-bottom: 8px;
}

.consumer-app .section-toolbar h2 {
  font-size: 15px;
}

.consumer-app .section-toolbar .accent-light {
  min-height: 36px;
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.consumer-app #productBankFilter {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 3px;
}

.consumer-app .product-section > .bank-filter-shell {
  flex: 0 0 auto;
  margin-top: 8px;
}

.consumer-app #productBankFilter .bank-filter-button {
  min-height: 26px;
  gap: 4px;
  padding-right: 6px;
  padding-left: 6px;
  font-size: 12px;
}

.consumer-app #productBankFilter .bank-filter-count {
  min-width: 20px;
  height: 20px;
  padding-right: 5px;
  padding-left: 5px;
  font-size: 10px;
}

.consumer-app .product-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.consumer-app .product-row {
  min-height: 112px;
  align-items: center;
  padding: 10px 0;
}

.consumer-app .product-title-line h3 {
  font-size: 14px;
}

.consumer-app .product-title-line > strong {
  color: var(--accent-hover);
  font-size: 14px;
}

.consumer-app .product-meta {
  margin-top: 6px;
}

.consumer-app .status-badge {
  min-height: 22px;
  border-radius: 5px;
  padding: 0 7px;
}

.consumer-app .product-controls {
  min-width: 92px;
  justify-content: flex-end;
}

.consumer-app .delete-button {
  min-width: 40px;
}

.consumer-app .empty-state {
  min-height: 100%;
  align-content: center;
  padding-top: 34px;
  padding-bottom: 44px;
}

.consumer-app .empty-symbol {
  width: 40px;
  height: 40px;
  margin-bottom: 13px;
  border-radius: 7px;
  background: var(--surface-2);
  font-size: 20px;
}

.consumer-app .monitor-bar {
  position: static;
  left: auto;
  bottom: auto;
  width: 100%;
  flex: 0 0 auto;
  transform: none;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 28px oklch(28% 0.025 255 / 0.07);
}

.consumer-app .bottom-spacer {
  display: none;
}

.consumer-app .monitor-summary span {
  font-size: 12px;
}

.consumer-app .monitor-button {
  min-height: 44px;
}

.consumer-app .sheet {
  padding-top: 18px;
}

/* 设置抽屉使用紧凑分段控件，让窄屏一次看到完整配置和提交按钮。 */
.consumer-app #settingsSheet {
  max-height: calc(100dvh - max(28px, env(safe-area-inset-top)));
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}

.consumer-app #settingsSheet > .sheet-head {
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
}

.consumer-app #settingsSheet .sheet-head h2 {
  margin-top: 0;
  font-size: 17px;
}

.consumer-app #settingsSheet .close-sheet {
  min-width: 32px;
  height: 32px;
  font-size: 20px;
}

.consumer-app #settingsForm > label {
  gap: 4px;
  font-size: 12px;
}

.consumer-app #settingsForm label small {
  font-size: 10px;
  line-height: 1.35;
}

.consumer-app #settingsForm input:not([type="radio"]):not([type="range"]),
.consumer-app #settingsForm select {
  min-height: 38px;
}

.consumer-app #settingsForm .minimum-quota-field {
  margin-top: 10px;
}

.consumer-app #settingsForm .notification-behavior-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  cursor: pointer;
}

.consumer-app #settingsForm .notification-behavior-toggle > .notification-behavior-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 3px;
  min-width: 0;
}

.consumer-app #settingsForm .notification-behavior-toggle > .switch {
  flex: 0 0 auto;
}

.consumer-app #settingsForm .notification-behavior-toggle .switch input {
  width: 1px;
  min-height: 1px;
}

.consumer-app #settingsForm .notification-behavior-toggle strong {
  font-size: 12px;
}

.consumer-app #settingsForm .notification-behavior-toggle small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.consumer-app #settingsSheet .notification-modes {
  display: block;
  margin-top: 10px;
}

.consumer-app #settingsSheet .notification-modes legend {
  margin-bottom: 6px;
  font-size: 12px;
}

.consumer-app #settingsSheet .notification-mode-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.consumer-app #settingsSheet .mode-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 4px;
}

.consumer-app #settingsSheet .mode-option:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(62% 0.2 24 / 0.1);
}

.consumer-app #settingsSheet .mode-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.consumer-app #settingsSheet .mode-option span {
  display: block;
}

.consumer-app #settingsSheet .mode-option strong {
  font-size: 12px;
  white-space: nowrap;
}

.consumer-app #settingsSheet .alert-fields {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 10px;
  margin-top: 10px;
}

.consumer-app #settingsSheet #volumeField {
  grid-column: auto;
  gap: 4px;
}

.consumer-app #settingsSheet #volumeField input {
  min-height: 24px;
}

.consumer-app #settingsSheet #volumeField output {
  font-size: 12px;
}

.consumer-app #settingsSheet .sheet-actions {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.consumer-app #settingsSheet .sheet-actions .button {
  min-height: 38px;
  padding: 0 8px;
  font-size: 12px;
}

.consumer-app #settingsSheet .sheet-actions + .text-button {
  margin-top: 8px;
  font-size: 12px;
}

/* 添加产品抽屉优先给目录列表留空间，小屏也能连续浏览更多产品。 */
.consumer-app #productSheet {
  max-height: calc(100dvh - max(28px, env(safe-area-inset-top)));
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
}

/* 目录多时提供确定高度，才能让列表收缩滚动而不把底部批量添加按钮裁掉。 */
.consumer-app #productSheet.catalog-has-scroll {
  height: calc(100dvh - max(28px, env(safe-area-inset-top)));
}

.consumer-app #productSheet > .sheet-head {
  margin-bottom: 10px;
  padding-bottom: 9px;
}

.consumer-app #productSheet .sheet-kicker {
  font-size: 10px;
}

.consumer-app #productSheet .sheet-head h2 {
  margin-top: 1px;
  font-size: 17px;
}

.consumer-app #productSheet .close-sheet {
  min-width: 34px;
  height: 34px;
  font-size: 21px;
}

.consumer-app #productSheet .catalog-picker {
  gap: 8px;
}

.consumer-app #productSheet .catalog-picker-head strong {
  font-size: 13px;
}

.consumer-app #productSheet .catalog-picker-head small {
  font-size: 10px;
}

.consumer-app #productSheet .catalog-sort-option {
  font-size: 10px;
}

.consumer-app #productSheet .catalog-added-filter {
  font-size: 10px;
}

.consumer-app #productSheet > #addCatalogProductsBtn {
  min-height: 36px;
  margin-top: 6px;
}

.consumer-app #catalogBankFilter {
  padding: 3px;
}

.consumer-app #catalogBankFilter .bank-filter-button {
  min-height: 26px;
  gap: 4px;
  padding-right: 6px;
  padding-left: 6px;
  font-size: 12px;
}

.consumer-app #catalogBankFilter .bank-filter-count {
  min-width: 20px;
  height: 20px;
  padding-right: 5px;
  padding-left: 5px;
  font-size: 10px;
}

/* 搜索框压缩高度，为小屏目录列表保留更多浏览空间。 */
.consumer-app #productSheet .catalog-search {
  height: 28px;
  min-height: 28px;
  font-size: 12px;
}

.consumer-app #productSheet .catalog-option {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 44px;
  padding: 5px 2px;
}

.consumer-app #productSheet .catalog-option input {
  width: 16px;
  min-height: 16px;
}

.consumer-app #productSheet .catalog-option-name strong {
  font-size: 12px;
}

.consumer-app #productSheet .catalog-option small,
.consumer-app #productSheet .catalog-option em {
  font-size: 10px;
}

.consumer-app #productSheet .catalog-option-query {
  font-size: 10px;
}

.consumer-app #productSheet .bank-filter-empty,
.consumer-app #productSheet .catalog-empty {
  padding-top: 10px;
  padding-bottom: 10px;
}

.consumer-app #addCatalogProductsBtn {
  min-height: 40px;
}

.consumer-app #productSheet > .custom-product-section {
  margin-top: 10px;
  padding-top: 8px;
}

.consumer-app #productSheet .custom-product-summary {
  min-height: 34px;
}

.consumer-app #productSheet .custom-product-summary > span:first-child {
  gap: 1px;
}

.consumer-app #productSheet .custom-product-summary strong {
  font-size: 13px;
}

.consumer-app #productSheet .custom-product-summary small {
  font-size: 10px;
}

.consumer-app #productSheet .custom-product-body {
  margin-top: 10px;
}

.consumer-app .sheet-head {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.consumer-app .sheet-head h2 {
  font-size: 18px;
}

.consumer-app .mode-option.selected {
  border-color: oklch(78% 0.09 24);
}

@media (max-width: 760px) {
  .consumer-app .user-shell {
    border-right: 0;
    border-left: 0;
  }

  .consumer-app .service-strip {
    padding-right: 16px;
    padding-left: 16px;
  }

  .consumer-app .product-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .consumer-app .product-controls {
    min-width: 42px;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
  }
}

@media (max-width: 480px) {
  .consumer-app .auth-screen {
    width: calc(100vw - 32px);
  }

  .consumer-app .code-sent-row {
    display: grid;
  }

  .consumer-app .code-email-actions {
    width: 100%;
    justify-content: space-between;
  }

  .consumer-app .account-bar {
    padding-right: 12px;
    padding-left: 16px;
  }

  .consumer-app .service-strip {
    grid-template-columns: 1.22fr 1fr 0.66fr;
  }

  .consumer-app .service-strip > div {
    padding-right: 9px;
    padding-left: 9px;
  }

  .consumer-app .service-strip strong {
    font-size: 11px;
  }

  .consumer-app .renewal-banner {
    margin-right: 16px;
    margin-left: 16px;
  }

  .consumer-app .product-title-line {
    grid-template-columns: minmax(0, 1fr) minmax(62px, auto);
  }

  .consumer-app .monitor-bar {
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
  }

  .consumer-app .monitor-summary small {
    max-width: none;
  }
}

/* 管理端采用桌面数据密度，窄屏时保持表格可横向查看。 */
.admin-body {
  background: oklch(96% 0.007 255);
  font-size: 13px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid oklch(87% 0.01 255);
  background: oklch(20% 0.018 255);
  color: oklch(94% 0.006 255);
  padding: 22px 16px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 26px;
}

.admin-brand .brand-mark {
  background: var(--accent);
}

.admin-brand strong {
  font-size: 15px;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: oklch(73% 0.012 255);
  padding: 0 10px;
  text-align: left;
  cursor: pointer;
}

.admin-nav button.active,
.admin-nav button:hover {
  background: oklch(28% 0.02 255);
  color: oklch(96% 0.006 255);
}

.admin-logout {
  margin-top: auto;
  color: oklch(73% 0.012 255);
}

.admin-content {
  min-width: 0;
  padding: 28px 32px 48px;
}

.admin-head,
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-head h1 {
  font-size: 21px;
}

.admin-head p {
  margin-top: 5px;
  color: var(--muted);
}

/* 产品目录动作允许换行，桌面窗口较窄时仍保持按钮完整可达。 */
.catalog-toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-top: 24px;
  border: 1px solid oklch(87% 0.01 255);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.metric-strip > div {
  display: grid;
  gap: 7px;
  padding: 17px;
  border-right: 1px solid oklch(87% 0.01 255);
}

.metric-strip > div:last-child {
  border-right: 0;
}

.metric-strip span {
  color: var(--muted);
  font-size: 11px;
}

.metric-strip strong {
  font-size: 20px;
}

.admin-section {
  margin-top: 26px;
}

.catalog-bank-mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.catalog-bank-mode-bar > div:first-child {
  /* 标题独占一行，避免新增银行后把模式控件挤到窄列中。 */
  flex: 0 0 100%;
  display: grid;
  gap: 4px;
}

.catalog-bank-mode-bar strong {
  font-size: 14px;
}

.catalog-bank-mode-bar small,
.catalog-bank-mode-label small {
  color: var(--muted);
  font-size: 11px;
}

.catalog-bank-modes {
  flex: 1 1 100%;
  min-width: 0;
  display: grid;
  /* 单项需同时容纳银行标签、统计与模式切换，窄时整项换行而非拆开统计。 */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: center;
  gap: 16px;
}

.catalog-bank-mode,
.catalog-bank-mode-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-bank-mode {
  min-width: 0;
  justify-content: space-between;
}

.catalog-bank-mode-label {
  min-width: 0;
}

.mode-segment {
  display: grid;
  grid-template-columns: repeat(2, 54px);
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  padding: 2px;
}

.mode-segment button {
  min-height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mode-segment button:hover:not(:disabled) {
  color: var(--ink);
}

.mode-segment button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mode-segment button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px oklch(30% 0.015 255 / 0.1);
}

.mode-segment button.active[data-mode="new"] {
  background: var(--warning-soft);
  color: oklch(46% 0.1 75);
}

.mode-segment button:disabled {
  cursor: default;
  opacity: 1;
}

.admin-section-head h2 {
  font-size: 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.filter-row input {
  width: 240px;
}

.filter-row select {
  width: 130px;
}

/* 产品名称和代码各自独立筛选，桌面端保持紧凑并允许标题栏自然换行。 */
.catalog-filter-row input {
  width: 190px;
}

.table-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid oklch(87% 0.01 255);
  border-radius: 8px;
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid oklch(90% 0.008 255);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: oklch(97% 0.006 255);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: oklch(98% 0.006 24);
}

/* 日志级别同时使用文字和颜色，避免只靠颜色判断事件严重性。 */
.log-level {
  display: inline-flex;
  min-width: 42px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: oklch(94% 0.008 255);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.log-level.warning {
  background: oklch(93% 0.045 75);
  color: oklch(43% 0.09 70);
}

.log-level.error {
  background: oklch(94% 0.035 25);
  color: var(--danger);
}

.log-table {
  min-width: 980px;
}

.monitoring-table {
  min-width: 980px;
}

/* 银行调度指标使用紧凑独立行，避免聚合状态掩盖单行周期差异。 */
.monitoring-scheduler-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
}

.monitoring-scheduler-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.monitoring-scheduler-row .bank-badge {
  justify-self: start;
}

.catalog-table {
  /* 移除更新时间后收紧表格宽度，桌面端不足时仍由外层横向滚动。 */
  min-width: 1010px;
}

.catalog-actions {
  min-width: 210px;
  white-space: nowrap;
}

/* 保持 td 的 table-cell 布局，只在内部排列操作按钮，避免整列错位。 */
.catalog-action-list {
  display: flex;
  gap: 10px;
}

/* 完整分享链接只在管理员详情中展示，长参数允许换行但不撑宽侧栏。 */
.catalog-share-url {
  display: block;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.detail-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* 产品名称优先，编号作为稳定识别信息放在次行。 */
.catalog-product-cell {
  display: grid;
  min-width: 300px;
  max-width: 440px;
  gap: 4px;
  white-space: normal;
}

.catalog-product-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.catalog-name-button {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.catalog-name-button:hover,
.catalog-name-button:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.catalog-product-cell small {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.catalog-product-cell .catalog-product-yield {
  color: var(--muted);
  font-family: inherit;
  line-height: 1.45;
}

.annualized-yield {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.yield-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
}

.yield-label {
  color: var(--muted);
}

.yield-value {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.yield-value.missing {
  color: var(--faint);
}

.yield-value.low {
  color: var(--yield-low);
}

.yield-value.medium {
  color: var(--yield-medium);
}

.yield-value.high {
  color: var(--yield-high);
}

.new-product-badge {
  display: inline-flex;
  min-width: 30px;
  min-height: 18px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid oklch(84% 0.07 75);
  border-radius: 4px;
  background: var(--warning-soft);
  color: oklch(46% 0.11 70);
  padding: 0 5px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

/* 最近查询使用主次两行，额度优先、时间弱化。 */
.catalog-query-cell {
  display: grid;
  gap: 3px;
}

.catalog-query-cell strong {
  color: var(--ink);
  font-size: 13px;
}

.catalog-query-cell small,
.catalog-query-empty {
  color: var(--muted);
  font-size: 11px;
}

.monitoring-detail-row td {
  padding: 0;
  background: oklch(97% 0.006 255);
}

.monitoring-user-list {
  display: grid;
}

.monitoring-user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 1fr) minmax(170px, 1fr);
  gap: 16px;
  align-items: center;
  padding: 11px 14px 11px 34px;
  border-bottom: 1px solid oklch(90% 0.008 255);
}

.monitoring-user-row:last-child {
  border-bottom: 0;
}

.monitoring-user-row span {
  color: var(--muted);
  font-size: 12px;
}

.log-table .log-summary {
  max-width: 380px;
  white-space: normal;
}

/* 表格单元格保持 table-cell，只让内部内容分行，避免破坏整行列宽和边线。 */
.log-table .log-summary > span,
.log-table .log-summary > small,
.log-user-value > span,
.log-user-value > small {
  display: block;
}

/* 日志列表只预览 Bark 标题，完整正文放在详情侧栏避免拉高每一行。 */
.log-table .log-summary small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 管理员要求排查列表展示完整邮箱、Bark Key 和链接，长值直接换行不截断。 */
.log-table .log-original-value,
.log-table .log-user-value small,
.sensitive-value-cell {
  max-width: 380px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.log-table .log-original-value {
  overflow: visible;
  text-overflow: clip;
}

.log-user-value {
  max-width: 300px;
  white-space: normal;
}

.log-user-value small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  color: var(--muted);
}

.pagination > div {
  display: flex;
  gap: 6px;
}

.pagination .icon-button {
  min-width: 36px;
  min-height: 36px;
  font-size: 20px;
}

.table-link {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 750;
  cursor: pointer;
}

.admin-panel {
  max-width: 760px;
  margin-top: 18px;
  border: 1px solid oklch(87% 0.01 255);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
}

/* 系统设置包含银行配置和查询时段，使用内容区全宽避免控件被压缩。 */
#systemSettingsForm {
  width: 100%;
  max-width: none;
}

/* 邮件发送区把模板、受众和最终人数放在同一操作面，减少群发前来回核对。 */
.email-send-panel {
  max-width: 920px;
}

/* 自动提醒规则与群发共用后台表单语言，但保留独立状态和记录区域。 */
.email-reminder-panel {
  max-width: 920px;
}

.email-reminder-panel .setting-toggle {
  border-top: 0;
  padding-top: 0;
}

.email-reminder-condition {
  align-self: end;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.email-reminder-body {
  min-height: 220px;
  resize: vertical;
}

.email-send-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.25fr);
  gap: 22px;
  align-items: start;
}

.email-audience-fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.email-audience-fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 650;
}

.email-audience-fieldset small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.email-audience-options {
  display: flex;
  gap: 8px;
}

.email-audience-option {
  display: flex;
  min-height: 40px;
  flex: 1 1 0;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--ink);
  cursor: pointer;
}

.email-audience-option:hover {
  border-color: var(--muted);
}

.email-audience-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.email-audience-option input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.email-audience-option:has(input:focus-visible) {
  outline: 3px solid oklch(62% 0.2 24 / 0.22);
  outline-offset: 2px;
}

.email-send-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.email-send-summary > div {
  display: grid;
  gap: 4px;
}

.email-send-summary span,
.admin-section-meta {
  color: var(--muted);
  font-size: 11px;
}

.email-send-summary strong {
  font-size: 17px;
}

.email-template-table {
  min-width: 760px;
}

.email-history-table {
  min-width: 1040px;
}

.email-reminder-history-table {
  min-width: 1120px;
}

.email-subject-cell {
  max-width: 420px;
  overflow-wrap: anywhere;
  white-space: normal !important;
}

.email-template-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-history-template {
  min-width: 240px;
  max-width: 400px;
  white-space: normal !important;
}

.email-history-template strong,
.email-history-template small {
  display: block;
  overflow-wrap: anywhere;
}

.email-history-template small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.email-campaign-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 5px;
  background: oklch(94% 0.008 255);
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.email-campaign-status.running {
  background: var(--warning-soft);
  color: oklch(46% 0.1 75);
}

.email-campaign-status.completed {
  background: var(--success-soft);
  color: var(--success);
}

.email-campaign-status.success {
  background: var(--success-soft);
  color: var(--success);
}

.email-campaign-status.pending {
  background: var(--warning-soft);
  color: oklch(46% 0.1 75);
}

.email-campaign-status.canceled {
  background: oklch(94% 0.008 255);
  color: var(--muted);
}

.email-reminder-error {
  display: block;
  margin-top: 5px;
  color: var(--danger);
  font-size: 11px;
}

.email-campaign-status.failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.email-template-body {
  min-height: 260px;
  resize: vertical;
}

.settings-block {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-block-head h2 {
  font-size: 16px;
}

.settings-block-head span {
  color: var(--muted);
  font-size: 12px;
}

.query-settings .settings-block-head > div {
  display: grid;
  gap: 4px;
}

.query-settings,
.query-window-list,
.query-window-row {
  min-width: 0;
}

.query-window-list {
  border-bottom: 1px solid var(--line);
}

.query-window-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: start;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.query-bank-group {
  position: relative;
  /* 使用固定最小轨道的网格，避免最后一个银行选项独占整行。 */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 24px 0 0;
}

.query-bank-group legend {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.query-bank-option {
  position: relative;
  display: block;
  min-width: 0;
  color: var(--muted);
  cursor: pointer;
}

.query-bank-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: 0;
  opacity: 0;
}

.query-bank-option span {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 8px;
  white-space: nowrap;
  font-weight: 700;
  transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.query-bank-option:hover span {
  border-color: var(--muted);
  color: var(--ink);
}

.query-bank-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.query-bank-option input:focus-visible + span {
  outline: 3px solid oklch(62% 0.2 24 / 0.22);
  outline-offset: 2px;
}

.query-day-group {
  position: relative;
  display: flex;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 24px 0 0;
}

.query-day-group legend {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.query-day-option {
  position: relative;
  display: block;
  color: var(--muted);
  cursor: pointer;
}

.query-day-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: 0;
  opacity: 0;
}

.query-day-option span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 700;
  transition: border-color 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
}

.query-day-option:hover span {
  border-color: var(--muted);
  color: var(--ink);
}

.query-day-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.query-day-option input:focus-visible + span {
  outline: 3px solid oklch(62% 0.2 24 / 0.22);
  outline-offset: 2px;
}

.query-window-controls {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) auto 36px;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

@media (max-width: 720px) {
  /* 设置面板在窄屏上改为单列，避免银行和星期控件把面板撑出视口。 */
  .query-window-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.query-time-field input {
  min-height: 40px;
  padding: 0 8px;
}

.query-time-separator {
  display: grid;
  place-items: center;
  height: 40px;
  color: var(--faint);
  font-size: 12px;
}

.query-all-day {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  color: var(--ink);
  cursor: pointer;
}

.query-all-day input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.query-remove {
  min-width: 36px;
  width: 36px;
  height: 40px;
  color: var(--danger);
  font-size: 21px;
  font-weight: 400;
}

.query-window-empty {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* 银行输入按可用宽度换行，单项保持可读且不被压缩。 */
.bank-worker-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.password-grid {
  margin-top: 16px;
}

.admin-form-grid .full-row {
  grid-column: 1 / -1;
}

/* 用户级覆盖值的说明紧贴输入框，避免管理员误以为留空会清零。 */
.admin-field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.setting-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  cursor: pointer;
}

.setting-toggle input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.setting-toggle span {
  display: grid;
  gap: 4px;
}

.setting-toggle strong {
  color: var(--ink);
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(520px, 100%);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.code-output {
  width: 100%;
  min-height: 180px;
  margin-top: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.detail-block {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.detail-block h3 {
  margin-bottom: 10px;
  font-size: 13px;
}

.detail-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail-block-head h3 {
  margin: 0;
}

.detail-block-head small {
  color: var(--muted);
  font-size: 11px;
}

/* 高频查询记录限制在独立滚动区，避免挤走产品链接与副本信息。 */
.catalog-query-history {
  max-height: 420px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.catalog-query-history-row {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.catalog-query-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-query-history-head time,
.catalog-query-history-row small,
.catalog-query-history-loading,
.catalog-query-history-empty {
  color: var(--muted);
  font-size: 11px;
}

.catalog-query-history-row > strong {
  color: var(--ink);
  font-size: 13px;
}

.catalog-query-history-row p {
  margin: 0;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.catalog-query-history-loading,
.catalog-query-history-empty {
  margin: 0;
  padding: 12px 0;
}

.catalog-query-history-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--danger);
  font-size: 12px;
}

.detail-list {
  display: grid;
  gap: 9px;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.notification-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.notification-row small {
  color: var(--muted);
}

/* 用户详情中的单发控件保持一行完成选择与执行，适配侧栏有限宽度。 */
.user-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.user-email-form label {
  margin: 0;
}

.user-email-form .button {
  min-height: 40px;
}

.user-email-history-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-more-button {
  margin-top: 10px;
}

.log-detail-list dd {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-detail-list code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

/* 消息预览模拟 Bark 的标题与正文层级，但不仿造系统通知外观。 */
.bark-message-preview {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  padding: 12px;
}

.bark-message-preview strong {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.bark-message-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* 协议页采用无干扰的长文档布局，便于手机阅读和核对条款。 */
.legal-body {
  background: var(--canvas);
}

.legal-shell {
  width: min(760px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 calc(48px + env(safe-area-inset-bottom));
}

.legal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.legal-head > div {
  display: grid;
  gap: 3px;
}

.legal-head p,
.legal-head span {
  color: var(--muted);
  font-size: 11px;
}

.legal-head h1 {
  font-size: 21px;
}

.legal-summary {
  margin: 22px 0;
  border: 1px solid oklch(86% 0.05 75);
  border-radius: 7px;
  background: var(--warning-soft);
  padding: 14px 16px;
}

.legal-summary strong {
  font-size: 13px;
}

.legal-summary p {
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}

.legal-content {
  border-top: 1px solid var(--line);
}

.legal-content section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.legal-content h2 {
  margin-bottom: 10px;
  font-size: 16px;
}

.legal-content p,
.legal-content li {
  color: oklch(36% 0.015 255);
  font-size: 13px;
  line-height: 1.8;
}

.legal-content p + p {
  margin-top: 9px;
}

.legal-content ul {
  margin: 10px 0;
  padding-left: 22px;
}

.privacy-no-list {
  padding: 12px 12px 12px 32px !important;
  border-radius: 6px;
  background: var(--success-soft);
}

.legal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 22px;
}

.legal-footer .button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 760px) {
  .account-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .product-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .compliance-strip {
    padding-left: 16px;
    padding-right: 16px;
  }

  .service-strip > div {
    padding: 13px 12px;
  }

  .product-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .product-controls {
    justify-content: space-between;
  }

  .monitor-bar {
    grid-template-columns: minmax(0, 1fr) 132px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: sticky;
    z-index: 30;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
  }

  .admin-brand {
    padding: 0;
  }

  .admin-brand .brand-mark {
    width: 34px;
    height: 34px;
  }

  .admin-nav {
    display: flex;
    margin-left: auto;
    overflow-x: auto;
  }

  .admin-nav button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 8px;
  }

  .admin-logout {
    margin: 0 0 0 4px;
  }

  .admin-content {
    padding: 22px 16px 40px;
  }

  .metric-strip {
    grid-template-columns: repeat(5, 130px);
    overflow-x: auto;
  }

  .filter-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
  }

  .filter-row input {
    width: 100%;
    grid-column: 1 / -1;
  }

  .filter-row select {
    width: 100%;
  }

  .admin-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (max-width: 620px) {
  /* 窄屏优先保留导航操作，品牌名称由图形标识承担。 */
  .admin-brand strong {
    display: none;
  }

  .admin-nav button {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .brand-lockup strong {
    font-size: 15px;
  }

  .header-actions .subtle {
    min-width: 40px;
    padding: 0 10px;
  }

  .service-strip {
    grid-template-columns: 1.15fr 1fr 0.75fr;
  }

  .service-strip > div {
    padding-left: 10px;
    padding-right: 8px;
  }

  .service-strip strong {
    font-size: 12px;
  }

  .renewal-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    flex-shrink: 0;
  }

  .product-title-line {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .product-title-line > strong {
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
  }

  .field-grid,
  .sheet-actions,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  #volumeField,
  .admin-form-grid .full-row {
    grid-column: auto;
  }

  .monitor-summary small {
    max-width: 180px;
  }

}

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