/* ============================================================
   鸠桀帅帅子私人站 - 全局样式
   视觉风格：暗夜炫彩科技风（深色 + 霓虹渐变发光）
   ============================================================ */

:root {
  /* 主题色（深色科技风 - 深蓝黑 + 科技蓝青） */
  --bg-0: #0a1120;            /* 页面最底 深蓝黑 */
  --bg-1: #0f1a2e;            /* 卡片/区块背景 */
  --bg-2: #16233c;            /* 卡片悬浮 */
  --text-0: #e8f0ff;          /* 主文字 */
  --text-1: #9fb0cc;          /* 次要文字 */
  --text-2: #63728c;          /* 弱文字 */
  --brand-0: #2f7bff;         /* 主品牌色 科技蓝 */
  --brand-1: #19c6de;         /* 辅色 青 */
  --brand-2: #4f9dff;         /* 点缀 亮蓝 */
  --brand-3: #7fd4ff;         /* 点缀 浅蓝 */
  --grad-main: linear-gradient(135deg, #2f7bff 0%, #19c6de 100%);
  --grad-hot: linear-gradient(135deg, #2f7bff 0%, #4f9dff 100%);
  --shadow-glow: 0 8px 40px rgba(47, 123, 255, .4);
  --radius: 18px;
  --maxw: 1140px;
  --font: "PingFang SC","Microsoft YaHei","Segoe UI",Roboto,"Helvetica Neue",-apple-system,sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.75;
  overflow-x: hidden;
}

/* 背景动态光斑（带动画的装饰层） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(106,92,255,.28), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(34,211,238,.20), transparent 55%),
    radial-gradient(800px 600px at 50% 120%, rgba(255,92,138,.18), transparent 60%);
  animation: bgDrift 20s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-30px,20px) scale(1.06); }
}

/* 浮动粒子层（纯 CSS 实现的星星粒子） */
.particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.particles i {
  position: absolute;
  display: block;
  width: 3px; height: 3px;
  background: rgba(255,255,255,.5);
  border-radius: 50%;
  animation: floatUp linear infinite;
  opacity: 0;
}
@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .8; }
  100% { transform: translateY(-110vh) translateX(30px); opacity: 0; }
}

/* ===== 顶部导航 ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 14, 26, .72);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .5px;
  color: var(--text-0);
  text-decoration: none;
}
.nav-logo .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--grad-main);
  box-shadow: 0 0 14px rgba(106,92,255,.9);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.4);opacity:.6} }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-1);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  transition: all .25s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active {
  color: #fff;
  background: var(--grad-main);
  box-shadow: var(--shadow-glow);
}

/* ===== 通用容器 ===== */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== 页面 hero ===== */
.page-hero { text-align: center; padding: 70px 24px 40px; }
.page-hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brand-1);
  background: rgba(34,211,238,.12);
  border: 1px solid rgba(34,211,238,.3);
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
}
.page-hero h1 {
  font-size: clamp(30px, 6vw, 54px);
  font-weight: 900;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.page-hero p { color: var(--text-1); max-width: 680px; margin: 18px auto 0; font-size: 17px; }

/* ===== 通用区块 ===== */
.section { padding: 56px 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}
.section-title .bar {
  width: 6px; height: 30px;
  border-radius: 4px;
  background: var(--grad-main);
  box-shadow: 0 0 12px rgba(106,92,255,.7);
}
.section-title h2 { font-size: 28px; font-weight: 800; }
.section-title .sub { margin-left: auto; color: var(--text-2); font-size: 14px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(106,92,255,.12), transparent 40%);
  opacity: 0;
  transition: opacity .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-glow); border-color: rgba(106,92,255,.4); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

