/* ============================================================
   《氢原子探秘》样式表
   主色 #7c5cff，强调 #22d3ee / #ff5ca8 / #ffb347
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #e8e9ff;
  background: radial-gradient(circle at 50% 30%, #171a3a, #0b0e20);
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 顶部栏 ---------------- */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7c5cff;
  box-shadow: 0 0 10px #7c5cff, 0 0 22px rgba(124, 92, 255, 0.7);
}

.brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: rgba(232, 233, 255, 0.55);
  margin-left: 6px;
  letter-spacing: 0;
}

.back-link {
  color: #c7d2fe;
  text-decoration: none;
  font-size: 14px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}
.back-link:hover {
  border-color: #7c5cff;
  color: #fff;
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.45);
}

/* ---------------- 主布局 ---------------- */
.layout {
  height: calc(100vh - 56px);
  display: flex;
}

.stage {
  flex: 1;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

#view {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#view:active { cursor: grabbing; }

/* 视图标签 */
.view-label {
  position: absolute;
  top: 14px;
  display: none;
  padding: 5px 14px;
  font-size: 13px;
  color: #dfe3ff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}

/* 底部说明 */
.caption {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  max-width: min(92%, 720px);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(232, 233, 255, 0.82);
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* 移动端面板按钮 */
.panel-toggle {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 8;
  font-family: inherit;
  font-size: 13px;
  color: #fff;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.55);
  backdrop-filter: blur(8px);
}

/* ---------------- 控制面板 ---------------- */
.panel {
  width: 348px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  padding: 16px 16px 28px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: rgba(124, 92, 255, 0.5); border-radius: 3px; }

.group {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.group-title {
  font-size: 13px;
  font-weight: 600;
  color: #b9c0f5;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}
.group-title.small { margin: 12px 0 8px; font-size: 12px; }

/* 分段按钮组 */
.seg {
  display: flex;
  gap: 6px;
}
.seg button {
  flex: 1;
  font-family: inherit;
  font-size: 13px;
  color: #c8ccf2;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.seg button:hover { border-color: rgba(124, 92, 255, 0.8); color: #fff; }
.seg button.active {
  color: #fff;
  border-color: #7c5cff;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.85), rgba(124, 92, 255, 0.45));
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.45);
}

.seg-six { flex-wrap: wrap; }
.seg-six button { flex: 0 0 calc(33.333% - 4px); }

.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 auto; padding: 7px 10px; }

/* 开关行 */
.switch-row {
  display: flex;
  gap: 10px;
}
.switch {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  padding: 9px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
}
.switch input {
  appearance: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dfe3ff;
  transition: transform 0.2s ease;
}
.switch input:checked { background: #7c5cff; }
.switch input:checked::after { transform: translateX(14px); background: #fff; }

/* 勾选项 */
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}
.check-line input {
  width: 16px;
  height: 16px;
  accent-color: #7c5cff;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(200, 204, 242, 0.6);
}

/* 滑块行 */
.slider-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
}
.slider-line input[type="range"] {
  flex: 1;
  accent-color: #22d3ee;
}
.slider-line b {
  min-width: 42px;
  text-align: right;
  color: #22d3ee;
  font-size: 13px;
}

/* ---------------- 信息卡 ---------------- */
.info-card {
  font-size: 13px;
  line-height: 1.5;
}
.info-block + .info-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}
.info-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.info-head b {
  font-size: 15px;
  color: #22d3ee;
}
.info-head span {
  font-size: 12px;
  color: rgba(200, 204, 242, 0.65);
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2.5px 0;
}
.info-row span { color: rgba(210, 214, 245, 0.72); }
.info-row b { font-weight: 600; color: #fff; text-align: right; }
.info-desc {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(232, 233, 255, 0.85);
}

/* ---------------- 径向图 ---------------- */
.radial-wrap {
  width: 100%;
  height: 172px;
  border-radius: 14px;
  background: rgba(11, 14, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
#radialCanvas { display: block; width: 100%; height: 100%; }

.hidden { display: none !important; }

/* ---------------- 自适应 ---------------- */
@media (max-width: 860px) {
  .topbar { height: 50px; padding: 0 14px; }
  .brand { font-size: 16px; }
  .brand-sub { display: none; }
  .back-link { font-size: 13px; padding: 6px 12px; }

  .layout {
    height: calc(100vh - 50px);
    position: relative;
  }

  .panel-toggle { display: block; }

  .panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: auto;
    max-height: 68vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px 22px 0 0;
    background: rgba(18, 21, 48, 0.92);
    transform: translateY(calc(100% - 52px));
    transition: transform 0.28s ease;
    z-index: 9;
    padding-bottom: 30px;
  }
  .panel.open { transform: translateY(0); }

  .caption {
    bottom: 12px;
    font-size: 12px;
    padding: 7px 14px;
  }

  .view-label { top: 56px; }
}
