:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --text: #2c2c2a;
  --muted: #888780;
  --line: rgba(0, 0, 0, 0.09);
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --ok: #0f6e56;
  --ok-soft: #e1f5ee;
  --warn: #a32d2d;
  --warn-soft: #fcebeb;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 12px;
}
.brand { font-size: 15px; font-weight: 500; letter-spacing: 0.05em; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 18px; font-size: 14px; }

main { flex: 1; padding: 40px 0 56px; }

.hero { margin-bottom: 32px; }
.hero h1 { font-size: 26px; font-weight: 500; line-height: 1.4; }
.hero p { margin-top: 10px; color: var(--muted); font-size: 15px; }

h2 { font-size: 17px; font-weight: 500; margin: 36px 0 14px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: block;
  color: var(--text);
}
.card:hover { text-decoration: none; border-color: rgba(0, 0, 0, 0.2); }
.card h3 { font-size: 15px; font-weight: 500; }
.card p { margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.card .tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.card.dim { opacity: 0.75; }

.list { list-style: none; border-top: 1px solid var(--line); }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.list .day { color: var(--muted); font-size: 13px; }
.list .badge {
  font-size: 12px;
  color: var(--ok);
  background: var(--ok-soft);
  border-radius: 999px;
  padding: 1px 9px;
}

.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.prose p { font-size: 15px; margin-bottom: 12px; }
.prose ul { padding-left: 20px; font-size: 15px; margin-bottom: 12px; }
.prose li { margin-bottom: 6px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
button, select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:active { transform: translateY(1px); }

.flashcard {
  margin: 22px auto 0;
  max-width: 320px;
  height: 170px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}
.flashcard .word { font-size: 30px; font-weight: 500; }
.flashcard .meaning { font-size: 24px; color: var(--accent); }
.flashcard .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.question { font-size: 30px; font-weight: 500; letter-spacing: 0.04em; }
.answer-input {
  margin-top: 16px;
  font-size: 22px;
  width: 140px;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  color: var(--text);
}
.feedback { margin-top: 14px; font-size: 14px; min-height: 22px; }
.feedback.ok { color: var(--ok); }
.feedback.no { color: var(--warn); }
.score { margin-top: 8px; font-size: 13px; color: var(--muted); }

.site-beian {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 18px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.site-beian .sep { margin: 0 0.6em; opacity: 0.45; }
.site-beian a { color: var(--muted); }
.site-beian a:hover { color: var(--text); }

.timer { text-align: center; }
.timer-state { font-size: 13px; color: var(--muted); }
.timer-time {
  font-size: 44px;
  font-weight: 500;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.timer-task { font-size: 13px; color: var(--muted); min-height: 20px; }

/* 圆形进度环 */
.ring-wrap {
  position: relative;
  width: 240px;
  max-width: 100%;
  margin: 4px auto 0;
  aspect-ratio: 1 / 1;
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 8;
}
.ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke 0.3s;
}
.ring-wrap.rest .ring-bar { stroke: var(--ok); }
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 34px;
}
.ring-center .timer-time { margin: 2px 0 4px; }
.ring-center .timer-task { font-size: 12px; line-height: 1.4; }

/* 时长选择 */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}
.presets .chip {
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--card);
}
.presets .chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.presets .custom { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.presets .custom input {
  width: 58px;
  font-family: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.add-row { display: flex; gap: 10px; margin-top: 18px; }
.add-row input {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}
.add-row input:focus { outline: none; border-color: var(--accent); }

.todos { list-style: none; margin-top: 14px; border-top: 1px solid var(--line); }
.todo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.todo.active {
  background: var(--accent-soft);
  border-radius: 10px;
  padding-left: 8px;
  padding-right: 8px;
}
.todo.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-text { flex: 1; font-size: 14px; word-break: break-word; }
.pomo-count { font-size: 12px; color: var(--ok); white-space: nowrap; }

button.small { font-size: 12px; padding: 4px 10px; border-radius: 8px; }
button.small.danger { color: var(--warn); }

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.settings input {
  width: 56px;
  font-family: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

/* 周历 */
.week {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.week-title { font-size: 15px; font-weight: 500; }
.week-range { margin-left: 10px; font-size: 12px; color: var(--muted); }
.week-nav { display: flex; gap: 8px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 2px 8px;
  text-align: center;
}
.week-day.today { border-color: var(--accent); background: var(--accent-soft); }
.week-day.sel { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.week-day:hover { border-color: rgba(0, 0, 0, 0.25); }
.week-detail { margin-top: 12px; font-size: 13px; color: var(--text); min-height: 18px; }
.week-day .wd { font-size: 11px; color: var(--muted); }
.week-day .dd { font-size: 16px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.week-day .dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px;
  margin-top: 5px;
  min-height: 12px;
}
.week-day .dot { width: 5px; height: 5px; border-radius: 2px; background: var(--ok); }
.week-day .more { font-size: 9px; color: var(--ok); }
.week-day .cnt { margin-top: 4px; font-size: 11px; color: var(--muted); }
.week-sum { margin-top: 12px; font-size: 12px; color: var(--muted); }

@media (max-width: 480px) {
  .hero h1 { font-size: 22px; }
  .nav-links { gap: 14px; font-size: 13px; }
  .brand { font-size: 14px; }
  .timer-time { font-size: 36px; }
  .todo { flex-wrap: wrap; }
  .todo-text { flex: 1 1 60%; }
  .ring-wrap { width: 200px; }
  .ring-center .timer-time { font-size: 34px; }
  .presets { gap: 6px; }
  .presets .chip { font-size: 12px; padding: 4px 10px; }
}
