/* 玄枢 · 智能刀模 官网 —— 公共样式
   配色沿用品牌：玄墨 #0A0E18 / 鎏金 #FFFFFF / 素白 #F4EBD8 */

:root {
  --ink: #0A0E18;
  --ink-2: #0e1421;
  --panel: #111726;
  --gold: #FFFFFF;
  --gold-soft: #F5F7FA;
  --paper: #F4EBD8;
  --muted: #8b95a6;
  --muted-2: #5f6878;
  --line: rgba(255,255,255,.18);
  --line-soft: rgba(255, 255, 255, .07);
  --radius: 14px;
  --max: 1160px;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #fff; }

img { max-width: 100%; display: block; }

.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

/* ── 顶栏 ─────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 24, .82);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .inner {
  display: flex; align-items: center; gap: 26px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); font-weight: 600; letter-spacing: 2px; }
.brand img { width: 30px; height: 30px; }
.brand em { font-style: normal; color: var(--gold); }
.site-nav { display: flex; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--muted); font-size: 14px; }
.site-nav a:hover, .site-nav a.is-active { color: var(--gold-soft); }
.head-cta {
  margin-left: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #E0BE7B, var(--gold));
  color: #10131c; font-size: 13px; font-weight: 700; letter-spacing: 1px;
}
.head-cta:hover { color: #10131c; filter: brightness(1.05); }

/* ── 通用 ─────────────────────────────── */
.section { padding: 68px 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 3px; color: var(--gold);
  text-transform: uppercase; margin: 0 0 14px;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); display: inline-block; }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 600; }
h1 { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: 1px; }
h2 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: 1px; }
h3 { font-size: 17px; }
.lead { color: var(--muted); font-size: 16px; max-width: 62ch; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.section-head p { color: var(--muted); margin: 8px 0 0; }

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 10px;
  background: linear-gradient(180deg, #E0BE7B, var(--gold)); color: #10131c;
  font-weight: 700; letter-spacing: 1px; font-size: 14px;
}
.btn:hover { color: #10131c; filter: brightness(1.05); }
.ghost {
  display: inline-block; padding: 11px 22px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--gold-soft); font-size: 14px;
}
.ghost:hover { border-color: rgba(255,255,255,.5); color: #fff; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: linear-gradient(180deg, rgba(20, 27, 43, .7), rgba(13, 18, 30, .7));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .tag { display: inline-block; font-size: 11px; letter-spacing: 2px; color: var(--gold); margin-bottom: 10px; }

/* ── 首屏 ─────────────────────────────── */
.hero { position: relative; padding: 78px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% 40% auto -10%; height: 520px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.16), transparent 62%);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; position: relative; }
.hero p.lead { margin: 20px 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 12px; color: var(--muted-2); letter-spacing: 1px; }
.hero-visual {
  border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 27, 43, .8), rgba(10, 14, 24, .9));
  padding: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.hero-visual .bar { display: flex; gap: 6px; margin-bottom: 14px; }
.hero-visual .bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); }
.hero-visual svg { width: 100%; height: auto; }

