/* SigmAgent.org 共享样式 */
:root {
  --bg-0: #0b1020;
  --bg-1: #111827;
  --surface: rgba(23, 32, 51, 0.68);
  --surface-strong: rgba(23, 32, 51, 0.92);
  --surface-2: rgba(31, 41, 55, 0.76);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-0: #eef3f8;
  --text-1: #b7c2cf;
  --text-2: #7d8a99;
  --text-3: #5f6b7a;
  --cyan: #6aa6c8;
  --pink: #b77aa6;
  --violet: #8c7ab8;
  --amber: #c49a62;
  --green: #65a987;
  --red: #b86b78;
  --grad: linear-gradient(135deg, #6aa6c8 0%, #8c7ab8 50%, #b77aa6 100%);
  --grad-cool: linear-gradient(135deg, #6aa6c8, #8c7ab8);
  --grad-warm: linear-gradient(135deg, #c49a62, #b77aa6);
  --grad-cyan: linear-gradient(135deg, #6aa6c8, #5b9ab8);
  --grad-pink: linear-gradient(135deg, #b77aa6, #8f6aa5);
  --shadow-cyan: 0 0 40px rgba(6, 214, 240, 0.25);
  --shadow-pink: 0 0 40px rgba(255, 62, 157, 0.25);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg-0); color: var(--text-0); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px; line-height: 1.6; min-height: 100vh;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; position: relative;
}
html { scroll-behavior: smooth; }

/* 背景 */
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 130, 200, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 130, 200, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 100%);
}
.bg-glow { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(80px); opacity: 0.18; }
.bg-glow-1 { width: 600px; height: 600px; background: radial-gradient(circle, var(--cyan) 0%, transparent 70%); top: -200px; left: -200px; animation: glowFloat 16s ease-in-out infinite; }
.bg-glow-2 { width: 700px; height: 700px; background: radial-gradient(circle, var(--pink) 0%, transparent 70%); bottom: -300px; right: -200px; animation: glowFloat 18s ease-in-out infinite -8s; }
@keyframes glowFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -40px) scale(1.1); } }

/* 导航 */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(11, 16, 32, 0.78); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1280px; margin: 0 auto; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: 0.05em; color: var(--text-0); text-decoration: none; }
.logo-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--grad); border-radius: 8px; font-size: 18px; color: #fff; box-shadow: var(--shadow-cyan); }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 16px; border-radius: 8px; color: var(--text-1); text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.2s var(--ease); }
.nav-link:hover { color: var(--text-0); background: var(--surface); }
.nav-link.active { color: var(--cyan); background: rgba(6, 214, 240, 0.1); }

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-0);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-strong);
  transition: all 0.2s var(--ease);
}
.nav-back:hover {
  background: rgba(6, 214, 240, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateX(-2px);
}
.nav-back svg { flex-shrink: 0; }

.floating-back {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 150;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: rgba(7, 7, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transition: all 0.2s var(--ease);
  animation: fadeUp 0.4s var(--ease);
}
.floating-back:hover {
  background: rgba(6, 214, 240, 0.2);
  border-color: var(--cyan);
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .floating-back { display: flex; }
}

/* 通用 */
.container { max-width: 1280px; margin: 0 auto; padding: 0 32px; }
.section { padding: 80px 0; }
.section-header { margin-bottom: 48px; text-align: center; }
.section-title { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.section-subtitle { color: var(--text-2); font-size: 16px; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: all 0.2s var(--ease); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-cyan); background-size: 200% 200%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 48px rgba(6, 214, 240, 0.4); background-position: 100% 50%; }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-0); }
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--cyan); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: rgba(255, 77, 109, 0.15); border: 1px solid var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* 动画 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 62, 157, 0.4); } 50% { box-shadow: 0 0 0 10px rgba(255, 62, 157, 0); } }
@keyframes gradientShift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 卡片（通用） */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; transition: all 0.3s var(--ease); }
.card:hover { border-color: var(--border-strong); }

/* 标签 */
.tag { display: inline-block; padding: 4px 10px; background: var(--surface-strong); border-radius: 100px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-2); }
.tag-hot { background: var(--grad-warm); color: #fff; animation: pulse 2s ease-in-out infinite; }
.tag-cyan { background: rgba(6, 214, 240, 0.15); color: var(--cyan); }
.tag-pink { background: rgba(255, 62, 157, 0.15); color: var(--pink); }
.tag-green { background: rgba(16, 214, 138, 0.15); color: var(--green); }
.tag-amber { background: rgba(245, 158, 11, 0.15); color: var(--amber); }

/* ===========================
   Footer
   =========================== */
.footer { padding: 32px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 32px; display: flex; justify-content: space-between; align-items: center; color: var(--text-2); font-size: 13px; }
.footer-left { display: flex; align-items: center; gap: 12px; }


/* ===========================
   SigmAgent.org Portal v0.5
   =========================== */
.sigmagent-page .logo span:last-child { display:flex; flex-direction:column; line-height:1.05; }
.sigmagent-page .logo small { display:block; margin-top:3px; color:var(--text-2); font-size:11px; letter-spacing:0; font-weight:600; }
.portal-hero, .topic-hero { padding: 92px 0 56px; text-align:center; }
.topic-hero { text-align:left; }
.portal-badge { display:inline-flex; align-items:center; gap:8px; padding:7px 14px; border:1px solid color-mix(in srgb, var(--topic-color, var(--cyan)) 45%, transparent); border-radius:999px; color:var(--topic-color, var(--cyan)); background:rgba(255,255,255,.035); font-size:12px; font-weight:800; letter-spacing:.12em; margin-bottom:22px; }
.portal-title { font-size:clamp(42px,8vw,88px); line-height:.98; letter-spacing:-.055em; margin:0 0 22px; font-weight:950; }
.portal-title span, .portal-title strong { display:block; }
.portal-title strong { background:linear-gradient(135deg, var(--topic-color, var(--cyan)), var(--violet), var(--pink)); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; font-size:.55em; letter-spacing:-.035em; margin-top:14px; }
.portal-subtitle { max-width:820px; color:var(--text-1); font-size:18px; line-height:1.9; margin:0 auto 30px; }
.topic-hero .portal-subtitle { margin-left:0; }
.portal-actions { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.topic-hero .portal-actions { justify-content:flex-start; }
.portal-stats { max-width:820px; margin:54px auto 0; display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.portal-stats div { padding:18px 14px; border:1px solid var(--border); border-radius:18px; background:var(--surface); }
.portal-stats b { display:block; font-size:32px; background:var(--grad-cool); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
.portal-stats span { color:var(--text-2); font-size:12px; }
.subsite-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:18px; }
.subsite-card, .category-section, .station-panel, .topic-panel, .jump-panel { background:linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)); border:1px solid var(--border); border-radius:24px; box-shadow:0 18px 60px rgba(0,0,0,.18); }
.subsite-card { padding:24px; position:relative; overflow:hidden; }
.subsite-card::before, .category-section::before, .station-panel::before { content:""; position:absolute; inset:0 0 auto 0; height:3px; background:linear-gradient(90deg, var(--topic-color), transparent); opacity:.9; }
.subsite-card { position:relative; }
.subsite-head { display:flex; align-items:center; gap:14px; margin-bottom:16px; }
.subsite-head > span { width:46px; height:46px; display:grid; place-items:center; border-radius:14px; background:color-mix(in srgb, var(--topic-color) 18%, transparent); font-size:24px; }
.subsite-head b { display:block; font-size:20px; }
.subsite-head em { display:block; color:var(--topic-color); font-style:normal; font-size:12px; font-weight:800; letter-spacing:.08em; margin-top:2px; }
.subsite-card p { color:var(--text-1); line-height:1.75; margin-bottom:14px; }
.subsite-status { color:var(--text-2); font-size:13px; line-height:1.7; padding:12px; background:rgba(0,0,0,.16); border:1px solid var(--border); border-radius:14px; margin-bottom:16px; }
.subsite-card a { color:var(--topic-color); text-decoration:none; font-weight:800; }
.category-section { position:relative; padding:28px; margin:0 0 28px; overflow:hidden; }
.category-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:22px; }
.category-head span { color:var(--topic-color); font-size:12px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.category-head h2 { font-size:30px; margin:4px 0 8px; }
.category-head p { color:var(--text-1); max-width:760px; }
.category-return { color:var(--topic-color); text-decoration:none; font-size:13px; font-weight:800; white-space:nowrap; }
.topic-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(235px,1fr)); gap:14px; }
.topic-card, .case-card, .jump-btn { display:block; text-decoration:none; color:inherit; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,.035); transition:all .22s var(--ease); }
.topic-card { padding:18px; min-height:156px; }
.topic-card:hover, .case-card:hover, .jump-btn:hover { transform:translateY(-3px); border-color:color-mix(in srgb, var(--topic-color, var(--cyan)) 55%, var(--border)); background:rgba(255,255,255,.06); }
.topic-card b { display:block; font-size:18px; margin-bottom:8px; }
.topic-card p { color:var(--text-1); font-size:13px; line-height:1.65; margin-bottom:12px; }
.topic-card small { color:var(--topic-color); font-weight:800; font-size:12px; }
.station-panel { position:relative; overflow:hidden; padding:28px; margin-bottom:28px; display:grid; grid-template-columns: minmax(260px,.8fr) 1.2fr; gap:24px; }
.station-kicker { color:var(--topic-color, var(--cyan)); font-size:11px; font-weight:900; letter-spacing:.14em; }
.station-panel h2 { font-size:28px; margin:6px 0 10px; }
.station-panel p { color:var(--text-1); line-height:1.8; }
.station-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.station-grid div, .info-card { padding:16px; border:1px solid var(--border); border-radius:16px; background:rgba(0,0,0,.14); }
.station-grid b, .info-card b { display:block; margin-bottom:6px; color:var(--text-0); }
.station-grid span, .info-card span { display:block; color:var(--text-1); font-size:13px; line-height:1.65; }
.topic-layout { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:24px; align-items:start; }
.topic-panel, .jump-panel { padding:28px; }
.topic-panel h2, .jump-panel h2 { font-size:22px; margin:24px 0 12px; }
.topic-panel h2:first-child, .jump-panel h2:first-child { margin-top:0; }
.topic-panel p, .topic-panel li { color:var(--text-1); line-height:1.85; }
.topic-panel ul { padding-left:20px; }
.info-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:20px 0; }
.subsite-types { display:flex; flex-wrap:wrap; gap:10px; }
.subsite-types span { padding:8px 12px; border-radius:999px; background:rgba(255,255,255,.06); border:1px solid var(--border); color:var(--text-1); font-size:13px; }
.case-grid, .case-list, .jump-list { display:grid; gap:12px; }
.case-grid { grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); }
.case-card { padding:18px; position:relative; }
.case-icon { font-size:26px; display:block; margin-bottom:8px; }
.case-card b { display:block; font-size:17px; padding-right:64px; }
.case-card em { position:absolute; right:14px; top:14px; color:var(--topic-color, var(--cyan)); font-style:normal; font-size:11px; font-weight:900; border:1px solid color-mix(in srgb, var(--topic-color, var(--cyan)) 45%, transparent); border-radius:999px; padding:3px 8px; }
.case-card p { color:var(--text-1); font-size:13px; line-height:1.65; margin-top:8px; }
.jump-btn { padding:14px; }
.jump-btn b { display:block; margin-bottom:4px; }
.jump-btn span { color:var(--text-2); font-size:12px; line-height:1.55; display:block; }
.placeholder-note { padding:18px; border:1px dashed var(--border-strong); border-radius:18px; background:rgba(255,255,255,.035); color:var(--text-1); line-height:1.7; }
.placeholder-note b, .placeholder-note span { display:block; }
.breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:8px; color:var(--text-2); font-size:13px; margin-bottom:22px; }
.breadcrumb a { color:var(--text-1); text-decoration:none; }
.breadcrumb a:hover { color:var(--topic-color, var(--cyan)); }
.footer-links { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.footer-links a { color:var(--text-2); text-decoration:none; }
.footer-links a:hover { color:var(--cyan); }
.mobile-dock { display:none; }
@media (max-width: 920px) {
  body.sigmagent-page { padding-bottom:88px; }
  .nav-inner { padding:12px 16px; gap:14px; align-items:flex-start; }
  .nav-links { overflow-x:auto; max-width:100%; padding-bottom:4px; scrollbar-width:none; }
  .nav-links::-webkit-scrollbar { display:none; }
  .nav-link { white-space:nowrap; padding:8px 12px; }
  .container { padding:0 18px; }
  .section { padding:48px 0; }
  .portal-hero, .topic-hero { padding:56px 0 34px; }
  .topic-hero { text-align:left; }
  .portal-subtitle { font-size:15px; line-height:1.75; }
  .portal-actions .btn { width:100%; justify-content:center; }
  .portal-stats { grid-template-columns:repeat(2,1fr); margin-top:32px; }
  .category-head, .station-panel, .topic-layout { grid-template-columns:1fr; display:grid; }
  .station-grid, .info-grid { grid-template-columns:1fr; }
  .category-head { gap:10px; }
  .topic-card { min-height:auto; }
  .jump-panel { order:-1; }
  .footer-inner { flex-direction:column; align-items:flex-start; gap:12px; padding:0 18px; }
  .floating-back { left:16px; bottom:76px; padding:10px 14px; }
  .mobile-dock { position:fixed; left:10px; right:10px; bottom:10px; z-index:180; display:grid; grid-template-columns:repeat(6,1fr); gap:4px; padding:8px; border:1px solid var(--border-strong); border-radius:18px; background:rgba(7,7,26,.88); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); box-shadow:0 10px 40px rgba(0,0,0,.42); }
  .mobile-dock a { min-height:42px; display:grid; place-items:center; color:var(--text-1); text-decoration:none; font-size:12px; font-weight:800; border-radius:12px; background:rgba(255,255,255,.035); }
  .mobile-dock a:active { background:rgba(6,214,240,.16); color:var(--cyan); }
}
@media (max-width: 520px) {
  .sigmagent-page .logo small { display:none; }
  .portal-title { font-size:42px; }
  .portal-title strong { font-size:.62em; }
  .portal-stats { grid-template-columns:1fr 1fr; gap:10px; }
  .subsite-grid, .topic-grid, .case-grid { grid-template-columns:1fr; }
  .category-section, .station-panel, .topic-panel, .jump-panel { padding:20px; border-radius:20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; scroll-behavior:auto !important; }
}

