* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #111418;
  --pane: #1a1f26;
  --text: #e8eaed;
  --dim: #9aa0a6;
  --accent: #4c9aff;
  --danger: #f28b82;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ---- 取景区 ---- */
#camera-pane {
  position: relative;
  height: 38dvh;
  flex-shrink: 0;
  background: #000;
}
#preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#status-pill {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 99px;
  background: rgba(0,0,0,.65);
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
#version-tag {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.35);
  padding: 1px 6px;
  border-radius: 6px;
}
#version-info {
  text-align: center;
  font-size: 11px;
  color: var(--dim);
  padding-top: 4px;
}
#btn-settings {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 18px;
}

/* ---- 讲解区 ---- */
#narration-pane {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px calc(80px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
#current-narration { margin-bottom: 18px; }
#current-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 8px;
}
#current-title.placeholder { color: var(--dim); font-weight: 400; }
#current-text {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

#transcript { border-top: 1px solid #2a3038; padding-top: 12px; }
.t-item {
  padding: 10px 0;
  border-bottom: 1px solid #22272e;
}
.t-item .t-title { font-size: 14px; font-weight: 600; }
.t-item .t-meta { font-size: 11px; color: var(--dim); margin: 2px 0 4px; }
.t-item .t-text {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.t-item.expanded .t-text { -webkit-line-clamp: unset; color: var(--text); }

/* ---- 控制栏 ---- */
#control-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 30%);
}
#control-bar button {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #2a3038;
  background: var(--pane);
  color: var(--text);
  font-size: 16px;
}
#control-bar button.primary { background: var(--accent); border: none; color: #04101f; font-weight: 700; }
#control-bar button:disabled { opacity: .35; }
#btn-start { flex: 1.6; }

/* ---- 弹层 ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: flex-end;
  z-index: 10;
}
.overlay.hidden, .hidden { display: none !important; }
.sheet {
  width: 100%;
  background: var(--pane);
  border-radius: 16px 16px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet h2 { font-size: 17px; margin-bottom: 4px; }
.sheet label { font-size: 13px; color: var(--dim); }
.sheet input[type=text], .sheet input[type=url], .sheet input[type=password], .sheet select {
  height: 44px;
  border-radius: 10px;
  border: 1px solid #2a3038;
  background: var(--bg);
  color: var(--text);
  padding: 0 12px;
  font-size: 15px;
}
.sheet button {
  height: 46px;
  border-radius: 12px;
  border: 1px solid #2a3038;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.sheet button.primary { background: var(--accent); border: none; color: #04101f; font-weight: 700; }
.sheet button.danger { color: var(--danger); }
