/* =========================================================
   草本星球 3D 页面 · 样式
   视觉基调：延续品牌「极简 · 明亮 · 通透 · 呼吸感」
   背景 #FAFDFB / 文字 #0D2818 / 品牌翠绿 #2DBE6C
   节点初始浅绿 #8BC34A（对接说明书 §3.3）
   ========================================================= */

.planet-hero {
  text-align: center;
  padding: 5.5rem 24px 18px;  /* 顶部留出固定导航栏高度 */
}
.planet-hero h1 {
  font-family: var(--font-serif, "Noto Serif SC", serif);
  font-weight: 300;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .12em;
  color: var(--text, #0D2818);
  margin: 0 0 10px;
}
.planet-hero p {
  color: var(--text-secondary, #4A7A5C);
  font-weight: 300;
  letter-spacing: .04em;
  margin: 0 auto;
  max-width: 640px;
  font-size: 14px;
}

.planet-stage {
  max-width: 1320px;
  margin: 0 auto 64px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 顶部控制区 ---------- */
.planet-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.group-btn {
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  background: var(--bg-alt, #fff);
  color: var(--text, #0D2818);
  font-family: inherit;
  font-weight: 300;
  letter-spacing: .06em;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius, 2px);
  cursor: pointer;
  transition: all .25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.group-btn .dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block;
}
.group-btn:hover { border-color: var(--brand, #2DBE6C); }
.group-btn.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.group-btn.active .dot { background:#fff !important; }

.overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text-secondary, #4A7A5C);
  cursor: pointer;
  user-select: none;
  padding: 6px 4px;
}
.overlay-toggle input { accent-color: var(--brand, #2DBE6C); }

.custom-btn {
  border: 1px solid var(--brand, #2DBE6C);
  background: transparent;
  color: var(--brand, #2DBE6C);
  font-family: inherit;
  font-weight: 300;
  letter-spacing: .06em;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: var(--radius, 2px);
  cursor: pointer;
  transition: all .25s ease;
}
.custom-btn:hover { background: var(--brand, #2DBE6C); color: #fff; }

/* ---------- 主体：画布 + 侧栏 ---------- */
.planet-main {
  display: flex;
  gap: 18px;
  align-items: stretch;
}
.planet-canvas-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 62vh;
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: var(--radius, 2px);
  background:
    radial-gradient(120% 120% at 50% 30%, #ffffff 0%, var(--bg, #FAFDFB) 60%, #eef6f1 100%);
  overflow: hidden;
  cursor: grab;
}
.planet-canvas-wrap:active { cursor: grabbing; }
.planet-canvas-wrap canvas { display: block; }

.planet-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  max-width: 240px;
  background: rgba(255,255,255,.94);
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: 0;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text, #0D2818);
  box-shadow: 0 6px 20px rgba(13,40,24,.10);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  backdrop-filter: blur(4px);
}
.planet-tooltip.show { opacity: 1; transform: translateY(0); }
.planet-tooltip .tt-name { font-weight: 500; letter-spacing:.04em; }
.planet-tooltip .tt-eff { color: var(--text-secondary,#4A7A5C); margin-top: 3px; }
.planet-tooltip .tt-herbs { color: var(--text-secondary,#4A7A5C); margin-top: 4px; }
.planet-tooltip .tt-src { color: var(--brand,#2DBE6C); margin-top: 5px; font-size: 11px; }

/* ---------- 右侧详情面板 ---------- */
.planet-panel {
  flex: 0 0 340px;
  max-width: 340px;
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: var(--radius, 2px);
  background: var(--bg-alt, #fff);
  padding: 18px 16px;
  overflow-y: auto;
  max-height: 62vh;
}
.planet-panel h3 {
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .08em;
  margin: 0 0 4px;
  color: var(--text, #0D2818);
}
.planet-panel .panel-sub {
  font-size: 12px;
  color: var(--text-secondary, #4A7A5C);
  margin: 0 0 14px;
}
.panel-empty {
  font-size: 13px;
  color: var(--text-tertiary, #7FAA92);
  font-weight: 300;
  line-height: 1.7;
  padding: 18px 4px;
}
.formula-card {
  border-top: var(--line-width, 1px) solid var(--line_light, #D5EDE0);
  padding: 13px 2px;
  cursor: pointer;
}
.formula-card:first-of-type { border-top: none; }
.formula-card .fc-head {
  display: flex; align-items: center; gap: 8px;
}
.formula-card .fc-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
}
.formula-card .fc-name {
  font-size: 14px; font-weight: 400; letter-spacing: .03em;
  color: var(--text, #0D2818);
}
.formula-card .fc-tags {
  margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px;
}
.fc-tag {
  font-size: 11px; font-weight: 300;
  color: var(--text-secondary, #4A7A5C);
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: var(--radius, 2px); padding: 2px 9px;
}
.fc-match {
  margin-left: auto;
  font-size: 11px; font-weight: 300;
  color: var(--text-secondary, #4A7A5C);
  background: var(--bg-alt, #ffffff);
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: var(--radius, 2px); padding: 2px 9px;
}
.fc-match.strict {
  color: var(--brand, #2DBE6C);
  border-color: var(--brand, #2DBE6C);
  background: var(--brand-pale, #E5F7EE);
}
.fc-matched-tags {
  margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
  font-size: 11px; font-weight: 300;
  color: var(--text-secondary, #4A7A5C);
}
.fc-mini-tag {
  font-size: 11px; font-weight: 300;
  color: var(--brand, #2DBE6C);
  border: var(--line-width, 1px) solid var(--brand-light, #86DDAF);
  border-radius: var(--radius, 2px); padding: 2px 9px;
}
.formula-card .fc-herbs {
  margin-top: 8px; font-size: 12.5px; font-weight: 300;
  color: var(--text, #0D2818); line-height: 1.6;
}
.formula-card .fc-source {
  margin-top: 7px; font-size: 11.5px; font-weight: 300;
  color: var(--brand, #2DBE6C);
}
.formula-card .fc-desc {
  margin-top: 8px; font-size: 12.5px; font-weight: 300; line-height: 1.7;
  color: var(--text-secondary, #4A7A5C);
  display: none;
}
.formula-card.open .fc-desc { display: block; }
.formula-card.open { background: var(--brand-pale, #E5F7EE); border-radius: var(--radius, 2px); padding: 13px 10px; }

/* ---------- 底部栏 ---------- */
.planet-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.reset-btn {
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  background: var(--bg-alt, #fff);
  color: var(--text, #0D2818);
  font-family: inherit; font-weight: 300; letter-spacing: .06em; font-size: 13px;
  padding: 9px 20px; border-radius: var(--radius, 2px); cursor: pointer;
  transition: all .25s ease;
}
.reset-btn:hover { border-color: var(--brand, #2DBE6C); color: var(--brand, #2DBE6C); }
.planet-note {
  font-size: 12px; font-weight: 300; color: var(--text-tertiary, #7FAA92);
  letter-spacing: .03em;
}

/* ---------- 自定义选配弹窗 ---------- */
.planet-modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(13,40,24,.28);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.planet-modal-mask.show { display: flex; }
.planet-modal {
  width: min(720px, 100%);
  max-height: 86vh; overflow-y: auto;
  background: var(--bg, #FAFDFB);
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  border-radius: var(--radius-lg, 4px);
  padding: 26px 28px;
  box-shadow: 0 20px 60px rgba(13,40,24,.22);
}
.planet-modal h2 {
  font-family: var(--font-serif, "Noto Serif SC", serif);
  font-weight: 300; font-size: 22px; letter-spacing: .1em;
  margin: 0 0 4px;
}
.planet-modal .pm-hint {
  font-size: 12.5px; font-weight: 300; color: var(--text-secondary, #4A7A5C);
  margin: 0 0 18px;
}
.filter-dim {
  margin-bottom: 18px;
}
.filter-dim .fd-title {
  font-size: 13px; font-weight: 400; letter-spacing: .06em;
  color: var(--text, #0D2818); margin-bottom: 9px;
  display: flex; align-items: center; gap: 8px;
}
.filter-dim .fd-title .fd-idx {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--brand, #2DBE6C); color: var(--brand, #2DBE6C);
  font-size: 11px; display: inline-flex; align-items: center; justify-content: center;
}
.filter-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-opt {
  font-size: 12.5px; font-weight: 300; cursor: pointer; user-select: none;
  border: var(--line-width, 1px) solid var(--line, #B8DDC8); border-radius: var(--radius, 2px);
  padding: 6px 14px; color: var(--text, #0D2818); transition: all .2s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-opt input { display: none; }
.filter-opt:hover { border-color: var(--brand, #2DBE6C); }
.filter-opt.checked { background: var(--brand, #2DBE6C); color: #fff; border-color: transparent; }

.planet-modal .pm-actions {
  display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px;
  border-top: var(--line-width, 1px) solid var(--line_light, #D5EDE0); padding-top: 18px;
}
.pm-apply {
  background: var(--brand, #2DBE6C); color: #fff; border: none;
  font-family: inherit; font-weight: 300; letter-spacing: .08em; font-size: 13px;
  padding: 10px 24px; border-radius: var(--radius, 2px); cursor: pointer;
}
.pm-clear {
  background: transparent; color: var(--text-secondary, #4A7A5C);
  border: var(--line-width, 1px) solid var(--line, #B8DDC8);
  font-family: inherit; font-weight: 300; font-size: 13px;
  padding: 10px 20px; border-radius: var(--radius, 2px); cursor: pointer;
}

/* ---------- 加载/错误 ---------- */
.planet-loading, .planet-error {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 300;
  color: var(--text-secondary, #4A7A5C); letter-spacing: .05em;
}
.planet-error { color: #c0392b; padding: 20px; text-align: center; line-height: 1.7; }

/* ---------- 响应式 ---------- */
@media (max-width: 880px) {
  .planet-main { flex-direction: column; }
  .planet-panel { flex: 1 1 auto; max-width: none; max-height: 50vh; }
  .planet-canvas-wrap { min-height: 56vh; }
}