/* ===========================
   SigmAgent.org Privacy + Support
   =========================== */
.footer-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
}
.footer-link-button:hover { color: var(--cyan); }

.privacy-notice {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 240;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(7, 7, 26, .92);
  box-shadow: 0 18px 60px rgba(0,0,0,.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: privacyIn .24s var(--ease);
}
.privacy-notice.is-leaving { opacity: 0; transform: translateY(10px); transition: all .18s var(--ease); }
.privacy-notice__body strong { display:block; color: var(--text-0); margin-bottom: 4px; }
.privacy-notice__body p { margin: 0; color: var(--text-1); font-size: 13px; line-height: 1.65; }
.privacy-notice__actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.privacy-notice__actions a,
.privacy-notice__actions button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.privacy-notice__actions a { color: var(--text-1); border:1px solid var(--border); background: rgba(255,255,255,.035); }
.privacy-notice__actions button { color:#051018; border:0; background: var(--grad-cool); }

.support-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 230;
  display:flex;
  align-items:center;
  gap:6px;
}
.support-fab__main,
.support-fab__hide {
  font-family: inherit;
  border: 1px solid rgba(245, 158, 11, .42);
  background: rgba(20, 16, 30, .86);
  color: var(--text-0);
  box-shadow: 0 14px 44px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor:pointer;
}
.support-fab__main {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 900;
}
.support-fab__main span { color: #f8d48a; }
.support-fab__hide {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--text-2);
}
.support-panel { position: fixed; inset: 0; z-index: 320; display:none; }
.support-panel.is-open { display:block; }
.support-panel__backdrop { position:absolute; inset:0; background: rgba(0,0,0,.56); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.support-panel__card {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 34px));
  padding: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24,22,42,.98), rgba(9,9,24,.98));
  box-shadow: 0 30px 90px rgba(0,0,0,.58);
  text-align: center;
}
.support-panel__close {
  position:absolute; right:14px; top:12px;
  width:34px; height:34px; border-radius:999px;
  border:1px solid var(--border); background:rgba(255,255,255,.035);
  color:var(--text-1); cursor:pointer; font-size:20px;
}
.support-panel__mark { font-size: 42px; margin-bottom: 10px; }
.support-panel__card h2 { margin: 0 0 12px; font-size: 26px; }
.support-panel__card p { color: var(--text-1); line-height: 1.75; margin: 0 0 18px; }
.support-panel__btn { width:100%; justify-content:center; margin: 8px 0 12px; }
.support-panel__btn:disabled { opacity:.72; cursor:not-allowed; filter:saturate(.65); }
.support-panel__hint { font-size: 12px; color: var(--text-2) !important; margin-bottom: 0 !important; }

@keyframes privacyIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

@media (max-width: 920px) {
  .privacy-notice {
    bottom: calc(82px + env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
  }
  .privacy-notice__actions { justify-content: flex-end; }
  .support-fab { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .support-fab__main span { display:none; }
}

/* ===========================
   SigmAgent.org hierarchy cleanup v0.6
   目标：手机端先看主频道，再看主题，最后进内容；避免所有卡片同时抢注意力。
   =========================== */
.hierarchy-guide {
  padding-top: 0;
  padding-bottom: 42px;
}
.hierarchy-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,255,255,.035);
}
.hierarchy-card div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0,0,0,.15);
  border: 1px solid rgba(255,255,255,.055);
}
.hierarchy-card b {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--grad-cool);
  color: #fff;
  font-size: 18px;
}
.hierarchy-card span { font-weight: 900; color: var(--text-0); }
.hierarchy-card em { color: var(--text-2); font-style: normal; font-size: 12px; line-height: 1.5; }
.category-section summary { list-style: none; cursor: pointer; }
.category-section summary::-webkit-details-marker { display: none; }
.category-section .topic-grid { margin-top: 20px; }
.category-toggle-hint {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--topic-color) 45%, transparent);
  color: var(--topic-color);
  background: color-mix(in srgb, var(--topic-color) 10%, transparent);
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}
.category-toggle-hint::after { content: '↓'; margin-left: 6px; }
.category-section[open] .category-toggle-hint::after { content: '↑'; }
.category-section[open] .category-toggle-hint { background: color-mix(in srgb, var(--topic-color) 16%, transparent); }
/* 注意：subsite-actions 现在有两个 <a>（"查看主题" + "独立站 ↗"），
   不能让 ::after 把整张卡盖死，否则第二个链接点不到。
   只让首个 a（在 .subsite-actions 之外）的 ::after 覆盖卡片。 */
.subsite-card { min-height: 220px; }
.subsite-status { margin-bottom: 0; }

