:root {
  --paper: #fbf7ed;
  --ink: #1f241d;
  --muted: #6b6357;
  --line: rgba(69, 55, 34, 0.14);
  --panel: rgba(255, 252, 245, 0.90);
  --green: #1f6b4b;
  --green-deep: #174b36;
  --gold: #a96f1d;
  --shadow: 0 20px 60px rgba(61, 43, 20, 0.10);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(169, 111, 29, 0.16), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(31, 107, 75, 0.15), transparent 28%),
    linear-gradient(135deg, #efe0c4 0%, #fbf7ed 42%, #f7efe1 100%);
  font-family: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.memorize-shell {
  width: min(1440px, calc(100% - 22px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.memorize-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.memorize-brand,
.memorize-nav a,
.soft-link {
  color: inherit;
  text-decoration: none;
}

.memorize-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.memorize-brand img {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  object-fit: cover;
}

.memorize-brand strong,
.memorize-brand em {
  display: block;
}

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

.memorize-brand em {
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.memorize-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.memorize-nav a,
.soft-btn,
.primary-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.52);
}

.primary-btn {
  width: 100%;
  margin-top: 14px;
  color: white;
  background: var(--green);
  border-color: var(--green);
  font-weight: 800;
}

.memorize-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.memorize-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding-right: 4px;
}

.panel-card,
.recite-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-card {
  padding: 16px;
}

.recite-card {
  min-height: calc(100vh - 112px);
  padding: clamp(26px, 4vw, 58px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font: 800 11px/1.2 "IBM Plex Sans", "Noto Sans SC", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  line-height: 1.2;
}

h1 {
  font-size: 25px;
}

h2 {
  font-size: 20px;
}

.today-progress,
.status {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.today-progress {
  margin-top: 12px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(69, 55, 34, 0.10);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transition: width 180ms ease;
}

.tab-list,
.memorize-card-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tab-btn,
.memory-list-card {
  width: 100%;
  border: 1px solid rgba(69, 55, 34, 0.12);
  border-radius: 16px;
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
}

.tab-btn {
  font-weight: 800;
  color: var(--green-deep);
}

.tab-btn.is-active,
.memory-list-card.is-active {
  border-color: rgba(31, 107, 75, 0.28);
  background: rgba(235, 247, 238, 0.72);
}

.memory-list-title,
.memory-list-meta,
.memory-list-snippet {
  display: block;
}

.memory-list-title {
  font-weight: 900;
  line-height: 1.45;
}

.memory-list-meta {
  margin-top: 3px;
  color: var(--green-deep);
  font: 700 12px/1.5 "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.memory-list-snippet {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.recite-empty {
  max-width: 680px;
  margin: 0 auto;
  padding-top: 12vh;
}

.recite-empty h2 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 52px);
}

.recite-empty p {
  color: var(--muted);
  line-height: 1.8;
}

.recite-content {
  width: min(100%, 850px);
  margin: 0 auto;
}

.recite-meta {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  color: rgba(107, 99, 87, 0.76);
  font: 600 15px/1.6 "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.mode-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, 0.48);
  font-weight: 800;
}

.mode-btn.is-active {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

.recite-text-card {
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(69, 55, 34, 0.12);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(169, 111, 29, 0.06), transparent 18%, transparent 82%, rgba(31, 107, 75, 0.05)),
    rgba(255, 253, 247, 0.80);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62), 0 16px 42px rgba(61, 43, 20, 0.08);
}

.recite-text-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--gold);
  font: 800 14px/1.4 "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.recite-text {
  min-height: 220px;
  font-size: clamp(25px, 2.1vw, 32px);
  line-height: 1.95;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

.covered-line {
  display: block;
  margin-bottom: 12px;
  color: transparent;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(31, 107, 75, 0.18), rgba(169, 111, 29, 0.14));
  user-select: none;
}

.mode-blank {
  color: var(--ink);
}

.reveal-btn {
  margin-top: 18px;
}

.support-panel {
  margin-top: 16px;
  border: 1px solid rgba(69, 55, 34, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.support-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--green-deep);
  font: 800 14px/1.4 "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

.support-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  color: #3f493e;
  line-height: 1.8;
}

.support-body p {
  margin-bottom: 0;
}

.keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-row span {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green-deep);
  background: rgba(31, 107, 75, 0.10);
  font-size: 12px;
  font-weight: 800;
}

.soft-link {
  color: var(--green-deep);
  font-weight: 800;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.review-actions button {
  min-height: 52px;
  border: 1px solid rgba(31, 107, 75, 0.20);
  border-radius: 16px;
  color: var(--green-deep);
  background: rgba(235, 247, 238, 0.68);
  font-weight: 900;
}

.review-actions button:last-child {
  color: white;
  background: var(--green);
  border-color: var(--green);
}

@media (max-width: 920px) {
  .memorize-shell {
    width: min(100% - 18px, 760px);
  }

  .memorize-topbar,
  .memorize-layout {
    grid-template-columns: 1fr;
  }

  .memorize-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .memorize-sidebar {
    position: static;
    max-height: none;
  }

  .recite-card {
    min-height: auto;
    padding: 22px;
  }

  .review-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .recite-text-card {
    padding: 20px;
  }

  .recite-text {
    font-size: 23px;
    line-height: 1.9;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }
}
