:root {
  color-scheme: dark;
  --canvas: oklch(0.145 0.006 50);
  --surface: oklch(0.18 0.008 50 / 0.72);
  --surface-strong: oklch(0.21 0.01 50 / 0.86);
  --line: oklch(0.78 0.012 70 / 0.15);
  --text: oklch(0.94 0.012 75);
  --muted: oklch(0.72 0.015 75);
  --accent: oklch(0.71 0.185 55);
  --accent-dim: oklch(0.57 0.15 55);
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --page-pad: clamp(18px, 5vw, 26px);
  --display-font: "Arial Narrow", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --body-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--text); font-family: var(--body-font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input { font: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 10px 14px; border-radius: var(--radius-s); background: var(--accent); color: #1b1005; transform: translateY(-160%); transition: transform 160ms ease-out; }
.skip-link:focus { transform: translateY(0); }
.app-shell { max-width: 660px; min-height: 100dvh; margin: 0 auto; padding: max(env(safe-area-inset-top), 20px) var(--page-pad) max(env(safe-area-inset-bottom), 20px); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 10px 0 28px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display-font); font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(34px, 10vw, 46px); line-height: 0.98; letter-spacing: -0.045em; }
h2 { font-size: 21px; line-height: 1.14; letter-spacing: -0.018em; }
.eyebrow { color: var(--muted); font-size: 12px; line-height: 1.4; letter-spacing: 0.08em; }
.subtle { color: var(--muted); font-size: 13px; line-height: 1.55; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.import-button, .refresh-button { display: inline-flex; min-height: 40px; align-items: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; touch-action: manipulation; transition-property: transform, background-color, border-color; transition-duration: 160ms; transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
.refresh-button { color: var(--muted); }
.import-button:active, .refresh-button:active { transform: scale(0.96); background: var(--surface-strong); }
.import-button input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; overflow: hidden; }
.today-section { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 20px 18px; align-items: center; padding: 0 0 32px; border-bottom: 1px solid var(--line); }
.today-ring { position: relative; display: grid; width: 124px; aspect-ratio: 1; place-items: center; }
.today-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.today-ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: oklch(0.28 0.009 50); }
.ring-value { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 320; stroke-dashoffset: 32; }
.ring-number { font-family: var(--display-font); font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.06em; font-variant-numeric: tabular-nums; }
.today-copy h2 { margin: 6px 0 4px; font-size: 30px; font-variant-numeric: tabular-nums; }
.today-copy h2 span { color: var(--accent); }
.periods { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.period-row { display: flex; align-items: baseline; justify-content: space-between; padding: 13px 0 0; color: var(--muted); font-size: 13px; }
.period-row + .period-row { padding-left: 18px; }
.period-row strong { color: var(--text); font-family: var(--display-font); font-size: 27px; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.period-row i { font-style: normal; font-family: var(--body-font); font-size: 13px; color: var(--muted); letter-spacing: 0; }
.section { padding: 31px 0; border-bottom: 1px solid var(--line); }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin-top: 5px; }
.section-heading-inline { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.total-badge { padding: 6px 9px; border-radius: 999px; background: oklch(0.71 0.185 55 / 0.13); color: var(--accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.trend-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 184px; align-items: end; padding: 10px 0 0; }
.trend-day { display: grid; grid-template-rows: 1fr auto auto; min-width: 0; height: 100%; gap: 7px; align-items: end; text-align: center; }
.bar-zone { position: relative; height: 105px; margin-top: 20px; border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, transparent 32%, var(--line) 32.6%, transparent 33.2%, transparent 65%, var(--line) 65.6%, transparent 66.2%); }
.trend-stack { position: absolute; bottom: 0; left: 50%; display: flex; flex-direction: column-reverse; width: min(100%, 26px); height: var(--bar-height); min-height: 2px; overflow: hidden; border-radius: var(--radius-s) var(--radius-s) 2px 2px; transform: translateX(-50%); transform-origin: bottom; animation: bar-rise 520ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.trend-segment { display: block; min-height: 1px; background: var(--segment-color); }
.trend-value { position: absolute; z-index: 1; bottom: calc(var(--bar-height) + 7px); left: 50%; color: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; transform: translateX(-50%); }
.trend-label { color: var(--muted); font-size: 10px; line-height: 1.45; white-space: nowrap; }
.trend-day.is-current .trend-label { color: var(--accent); }
.trend-day.is-empty .trend-value { visibility: hidden; }
.action-list { display: grid; gap: 16px; }
.action-row { display: grid; grid-template-columns: 9px minmax(54px, 0.82fr) 38px minmax(84px, 1.55fr) 34px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.action-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--action-color); }
.action-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.action-count { color: var(--action-color); text-align: right; font-family: var(--display-font); font-size: 22px; font-weight: 700; letter-spacing: -0.025em; }
.action-count i { color: var(--muted); font-family: var(--body-font); font-size: 11px; font-style: normal; letter-spacing: 0; }
.action-track { overflow: hidden; height: 7px; border-radius: 999px; background: oklch(0.3 0.008 50); }
.action-fill { display: block; height: 100%; border-radius: inherit; background: var(--action-color); transform-origin: left; animation: fill-in 520ms 100ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.action-percent { color: var(--muted); text-align: right; font-size: 12px; }
.lower-grid { display: grid; gap: 0; padding: 31px 0 10px; }
.streak-panel { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.streak-number { display: flex; align-items: baseline; gap: 7px; padding: 8px 0 1px; }
.streak-number strong { color: var(--accent); font-family: var(--display-font); font-size: 72px; line-height: 0.95; letter-spacing: -0.065em; font-variant-numeric: tabular-nums; }
.streak-number span { color: var(--muted); font-size: 16px; }
.records-panel { padding-top: 28px; }
.records-panel h2 { margin: 5px 0 14px; }
.record-list { display: grid; }
.record-row { display: grid; grid-template-columns: 47px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.record-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.record-action { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-sets { color: var(--accent); font-family: var(--display-font); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.record-empty { padding: 16px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 14px; }
.status-bar { display: flex; align-items: center; gap: 8px; padding: 23px 0 8px; color: var(--muted); font-size: 11px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.enter { opacity: 0; transform: translateY(12px); }
.ready .enter { animation: enter 440ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.ready .enter:nth-child(2) { animation-delay: 70ms; }
.ready .enter:nth-child(3) { animation-delay: 130ms; }
.ready .enter:nth-child(4) { animation-delay: 190ms; }
@keyframes enter { to { opacity: 1; transform: translateY(0); } }
@keyframes bar-rise { from { transform: translateX(-50%) scaleY(0); } to { transform: translateX(-50%) scaleY(1); } }
@keyframes fill-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (min-width: 520px) { .app-shell { padding-inline: 34px; } .today-section { grid-template-columns: 142px minmax(0, 1fr) 152px; } .today-ring { width: 142px; } .periods { grid-column: 3; grid-row: 1; display: block; border-top: 0; border-left: 1px solid var(--line); padding-left: 20px; } .period-row { padding: 0 0 16px; } .period-row + .period-row { padding-left: 0; padding-top: 16px; border-top: 1px solid var(--line); } .lower-grid { grid-template-columns: 0.72fr 1.28fr; } .streak-panel { padding: 0 24px 0 0; border-bottom: 0; border-right: 1px solid var(--line); } .records-panel { padding: 0 0 0 24px; } }
@media (hover: hover) { .import-button:hover, .refresh-button:hover { border-color: oklch(0.71 0.185 55 / 0.55); background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }
