/* ============================================================
 *  小珂的技术屋 · 金色渐变主题
 * ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #08080C;
  --bg-2:        #101017;
  --bg-3:        #17171F;
  --card:        #14141C;
  --border:      #26262F;
  --border-hi:   #4A3F1E;

  --gold-1:      #F5D76E;
  --gold-2:      #D4AF37;
  --gold-3:      #B8860B;
  --gold-deep:   #8B6914;
  --gold-grad:   linear-gradient(135deg, #F5D76E 0%, #D4AF37 45%, #B8860B 100%);
  --gold-grad-v: linear-gradient(180deg, #F5D76E 0%, #D4AF37 100%);
  --gold-glow:   rgba(212, 175, 55, 0.20);

  --text:        #F2EAD3;
  --text-2:      #A09A88;
  --text-3:      #6C6759;

  --max:         1080px;
  --mono:        "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", sans-serif;
  font-size: 15px; line-height: 1.8;
  color: var(--text-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(212, 175, 55, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(184, 134, 11, 0.05), transparent 60%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code, .mono { font-family: var(--mono); }

/* 通用渐变文字 */
.grad {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- 顶部导航 ---------- */
#siteHeader {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.hd-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 24px; position: relative;
}
.hd-brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.hd-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 12px var(--gold-glow);
  flex-shrink: 0;
}
.hd-name {
  font-family: var(--mono);
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.hd-nav { display: flex; gap: 4px; }
.hd-nav a {
  font-size: 14.5px;
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 6px;
  transition: color .18s, background .18s;
}
.hd-nav a:hover { color: var(--gold-1); background: rgba(212, 175, 55, 0.08); }
.hd-nav a.active {
  color: var(--gold-1);
  background: rgba(212, 175, 55, 0.10);
}
.hd-menu {
  display: none;
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px;
  color: var(--gold-2); cursor: pointer;
  font-size: 16px;
}

/* ---------- 主内容容器 ---------- */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 80px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 56px;
  text-align: center;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--gold-3);
  margin-bottom: 24px;
}
.hero h1 {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.32;
  letter-spacing: 0.005em;
  margin-bottom: 22px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}
.hero-lead {
  font-size: 16px;
  line-height: 1.95;
  color: var(--text-2);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-actions {
  display: flex; gap: 14px;
  justify-content: center; flex-wrap: wrap;
  margin-bottom: 56px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 12px 26px;
  border-radius: 10px;
  font-size: 14.5px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: all .2s ease;
  border: none;
  white-space: nowrap;
}
.btn-gold {
  background: var(--gold-grad);
  color: #1A1408;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.22);
  font-weight: 600;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.35);
  filter: brightness(1.06);
}
.btn-line {
  background: transparent;
  color: var(--gold-1);
  border: 1px solid var(--border-hi);
}
.btn-line:hover {
  border-color: var(--gold-2);
  background: rgba(212, 175, 55, 0.06);
}

/* ---------- Hero 统计 ---------- */
.hero-stats {
  display: inline-flex;
  gap: 0;
  padding: 20px 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  justify-content: center;
}
.hero-stats > div {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 0 32px;
  position: relative;
}
.hero-stats > div + div::before {
  content: "";
  position: absolute;
  left: 0; top: 15%;
  height: 70%; width: 1px;
  background: var(--border);
}
.hero-stats strong {
  font-family: "Noto Serif SC", serif;
  font-size: 26px;
  font-weight: 700;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.hero-stats span {
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ---------- 内容块 ---------- */
.block { padding: 40px 0; }

.block-head {
  display: flex; align-items: baseline;
  justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  position: relative;
}
.block-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 60px; height: 2px;
  background: var(--gold-grad);
}
.block-head h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.block-more {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold-2);
  transition: color .18s;
}
.block-more:hover { color: var(--gold-1); }

/* ---------- 工具卡片网格 ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.tool-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 26px;
  transition: all .28s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gold-grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.tool-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.10);
}
.tool-card:hover::before { transform: scaleX(1); }

.tc-top {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.tc-idx {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}
.tc-title {
  font-family: "Noto Serif SC", serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
}
.tc-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.85;
  margin-bottom: 16px;
}
.tc-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px;
}
.tc-tags span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold-3);
  padding: 2px 8px;
  border: 1px solid var(--border-hi);
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.04);
  letter-spacing: 0.03em;
}
.tc-go {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--gold-2);
  font-weight: 500;
  display: inline-block;
  transition: letter-spacing .2s;
}
.tool-card:hover .tc-go {
  color: var(--gold-1);
  letter-spacing: 0.05em;
}

/* ---------- 文章列表 ---------- */
.guides-list {
  display: flex; flex-direction: column;
}
.guide-item {
  display: block;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 0;
  transition: padding-left .25s ease;
}
.guide-item:last-child { border-bottom: none; }
.guide-item::before {
  content: "";
  position: absolute;
  left: -20px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--gold-grad);
  transition: height .25s ease;
}
.guide-item:hover {
  padding-left: 16px;
}
.guide-item:hover::before {
  height: 60%;
  left: -16px;
}
.guide-item h3 {
  font-family: "Noto Serif SC", serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 6px;
  transition: color .2s;
}
.guide-item:hover h3 { color: var(--gold-1); }
.guide-item p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.75;
}