/* 频道卡 + 子站卡的"独立站 ↗"链接（与 .inline-disabled 同尺寸） */
.subsite-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.subsite-actions a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 8px 14px; border-radius: 999px;
  font: inherit; font-size: 13px; font-weight: 900;
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.subsite-actions a:first-child {
  color: var(--topic-color);
  background: color-mix(in srgb, var(--topic-color) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--topic-color) 28%, transparent);
}
.subsite-actions a.inline-go {
  color: #fff !important;
  background: var(--topic-color);
  border: 1px solid var(--topic-color);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--topic-color) 30%, transparent);
}
.subsite-actions a:hover { transform: translateY(-1px); }

/* topic-card 现在直接指向 subdomain；保留卡内 small 作为副文案 */
.topic-card small { color: var(--topic-color); font-weight: 800; opacity: .9; }
.topic-card[data-intro]:hover small { text-decoration: underline; }

@media (min-width: 921px) {
  .category-section:not([open]) .category-head { margin-bottom: 0; }
}

@media (max-width: 920px) {
  body.sigmagent-page { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .sigmagent-page .nav { position: sticky; }
  .sigmagent-page .nav-inner { align-items: center; }
  .sigmagent-page .nav-links { display: none; }
  .sigmagent-page .logo { max-width: 100%; }
  .portal-hero { padding-top: 36px; padding-bottom: 22px; text-align: left; }
  .portal-badge { margin-bottom: 14px; font-size: 10px; letter-spacing: .08em; }
  .portal-title { font-size: clamp(38px, 14vw, 52px); margin-bottom: 14px; }
  .portal-title strong { font-size: .48em; margin-top: 10px; letter-spacing: -.02em; }
  .portal-subtitle { margin: 0 0 18px; max-width: none; }
  .portal-actions { justify-content: stretch; }
  .portal-actions .btn { min-height: 48px; }
  .portal-stats { display: none; }
  .hierarchy-guide { padding: 0 0 26px; }
  .hierarchy-card { grid-template-columns: 1fr; padding: 10px; border-radius: 20px; }
  .hierarchy-card div { padding: 12px; border-radius: 16px; }
  .section-header { text-align: left; margin-bottom: 20px; }
  .section-title { font-size: 26px; }
  .section-subtitle { font-size: 14px; line-height: 1.65; }
  .subsite-grid { grid-template-columns: 1fr; gap: 12px; }
  .subsite-card { min-height: 88px; padding: 18px; border-radius: 20px; }
  .subsite-head { margin-bottom: 10px; }
  .subsite-head > span { width: 42px; height: 42px; font-size: 22px; }
  .subsite-card p { font-size: 14px; line-height: 1.65; margin-bottom: 10px; }
  .subsite-status { font-size: 12px; padding: 10px; }
  .category-section { padding: 0; overflow: hidden; }
  .category-head {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 18px;
    margin: 0;
  }
  .category-head h2 { font-size: 22px; margin: 2px 0 4px; }
  .category-head p { display: none; }
  .category-toggle-hint { min-width: 74px; height: 34px; font-size: 11px; }
  .category-section .topic-grid { padding: 0 16px 16px; margin-top: 0; gap: 10px; }
  .topic-card { padding: 14px; border-radius: 16px; }
  .topic-card b { font-size: 16px; margin-bottom: 4px; }
  .topic-card p { display: none; }
  .topic-card small { font-size: 11px; }
  .home-cases .case-card:nth-child(n+5) { display: none; }
  .mobile-dock {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    border-radius: 20px;
  }
  .mobile-dock a {
    min-height: 46px;
    font-size: 11px;
    position: relative;
  }
  .mobile-dock a::before {
    display: block;
    font-size: 16px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .mobile-dock a:nth-child(1)::before { content: '🧪'; }
  .mobile-dock a:nth-child(2)::before { content: '🌿'; }
  .mobile-dock a:nth-child(3)::before { content: '🏛️'; }
  .mobile-dock a:nth-child(4)::before { content: '🍽️'; }
  .mobile-dock a:nth-child(5)::before { content: '🎮'; }
  .mobile-dock a:nth-child(6)::before { content: '🧰'; }
  .support-fab { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .portal-hero, .topic-hero { padding-top: 30px; }
  .topic-hero .portal-title { font-size: 34px; }
  .topic-hero .portal-title strong { font-size: .56em; }
  .breadcrumb { font-size: 12px; margin-bottom: 14px; }
  .station-panel { display: none; }
  .jump-panel { order: -1; }
  .case-card p { display: none; }
  .case-card b { padding-right: 58px; }
}

/* ===========================
   SigmAgent.org theme + language controls
   =========================== */
:root {
  color-scheme: dark;
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-bg-hover: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg-0: #ffffff;
  --bg-1: #ffffff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: rgba(17, 24, 39, 0.10);
  --border-strong: rgba(17, 24, 39, 0.18);
  --text-0: #111827;
  --text-1: #334155;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --cyan: #047c91;
  --pink: #b91c62;
  --violet: #6d28d9;
  --amber: #b45309;
  --green: #047857;
  --red: #be123c;
  --grad: linear-gradient(135deg, #047c91 0%, #6d28d9 52%, #b91c62 100%);
  --grad-cool: linear-gradient(135deg, #047c91, #6d28d9);
  --grad-warm: linear-gradient(135deg, #b45309, #b91c62);
  --grad-cyan: linear-gradient(135deg, #047c91, #0e9bb2);
  --grad-pink: linear-gradient(135deg, #b91c62, #7c3aed);
  --shadow-cyan: 0 16px 42px rgba(4, 124, 145, 0.13);
  --shadow-pink: 0 16px 42px rgba(185, 28, 98, 0.10);
  --control-bg: #ffffff;
  --control-bg-hover: #ffffff;
  --surface-2: #ffffff;
}

html[data-theme="light"] body,
html[data-theme="light"] html {
  background: var(--bg-0);
  color: var(--text-0);
}

html[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(rgba(80, 72, 58, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 72, 58, 0.055) 1px, transparent 1px);
}

html[data-theme="light"] .floating-back,
html[data-theme="light"] .support-fab,
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .privacy-toast,
html[data-theme="light"] .support-modal-card {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-0);
}

html[data-theme="light"] .mobile-dock a,
html[data-theme="light"] .floating-back,
html[data-theme="light"] .support-fab {
  color: var(--text-0);
}


/* Light theme should feel clean, not dusty. */
html[data-theme="light"] .bg-glow { opacity: 0.12; filter: blur(110px); }
html[data-theme="light"] .bg-grid {
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}
html[data-theme="light"] .nav { background: rgba(255, 255, 255, 0.82); }
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card {
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(15, 23, 42, 0.075);
}
html[data-theme="light"] .topic-card,
html[data-theme="light"] .case-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .station-grid div,
html[data-theme="light"] .info-card,
html[data-theme="light"] .subsite-types span,
html[data-theme="light"] .placeholder-note,
html[data-theme="light"] .subsite-status {
  background: #ffffff;
}
html[data-theme="light"] .topic-card:hover,
html[data-theme="light"] .case-card:hover,
html[data-theme="light"] .jump-btn:hover,
html[data-theme="light"] .subsite-card:hover {
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}
html[data-theme="light"] .portal-badge,
html[data-theme="light"] .hero-badge {
  background: #ffffff;
}
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .privacy-toast,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .search-results {
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .mobile-dock a { background: rgba(15, 23, 42, 0.035); }
html[data-theme="light"] .mobile-dock a.is-active { background: color-mix(in srgb, var(--cyan) 14%, #fff); color: var(--cyan); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.preference-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.preference-select {
  appearance: none;
  min-height: 36px;
  padding: 7px 30px 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--control-bg);
  color: var(--text-1);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.preference-select:hover,
.preference-select:focus-visible {
  background: var(--control-bg-hover);
  border-color: var(--border-strong);
  color: var(--text-0);
}

.preference-control::after {
  content: "⌄";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-55%);
  pointer-events: none;
  color: var(--text-2);
  font-size: 13px;
}

.preference-select option {
  color: #17140f;
  background: #fffaf0;
}

html[data-theme="dark"] .preference-select option,
:root:not([data-theme="light"]) .preference-select option {
  color: #fff;
  background: #111229;
}

.theme-quick {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--control-bg);
}

.theme-quick button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.theme-quick button:hover,
.theme-quick button:focus-visible,
.theme-quick button[aria-pressed="true"] {
  color: var(--text-0);
  background: var(--surface-strong);
}

.theme-quick button[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.mobile-preference-bar {
  display: none;
}

@media (max-width: 920px) {
  .nav-inner {
    gap: 10px;
  }
  .nav-tools {
    margin-left: auto;
  }
  .theme-quick {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    padding: 12px 16px;
  }
  .logo small {
    display: none;
  }
  .nav-tools {
    gap: 6px;
  }
  .preference-select {
    max-width: 84px;
    min-height: 34px;
    padding-left: 10px;
    padding-right: 24px;
    font-size: 12px;
  }
  .mobile-preference-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin: 14px auto 0;
    flex-wrap: wrap;
  }
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 商业级收尾：搜索、当前导航、移动端焦点 */
.quick-search-section { padding-top: 0; padding-bottom: 18px; }
.quick-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.quick-search b { display:block; color:var(--text-0); font-size: 16px; }
.quick-search span { color:var(--text-2); font-size: 13px; }
.search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-0);
  background: transparent;
  font: inherit;
  font-size: 15px;
}
.search-box input::placeholder { color: var(--text-3); }
.search-results {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(100% + 8px);
  z-index: 220;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: rgba(7,7,26,.96);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.search-result-item {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  color: var(--text-1);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover,
.search-result-item:focus-visible { background: rgba(6,214,240,.10); color: var(--text-0); }
.search-result-item span { color: var(--cyan); font-size: 12px; font-weight: 800; }
.search-result-item b { font-size: 15px; }
.search-result-item em { color: var(--text-2); font-style: normal; font-size: 13px; line-height: 1.45; }
.search-empty { padding: 16px; color: var(--text-2); font-size: 14px; }
.mobile-dock a.active,
.mobile-dock a[aria-current="page"] {
  color: var(--cyan);
  background: rgba(6,214,240,.16);
  box-shadow: inset 0 0 0 1px rgba(6,214,240,.22);
}
.nav-link.active,
.nav-link[aria-current="page"] {
  color: var(--cyan);
  background: rgba(6,214,240,.12);
}
html[data-theme="light"] .search-box { background: rgba(255,255,255,.76); }
html[data-theme="light"] .search-results { background: #ffffff; }
@media (max-width: 720px) {
  .quick-search { grid-template-columns: 1fr; padding: 14px; border-radius: 18px; }
  .search-results { left: 10px; right: 10px; }
  .search-result-item { padding: 12px; }
}

/* 栏目入口与签约作者卡 */
.subsite-actions { display:flex; gap:10px; flex-wrap:wrap; position:relative; z-index:2; }
.subsite-actions a { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:8px 12px; border-radius:999px; border:1px solid color-mix(in srgb, var(--topic-color) 42%, transparent); background:color-mix(in srgb, var(--topic-color) 9%, transparent); }
.subsite-actions a:first-child { color:var(--text-1); border-color:var(--border); background:rgba(255,255,255,.04); }
.subsite-card a::after { content:none; }
.column-entry-card { display:block; text-decoration:none; color:inherit; padding:18px; border-radius:18px; border:1px solid color-mix(in srgb, var(--topic-color, var(--cyan)) 48%, var(--border)); background:linear-gradient(135deg, color-mix(in srgb, var(--topic-color, var(--cyan)) 18%, transparent), rgba(255,255,255,.035)); margin-bottom:14px; transition:all .22s var(--ease); }
.column-entry-card:hover { transform:translateY(-2px); background:linear-gradient(135deg, color-mix(in srgb, var(--topic-color, var(--cyan)) 25%, transparent), rgba(255,255,255,.055)); }
.column-entry-card span { display:block; color:var(--topic-color, var(--cyan)); font-size:12px; font-weight:900; letter-spacing:.1em; margin-bottom:4px; }
.column-entry-card b { display:block; font-size:21px; margin-bottom:4px; }
.column-entry-card em { display:block; color:var(--text-1); font-style:normal; font-size:13px; }
.author-card { display:grid; grid-template-columns:54px 1fr; gap:14px; padding:16px; margin-bottom:22px; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,.035); }
.author-avatar { width:54px; height:54px; border-radius:16px; display:grid; place-items:center; font-weight:950; letter-spacing:.04em; color:#fff; background:linear-gradient(135deg, var(--topic-color, var(--cyan)), var(--violet)); box-shadow:0 12px 34px color-mix(in srgb, var(--topic-color, var(--cyan)) 24%, transparent); }
.author-kicker { display:block; color:var(--topic-color, var(--cyan)); font-size:11px; font-weight:900; letter-spacing:.12em; margin-bottom:2px; }
.author-card h3 { font-size:18px; margin:0 0 2px; }
.author-role { color:var(--text-2) !important; font-size:12px !important; margin-bottom:8px; }
.author-card p { color:var(--text-1); font-size:13px; line-height:1.7; margin:0 0 10px; }
.author-card dl { display:grid; gap:8px; margin:0; }
.author-card dt { color:var(--text-2); font-size:11px; font-weight:800; }
.author-card dd { color:var(--text-1); font-size:12px; line-height:1.5; margin:0; }
@media (max-width:520px){
  .subsite-actions { display:grid; grid-template-columns:1fr 1fr; }
  .subsite-actions a { width:100%; }
  .author-card { grid-template-columns:46px 1fr; padding:14px; }
  .author-avatar { width:46px; height:46px; border-radius:14px; font-size:13px; }
  .column-entry-card { padding:16px; }
}

/* Mobile overflow guard: application pages should never create horizontal swipes. */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }
img, svg, canvas, video, iframe { max-width: 100%; }
.container, .section, .nav-inner, .footer-inner, .topic-layout, .portal-hero, .topic-hero { min-width: 0; }
.card, .topic-panel, .jump-panel, .case-card, .topic-card, .subsite-card, .manager-card, .mascot-card { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 768px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .section { padding-left: 0; padding-right: 0; }
  .nav-inner { width: 100%; max-width: 100%; }
  .logo { min-width: 0; flex: 1 1 auto; }
  .logo b { display: block; max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-tools { flex: 0 0 auto; }
  .footer-inner { padding-left: 14px; padding-right: 14px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .portal-actions { width: 100%; }
  .portal-actions .btn { flex: 1 1 100%; justify-content: center; }
  .myth-stage-card { border-radius: 18px; min-height: auto; }
  .myth-stage-card canvas { min-height: 220px; height: auto; aspect-ratio: 5 / 3; }
  .myth-hotspots button { min-width: 42px; min-height: 30px; padding: 5px 8px; font-size: 12px; }
  .myth-stage-actions { position: static; padding: 10px; background: rgba(0,0,0,.18); }
  .myth-stage-actions .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .quiz-card-main { border-radius: 20px; padding: 18px; }
  .quiz-topline { flex-direction: column; gap: 4px; }
  .quiz-stats { grid-template-columns: 1fr; }
  .apparatus-wrap, .story-stage, .poetry-stage { max-width: 100%; }
}

@media (max-width: 480px) {
  .preference-select { max-width: 70px; }
  .logo b { max-width: 38vw; }
  .mobile-dock { left: 6px; right: 6px; padding: 6px; }
  .mobile-dock a { font-size: 11px; min-height: 40px; }
}

/* Column manager vertical timeline */
.manager-card { padding:16px; margin-bottom:22px; border:1px solid var(--border); border-radius:18px; background:rgba(255,255,255,.035); }
.manager-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:14px; }
.manager-card-head span { color:var(--topic-color, var(--cyan)); font-size:11px; font-weight:900; letter-spacing:.12em; }
.manager-card-head b { font-size:14px; color:var(--text-1); }
.manager-timeline { position:relative; display:grid; gap:14px; }
.manager-timeline::before { content:""; position:absolute; left:8px; top:8px; bottom:8px; width:2px; border-radius:999px; background:linear-gradient(180deg, var(--topic-color, var(--cyan)), rgba(255,255,255,.12)); }
.manager-item { position:relative; display:grid; grid-template-columns:20px 1fr; gap:10px; }
.manager-time { grid-column:2; color:var(--text-2); font-size:12px; font-weight:800; }
.manager-dot { position:absolute; left:1px; top:27px; width:16px; height:16px; border-radius:50%; border:3px solid var(--bg-0); background:var(--text-3); box-shadow:0 0 0 1px var(--border); }
.manager-item.is-current .manager-dot { background:var(--topic-color, var(--cyan)); box-shadow:0 0 0 4px color-mix(in srgb, var(--topic-color, var(--cyan)) 20%, transparent); }
.manager-body { grid-column:2; display:grid; grid-template-columns:44px 1fr; gap:10px; padding:12px; border-radius:16px; border:1px solid var(--border); background:rgba(255,255,255,.04); }
.manager-item.is-current .manager-body { border-color:color-mix(in srgb, var(--topic-color, var(--cyan)) 45%, var(--border)); background:linear-gradient(135deg, color-mix(in srgb, var(--topic-color, var(--cyan)) 12%, transparent), rgba(255,255,255,.035)); }
.manager-avatar { width:42px; height:42px; border-radius:14px; display:grid; place-items:center; color:#fff; font-weight:950; background:linear-gradient(135deg, var(--topic-color, var(--cyan)), var(--violet)); }
.manager-item.is-past .manager-avatar { filter:grayscale(.75); opacity:.72; }
.manager-body h3 { font-size:16px; margin:0 0 2px; }
.manager-role { color:var(--text-2) !important; font-size:12px !important; margin:0 0 6px !important; }
.manager-body p { color:var(--text-1); font-size:13px; line-height:1.65; margin:0; }

/* Disabled / unconfigured column links */
.btn.is-disabled,
button.inline-disabled,
.column-entry-card.is-disabled,
.subsite-card.is-disabled {
  cursor: not-allowed;
  filter: grayscale(.42);
  opacity: .68;
}
.btn.is-disabled,
button.inline-disabled {
  color: var(--text-2) !important;
  background: color-mix(in srgb, var(--surface-2) 82%, transparent) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}
button.inline-disabled {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  font:inherit;
  font-size:13px;
  font-weight:900;
}
.column-entry-card.is-disabled {
  border-color: var(--border);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
}
.column-entry-card.is-disabled span,
.column-entry-card.is-disabled em,
.subsite-card.is-disabled .subsite-status { color: var(--text-2); }
.subsite-card-link { position:absolute; inset:0; z-index:1; border-radius:inherit; }
.subsite-link-card { position:relative; }
.subsite-link-card > *:not(.subsite-card-link) { position:relative; z-index:2; }

/* Friendly 404 */
.error-wrap { min-height: calc(100vh - 190px); display:grid; place-items:center; padding-top:56px; padding-bottom:56px; }
.error-card { width:min(860px,100%); text-align:center; padding:42px 28px; border:1px solid var(--border-strong); border-radius:34px; background:linear-gradient(145deg, rgba(6,214,240,.10), rgba(139,92,246,.10)), var(--surface); box-shadow:var(--shadow); overflow:hidden; position:relative; }
.error-card h1 { font-size:clamp(34px,7vw,74px); line-height:1.02; margin:12px 0 14px; }
.error-card p:not(.portal-badge) { max-width:680px; margin:0 auto 20px; color:var(--text-1); font-size:17px; line-height:1.85; }
.error-orbit { width:154px; height:154px; margin:0 auto 20px; border-radius:50%; border:1px solid color-mix(in srgb, var(--cyan) 36%, transparent); display:grid; place-items:center; position:relative; background:radial-gradient(circle, rgba(6,214,240,.18), transparent 62%); }
.error-orbit span { font-size:68px; font-weight:950; color:var(--cyan); text-shadow:0 0 34px rgba(6,214,240,.45); }
.error-orbit i { position:absolute; width:12px; height:12px; border-radius:50%; background:var(--cyan); box-shadow:0 0 18px rgba(6,214,240,.7); animation:error-orbit 8s linear infinite; transform-origin:0 0; }
.error-orbit i:nth-child(2) { animation-duration:11s; background:var(--violet); }
.error-orbit i:nth-child(3) { animation-duration:14s; background:var(--amber); }
@keyframes error-orbit { from { transform: rotate(0deg) translateX(76px); } to { transform: rotate(360deg) translateX(76px); } }
.error-shortcuts { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:22px; }
.error-shortcuts a { padding:10px 14px; border:1px solid var(--border); border-radius:999px; background:rgba(255,255,255,.045); color:var(--text-1); text-decoration:none; font-weight:900; }
.error-shortcuts a:hover { border-color:var(--cyan); color:var(--text-0); background:rgba(6,214,240,.12); }
@media (max-width:560px){ .error-card { border-radius:24px; padding:30px 18px; } .error-orbit { width:118px; height:118px; } .error-orbit span { font-size:52px; } @keyframes error-orbit { from { transform: rotate(0deg) translateX(58px); } to { transform: rotate(360deg) translateX(58px); } } }

/* Page share: QR + link copy */
.share-nav-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-1);
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.share-nav-button:hover { color: var(--text-0); border-color: color-mix(in srgb, var(--cyan) 48%, var(--border)); background: color-mix(in srgb, var(--cyan) 12%, var(--surface-2)); }
.share-nav-button span { color: var(--cyan); font-weight: 950; }
.share-fab {
  position: fixed;
  right: 20px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 230;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--border));
  border-radius: 999px;
  color: var(--text-0);
  background: linear-gradient(135deg, color-mix(in srgb, var(--cyan) 18%, var(--surface)), color-mix(in srgb, var(--violet) 12%, var(--surface)));
  box-shadow: 0 12px 36px rgba(0,0,0,.32);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
}
.share-fab span { color: var(--cyan); font-size: 16px; }
.share-panel { position: fixed; inset: 0; z-index: 360; display: none; }
.share-panel.is-open { display: block; }
.share-panel__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.share-panel__card {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border-strong);
  border-radius: 26px;
  color: var(--text-0);
  background: linear-gradient(145deg, color-mix(in srgb, var(--cyan) 9%, transparent), color-mix(in srgb, var(--violet) 8%, transparent)), var(--surface);
  box-shadow: var(--shadow);
}
.share-panel__close {
  position: absolute;
  right: 14px; top: 12px;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-1);
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  font-size: 20px;
  cursor: pointer;
}
.share-panel__head { display: flex; gap: 12px; align-items: flex-start; padding-right: 34px; }
.share-panel__mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: #041018;
  background: var(--grad-cool);
  font-size: 20px;
  font-weight: 950;
  flex: 0 0 auto;
}
.share-panel__head h2 { margin: 0 0 6px; font-size: 24px; }
.share-panel__head p { margin: 0; color: var(--text-1); line-height: 1.65; font-size: 14px; }
.share-qr { width: min(272px, 76vw); margin: 20px auto 16px; padding: 12px; border-radius: 22px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.share-qr__svg { display: block; width: 100%; height: auto; }
.share-url { display: grid; gap: 8px; margin-top: 10px; color: var(--text-2); font-size: 12px; font-weight: 900; }
.share-url input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-0);
  background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  font: inherit;
  font-size: 13px;
}
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.share-actions .btn { justify-content: center; width: 100%; }
.share-hint { margin: 12px 0 0; color: var(--text-2); font-size: 12px; line-height: 1.6; text-align: center; }
html[data-theme="light"] .share-nav-button,
html[data-theme="light"] .share-fab,
html[data-theme="light"] .share-panel__card { background: rgba(255,255,255,.94); box-shadow: 0 14px 40px rgba(15,23,42,.12); }
html[data-theme="light"] .share-url input,
html[data-theme="light"] .share-panel__close { background: #ffffff; }
@media (max-width: 760px) {
  .share-nav-button em { display: none; }
  .share-nav-button { padding: 7px 9px; }
  .share-fab { right: 12px; bottom: calc(136px + env(safe-area-inset-bottom)); }
  .share-fab em { display: none; }
}
@media (max-width: 460px) {
  .share-panel__card { padding: 18px; border-radius: 22px; }
  .share-actions { grid-template-columns: 1fr; }
  .share-qr { width: min(250px, 78vw); }
}

/* Light theme final reset: keep it actually white, not grey/dusty. */
html[data-theme="light"],
html[data-theme="light"] body {
  background: #ffffff !important;
}
html[data-theme="light"] .bg-grid,
html[data-theme="light"] .bg-glow {
  opacity: 0 !important;
  display: none !important;
}
html[data-theme="light"] .nav,
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card,
html[data-theme="light"] .topic-card,
html[data-theme="light"] .case-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .station-grid div,
html[data-theme="light"] .info-card,
html[data-theme="light"] .subsite-types span,
html[data-theme="light"] .placeholder-note,
html[data-theme="light"] .subsite-status,
html[data-theme="light"] .manager-card,
html[data-theme="light"] .share-nav-button,
html[data-theme="light"] .share-fab,
html[data-theme="light"] .share-panel__card,
html[data-theme="light"] .share-url input,
html[data-theme="light"] .share-panel__close,
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .privacy-toast,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .search-box,
html[data-theme="light"] .search-results {
  background: #ffffff !important;
}
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card,
html[data-theme="light"] .topic-card,
html[data-theme="light"] .case-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .info-card,
html[data-theme="light"] .manager-card {
  border-color: rgba(17, 24, 39, 0.10) !important;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.055) !important;
}
html[data-theme="light"] .topic-card:hover,
html[data-theme="light"] .case-card:hover,
html[data-theme="light"] .jump-btn:hover,
html[data-theme="light"] .subsite-card:hover {
  background: #ffffff !important;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.08) !important;
}
html[data-theme="light"] .mobile-dock a {
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, 0.08);
}
html[data-theme="light"] .mobile-dock a.is-active {
  background: #eefcff !important;
  color: var(--cyan);
}

/* SigmAgent.org mascot system */
.portal-hero--with-mascot,
.topic-hero--with-mascot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
}
.portal-hero-copy,
.topic-hero-copy { min-width: 0; }
.mascot-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 32px;
  color: var(--text-0);
  background: linear-gradient(145deg, color-mix(in srgb, var(--topic-color, var(--cyan)) 13%, transparent), color-mix(in srgb, var(--violet) 10%, transparent)), var(--surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  isolation: isolate;
}
.mascot-card::before {
  content: '';
  position: absolute;
  inset: -45% -35% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--topic-color, var(--cyan)) 22%, transparent);
  filter: blur(22px);
  z-index: -1;
}
.mascot-card img {
  width: min(220px, 54vw);
  aspect-ratio: 1;
  display: block;
  border-radius: 28px;
  filter: drop-shadow(0 22px 34px rgba(0,0,0,.28));
  transform-origin: 50% 68%;
  animation: mascotFloat 5.6s ease-in-out infinite;
}
.mascot-card figcaption {
  display: grid;
  gap: 5px;
  text-align: center;
  max-width: 260px;
}
.mascot-card figcaption span {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mascot-card figcaption b {
  color: var(--text-0);
  font-size: 18px;
  font-weight: 950;
}
.mascot-card figcaption em {
  color: var(--text-1);
  font-style: normal;
  font-size: 13px;
  line-height: 1.55;
}
.mascot-orbit {
  position: absolute;
  inset: 18px;
  border: 1px dashed color-mix(in srgb, var(--topic-color, var(--cyan)) 38%, transparent);
  border-radius: 30px;
  opacity: .52;
  pointer-events: none;
}
.mascot-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.mascot-grid .mascot-card {
  padding: 14px 12px;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}
.mascot-grid .mascot-card img { width: min(128px, 34vw); border-radius: 22px; }
.mascot-grid .mascot-card figcaption b { font-size: 15px; }
.mascot-grid .mascot-card figcaption em { display: none; }
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
html[data-theme="light"] .mascot-card {
  background: #ffffff !important;
  border-color: rgba(17,24,39,.10) !important;
  box-shadow: 0 12px 30px rgba(17,24,39,.07) !important;
}
html[data-theme="light"] .mascot-card::before { opacity: .45; filter: blur(28px); }
html[data-theme="light"] .mascot-card img { filter: drop-shadow(0 18px 26px rgba(17,24,39,.12)); }
@media (max-width: 1100px) {
  .mascot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .portal-hero--with-mascot,
  .topic-hero--with-mascot { grid-template-columns: 1fr; }
  .portal-hero--with-mascot .mascot-card,
  .topic-hero--with-mascot .mascot-card { max-width: 360px; justify-self: center; width: 100%; }
  .mascot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .mascot-system { margin-top: 8px; }
  .mascot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mascot-grid .mascot-card { padding: 10px 8px; border-radius: 20px; }
  .mascot-grid .mascot-card img { width: 104px; }
  .mascot-card figcaption span { font-size: 10px; }
  .mascot-card figcaption b { font-size: 14px; }
  .mascot-card figcaption em { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-card img { animation: none; }
}

/* ===== SigmAgent 主导航图片 ===== */
.subsite-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 14px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s var(--ease);
}
.subsite-card:hover .subsite-thumb {
  transform: scale(1.08) rotate(-2deg);
}

.mascot-card img {
  width: 100%;
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

/* ===== Mascot layout refinement: keep mascots as brand accents, not layout rulers ===== */
.portal-hero--with-mascot,
.topic-hero--with-mascot {
  grid-template-columns: minmax(0, 1fr) clamp(210px, 24vw, 292px) !important;
  gap: clamp(24px, 4vw, 48px) !important;
  align-items: center !important;
}
.portal-hero--with-mascot {
  text-align: left !important;
  padding-top: clamp(56px, 8vw, 88px) !important;
}
.portal-hero--with-mascot .portal-subtitle,
.topic-hero--with-mascot .portal-subtitle {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 760px;
}
.portal-hero--with-mascot .portal-actions,
.topic-hero--with-mascot .portal-actions {
  justify-content: flex-start !important;
}
.portal-hero--with-mascot .portal-stats {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 720px;
}
.portal-hero--with-mascot > .mascot-card,
.topic-hero--with-mascot > .mascot-card {
  width: 100%;
  max-width: 292px;
  justify-self: end;
  align-self: center;
  padding: 16px;
  border-radius: 26px;
  min-height: auto;
}
.portal-hero--with-mascot > .mascot-card img,
.topic-hero--with-mascot > .mascot-card img {
  width: clamp(132px, 16vw, 178px) !important;
  height: clamp(132px, 16vw, 178px) !important;
  object-fit: contain !important;
  border-radius: 22px;
}
.portal-hero--with-mascot > .mascot-card figcaption,
.topic-hero--with-mascot > .mascot-card figcaption {
  max-width: 220px;
  gap: 3px;
}
.portal-hero--with-mascot > .mascot-card figcaption span,
.topic-hero--with-mascot > .mascot-card figcaption span {
  font-size: 10px;
}
.portal-hero--with-mascot > .mascot-card figcaption b,
.topic-hero--with-mascot > .mascot-card figcaption b {
  font-size: 15px;
}
.portal-hero--with-mascot > .mascot-card figcaption em,
.topic-hero--with-mascot > .mascot-card figcaption em {
  font-size: 12px;
  line-height: 1.45;
}
.mascot-card img {
  object-fit: contain !important;
  background: transparent !important;
}
.mascot-system {
  padding-top: 34px !important;
}
.mascot-system .section-header {
  margin-bottom: 22px;
}
.mascot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch;
}
.mascot-grid .mascot-card {
  grid-template-columns: 72px minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  text-align: left;
  gap: 12px;
  min-height: 112px;
  padding: 14px !important;
}
.mascot-grid .mascot-card .mascot-orbit {
  display: none;
}
.mascot-grid .mascot-card img {
  width: 72px !important;
  height: 72px !important;
  border-radius: 18px !important;
}
.mascot-grid .mascot-card figcaption {
  text-align: left;
  max-width: none;
  gap: 2px;
}
.mascot-grid .mascot-card figcaption span {
  font-size: 10px;
  white-space: nowrap;
}
.mascot-grid .mascot-card figcaption b {
  font-size: 15px !important;
}
.mascot-grid .mascot-card figcaption em {
  display: block !important;
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.subsite-head {
  min-height: 58px;
}
.subsite-thumb,
.subsite-head img.subsite-thumb {
  flex: 0 0 50px;
  width: 50px !important;
  height: 50px !important;
  object-fit: contain !important;
  border-radius: 14px;
}
.subsite-head > span {
  flex: 0 0 46px;
}

@media (max-width: 980px) {
  .portal-hero--with-mascot,
  .topic-hero--with-mascot {
    grid-template-columns: 1fr !important;
  }
  .portal-hero--with-mascot > .mascot-card,
  .topic-hero--with-mascot > .mascot-card {
    justify-self: stretch !important;
    max-width: none !important;
    grid-template-columns: 84px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    padding: 14px 16px;
  }
  .portal-hero--with-mascot > .mascot-card img,
  .topic-hero--with-mascot > .mascot-card img {
    width: 84px !important;
    height: 84px !important;
  }
  .portal-hero--with-mascot > .mascot-card figcaption,
  .topic-hero--with-mascot > .mascot-card figcaption {
    text-align: left;
    max-width: none;
  }
  .portal-hero--with-mascot > .mascot-card .mascot-orbit,
  .topic-hero--with-mascot > .mascot-card .mascot-orbit {
    display: none;
  }
  .mascot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 620px) {
  .portal-hero--with-mascot {
    padding-top: 34px !important;
  }
  .portal-title {
    letter-spacing: -0.04em;
  }
  .portal-hero--with-mascot > .mascot-card,
  .topic-hero--with-mascot > .mascot-card {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    border-radius: 20px;
  }
  .portal-hero--with-mascot > .mascot-card img,
  .topic-hero--with-mascot > .mascot-card img {
    width: 62px !important;
    height: 62px !important;
    border-radius: 16px;
  }
  .portal-hero--with-mascot > .mascot-card figcaption em,
  .topic-hero--with-mascot > .mascot-card figcaption em {
    display: none;
  }
  .mascot-system {
    padding-top: 18px !important;
  }
  .mascot-grid {
    grid-template-columns: 1fr !important;
  }
  .mascot-grid .mascot-card {
    grid-template-columns: 56px minmax(0, 1fr);
    min-height: 82px;
    padding: 10px 12px !important;
  }
  .mascot-grid .mascot-card img {
    width: 56px !important;
    height: 56px !important;
    border-radius: 14px !important;
  }
  .mascot-grid .mascot-card figcaption em {
    display: none !important;
  }
}

/* ===== 分类页 (categories) 公仔图 ===== */
.category-head-mascot {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: transform 0.3s var(--ease);
}
.category-section[open] .category-head-mascot,
.category-head-mascot:hover {
  transform: scale(1.08) rotate(-2deg);
}
.category-head-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.category-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ===== 层级引导 mascot 装饰 ===== */
.hierarchy-mascot {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: floatY 4s ease-in-out infinite;
}
.hierarchy-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== 搜索 mascot 装饰 ===== */
.quick-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.quick-search-mascot {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: floatY 5s ease-in-out infinite 0.5s;
}
.quick-search-mascot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 600px) {
  .quick-search-mascot { display: none; }
}


/* === SigmAgent commercial audit hardening: 2026-06-05 === */
/* Public portal only: keep mobile pages stable, clean and hierarchy-first. */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}
body.sigmagent-page { background: var(--bg-0); }
img, svg, canvas, video, iframe { max-width: 100%; }
.nav, .container, main, section, .portal-shell, .topic-layout, .topic-hero, .portal-hero,
.subsite-grid, .topic-grid, .mascot-grid, .station-grid, .share-panel__card,
.privacy-toast, .support-modal-card, .search-results { min-width: 0; }
.nav-inner, .logo, .nav-tools, .nav-links { min-width: 0; }
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Light theme should be actual white, not gray/dusty. */
html[data-theme="light"], html[data-theme="light"] body { background: #ffffff !important; }
html[data-theme="light"] .bg-grid, html[data-theme="light"] .bg-glow { display: none !important; }
html[data-theme="light"] .nav,
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card,
html[data-theme="light"] .topic-card,
html[data-theme="light"] .case-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .station-grid div,
html[data-theme="light"] .info-card,
html[data-theme="light"] .subsite-types span,
html[data-theme="light"] .placeholder-note,
html[data-theme="light"] .subsite-status,
html[data-theme="light"] .manager-card,
html[data-theme="light"] .manager-body,
html[data-theme="light"] .share-nav-button,
html[data-theme="light"] .share-fab,
html[data-theme="light"] .share-panel__card,
html[data-theme="light"] .share-url input,
html[data-theme="light"] .share-panel__close,
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .privacy-toast,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .search-box,
html[data-theme="light"] .search-results,
html[data-theme="light"] .mascot-card,
html[data-theme="light"] .mascot-hero-card { background: #ffffff !important; }
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card,
html[data-theme="light"] .manager-card,
html[data-theme="light"] .mascot-card,
html[data-theme="light"] .mascot-hero-card { box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06) !important; }
html[data-theme="light"] .topic-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .info-card,
html[data-theme="light"] .manager-body,
html[data-theme="light"] .subsite-types span { box-shadow: none !important; }
/* Disabled column entries must read as disabled, not as broken links. */
a[aria-disabled="true"], .is-disabled, .btn-disabled, .disabled-link {
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: .58;
  filter: grayscale(.25);
}
/* Mobile: prevent control clusters and mascot blocks from creating side-scroll. */
@media (max-width: 720px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .nav-inner { padding-left: 14px; padding-right: 14px; gap: 10px; }
  .nav-tools { flex-shrink: 0; gap: 6px; }
  .preference-select { max-width: 88px; }
  .share-nav-button { flex-shrink: 0; }
  .portal-hero, .topic-hero { overflow: hidden; }
  .mascot-card, .mascot-hero-card { width: 100%; max-width: 100%; }
  .mobile-dock { box-sizing: border-box; max-width: calc(100vw - 16px); }
  .share-panel__card { width: min(440px, calc(100vw - 28px)); }
  .share-qr { width: min(240px, 74vw); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}


/* ===== 无障碍 ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  padding: 10px 18px;
  background: var(--cyan);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}


/* ===== 本设备备份与恢复 ===== */
.backup-fab {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 75;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow);
  cursor: pointer;
  backdrop-filter: blur(14px);
}
.backup-fab:hover { transform: translateY(-2px); border-color: var(--cyan); }
.backup-panel {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.backup-panel.is-open { display: flex; }
.backup-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(10px);
}
.backup-panel__card {
  position: relative;
  width: min(560px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  padding: 26px;
}
.backup-panel__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.backup-panel__mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #06111b;
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 14px;
}
.backup-panel h2 { margin: 0 0 8px; }
.backup-panel p { color: var(--muted); line-height: 1.7; }
.backup-field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: var(--text);
  font-weight: 700;
}
.backup-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}
.backup-field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(6,214,240,.14); }
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.backup-import-label input { display: none; }
.backup-preview {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  padding: 14px;
  margin-top: 14px;
}
.backup-preview b,
.backup-preview span,
.backup-preview small { display: block; }
.backup-preview span { color: var(--muted); margin-top: 4px; }
.backup-preview small { color: var(--muted); margin-top: 10px; line-height: 1.6; word-break: break-all; }
.backup-panel__hint { font-size: 13px; }
.backup-status {
  min-height: 24px;
  font-weight: 800;
}
.backup-status[data-tone="ok"] { color: var(--green); }
.backup-status[data-tone="error"] { color: var(--pink); }
html[data-theme="light"] .backup-fab,
html[data-theme="light"] .backup-panel__card,
html[data-theme="light"] .backup-field input,
html[data-theme="light"] .backup-preview,
html[data-theme="light"] .backup-panel__close { background: #ffffff !important; }
@media (max-width: 720px) {
  .backup-fab {
    right: auto;
    left: 12px;
    bottom: 148px;
    padding: 9px 12px;
    font-size: 13px;
  }
  .backup-panel { padding: 14px; align-items: flex-end; }
  .backup-panel__card { max-height: calc(100vh - 28px); border-radius: 24px; padding: 22px 18px; }
  .backup-actions .btn,
  .backup-import-label { width: 100%; justify-content: center; box-sizing: border-box; }
}


/* ===== 2026-06-05 commercial polish: mobile action stack + cleaner tap behavior ===== */
a, button, select, summary { -webkit-tap-highlight-color: rgba(6, 214, 240, 0.16); }
button, select, a { touch-action: manipulation; }
.btn:focus-visible, .nav-link:focus-visible, .topic-card:focus-visible, .subsite-card:focus-visible,
.share-nav-button:focus-visible, .share-fab:focus-visible, .backup-fab:focus-visible,
.support-fab__main:focus-visible, .support-fab__hide:focus-visible, .preference-select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 62%, transparent);
  outline-offset: 3px;
}
.support-fab { bottom: calc(18px + env(safe-area-inset-bottom)); }
.share-fab { bottom: calc(88px + env(safe-area-inset-bottom)); }
.backup-fab { bottom: calc(158px + env(safe-area-inset-bottom)); }
.privacy-notice { bottom: calc(18px + env(safe-area-inset-bottom)); }
@media (max-width: 920px) {
  .support-fab { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .share-fab { right: 12px; bottom: calc(132px + env(safe-area-inset-bottom)); }
  .backup-fab { right: 12px; left: auto; bottom: calc(188px + env(safe-area-inset-bottom)); }
  .privacy-notice { bottom: calc(78px + env(safe-area-inset-bottom)); }
  .floating-back { display: none; }
}
@media (max-width: 520px) {
  .support-fab__main { min-width: 44px; height: 44px; padding: 0 10px; }
  .share-fab, .backup-fab { min-width: 44px; min-height: 44px; border-radius: 999px; padding: 0 11px; }
  .backup-fab { font-size: 0; }
  .backup-fab::before { content: '↧'; font-size: 18px; }
}
html[data-theme="light"] .support-fab,
html[data-theme="light"] .support-fab__main,
html[data-theme="light"] .support-fab__hide,
html[data-theme="light"] .backup-fab,
html[data-theme="light"] .share-fab,
html[data-theme="light"] .privacy-notice {
  background: #ffffff !important;
  color: var(--text-0) !important;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.10) !important;
}
html[data-theme="light"] .support-fab__main { border-color: rgba(17, 24, 39, 0.12); }


