:root{
  /* 深色模式（默认） */
  --bg:#0b0d10; --fg:#e9eef5; --muted:#a7b3c2;
  --card:#12161c; --line:#1c2330; --accent:#0A84FF;
}

/* 浅色模式 */
:root[data-theme="light"],
html[data-theme="light"]{
  --bg:#f5f5f7; --fg:#1d1d1f; --muted:#6e6e73;
  --card:#ffffff; --line:#d2d2d7; --accent:#0071e3;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--fg)}
html{min-height:100%; -webkit-text-size-adjust:100%}
body{min-height:100%; font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","SF Pro Display","Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}
a{color:inherit;text-decoration:none}
.wrap{max-width:1100px;margin:0 auto;padding:24px}

/* header */
.site-header{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:14px;
  padding:12px 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(11,13,16,.72);
  border-bottom:1px solid var(--line);
}

/* 浅色模式下的 header */
html[data-theme="light"] .site-header,
:root[data-theme="light"] .site-header{
  background: rgba(255,255,255,.85);
  border-bottom:1px solid var(--line);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;font-size:13px}
.brand-dot{width:8px;height:8px;border-radius:999px;background:var(--accent);box-shadow:0 0 0 4px rgba(10,132,255,.22)}
.brand-text{opacity:.95}

.header-actions{display:flex;align-items:center;gap:10px}
.theme-toggle,.menu-toggle{
  height:34px; padding:0 12px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color: var(--fg);
  cursor:pointer;
}
.theme-toggle{width:34px;padding:0}
.theme-toggle:hover,.menu-toggle:hover{border-color:rgba(255,255,255,.22)}

/* 浅色模式下的按钮 */
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .menu-toggle,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .menu-toggle{
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.12);
  color: var(--fg);
}
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .menu-toggle:hover,
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .menu-toggle:hover{
  border-color:rgba(0,0,0,.22);
  background: rgba(0,0,0,.1);
}

/* Desktop nav */
.nav{
  display:flex;
  gap:16px;
  align-items:center;
  flex-wrap:nowrap;
}
.nav a{
  font-size:13px;
  color: rgba(233,238,245,.82);
  padding:6px 10px;
  border-radius:999px;
}
.nav a:hover{background: rgba(255,255,255,.06)}
.nav a.active{background: rgba(10,132,255,.16); border:1px solid rgba(10,132,255,.22)}

/* 浅色模式下的导航链接 */
html[data-theme="light"] .nav a,
:root[data-theme="light"] .nav a{
  color: rgba(29,29,31,.82);
}
html[data-theme="light"] .nav a:hover,
:root[data-theme="light"] .nav a:hover{
  background: rgba(0,0,0,.06);
}
html[data-theme="light"] .nav a.active,
:root[data-theme="light"] .nav a.active{
  background: rgba(0,113,227,.16);
  border:1px solid rgba(0,113,227,.22);
  color: var(--accent);
}

/* Mobile menu overlay */
.menu-overlay{
  position:fixed; inset:0; z-index:1000;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display:flex; align-items:flex-start; justify-content:center;
  padding: 70px 14px 14px;
}
.menu-panel{
  width:min(520px, 100%);
  border-radius:18px;
  background: rgba(18,22,28,.92);
  border:1px solid rgba(255,255,255,.12);
  overflow:hidden;
}

/* 浅色模式下的菜单面板 */
html[data-theme="light"] .menu-panel,
:root[data-theme="light"] .menu-panel{
  background: rgba(255,255,255,.95);
  border:1px solid rgba(0,0,0,.12);
}
.menu-top{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.menu-title{font-weight:700; letter-spacing:.02em}
.menu-close{
  height:34px; width:34px; border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color: var(--fg);
  cursor:pointer;
}
.menu-grid{
  padding:14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* ✅ 每行最多3个 */
  gap:10px;
}
.menu-grid a{
  display:flex; align-items:center; justify-content:center;
  min-height:36px;
  padding:10px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  font-size:13px;
  text-align:center;
  white-space:normal;      /* ✅ 不省略 */
  overflow:visible;        /* ✅ 不裁切 */
  word-break:keep-all;     /* ✅ Knowledge 完整显示 */
}
.menu-grid a:hover{border-color:rgba(255,255,255,.22)}
.menu-grid a.active{background: rgba(10,132,255,.16); border-color: rgba(10,132,255,.22)}

/* 浅色模式下的菜单项 */
html[data-theme="light"] .menu-grid a,
:root[data-theme="light"] .menu-grid a{
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.12);
  color: var(--fg);
}
html[data-theme="light"] .menu-grid a:hover,
:root[data-theme="light"] .menu-grid a:hover{
  border-color:rgba(0,0,0,.22);
  background: rgba(0,0,0,.1);
}
html[data-theme="light"] .menu-grid a.active,
:root[data-theme="light"] .menu-grid a.active{
  background: rgba(0,113,227,.16);
  border-color: rgba(0,113,227,.22);
  color: var(--accent);
}

