/* ============================================================
   知与看电视 — 视觉系统
   暖纸底色 + 墨色文字 + 朱红点缀;数字与标题用衬线展示字,
   像一本家庭观察手记,而不是仪表盘。
   ============================================================ */

:root {
  color-scheme: light;

  /* 纸与墨 */
  --paper: #f6f2e9;
  --paper-deep: #efe9da;
  --card: #fffdf8;
  --ink: #2b2620;
  --ink-soft: #6f675a;
  --ink-faint: #a59c8c;
  --line: #e6decd;
  --line-strong: #d3c8b0;

  /* 朱红点缀 */
  --accent: #c0512e;
  --accent-deep: #a8431f;
  --accent-wash: #f6e3d9;

  /* 状态色 */
  --active: #3f7d51;
  --active-wash: #ecf2e7;
  --warn: #b07b16;
  --warn-wash: #f7efda;
  --alert: #b43a24;
  --alert-wash: #f7e3dd;
  --paused: #5a6299;
  --paused-wash: #e9ebf4;
  --idle: #a59c8c;

  /* 内容类别 */
  --cat-science: #49799a;
  --cat-animation: #d29e35;
  --cat-nature: #67934e;
  --cat-craft: #96639b;
  --cat-music: #8b8e96;
  --cat-game: #3e8577;
  --cat-entertainment: #bd6e44;
  --cat-uncategorized: #b6ad9d;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgb(43 38 32 / 4%), 0 4px 14px rgb(43 38 32 / 4%);

  --font-display: "Georgia", "Times New Roman", "Songti SC", "STSong", "Noto Serif SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 480px at 50% -120px, #fbf8f0, transparent),
    var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
p {
  margin: 0;
}

/* ------------------------------------------------------------
   顶栏与品牌
   ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar__inner,
.shell {
  width: min(700px, calc(100vw - 36px));
  margin: 0 auto;
}

.topbar__inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent);
  color: #fdf6ee;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}

h1 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12px;
}

.status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--idle);
}

.status-chip.is-active::before {
  background: var(--active);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--active) 18%, transparent);
}

.status-chip.is-paused::before {
  background: var(--paused);
}

/* ------------------------------------------------------------
   页签
   ------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab:hover {
  color: var(--ink);
}

.tabs--top .tab.is-active {
  color: var(--card);
  background: var(--ink);
}

.tabs--bottom {
  display: none;
}

.is-hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   布局外壳与面板
   ------------------------------------------------------------ */

.shell {
  padding: 22px 0 96px;
}

.panel,
.token-panel,
.hero {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.section-heading span {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.section-heading > div span {
  display: block;
  margin-top: 2px;
}

/* ------------------------------------------------------------
   密码面板 / 表单控件
   ------------------------------------------------------------ */

.token-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--card);
}

input:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}

select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  background: var(--card);
}

.button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  background: var(--paper-deep);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

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

.button:hover {
  filter: brightness(0.98);
}

.button--primary {
  border-color: var(--accent-deep);
  color: #fdf6ee;
  background: var(--accent);
}

.button--primary:hover {
  filter: none;
  background: var(--accent-deep);
}

.button--danger {
  border: 1.5px solid color-mix(in srgb, var(--alert) 65%, var(--line-strong));
  color: var(--alert);
  background: transparent;
}

.button--compact {
  min-height: 33px;
  padding: 0 11px;
  font-size: 13px;
  border-color: var(--line);
  background: var(--paper-deep);
}

.button.button--compact {
  min-height: 33px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.inline-message {
  min-height: 22px;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.inline-message.is-error {
  color: var(--alert);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

/* ------------------------------------------------------------
   主卡片(现在)
   ------------------------------------------------------------ */

.hero {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 20px 20px 18px;
  overflow: hidden;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--idle);
  opacity: 0.55;
  transition: background 0.4s ease;
}

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.hero__body h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hero__sub,
.hero__hint,
#controlHint {
  color: var(--ink-soft);
  font-size: 13px;
}

.hero__time span {
  display: block;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.hero__hint {
  color: var(--ink-faint);
  font-size: 12.5px;
}

/* 进度刻度:0 → 30 分钟,15/20/25/30 提醒点 */

.hero__progress {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.progress-track {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
  overflow: visible;
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--active);
  transition: width 0.6s ease, background 0.4s ease;
}

.progress-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--line-strong);
}

.progress-labels {
  position: relative;
  height: 16px;
  color: var(--ink-faint);
  font-size: 11px;
}

.progress-labels span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.progress-labels span:last-child {
  transform: translateX(-100%);
}

/* 状态变奏 */

.hero--idle .hero__progress {
  display: none;
}

.hero--active {
  border-color: color-mix(in srgb, var(--active) 32%, var(--line));
  background: linear-gradient(180deg, var(--active-wash), var(--card) 65%);
}

.hero--active::before { background: var(--active); }
.hero--active .hero__badge { background: color-mix(in srgb, var(--active) 14%, var(--card)); color: var(--active); }

