/* ==========================================================================
   Mr.Science · AIDC 知识站 — 设计系统
   ========================================================================== */

:root {
  --bg: #070b11;
  --bg-soft: #0b1119;
  --panel: #0f1720;
  --panel-2: #141e2a;
  --line: #1d2b3a;
  --line-soft: #16222e;
  --text: #e6eef7;
  --text-2: #9fb0c3;
  --text-3: #64788e;
  --cyan: #2ee6d6;
  --cyan-dim: #1aa89c;
  --blue: #4d8bff;
  --amber: #ffb545;
  --red: #ff5c68;
  --green: #3ddc84;
  --radius: 14px;
  --radius-sm: 8px;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 背景网格 + 光晕 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(46, 230, 214, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 230, 214, 0.028) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: -30vh;
  left: 50%;
  width: 120vw;
  height: 80vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(77, 139, 255, 0.13), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; transition: color 0.18s; }
a:hover { color: #7ff5ea; }

h1, h2, h3, h4 { line-height: 1.3; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.narrow { max-width: 780px; }

/* ============================ 顶部导航 ============================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 11, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo:hover { color: var(--text); }

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: #04121a;
  box-shadow: 0 0 18px rgba(46, 230, 214, 0.35);
}

.logo small {
  color: var(--text-3);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }

.nav-links a {
  color: var(--text-2);
  font-size: 14.5px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
}

.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); }
.nav-links a.on { color: var(--cyan); background: rgba(46, 230, 214, 0.09); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
  font-size: 18px;
  cursor: pointer;
}

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #24c4e0);
  color: #04121a;
  box-shadow: 0 6px 24px rgba(46, 230, 214, 0.22);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(46, 230, 214, 0.32); color: #04121a; }

.btn-ghost { border-color: var(--line); color: var(--text-2); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: var(--cyan-dim); color: var(--cyan); }

/* ============================ Hero ============================ */
.hero { padding: 92px 0 76px; position: relative; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(46, 230, 214, 0.25);
  background: rgba(46, 230, 214, 0.06);
  padding: 5px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15;
  margin-bottom: 22px;
  letter-spacing: -0.03em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--cyan), var(--blue) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-lead {
  font-size: 17.5px;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 34px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 54px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.stat-num {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-num span { font-size: 14px; color: var(--cyan); margin-left: 3px; }
.stat-label { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* Hero 右侧：机柜示意 */
.hero-visual {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, #0d1520, #080d14);
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(46, 230, 214, 0.1), transparent 60%);
  pointer-events: none;
}

.rack { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; position: relative; }

.rack-u {
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(90deg, #182635, #1e3040);
  border: 1px solid #24384a;
  position: relative;
  overflow: hidden;
}

.rack-u::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-3);
  transform: translateY(-50%);
}

.rack-u.hot { background: linear-gradient(90deg, #2a1a1e, #3a2026); border-color: #4a2830; }
.rack-u.hot::after { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.rack-u.cool { background: linear-gradient(90deg, #10222a, #133039); border-color: #1b4450; }
.rack-u.cool::after { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.hero-visual-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
}

/* ============================ 通用区块 ============================ */
section { position: relative; z-index: 1; }

.sec { padding: 84px 0; }
.sec-tight { padding: 56px 0; }

.sec-head { max-width: 700px; margin-bottom: 46px; }

.sec-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.sec-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin-bottom: 16px;
  letter-spacing: -0.025em;
}

.sec-head p { color: var(--text-2); font-size: 16.5px; margin: 0; }

/* ============================ 卡片网格 ============================ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: linear-gradient(165deg, var(--panel), #0b1219);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: all 0.24s;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 230, 214, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.24s;
}

.card:hover { border-color: rgba(46, 230, 214, 0.32); transform: translateY(-3px); }
.card:hover::after { opacity: 1; }

.card-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan-dim);
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}

.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: 14.5px; margin: 0; line-height: 1.7; }

.card-link { display: block; color: inherit; }
.card-link:hover { color: inherit; }

.card-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 18px; }

.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 100px;
}

/* ============================ 交互面板 ============================ */
.tool {
  background: linear-gradient(170deg, #0c141d, #080e15);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.tool-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-head h3 { font-size: 16px; margin: 0; }

.tool-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(46, 230, 214, 0.1);
  border: 1px solid rgba(46, 230, 214, 0.22);
  padding: 3px 9px;
  border-radius: 4px;
}

.tool-body { padding: 24px; }

.tool-split { display: grid; grid-template-columns: 1fr 320px; gap: 0; }

.tool-canvas-wrap { position: relative; min-height: 340px; background: #060a10; border-right: 1px solid var(--line-soft); }
.tool-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.tool-controls { padding: 24px; display: flex; flex-direction: column; gap: 20px; }

/* 滑块 */
.ctrl label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 9px;
  gap: 10px;
}

.ctrl output {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--cyan);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid #06202a;
  box-shadow: 0 0 10px rgba(46, 230, 214, 0.55);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--cyan);
  border: 2px solid #06202a;
  cursor: pointer;
}

/* 分段切换 */
.seg { display: flex; gap: 4px; background: #080e15; border: 1px solid var(--line); border-radius: 9px; padding: 4px; }
.seg button {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  padding: 7px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  transition: all 0.16s;
  white-space: nowrap;
}
.seg button:hover { color: var(--text-2); }
.seg button.on { background: rgba(46, 230, 214, 0.14); color: var(--cyan); font-weight: 600; }

/* 读数 */
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.readout-item {
  background: #070d14;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.readout-item .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.readout-item .v { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.readout-item .v.hi { color: var(--amber); }
.readout-item .v.ok { color: var(--green); }
.readout-item .v.bad { color: var(--red); }
.readout-item .u { font-size: 12px; color: var(--text-3); margin-left: 2px; }

.note { font-size: 12.5px; color: var(--text-3); line-height: 1.6; margin: 0; }

/* ============================ 数据条 / 表格 ============================ */
.bars { display: flex; flex-direction: column; gap: 14px; }

.bar-row { display: grid; grid-template-columns: 132px 1fr 78px; align-items: center; gap: 14px; font-size: 13.5px; }

.bar-track { height: 9px; background: #0a1219; border-radius: 100px; overflow: hidden; border: 1px solid var(--line-soft); }

.bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-row .val { font-family: var(--mono); font-size: 13px; color: var(--cyan); text-align: right; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }

th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  font-family: var(--mono);
}

td { color: var(--text-2); }
td strong { color: var(--text); font-weight: 600; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ============================ 文章 ============================ */
.article { padding: 56px 0 90px; }

.article-head { margin-bottom: 42px; padding-bottom: 30px; border-bottom: 1px solid var(--line-soft); }

.article-head h1 { font-size: clamp(28px, 4vw, 42px); margin: 16px 0 18px; letter-spacing: -0.03em; }

.article-meta { display: flex; gap: 18px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; font-family: var(--mono); }

.prose { font-size: 16.5px; line-height: 1.9; color: #cbd8e6; }
.prose h2 { font-size: 25px; margin: 46px 0 16px; color: var(--text); letter-spacing: -0.02em; }
.prose h3 { font-size: 19px; margin: 32px 0 12px; color: var(--text); }
.prose p { margin: 0 0 1.25em; }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1.3em; }
.prose li { margin-bottom: 8px; }

.prose blockquote {
  margin: 26px 0;
  padding: 16px 22px;
  border-left: 2px solid var(--cyan);
  background: rgba(46, 230, 214, 0.045);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-size: 15.5px;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(46, 230, 214, 0.09);
  color: var(--cyan);
  padding: 2px 6px;
  border-radius: 4px;
}

.callout {
  margin: 30px 0;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.callout .callout-t {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}

.callout p:last-child { margin: 0; }

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}

.article-nav a { font-size: 14px; color: var(--text-2); }
.article-nav a:hover { color: var(--cyan); }
.article-nav small { display: block; color: var(--text-3); font-size: 11.5px; font-family: var(--mono); margin-bottom: 4px; letter-spacing: 0.1em; }

/* ============================ 页脚 ============================ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 46px 0 36px;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

.footer-in { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; align-items: flex-start; }

.footer p { color: var(--text-3); font-size: 13.5px; margin: 6px 0 0; }

.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--text-3); font-size: 13.5px; }
.footer-links a:hover { color: var(--cyan); }

/* ============================ 动效 ============================ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; }
}

/* ============================ 响应式 ============================ */
@media (max-width: 960px) {
  .hero { padding: 56px 0 52px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .tool-split { grid-template-columns: 1fr; }
  .tool-canvas-wrap { border-right: none; border-bottom: 1px solid var(--line-soft); min-height: 300px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    background: #080e15;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px;
    gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .nav-toggle { display: block; }
  .sec { padding: 60px 0; }
}

@media (max-width: 640px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr 1fr; }
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 22px; }
  .bar-row { grid-template-columns: 96px 1fr 62px; font-size: 12.5px; }
  .hero-visual { padding: 16px; }
  .tool-body, .tool-controls { padding: 18px; }
}