/* ── 盒型卡片 ─────────────────────────── */
.types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.type {
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 16px; color: var(--paper); background: rgba(17, 23, 38, .5);
  transition: border-color .18s ease, transform .18s ease;
}
.type:hover { border-color: rgba(255,255,255,.45); transform: translateY(-2px); color: #fff; }
.type b { display: block; font-size: 15px; margin-bottom: 4px; }
.type span { color: var(--muted); font-size: 12px; }

/* ── 步骤 ─────────────────────────────── */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: block; font-size: 26px; color: rgba(255,255,255,.5);
  font-family: Consolas, monospace; margin-bottom: 6px;
}
.step h3 { margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ── 文章卡片 ─────────────────────────── */
.article-card { display: block; color: var(--paper); }
.article-card:hover { color: #fff; }
.article-card h3 { margin-bottom: 8px; }
.article-card p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.article-card .more { font-size: 12px; color: var(--gold); letter-spacing: 1px; }

/* ── FAQ ─────────────────────────────── */
.faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 16px 0;
}
.faq summary {
  cursor: pointer; font-size: 15px; color: var(--paper); list-style: none;
  display: flex; gap: 10px; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "＋"; color: var(--gold); font-size: 14px; line-height: 1.9; }
.faq details[open] summary::before { content: "－"; }
.faq p { color: var(--muted); margin: 10px 0 0 22px; font-size: 14px; }

/* ── 正文页（知识库） ─────────────────── */
.article { max-width: 760px; margin: 0 auto; padding: 64px 0 80px; }
.article h1 { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 10px; }
.article .meta { color: var(--muted-2); font-size: 12px; letter-spacing: 1px; margin-bottom: 34px; }
.article h2 { font-size: 21px; margin: 40px 0 12px; }
.article h3 { font-size: 16px; margin: 24px 0 8px; color: var(--gold-soft); }
.article p { margin: 0 0 14px; color: #cfd6e2; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; color: #cfd6e2; }
.article li { margin-bottom: 6px; }
.article table { width: 100%; border-collapse: collapse; margin: 18px 0 22px; font-size: 14px; }
.article th, .article td { border: 1px solid var(--line-soft); padding: 10px 12px; text-align: left; }
.article th { background: rgba(255,255,255,.08); color: var(--gold-soft); font-weight: 600; }
.article code { font-family: Consolas, "Cascadia Mono", monospace; background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.article blockquote {
  margin: 18px 0; padding: 14px 18px; border-left: 2px solid var(--gold);
  background: rgba(255,255,255,.06); color: var(--muted); font-size: 14px;
}
.crumbs { font-size: 12px; color: var(--muted-2); margin-bottom: 22px; letter-spacing: 1px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

/* ── 页脚 ─────────────────────────────── */
.site-foot { border-top: 1px solid var(--line-soft); padding: 40px 0 46px; color: var(--muted-2); font-size: 13px; }
.site-foot .cols { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
.site-foot .brand { margin-bottom: 10px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--gold-soft); }
.site-foot ul { list-style: none; padding: 0; margin: 6px 0 0; }
.site-foot li { margin-bottom: 4px; }
.site-foot .col-title { color: var(--paper); font-size: 13px; margin-bottom: 8px; }
.copyright { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ── 响应式 ───────────────────────────── */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .grid-4, .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .grid-2, .grid-3, .grid-4, .types { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

/* ── 盒型详情页（tools/gen-box-pages.js 生成） ───────────── */
.dieline-figure {
  margin: 30px 0 32px; padding: 20px;
  border: 1px solid var(--line-soft); border-radius: 14px;
  background: rgba(255,255,255,.03);
}
.dieline-figure img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; border-radius: 8px; background: #f7f2e6; }
.dieline-figure figcaption { margin-top: 14px; color: var(--muted-2); font-size: 12.5px; line-height: 1.85; }
.answer {
  margin: 0 0 26px; padding: 16px 20px;
  border-left: 2px solid var(--gold); border-radius: 0 10px 10px 0;
  background: rgba(255,255,255,.07);
}
.article .answer p { margin: 0; color: var(--paper); font-size: 15px; line-height: 1.9; }
.article ol { margin: 0 0 16px; padding-left: 22px; }
.article ol li { margin-bottom: 8px; color: #cfd6e2; }
.table-wrap { overflow-x: auto; margin: 16px 0 22px; }

.box-card h3 { margin-bottom: 6px; }
.box-card-data { color: var(--muted-2); font-size: 12px; letter-spacing: .5px; margin-top: 10px !important; }
.box-card-more { color: var(--gold); font-size: 12px; margin-top: 10px !important; }

.box-card { display: flex; flex-direction: column; }
.box-card-more { margin-top: auto !important; }

.related { max-width: 760px; margin: 0 auto; }

/* ══════════════ 移动端（Android / iOS 手机）══════════════ */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  margin-left: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--gold-2);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.nav-toggle:active { background: rgba(255,255,255,.1); }

@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .site-head .inner { gap: 10px; flex-wrap: nowrap; }
  .site-head .brand span { font-size: 15px; }
  .nav-toggle { display: inline-flex; }
  .head-cta { display: none; }

  /* 导航变成下拉面板 */
  .site-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    position: fixed;
    left: 0; right: 0; top: 58px;
    z-index: 60;
    padding: 6px 16px 14px;
    background: #0a0e18;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 40px rgba(0,0,0,.5);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    max-height: calc(100vh - 58px);
    overflow-y: auto;
  }
  body.nav-open .site-nav {
    opacity: 1; visibility: visible; transform: none; pointer-events: auto;
  }
  .site-nav a {
    padding: 14px 2px;
    font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .site-nav a:last-child { border-bottom: 0; }
  body.nav-open::after {
    content: "";
    position: fixed; inset: 58px 0 0;
    background: rgba(4,7,12,.5);
    z-index: 55;
  }

  /* 首屏 */
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: clamp(30px, 9vw, 44px); line-height: 1.15; }
  .hero .lead { font-size: 15px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn, .hero-actions .ghost { flex: 1 1 100%; text-align: center; }
  .hero-visual { display: none; }

  /* 通用区块 */
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .section-head h2 { font-size: 22px; }
  .grid-2, .grid-3, .grid-4, .types, .steps { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 18px; }

  /* 文章 / 表格 */
  .article { padding: 0; }
  .article h1 { font-size: 26px; line-height: 1.25; }
  .article h2 { font-size: 19px; margin: 26px 0 10px; }
  .article h3 { font-size: 16px; }
  .article p, .article li { font-size: 15px; line-height: 1.85; }
  .article table, .table-wrap table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13.5px;
  }
  .article pre, .article code { font-size: 13px; word-break: break-word; }
  .article img, .article svg { max-width: 100%; height: auto; }

  /* 页脚 */
  .site-foot .cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .site-foot .cols > div:first-child { grid-column: 1 / -1; }

  /* 盒型库 */
  .box-card { padding: 16px; }
  .dieline-figure { padding: 12px; }

  /* 下载区 */
  .dl-grid { grid-template-columns: 1fr; }
  .dl-actions .btn, .dl-actions .ghost { flex: 1 1 100%; text-align: center; }

  /* 证件照工具 */
  .photo-grid { grid-template-columns: 1fr !important; }
  .photo-wrap { padding: 0 16px 40px !important; }
  .canvas-box canvas { width: 100%; height: auto; }

  /* 账号中心（后端页也有独立样式，这里兜底） */
  table { font-size: 13px; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 24px); }
  .hero h1 { font-size: 30px; }
  .site-foot .cols { grid-template-columns: 1fr; }
  .article h1 { font-size: 23px; }
  .btn, .ghost { font-size: 14px; }
}

/* 卡片图标 */
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: 12px; border-radius: 11px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.28);
  color: #f5f7fa;
}
.card-icon svg { width: 21px; height: 21px; display: block; }
.card:hover .card-icon { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.5); }


