/* TrueTCM Learning — shared styles */
:root {
  --ink: #16241f;
  --ink-soft: #4a5a54;
  --paper: #fbfaf6;
  --card: #ffffff;
  --line: #e4e1d8;
  --brand: #1f6b54;
  --brand-dark: #185645;
  --brand-soft: #e6f1ec;
  --accent: #c8752b;
  --accent-soft: #fbeee0;
  --good: #2e7d4f;
  --bad: #b3412f;
  --radius: 14px;
  --max: 1100px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.75; font-size: 17px; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.en { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.muted { color: var(--ink-soft); }
.todo { background: #fff3c4; color: #7a5a00; padding: 0 6px; border-radius: 4px; font-size: .92em; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(251,250,246,.94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 66px; }
.logo { display: flex; flex-direction: column; line-height: 1.15; color: var(--ink); font-weight: 700; }
.logo:hover { text-decoration: none; }
.logo .mark { color: var(--brand); }
.logo small { font-weight: 400; color: var(--ink-soft); font-size: 11.5px; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--ink-soft); font-size: 15.5px; padding: 6px 12px; border-radius: 8px; }
.nav a:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.nav a.active { color: var(--brand); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 14px; }
.lang { font-size: 13px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 99px; padding: 2px 4px; display: flex; }
.lang span { padding: 1px 8px; border-radius: 99px; }
.lang .on { background: var(--ink); color: #fff; }
.lang .off { color: #aaa69a; cursor: not-allowed; }
.btn-login { font-size: 14.5px; font-weight: 600; padding: 7px 16px; border-radius: 9px; background: var(--brand); color: #fff; white-space: nowrap; }
.btn-login:hover { background: var(--brand-dark); text-decoration: none; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 18px; padding: 2px 10px; cursor: pointer; }
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 66px; left: 0; right: 0; background: var(--paper); flex-direction: column; padding: 10px 24px 16px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .site-header .wrap { justify-content: space-between; }
  .lang { display: none; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 12px 26px; border-radius: 10px; font-weight: 600; font-size: 16px; border: 1px solid var(--brand); cursor: pointer; font-family: inherit; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 14.5px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Page heads & sections ---------- */
.hero { padding: 84px 0 68px; }
.eyebrow { display: inline-block; font-size: 13px; letter-spacing: 1.2px; color: var(--brand); background: var(--brand-soft); padding: 4px 12px; border-radius: 99px; }
.hero h1 { font-family: var(--serif); font-size: clamp(36px, 6vw, 60px); line-height: 1.25; margin: 22px 0 14px; letter-spacing: 1px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: 19px; max-width: 620px; color: var(--ink-soft); margin: 0 0 30px; }
.page-head { padding: 52px 0 30px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-family: var(--serif); font-size: clamp(30px, 4.5vw, 42px); margin: 6px 0 4px; line-height: 1.3; }
.page-head .en-title { color: var(--ink-soft); margin: 0; }
.crumbs { font-size: 14px; color: var(--ink-soft); }
section { padding: 60px 0; }
section.alt { background: #f3f1ea; }
section.tight { padding: 40px 0; }
h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 6px; }
.h2-sub { color: var(--ink-soft); margin: 0 0 30px; }
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 6px; font-size: 19px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.card .num { font-family: var(--serif); font-size: 26px; color: var(--accent); line-height: 1; margin-bottom: 10px; }

/* Module entry cards */
.module { display: flex; flex-direction: column; color: var(--ink); transition: border-color .15s, transform .15s; }
.module:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.module .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.module .en { color: var(--brand); font-size: 13px; letter-spacing: .5px; margin-bottom: 8px; }
.module p { flex: 1; }
.module .go { margin-top: 16px; color: var(--brand); font-weight: 600; font-size: 15px; }

/* Teacher */
.teacher { display: grid; grid-template-columns: 140px 1fr; gap: 32px; align-items: start; }
.avatar { width: 140px; height: 140px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 52px; }
.teacher blockquote { margin: 0 0 18px; font-size: 18px; border-left: 3px solid var(--accent); padding-left: 18px; }
.teacher ul { padding-left: 20px; margin: 0; color: var(--ink-soft); }
.en-box { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; font-size: 15.5px; color: var(--ink-soft); }
.en-box b { color: var(--ink); }
@media (max-width: 640px) { .teacher { grid-template-columns: 1fr; } }

/* Tables */
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15.5px; }
.tbl th, .tbl td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f3f1ea; font-size: 14px; font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tz-local { display: block; font-size: 13px; color: var(--ink-soft); }

/* Price cards */
.price { display: flex; flex-direction: column; }
.price .amount { font-family: var(--serif); font-size: 28px; margin: 10px 0; }
.price ul { padding-left: 18px; color: var(--ink-soft); font-size: 15px; flex: 1; }
.price.featured { border: 2px solid var(--brand); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 0 20px; }
.faq summary { padding: 14px 0; cursor: pointer; font-weight: 600; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }
form.enroll label { display: block; font-size: 14.5px; font-weight: 600; margin: 12px 0 4px; }
form.enroll input, form.enroll select, form.enroll textarea { width: 100%; font: inherit; font-size: 15.5px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
form.enroll button { margin-top: 18px; }

/* ---------- Catalogue ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 15px; padding: 7px 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.unit { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 12px; overflow: hidden; }
.unit summary { padding: 15px 22px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; list-style: none; }
.unit summary::-webkit-details-marker { display: none; }
.unit summary .meta { color: var(--ink-soft); font-weight: 400; font-size: 14px; white-space: nowrap; }
.unit ul { margin: 0; padding: 0 22px 14px; list-style: none; }
.unit li { padding: 9px 0; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 15.5px; }
.badge { font-size: 12px; padding: 2px 10px; border-radius: 99px; white-space: nowrap; align-self: center; }
.badge.live { background: var(--brand-soft); color: var(--brand); }
.badge.free { background: var(--accent-soft); color: var(--accent); }
.badge.soon { background: #efede6; color: #8a877c; }

/* ---------- Lesson player (video + exercises in one list) ---------- */
.player { display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 32px 0 80px; }
@media (max-width: 880px) { .player { grid-template-columns: 1fr; } }
.steps { position: sticky; top: 86px; align-self: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
@media (max-width: 880px) { .steps { position: static; } }
.steps h3 { font-size: 15px; margin: 8px 10px 10px; }
.step-btn { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; font-size: 14.5px; background: none; border: 0; border-radius: 9px; padding: 9px 10px; cursor: pointer; color: var(--ink); line-height: 1.5; }
.step-btn:hover { background: #f3f1ea; }
.step-btn.current { background: var(--brand-soft); }
.step-btn .ico { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #efede6; color: var(--ink-soft); }
.step-btn.video .ico { background: #e3ecf7; color: #2b5a8f; }
.step-btn.practice .ico { background: var(--accent-soft); color: var(--accent); }
.step-btn.done .ico { background: var(--good); color: #fff; }
.step-btn small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.stage h2 { font-size: 24px; }
.stage .en-sub { color: var(--ink-soft); margin: 0 0 20px; }
.video-frame { aspect-ratio: 16 / 9; background: #1b2a25; border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; color: #cfd8d4; text-align: center; margin-bottom: 20px; }
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; }
.video-frame .ph b { display: block; color: #fff; font-size: 18px; margin-bottom: 4px; }
.points { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.points h4 { margin: 0 0 8px; font-size: 16px; }
.points ul { margin: 0; padding-left: 20px; }
.points li { margin-bottom: 6px; }
.stage-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
.locked { background: var(--card); border: 1px dashed var(--accent); border-radius: var(--radius); padding: 28px; text-align: center; }

/* ---------- Question component (shared by lessons & practice) ---------- */
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.qcard .qmeta { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.qcard .stem { font-weight: 600; margin-bottom: 8px; }
.qcard details.hint { font-size: 14.5px; color: var(--ink-soft); margin-bottom: 12px; }
.qcard details.hint summary { cursor: pointer; color: var(--brand); width: fit-content; }
.qcard .opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font-size: 15.5px; background: #faf9f5; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; cursor: pointer; }
.qcard .opt:hover { border-color: var(--brand); }
.qcard .opt input { margin-top: 6px; accent-color: var(--brand); }
.qcard .opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.qcard .opt.correct { background: #e7f3ec; border-color: var(--good); }
.qcard .opt.wrong { background: #fbeceb; border-color: var(--bad); }
.qcard.submitted .opt { cursor: default; }
.qcard .submit-row { margin-top: 6px; }
.qcard .feedback { display: none; margin-top: 12px; font-size: 15px; padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); }
.qcard .feedback.bad { background: #fbeceb; }
.qcard.submitted .feedback { display: block; }
.qcard.submitted .submit-row { display: none; }
.scorebar { font-size: 17px; font-weight: 600; padding: 14px 20px; border-radius: var(--radius); background: var(--ink); color: #fff; margin-top: 8px; }

/* ---------- Practice filters ---------- */
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 26px; }
.filters .row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters select { font: inherit; font-size: 15px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 14px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; cursor: pointer; background: #faf9f5; user-select: none; }
.chip input { display: none; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip.empty { opacity: .45; cursor: not-allowed; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--ink-soft); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--ink-soft); }
