/* ============================================================
   全站共享导航 —— 与首页 header 完全一致（DOM 同构 + CSS 同值）
   浅色照抄 style.css + upgrade.css + theme.css 最终生效值；
   深色走 [data-theme=dark] 变量翻转，并复刻首页 premium 的 header 规格。
   ============================================================ */

[data-theme=dark]{
  --cream:#071b18;--white:#102b25;--celadon:#0d2622;--ink:#f5f6ed;--deep:#0a1a18;
  --muted:#9db8b0;--line:#1d3a35;--soft:#5f8a80;--shadow:#00000080;
  --accent:#6fc3ae;--primary:#6fc3ae
}

.sprite{position:absolute;width:0;height:0;overflow:hidden}

/* 对抗 admin.css 的全局污染（download 页借用了 admin.css）：
   admin.css 有 a:hover{text-decoration:underline} 和 button:hover{background:#edf3ef} */
.header a,.header a:hover,.header a:active,.header a:visited{color:inherit;text-decoration:none}
.header .icon-button:hover,.header .theme-toggle:hover,.header .language-switch button:hover,.header .menu-toggle:hover{background:none}

/* ---------- header 容器 ---------- */
.header{height:100px;padding-inline:4%;background:var(--white);border:0;box-shadow:0 1px 0 var(--line);transition:height .25s,box-shadow .25s;display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:60}
.header.is-scrolled{height:78px;box-shadow:0 5px 25px var(--shadow)}
.header a{color:inherit;text-decoration:none}

/* ---------- 品牌 ---------- */
.brand{display:flex;align-items:center;gap:5px;flex-shrink:0}
.brand strong{color:#065a6e}.brand small{color:#4f8497}
.brand strong{display:block;font-size:25px;font-weight:700;letter-spacing:3px;line-height:1.3}
.brand small{display:block;font-size:8px;letter-spacing:1.7px;font-weight:600;margin-top:5px}
.official-logo{position:relative;display:block;width:60px;height:60px;object-fit:cover;flex-shrink:0;overflow:hidden;border-radius:14px;box-shadow:0 2px 10px var(--shadow)}
.official-logo img{position:absolute;left:0;top:0;width:100%;height:100%;max-width:none;object-fit:cover}

/* ---------- 导航 ---------- */
.header nav{display:flex;align-items:center;gap:26px;font-size:15px}
.header nav>a{position:relative;white-space:nowrap}
.header nav>a:not(.nav-cta):after{content:'';position:absolute;bottom:-7px;left:0;width:0;height:2px;background:var(--ink);transition:width .25s}
.header nav>a:hover:after{width:100%}
.header nav>a.is-active{color:var(--accent);font-weight:600}
.header nav>a.is-active:after{width:100%;background:var(--accent)}

/* ---------- 下拉 disclosure ---------- */
.nav-disclosure{border:0}
.nav-disclosure summary{position:relative;padding:0;display:flex;align-items:center;gap:5px;font-size:inherit;white-space:nowrap;cursor:pointer;list-style:none;color:inherit}
.nav-disclosure summary::-webkit-details-marker{display:none}
.nav-disclosure summary:after{content:'';position:absolute;bottom:-7px;left:0;width:0;height:2px;background:var(--ink);transition:width .25s}
.nav-disclosure summary:hover:after{width:100%}
.nav-disclosure.is-active summary{color:var(--accent);font-weight:600}
.nav-disclosure.is-active summary:after{width:100%;background:var(--accent)}
.chevron{width:8px;height:8px;flex:none;margin-left:2px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);color:var(--muted);transition:transform .25s cubic-bezier(.4,0,.2,1),color .2s,border-color .2s}
.nav-disclosure summary:hover .chevron{color:var(--ink)}
.nav-disclosure summary:active .chevron{transform:rotate(45deg) translateY(1.5px)}
.nav-disclosure summary:focus-visible .chevron{color:var(--ink)}
.nav-disclosure[open] .chevron{transform:rotate(-135deg);color:var(--ink)}
.mega-panel{position:absolute;top:100%;left:0;right:0;background:var(--white);padding:40px max(4%,calc((100% - 1280px)/2));display:grid;grid-template-columns:1fr 2.5fr;gap:50px;border-top:1px solid var(--line);box-shadow:0 25px 35px var(--shadow);z-index:62;animation:sn-enter .2s ease-out}
.mega-intro h3{font-family:var(--display);font-size:27px;font-weight:500;letter-spacing:.02em;line-height:1.4}
.mega-intro .eyebrow{display:flex;align-items:center;gap:9px;font-size:10px;font-weight:500;letter-spacing:2.5px;line-height:1.6;margin-bottom:14px;color:var(--muted)}
.mega-intro .eyebrow:before{content:'';width:20px;height:2px;background:var(--accent);flex:none}
.mega-intro .text-link{display:inline-flex;gap:12px;align-items:center;font-size:12px;border-bottom:1px solid var(--ink);padding-bottom:7px;margin-top:26px;transition:color .2s,border-color .2s}
.mega-intro .text-link:hover{color:var(--accent);border-color:var(--accent)}
.mega-intro .text-link:focus-visible{outline:2px solid var(--focus);outline-offset:4px}
.mega-intro .text-link svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.mega-intro .text-link:hover svg{transform:translateX(4px)}
.mega-links{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;align-items:center}
.mega-links>a{padding:20px 15px;background:var(--cream);transition:background .2s,transform .2s;min-height:120px;display:flex;flex-direction:column;gap:12px;border-radius:0}
.mega-links>a:hover{background:var(--celadon);transform:translateY(-3px)}
.mega-links svg{width:32px;height:32px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.mega-links strong{font-size:16px;font-weight:500;color:inherit}
.mega-links small{font-size:8px;letter-spacing:1px;color:var(--muted)}
.product-mega{grid-template-columns:repeat(5,1fr)}
.product-mega>a{justify-content:center}
.product-mega strong{font-size:14px}

/* ---------- 右侧工具 ---------- */
.header-tools{display:flex;align-items:center;gap:20px;margin-left:28px}
.icon-button{border:0;background:none;display:grid;place-items:center;width:35px;height:35px;cursor:pointer;color:var(--ink);padding:0}
.icon-button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle{display:grid;place-items:center;width:35px;height:35px;padding:7px;border:1px solid var(--line);border-radius:50%;background:none;color:inherit;cursor:pointer;flex-shrink:0}
.theme-toggle svg{width:19px;height:19px}
.theme-toggle svg circle{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-half{fill:currentColor;stroke:none}
.language-switch{display:flex;border:1px solid var(--line);border-radius:28px;padding:4px;gap:3px;background:var(--cream)}
.language-switch button{width:35px;height:33px;border:0;background:none;border-radius:50%;padding:0;font-size:12px;font-weight:600;color:var(--muted);cursor:pointer;font-family:inherit}
.language-switch button[aria-pressed=true]{background:var(--white);color:var(--ink);box-shadow:0 2px 12px var(--shadow)}
.menu-toggle{display:none;width:32px;height:36px;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:none;border:0;cursor:pointer}
.menu-toggle span{height:1px;width:22px;background:var(--ink);transition:transform .2s}
.menu-toggle[aria-expanded=true] span:first-child{transform:translateY(3.5px) rotate(45deg)}
.menu-toggle[aria-expanded=true] span:last-child{transform:translateY(-3.5px) rotate(-45deg)}

@keyframes sn-enter{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)}}

