/* ===== 天人一体推演大模型平台 - 全局样式 ===== */
:root {
  --bg-dark: #07091a;
  --bg-card: rgba(14, 19, 38, 0.78);
  --bg-glass: rgba(255,255,255,0.05);
  --border-glass: rgba(255,255,255,0.10);
  --text-primary: #e8ecf8;
  --text-secondary: #aab4cf;
  --text-muted: #6b7a99;
  --accent-sun: #ff8f00;
  --accent-moon: #7986cb;
  --wood: #4caf50;
  --wood-glow: rgba(76,175,80,0.45);
  --fire: #ff5252;
  --fire-glow: rgba(255,82,82,0.45);
  --earth: #ffca28;
  --earth-glow: rgba(255,202,40,0.45);
  --metal: #cfd8dc;
  --metal-glow: rgba(207,216,220,0.4);
  --water: #42a5f5;
  --water-glow: rgba(66,165,245,0.45);
  --radius: 14px;
  --transition: 0.35s cubic-bezier(.4,0,.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(1px 1px at 8% 18%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 22% 62%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 48% 12%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 72% 78%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 92% 38%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 18% 88%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 82% 14%, rgba(255,200,120,0.18), transparent),
    radial-gradient(2px 2px at 58% 52%, rgba(150,200,255,0.12), transparent),
    radial-gradient(1px 1px at 35% 45%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 66% 30%, rgba(255,255,255,0.28), transparent);
  z-index: -1;
  animation: twinkle 9s infinite alternate ease-in-out;
}
@keyframes twinkle { from{opacity:.55;} to{opacity:1;} }

/* ===== 导航 ===== */
.nav-bar {
  position: fixed; top:0; left:0; right:0; z-index: 1000;
  background: rgba(7,9,26,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 20px;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 1.1rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-moon));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 2px; white-space: nowrap;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-secondary); text-decoration: none;
  padding: 6px 11px; border-radius: 8px; font-size: 0.83rem;
  transition: var(--transition); white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  color: #fff; background: rgba(255,255,255,0.10);
  box-shadow: 0 0 14px rgba(110,145,255,0.30);
}

/* ===== 布局 ===== */
.container { max-width: 1180px; margin: 78px auto 48px; padding: 0 20px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
  transition: var(--transition);
}
.card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 10px 34px rgba(0,0,0,0.35);
}
.card-title {
  font-size: 1.22rem; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 9px;
}
.card-title .icon { font-size: 1.4rem; }

/* ===== 五行色 ===== */
.tag-wood { color: var(--wood); }
.tag-fire { color: var(--fire); }
.tag-earth { color: var(--earth); }
.tag-metal { color: var(--metal); }
.tag-water { color: var(--water); }
.glow-wood { box-shadow: 0 0 16px var(--wood-glow); border-color: var(--wood); }
.glow-fire { box-shadow: 0 0 16px var(--fire-glow); border-color: var(--fire); }
.glow-earth { box-shadow: 0 0 16px var(--earth-glow); border-color: var(--earth); }
.glow-metal { box-shadow: 0 0 16px var(--metal-glow); border-color: var(--metal); }
.glow-water { box-shadow: 0 0 16px var(--water-glow); border-color: var(--water); }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 10px 22px;
  border-radius: 10px; border: 1px solid var(--border-glass);
  background: var(--bg-glass); color: var(--text-primary);
  cursor: pointer; font-size: 0.93rem; transition: var(--transition);
  text-decoration: none;
}
.btn:hover {
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 20px rgba(110,145,255,0.25);
  transform: translateY(-2px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-sun), var(--accent-moon));
  border: none; color: #fff; font-weight: 500;
}
.btn-primary:hover { box-shadow: 0 0 28px rgba(255,143,0,0.4); }

/* ===== 网格 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* ===== 标题 ===== */
h1 { font-size: 1.95rem; margin-bottom: 10px; }
h2 { font-size: 1.45rem; margin-bottom: 10px; }
h3 { font-size: 1.12rem; margin-bottom: 8px; }
h4 { font-size: 1rem; margin-bottom: 6px; }
.subtitle { color: var(--text-secondary); margin-bottom: 26px; font-size: 1rem; }