/* ===== 学习专栏按钮 ===== */
.col-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}
.col-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 30px;
  margin-bottom: 16px;
  background: var(--bg-2);
}
.col-card h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.col-card p { color: var(--text-1); font-size: 14px; min-height: 40px; }
.col-meta { margin-top: 16px; color: var(--brand-1); font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

/* ===== DIY 作品卡片 ===== */
.prod-card { text-align: center; }
.prod-thumb {
  height: 180px;
  border-radius: 12px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  font-size: 60px;
  position: relative;
  overflow: hidden;
}
.prod-card h3 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.prod-card p { color: var(--text-1); font-size: 14px; }

/* 网格 */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
@media (max-width: 820px) {
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .nav-links a { padding: 6px 12px; font-size: 14px; }
}

/* ===== 文章/章节 ===== */
article {
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 34px;
  margin-bottom: 28px;
}
article h2 { font-size: 24px; margin-bottom: 14px; color: var(--text-0); display: flex; align-items: center; gap: 10px; }
article h3 { font-size: 19px; margin: 22px 0 10px; color: var(--brand-1); }
article p, article li { color: var(--text-1); }
article ul, article ol { padding-left: 22px; margin: 8px 0; }
article code {
  background: rgba(0,0,0,.35);
  color: var(--brand-3);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 14px;
}
article pre {
  background: rgba(0,0,0,.45);
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid rgba(255,255,255,.06);
  font-size: 14px;
  line-height: 1.6;
}
article pre code { background: none; color: #d6e2ff; padding: 0; }
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-right: 8px;
  margin-bottom: 4px;
}

/* ===== 两个大按钮（主页核心） ===== */
.big-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0; }
@media (max-width: 720px) { .big-btn-grid { grid-template-columns: 1fr; } }
.big-btn {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 34px 30px;
  border-radius: 22px;
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .35s, box-shadow .35s;
}
.big-btn .icon {
  width: 74px; height: 74px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 40px;
  flex-shrink: 0;
}
.big-btn .txt h3 { font-size: 26px; font-weight: 900; }
.big-btn .txt p { color: var(--text-1); font-size: 15px; margin-top: 6px; }
.big-btn .arrow { margin-left: auto; font-size: 26px; opacity: .6; transition: transform .3s; }
.big-btn:hover { transform: translateY(-8px) scale(1.01); }
.big-btn:hover .arrow { transform: translateX(8px); }
.big-btn.learn { box-shadow: 0 10px 40px rgba(106,92,255,.3); }
.big-btn.diy { box-shadow: 0 10px 40px rgba(255,92,138,.3); }
.big-btn .icon.learn { background: var(--grad-main); box-shadow: 0 0 30px rgba(34,211,238,.5); }
.big-btn .icon.diy { background: var(--grad-hot); box-shadow: 0 0 30px rgba(255,92,138,.5); }
/* 按钮浮动装饰 */
.big-btn::after {
  content: "";
  position: absolute;
  top: -40%; right: -20%;
  width: 60%; height: 180%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 60%);
  transform: rotate(15deg);
  transition: all .5s;
}
.big-btn:hover::after { transform: rotate(15deg) translateX(-20px); }

/* ===== 小按钮链接 ===== */
.mini-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.mini-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-0);
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,.1);
  transition: all .25s;
}
.mini-link:hover { border-color: var(--brand-0); box-shadow: var(--shadow-glow); transform: translateY(-3px); }
.mini-link .ic { font-size: 18px; }

/* ===== 页脚 ===== */
footer {
  margin-top: 60px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-2);
  font-size: 14px;
}
footer .heart { color: var(--brand-2); }

/* ===== 通用工具 ===== */
.mt-40 { margin-top: 40px; }
.center { text-align: center; }
a { color: var(--brand-1); }

/* 进场动画 */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   学习专栏 - 左侧固定章节目录（方案B）
   ============================================================ */
.learn-layout { display: grid; grid-template-columns: 290px 1fr; gap: 30px; align-items: start; }

