/* 无人机竞速赛学习包 · 仅使用 assets/ui/base.css 变量 */
.dr { --accent: var(--seal); max-width: 840px; font-size: 17px; line-height: 1.75; }
.dr-head { padding: 4px 0 18px; }
.dr-head h1 { font: 400 clamp(30px, 7vw, 40px)/1.25 var(--font-kai); }
.dr-head p { margin-top: 6px; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }
.dr-head .note { margin-top: 10px; }

/* 顶部标签：吸顶可横向滑动 */
.tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; margin: 0 calc(-1 * var(--gutter)) 22px; padding: calc(6px + env(safe-area-inset-top)) var(--gutter) 0; overflow-x: auto; scrollbar-width: none; background: var(--paper); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--ink-soft); font-size: 16px; font-weight: 600; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.panel { scroll-margin-top: 64px; }
html.js .panel { display: none; }
html.js .panel.is-active { display: block; }
html:not(.js) .panel + .panel { margin-top: 48px; }
.panel-title { margin-bottom: 16px; font: 400 26px/1.35 var(--font-kai); }
.panel > * + * { margin-top: 14px; }

.lead { padding: 2px 2px 4px; color: var(--ink-soft); font-size: 16px; }
.lead blockquote { padding: 0; border: 0; background: none; }

.block { padding: 18px 18px 20px; box-shadow: none; border-radius: var(--r-m); }
.block h3 { font-size: 19px; font-weight: 700; line-height: 1.45; }
.block-body { margin-top: 10px; }
.block-body > * + *, .lead > * + * { margin-top: 12px; }
.block-body h4 { margin-top: 20px; font-size: 17px; font-weight: 700; }
.block-body h4 + * { margin-top: 6px; }
.block-body strong, .lead strong { font-weight: 700; color: var(--ink); }
.block-body ul, .block-body ol, .lead ol, .lead ul { padding-left: 1.3em; display: grid; gap: 5px; }
.block-body ul, .lead ul { list-style: disc; }
.block-body ol, .lead ol { list-style: decimal; }
.block-body li::marker { color: var(--ink-faint); }
.block-body blockquote { padding: 10px 14px; border-left: 3px solid var(--line-strong); background: var(--paper); border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--ink-soft); font-size: 16px; }
.block-body blockquote > * + * { margin-top: 6px; }
.dr a[target] { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.dr code { padding: 0 5px; border-radius: 4px; background: var(--paper-deep); font-size: .9em; }

/* 折叠块 */
.fold { padding: 0; }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 18px; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold .chev { color: var(--ink-faint); transition: transform .15s ease; flex: none; }
.fold[open] .chev { transform: rotate(180deg); }
.fold > .block-body { margin: 0; padding: 14px 18px 20px; border-top: 1px solid var(--line); }

/* 表格 */
.tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); }
.tbl table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; line-height: 1.6; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl td { min-width: 4.2em; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th { background: var(--paper); color: var(--ink-soft); font-size: 14px; font-weight: 700; white-space: nowrap; }

.fig { margin: 14px 0 4px; }
.fig a { display: block; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); }
.fig img { width: 100%; height: auto; }
.fig figcaption { margin-top: 6px; color: var(--ink-faint); font-size: 14px; text-align: center; }

.tag { display: inline-block; margin: 0 2px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink-soft); background: var(--paper); font-size: 12.5px; font-weight: 600; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.tag-seal { border-color: var(--seal); color: var(--seal); background: var(--seal-tint); }
.tag-leaf { border-color: var(--leaf); color: var(--leaf-deep); background: var(--leaf-tint); }
.tag-sky { border-color: var(--sky); color: var(--sky); background: var(--sky-tint); }

/* 制作指南 & 步骤 */
#build { overflow-wrap: anywhere; }
.build-downloads { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.build-download, .step-nav a, .lecture-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--r-s); background: var(--card); font-size: 15px; font-weight: 600;
  color: var(--ink); text-decoration: none;
}
.build-download:hover, .step-nav a:hover, .lecture-download:hover { background: var(--paper-deep); }
.step-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.step-nav a { min-height: 44px; padding: 6px 12px; font-size: 14px; }
#build .caution { border: 2px solid var(--seal); background: var(--seal-tint); border-radius: var(--r-s); padding: 10px 14px; color: var(--ink); }
#build .adult { padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); font-size: 16px; }
#build .adult summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--sky); }
#build rt { font-size: .58em; color: var(--ink-soft); }
#build .role-icon { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; color: var(--sky); }
#build article { scroll-margin-top: 68px; }