/* ---------- 深色：精确复刻首页 premium shell 的 header 规格 ---------- */
[data-theme=dark] .header{background:#071b18;color:#f5f6ed;padding-inline:4%;box-shadow:none;border-bottom:1px solid #d1e5dc26}
[data-theme=dark] .header.is-scrolled{height:78px;box-shadow:none}
[data-theme=dark] .brand small{color:#b1c9bf}
[data-theme=dark] .brand strong{color:#c2dde4}
[data-theme=dark] .header .brand .official-logo{background:#102b25;border:1px solid #ffffff2e;box-shadow:none}
[data-theme=dark] .header .brand .official-logo img{left:3px;top:3px;width:calc(100% - 6px);height:calc(100% - 6px);border-radius:12px}

[data-theme=dark] .header nav>a{color:#f5f6ed}
[data-theme=dark] .header nav>a:after{background:#c1dccd}
[data-theme=dark] .nav-disclosure summary:after{background:#c1dccd}
[data-theme=dark] .header nav>a.is-active{color:#c1dccd}
[data-theme=dark] .header nav>a.is-active:after{background:#c1dccd}
[data-theme=dark] .nav-disclosure summary{color:#f5f6ed}
[data-theme=dark] .nav-disclosure.is-active summary{color:#c1dccd}
[data-theme=dark] .nav-disclosure.is-active summary:after{background:#c1dccd}
[data-theme=dark] .chevron{color:#b1c9bf}
[data-theme=dark] .theme-toggle{border-color:#d1e5dc26;color:#f5f6ed}
[data-theme=dark] .language-switch{background:#102b25;border-color:#d1e5dc26}
[data-theme=dark] .language-switch button{color:#b1c9bf}
[data-theme=dark] .language-switch button[aria-pressed=true]{color:#071b18;background:#c1dccd}
[data-theme=dark] .menu-toggle span{background:#f5f6ed}
[data-theme=dark] .mega-panel{background:#f5f3ec;color:#07565b;border:0;padding-block:48px}
[data-theme=dark] .mega-intro h3{color:#07565b}
[data-theme=dark] .mega-intro .eyebrow{color:#607574}
[data-theme=dark] .mega-intro .text-link{color:#07565b;border-bottom-color:#07565b}
[data-theme=dark] .mega-links>a{background:#fffef8;border-radius:10px}
[data-theme=dark] .mega-links>a:hover{background:#eaf0e9}
[data-theme=dark] .mega-links strong{color:#07565b}
[data-theme=dark] .mega-links small{color:#607574}
[data-theme=dark] .mega-links svg{stroke:#07565b}

/* ---------- 响应式（与首页 upgrade.css 断点一致） ---------- */
/* 英文导航更长（约 880px vs 中文 720px）：1251-1600px 缩小导航密度防溢出 */
@media(max-width:1600px){
  html[lang=en] .header nav{font-size:13px;gap:17px}
}
/* 英文模式更早切换汉堡布局（1000-1400px 区间，中文保持横排） */
@media(max-width:1400px){
  html[lang=en] .header .menu-toggle{display:flex}
  html[lang=en] .header nav{display:none;position:absolute;top:100px;left:0;right:0;background:var(--white);padding:20px 24px;flex-direction:column;align-items:stretch}
  html[lang=en] .header nav.is-open{display:flex;max-height:calc(100svh - 100px);overflow:auto}
  html[lang=en] .header nav>a{font-size:16px;padding:14px 0}
  html[lang=en] .nav-disclosure summary{font-size:16px;padding:14px 0;justify-content:space-between}
  html[lang=en] .mega-panel{position:static;box-shadow:none;padding:15px 0 25px;display:block;animation:none}
  html[lang=en] .mega-intro{display:none}
  html[lang=en] .mega-links{gap:8px;grid-template-columns:repeat(2,1fr)}
  html[lang=en] .mega-links>a{min-height:70px;padding:12px}
  html[lang=en] .mega-links svg{display:none}
  html[lang=en] .header-tools{margin-left:auto;gap:12px}
  html[lang=en][data-theme=dark] .header nav{background:#071b18}
}
@media(max-width:1250px){
  .header nav{gap:17px;font-size:13px}
  .header-tools{gap:12px;margin-left:18px}
  .header .brand strong{font-size:23px}
  .header .brand small{font-size:7px}
  .official-logo{width:52px;height:52px}
}
@media(max-width:1000px){
  .header,.header.is-scrolled{height:82px;padding-inline:24px}
  .header .menu-toggle{display:flex}
  .header nav{display:none;position:absolute;top:82px;left:0;right:0;background:var(--white);padding:20px 24px;flex-direction:column;align-items:stretch}
  .header nav.is-open{display:flex;max-height:calc(100svh - 82px);overflow:auto}
  .header nav>a{font-size:16px;padding:14px 0}
  .nav-disclosure summary{font-size:16px;padding:14px 0;justify-content:space-between}
  .mega-panel{position:static;box-shadow:none;padding:15px 0 25px;display:block;animation:none}
  .mega-intro{display:none}
  .mega-links{gap:8px;grid-template-columns:repeat(2,1fr)}
  .mega-links>a{min-height:70px;padding:12px}
  .mega-links svg{display:none}
  .mega-links strong{font-size:14px}
  .mega-links small{font-size:8px}
  .mega-links a:last-child:nth-child(odd){grid-column:1/-1}
  .header-tools{margin-left:auto;gap:12px}
}
@media(max-width:600px){
  .header,.header.is-scrolled{height:76px;padding-inline:14px}
  .header nav{top:76px}
  .header nav.is-open{max-height:calc(100svh - 76px)}
  .official-logo{width:45px;height:45px}
  .header .brand strong{font-size:20px;letter-spacing:2px}
  .header .brand small{font-size:6px;letter-spacing:1px}
  .header-tools{gap:6px}
  .language-switch{padding:3px;gap:0}
  .language-switch button{width:29px;height:28px;font-size:10px}
  .icon-button{width:30px}
  .icon-button svg{width:20px}
  .theme-toggle{width:28px;height:28px;padding:5px}
  .theme-toggle svg{width:16px;height:16px}
  .menu-toggle{width:30px}
}

/* ---------- 深色 mobile（复刻首页 premium 600px） ---------- */
@media(max-width:1000px){
  [data-theme=dark] .header nav{background:#071b18}
}
@media(max-width:600px){
  [data-theme=dark] .header,[data-theme=dark] .header.is-scrolled{padding-inline:14px}
  [data-theme=dark] .header nav{top:76px}
}

/* ---------- 站点页脚（复刻首页 premium footer，逐值同构） ---------- */
.wrap{width:min(1360px,calc(100% - 112px));margin-inline:auto}
footer{background:#fff;padding:65px 0 30px;color:var(--ink)}
.footer-main{display:flex;align-items:center;justify-content:space-between;gap:30px;padding-bottom:35px;border-bottom:1px solid var(--line)}
.footer-columns{display:grid;grid-template-columns:1fr 1fr 1.4fr minmax(140px,180px);gap:50px;padding-block:50px}
.footer-columns h3{font-size:14px;font-weight:500;margin-bottom:18px}
.footer-columns a{display:block;font-size:12px;color:var(--muted);margin-bottom:10px}
.footer-contact>a{font-size:13px;line-height:1.7}
.footer-contact>a:first-of-type{font-size:16px;font-weight:500;color:var(--ink)}
.footer-wechat{margin:0;text-align:center;align-self:start}
.footer-wechat img{width:160px;height:160px;object-fit:contain;background:var(--white);margin-inline:auto;border:1px solid var(--line);border-radius:8px}
.footer-wechat figcaption{font-size:12px;color:var(--muted);margin-top:12px}
.footer-bottom{display:flex;justify-content:space-between;gap:30px;border-top:1px solid var(--line);padding-top:20px;font-size:10px;color:var(--muted)}
.footer-bottom>div{display:flex;flex-direction:column;gap:8px}
.footer-bottom p{max-width:680px}
.icp-link{font-size:11px}
.icp-link:hover{text-decoration:underline}
/* 免疫 admin.css 全局污染（download 页） */
footer a,footer a:hover{color:inherit;text-decoration:none}
footer a:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
/* 深色 */
[data-theme=dark] footer{background:var(--deep);color:var(--ink)}
[data-theme=dark] .footer-wechat img{background:var(--white)}
[data-theme=dark] .footer-contact>a:first-of-type{color:var(--ink)}
/* 响应式（与首页断点一致） */
@media(max-width:1100px){.wrap{width:calc(100% - 70px)}}
@media(max-width:1000px){.footer-columns{grid-template-columns:1fr 1fr}.footer-contact{grid-column:auto}}
@media(max-width:800px){.wrap{width:calc(100% - 48px)}.footer-main{flex-wrap:wrap}.footer-bottom{display:block}.footer-bottom p{margin-top:12px}}
@media(max-width:600px){.footer-columns{grid-template-columns:1fr 1fr;gap:25px 16px;padding-block:30px}.footer-contact{grid-column:1/-1}.footer-contact>a:first-of-type{font-size:16px}.footer-wechat img{width:140px;height:140px}.footer-bottom{padding-right:50px}}
@media(max-width:480px){.footer-main{gap:20px}}

/* ---------- 核心架构 · 分组式 mega 面板 ---------- */
.mega-panel-arch{grid-template-columns:1fr 2.9fr}
.mega-desc{font-size:13px;color:var(--muted);margin-top:12px;letter-spacing:1px;line-height:1.8}
.mega-groups{display:grid;grid-template-columns:1fr 1.62fr 1fr;gap:16px;align-items:start}
.mega-group{display:flex;flex-direction:column;gap:8px;background:var(--cream);border-radius:12px;padding:16px 14px}
.mega-group-title{font-size:9.5px;font-weight:500;letter-spacing:2px;color:var(--muted);margin:0 0 2px;padding-left:4px}
.mega-group>a{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:9px;background:var(--white);transition:background .2s,transform .2s;min-height:0}
.mega-group>a:hover{background:var(--celadon);transform:translateY(-2px);text-decoration:none}
.mega-group svg{width:18px;height:18px;flex:none;color:var(--ink);fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.mega-group strong{display:block;font-size:13.5px;font-weight:500;line-height:1.35;color:inherit}
.mega-group small{display:block;font-size:7.5px;letter-spacing:1px;color:var(--muted);margin-top:3px}
[data-theme=dark] .mega-group{background:#fffef8}
[data-theme=dark] .mega-group>a{background:#fff}
[data-theme=dark] .mega-group>a:hover{background:#eaf0e9}
[data-theme=dark] .mega-group svg{color:#07565b;stroke:#07565b}
[data-theme=dark] .mega-group strong{color:#07565b}
[data-theme=dark] .mega-group small,[data-theme=dark] .mega-group-title,[data-theme=dark] .mega-desc{color:#607574}
@media(max-width:1000px){
  .mega-panel-arch{display:block}
  [data-theme=dark] .mega-panel.mega-panel-arch{padding-block:16px}
  .mega-groups{grid-template-columns:1fr;gap:12px}
  .mega-group{padding:12px}
  .mega-group>a{padding:10px 12px}
  .mega-group small{font-size:8px}
}

.mega-group .mega-logo{width:20px;height:20px;flex:none;object-fit:contain}