/* ===== 2026-06-05 token compatibility aliases ===== */
:root {
  --text: var(--text-0);
  --muted: var(--text-2);
  --purple: var(--violet);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}
html[data-theme="light"] {
  --text: var(--text-0);
  --muted: var(--text-2);
  --purple: var(--violet);
  --shadow: 0 14px 38px rgba(17, 24, 39, 0.10);
}

/* === 2026-06-05 hero layout correction: mascot must not steal layout space === */
.portal-hero--with-mascot {
  display: block !important;
  text-align: left !important;
  max-width: var(--container, 1180px);
}
.portal-hero-copy {
  width: 100% !important;
  max-width: 980px !important;
}
.portal-hero--with-mascot .portal-title,
.portal-hero--with-mascot .portal-subtitle,
.portal-hero--with-mascot .portal-actions,
.portal-hero--with-mascot .portal-stats {
  max-width: 980px !important;
}
.portal-hero--with-mascot > .mascot-card--core,
.hierarchy-mascot {
  display: none !important;
}
.portal-hero .portal-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* 公仔区只作为后续品牌辅助，不参与首屏重心。 */
.mascot-system {
  margin-top: 0 !important;
  padding-top: 8px !important;
}
@media (min-width: 1100px) {
  .portal-hero-copy { max-width: 1040px !important; }
  .portal-title { max-width: 1080px; }
  .portal-subtitle { max-width: 760px !important; }
}
@media (max-width: 760px) {
  .portal-hero .portal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Topic pages follow the same rule: mascot is a brand accent, not a hero column. */
.topic-hero--with-mascot {
  display: block !important;
  text-align: left !important;
}
.topic-hero-copy {
  width: 100% !important;
  max-width: 980px !important;
}
.topic-hero--with-mascot > .mascot-card {
  display: none !important;
}

/* === 2026-06-05 hero balance correction: no right-side void after mascot removal === */
.portal-hero--with-mascot,
.portal-hero {
  text-align: center !important;
}
.portal-hero--with-mascot {
  max-width: 1280px !important;
}
.portal-hero-copy {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 1080px !important;
}
.portal-hero--with-mascot .portal-title,
.portal-hero--with-mascot .portal-subtitle,
.portal-hero--with-mascot .portal-actions,
.portal-hero--with-mascot .portal-stats {
  margin-left: auto !important;
  margin-right: auto !important;
}
.portal-hero--with-mascot .portal-title {
  max-width: 1120px !important;
}
.portal-hero--with-mascot .portal-subtitle {
  max-width: 820px !important;
}
.portal-hero--with-mascot .portal-actions {
  justify-content: center !important;
}
.portal-hero--with-mascot .portal-stats {
  max-width: 880px !important;
}
@media (min-width: 1280px) {
  .portal-hero {
    padding-top: 96px;
    padding-bottom: 64px;
  }
}
@media (max-width: 760px) {
  .portal-hero--with-mascot,
  .portal-hero {
    text-align: left !important;
  }
  .portal-hero-copy,
  .portal-hero--with-mascot .portal-title,
  .portal-hero--with-mascot .portal-subtitle,
  .portal-hero--with-mascot .portal-actions,
  .portal-hero--with-mascot .portal-stats {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .portal-hero--with-mascot .portal-actions {
    justify-content: stretch !important;
  }
}

/* === 2026-06-05 FINAL desktop hero centering fix ===
   The homepage hero no longer has a right visual column. Make the hero a true
   centered composition, independent from older mascot/grid/container rules. */
@media (min-width: 761px) {
  body.sigmagent-page > header.portal-hero.container {
    width: min(100%, 1280px) !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(28px, 5vw, 72px) !important;
    padding-right: clamp(28px, 5vw, 72px) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }
  body.sigmagent-page > header.portal-hero.container > .portal-hero-copy {
    width: min(100%, 1080px) !important;
    max-width: 1080px !important;
    margin-inline: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  body.sigmagent-page > header.portal-hero.container .portal-badge,
  body.sigmagent-page > header.portal-hero.container .portal-title,
  body.sigmagent-page > header.portal-hero.container .portal-subtitle,
  body.sigmagent-page > header.portal-hero.container .portal-actions,
  body.sigmagent-page > header.portal-hero.container .portal-stats {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body.sigmagent-page > header.portal-hero.container .portal-title {
    max-width: 1120px !important;
    text-align: center !important;
  }
  body.sigmagent-page > header.portal-hero.container .portal-subtitle {
    max-width: 840px !important;
    text-align: center !important;
  }
  body.sigmagent-page > header.portal-hero.container .portal-actions {
    width: 100% !important;
    justify-content: center !important;
  }
  body.sigmagent-page > header.portal-hero.container .portal-stats {
    width: min(100%, 880px) !important;
    justify-self: center !important;
  }
}


/* === 20260605 nav stability + locale behavior fix ===
   Preference controls must not resize the top bar when theme/language text changes. */
.nav {
  min-height: 72px;
}
.nav-inner {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.logo {
  min-width: 0;
  max-width: 280px;
  overflow: hidden;
}
.logo b,
.logo small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-links {
  min-width: 0;
  justify-content: center;
  overflow: hidden;
}
.nav-tools {
  width: 318px;
  justify-content: flex-end;
  margin-left: 0;
  flex-shrink: 0;
}
.preference-control {
  flex: 0 0 auto;
}
.preference-select {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  text-align: left;
}
[data-locale-select].preference-select {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}
[data-theme-select].preference-select {
  width: 86px;
  min-width: 86px;
  max-width: 86px;
}
.theme-quick {
  flex: 0 0 auto;
}

@media (max-width: 1080px) {
  .nav-inner {
    grid-template-columns: minmax(160px, 1fr) auto;
  }
  .nav-links {
    display: none;
  }
  .nav-tools {
    width: 274px;
  }
  .theme-quick {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav { min-height: 60px; }
  .nav-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 12px;
  }
  .logo {
    max-width: none;
  }
  .logo-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .nav-tools {
    width: 148px;
    gap: 4px;
  }
  .preference-select,
  [data-locale-select].preference-select,
  [data-theme-select].preference-select {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    height: 34px;
    padding-left: 8px;
    padding-right: 21px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .nav-tools { width: 116px; }
  [data-theme-select].preference-select { display: none; }
}

/* === 20260606 topbar share compact + no-overlap fix ===
   Share in the desktop top bar is an icon action, not a primary nav item. */
.nav-inner {
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr) 360px !important;
}
.nav-tools {
  width: 360px !important;
  min-width: 360px !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}
.nav-links {
  overflow: hidden !important;
  white-space: nowrap !important;
}
.nav-link {
  flex: 0 0 auto;
}
.share-nav-button {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  justify-content: center !important;
  gap: 0 !important;
  flex: 0 0 36px !important;
  border-radius: 999px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
.share-nav-button span {
  display: block !important;
  font-size: 17px !important;
  line-height: 1 !important;
}
.share-nav-button em {
  display: none !important;
}
@media (max-width: 1180px) {
  .nav-inner {
    grid-template-columns: minmax(160px, 1fr) auto !important;
  }
  .nav-links { display: none !important; }
  .nav-tools {
    width: 360px !important;
    min-width: 360px !important;
  }
}
@media (max-width: 768px) {
  .nav-tools {
    width: 184px !important;
    min-width: 184px !important;
  }
  .share-nav-button {
    display: none !important;
  }
}
@media (max-width: 420px) {
  .nav-tools {
    width: 148px !important;
    min-width: 148px !important;
  }
}
@media (max-width: 380px) {
  .nav-tools {
    width: 116px !important;
    min-width: 116px !important;
  }
}


/* === 20260606 true white light theme final guard === */
html[data-theme="light"] {
  color-scheme: light !important;
  --bg-0: #ffffff !important;
  --bg-1: #ffffff !important;
  --surface: #ffffff !important;
  --surface-strong: #ffffff !important;
  --surface-2: #ffffff !important;
  --control-bg: #ffffff !important;
  --control-bg-hover: #ffffff !important;
  --text-0: #111827 !important;
  --text-1: #334155 !important;
  --text-2: #64748b !important;
  --text-3: #94a3b8 !important;
  --border: rgba(17, 24, 39, 0.10) !important;
  --border-strong: rgba(17, 24, 39, 0.16) !important;
}
html[data-theme="light"],
html[data-theme="light"] body,
html[data-theme="light"] main,
html[data-theme="light"] .sigmagent-page {
  background: #ffffff !important;
  color: #111827 !important;
}
html[data-theme="light"] body::before,
html[data-theme="light"] body::after,
html[data-theme="light"] .bg-grid,
html[data-theme="light"] .bg-glow {
  display: none !important;
  opacity: 0 !important;
  background: none !important;
}
html[data-theme="light"] .nav,
html[data-theme="light"] .card,
html[data-theme="light"] .subsite-card,
html[data-theme="light"] .category-section,
html[data-theme="light"] .station-panel,
html[data-theme="light"] .topic-panel,
html[data-theme="light"] .jump-panel,
html[data-theme="light"] .quick-search,
html[data-theme="light"] .hierarchy-card,
html[data-theme="light"] .topic-card,
html[data-theme="light"] .case-card,
html[data-theme="light"] .jump-btn,
html[data-theme="light"] .station-grid div,
html[data-theme="light"] .info-card,
html[data-theme="light"] .subsite-types span,
html[data-theme="light"] .placeholder-note,
html[data-theme="light"] .subsite-status,
html[data-theme="light"] .manager-card,
html[data-theme="light"] .manager-body,
html[data-theme="light"] .share-nav-button,
html[data-theme="light"] .share-fab,
html[data-theme="light"] .share-panel__card,
html[data-theme="light"] .share-url input,
html[data-theme="light"] .share-panel__close,
html[data-theme="light"] .backup-fab,
html[data-theme="light"] .backup-panel__card,
html[data-theme="light"] .backup-field input,
html[data-theme="light"] .backup-preview,
html[data-theme="light"] .backup-panel__close,
html[data-theme="light"] .mobile-dock,
html[data-theme="light"] .privacy-toast,
html[data-theme="light"] .privacy-notice,
html[data-theme="light"] .support-fab,
html[data-theme="light"] .support-fab__main,
html[data-theme="light"] .support-fab__hide,
html[data-theme="light"] .support-modal-card,
html[data-theme="light"] .search-box,
html[data-theme="light"] .search-results,
html[data-theme="light"] .mascot-card,
html[data-theme="light"] .mascot-hero-card {
  background-color: #ffffff !important;
}
html[data-theme="light"] .tag,
html[data-theme="light"] .portal-badge,
html[data-theme="light"] .hero-badge,
html[data-theme="light"] .mobile-dock a,
html[data-theme="light"] .mobile-dock a.is-active {
  background-color: #ffffff !important;
}

/* === 20260606 unified floating tools: support/coffee stays separate, tools collapse into one FAB === */
.share-fab,
.backup-fab {
  display: none !important;
}
.floating-tools {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 118;
  display: grid;
  justify-items: end;
  gap: 10px;
  pointer-events: none;
}
.floating-tools__toggle,
.floating-tools__menu button {
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--cyan) 42%, var(--border));
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
}
.floating-tools__toggle {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #06101e;
  border-color: color-mix(in srgb, var(--cyan) 70%, transparent);
  font-weight: 950;
  font-size: 20px;
}
.floating-tools__menu {
  display: grid;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.floating-tools.is-open .floating-tools__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.floating-tools__menu button {
  min-width: 128px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px 0 10px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-weight: 850;
}
.floating-tools__menu span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(6,214,240,.13);
  color: var(--cyan);
  font-weight: 950;
}
.floating-tools__menu em { font-style: normal; white-space: nowrap; }
.floating-tools__toggle:focus-visible,
.floating-tools__menu button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cyan) 50%, transparent);
  outline-offset: 3px;
}
html[data-theme="light"] .floating-tools__menu button {
  background: #ffffff !important;
  color: #111827 !important;
}
@media (max-width: 920px) {
  .floating-tools {
    right: 12px;
    bottom: calc(132px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 520px) {
  .floating-tools__toggle { width: 44px; height: 44px; font-size: 18px; }
  .floating-tools__menu button { min-width: 116px; min-height: 40px; font-size: 13px; }
}


/* restrained dark palette patch · reduce neon/cyberpunk saturation */
:root,
html[data-theme="dark"] {
  --bg-0: #0b1020;
  --bg-1: #111827;
  --surface: rgba(23, 32, 51, 0.68);
  --surface-strong: rgba(23, 32, 51, 0.92);
  --surface-2: rgba(31, 41, 55, 0.76);
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-0: #eef3f8;
  --text-1: #b7c2cf;
  --text-2: #7d8a99;
  --cyan: #6aa6c8;
  --pink: #b77aa6;
  --violet: #8c7ab8;
  --amber: #c49a62;
  --green: #65a987;
  --red: #b86b78;
  --grad: linear-gradient(135deg, #6aa6c8 0%, #8c7ab8 55%, #b77aa6 100%);
  --grad-cool: linear-gradient(135deg, #6aa6c8, #8c7ab8);
  --grad-warm: linear-gradient(135deg, #c49a62, #b77aa6);
  --grad-cyan: linear-gradient(135deg, #6aa6c8, #5b9ab8);
  --grad-pink: linear-gradient(135deg, #b77aa6, #8c7ab8);
  --shadow-cyan: 0 16px 42px rgba(15, 23, 42, 0.28);
  --shadow-pink: 0 16px 42px rgba(15, 23, 42, 0.20);
}
html[data-theme="dark"] .bg-glow { opacity: .14; filter: blur(96px); }
html[data-theme="dark"] .logo-mark,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .channel-card,
html[data-theme="dark"] .topic-card { box-shadow: none; }


/* === 20260606 coffee support FAB: no inline dismiss X === */
.support-fab__hide { display: none !important; }
.support-fab {
  align-items: center;
  gap: 0;
}
.support-fab__main {
  border-radius: 999px !important;
}
.support-fab__main::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  pointer-events: none;
}

/* Random exploration stability patch: do not let random controls skew list/nav rows. */
#random-subsite,
#about-random-sub,
#topic-random-sub,
#dock-random-sub {
  transform: none !important;
  flex: 0 0 auto;
  white-space: nowrap;
  contain: layout paint;
}
#dock-random-sub {
  inline-size: 36px;
  block-size: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  line-height: 1;
  text-decoration: none;
}
#random-subsite.is-random-pending,
#about-random-sub.is-random-pending,
#topic-random-sub.is-random-pending,
#dock-random-sub.is-random-pending {
  opacity: .72;
  filter: saturate(.85);
  pointer-events: none;
}
