/* Speaking · 跟读练习 — LingoFruit Chinese
 * Layered over /tokens.css and /site.css. Local recording + playback, NO automatic scoring. */

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: center;
  padding: clamp(32px, 5vw, 60px) 0 var(--s-6);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: var(--s-3) 0 var(--s-4);
}

.art {
  padding: var(--s-6);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  min-height: 240px;
}

.sheet {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  width: min(100%, 248px);
  padding: var(--s-5);
  text-align: center;
}

.sheet .han {
  width: 96px;
  height: 96px;
  margin: var(--s-3) auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--gridline);
  border-radius: var(--r-sm);
  background:
    linear-gradient(90deg, transparent 49.5%, var(--gridline) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, var(--gridline) 50%, transparent 50.5%),
    var(--surface);
  font-family: var(--font-zh);
  font-size: 56px;
  line-height: 1;
}

.sheet b { color: var(--ochre); }
.sheet .py { font-size: var(--text-sm); color: var(--ink-3); font-weight: 500; margin-top: 6px; }

/* ---- Notice (no-scoring) ---- */
.notice {
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
  background: var(--warn-bg);
  border: 1px solid var(--warn-rule);
  border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5);
  margin: 0 0 var(--s-4);
}

.notice .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--warn);
  flex: 0 0 36px;
}

.notice .ico svg { width: 20px; height: 20px; }
.notice h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: var(--text-h3); color: var(--ink); }
.notice p { margin: 0; color: var(--ink-2); font-size: var(--text-sm); line-height: 1.65; }

/* ---- Sections ---- */
section.block { margin: var(--s-7) 0 0; }

.section-title {
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-4);
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
}

.section-title .zh {
  color: var(--ochre);
  font-family: var(--font-zh);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ---- Tone chart ---- */
.tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s-3);
}

.tone {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-4);
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}

.tone:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tone .mark { font-size: 1.5rem; color: var(--accent-mid); font-weight: 700; line-height: 1.1; }
.tone .name { display: block; font-size: var(--text-xs); font-weight: 600; color: var(--ink-3); margin: 4px 0 var(--s-2); }
.tone .han { font-family: var(--font-zh); font-size: 2.25rem; line-height: 1.2; color: var(--ink); }
.tone .py { color: var(--ochre); font-weight: 600; font-size: var(--text-base); }
.tone .en { color: var(--ink-3); font-size: var(--text-xs); margin-top: 2px; }
.tone .hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-4);
  margin-top: var(--s-2);
}
.tone .hint svg { width: 13px; height: 13px; }

/* ---- Record button variant ---- */
.btn.rec {
  background: var(--err);
  border-color: var(--err);
  color: var(--surface);
}

.btn.rec:hover:not(:disabled) {
  background: #8c2f27;
  border-color: #8c2f27;
}

.btn.rec.recording {
  animation: rec-pulse 1.1s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 60, 50, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(168, 60, 50, 0); }
}

/* ---- Phrase cards ---- */
.phrases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--s-4);
}

.phrase {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.phrase .focus {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ochre);
  background: var(--ochre-soft);
  border: 1px solid var(--ochre-rule);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}

.phrase .han { font-family: var(--font-zh); font-size: 1.75rem; line-height: 1.3; color: var(--ink); }
.phrase .py { color: var(--ochre); font-weight: 600; font-size: var(--text-base); }
.phrase .en { color: var(--ink-2); font-size: var(--text-sm); margin-bottom: var(--s-1); }
.phrase .row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }

.rec-status {
  font-size: var(--text-xs);
  color: var(--ink-3);
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s-1);
}

.rec-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-4);
  flex: 0 0 8px;
  display: inline-block;
}

.rec-status.live .dot { background: var(--err); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.rec-status.live { color: var(--err); font-weight: 600; }

.done-mark {
  position: absolute;
  top: var(--s-4);
  right: var(--s-4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-rule);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  font-weight: 650;
}

.done-mark svg { width: 13px; height: 13px; }

.note {
  color: var(--ink-3);
  font-size: var(--text-sm);
  margin: var(--s-4) 0 0;
}

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: var(--s-5); }
  .art { min-height: 0; padding: var(--s-5); }
  .phrases { grid-template-columns: 1fr; }
}
