@import "tailwindcss";

:root { --ink: #19332d; --muted: #6f7f79; --cream: #f5f1e8; --paper: #fffdf8; --sage: #bfd0bd; --orange: #e96f3a; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--cream); color: var(--ink); }
body { font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; padding: 0 38px 38px; }
.topbar { height: 112px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d6d7cd; }
.brand { display: flex; align-items: center; gap: 15px; }
.brandMark { width: 54px; height: 54px; display: grid; place-items: center; color: white; background: var(--orange); border-radius: 50% 50% 48% 42%; font: 800 17px Georgia, serif; transform: rotate(-4deg); }
.eyebrow { margin: 0 0 4px; font: 700 10px/1 var(--font-geist-mono); letter-spacing: .18em; color: var(--orange); }
h1 { margin: 0; font: 600 27px/1.1 Georgia, "Songti SC", serif; letter-spacing: .05em; }
.progressBox { width: 250px; }
.progressBox div:first-child { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.progressBox strong { font-family: var(--font-geist-mono); }
.progressTrack { height: 5px; background: #dedfd6; border-radius: 9px; overflow: hidden; }
.progressTrack i { display: block; height: 100%; background: var(--orange); }
.toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) 250px 110px 120px; gap: 12px; padding: 18px 0; }
.search { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--paper); border: 1px solid #d8d8ce; border-radius: 8px; }
.search span { font-size: 26px; transform: rotate(-15deg); color: var(--orange); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
select, .filter { border: 1px solid #d8d8ce; border-radius: 8px; background: var(--paper); padding: 0 14px; color: var(--ink); }
.filter.active { background: var(--ink); color: white; }
.chineseMode { font-weight: 700; }
.chineseMode.active { border-color: var(--orange); background: var(--orange); }
.workspace { height: calc(100vh - 195px); min-height: 620px; display: grid; grid-template-columns: 390px 1fr; overflow: hidden; border: 1px solid #d5d5cb; border-radius: 12px; background: var(--paper); box-shadow: 0 18px 60px rgba(47, 57, 48, .08); }
.sentenceList { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid #d5d5cb; background: #f8f6ef; }
.listHead { height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid #dddcd3; }
.listHead span { font-weight: 700; }
.listHead small { color: var(--muted); }
.listActions { display: flex; gap: 6px; }
.chapterPlay { padding: 7px 11px; border: 1px solid #cfd3cb; border-radius: 99px; background: var(--paper); color: var(--ink); font-size: 11px; font-weight: 700; }
.chapterPlay:hover { border-color: var(--orange); color: var(--orange); }
.chapterPlay.playing { border-color: var(--orange); background: var(--orange); color: white; }
.chapterPlay:disabled { cursor: not-allowed; opacity: .45; }
.scrollList {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}
.sentence { width: 100%; display: grid; grid-template-columns: 42px 1fr 18px; gap: 6px; text-align: left; padding: 15px 14px; border: 0; border-bottom: 1px solid #e3e1d9; background: transparent; color: var(--ink); }
.sentence:hover { background: #fff; }
.sentence.active { background: var(--ink); color: white; }
.sentence .index { padding-top: 2px; font: 600 10px var(--font-geist-mono); color: #9a9f98; }
.sentence strong, .sentence em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sentence strong { font: 600 14px/1.35 Georgia, serif; }
.sentence em { margin-top: 5px; font-size: 12px; font-style: normal; color: #7d8984; }
.sentence.active em { color: #c8d4cf; }
.sentence b { color: #f3b646; }
.limitNote { padding: 18px; color: var(--muted); font-size: 12px; text-align: center; }
.lesson { overflow-y: auto; padding: 0 clamp(28px, 5vw, 76px); }
.lessonMeta { height: 56px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; border-bottom: 1px solid #e4e2da; }
.heroSentence { position: relative; padding: 54px 0 42px; border-bottom: 1px solid #d9d8ce; }
.number { position: absolute; left: -44px; top: 60px; margin: 0; font: 700 10px var(--font-geist-mono); color: var(--orange); writing-mode: vertical-rl; letter-spacing: .15em; }
.heroSentence h2 { max-width: 920px; margin: 0; font: 500 clamp(34px, 4vw, 59px)/1.05 Georgia, serif; letter-spacing: -.035em; }
.translation { margin: 20px 0 0; font: 500 20px Georgia, "Songti SC", serif; color: #52655f; }
.correction { display: inline-block; margin: 18px 0 0; padding: 7px 10px; border-radius: 4px; background: #fff0e8; color: #a34a27; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.actions button { padding: 9px 14px; border: 1px solid #cfd3cb; border-radius: 99px; background: transparent; color: var(--ink); font-size: 12px; }
.actions button:first-child { background: var(--orange); border-color: var(--orange); color: white; }
.actions button:disabled { cursor: not-allowed; opacity: .48; background: #d7d5cd; border-color: #d7d5cd; color: #59645f; }
.actions button.selected { background: #fff3cc; border-color: #e8c666; }
.actions button.learned { background: var(--sage); border-color: var(--sage); }
.lessonFoot { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0 34px; color: var(--muted); font-size: 11px; }
.lessonFoot button { border: 0; background: none; color: var(--ink); font-weight: 700; }
.lessonFoot button:disabled { opacity: .25; }
.practiceDialog { width: min(680px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 28px 90px rgba(25,51,45,.3); }
.practiceDialog::backdrop { background: rgba(25,51,45,.72); backdrop-filter: blur(5px); }
.practiceTop { display: flex; align-items: flex-start; justify-content: space-between; padding: 28px 30px 20px; }
.practiceTop p { margin: 0 0 6px; color: var(--orange); font: 700 10px var(--font-geist-mono); letter-spacing: .15em; }
.practiceTop h2 { margin: 0; font: 600 24px Georgia, "Songti SC", serif; }
.practiceTop button { border: 0; background: none; color: var(--muted); font-size: 28px; }
.practiceHeading label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 11px; }
.practiceHeading select { width: min(410px, 68vw); height: 42px; background: #f8f6ef; font-weight: 600; }
.practiceRoleLabel { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; }
.practiceRoleSwitch { display: flex; flex-wrap: wrap; gap: 3px; width: fit-content; max-width: 100%; padding: 3px; border-radius: 12px; background: #e9e7df; }
.practiceTop .practiceRoleSwitch button { padding: 7px 14px; border-radius: 99px; color: var(--muted); font-size: 12px; font-weight: 700; }
.practiceTop .practiceRoleSwitch button.active { background: var(--ink); color: white; box-shadow: 0 2px 8px rgba(25,51,45,.16); }
.practiceProgress { height: 4px; background: #e6e2d8; }
.practiceProgress i { display: block; width: 0; height: 100%; background: var(--orange); transition: width .25s ease; }
.practiceStep { margin: 24px 30px 0; color: var(--muted); font: 700 11px var(--font-geist-mono); }
.practiceSentence { min-height: 190px; display: grid; align-content: center; gap: 18px; padding: 25px 42px; text-align: center; }
.practiceSentence strong { font: 500 clamp(30px, 5vw, 48px)/1.08 Georgia, serif; }
.practiceSentence span { color: #52655f; font: 500 18px Georgia, "Songti SC", serif; }
.practiceSentence .practiceRole { width: fit-content; margin: 0 auto -4px; padding: 6px 12px; border-radius: 99px; font-size: 12px; letter-spacing: .08em; }
.practiceSentence .practiceRole.parent { background: #e4eee8; color: #315b49; }
.practiceSentence .practiceRole.child { background: #fff0e4; color: #a45127; }
.practiceCue { width: fit-content; margin: 0 auto 24px; padding: 9px 16px; border-radius: 99px; background: #e9eee7; color: #486058; font-size: 13px; font-weight: 700; }
.practiceControls { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; padding: 0 30px; }
.practiceControls button { min-height: 44px; border: 1px solid #d5d5cb; border-radius: 9px; background: transparent; color: var(--ink); font-weight: 700; }
.practiceControls .primary { border-color: var(--orange); background: var(--orange); color: white; }
.practiceHint { margin: 18px 30px 26px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .shell { padding: 0 16px 20px; }
  .topbar { height: 90px; }
  .progressBox { display: none; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search { grid-column: 1 / -1; }
  .workspace { height: auto; min-height: 0; display: block; overflow: visible; }
  .sentenceList { height: 326px; border-right: 0; border-bottom: 1px solid #d5d5cb; }
  .scrollList { height: auto; }
  .lesson { overflow: visible; padding: 0 24px; }
  .heroSentence { padding-top: 38px; }
  .number { display: none; }
}
@media (max-width: 580px) {
  h1 { font-size: 21px; }
  .brandMark { width: 44px; height: 44px; }
  .toolbar { grid-template-columns: 1fr; }
  .search { grid-column: auto; }
  .toolbar select, .toolbar button { height: 42px; }
  .lessonMeta span:first-child { max-width: 55%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .heroSentence h2 { font-size: 36px; }
  .lessonFoot span { display: none; }
}
