/* 许峰声呐AI工作室 · 在线互动声呐培训学院（零依赖 · 建筑感精密仪器风格） */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-subtle: #f7f8fa;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --ink: #111827;
  --ink-secondary: #4b5563;
  --ink-muted: #6b7280;
  --primary: #111827;
  --primary-fg: #ffffff;
  --accent: #1d4ed8;
  --alert: #c8322b;
  --confirm: #15803d;
  --amber: #b45309;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 13.5px; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }

/* 实名浅水印防外泄层 */
.watermark-layer {
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  opacity: 0.045; background-repeat: repeat;
}

/* 顶栏 */
.course-header {
  height: 58px; padding: 0 22px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: sticky; top: 0; z-index: 30;
}
.head-left, .head-right { display: flex; align-items: center; gap: 10px; }
.course-logo { height: 25px; width: auto; display: block; object-fit: contain; }
.course-pill {
  font-size: 12px; font-weight: 600; color: var(--ink-secondary);
  background: var(--surface-subtle); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
}

.btn {
  border: 1px solid transparent; border-radius: 7px; padding: 6px 13px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: background 0.14s, border-color 0.14s; white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover:not(:disabled) { background: #1f2937; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-subtle); }
.btn-ghost { background: transparent; color: var(--ink-secondary); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }

/* 主双栏结构 */
.academy-shell {
  height: calc(100vh - 58px);
  display: grid; grid-template-columns: 270px minmax(0, 1fr);
}
@media (max-width: 900px) {
  .academy-shell { grid-template-columns: 1fr; height: auto; }
  .chapter-sidebar { display: none; }
}

/* 左侧章节目录 */
.chapter-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-head strong { font-size: 13px; }
.sidebar-head span { font-size: 11.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.chapter-list {
  flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 4px;
}
.chap-btn {
  width: 100%; border: 1px solid transparent; background: transparent;
  border-radius: 8px; padding: 10px 11px; text-align: left; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px; color: var(--ink-secondary);
  transition: background 0.12s, border-color 0.12s;
}
.chap-btn:hover { background: var(--surface-subtle); color: var(--ink); }
.chap-btn.active {
  background: var(--ink); color: #ffffff;
}
.chap-num {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 700;
  background: var(--surface-subtle); color: var(--ink-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.chap-btn.active .chap-num { background: rgba(255, 255, 255, 0.18); color: #ffffff; }
.chap-title { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.chap-sub { font-size: 11px; opacity: 0.72; margin-top: 2px; }

/* 右侧主课程舞台 */
.stage-wrap {
  display: flex; flex-direction: column; overflow: hidden;
}
.lesson-scroll {
  flex: 1; overflow-y: auto; padding: 26px 34px 40px;
}
.lesson-inner {
  max-width: 1020px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px;
}
.lesson-head {
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.lesson-kicker {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 600; color: var(--ink-muted); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 6px;
}
.lesson-head h1 { margin: 0 0 8px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.lesson-head p { margin: 0; font-size: 14px; color: var(--ink-secondary); line-height: 1.65; }

/* 底部翻页控制栏 */
.stage-footer {
  height: 54px; padding: 0 28px; background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-hint { font-size: 12px; color: var(--ink-muted); }

/* 通用教学卡片 */
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 820px) { .card-grid-3, .card-grid-2 { grid-template-columns: 1fr; } }

.teach-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
}
.teach-card-img {
  aspect-ratio: 16 / 10; background: #0d1117; overflow: hidden;
}
.teach-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.teach-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.teach-card-title { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.teach-card-desc { font-size: 12.5px; color: var(--ink-secondary); line-height: 1.65; }

.callout-box {
  padding: 14px 16px; border-radius: 9px; font-size: 13px; line-height: 1.68;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ink);
}
.callout-box.danger {
  background: rgba(200, 50, 43, 0.05); border-color: rgba(200, 50, 43, 0.25); border-left-color: var(--alert);
}
.callout-box.success {
  background: rgba(21, 128, 61, 0.05); border-color: rgba(21, 128, 61, 0.25); border-left-color: var(--confirm);
}

/* 交互式 Canvas 沙盘面板 */
.sim-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  overflow: hidden; display: flex; flex-direction: column;
}
.sim-bar {
  padding: 12px 16px; background: var(--surface-subtle); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.sim-canvas-wrap {
  background: #0c1017; padding: 12px; display: flex; justify-content: center;
}
.sim-canvas-wrap canvas { max-width: 100%; height: auto; display: block; border-radius: 6px; }

/* 五大成像因素控制台 */
.factor-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.f-tab {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-secondary);
  padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.f-tab.active { background: var(--ink); color: #ffffff; border-color: var(--ink); }
.factor-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
@media (max-width: 760px) { .factor-layout { grid-template-columns: 1fr; } }
.factor-list { display: flex; flex-direction: column; gap: 6px; }
.factor-item-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-secondary);
  padding: 9px 12px; border-radius: 7px; text-align: left; font-size: 13px; font-weight: 500; cursor: pointer;
}
.factor-item-btn.active { background: var(--ink); color: #ffffff; border-color: var(--ink); font-weight: 600; }
.factor-detail {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
}

/* 真实声呐案例交互查看器（四步法 + 案例精讲） */
.case-viewer {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; align-items: start;
}
@media (max-width: 860px) { .case-viewer { grid-template-columns: 1fr; } }
.sonar-stage-box {
  position: relative; background: #0a0d12; border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
}
.sonar-stage-box img { width: 100%; display: block; object-fit: contain; }
.sonar-highlight-box {
  position: absolute; border: 2.5px solid #ff2d20;
  background: rgba(255, 45, 32, 0.14);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.7);
  pointer-events: none; transition: all 0.25s ease;
}
.sonar-highlight-label {
  position: absolute; top: -24px; left: -2px;
  background: #ff2d20; color: #ffffff; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px; white-space: nowrap;
}
.step-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.step-pill {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-secondary);
  padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.step-pill.active { background: var(--ink); color: #ffffff; border-color: var(--ink); }

@media print {
  .course-header, .chapter-sidebar, .stage-footer { display: none !important; }
  .academy-shell { display: block; height: auto; }
  .lesson-scroll { overflow: visible; padding: 0; }
}

/* 章节完成勾选标记与电子结业证书弹窗 */
.chap-done-tag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--confirm);
  background: rgba(21, 128, 61, 0.1);
  border: 1px solid rgba(21, 128, 61, 0.25);
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.chap-btn.active .chap-done-tag {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}
.cert-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
}
.cert-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(3px);
}
.cert-dialog {
  position: relative; z-index: 2; width: min(760px, 95vw); max-height: 92vh;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}
.cert-head {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.cert-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.cert-body {
  padding: 18px 20px; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.cert-preview-img {
  width: 100%; max-width: 680px; border-radius: 8px;
  border: 1px solid var(--border-strong); display: block; background: #ffffff;
}
.cert-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