/* ===== 流程图 ===== */
.flow-chart { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0; }
.flow-step {
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 10px; padding: 11px 16px; text-align: center;
  flex: 1; min-width: 100px; font-size: 0.9rem;
}
.flow-arrow { font-size: 1.3rem; color: var(--text-muted); }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; margin: 14px 0; }
th, td { padding: 11px 13px; text-align: left; border-bottom: 1px solid var(--border-glass); }
th { color: var(--text-secondary); font-weight: 500; font-size: 0.88rem; }

/* ===== 表单 ===== */
input, select, textarea {
  width: 100%; padding: 11px 15px;
  background: var(--bg-glass); border: 1px solid var(--border-glass);
  border-radius: 10px; color: var(--text-primary);
  font-size: 0.93rem; transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-moon);
  box-shadow: 0 0 12px rgba(121,134,203,0.35);
}
label { display: block; margin-bottom: 5px; color: var(--text-secondary); font-size: 0.88rem; }

/* ===== 结果框 ===== */
.result-box {
  background: rgba(0,0,0,0.32); border-radius: 12px;
  padding: 20px; margin-top: 18px;
  border-left: 3px solid var(--accent-sun);
  display: none;
}
.result-box.show { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(10px);} to{opacity:1;transform:translateY(0);} }

/* ===== Canvas 容器 ===== */
.canvas-wrap {
  position: relative; width: 100%; text-align: center; padding: 10px 0;
}
canvas { display: block; margin: 0 auto; max-width: 100%; }

/* ===== ECharts 容器 ===== */
.chart-box { width: 100%; height: 400px; margin: 12px 0; }
.chart-box.tall { height: 460px; }

/* ===== 螺旋动画 ===== */
@keyframes spiral {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(1); }
}
.spiral-orbit {
  width: 180px; height: 180px;
  border: 2px dashed rgba(255,255,255,0.18);
  border-radius: 50%;
  animation: spiral 22s linear infinite;
  display: flex; align-items: center; justify-content: center;
  position: relative; margin: 34px auto;
}
.spiral-orbit::before {
  content: ''; width: 120px; height: 120px;
  border: 1.5px dashed rgba(255,143,0,0.3);
  border-radius: 50%; position: absolute;
}
.spiral-orbit::after {
  content: ''; width: 68px; height: 68px;
  border: 1px dashed rgba(121,134,203,0.4);
  border-radius: 50%; position: absolute;
}

/* ===== 宇宙音效按钮 ===== */
.ambience-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: var(--transition);
  white-space: nowrap;
}
.ambience-btn:hover { color: #fff; border-color: var(--accent-moon); box-shadow: 0 0 14px rgba(92,107,192,0.4); }
.ambience-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(255,111,0,0.25), rgba(92,107,192,0.25));
  border-color: var(--accent-sun);
  box-shadow: 0 0 16px rgba(255,111,0,0.35);
}

/* ===== Canvas 容器 ===== */
.canvas-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 200px;
}
.canvas-wrap canvas { display: block; max-width: 100%; }

/* ===== 工具栏 ===== */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.toolbar .btn.active { background: linear-gradient(135deg, var(--accent-sun), var(--accent-moon)); color: #fff; }

/* ===== 滑块美化 ===== */
input[type=range] {
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(67,160,71,0.6), rgba(249,168,37,0.6), rgba(30,136,229,0.6));
  outline: none;
  padding: 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
  border: 2px solid var(--accent-moon);
}
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: 2px solid var(--accent-moon);
}

ul { margin-left: 20px; }
li { margin-bottom: 4px; color: var(--text-secondary); }

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-bar { justify-content: center; }
  h1 { font-size: 1.45rem; }
  .flow-chart { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); }
  .container { margin-top: 70px; }
  .card { padding: 18px; }
  .chart-box { height: 320px; }
}
