:root {
  --bg: #0f1114; --card: #191c21; --card2: #20242b; --line: #2c313a; --text: #e3e6eb; --dim: #8f97a3;
  --acc: #ffd400; --acc2: #ffb347; --good: #5fd38a; --warn: #f5c04a; --bad: #ff6b6b; --info: #6fb4ff;
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; line-height: 1.55; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.hint { color: var(--dim); font-weight: normal; font-size: 12px; }
h2 { font-size: 18px; margin: 4px 0 10px; } h3 { font-size: 14px; margin: 0 0 10px; } h4 { margin: 10px 0 6px; font-size: 13px; color: var(--dim); }

/* 顶栏 */
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 18px; background: #090a0c; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand small { color: var(--dim); font-weight: normal; margin-left: 6px; }
.brand-mark { background: var(--acc); color: #000; padding: 1px 7px; border-radius: 3px; margin-right: 6px; font-style: italic; }
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: 0; padding: 7px 16px; border-radius: 6px; color: var(--dim); }
.tab.active { background: var(--card2); color: var(--acc); }
.top-help { margin-left: auto; }
.ghost { background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px; }
.ghost:hover { border-color: #4a515d; }
.ghost.on { background: var(--acc); color: #000; }
.ghost:disabled { opacity: 0.4; cursor: default; }
.primary { background: var(--acc); color: #000; border: 0; border-radius: 6px; padding: 6px 16px; font-weight: 600; }
.small { font-size: 12px; padding: 3px 10px; }

/* 三栏布局 */
.view { display: grid; grid-template-columns: 330px minmax(520px, 1fr) 300px; gap: 14px; padding: 14px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.col-left, .col-right { position: sticky; top: 64px; max-height: calc(100vh - 78px); overflow-y: auto; }
.col-left::-webkit-scrollbar, .col-right::-webkit-scrollbar { width: 6px; }
.col-left::-webkit-scrollbar-thumb, .col-right::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* 课程 */
.lesson-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pill { background: var(--acc); color: #000; border-radius: 10px; padding: 1px 10px; font-size: 12px; font-weight: 600; }
.lesson-list { margin: 6px 0 10px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lesson-list li { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.lesson-list li:last-child { border: 0; }
.lesson-list li:hover { background: var(--card2); }
.lesson-list li.on { color: var(--acc); }
.lesson-list li.done { color: var(--good); }
.intro p, .intro ul { margin: 6px 0; } .intro ul { padding-left: 18px; }
.intro b { color: var(--acc2); }
.task { background: rgba(255, 212, 0, 0.08); border-left: 3px solid var(--acc); padding: 8px 10px; border-radius: 4px; margin: 10px 0; }
.task b { display: block; margin-bottom: 2px; }
.lesson-nav { display: flex; gap: 6px; justify-content: space-between; }

/* 场景 */
.scene-list { display: grid; gap: 6px; }
.scene-list button { display: grid; grid-template-columns: 34px 1fr; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.scene-list button.on { border-color: var(--acc); }
.scene-list .ic { font-size: 22px; grid-row: span 2; }
.scene-list small { color: var(--dim); font-size: 12px; }

/* 参数解读 */
.explain { font-size: 13px; }
.ex-row { display: flex; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.ex-row .k { color: var(--dim); width: 44px; flex: none; }

/* 取景器 */
.finder-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.scene-title { margin-left: auto; color: var(--dim); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { background: var(--card2); border: 0; padding: 5px 12px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--acc); color: #000; font-weight: 600; }
.finder-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #000; cursor: crosshair; aspect-ratio: 3 / 2;
  box-shadow: inset 0 0 0 1px #000; }
.finder-wrap canvas, .finder-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.finder-wrap:not(.lv)::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px 20px rgba(0,0,0,0.55); border-radius: 10px; }
.finder-wrap.lv { outline: 3px solid #2a2f37; }
#afOverlay rect { fill: none; stroke: rgba(0,0,0,0.35); stroke-width: 1.2; }
#afOverlay rect.cross { stroke: rgba(0,0,0,0.5); }
#afOverlay rect.sel { stroke: #ff3030; stroke-width: 3; }
#afOverlay rect.sel.ok { stroke: #3cff6e; }
#afOverlay rect.sel.fail { stroke: #ff3030; stroke-dasharray: 4 3; }
#afOverlay.mf rect.sel { stroke: #9aa3ad; }
#afOverlay .spot { fill: none; stroke: rgba(255,255,255,0.75); stroke-width: 1.5; stroke-dasharray: 3 3; pointer-events: none; }
.lv-info { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 14px; padding: 6px 12px; background: linear-gradient(transparent, rgba(0,0,0,0.7)); font-size: 13px; color: #fff; pointer-events: none; }
.lv-info:empty { display: none; }
.lv-info span:first-child { background: #fff; color: #000; padding: 0 5px; border-radius: 3px; font-weight: 700; }
.flash { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.06s; display: flex; align-items: center; justify-content: center; color: #ffd56b; font-size: 18px; }
.flash.on { opacity: 1; }
.flash.lv.on { background: #050608; }
.ovf-bar { display: flex; align-items: center; gap: 14px; background: #000; color: #7dff7d; font-family: Consolas, monospace; font-size: 15px; padding: 6px 14px; border-radius: 0 0 8px 8px; margin-top: -4px; flex-wrap: wrap; }
.ovf-bar .m { border: 1px solid #7dff7d; padding: 0 4px; }
.ovf-bar .warn { animation: blink 0.5s steps(1) infinite; color: #7dff7d; }
.ovf-bar .fdot { color: #7dff7d; } .ovf-bar .fdot.off { opacity: 0.6; }
.ovf-bar .comp { color: #7dff7d; }
@keyframes blink { 50% { opacity: 0; } }
.scale { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.scale i { width: 3px; height: 6px; background: #2c5a2c; font-style: normal; font-size: 11px; line-height: 0; position: relative; }
.scale i.maj { height: 10px; }
.scale i.lit { background: #7dff7d; }
.scale i:first-child::before, .scale i:last-child::before { content: attr(data-x); }
.shoot-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.hint-line { color: var(--dim); font-size: 13px; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #3a3f48; background: radial-gradient(circle at 40% 35%, #f0f0f0, #9aa0a8); color: #111; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,0.6); }
.shutter:active { transform: scale(0.94); }

/* 回放 */
.review-grid { display: grid; grid-template-columns: 1fr 260px; gap: 14px; }
.review-img canvas { width: 100%; border-radius: 6px; display: block; background: #000; }
.review-tools { display: flex; gap: 14px; align-items: center; margin-top: 6px; font-size: 13px; }
#histo { width: 100%; height: 100px; border-radius: 4px; display: block; }
.histo-legend { display: flex; justify-content: space-between; color: var(--dim); font-size: 11px; }
.exif { font-size: 12px; }
.exif div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.exif span { color: var(--dim); }
.analysis { margin-top: 12px; }
.verdict { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; }
.verdict b { display: block; margin-bottom: 2px; }
.verdict.pass { background: rgba(95, 211, 138, 0.12); border: 1px solid var(--good); }
.verdict.fail { background: rgba(255, 107, 107, 0.1); border: 1px solid var(--bad); }
.verdict.info { background: rgba(111, 180, 255, 0.1); border: 1px solid var(--info); }
.verdict .primary { margin-top: 8px; }
.crit { list-style: none; padding: 0; margin: 0; }
.crit li { padding: 3px 0 3px 20px; position: relative; font-size: 13px; }
.crit li::before { position: absolute; left: 0; }
.crit li.good::before { content: "✔"; color: var(--good); } .crit li.warn::before { content: "!"; color: var(--warn); font-weight: 700; left: 4px; }
.crit li.bad::before { content: "✘"; color: var(--bad); } .crit li.info::before { content: "ℹ"; color: var(--info); }
.crit li { color: var(--text); }
.roll { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.roll button { padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; flex: none; }
.roll button.on { border-color: var(--acc); }
.roll canvas { display: block; width: 72px; height: 48px; border-radius: 2px; }

/* 机身控件 */
.lcd { background: #b9c4a6; color: #1d2418; border-radius: 6px; padding: 8px 10px; font-family: Consolas, monospace; margin-bottom: 12px; box-shadow: inset 0 2px 6px rgba(0,0,0,0.4); }
.lcd-row { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; }
.lcd-row.big { font-size: 26px; font-weight: 700; }
.lcd-mode { border: 1.5px solid #1d2418; padding: 0 4px; font-weight: 700; }
.lcd i { font-style: normal; font-size: 10px; border: 1px solid; padding: 0 2px; }
.ctl { margin-bottom: 12px; }
.ctl-label { font-size: 12px; color: var(--dim); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.auto-tag { margin-left: auto; color: var(--info); font-size: 11px; }
.q { width: 17px; height: 17px; border-radius: 50%; border: 1px solid #4a515d; background: none; font-size: 11px; padding: 0; line-height: 1; color: var(--dim); }
.q:hover { color: var(--acc); border-color: var(--acc); }
.dial-row { display: flex; align-items: center; gap: 6px; }
.dial-val { flex: 1; text-align: center; font-size: 20px; font-weight: 700; background: #0b0c0e; border: 1px solid var(--line); border-radius: 6px; padding: 3px 0; font-family: Consolas, monospace; }
.dial.is-auto .dial-val { color: var(--info); }
.dial.is-auto .step { opacity: 0.35; }
.step { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card2); }
.step:hover { border-color: var(--acc); }
.dial-sub { font-size: 11px; color: var(--dim); text-align: center; margin-top: 2px; }
.seg-mode button { font-weight: 700; padding: 5px 16px; font-size: 15px; }
select { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.range-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.range-row input { flex: 1; accent-color: var(--acc); }
.range-row span { width: 60px; text-align: right; font-family: Consolas, monospace; font-size: 13px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0 10px; cursor: pointer; }
.check input { accent-color: var(--acc); }
.check.dim { opacity: 0.45; }
.toggles { display: flex; gap: 16px; }
#miniDiagram { width: 100%; border-radius: 6px; display: block; }

/* 浮层 */
.tip { position: fixed; z-index: 50; width: 330px; background: #262b33; border: 1px solid #3f4652; border-radius: 8px; padding: 10px 12px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.tip b { color: var(--acc2); }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 30px; transform: translateX(-50%); background: #2b3038; border: 1px solid #4a515d; padding: 10px 18px; border-radius: 8px; max-width: 560px; font-size: 13px; box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 70; display: flex; align-items: center; justify-content: center; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; min-width: 360px; position: relative; }
.modal-x { position: absolute; right: 10px; top: 6px; background: none; border: 0; font-size: 22px; color: var(--dim); }
.keys td { padding: 4px 10px; }
kbd { background: var(--card2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-family: Consolas, monospace; }

/* 原理页 */
#view-learn { display: block; }
.learn-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 1280px; margin: 0 auto; }
.learn-card { margin: 0; }
.learn-card.wide { grid-column: span 2; }
.learn-card canvas { width: 100%; display: block; border-radius: 6px; margin-bottom: 8px; }
.learn-card input[type=range] { width: 100%; accent-color: var(--acc); }
.learn-two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; }
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 8px 0; font-size: 13px; }
.row select { width: auto; }
.parts { display: grid; gap: 6px; max-height: 520px; overflow-y: auto; }
.parts button { text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.parts button span { color: var(--dim); font-size: 12px; display: none; }
.parts button.on { border-color: var(--acc2); }
.parts button.on span { display: block; color: var(--text); }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tri label { font-size: 13px; color: var(--dim); }
.tri label b { color: var(--acc); font-family: Consolas, monospace; font-size: 16px; margin-left: 4px; }
.tri small { color: var(--dim); font-size: 11px; }
.gray-demo { display: flex; gap: 24px; justify-content: center; }
.gray-demo > div { display: grid; grid-template-columns: 50px 50px; gap: 4px; text-align: center; }
.gray-demo .sw { height: 50px; border-radius: 4px; border: 1px solid #333; }
.gray-demo b, .gray-demo small { grid-column: span 2; }
.gray-demo small { color: var(--dim); font-size: 11px; }
.spec { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec th { text-align: left; color: var(--dim); width: 90px; padding: 5px 8px; border-bottom: 1px solid var(--line); font-weight: normal; }
.spec td { padding: 5px 8px; border-bottom: 1px solid var(--line); }

@media (max-width: 1280px) {
  .view { grid-template-columns: 300px 1fr; }
  .col-right { grid-column: 1 / -1; position: static; max-height: none; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 8px 16px; }
  .view { grid-template-columns: 1fr; }
  .col-left { position: static; max-height: none; }
  .col-right { grid-template-columns: 1fr; }
  .review-grid, .learn-wrap, .learn-two, .tri { grid-template-columns: 1fr; }
  .learn-card.wide { grid-column: auto; }
  .brand small { display: none; }
}