/* ✅ Mobile rules: only show Menu, hide desktop nav */
@media (max-width: 760px){
  .nav{display:none !important;}
  .menu-toggle{display:inline-flex;}
}

/* ✅ Desktop rules: show nav, hide Menu button/overlay */
@media (min-width: 761px){
  .menu-toggle{display:none !important;}
  .menu-overlay{display:none !important;}
}

/* iOS pinch-zoom dark background: make html background solid when dark */
html[data-theme="dark"], body[data-theme="dark"]{background:#000 !important;}

/* ✅ iOS/Safari: ensure hidden overlay is really hidden */
.menu-overlay[hidden]{display:none !important;}


/* IOS_HTML_BG_FIX */
html{background:#f5f5f7;}
html[data-theme="dark"]{background:#000000;}


/* JC_IOS_ZOOM_BG */
html, body { background: var(--bg); }
html[data-theme="dark"], body[data-theme="dark"] { background:#000 !important; }

/* 通用卡片样式 */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: var(--fg);
}

/* 浅色模式下的通用样式增强 */
html[data-theme="light"] .menu-close,
:root[data-theme="light"] .menu-close{
  background: rgba(0,0,0,.06);
  border:1px solid rgba(0,0,0,.12);
  color: var(--fg);
}

html[data-theme="light"] .menu-top,
:root[data-theme="light"] .menu-top{
  border-bottom:1px solid rgba(0,0,0,.10);
}


/* =========================================================
   Stronger LIGHT theme contrast (make Day mode obvious)
   ========================================================= */
body:not([data-theme="dark"]) header{
  background: rgba(245,245,247,.86) !important;
  border-bottom-color: rgba(0,0,0,.12) !important;
}

body:not([data-theme="dark"]) .hero-gradient{
  /* lighten the overlay so the image feels brighter in Day mode */
  background:
    radial-gradient(80% 55% at 15% 35%, rgba(255,255,255,.16), rgba(0,0,0,.35) 70%),
    linear-gradient(to bottom, rgba(255,255,255,.06), rgba(0,0,0,.40)) !important;
}

body:not([data-theme="dark"]) .panel{
  background: rgba(255,255,255,.76) !important;
  color: #101114 !important;
  border-color: rgba(0,0,0,.10) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.10) !important;
}

body:not([data-theme="dark"]) .title{
  text-shadow: 0 6px 24px rgba(0,0,0,.22) !important;
}

body:not([data-theme="dark"]) .sub{
  color: rgba(20,22,26,.72) !important;
}

body:not([data-theme="dark"]) .tag,
body:not([data-theme="dark"]) .chip{
  background: rgba(255,255,255,.70) !important;
  border-color: rgba(0,0,0,.10) !important;
  color: rgba(20,22,26,.84) !important;
}

body:not([data-theme="dark"]) .btn-primary{
  background: rgba(0,0,0,.06) !important;
  color: #101114 !important;
  border-color: rgba(0,0,0,.14) !important;
}

body:not([data-theme="dark"]) .btn-ghost{
  background: rgba(255,255,255,.66) !important;
  color: #101114 !important;
  border-color: rgba(0,0,0,.12) !important;
}

body:not([data-theme="dark"]) .card{
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(0,0,0,.10) !important;
}


/* JC_THEME_ICON_SVG */
.theme-toggle .theme-icon{display:inline-flex;align-items:center;justify-content:center}
.theme-toggle svg{width:18px;height:18px;display:block;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .icon-sun{display:none}
html[data-theme="dark"] .theme-toggle .icon-moon{display:none}
html[data-theme="dark"] .theme-toggle .icon-sun{display:block}