.hero--warn {
  border-color: color-mix(in srgb, var(--warn) 36%, var(--line));
  background: linear-gradient(180deg, var(--warn-wash), var(--card) 65%);
}

.hero--warn::before { background: var(--warn); }
.hero--warn .hero__badge { background: color-mix(in srgb, var(--warn) 14%, var(--card)); color: var(--warn); }
.hero--warn .progress-fill { background: var(--warn); }

.hero--alert {
  border-color: color-mix(in srgb, var(--alert) 36%, var(--line));
  background: linear-gradient(180deg, var(--alert-wash), var(--card) 65%);
}

.hero--alert::before { background: var(--alert); }
.hero--alert .hero__badge { background: color-mix(in srgb, var(--alert) 13%, var(--card)); color: var(--alert); }
.hero--alert .progress-fill { background: var(--alert); }

.hero--paused {
  border-color: color-mix(in srgb, var(--paused) 32%, var(--line));
  background: linear-gradient(180deg, var(--paused-wash), var(--card) 65%);
}

.hero--paused::before { background: var(--paused); }
.hero--paused .hero__badge { background: color-mix(in srgb, var(--paused) 13%, var(--card)); color: var(--paused); }
.hero--paused .hero__progress { display: none; }

.hero--ending::before { background: var(--idle); }
.hero--ending .hero__progress { display: none; }

/* ------------------------------------------------------------
   远程控制
   ------------------------------------------------------------ */

.control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.control-panel__copy h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.control-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

/* ------------------------------------------------------------
   今日统计条
   ------------------------------------------------------------ */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  overflow: hidden;
}

.stat-cell {
  padding: 16px 18px 14px;
}

.stat-cell + .stat-cell {
  border-left: 1px solid var(--line);
}

.stat-cell span {
  display: block;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.stat-cell strong {
  display: block;
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   趋势
   ------------------------------------------------------------ */

.trend-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.period-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
}

.period-toggle__button {
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.period-toggle__button.is-active {
  color: var(--ink);
  background: var(--card);
  font-weight: 600;
  box-shadow: 0 1px 3px rgb(43 38 32 / 10%);
}

.period-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}

.period-nav span {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
}

.period-nav__button {
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.screen-card__summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.screen-card__summary span {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.screen-card__summary strong {
  display: block;
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.trend-chart {
  min-height: 200px;
}

.trend-chart__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--ink-faint);
  font-size: 12px;
}

.trend-chart__caption strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.trend-chart__body {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.trend-chart__axis {
  display: flex;
  height: 160px;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trend-chart__plot {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(18px, 1fr);
  align-items: end;
  gap: 9px;
  min-height: 188px;
  overflow-x: auto;
}

.trend-bucket {
  display: grid;
  grid-template-rows: 160px auto;
  gap: 6px;
  min-width: 18px;
  text-align: center;
}

.trend-bucket > span {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.trend-bar__track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 160px;
  border-bottom: 1px solid var(--line-strong);
  background:
    linear-gradient(to top, var(--line) 1px, transparent 1px) 0 33% / 100% 33%,
    linear-gradient(to top, var(--line) 1px, transparent 1px) 0 66% / 100% 33%;
}

.trend-bar {
  display: flex;
  flex-direction: column-reverse;
  width: min(100%, 20px);
  min-height: 0;
  overflow: hidden;
  border-radius: 5px 5px 0 0;
  background: var(--paper-deep);
}

.trend-bar__segment {
  display: block;
  width: 100%;
}

.trend-empty {
  display: grid;
  min-height: 156px;
  place-items: center;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--paper-deep) 55%, transparent);
}

.category-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.category-legend:empty {
  display: none;
}

.category-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.category-legend__item strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.category-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
}

.category-dot--science,
.trend-bar__segment--science { background: var(--cat-science); }

.category-pill--science {
  color: #31536b;
  background: color-mix(in srgb, var(--cat-science) 16%, var(--card));
}

.category-dot--animation,
.trend-bar__segment--animation { background: var(--cat-animation); }

.category-pill--animation {
  color: #7c5a13;
  background: color-mix(in srgb, var(--cat-animation) 20%, var(--card));
}

.category-dot--nature,
.trend-bar__segment--nature { background: var(--cat-nature); }

.category-pill--nature {
  color: #3c5c2c;
  background: color-mix(in srgb, var(--cat-nature) 17%, var(--card));
}

.category-dot--craft,
.trend-bar__segment--craft { background: var(--cat-craft); }

.category-pill--craft {
  color: #64406a;
  background: color-mix(in srgb, var(--cat-craft) 16%, var(--card));
}

.category-dot--music,
.trend-bar__segment--music { background: var(--cat-music); }

.category-pill--music {
  color: #51545c;
  background: color-mix(in srgb, var(--cat-music) 17%, var(--card));
}

.category-dot--game,
.trend-bar__segment--game { background: var(--cat-game); }

.category-pill--game {
  color: #2c5e54;
  background: color-mix(in srgb, var(--cat-game) 15%, var(--card));
}

.category-dot--entertainment,
.trend-bar__segment--entertainment { background: var(--cat-entertainment); }

.category-pill--entertainment {
  color: #774226;
  background: color-mix(in srgb, var(--cat-entertainment) 17%, var(--card));
}

.category-dot--uncategorized,
.trend-bar__segment--uncategorized { background: var(--cat-uncategorized); }

.category-pill--uncategorized {
  color: #6a6457;
  background: color-mix(in srgb, var(--cat-uncategorized) 20%, var(--card));
}

/* ------------------------------------------------------------
   观看顺序(时间线)
   ------------------------------------------------------------ */

.timeline {
  display: grid;
  margin-top: 2px;
}

.timeline-event {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 10px 0 14px 22px;
}

.timeline-event::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--cat-color, var(--ink-faint));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-color, var(--ink-faint)) 16%, transparent);
}

