/* ============================================================
   Newcclm 站点公共样式
   site/ 下的页面都引用这一份，避免每个文件重复几百行 CSS。
   改配色 / 排版只需要改这里。
   ============================================================ */

:root {
  --bg: #0b0b0c;
  --bg-soft: #131315;
  --bg-card: #17171a;
  --nav-bg: rgba(11, 11, 12, 0.82);
  --line: #27272b;
  --line-soft: #1e1e22;
  --text: #eeedf0;
  --text-dim: #a3a1aa;
  --text-faint: #6d6a75;
  --accent: #eeedf0;
  --on-accent: #0b0b0c;
  --brand: #6ea8fe;
  --brand-soft: rgba(110, 168, 254, 0.12);
  --good: #45d19a;
  --warn: #e0a83c;
  --radius: 10px;
  --radius-lg: 15px;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', 'Courier New',
    monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
}

html[data-theme='light'] {
  --bg: #faf9f7;
  --bg-soft: #f2f1ed;
  --bg-card: #ffffff;
  --nav-bg: rgba(250, 249, 247, 0.86);
  --line: #e5e3dd;
  --line-soft: #edece7;
  --text: #1a1a1c;
  --text-dim: #55535c;
  --text-faint: #8b8892;
  --accent: #1a1a1c;
  --on-accent: #ffffff;
  --brand: #2563eb;
  --brand-soft: rgba(37, 99, 235, 0.09);
  --good: #15803d;
  --warn: #a16207;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
a.link {
  color: var(--brand);
}
a.link:hover {
  text-decoration: underline;
}
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 60px;
  padding: 0 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.logo {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #7c5cff);
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
html[data-theme='light'] .logo {
  background: linear-gradient(135deg, #2563eb, #6d28d9);
}
.nav-links {
  display: flex;
  gap: 20px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-left: 8px;
}
.nav-links a:hover {
  color: var(--text);
}
.nav-spacer {
  flex: 1;
}
.nav-cta {
  padding: 7px 15px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13.5px;
  font-weight: 600;
}
.nav-cta:hover {
  opacity: 0.88;
}
.theme-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-btn:hover {
  color: var(--text);
  border-color: var(--text-faint);
}
.theme-btn svg {
  width: 16px;
  height: 16px;
}
.theme-btn .icon-sun {
  display: none;
}
html[data-theme='light'] .theme-btn .icon-sun {
  display: block;
}
html[data-theme='light'] .theme-btn .icon-moon {
  display: none;
}

/* ---------- 排版 ---------- */
h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.024em;
  font-weight: 680;
}
h1 {
  font-size: 30px;
  margin-bottom: 10px;
}
h2 {
  font-size: 21px;
  margin: 40px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 24px;
}
h3 {
  font-size: 15.5px;
  margin: 24px 0 8px;
}
p {
  color: var(--text-dim);
  margin: 0 0 13px;
}
.lede {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.sec-sub {
  color: var(--text-dim);
  margin: 0 0 30px;
  font-size: 15px;
}
strong,
b {
  color: var(--text);
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 6px;
}
pre {
  margin: 11px 0;
  padding: 14px 16px;
  background: #0e0e10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: #d6d6da;
}
html[data-theme='light'] pre {
  background: #f6f5f1;
  border-color: #e5e3dd;
  color: #26262a;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}
.cmt,
.k3 {
  color: #5f5f66;
}
.val {
  color: #a5d6a7;
}
html[data-theme='light'] .cmt,
html[data-theme='light'] .k3 {
  color: #a5a29b;
}
html[data-theme='light'] .val {
  color: #15803d;
}

/* ---------- 提示块 ---------- */
.tip {
  border-left: 3px solid var(--brand);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 13.5px;
  color: var(--text-dim);
}
.tip.warn {
  border-left-color: var(--warn);
}
.tip.ok {
  border-left-color: var(--good);
}
.tip b {
  color: var(--text);
}

/* ---------- 表格 ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 14px 0;
}
th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  color: var(--text-dim);
}
td code {
  white-space: nowrap;
}

/* ---------- 参数卡 ---------- */
.params {
  background: linear-gradient(180deg, var(--brand-soft), transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
  border-radius: 12px;
  padding: 19px 21px;
  margin: 19px 0 24px;
}
.params h3 {
  margin: 0 0 12px;
}
.param-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-size: 14px;
}
.param-row:last-child {
  border-bottom: none;
}
.param-row > span {
  flex: 0 0 96px;
  color: var(--text-faint);
  font-size: 12.5px;
}
.param-row > b {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

/* ---------- 复制按钮 ---------- */
.copy-btn {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  padding: 3px 11px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.copy-btn:hover {
  color: var(--text);
  border-color: var(--text-faint);
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 13px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: inherit;
  display: block;
}
a.card:hover {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-tag {
  font-size: 11.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  white-space: nowrap;
}
.card p {
  margin: 0;
  font-size: 13px;
}
.card .more {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--brand);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.dot.g {
  background: var(--good);
}
.dot.o {
  background: var(--warn);
}

/* ---------- 侧栏 ---------- */
.layout {
  display: grid;
  grid-template-columns: 208px 1fr;
  max-width: 1060px;
  margin: 0 auto;
}
aside {
  border-right: 1px solid var(--line-soft);
  padding: 26px 18px 60px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  color: var(--text);
}
.side-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 20px 0 7px;
}
aside a.nav-item {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13.5px;
}
aside a.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}
aside a.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}
main {
  padding: 30px 38px 90px;
  min-width: 0;
}

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 32px 0 44px;
  font-size: 13px;
  color: var(--text-faint);
}
footer.site {
  margin-top: 60px;
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: center;
}
.foot-row a:hover {
  color: var(--text);
}
.foot-note {
  margin-top: 13px;
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- 区块 ---------- */
section {
  padding: 68px 0;
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    padding-bottom: 20px;
  }
  main {
    padding: 24px 20px 70px;
  }
}
@media (max-width: 720px) {
  h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 19px;
  }
  section {
    padding: 50px 0;
  }
  .nav-links {
    display: none;
  }
}