/* ── 导航与布局优化（6 项导航） ───────────────────────── */
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { font-size: 14px; color: #b9c0cd; white-space: nowrap; }
.site-nav a:hover { color: #fff; }
.site-nav a.is-active { color: #fff; position: relative; }
.site-nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -7px; height: 2px;
  background: #fff; border-radius: 2px;
}
@media (max-width: 1100px) {
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; }
}
@media (max-width: 860px) {
  .site-nav { display: none; }
  .site-header .nav-inner { justify-content: space-between; }
}

/* 首页区块间距统一 */
.section { padding: 64px 0; }
.section + .section { border-top: 1px solid rgba(255,255,255,.05); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { font-size: 30px; margin: 0 0 8px; }
.section-head p { margin: 0; color: #8b95a6; }

/* 页脚链接区 */
.site-footer nav, .foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a, .foot-links a { color: #8b95a6; font-size: 13px; }
.site-footer a:hover { color: #fff; }

/* ── 移动端汉堡导航 ───────────────────────────────────── */
.nav-toggle {
  display: none; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
  border: 1px solid #2a3241; background: #0e141d; padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: #dfe4ec; border-radius: 2px; }
.nav-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw); z-index: 1200;
  background: #0b0f16; border-left: 1px solid #1e2531;
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column; padding: 18px 0;
}
body.nav-open .nav-drawer { transform: translateX(0); }
.nav-backdrop {
  position: fixed; inset: 0; z-index: 1190; background: rgba(4,7,12,.6);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px 14px; border-bottom: 1px solid #1a212d; color: #cfd6e4; font-size: 15px; font-weight: 700;
}
.nav-drawer-close {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 18px;
  border: 1px solid #2a3241; background: #0e141d; color: #cfd6e4;
}
.nav-drawer-links { display: flex; flex-direction: column; padding: 10px 0; }
.nav-drawer-links a {
  padding: 14px 18px; color: #cfd6e4; font-size: 15px; border-left: 2px solid transparent;
}
.nav-drawer-links a:hover { background: rgba(255,255,255,.04); }
.nav-drawer-links a.is-active { color: #fff; border-left-color: #fff; font-weight: 700; }
.nav-drawer-cta {
  margin: 14px 18px 0; text-align: center; padding: 12px 0; border-radius: 10px;
  background: #fff; color: #0b0f16 !important; font-weight: 700;
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-header .nav-inner { gap: 12px; }
  .site-header .site-nav, .site-header .head-cta { display: none; }
}
@media (min-width: 861px) {
  .nav-drawer, .nav-backdrop { display: none; }
}

/* ── 移动端抽屉导航（复用 mobile.js 的 body.nav-open） ──── */
@media (max-width: 860px) {
  .site-head .site-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200;
    width: min(280px, 80vw); display: flex; flex-direction: column; gap: 0;
    background: #0b0f16; border-left: 1px solid #1e2531; padding: 28px 0 20px;
    transform: translateX(100%); transition: transform .24s ease;
  }
  body.nav-open .site-head .site-nav { transform: translateX(0); }
  .site-head .site-nav a {
    padding: 15px 22px; font-size: 15px; border-left: 2px solid transparent; white-space: normal;
  }
  .site-head .site-nav a:hover { background: rgba(255,255,255,.04); }
  .site-head .site-nav a.is-active { color: #fff; border-left-color: #fff; font-weight: 700; }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; z-index: 1190;
    background: rgba(4,7,12,.62);
  }
  .site-head .nav-toggle { z-index: 1210; position: relative; }
}

/* 移动端抽屉（导航被搬到 body 下） */
.site-nav.is-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1200;
  width: min(280px, 80vw); display: flex !important; flex-direction: column !important;
  gap: 0 !important; align-items: stretch !important;
  background: #0b0f16; border-left: 1px solid #1e2531; padding: 72px 0 20px;
  transform: translateX(100%); transition: transform .24s ease;
  overflow-y: auto;
}
body.nav-open .site-nav.is-mobile-drawer { transform: translateX(0); }
.site-nav.is-mobile-drawer a {
  display: block; padding: 15px 22px; font-size: 15px; color: #cfd6e4;
  border-left: 2px solid transparent; white-space: normal;
}
.site-nav.is-mobile-drawer a:hover { background: rgba(255,255,255,.05); }
.site-nav.is-mobile-drawer a.is-active { color: #fff; border-left-color: #fff; font-weight: 700; }
body.nav-open::after {
  content: ''; position: fixed; inset: 0; z-index: 1190; background: rgba(4,7,12,.62);
}