/* 左侧目录（sticky 固定） */
.learn-toc {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
  padding: 20px;
}
.learn-toc .toc-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px;
  padding-bottom: 14px; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.learn-toc .toc-head .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--grad-main);
  box-shadow: 0 0 12px rgba(106,92,255,.9);
}
/* 专栏分组 */
.toc-col { margin-bottom: 16px; }
.toc-col:last-child { margin-bottom: 4px; }
.toc-col > .col-label {
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--brand-1);
  padding: 8px 8px 6px;
  display: flex; align-items: center; gap: 6px;
  opacity: .9;
}
.toc-col a.ch {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-1); text-decoration: none;
  padding: 8px 10px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  transition: all .2s;
  border-left: 3px solid transparent;
}
.toc-col a.ch:hover { color:#fff; background: rgba(255,255,255,.06); }
.toc-col a.ch.active {
  color:#fff; background: rgba(47,123,255,.18);
  border-left-color:#2f7bff;
}
.toc-col a.ch .num { color:#19c6de; font-weight:800; font-size:13px; flex-shrink:0; }
.toc-col a.ch .ch-name { flex:1; line-height:1.4; }
/* 当前章的子节 */
.toc-col .sub {
  margin-left: 26px; border-left:1px solid rgba(255,255,255,.1);
  padding-left: 10px; margin-top: 2px;
  display:none;
}
.toc-col a.ch.active + .sub { display:block; }
.toc-col .sub a {
  display:block; color:var(--text-2); text-decoration:none;
  padding:5px 8px; font-size:13px; border-radius:8px;
  transition: all .2s;
}
.toc-col .sub a:hover { color:#fff; background: rgba(255,255,255,.05); }
.toc-col .sub a.active { color:var(--brand-3); }
.toc-col .sub a .sn { color:var(--brand-1); font-weight:600; margin-right:6px; font-size:12px; }

/* 正文区 */
.learn-body { min-width:0; }
.learn-body article { scroll-margin-top:90px; }
.learn-body h2 .ch-num {
  color:#19c6de; font-size:.7em;
  background: rgba(47,123,255,.15);
  padding:3px 10px; border-radius:8px; margin-right:4px;
}
.learn-body h2.empty-h { opacity:.85; }

/* 占位提示 */
.placeholder-note {
  background: rgba(255,255,255,.04);
  border:1px dashed rgba(255,255,255,.18);
  border-radius:12px; padding:26px; margin:20px 0;
  color:var(--text-2); text-align:center; font-size:14px;
}

/* 响应式：窄屏目录收为顶部可折叠 */
@media (max-width: 900px) {
  .learn-layout { grid-template-columns: 1fr; }
  .learn-toc { position: static; max-height:none; }
  .learn-toc { display:none; }
  .toc-mobile-btn {
    display:inline-flex !important;
    align-items:center; gap:8px;
    margin: 0 auto 18px;
    padding: 10px 20px; border-radius:30px;
    color:var(--text-0); font-weight:700; font-size:14px;
    background:var(--bg-1); border:1px solid rgba(255,255,255,.12);
    cursor:pointer;
  }
  .learn-toc.open { display:block; }
}
.toc-mobile-btn { display:none; }

/* ===== 知识小丑专栏（NO xx 编号样式） ===== */
.toc-col a.ch .num.no {
  color: #ff8ab5;
  font-size: 12px;
  background: rgba(255,92,138,.12);
  border: 1px solid rgba(255,92,138,.25);
  padding: 1px 8px;
  border-radius: 20px;
  letter-spacing: .3px;
}
/* 知识页正文视觉 */
.kno-body article {
  background: linear-gradient(135deg, rgba(255,92,138,.05), transparent 60%), var(--bg-1);
}
.kno-hero .eyebrow { background: rgba(255,92,138,.14); border-color: rgba(255,92,138,.35); color:#ff9dba; }
.kno-body .ch-num { background: rgba(255,92,138,.2) !important; color:#ff9dba !important; }
.kno-body img.kno-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  margin: 14px 0;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.kno-body .kno-caption { color: var(--text-2); font-size: 13px; text-align:center; margin:4px 0 16px; }

/* ===== 知识小丑代码块 ===== */
.kno-code {
  background: #0d1117;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  margin: 14px 0;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.kno-code .code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 12px; color: var(--text-2);
}
.kno-code .code-head .dots { display:flex; gap:6px; }
.kno-code .code-head .dots i {
  width: 11px; height: 11px; border-radius: 50%; display:inline-block;
}
.kno-code .code-head .dots i:nth-child(1){background:#ff5f57;}
.kno-code .code-head .dots i:nth-child(2){background:#febc2e;}
.kno-code .code-head .dots i:nth-child(3){background:#28c840;}
.kno-code .code-head .copy-btn {
  cursor:pointer; user-select:none;
  padding:2px 10px; border:1px solid rgba(255,255,255,.2); border-radius:6px;
  transition: all .2s;
}
.kno-code .code-head .copy-btn:hover { background:rgba(255,255,255,.1); }
.kno-code pre {
  margin:0; padding:14px 16px; overflow-x:auto;
}
.kno-code pre code {
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 13.5px; line-height: 1.6; color:#e6edf3;
  white-space: pre; display: block;
}
/* 代码高亮 token 色（浅处理，靠颜色区分，避免过度依赖） */
.kno-code .k-kw { color:#ff7b72; }   /* 关键字 */
.kno-code .k-type{ color:#79c0ff; }   /* 类型/typedef */
.kno-code .k-str { color:#a5d6ff; }   /* 字符串 */
.kno-code .k-cmt { color:#8b949e; font-style:italic; } /* 注释 */
.kno-code .k-num { color:#79c0ff; }   /* 数字 */
.kno-code .k-fn  { color:#d2a8ff; }   /* 函数名 */
.kno-code .k-mac { color:#ffa657; }   /* 宏/预处理 */
.kno-code .k-punct{ color:#9da7b3; }  /* 标点 */
