:root {
  --bg: #e6e2d8;
  --bg-elevated: #eeebdf;
  --surface: #faf8f4;
  --border: rgba(42, 38, 32, 0.1);
  --text: #2a2620;
  --muted: #5f5a52;
  --accent: #4a6b52;
  --accent-soft: rgba(74, 107, 82, 0.14);
  --accent-muted: #6d8574;
  --success: #3d6b4f;
  --warning: #7a6239;
  --danger: #9a4a43;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: linear-gradient(180deg, #ebe7dd 0%, #e3dfd4 48%, #dcd8cc 100%);
  color: var(--text);
  line-height: 1.62;
  padding: calc(14px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 520px;
  margin: 0 auto;
}

/* el() 多根节点时的包裹层：不参与布局，子节点仍相当于挂在 #app 下 */
.el-fragment-wrap {
  display: contents;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 {
  font-size: 1.45rem;
  margin: 0 0 8px;
  color: var(--text);
}

h2 {
  font-size: 1.12rem;
  margin: 0 0 12px;
  color: var(--text);
}

h3 {
  font-size: 1.02rem;
  margin: 0 0 8px;
  color: var(--text);
}

p {
  margin: 0 0 12px;
  color: var(--muted);
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(42, 38, 32, 0.04), 0 8px 24px rgba(42, 38, 32, 0.05);
}

.card--accent {
  border-color: rgba(74, 107, 82, 0.28);
  background: linear-gradient(165deg, #faf8f4 0%, #eef2ea 55%, #e8ebe4 100%);
  box-shadow: 0 2px 8px rgba(74, 107, 82, 0.08);
}

.card--next {
  border-color: rgba(90, 110, 100, 0.22);
  background: linear-gradient(180deg, #f7f6f1, #f0f3ee);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.tag--soft {
  color: var(--muted);
  background: rgba(95, 90, 82, 0.1);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, #5a7a62, #4a6b52);
  color: #fdfcf9;
  box-shadow: 0 2px 8px rgba(74, 107, 82, 0.25);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn + .btn {
  margin-top: 10px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chip[aria-pressed="true"] {
  border-color: rgba(74, 107, 82, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.streak {
  font-size: 0.875rem;
  color: var(--warning);
  font-weight: 600;
}

.time-pill {
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.timeline-body {
  flex: 1;
}

.timeline-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.quiz-q {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option {
  text-align: left;
  padding: 14px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option:hover {
  border-color: rgba(74, 107, 82, 0.35);
  background: rgba(255, 255, 255, 0.65);
}

.option.correct {
  border-color: rgba(61, 107, 79, 0.45);
  background: rgba(61, 107, 79, 0.1);
}

.option.wrong {
  border-color: rgba(154, 74, 67, 0.45);
  background: rgba(154, 74, 67, 0.08);
}

.option.reveal {
  opacity: 0.85;
}

.lesson-block {
  margin-bottom: 18px;
}

.lesson-block p {
  line-height: 1.68;
}

.lesson-block:last-child {
  margin-bottom: 0;
}

.concept-title {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

textarea.input {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fdfcfa;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  line-height: 1.6;
}

.input-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.done-banner {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(61, 107, 79, 0.1);
  border: 1px solid rgba(61, 107, 79, 0.28);
  color: var(--success);
  font-weight: 600;
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 20px 0 8px;
}

/* 个人学习中心 · 日历 */
.grxx-cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.grxx-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  text-align: center;
  font-size: 0.78rem;
}

.grxx-cal-wd {
  color: var(--muted);
  padding: 4px 0;
  font-weight: 500;
}

.grxx-cal-day {
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text);
  font: inherit;
  padding: 4px 2px;
}

.grxx-cal-day:hover {
  border-color: rgba(74, 107, 82, 0.4);
}

.grxx-cal-day--off {
  opacity: 0.25;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
}

.grxx-cal-day--sel {
  border-color: rgba(74, 107, 82, 0.55);
  box-shadow: 0 0 0 2px var(--accent-soft);
  font-weight: 700;
}

.grxx-cal-day--dots::after {
  content: "";
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-muted);
  margin-top: 2px;
}

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 24px;
  opacity: 0.85;
}