/* ---------- 页面标题块 ---------- */
.page-head {
  padding: 56px 0 36px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 80px; height: 2px;
  background: var(--gold-grad);
}
.ph-crumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 22px;
}
.ph-crumb a { color: var(--text-3); }
.ph-crumb a:hover { color: var(--gold-2); }
.ph-crumb span { margin: 0 10px; opacity: 0.5; }
.ph-crumb .now { color: var(--text-2); }
.ph-eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--gold-3);
  margin-bottom: 16px;
}
.page-head h1 {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: 0.005em;
  margin-bottom: 16px;
  max-width: 800px;
}
.ph-lead {
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--text-2);
  max-width: 660px;
}

/* ---------- 工具面板 ---------- */
.tool-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
}
.tool-body textarea, .tool-body input[type="text"] {
  width: 100%;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  appearance: none; -webkit-appearance: none;
}
.tool-body textarea {
  resize: vertical; min-height: 120px; line-height: 1.75;
}
.tool-body textarea:focus, .tool-body input:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}
.btn-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
}
.btn-row .btn { min-height: 42px; padding: 10px 20px; font-size: 13.5px; }
.tool-result {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 44px;
}
.tool-result.empty { color: var(--text-3); }

/* ---------- 说明块 ---------- */
.note-block {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
}
.note-block h2 {
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  padding-left: 20px;
  position: relative;
}
.note-block h2::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 2px;
  background: var(--gold-grad);
}
.note-block p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.95;
  margin-bottom: 10px;
}
.note-block p:last-child { margin-bottom: 0; }

/* ---------- 长文排版 ---------- */
.doc {
  padding: 40px 0;
  max-width: 720px;
}
.doc h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.55;
  margin: 40px 0 14px;
  padding-left: 18px;
  position: relative;
}
.doc h2:first-child { margin-top: 0; }
.doc h2::before {
  content: "";
  position: absolute;
  left: 0; top: 12px;
  width: 3px; height: 20px;
  background: var(--gold-grad);
  border-radius: 2px;
}
.doc p {
  font-size: 15.5px;
  line-height: 2.05;
  color: var(--text-2);
  margin-bottom: 18px;
}
.doc code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gold-1);
  background: rgba(212, 175, 55, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-hi);
}

/* ---------- 页脚 ---------- */
#siteFooter {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 36px 0 calc(32px + env(safe-area-inset-bottom));
}
.ft-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex; flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-3);
}
.ft-left { color: var(--text-3); }
.ft-beian {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-2);
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-3);
  transition: all .18s;
}
.ft-beian::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-grad);
  box-shadow: 0 0 6px var(--gold-glow);
}
.ft-beian:hover {
  color: var(--gold-1);
  border-color: var(--border-hi);
  background: rgba(212, 175, 55, 0.06);
}
.ft-links {
  display: flex; gap: 18px;
}
.ft-links a { color: var(--text-3); }
.ft-links a:hover { color: var(--gold-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .hd-inner { padding: 0 20px; height: 60px; }
  main { padding: 0 20px 60px; }
  .ft-inner { padding: 0 20px; }

  .hd-menu { display: block; }
  .hd-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }
  .hd-nav.open { display: flex; }
  .hd-nav a {
    padding: 14px 24px;
    border-radius: 0;
    font-size: 15px;
  }

  .hero { padding: 56px 0 32px; }
  .hero h1 { font-size: 26px; }
  .hero-lead { font-size: 15px; }
  .hero-stats {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }
  .hero-stats > div { padding: 0 12px; }
  .hero-stats strong { font-size: 20px; }
  .hero-stats span { font-size: 11.5px; }

  .block { padding: 28px 0; }
  .tools-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-card { padding: 22px 20px; }

  .page-head { padding: 36px 0 24px; }
  .page-head h1 { font-size: 24px; }

  .tool-panel { padding: 20px 20px; }
  .note-block { padding: 20px 20px; }
  .doc { padding: 24px 0; }
  .doc h2 { font-size: 18px; }
  .doc p { font-size: 15px; }

  .ft-inner { flex-direction: column; text-align: center; }
}
