/* 幸福哲学空中课堂 · Swiss / International Typographic Style */
:root {
  --paper: #ffffff;
  --ink: #000000;
  --ink-2: #1a1a1a;
  --muted: #6b6b6b;
  --line: #000000;
  --line-soft: #d9d9d9;
  --tint: #f2f2f2;
  --red: #e30613;
  --red-dark: #b8050f;
  --ok: #000000;
  --stage: #000000;
  --sans: "Helvetica Neue", Helvetica, Inter, Arial, "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --wrap: 1200px;
  --gutter: 24px;
  --pad: max(24px, calc((100% - var(--wrap)) / 2));
  --control: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1;
}

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--red); }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ---------- Header: wordmark + nav on the grid ---------- */
.top {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
  padding: 28px var(--pad) 18px;
  border-bottom: 3px solid var(--line);
  background: var(--paper);
}
.brand {
  grid-column: 1 / span 6;
  display: flex;
  gap: 14px;
  align-items: flex-end;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-text { min-width: 0; }
.brand strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand em {
  display: block;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  background: var(--red);
  margin-bottom: 2px;
}
.nav {
  grid-column: 7 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0 4px;
  font-size: 14px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  min-height: var(--control);
  display: inline-flex;
  align-items: flex-end;
  padding: 0 12px 6px;
  font-weight: 500;
  border-bottom: 4px solid transparent;
  margin-bottom: -18px;
  padding-bottom: 14px;
}
.nav a:hover { color: var(--red); }
.nav a.on { font-weight: 700; border-bottom-color: var(--red); }
.who {
  color: var(--muted);
  font-size: 12px;
  padding: 0 12px 6px;
  letter-spacing: 0.02em;
}
.inline { display: inline; margin: 0; }
button.linkish {
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: var(--control);
  padding: 0 0 6px 12px;
  display: inline-flex;
  align-items: flex-end;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
button.linkish:hover { color: var(--red); }

/* ---------- Page frame ---------- */
.main {
  width: 100%;
  padding: 56px var(--pad) 96px;
  flex: 1 0 auto;
}
.foot {
  padding: 18px var(--pad) 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-align: left;
}

h1 {
  font-size: clamp(36px, 5.2vw, 64px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  color: var(--ink);
}
h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 64px 0 20px;
  padding-top: 14px;
  border-top: 3px solid var(--line);
}
.page-head { margin-bottom: 48px; max-width: 58rem; }
.lead, .hint, .stat { color: var(--muted); }
.lead { margin: 0 0 8px; max-width: 40em; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.err, .ok {
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 15px;
  border-left: 6px solid var(--ink);
  background: var(--tint);
}
.err { border-left-color: var(--red); color: var(--ink); }
.ok { color: var(--ink); }

/* ---------- Forms ---------- */
.card {
  background: var(--paper);
  border: 0;
  padding: 0;
}
.form { display: grid; gap: 22px; }
.form label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input:not([type]),
.form input[type="email"] {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 14px;
  font: inherit;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
  background: var(--paper);
  appearance: none;
  -webkit-appearance: none;
}
.form input:not([type="checkbox"]):hover { background: var(--tint); }
.form input:not([type="checkbox"]):focus {
  outline: none;
  border-width: 3px;
  border-color: var(--red);
  padding: 11px 13px;
  background: var(--paper);
}
.form button, .acts button {
  border: 0;
  border-radius: 0;
  background: var(--red);
  color: #fff;
  min-height: var(--control);
  padding: 12px 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  justify-self: start;
  text-align: left;
}
.form button:hover { background: var(--red-dark); }
.form button:active { background: var(--ink); }
.acts button {
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--line);
}
.acts button:hover { background: var(--ink); color: #fff; }
.check {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: var(--control);
  font-size: 15px !important;
  letter-spacing: 0 !important;
}
.check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--red);
  flex: 0 0 auto;
  border-radius: 0;
}
.grid2, .grid3 { display: grid; gap: 22px var(--gutter); }
@media (min-width: 720px) {
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid2 button, .form.grid2 > button { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Login: asymmetric 12-col composition ---------- */
.auth {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: start;
  padding-top: 24px;
}
.auth > * { grid-column: 1 / -1; }
.auth .page-head {
  grid-column: 1 / span 6;
  grid-row: 1 / span 3;
  margin: 0;
  padding-top: 18px;
  border-top: 12px solid var(--red);
}
.auth .page-head h1 { font-size: clamp(44px, 6.4vw, 88px); line-height: 1.02; margin-bottom: 28px; }
.auth .page-head .lead { max-width: 26em; }
.auth .err { grid-column: 8 / -1; }
.auth .form { grid-column: 8 / -1; padding-top: 30px; }
.auth .form button { width: 100%; justify-self: stretch; margin-top: 8px; }
.auth > h1 { grid-column: 1 / span 8; }
.auth > p { grid-column: 1 / span 8; }

/* ---------- Course list ---------- */
.course .page-head h1 { max-width: 14em; }
.stat {
  margin: 28px 0 0;
  display: grid;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  max-width: 360px;
}
.lessons { display: grid; border-top: 3px solid var(--line); }
.lesson {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
@media (hover: hover) {
  .lesson:hover { color: var(--ink); background: var(--tint); }
  .lesson:hover .ord { color: var(--red); }
}
.ord {
  grid-column: 1 / span 2;
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.lt { grid-column: 3 / span 7; min-width: 0; }
.lt strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.lt em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.bar {
  grid-column: 10 / -1;
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 0;
  background: var(--line-soft);
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--red);
}
.bar::-webkit-progress-bar { background-color: var(--line-soft); border-radius: 0; }
.bar::-webkit-progress-value { background-color: var(--red); border-radius: 0; }
.bar::-moz-progress-bar { background-color: var(--red); border-radius: 0; }
.stat-bar { grid-column: auto; width: 100%; height: 8px; }

/* ---------- Watch ---------- */
.crumb {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding-top: 10px;
  border-top: 3px solid var(--line);
  max-width: 100%;
}
.crumb a { color: var(--ink); text-decoration: none; }
.crumb a:hover { color: var(--red); }
.watch h1 { font-size: clamp(28px, 3.6vw, 48px); margin-bottom: 28px; max-width: 18em; }
.stage {
  position: relative;
  background: var(--stage);
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin: 0 0 16px;
}
.stage video { width: 100%; height: 100%; display: block; background: #000; }
.watermark {
  position: absolute;
  left: 0;
  top: 18%;
  white-space: nowrap;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
  font-weight: 700;
  animation: wm-x 18s linear infinite, wm-y 11s ease-in-out infinite;
  z-index: 3;
  user-select: none;
}
@keyframes wm-x {
  0% { transform: translateX(-20%); }
  100% { transform: translateX(60vw); }
}
@keyframes wm-y {
  0% { margin-top: 0; }
  50% { margin-top: 28%; }
  100% { margin-top: 0; }
}
.hint { font-size: 13px; margin: 0 0 8px; line-height: 1.5; max-width: 40em; }
.pager {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gutter);
  margin-top: 40px;
  border-top: 3px solid var(--line);
}
.pager a {
  color: var(--ink);
  min-height: 64px;
  padding: 14px 0;
  display: flex;
  align-items: flex-start;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
.pager a:hover { color: var(--red); }
.pager > :nth-child(2) { justify-content: flex-start; }
.pager > :nth-child(3) { justify-content: flex-end; }

/* ---------- Admin ---------- */
.admin { counter-reset: sec; }
.admin h2::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.admin .page-head { margin-bottom: 16px; }
.admin .form { max-width: 880px; }
.block { margin-top: 8px; }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 20px;
  border-top: 3px solid var(--line);
}
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-weight: 700;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 2px solid var(--line);
}
tbody tr:hover td { background: var(--tint); }
.acts form { margin: 0; }
.status {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
}
.status.is-disabled { background: var(--paper); color: var(--muted); border: 1px solid var(--muted); }
code {
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  background: var(--tint);
  padding: 1px 6px;
  border-radius: 0;
  font-size: 0.9em;
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .auth .page-head { grid-column: 1 / -1; grid-row: auto; margin-bottom: 40px; }
  .auth .err, .auth .form { grid-column: 1 / span 9; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  :root { --pad: 20px; --gutter: 12px; }
  .top {
    grid-template-columns: 1fr;
    row-gap: 14px;
    padding: 20px var(--pad) 0;
  }
  .brand, .nav { grid-column: 1 / -1; }
  .brand strong { font-size: 20px; }
  .nav {
    justify-content: flex-start;
    border-top: 1px solid var(--line);
    margin: 0 calc(var(--pad) * -1);
    padding: 0 var(--pad);
  }
  .nav a { margin-bottom: 0; padding: 0 12px 0 0; align-items: center; min-height: 48px; margin-right: 8px; }
  .nav a.on { border-bottom-color: var(--red); }
  .who { flex: 1 0 auto; text-align: right; padding: 0 12px 0 0; align-self: center; }
  button.linkish { padding: 0; align-items: center; min-height: 48px; }
  .main { padding-top: 36px; padding-bottom: 64px; }
  h1 { font-size: 36px; }
  h2 { font-size: 22px; margin-top: 48px; }
  .page-head { margin-bottom: 32px; }
  .auth { padding-top: 8px; }
  .auth .page-head h1 { font-size: 44px; }
  .auth .err, .auth .form, .auth > h1, .auth > p { grid-column: 1 / -1; }
  .form button,
  .auth .form button,
  .grid2 button,
  .form.grid2 > button {
    width: 100%;
    justify-self: stretch;
    text-align: center;
  }
  .acts button { width: 100%; min-height: 48px; }
  .lesson { padding: 20px 0; row-gap: 14px; }
  .ord { grid-column: 1 / span 3; font-size: 40px; align-self: start; }
  .lt { grid-column: 4 / -1; }
  .lesson .bar { grid-column: 4 / -1; }
  .watch h1 { font-size: 28px; }
  .stage { margin-left: calc(var(--pad) * -1); margin-right: calc(var(--pad) * -1); }
  .pager a { font-size: 16px; min-height: 56px; }
  .table-wrap { overflow: visible; border-top: 0; }
  table { min-width: 0; width: 100%; }
  thead { display: none; }
  table, tbody, tr, td { display: block; }
  tr { border-top: 3px solid var(--line); margin-bottom: 28px; }
  td {
    display: grid;
    grid-template-columns: 7em 1fr;
    gap: 12px;
    align-items: start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  td:last-child { border-bottom: 1px solid var(--line); }
  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding-top: 2px;
  }
  td:not([data-label]) { display: block; }
  tbody tr:hover td { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .watermark { animation: none; }
}

/* =====================================================================
   v3 · 课时简介 + 全站手机适配（360–430px）+ 后台极简风
   ===================================================================== */
img, video, svg { max-width: 100%; }
h1, h2, h3, p, strong, em, td, th, .who { overflow-wrap: anywhere; }
.lt .ld {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.watch-desc { margin: -12px 0 24px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.muted { color: var(--muted); font-weight: 400; }

@media (max-width: 640px) {
  .brand-text em { display: none; }
  .nav { gap: 0; }
  .who { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
  .auth .page-head h1 { font-size: clamp(34px, 11vw, 44px); }
  h1 { font-size: clamp(28px, 9vw, 36px); }
  .watch h1 { font-size: clamp(24px, 7.4vw, 28px); }
  .lt strong { font-size: 18px; }
  .ord { font-size: 36px; }
  .pager a { min-height: 56px; align-items: center; }
  .stage { aspect-ratio: 16 / 9; }
}
@media (max-width: 380px) {
  :root { --pad: 16px; }
  .brand strong { font-size: 18px; }
  .ord { grid-column: 1 / span 2; font-size: 30px; }
  .lt, .lesson .bar { grid-column: 3 / -1; }
}

/* ---------------- 后台：极简风（仅 .is-admin，前台不受影响） ---------------- */
.is-admin {
  --a-ink: #111111;
  --a-sub: #6e6e73;
  --a-faint: #a1a1a6;
  --a-hair: #ececec;
  --a-bg: #fafafa;
  --a-accent: #111111;
  --a-r: 10px;
  background: #ffffff;
}
.is-admin .top { border-bottom: 1px solid var(--a-hair); padding-top: 22px; padding-bottom: 14px; }
.is-admin .mark { width: 14px; height: 14px; flex-basis: 14px; margin-bottom: 6px; }
.is-admin .brand strong { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.is-admin .brand em { color: var(--a-faint); }
.is-admin .nav a { font-weight: 500; color: var(--a-sub); border-bottom-width: 2px; margin-bottom: -15px; }
.is-admin .nav a.on { color: var(--a-ink); font-weight: 600; border-bottom-color: var(--a-ink); }
.is-admin .nav a:hover, .is-admin button.linkish:hover { color: var(--a-ink); }
.is-admin button.linkish { color: var(--a-sub); text-decoration: none; }
.is-admin .foot { border-top: 1px solid var(--a-hair); color: var(--a-faint); }
.is-admin .main { padding-top: 48px; }
.is-admin a { color: var(--a-ink); }
.is-admin a:focus-visible, .is-admin button:focus-visible, .is-admin input:focus-visible, .is-admin textarea:focus-visible, .is-admin summary:focus-visible {
  outline: 2px solid var(--a-ink); outline-offset: 2px;
}

.admin { max-width: 960px; color: var(--a-ink); }
.admin h2::before { content: none; }
.a-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-bottom: 40px; }
.a-head h1 { font-size: 34px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.a-toc { display: flex; flex-wrap: wrap; gap: 4px; }
.a-toc a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  border-radius: 999px; color: var(--a-sub); text-decoration: none; font-size: 15px;
}
.a-toc a:hover { background: var(--a-bg); color: var(--a-ink); }
.a-flash { margin: 0 0 32px; padding: 14px 18px; border-radius: var(--a-r); background: var(--a-bg); font-size: 15px; }
.a-flash.is-err { color: #b00020; background: #fff5f5; }

.a-sec { padding: 56px 0 8px; border-top: 1px solid var(--a-hair); scroll-margin-top: 16px; }
.a-sec:first-of-type { border-top: 0; padding-top: 8px; }
.a-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 28px; }
.admin h2 { font-size: 22px; font-weight: 600; letter-spacing: 0; margin: 0; padding: 0; border: 0; }
.a-h3 { font-size: 15px; font-weight: 600; margin: 40px 0 12px; color: var(--a-ink); }
.a-meta { margin: 0; color: var(--a-sub); font-size: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-meter { width: 120px; height: 4px; border: 0; border-radius: 4px; background: var(--a-hair); appearance: none; -webkit-appearance: none; }
.a-meter::-webkit-progress-bar { background: var(--a-hair); border-radius: 4px; }
.a-meter::-webkit-progress-value { background: var(--a-ink); border-radius: 4px; }
.a-meter::-moz-progress-bar { background: var(--a-ink); border-radius: 4px; }
.is-admin code { background: var(--a-bg); border-radius: 4px; }

/* 按钮 */
.is-admin .btn, .is-admin .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0;
  cursor: pointer; text-decoration: none; text-align: center; white-space: nowrap;
}
.is-admin .btn { background: var(--a-accent); color: #fff; border: 0; }
.is-admin .btn:hover { background: #333; color: #fff; }
.is-admin .btn-quiet { background: transparent; color: var(--a-ink); border: 1px solid var(--a-hair); }
.is-admin .btn-quiet:hover { background: var(--a-bg); color: var(--a-ink); }
.is-admin .btn-small { min-height: 44px; padding: 0 18px; font-size: 14px; }

/* 上传区 */
.drop {
  border: 1px dashed #d2d2d7; border-radius: 14px; background: var(--a-bg);
  padding: 40px 24px; text-align: center; transition: background .15s, border-color .15s;
}
.drop.is-over { background: #f0f0f2; border-color: var(--a-ink); }
.drop-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.drop-note { margin: 0 0 14px; color: var(--a-sub); display: flex; align-items: center; justify-content: center; gap: 10px; }
.drop-rule { margin: 0 auto; max-width: 36em; color: var(--a-faint); font-size: 13px; line-height: 1.6; }
.queue { list-style: none; margin: 16px 0 0; padding: 0; }
.q-item { padding: 16px 0; border-bottom: 1px solid var(--a-hair); }
.q-top, .q-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.q-name { font-weight: 600; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-size { color: var(--a-faint); font-size: 13px; flex: 0 0 auto; }
.q-bar { display: block; width: 100%; height: 4px; margin: 10px 0 8px; border: 0; border-radius: 4px; background: var(--a-hair); appearance: none; -webkit-appearance: none; }
.q-bar::-webkit-progress-bar { background: var(--a-hair); border-radius: 4px; }
.q-bar::-webkit-progress-value { background: var(--a-ink); border-radius: 4px; }
.q-bar::-moz-progress-bar { background: var(--a-ink); border-radius: 4px; }
.q-status { font-size: 13px; color: var(--a-sub); min-width: 0; }
.q-item[data-state="done"] .q-status { color: #1d7a3a; }
.q-item[data-state="failed"] .q-status, .q-item[data-state="rejected"] .q-status { color: #b00020; }
.q-item[data-state="failed"] .q-bar::-webkit-progress-value { background: #b00020; }
.q-item[data-state="done"] .q-bar::-webkit-progress-value { background: #1d7a3a; }
.q-retry { flex: 0 0 auto; }
.queue-foot { margin: 16px 0 0; }

/* 课时列表 */
.a-lessons { list-style: none; margin: 0; padding: 0; }
.a-lesson { padding: 20px 0; border-bottom: 1px solid var(--a-hair); }
.a-lesson:last-child { border-bottom: 0; }
.a-lesson-main { display: flex; gap: 20px; align-items: flex-start; }
.a-no { flex: 0 0 auto; width: 2.2em; color: var(--a-faint); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 1px; }
.a-lesson-text { min-width: 0; flex: 1 1 auto; }
.a-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.45; }
.a-desc { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--a-sub); white-space: pre-line; }
.a-desc.is-empty { color: var(--a-faint); }
.a-tags { margin: 6px 0 0; font-size: 12px; color: var(--a-faint); }
.a-edit { margin: 8px 0 0 calc(2.2em + 20px); }
.a-edit summary {
  display: inline-flex; align-items: center; min-height: 44px; cursor: pointer;
  color: var(--a-sub); font-size: 14px; list-style: none;
}
.a-edit summary::-webkit-details-marker { display: none; }
.a-edit summary::after { content: "›"; margin-left: 6px; transition: transform .15s; }
.a-edit[open] summary::after { transform: rotate(90deg); }
.a-edit summary:hover { color: var(--a-ink); }
.a-empty { color: var(--a-faint); padding: 16px 0; }

/* 表单 */
.a-form { display: grid; gap: 18px; max-width: 640px; }
.a-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 500; color: var(--a-sub); letter-spacing: 0; }
.a-form input:not([type="checkbox"]), .a-form textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid #d2d2d7; border-radius: var(--a-r); background: #fff;
  font: inherit; font-size: 16px; color: var(--a-ink); box-shadow: none; appearance: none; -webkit-appearance: none;
}
.a-form textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.a-form input:not([type="checkbox"]):focus, .a-form textarea:focus { outline: none; border-color: var(--a-ink); box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.a-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.a-saved { font-size: 13px; color: var(--a-sub); }
.a-check { display: flex !important; align-items: center; gap: 12px; min-height: 44px; font-size: 15px !important; color: var(--a-ink) !important; }
.a-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--a-ink); }
.a-cols { display: grid; gap: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
.a-cols .a-h3 { margin-top: 0; }
.a-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.a-narrow { max-width: 420px; }

/* 学情表 */
.is-admin .table-wrap { border-top: 0; margin-top: 0; }
.is-admin table { font-size: 14px; min-width: 0; }
.is-admin th { font-size: 12px; font-weight: 500; color: var(--a-faint); letter-spacing: 0; border-bottom: 1px solid var(--a-hair); padding: 10px 16px 10px 0; }
.is-admin td { border-bottom: 1px solid var(--a-hair); padding: 16px 16px 16px 0; vertical-align: middle; }
.is-admin td strong { font-weight: 600; }
.is-admin tbody tr:hover td { background: transparent; }
.is-admin .acts button { min-height: 44px; padding: 0 16px; font-size: 14px; border-radius: 999px; border: 1px solid var(--a-hair); background: #fff; color: var(--a-ink); font-weight: 600; }
.is-admin .acts button:hover { background: var(--a-bg); color: var(--a-ink); }
.pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eef7f0; color: #1d7a3a; white-space: nowrap; }
.pill.is-off { background: var(--a-bg); color: var(--a-faint); }

@media (max-width: 900px) {
  .is-admin .table-wrap { overflow: visible; }
  .is-admin table, .is-admin tbody, .is-admin tr, .is-admin td { display: block; width: 100%; }
  .is-admin thead { display: none; }
  .is-admin tr { border: 0; border-bottom: 1px solid var(--a-hair); padding: 12px 0; margin: 0; }
  .is-admin td { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 12px; border: 0; padding: 6px 0; align-items: center; }
  .is-admin td:last-child { border: 0; }
  .is-admin td::before { content: attr(data-label); color: var(--a-faint); font-size: 12px; font-weight: 500; letter-spacing: 0; padding: 0; }
  .is-admin td.acts form { justify-self: start; }
  .is-admin .acts button { width: auto; }
}
@media (max-width: 640px) {
  .is-admin .top { padding-top: 16px; padding-bottom: 0; }
  .is-admin .nav { border-top: 1px solid var(--a-hair); }
  .is-admin .nav a { margin-bottom: 0; }
  .is-admin .main { padding-top: 28px; }
  .a-head { margin-bottom: 20px; }
  .a-head h1 { font-size: 28px; }
  .a-toc { margin: 0 -12px; }
  .a-sec { padding-top: 40px; }
  .a-cols, .a-cols-3 { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .a-cols-3 { gap: 18px; }
  .drop { padding: 28px 16px; }
  .a-lesson-main { gap: 12px; }
  .a-no { width: 1.8em; }
  .a-edit { margin-left: calc(1.8em + 12px); }
  .a-actions .btn { flex: 1 1 auto; }
  .is-admin .form button, .is-admin .grid2 button { width: auto; }
}

/* 触控目标 ≥ 44px：品牌链接、面包屑 */
.brand { min-height: 44px; }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; }
.crumb { padding-top: 0; }
[hidden] { display: none !important; }