/* 交互勾选清单 */
.check-list { list-style: none !important; padding-left: 0 !important; display: grid; gap: 8px; }
.check-item { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); cursor: pointer; }
.check-item input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--leaf); cursor: pointer; }
.check-item.is-checked { background: var(--leaf-tint); border-color: var(--leaf); color: var(--ink-soft); }
.check-item.is-checked span { text-decoration: line-through; }

/* 讲义 */
#theory { overflow-wrap: anywhere; }
#theory .lecture-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
#theory .lecture-row { padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); }
#theory .note, #theory .confusion { padding: 12px 14px; border-left: 3px solid var(--ink-soft); background: var(--paper); border-radius: 0 var(--r-s) var(--r-s) 0; }
#theory .confusion { border: 1px dashed var(--ink-soft); border-radius: var(--r-s); }
#theory .child { font-size: 18px; line-height: 1.85; }
#theory rt { font-size: .58em; color: var(--ink-soft); }
#theory .parent { background: var(--paper); padding: 12px 14px; border-radius: var(--r-s); border: 1px solid var(--line); font-size: 16px; margin-top: 12px; }
#theory .parent summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--sky); }
#theory details[id^="l"] > summary { flex-wrap: wrap; }
#theory .lesson-download { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; margin-left: auto; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--card); }

/* 模拟题 & 互动考场 */
.quiz-modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: var(--r-m); background: var(--paper-deep); }
.quiz-modes button { flex: 1 1 130px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-s); font-size: 15px; font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.quiz-modes button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }

.quiz-dash { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--card); }
.quiz-stats { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 15px; }
.quiz-stats b { color: var(--seal); font-size: 18px; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.qbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 15px; font-weight: 600; color: var(--ink); }
.qbtn:hover { background: var(--paper-deep); }
.qbtn-primary { background: var(--seal); border-color: var(--seal); color: #fff; }
.qbtn-primary:hover { background: var(--seal-deep); }
.qbtn-leaf { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.qbtn-leaf:hover { background: var(--leaf-deep); }
.qbtn[aria-pressed="true"] { background: var(--sky-tint); border-color: var(--sky); color: var(--sky); }

.qs { display: grid; gap: 0; padding: 0 !important; list-style: none !important; }
.q { padding: 16px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.q:first-child { padding-top: 4px; }
.q:last-child { border-bottom: 0; padding-bottom: 0; }
.q-stem { display: flex; gap: 10px; font-size: 17px; line-height: 1.75; }
.q-stem > span { flex: 1; min-width: 0; }
.q-stem rt { font-size: .58em; color: var(--ink-soft); }
.q-no { flex: none; display: grid; place-items: center; min-width: 30px; height: 30px; margin-top: 1px; border-radius: 8px; background: var(--paper-deep); color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.q:target .q-no { background: var(--accent); color: #fff; }
.q-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.qt { padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-faint); font-size: 12.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.qt.tag-seal { border-color: var(--seal); color: var(--seal); background: var(--seal-tint); }

/* 交互作答大按钮 */
.q-opts { display: grid; gap: 8px; margin-top: 10px; padding-left: 40px !important; list-style: none !important; }
.q-opts.is-tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.q-opt-btn { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--card); text-align: left; display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.45; transition: background-color .12s ease, border-color .12s ease; }
.q-opt-btn:hover { background: var(--paper); border-color: var(--ink-faint); }
.q-opt-btn .opt-key { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--paper-deep); font-weight: 700; font-size: 14px; }
.q-opt-btn.is-selected { border-color: var(--sky); background: var(--sky-tint); }
.q-opt-btn.is-right { border-color: var(--leaf); background: var(--leaf-tint); color: var(--leaf-deep); font-weight: 600; }
.q-opt-btn.is-right .opt-key { background: var(--leaf); color: #fff; }
.q-opt-btn.is-wrong { border-color: var(--seal); background: var(--seal-tint); color: var(--seal-deep); }
.q-opt-btn.is-wrong .opt-key { background: var(--seal); color: #fff; }

.ans { margin: 10px 0 0 40px; }
.ans > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--accent); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.ans > summary::-webkit-details-marker { display: none; }
.ans[open] > summary { background: var(--paper-deep); border-color: transparent; color: var(--ink-soft); }
.ans > div { margin-top: 8px; padding: 10px 14px; border-radius: var(--r-s); background: var(--paper); font-size: 16px; border-left: 3px solid var(--leaf); }
.q.is-q-wrong .ans > div { border-left-color: var(--seal); }

/* 分组摘要里的进度徽章 */
.grp-prog { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); margin-left: auto; white-space: nowrap; }
.grp-prog.is-full { background: var(--leaf-tint); color: var(--leaf-deep); }

/* 模拟考场与倒计时吸顶条 */
.exam-bar { position: sticky; top: 52px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 2px solid var(--sky); border-radius: var(--r-m); background: var(--card); box-shadow: var(--shadow-1); }
.exam-bar.is-urgent { border-color: var(--seal); background: var(--seal-tint); }
.exam-timer { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.exam-bar.is-urgent .exam-timer { color: var(--seal); }
.exam-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.exam-dot { min-width: 38px; min-height: 44px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.exam-dot.is-done { background: var(--sky-tint); border-color: var(--sky); color: var(--sky); }
.exam-dot.is-right { background: var(--leaf-tint); border-color: var(--leaf); color: var(--leaf-deep); }
.exam-dot.is-wrong { background: var(--seal-tint); border-color: var(--seal); color: var(--seal-deep); }
.exam-result { padding: 16px 18px; border-radius: var(--r-m); border: 2px solid var(--leaf); background: var(--leaf-tint); }
.exam-result.is-low { border-color: var(--sun); background: var(--sun-tint); }

/* 题库总览 & 答案速查 */
.ans.key { margin-left: 0; margin-top: 14px; }
.akey { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px 8px; font-size: 15px; }
.akey b { display: inline-block; min-width: 2em; color: var(--ink-faint); font-weight: 600; }
.qsum { min-width: 0 !important; }
.qsum td, .qsum th { padding: 8px 6px; white-space: nowrap; text-align: center; }
.qsum td:first-child, .qsum th:first-child { min-width: 0; width: 100%; white-space: normal; text-align: left; padding-left: 10px; }
.qr { display: block; color: var(--ink-faint); font-size: 13px; }

/* 视频与参考 */
.vid-lead { color: var(--ink-soft); font-size: 15px; }
.vids { display: grid; gap: 0; padding: 0 !important; list-style: none !important; }
.vid { padding: 14px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.vid:first-child { padding-top: 4px; }
.vid:last-child { border-bottom: 0; padding-bottom: 0; }
.dr a.vid-title { display: block; color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.5; text-decoration: none; }
.dr a.vid-title::after { content: " ↗"; color: var(--accent); font-weight: 400; }
.vid-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--ink-faint); font-size: 14px; line-height: 1.5; }
.vid-bv { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.vid-use { margin-top: 4px; font-size: 16px; line-height: 1.65; }
.vid-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dr a.vid-ref { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-soft); font-size: 14px; text-decoration: none; }
.off-vids { display: grid; gap: 18px; margin-top: 12px; }
.off-vid-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper); }
.off-vid-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.off-vid-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.off-vid-wrap { margin: 10px 0 12px; border-radius: var(--r-m); overflow: hidden; background: #16181c; display: flex; justify-content: center; }
.off-vid-player { display: block; width: 100%; max-width: 720px; max-height: 520px; background: #16181c; }
.off-vid-points { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.off-vid-points li + li { margin-top: 4px; }
.off-vid-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dr-foot { margin-top: 28px; }

/* 打印视图 */
.print-sheet { display: none; background: #fff; color: #000; padding: 12px; }
.print-head { border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 14px; }
.print-key { page-break-before: always; border-top: 1px dashed #666; padding-top: 12px; margin-top: 20px; }

@media (min-width: 720px) {
  .block { padding: 22px 26px 24px; }
  .fold > summary { padding: 14px 26px; }
  .fold > .block-body { padding: 16px 26px 24px; }
}
@media (max-width: 480px) {
  .q-opts, .ans { padding-left: 0 !important; margin-left: 0; }
  .q-opts.is-tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .tabs, .star-dock, .quiz-modes, .quiz-dash, .exam-bar, .no-print { display: none !important; }
  html.js .panel { display: block; }
  body.printing-exam .dr > *:not(#quiz),
  body.printing-exam #quiz > *:not(#quizPrintArea) { display: none !important; }
  body.printing-exam #quiz { display: block !important; }
  body.printing-exam #quizPrintArea { display: block !important; }
}