.timeline-event::after {
  content: "";
  position: absolute;
  left: 7.5px;
  top: 32px;
  bottom: -4px;
  width: 1px;
  background: var(--line);
}

.timeline-event:last-child::after {
  display: none;
}

.timeline-event .content-item__main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.timeline-event .content-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* ------------------------------------------------------------
   内容列表 / 排行
   ------------------------------------------------------------ */

.content-list {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
}

.content-item,
.notification-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card) 60%, var(--paper));
}

.content-item {
  display: grid;
  gap: 7px;
}

.content-item__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-item__actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.content-item__title {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.content-item__title--ranked {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.content-item__meta,
.notification-item p {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.content-item__time,
.item-duration {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.item-duration {
  font-family: var(--font-display);
  font-weight: 700;
}

.content-item__time {
  color: var(--ink-faint);
  font-size: 12px;
}

.rank-number {
  flex: 0 0 auto;
  width: 22px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  text-align: center;
}

.most-watched-item .content-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.watch-progress {
  height: 5px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--paper-deep);
}

.watch-progress span {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--ink-faint);
}

.watch-progress span.watch-progress__fill--science { background: var(--cat-science); }
.watch-progress span.watch-progress__fill--animation { background: var(--cat-animation); }
.watch-progress span.watch-progress__fill--nature { background: var(--cat-nature); }
.watch-progress span.watch-progress__fill--craft { background: var(--cat-craft); }
.watch-progress span.watch-progress__fill--music { background: var(--cat-music); }
.watch-progress span.watch-progress__fill--game { background: var(--cat-game); }
.watch-progress span.watch-progress__fill--entertainment { background: var(--cat-entertainment); }
.watch-progress span.watch-progress__fill--uncategorized { background: var(--cat-uncategorized); }

/* ------------------------------------------------------------
   提醒记录
   ------------------------------------------------------------ */

.notification-status {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.notification-status--success { color: var(--active); }
.notification-status--failed { color: var(--alert); }

.notification-time {
  color: var(--ink-faint) !important;
  font-size: 12px !important;
}

/* ------------------------------------------------------------
   应用分类
   ------------------------------------------------------------ */

.app-category-section {
  gap: 12px;
}

.app-profile__main {
  align-items: flex-start;
}

.app-list-in-category {
  display: grid;
  gap: 8px;
}

.app-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}

.app-row__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
}

.app-control-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.app-control-state.is-controlled {
  color: var(--active);
  background: var(--active-wash);
}

.app-control-state.is-free {
  color: var(--ink-soft);
  background: var(--paper-deep);
}

.app-edit-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.app-edit-row--policy {
  grid-template-columns: auto minmax(90px, 1fr) minmax(90px, 1fr) auto;
}

.switch-row,
.number-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.switch-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.number-field {
  justify-content: flex-end;
}

.number-field input {
  width: 72px;
  min-height: 38px;
  text-align: right;
}

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */

@media (min-width: 641px) {
  .trend-chart__plot {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .topbar__inner,
  .shell {
    width: min(100vw - 28px, 700px);
  }

  .shell {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }

  .tabs--top {
    display: none;
  }

  .tabs--bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .tabs--bottom .tab {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 5px 0 3px;
    border-radius: 12px;
    color: var(--ink-faint);
    font-size: 11px;
  }

  .tabs--bottom .tab svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .tabs--bottom .tab.is-active {
    color: var(--accent);
    font-weight: 600;
  }

  .token-row,
  .control-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .control-panel__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 48px;
  }

  .button.button--compact {
    min-height: 33px;
  }

  .hero__time span {
    font-size: 46px;
  }

  .stat-strip {
    grid-template-columns: 1fr;
  }

  .stat-cell {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 13px 16px;
  }

  .stat-cell + .stat-cell {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stat-cell strong {
    margin-top: 0;
    font-size: 21px;
  }

  .screen-card__summary {
    display: grid;
    align-items: start;
  }

  .screen-card__summary strong {
    font-size: 33px;
  }

  .trend-chart__plot {
    grid-auto-columns: minmax(16px, 1fr);
    gap: 6px;
  }

  .trend-chart__body {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 6px;
  }

  .app-edit-row,
  .app-edit-row--policy {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .app-row__summary {
    grid-template-columns: 1fr;
  }

  .number-field {
    justify-content: space-between;
  }

  .number-field input {
    width: 120px;
  }
}
