/* 步数工作台：暖纸色、炭黑与鼠尾草绿，移动优先。 */
:root {
  color-scheme: light;
  --p-paper: oklch(0.955 0.014 88);
  --p-surface: oklch(0.985 0.008 88);
  --p-surface-raised: oklch(1 0 0);
  --p-ink: oklch(0.225 0.015 85);
  --p-ink-soft: oklch(0.44 0.015 85);
  --p-line: oklch(0.865 0.018 88);
  --p-sage: oklch(0.885 0.052 132);
  --p-sage-soft: oklch(0.93 0.034 132);
  --p-sage-ink: oklch(0.39 0.065 139);
  --p-terracotta: oklch(0.59 0.13 39);
  --p-error: oklch(0.5 0.16 29);
  --p-error-soft: oklch(0.94 0.035 29);
  --p-focus: oklch(0.56 0.12 42);

  --bg: var(--p-paper);
  --surface: var(--p-surface);
  --surface-raised: var(--p-surface-raised);
  --text: var(--p-ink);
  --text-muted: var(--p-ink-soft);
  --line: var(--p-line);
  --accent: var(--p-sage);
  --accent-soft: var(--p-sage-soft);
  --accent-ink: var(--p-sage-ink);
  --danger: var(--p-error);
  --danger-soft: var(--p-error-soft);
  --focus: var(--p-focus);
  --button-bg: var(--p-ink);
  --button-text: var(--p-paper);
  --glass: color-mix(in oklch, var(--p-paper) 86%, transparent);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-dialog: 0 24px 80px color-mix(in oklch, var(--p-ink) 22%, transparent);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { min-width: 0; scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  padding-inline: env(safe-area-inset-left, 0px) env(safe-area-inset-right, 0px);
  background: var(--bg);
  color: var(--text);
  font-family: "Figtree", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
img { max-width: 100%; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { line-height: 1.16; text-wrap: balance; }
p { text-wrap: pretty; }
:is(h1, h2, h3, p, dd, small, label, summary, .button) { overflow-wrap: anywhere; }
:is(input, button, summary)[id] { scroll-margin-top: 6rem; }
.workspace-grid > *, .action-column, .panel, .auth-shell > *, .page-heading > div, .guide-panel, .topbar-actions { min-width: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 顶部导航 */
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 70%, transparent);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 68px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; max-width: 100%; font-weight: 750; letter-spacing: -.02em; }
.brand img { flex-shrink: 0; }
.brand img { width: 36px; height: 36px; border-radius: 11px; }
.topbar-note { color: var(--text-muted); font-size: 14px; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.icon-text-button, .text-link {
  min-height: 44px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out;
}
.icon-text-button:hover, .text-link:hover { background: var(--surface); color: var(--text); }
.icon-text-button:active, .text-link:active { transform: scale(.97); }
.logout-form { display: flex; }

/* 页面标题与通用布局 */
.page-shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; padding: 40px 0 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { max-width: 18ch; font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 750; letter-spacing: -.055em; }
.page-heading > div > p:last-child { margin-top: 12px; color: var(--text-muted); }
.section-label { margin-bottom: 9px; color: var(--accent-ink); font-size: 12px; font-weight: 800; letter-spacing: .12em; line-height: 1.4; }
.goal-display { flex: 0 0 auto; padding-left: 24px; border-left: 1px solid var(--line); text-align: right; }
.goal-display > span { display: block; color: var(--text-muted); font-size: 13px; }
.goal-display strong { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.goal-display small { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 24px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.panel h2 { font-size: 1.45rem; letter-spacing: -.035em; }
.soft-badge { flex: 0 0 auto; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); padding: 5px 10px; font-size: 12px; font-weight: 700; }

/* 三步引导 */
.guide-panel { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.guide-panel > summary { min-height: 76px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; border-radius: var(--radius-md); }
.guide-panel > summary::-webkit-details-marker { display: none; }
.guide-panel > summary strong, .guide-panel > summary small { display: block; }
.guide-panel > summary strong { font-size: 15px; }
.guide-panel > summary small { margin-top: 2px; color: var(--text-muted); font-size: 12px; font-weight: 400; }
.guide-panel > summary > svg { flex: 0 0 auto; transition: transform 180ms ease-out; }
.guide-panel[open] > summary > svg { transform: rotate(180deg); }
.guide-steps { list-style: none; display: grid; gap: 16px; padding: 4px 20px 22px; border-top: 1px solid var(--line); }
.guide-steps li { display: flex; align-items: flex-start; gap: 12px; padding-top: 16px; }
.guide-number { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.guide-steps strong { font-size: 14px; }
.guide-steps p { margin-top: 2px; color: var(--text-muted); font-size: 13px; }

/* 站内首次使用说明，按步骤展开阅读。 */
.onboarding-content { padding: 4px 20px 24px; border-top: 1px solid var(--line); }
.guide-intro { margin: 18px 0; color: var(--text-muted); font-size: 14px; }
.onboarding-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.onboarding-list > li { min-width: 0; }
.onboarding-list h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.5; }
.guide-step > summary { min-height: 52px; display: flex; align-items: center; gap: 8px; list-style: none; }
.guide-step > summary::-webkit-details-marker { display: none; }
.guide-step > summary::after { content: '+'; margin-left: auto; color: var(--accent-ink); font-size: 22px; }
.guide-step[open] > summary::after { content: '−'; }
.compact-guide { padding-top: 18px; gap: 20px; }
.compact-guide .guide-downloads { margin: 2px 0 0; }
.compact-guide .guide-downloads .text-link { padding-left: 0; }
.binding-help > summary { min-height: 44px; padding: 10px 0; color: var(--accent-ink); font-size: 13px; }
.guide-body { min-width: 0; margin-top: 10px; font-size: 14px; }
.guide-body p + p { margin-top: 12px; }
.guide-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.guide-downloads .button { min-height: 44px; font-size: 13px; }
.guide-callout { padding: 12px 14px; border-left: 3px solid var(--accent-ink); border-radius: 0 10px 10px 0; background: var(--accent-soft); }
.guide-figure { margin: 16px 0; }
.guide-figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.guide-figure figcaption, .guide-sources { margin-top: 8px; color: var(--text-muted); font-size: 12px; }
.guide-screenshots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; align-items: start; }
.guide-screenshots .guide-figure { min-width: 0; margin: 12px 0 0; }
.guide-screenshots .guide-figure a { display: block; }
.guide-screenshots .guide-figure img { width: 100%; max-width: 420px; margin-inline: auto; }
.copy-account { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; min-height: 44px; padding: 4px 8px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: middle; }
.copy-account strong { overflow-wrap: anywhere; user-select: text; }
.copy-account span { font-size: 12px; }
.guide-copy-feedback { color: var(--text-muted); font-size: 13px; }
.guide-sources a { text-decoration: underline; text-underline-offset: 3px; }
.guide-faq { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 12px; }
.guide-faq summary, .wechat-instructions summary { display: list-item; min-height: 44px; padding: 10px 0; font-size: 14px; font-weight: 700; }
.guide-faq dt { margin-top: 12px; font-size: 14px; font-weight: 700; }
.guide-faq dd { margin: 4px 0 14px; color: var(--text-muted); font-size: 13px; }
.schedule-saved { margin-top: 12px; color: var(--accent-ink); font-size: 13px; font-weight: 650; }
.schedule-unsaved { margin-top: 12px; color: var(--danger); font-size: 13px; font-weight: 650; }
.wechat-instructions { margin: 12px 0; }
.wechat-instructions p { margin: 8px 0; color: var(--text-muted); font-size: 13px; }
@media (max-width: 540px) {
  .guide-figure img { width: min(100%, 320px); margin-inline: auto; }
}

/* 工作区 */
.workspace-grid { display: grid; gap: 20px; align-items: start; }
.settings-panel form { display: grid; gap: 20px; }
.field { min-width: 0; }
.field label, .field legend { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 700; }
.field input, .field select, .step-input-wrap input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out;
}
.field input:hover, .field select:hover { border-color: var(--text-muted); }
.field input:focus, .field select:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 20%, transparent); }
.field input::placeholder { color: var(--text-muted); opacity: .8; }
.field input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-soft); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-label { color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.password-toggle { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--text-muted); transition: background-color 160ms ease-out, color 160ms ease-out; }
.password-toggle:hover { background: var(--surface); color: var(--text); }
.field-help, .field-error { margin-top: 6px; font-size: 12px; line-height: 1.5; }
.field-help { color: var(--text-muted); }
.field-error { min-height: 0; color: var(--danger); font-weight: 600; }
.field-error:empty { display: none; }
.steps-field { border: 0; min-inline-size: 0; }
.step-input-wrap { position: relative; }
.step-input-wrap input { padding-right: 52px; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-input-wrap > span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }
.quick-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-steps button { min-width: 58px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, transform 160ms ease-out; }
.quick-steps button:hover { border-color: var(--accent-ink); color: var(--text); }
.quick-steps button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--text); }
.quick-steps button:active { transform: scale(.96); }
.schedule-block { padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.schedule-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.schedule-heading label { margin: 0; }
.schedule-heading p { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
.switch { position: relative; flex: 0 0 auto; width: 52px; height: 44px; display: grid; place-items: center; margin: 0 !important; }
.switch input { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.switch-track { pointer-events: none; width: 48px; height: 28px; padding: 3px; border-radius: 999px; background: var(--line); transition: background-color 180ms ease-out; }
.switch-track > span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-raised); box-shadow: 0 1px 3px color-mix(in oklch, var(--text) 18%, transparent); transition: transform 180ms ease-out; }
.switch input:checked + .switch-track { background: var(--accent-ink); }
.switch input:checked + .switch-track > span { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 3px; }
.time-row { display: grid; gap: 8px; margin-top: 16px; transition: opacity 180ms ease-out; }
.time-row.is-paused { opacity: .55; }
.time-row label { display: flex; align-items: center; gap: 6px; margin: 0; }
.time-row label > span { color: var(--text-muted); font-size: 12px; font-weight: 500; }
.time-row select { width: auto; min-width: 68px; min-height: 44px; padding: 8px 28px 8px 10px; font-variant-numeric: tabular-nums; }
.time-colon { font-weight: 800; }
.time-row > p { flex: 1 1 100%; color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.time-trigger { width: 100%; min-height: 70px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); text-align: left; }
.time-trigger:hover { border-color: var(--accent-ink); background: var(--accent-soft); }
.time-trigger > svg { color: var(--accent-ink); flex: 0 0 auto; }
.time-trigger strong { font-size: 28px; line-height: 1.2; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.time-trigger > span { color: var(--text-muted); font-size: 12px; }
.time-trigger .time-edit { margin-left: auto; color: var(--accent-ink); font-weight: 700; }
.time-picker-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: center; gap: 14px; margin: 24px 0 16px; }
.time-picker-grid > div > p { margin-bottom: 10px; text-align: center; color: var(--text-muted); font-size: 13px; }
.time-options { height: clamp(88px, 30dvh, 240px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 18px; padding: 6px; background: var(--bg); scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.time-options button { display: block; width: 100%; min-height: 46px; margin: 2px 0; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text-muted); font-size: 22px; font-variant-numeric: tabular-nums; }
.time-options button:hover { background: var(--surface); }
.time-options button[aria-selected="true"] { background: var(--accent); color: var(--text); font-weight: 800; }
.picker-colon { font-size: 30px; text-align: center; }
.time-picker-actions { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 18px; }

/* 按钮与表单反馈 */
.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 999px; padding: 12px 20px; font-weight: 750; line-height: 1.3; transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out, opacity 160ms ease-out; }
.button-full { width: 100%; }
.button-primary { background: var(--button-bg); color: var(--button-text); }
.button-primary:hover { background: var(--accent-ink); color: var(--p-paper); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button-secondary:hover { border-color: var(--text-muted); background: var(--bg); }
.button:active { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button-spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.is-loading .button-spinner { display: block; }
.is-loading .button-label { opacity: .82; }
.form-message { margin-bottom: 16px; padding: 12px 14px; display: flex; align-items: flex-start; gap: 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.form-message.is-error { background: var(--danger-soft); color: var(--danger); }
.form-message svg { flex: 0 0 auto; margin-top: 2px; }

/* 提交与状态 */
.action-column { display: grid; gap: 20px; }
.run-panel { border-color: var(--p-ink); background: var(--p-ink); color: var(--p-paper); }
.run-panel .section-label { color: var(--p-sage); }
.run-panel h2 { max-width: 16ch; font-size: clamp(1.65rem, 4vw, 2.15rem); }
.run-panel > p:not(.section-label):not(.offline-note) { margin: 14px 0 24px; color: var(--p-line); font-size: 14px; }
.button-run { background: var(--p-sage); color: var(--p-ink); }
.button-run:hover { background: var(--p-surface); }
.button-run > svg { margin-left: auto; }
.button-run .button-label { margin-right: auto; }
.button-run.is-loading > svg { display: none; }
.offline-note { margin-top: 12px; color: var(--p-paper); font-size: 13px; font-weight: 600; }
.status-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.status-heading h2 { font-size: 1.1rem; }
.status-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 750; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-badge.is-running { background: color-mix(in oklch, var(--accent) 60%, var(--surface)); }
.status-badge.is-running .status-dot { animation: pulse 1.5s ease-in-out infinite; }
.status-badge.is-failed { background: var(--danger-soft); color: var(--danger); }
.status-result { min-height: 52px; margin: 18px 0; color: var(--text); font-size: 15px; }
.status-meta { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.status-meta > div { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.status-meta dt { color: var(--text-muted); }
.status-meta dd { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.verify-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; color: var(--text-muted); }
.verify-note svg { flex: 0 0 auto; margin-top: 3px; color: var(--accent-ink); }
.verify-note p { font-size: 12px; }
.install-strip { width: 100%; min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: transparent; text-align: left; transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out; }
.install-strip:hover { background: var(--surface); border-color: var(--text-muted); }
.install-strip:active { transform: scale(.99); }
.install-strip > svg { flex: 0 0 auto; color: var(--accent-ink); }
.install-strip > svg:last-child { margin-left: auto; color: var(--text-muted); }
.install-strip span { display: grid; }
.install-strip strong { font-size: 14px; }
.install-strip small { color: var(--text-muted); font-size: 12px; }

/* 安装说明弹窗 */
.install-dialog { width: 100%; max-width: 100%; max-height: min(calc(100dvh - 16px), 760px); margin: auto 0 0; padding: 24px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); overflow-y: auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-dialog); }
.time-picker-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.time-picker-dialog .dialog-header, .time-picker-actions { flex-shrink: 0; }
.time-picker-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog-header > div { min-width: 0; }
.install-dialog::backdrop { background: color-mix(in oklch, var(--p-ink) 45%, transparent); backdrop-filter: blur(4px); }
.install-dialog[open] { animation: sheet-in 220ms ease-out; }
.dialog-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dialog-header h2 { font-size: 1.65rem; letter-spacing: -.035em; }
.dialog-close { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; transition: background-color 160ms ease-out, transform 160ms ease-out; }
.dialog-close:hover { background: var(--bg); }
.dialog-close:active { transform: scale(.94); }
.dialog-intro { margin: 10px 0 18px; color: var(--text-muted); font-size: 14px; }
.inapp-tip { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 18px; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.inapp-tip svg { flex: 0 0 auto; margin-top: 2px; }
.inapp-tip p { font-size: 13px; font-weight: 600; }
#native-install { margin-bottom: 16px; }
.install-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg); }
.install-tabs button { min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--text-muted); font-size: 14px; font-weight: 700; transition: background-color 160ms ease-out, color 160ms ease-out; }
.install-tabs button[aria-selected="true"] { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 4px color-mix(in oklch, var(--text) 10%, transparent); }
.install-panel { padding-top: 20px; }
.install-panel ol { list-style: none; display: grid; gap: 16px; }
.install-panel li { display: flex; align-items: flex-start; gap: 12px; }
.install-panel li > span { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
.install-panel p { padding-top: 2px; font-size: 14px; }

/* 登录与注册 */
.auth-shell { width: min(1040px, calc(100% - 32px)); min-height: calc(100dvh - 68px); margin-inline: auto; padding: 40px 0 56px; display: grid; align-items: center; gap: 32px; }
.auth-intro h1 { max-width: 12ch; font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 750; letter-spacing: -.06em; }
.auth-intro > p:not(.section-label) { max-width: 52ch; margin-top: 20px; color: var(--text-muted); }
.auth-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.auth-steps span[aria-hidden="true"] { color: var(--text-muted); }
.auth-panel { padding: 26px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.auth-panel-heading { margin-bottom: 24px; }
.auth-panel-heading h2 { font-size: 1.8rem; letter-spacing: -.04em; }
.auth-panel-heading > p:last-child { margin-top: 8px; color: var(--text-muted); font-size: 14px; }
#auth-form { display: grid; gap: 17px; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: 14px; }
.auth-switch a { display: inline-flex; min-height: 44px; align-items: center; margin-left: 4px; color: var(--accent-ink); font-weight: 750; text-decoration: underline; text-underline-offset: 4px; }

/* 管理后台 */
.admin-heading { align-items: center; }
.admin-heading .button { flex: 0 0 auto; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.metric:last-child { grid-column: 1 / -1; }
.metric p { color: var(--text-muted); font-size: 13px; font-weight: 650; }
.metric strong { display: block; margin: 10px 0 8px; overflow-wrap: anywhere; font-size: clamp(2rem, 8vw, 3.4rem); line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric > span { color: var(--text-muted); font-size: 12px; }
.metric-featured { background: var(--p-ink); color: var(--p-paper); border-color: var(--p-ink); }
.metric-featured p, .metric-featured > span { color: var(--p-line); }
.metric-success { background: var(--accent-soft); border-color: var(--accent); }
.admin-note { display: flex; align-items: flex-start; gap: 14px; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.admin-note > svg { flex: 0 0 auto; margin-top: 3px; color: var(--accent-ink); }
.admin-note h2 { font-size: 1rem; }
.admin-note p { max-width: 72ch; margin-top: 6px; color: var(--text-muted); font-size: 14px; }

/* 离线页 */
.offline-shell { width: min(620px, calc(100% - 32px)); min-height: 100dvh; margin-inline: auto; padding: 48px 0; display: grid; align-content: center; }
.offline-mark { width: 72px; height: 72px; margin-bottom: 24px; border-radius: 22px; }
.offline-shell h1 { margin-top: 6px; font-size: clamp(2.25rem, 9vw, 4rem); letter-spacing: -.055em; }
.offline-shell > p:not(.section-label) { max-width: 52ch; margin: 18px 0 26px; color: var(--text-muted); }
.offline-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.offline-hint { margin-top: 20px !important; font-size: 13px; }

/* 仅静态预览使用的页面切换条 */
.preview-bar { position: relative; z-index: 30; padding: 10px 16px; background: var(--p-ink); color: var(--p-paper); }
.preview-bar-inner { width: min(1120px, 100%); margin-inline: auto; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.preview-bar-inner::-webkit-scrollbar { display: none; }
.preview-bar strong { flex: 0 0 auto; margin-right: 6px; color: var(--p-sage); font-size: 12px; }
.preview-bar a { flex: 0 0 auto; min-height: 36px; display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; color: var(--p-paper); font-size: 12px; }
.preview-bar a:hover, .preview-bar a[aria-current="page"] { background: color-mix(in oklch, var(--p-paper) 14%, transparent); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.75); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 560px) {
  .page-shell, .auth-shell { padding-top: 52px; }
  .panel { padding: 28px; }
  .guide-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .install-dialog { width: min(520px, calc(100% - 32px)); max-height: min(86dvh, 760px); margin: auto; padding: 28px; border-bottom: 1px solid var(--line); border-radius: 28px; }
  .auth-panel { padding: 32px; }
}

@media (min-width: 820px) {
  .page-shell { padding: 56px 0 80px; }
  .home-heading { margin-bottom: 36px; }
  .workspace-grid { grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 24px; }
  .guide-panel { margin-bottom: 24px; }
  .auth-shell { grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 64px; padding-block: 56px; }
  .metrics-grid { grid-template-columns: 1.25fr repeat(2, 1fr); gap: 16px; }
  .metric { min-height: 174px; padding: 24px; }
  .metric:last-child { grid-column: auto; }
  .metric-featured { grid-row: span 2; min-height: 364px; display: flex; flex-direction: column; justify-content: flex-end; }
  .metric-featured strong { font-size: clamp(4rem, 8vw, 6rem); }
  .metric-success { grid-column: span 2; }
}

@media (max-width: 559px) {
  .topbar-inner { width: min(100% - 24px, 1120px); min-height: 62px; }
  .brand { font-size: 15px; }
  .brand img { width: 32px; height: 32px; }
  .topbar-note { display: none; }
  .icon-text-button { width: 44px; padding: 8px; }
  .icon-text-button > span { display: none; }
  .admin-link { display: none; }
  .page-shell { width: min(100% - 24px, 1120px); padding-top: 28px; }
  .page-heading { align-items: flex-start; gap: 16px; }
  .page-heading h1 { font-size: clamp(1.65rem, 7.3vw, 2.25rem); }
  .page-heading > div > p:last-child { font-size: 14px; }
  .home-heading { display: block; }
  .goal-display { margin-top: 22px; padding: 14px 0 0; border-top: 1px solid var(--line); border-left: 0; display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .goal-display strong { font-size: 2rem; }
  .guide-panel summary { padding-inline: 16px; }
  .guide-panel summary small { max-width: 32ch; }
  .guide-steps { padding-inline: 16px; }
  .panel { padding: 22px 18px; border-radius: 22px; }
  .field input, .admin-controls input { font-size: max(16px, 1rem); }
  .panel-heading { margin-bottom: 22px; }
  .action-column { gap: 16px; }
  .run-panel { padding: 26px 22px; }
  .status-meta > div { align-items: flex-start; }
  .status-meta dd { max-width: 65%; }
  .admin-heading { align-items: flex-end; }
  .admin-heading .button { width: 48px; min-height: 48px; padding: 10px; font-size: 0; }
  .admin-heading .button svg { width: 20px; height: 20px; }
  .metric { padding: 18px 16px; }
  .metric strong { font-size: 2.35rem; }
  .auth-shell { width: min(100% - 24px, 1040px); min-height: auto; padding-top: 32px; gap: 26px; }
  .auth-intro h1 { font-size: 2.65rem; }
  .auth-intro > p:not(.section-label) { margin-top: 14px; font-size: 14px; }
  .auth-steps { margin-top: 16px; font-size: 12px; }
  .auth-panel { padding: 24px 18px; border-radius: 22px; }
}

@media (max-height: 500px) {
  .install-dialog { padding-top: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); max-height: calc(100dvh - 16px); }
  .dialog-header h2 { font-size: 1.3rem; }
  .time-picker-grid { margin-block: 12px; gap: 8px; }
  .time-picker-actions { margin-top: 10px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --p-paper: oklch(0.21 0.012 85);
    --p-surface: oklch(0.255 0.013 85);
    --p-surface-raised: oklch(0.31 0.014 85);
    --p-ink: oklch(0.94 0.014 88);
    --p-ink-soft: oklch(0.75 0.016 88);
    --p-line: oklch(0.39 0.016 85);
    --p-sage: oklch(0.78 0.075 132);
    --p-sage-soft: oklch(0.33 0.038 132);
    --p-sage-ink: oklch(0.82 0.075 132);
    --p-error: oklch(0.75 0.12 29);
    --p-error-soft: oklch(0.32 0.055 29);
    --p-focus: oklch(0.78 0.11 55);
    --button-bg: var(--p-sage);
    --button-text: oklch(0.22 0.02 132);
    --glass: color-mix(in oklch, var(--p-paper) 86%, transparent);
  }
  .button-primary:hover { background: var(--p-surface-raised); color: var(--text); }
  .run-panel { border-color: var(--p-line); background: var(--p-surface); }
  .run-panel > p:not(.section-label):not(.offline-note) { color: var(--text-muted); }
  .offline-note { color: var(--text); }
  .metric-featured { background: var(--p-surface-raised); border-color: var(--p-line); }
  .preview-bar { background: var(--p-surface-raised); }
}

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


/* 微信核对入口，沿用第一版卡片与按钮样式。 */
.wechat-link { margin-top: 18px; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.wechat-link:hover { border-color: var(--accent-ink); background: var(--accent); color: var(--text); }
.wechat-hint { margin-top: 9px; color: var(--text-muted); font-size: 12px; text-align: center; }

.share-fallback { margin-block: 12px; color: var(--text-muted); font-size: 13px; }
.share-fallback p { overflow-wrap: anywhere; padding: 10px; user-select: all; }
.admin-controls { margin-block: 24px; padding: 24px; }
.admin-controls form { display: grid; gap: 12px; margin-top: 20px; }
.admin-controls input { width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
@media (max-width: 559px) {
  .admin-link { display: inline-flex; }
  .topbar-actions { gap: 2px; }
  .workspace-grid, .action-column, .settings-panel { min-width: 0; }
}
