/* 摄影参数助手 · 单色极简 */
:root {
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --ink-3: #6e6e6e;
  --ink-4: #a3a3a3;
  --line: #e2e2e2;
  --line-2: #cfcfcf;
  --paper: #ffffff;
  --paper-2: #f6f6f6;
  --dot: #d6d6d6;
  --side-w: 248px;
  --font: "Century Gothic", "Bahnschrift", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --num: "Bahnschrift", "Century Gothic", "Microsoft YaHei UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: #a8a8a8; }

/* ---------- 侧边栏 ---------- */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 10;
}
.brand { padding: 26px 24px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .04em; }
.brand-sub { font-size: 10px; letter-spacing: .22em; color: var(--ink-3); text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.nav-group { margin-top: 14px; }
.nav-title {
  display: flex; align-items: center; width: 100%; text-align: left;
  font-size: 10px; letter-spacing: .2em; color: var(--ink-4); padding: 6px 12px; text-transform: uppercase;
  border-radius: 6px; transition: color .15s, background .15s;
}
@media (hover: hover) { .nav-title:hover { color: var(--ink); background: var(--paper-2); } }
.nav-group.open > .nav-title { color: var(--ink-2); }
.nav-chev { width: 12px; height: 12px; margin-left: auto; flex: none; transition: transform .2s; }
.nav-group.open .nav-chev { transform: rotate(90deg); }
/* 0fr -> 1fr 实现高度过渡，不用写死 max-height */
.nav-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.nav-group.open > .nav-body { grid-template-rows: 1fr; }
.nav-body-in { overflow: hidden; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .nav-body, .nav-chev { transition: none; } }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px 12px; border-radius: 6px; text-align: left; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); }
.nav-item .no { font-family: var(--num); font-size: 11px; width: 18px; color: var(--ink-4); }
.nav-item.active .no { color: #8d8d8d; }
.nav-item .en { margin-left: auto; font-size: 10px; letter-spacing: .06em; color: var(--ink-4); }
.nav-item.active .en { color: #8d8d8d; }
.nav-item svg { width: 16px; height: 16px; flex: none; }
.side-foot { padding: 14px 24px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); display: flex; justify-content: space-between; }

/* ---------- 主区域 ---------- */
.main { position: fixed; inset: 0 0 0 var(--side-w); overflow-y: auto; display: flex; flex-direction: column; }
/* 全局版权页脚：始终落在主内容区底部（内容不足一屏时也贴底，靠 margin-top:auto） */
.site-foot { margin-top: auto; padding: 18px 48px; border-top: 1px solid var(--line); text-align: center; font-size: 11px; color: var(--ink-3); flex-shrink: 0; }
.page { display: none; padding: 40px 48px 64px; max-width: 1680px; }
.page.active { display: block; }
.eyebrow { font-size: 11px; letter-spacing: .24em; color: var(--ink-3); text-transform: uppercase; }
h1 { font-size: 40px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; margin: 10px 0 12px; }
h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.lead { font-size: 15px; color: var(--ink-2); max-width: 760px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hero-tags span { font-size: 12px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--paper); font-size: 13px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: #2b2b2b; }
.btn.ghost { border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn svg { width: 15px; height: 15px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ---------- 总览 ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: end; padding-bottom: 36px; border-bottom: 1px solid var(--line); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.hero-stats div { padding: 18px 20px; border-right: 1px solid var(--line); }
.hero-stats div:last-child { border-right: none; }
.hero-stats b { display: block; font-family: var(--num); font-size: 30px; font-weight: 600; line-height: 1.1; }
.hero-stats span { font-size: 12px; color: var(--ink-3); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.tile { text-align: left; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; transition: border-color .2s; }
.tile:hover { border-color: var(--ink); }
.tile-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.tile:hover .tile-img img { transform: scale(1.07); }
.tile-tag { position: absolute; left: 10px; top: 10px; font-size: 10px; letter-spacing: .1em; padding: 3px 8px; border-radius: 4px; background: rgba(255,255,255,.92); color: var(--ink); }
.tile-body { padding: 14px 16px 16px; }
.tile-title { display: flex; align-items: baseline; gap: 10px; }
.tile-title b { font-size: 16px; }
.tile-title span { font-size: 11px; color: var(--ink-4); letter-spacing: .06em; }
.tile-params { margin-top: 8px; font-family: var(--num); font-size: 12px; color: var(--ink-2); display: flex; gap: 14px; }

/* ---------- 实验室 ---------- */
.lab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.lab-head h1 { font-size: 32px; margin: 6px 0 6px; }
.lab-head .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.stage-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; }
.stage-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; gap: 12px; }
.stage-bar .exif { font-family: var(--num); display: flex; gap: 18px; color: var(--ink); flex-wrap: wrap; }
.stage-bar .exif span { color: var(--ink-3); margin-right: 4px; font-family: var(--font); }
.stage-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 13px; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stage { position: relative; background: #111; aspect-ratio: 4 / 3; cursor: crosshair; overflow: hidden; }
.stage canvas.view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .orig { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.stage.compare .orig { display: block; }
.loupe { position: absolute; width: 220px; height: 220px; border-radius: 50%; border: 2px solid #fff; pointer-events: none; display: none; overflow: hidden; outline: 1px solid rgba(0,0,0,.4); }
.loupe canvas { width: 100%; height: 100%; display: block; }
.loupe-label { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-family: var(--num); font-size: 11px; color: #fff; background: rgba(0,0,0,.6); padding: 1px 8px; border-radius: 9px; }
.focus-mark { position: absolute; width: 34px; height: 34px; border: 1.5px solid #fff; margin: -17px 0 0 -17px; pointer-events: none; display: none; }
.focus-mark::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: #fff; }
.subject-mark { position: absolute; border: 1.5px dashed #fff; border-radius: 50%; pointer-events: none; display: none; }
/* 画幅对比：全画幅视野上叠加各画幅的中央裁切框 */
.crop-guide { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 3; }
.crop-guide.on { display: block; }
.crop-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1px dashed rgba(255,255,255,.7); box-sizing: border-box; }
/* 标签放框内侧顶部，避免外沿标签被 .stage 的 overflow:hidden 裁掉（全画幅框占满舞台时尤甚） */
.crop-box > span { position: absolute; left: 50%; top: 0; transform: translateX(-50%); white-space: nowrap; font-family: var(--num); font-size: 11px; line-height: 1.5; color: #fff; background: #4ea1ff; padding: 1px 7px; border-radius: 0 0 4px 4px; }
.crop-box.on { border: 1.5px solid #4ea1ff; }
/* 地平线校准线：横贯线本身不拦指针，只有中间把手可拖 */
.horizon-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed #4ea1ff; margin-top: -1px; pointer-events: none; display: none; z-index: 3; }
.hl-handle { position: absolute; left: 50%; top: 0; width: 46px; height: 22px; margin: -11px 0 0 -23px; border-radius: 11px; background: #4ea1ff; pointer-events: auto; cursor: ns-resize; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.hl-handle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; background: #fff; box-shadow: 0 -4px 0 #fff, 0 4px 0 #fff; }
.stage-hint { position: absolute; left: 12px; bottom: 12px; font-size: 11px; color: #fff; background: rgba(0,0,0,.55); padding: 3px 10px; border-radius: 4px; pointer-events: none; max-width: calc(100% - 24px); }
.stage-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #bbb; font-size: 13px; }
/* 导入图自动识别类型横幅（悬浮在舞台顶部，深浅色模式一致：半透明暗底白字） */
.scene-detect { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(0,0,0,.62); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; backdrop-filter: blur(2px); }
.scene-detect[hidden] { display: none; }   /* hidden 属性需显式覆盖 display:flex，否则关不掉 */
.scene-detect-txt { flex: 1 1 auto; min-width: 0; }
.scene-detect-sel { flex: 0 0 auto; font-size: 12px; padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.scene-detect-sel option { color: #111; }
.scene-detect-x { flex: 0 0 auto; background: none; border: none; color: #fff; font-size: 13px; line-height: 1; cursor: pointer; opacity: .8; padding: 2px 4px; }
.scene-detect-x:hover { opacity: 1; }

.readouts { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); }
.readout { padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.readout:last-child { border-right: none; }
.readout .k { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.readout .v { font-family: var(--num); font-size: 20px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout .s { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.meter { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.meter-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.meter-scale { position: relative; height: 26px; }
.meter-scale .ticks { position: absolute; inset: 0 0 10px 0; display: flex; justify-content: space-between; align-items: flex-end; }
.meter-scale .ticks i { width: 1px; height: 6px; background: var(--ink-4); }
.meter-scale .ticks i.major { height: 12px; background: var(--ink); }
.meter-scale .nums { position: absolute; left: 0; right: 0; bottom: -6px; display: flex; justify-content: space-between; font-family: var(--num); font-size: 10px; color: var(--ink-3); }
.meter-needle { position: absolute; top: -2px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--ink); margin-left: -6px; transition: left .25s; }

.below { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; margin-top: 28px; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.panel-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-b { padding: 16px; }
.histo { width: 100%; height: 120px; display: block; }
.histo-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.advice { list-style: none; }
.advice li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.advice li:last-child { border-bottom: none; }
.advice .lv { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding-top: 1px; }
.advice .lv.warn::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--ink); margin-right: 6px; vertical-align: 1px; }
.advice .lv.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border: 1.5px solid var(--ink); border-radius: 50%; margin-right: 6px; vertical-align: 0; box-sizing: border-box; }
.advice .lv.tip::before { content: ""; display: inline-block; width: 7px; height: 1.5px; background: var(--ink); margin-right: 6px; vertical-align: 3px; }
.tips { list-style: none; counter-reset: t; }
.tips li { counter-increment: t; display: grid; grid-template-columns: 28px 1fr; padding: 8px 0; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.tips li:last-child { border-bottom: none; }
.tips li::before { content: counter(t, decimal-leading-zero); font-family: var(--num); font-size: 11px; color: var(--ink-4); padding-top: 2px; }

/* ---------- 控制面板 ---------- */
.controls { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); flex: none; }
.tab { padding: 12px 0; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.tab-body { overflow-y: auto; padding: 4px 18px 18px; flex: 1; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.grp { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.grp:last-child { border-bottom: none; }
.grp-t { font-size: 10px; letter-spacing: .2em; color: var(--ink-4); text-transform: uppercase; margin-bottom: 6px; }
.ctl { padding: 8px 0; }
.ctl-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 8px; }
.ctl-name { font-size: 13px; }
.ctl-name em { font-style: normal; font-size: 10px; color: var(--ink-4); margin-left: 6px; letter-spacing: .06em; }
.ctl-val { font-family: var(--num); font-size: 14px; font-weight: 600; white-space: nowrap; }
.ctl-val.auto { color: var(--ink-3); }
.ctl-val.auto::after { content: " 自动"; font-family: var(--font); font-size: 10px; font-weight: 400; }
.ctl-note { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.ctl.disabled input[type=range] { opacity: .35; pointer-events: none; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; display: block; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--ink) var(--p, 50%), var(--line-2) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); margin-top: -6px; transition: transform .12s; }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.25); }
input[type=range]:active::-webkit-slider-thumb { background: var(--ink); }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 5px; font-size: 12px; transition: all .12s; }
.seg button:hover { border-color: var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13px; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--line-2); transition: background .15s; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--ink); }
.switch.on::after { left: 19px; }
select.sel { width: 100%; height: 32px; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 8px; background: var(--paper); }

/* ---------- 我的图片 ---------- */
.drop { margin-top: 28px; border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 40px; text-align: center; background: var(--paper); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--ink); background: var(--paper-2); }
.drop b { display: block; font-size: 16px; margin-bottom: 6px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; margin-top: 28px; }
.lib-item { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; transition: border-color .2s; }
.lib-item:hover { border-color: var(--ink); }
.lib-item .tile-img img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.lib-item:hover .tile-img img { transform: scale(1.07); }
.lib-body { padding: 12px 14px 14px; display: grid; gap: 10px; }
.lib-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 30px 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 参数手册 ---------- */
.guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; margin-top: 28px; }
.entry { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 20px 22px; }
.entry .eyebrow { margin-bottom: 4px; }
.entry h2 { font-size: 18px; }
.entry p { font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.entry table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; }
.entry td { padding: 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.entry td:first-child { font-family: var(--num); width: 40%; padding-right: 10px; white-space: nowrap; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 6px; font-size: 13px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---------- 学习模式 ---------- */
.learn { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-columns: 320px minmax(0, 1fr);
  background-color: var(--paper); background-image: radial-gradient(var(--dot) 1px, transparent 1.2px); background-size: 22px 22px; }
.learn[hidden] { display: none; }
.learn-side { background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.learn-head { padding: 26px 26px 20px; border-bottom: 1px solid var(--line); }
.learn-head .eyebrow { margin-bottom: 6px; }
.learn-head b { font-size: 20px; }
.learn-prog { margin-top: 16px; font-size: 11px; color: var(--ink-3); display: flex; justify-content: space-between; }
.learn-bar { margin-top: 6px; height: 2px; background: var(--line); }
.learn-bar i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .3s; }
.learn-toc { flex: 1; overflow-y: auto; padding: 8px 14px 20px; }
.toc-ch { font-size: 10px; letter-spacing: .16em; color: var(--ink-4); padding: 16px 12px 6px; }
.toc-item { display: grid; grid-template-columns: 26px 1fr 12px; align-items: center; gap: 6px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 6px; color: var(--ink-2); transition: background .15s, color .15s; }
.toc-item:hover { background: var(--paper-2); color: var(--ink); }
.toc-item .no { font-family: var(--num); font-size: 11px; color: var(--ink-4); }
.toc-item .st { width: 8px; height: 8px; border: 1.5px solid var(--line-2); border-radius: 50%; }
.toc-item.done .st { background: var(--ink); border-color: var(--ink); }
.toc-item.active { background: var(--ink); color: var(--paper); }
.toc-item.active .no { color: #8d8d8d; }
.toc-item.active .st { border-color: var(--paper); }
.toc-item.active.done .st { background: var(--paper); }
.learn-foot { padding: 14px 26px; border-top: 1px solid var(--line); }
.learn-foot .btn { width: 100%; justify-content: center; }
.learn-main { overflow-y: auto; min-height: 0; }
.lesson { padding: 44px 56px 56px; max-width: 1500px; }
.lesson h1 { font-size: 38px; margin: 8px 0 10px; }
.ls-variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px; }
.ls-var { text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; transition: border-color .2s; }
.ls-var:hover { border-color: var(--ink); }
.ls-var .tile-img { background: #111; }
.ls-var canvas { width: 100%; height: 100%; display: block; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ls-var:hover canvas { transform: scale(1.07); }
.ls-var-cap { padding: 10px 14px 12px; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ls-var-cap b { font-size: 13px; }
.ls-var-cap span { font-family: var(--num); font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.ls-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; margin-top: 36px; align-items: start; }
.ls-text p { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; line-height: 1.85; }
.ls-points { list-style: none; border-top: 1px solid var(--ink); margin-top: 22px; }
.ls-points li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; display: grid; grid-template-columns: 28px 1fr; }
.ls-points li span { font-family: var(--num); font-weight: 400; color: var(--ink-4); font-size: 11px; padding-top: 2px; }
.ls-task { margin-top: 22px; padding: 14px 16px; border: 1px solid var(--ink); border-radius: 6px; font-size: 13px; }
.ls-task .eyebrow { margin-bottom: 4px; }
.ls-diagrams { display: grid; gap: 16px; margin-top: 22px; }
.ls-diagram { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 14px 16px 12px; }
.ls-diagram-h { font-size: 12px; font-weight: 700; letter-spacing: .06em; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.ls-diagram-h span { font-size: 10px; font-weight: 400; color: var(--ink-4); letter-spacing: .1em; }
.ls-diagram svg { display: block; overflow: visible; font-family: var(--num); }
.ls-sim { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; }
.ls-stage { position: relative; background: #111; cursor: crosshair; overflow: hidden; }
.ls-stage canvas.sim { width: 100%; display: block; }
.ls-controls { padding: 4px 18px 14px; border-top: 1px solid var(--line); }
.ls-controls .grp { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; border-bottom: none; }
.ls-controls .grp-t { grid-column: 1 / -1; }
.ls-nav { display: flex; justify-content: space-between; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.ls-nav .btn { min-width: 160px; justify-content: center; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(255,255,255,.86); display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
/* 导入参数对话框：固定全屏居中浮层（z-index 高于移动端抽屉 70 / 遮罩 60） */
.modal-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10,10,10,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay[hidden] { display: none; }
.modal-overlay .modal-box { width: min(520px, 100%); box-sizing: border-box; padding: 28px 30px; overflow: visible; }
.modal-h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.modal-box { width: 560px; background: var(--paper); border: 1px solid var(--ink); border-radius: 10px; overflow: hidden; }
.modal-img { aspect-ratio: 16 / 7; overflow: hidden; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.modal-box:hover .modal-img img { transform: scale(1.05); }
.modal-body { padding: 26px 30px 28px; }
.modal-body h2 { font-size: 24px; margin: 6px 0 8px; }
.modal-body p { font-size: 13px; color: var(--ink-2); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.announce-list { margin: 6px 0 0; padding-left: 20px; font-size: 13px; color: var(--ink-2); }
.announce-list li { margin: 6px 0; line-height: 1.6; }
.announce-list b { color: var(--ink); }
.announce-qq { font-size: 14px; margin-top: 4px; }
.announce-qq b { font-family: var(--num); letter-spacing: .02em; }

@media (max-width: 1280px) {
  .ls-split { grid-template-columns: 1fr; }
  .learn { grid-template-columns: 260px minmax(0, 1fr); }
  .lab { grid-template-columns: minmax(0, 1fr) 340px; }
  .readouts { grid-template-columns: repeat(3, 1fr); }
  .readout:nth-child(3) { border-right: none; }
  .readout:nth-child(n+4) { border-top: 1px solid var(--line); }
  .below { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}

/* ---------- 修图页 ---------- */
.rt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; margin-top: 24px; }
.rt-left .stage-wrap { }
.rt-right { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.rt-right .tab-body { overflow-y: auto; padding: 4px 18px 18px; flex: 1; }
.rt-right .ctl { padding: 8px 0; }

/* ---------- 构图练习页 ---------- */
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 24px; }
.cp-left { }
.cp-right { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 48px); }
.cp-right .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.cp-right .panel-b { overflow-y: auto; max-height: 300px; }
.ref-tip { padding: 10px; background: var(--paper-2); border-left: 3px solid var(--ink); border-radius: 4px; font-size: 12px; line-height: 1.6; }

/* ---------- 首次启动引导 ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: welcomeFadeIn 0.4s ease-out;
}
.welcome-overlay[hidden] { display: none; }

@keyframes welcomeFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.welcome-card {
  width: 720px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  animation: welcomeSlideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes welcomeSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.welcome-header {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  opacity: 0.9;
}

.welcome-header h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.welcome-header p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
}

.welcome-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.welcome-btn {
  background: var(--paper-2);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.welcome-btn:hover {
  background: var(--paper);
  border-color: var(--ink-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.welcome-btn:active {
  transform: translateY(0);
}

.welcome-btn-icon {
  font-size: 32px;
  margin-bottom: 12px;
  filter: grayscale(0.3);
}

.welcome-btn-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.welcome-btn-desc {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
}

.welcome-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-radius: 6px;
  transition: background .15s;
}

.welcome-remember:hover {
  background: var(--line);
}

.welcome-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 1280px) {
  .welcome-card { width: 640px; padding: 40px; }
  .welcome-options { gap: 12px; }
  .welcome-btn { padding: 20px 16px; }
}

/* ---------- 学习模式：章节卡片视图 ---------- */
.learn-chapters {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px 20px;
}

.chapter-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chapter-card:hover {
  background: var(--paper);
  border-color: var(--ink-2);
  transform: translateX(2px);
}

.chapter-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chapter-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.chapter-card-badge {
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--num);
}

.chapter-card-badge.complete {
  background: #4caf50;
}

.chapter-card-badge.partial {
  background: #ff9800;
}

.chapter-card-progress {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.chapter-card-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.chapter-card-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.chapter-card-bar-fill.complete {
  background: #4caf50;
}

.chapter-card.expanded {
  background: var(--paper);
  border-color: var(--ink);
}

.chapter-card-lessons {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chapter-lesson-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease;
}

.chapter-lesson-item:hover {
  color: var(--ink);
}

.chapter-lesson-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
  flex: none;
}

.chapter-lesson-item.done::before {
  background: #4caf50;
}

.chapter-lesson-item.current {
  color: var(--ink);
  font-weight: 600;
}

/* 锁定章节样式 */
.chapter-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.chapter-card.locked:hover {
  transform: none;
  border-color: var(--line);
}

.chapter-card.locked .chapter-card-title {
  color: var(--ink-3);
}

.chapter-card.locked .chapter-card-progress {
  color: var(--ink-4);
  font-style: italic;
}

/* ---------- 构图对比模式 ---------- */
.cp-compare {
  position: relative;
  aspect-ratio: 4/3;
  display: flex;
  background: var(--ink);
  border-radius: 6px;
  overflow: hidden;
}
.cp-compare[hidden] { display: none; }

.cp-compare-side {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.cp-compare-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cp-compare-close svg { width: 11px; height: 11px; flex: none; }
.cp-compare-close:hover { background: rgba(0, 0, 0, 0.9); }

.cp-compare-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  z-index: 10;
}

.cp-compare-side canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.cp-compare-divider {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--paper);
  cursor: ew-resize;
  z-index: 20;
  transform: translateX(-50%);
  transition: background 0.2s ease;
}

.cp-compare-divider:hover {
  background: var(--ink);
}

.cp-compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-compare-handle::before {
  content: '⟷';
  font-size: 16px;
  color: var(--ink);
}

/* ---------- 深色模式 ---------- */
body.dark-mode {
  --ink: #e0e0e0;
  --ink-2: #b8b8b8;
  --ink-3: #909090;
  --ink-4: #707070;
  --line: #3a3a3a;
  --line-2: #4a4a4a;
  --paper: #1a1a1a;
  --paper-2: #242424;
  --dot: #2a2a2a;
  background-color: var(--paper);
  color: var(--ink);
}

body.dark-mode .welcome-overlay {
  background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
}

body.dark-mode .welcome-card {
  background: #1e1e1e;
  border-color: var(--line);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

body.dark-mode .welcome-btn {
  background: var(--paper-2);
  border-color: var(--line);
}

body.dark-mode .welcome-btn:hover {
  background: var(--paper);
  border-color: var(--ink-3);
}

body.dark-mode .chapter-card {
  background: var(--paper-2);
  border-color: var(--line);
}

body.dark-mode .chapter-card:hover {
  background: var(--paper);
  border-color: var(--ink-3);
}

body.dark-mode .modal {
  background: rgba(26, 26, 26, 0.92);
}

body.dark-mode .modal-box {
  background: var(--paper-2);
  border-color: var(--line);
}

body.dark-mode .stage {
  border-color: var(--line);
}

body.dark-mode .cp-compare-divider {
  background: var(--line-2);
}

body.dark-mode .cp-compare-divider:hover {
  background: var(--ink-3);
}

body.dark-mode .cp-compare-handle {
  background: var(--paper-2);
  border-color: var(--line);
}

body.dark-mode .cp-compare-handle::before {
  color: var(--ink);
}

/* 深色模式切换按钮 */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 50;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--paper-2);
  border-color: var(--ink-2);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .theme-icon {
  width: 24px;
  height: 24px;
  color: var(--ink);
}

/* AI 生成示例图角标 */
.ai-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(10,10,10,0.75);
  color: #f2f2f2;
  border-radius: 3px;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 5;
}
.tile-img .ai-badge { bottom: 6px; right: 6px; font-size: 10px; padding: 2px 6px; }

/* ---------- 符号艺术风格图标 ---------- */
.icon-leaf, .icon-book, .icon-rocket, .icon-lock, .icon-moon, .icon-sun, 
.icon-check, .icon-warning, .icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

.icon-leaf svg, .icon-book svg, .icon-rocket svg, .icon-lock svg,
.icon-moon svg, .icon-sun svg, .icon-check svg, .icon-warning svg, .icon-circle svg {
  width: 100%;
  height: 100%;
}

/* 欢迎页面图标放大 */
.welcome-btn-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-btn-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ---------- 学习进度总览 ---------- */
.prog-top { display: flex; align-items: center; gap: 28px; margin-top: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.prog-ring { flex: none; }
.prog-ring-num { font-family: var(--num); font-size: 24px; font-weight: 700; fill: var(--ink); }
.prog-top-info { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.prog-top-num { font-family: var(--num); font-size: 28px; font-weight: 700; }
.prog-top-info .btn { margin-top: 8px; }
.prog-ch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.prog-ch { text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--paper); transition: border-color .15s, background .15s; }
.prog-ch:hover { border-color: var(--ink-3); background: var(--paper-2); }
.prog-ch-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.prog-ch-name { font-size: 13px; font-weight: 700; }
.prog-ch-badge { font-family: var(--num); font-size: 11px; color: var(--ink-3); padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line); }
.prog-ch-badge.partial { color: var(--ink); border-color: var(--ink-3); }
.prog-ch-badge.complete { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.prog-ch-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.prog-ch-fill { height: 100%; background: var(--ink-3); border-radius: 4px; transition: width .3s; }
.prog-ch-fill.complete { background: var(--ink); }
.prog-quiz { margin-top: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.prog-quiz-score { font-family: var(--num); font-size: 20px; font-weight: 700; }

/* ---------- 实验室参数对比 A/B ---------- */
.lab-ab { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; }
.lab-ab-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lab-ab-tip { font-size: 12px; color: var(--ink-3); }
.lab-ab-actions { display: flex; gap: 8px; }
.lab-ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.lab-ab-pane { background: var(--paper); display: flex; flex-direction: column; }
.lab-ab-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.lab-ab-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.lab-ab-tag.b { background: var(--ink-3); }
.lab-ab-info { display: flex; gap: 10px; flex-wrap: wrap; }
.lab-ab-info b { font-family: var(--num); font-size: 11px; font-weight: 600; color: var(--ink-2); }
.lab-ab-canvas { position: relative; }
.lab-ab-canvas canvas { display: block; width: 100%; height: auto; background: #111; }
.lab-ab-diff { padding: 10px 14px; border-top: 1px solid var(--line); font-family: var(--num); font-size: 12px; color: var(--ink); }
