/* 全站统一侧边栏 —— 由 /static/shell.js 注入，PULSE / AI 工具库 / 各前台页共用
   桌面端可折叠为图标条（状态记忆在 localStorage: gs_collapsed） */
:root{ --gs-w:236px; --gs-wc:76px; }

body.gs-on{ padding:44px 0 0 var(--gs-w); transition:padding .18s ease; }
body.gs-on.gs-collapsed{ padding-left:var(--gs-wc); }

.gs-side{
  position:fixed; left:0; top:0; bottom:0; width:var(--gs-w); z-index:60;
  background:#0b0f17; border-right:1px solid rgba(94,234,212,.14);
  display:flex; flex-direction:column; overflow-y:auto; overflow-x:hidden;
  font-family:"IBM Plex Sans","PingFang SC","Microsoft YaHei",sans-serif;
  color:#e8eefc; -webkit-font-smoothing:antialiased;
  transition:width .18s ease;
}
body.gs-collapsed .gs-side{ width:var(--gs-wc); }
.gs-side::-webkit-scrollbar{ width:0; }

.gs-side a{color:inherit;text-decoration:none}

/* ---- 品牌区 ---- */
.gs-brand{display:flex;align-items:center;gap:11px;padding:22px 18px 18px;border-bottom:1px solid rgba(94,234,212,.14);transition:.15s}
.gs-brand:hover{background:#121826}
.gs-brand:hover b{color:#5eead4}
.gs-brand .mk{width:36px;height:36px;flex:0 0 36px;border-radius:11px;display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:18px;color:#04211c;background:linear-gradient(135deg,#5eead4,#8b7cff)}
.gs-brand-text{min-width:0}
.gs-brand b{font-size:17px;letter-spacing:.5px;display:block;white-space:nowrap}
.gs-brand small{display:block;font-size:9.5px;letter-spacing:.7px;color:#7d8ba6;margin-top:3px;white-space:nowrap}

/* ---- 折叠按钮 ---- */
.gs-toggle{flex:0 0 auto;margin-left:auto;width:28px;height:28px;border-radius:9px;border:0;cursor:pointer;
  display:flex;align-items:center;justify-content:center;background:#121826;color:#a9b6c9;font-size:11px;transition:.15s}
.gs-toggle:hover{background:#1a2230;color:#5eead4}
.gs-toggle-ico{display:block;line-height:1}

/* ---- 导航 ---- */
.gs-nav{padding:14px 10px;flex:1}
.gs-group{margin-bottom:16px}
.gs-group-t{font-size:10.5px;letter-spacing:1.5px;color:#6b7d92;padding:0 10px 7px;font-weight:700;white-space:nowrap}
.gs-item{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:10px;color:#a9b6c9;
  font-size:13.5px;font-weight:600;transition:.15s;position:relative;white-space:nowrap}
.gs-item:hover{background:#121826;color:#e8eefc}
.gs-item.on{background:rgba(94,234,212,.1);color:#5eead4}
.gs-item.on::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:3px;background:#5eead4}
.gs-item .i{width:24px;height:24px;flex:0 0 24px;border-radius:7px;background:#121826;display:flex;
  align-items:center;justify-content:center;font-size:12.5px;font-weight:800;letter-spacing:-.3px;font-style:normal}
/* 图标用功能短字样 + 专属配色，折叠态一眼可辨 */
.gs-item .i[data-tone="pulse"]{color:#5eead4;background:rgba(94,234,212,.12)}
.gs-item .i[data-tone="ai"]{color:#a78bfa;background:rgba(139,124,255,.14)}
.gs-item .i[data-tone="github"]{color:#e8eefc;background:rgba(232,238,252,.10)}
.gs-item .i[data-tone="media"]{color:#fb923c;background:rgba(251,146,60,.13)}
.gs-item .i[data-tone="gig"]{color:#fbbf24;background:rgba(251,191,36,.13)}
.gs-item .i[data-tone="trends"]{color:#38bdf8;background:rgba(56,189,248,.13)}
.gs-item .i[data-tone="print"]{color:#60a5fa;background:rgba(96,165,250,.13)}
.gs-item .i[data-tone="wechat"]{color:#4ade80;background:rgba(74,222,128,.13)}
.gs-item .i[data-tone="trade"]{color:#e879f9;background:rgba(232,121,249,.13)}
.gs-item.on .i{background:rgba(94,234,212,.18);color:#5eead4}
.gs-item .x{margin-left:auto;font-size:11px;color:#6b7d92;font-weight:700}
.gs-item .x.new{color:#8b7cff}
.gs-item .x.free{color:#fb923c}
.gs-foot{padding:14px 18px 18px;border-top:1px solid rgba(94,234,212,.14);font-size:10.5px;color:#6b7d92;line-height:1.9;white-space:nowrap}
.gs-foot .d{display:inline-block;width:7px;height:7px;border-radius:50%;background:#5eead4;margin-right:6px}

/* ---- 折叠态（桌面端） ---- */
body.gs-collapsed .gs-brand{flex-direction:column;align-items:center;gap:10px;padding:20px 0 16px}
body.gs-collapsed .gs-brand-text,
body.gs-collapsed .gs-group-t,
body.gs-collapsed .gs-foot-text,
body.gs-collapsed .gs-item .x{display:none}
body.gs-collapsed .gs-toggle{margin:0}
body.gs-collapsed .gs-nav{padding:12px 10px}
body.gs-collapsed .gs-item{justify-content:center;padding:10px 0;border-radius:10px}
body.gs-collapsed .gs-item.on::before{left:2px}
body.gs-collapsed .gs-item .i{width:28px;height:28px;flex:0 0 28px;font-size:13px}
body.gs-collapsed .gs-foot{text-align:center;padding:14px 0}
body.gs-collapsed .gs-foot .d{display:none}

/* 折叠态 hover：图标右侧浮出功能名称。
   用 fixed 脱离侧栏 overflow-x:hidden 的裁剪；top 取静态位置，与图标同行对齐。 */
body.gs-collapsed .gs-item-text{
  display:block;position:fixed;left:calc(var(--gs-wc) + 10px);z-index:80;
  margin-top:-3px;padding:7px 11px;border-radius:8px;
  background:#151c2b;border:1px solid rgba(94,234,212,.28);
  color:#e8eefc;font-size:12.5px;font-weight:600;letter-spacing:.2px;
  white-space:nowrap;box-shadow:0 8px 26px rgba(0,0,0,.5);
  opacity:0;pointer-events:none;transform:translateX(-4px);
  transition:opacity .13s ease,transform .13s ease;
}
body.gs-collapsed .gs-item-text::before{
  content:"";position:absolute;left:-5px;top:50%;margin-top:-4px;
  border:4px solid transparent;border-right-color:#151c2b;
}
body.gs-collapsed .gs-item:hover .gs-item-text,
body.gs-collapsed .gs-item:focus-visible .gs-item-text{opacity:1;transform:translateX(0)}

/* ---- 窄屏：侧栏收起为抽屉，左上角浮动按钮，折叠态不生效 ---- */
.gs-burger{display:none}
@media(max-width:900px){
  body.gs-on{padding-left:0}
  body.gs-on.gs-collapsed{padding-left:0}
  .gs-side{transform:translateX(-100%);transition:transform .2s ease;box-shadow:0 0 50px rgba(0,0,0,.5)}
  body.gs-open .gs-side{transform:none}
  .gs-burger{display:flex;position:fixed;left:12px;top:12px;z-index:70;width:38px;height:38px;border-radius:10px;
    align-items:center;justify-content:center;background:#0e131c;border:1px solid rgba(94,234,212,.3);
    color:#5eead4;font-size:16px;cursor:pointer;font-family:inherit}
  .gs-toggle{display:none}
}

/* 有侧栏后正文变窄：收紧 PULSE 顶栏，避免按钮折行 */
body.gs-on .nav{ gap:12px; padding:12px 20px; flex-wrap:nowrap; }
body.gs-on .nav-actions{ gap:8px; flex-wrap:nowrap; }
body.gs-on .nav .btn{ white-space:nowrap; padding:8px 13px; }
body.gs-on .nav .wordmark b{ font-size:19px; }
@media(max-width:1320px){
  body.gs-on .nav .wordmark small{ display:none; }
  body.gs-on .meta{ display:none; }
}
@media(max-width:1080px){
  body.gs-on .nav .period-global-label{ display:none; }
  body.gs-on .nav .btn.ghost{ padding:8px 10px; font-size:12px; }
}

/* ---- 顶部右侧：当日访客 + 注册登录（全站共用，shell.js 注入） ---- */
.gs-topbar{
  position:fixed; left:var(--gs-w); right:0; top:0; height:44px; z-index:70;
  display:flex; align-items:center; justify-content:flex-end; gap:10px;
  box-sizing:border-box; padding:0 18px;
  background:rgba(10,15,23,.94); backdrop-filter:blur(10px);
  border-bottom:1px solid rgba(94,234,212,.16);
  font-family:"IBM Plex Sans","PingFang SC","Microsoft YaHei",sans-serif;
  font-size:11.5px; color:#cbd5e1; white-space:nowrap;
}
body.gs-collapsed .gs-topbar{left:var(--gs-wc)}
.gs-topbar .gs-visits{display:flex;align-items:center;gap:7px;color:#94a3b8}
.gs-topbar .gs-visits-short{display:none}
.gs-topbar .gs-visits b{color:#5eead4;font-weight:800;font-size:12.5px}
.gs-topbar .gs-mine{color:#dbe6f7}
.gs-topbar .gs-sep{color:#4b5b70}
.gs-topbar .gs-hello{color:#e8eefc;font-weight:700}
.gs-topbar button{
  border:1px solid rgba(94,234,212,.42); border-radius:999px; background:rgba(94,234,212,.1);
  color:#5eead4; padding:6px 13px; font-size:11.5px; font-weight:700; cursor:pointer;
  font-family:inherit; transition:background .15s ease,transform .15s ease;
}
.gs-topbar button:hover{background:rgba(94,234,212,.22);transform:translateY(-1px)}
.gs-topbar button:focus-visible{outline:2px solid #5eead4;outline-offset:2px}
.gs-topbar button[data-act="logout"]{border-color:rgba(148,163,184,.35);color:#94a3b8;background:transparent}

.gs-auth-mask{
  position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center;
  padding:18px; background:rgba(3,6,12,.72); backdrop-filter:blur(3px);
  font-family:"IBM Plex Sans","PingFang SC","Microsoft YaHei",sans-serif;
}
.gs-auth-mask[hidden]{display:none}
.gs-auth-box{
  position:relative; width:min(420px,100%); box-sizing:border-box; padding:24px;
  background:#0e131c; color:#e8eefc; border:1px solid rgba(94,234,212,.28);
  border-radius:16px; box-shadow:0 24px 70px rgba(0,0,0,.5);
}
.gs-auth-box h3{margin:0 0 4px;font-size:19px;color:#e8eefc}
.gs-auth-box .gs-auth-sub{margin:0 0 18px;font-size:11.5px;color:#8292a8;line-height:1.6}
.gs-auth-x{
  position:absolute; right:14px; top:12px; width:28px; height:28px; border-radius:8px;
  border:1px solid rgba(148,163,184,.28); background:transparent; color:#94a3b8;
  cursor:pointer; font-size:16px; line-height:1;
}
.gs-auth-tabs{display:flex;gap:6px;margin-bottom:16px}
.gs-auth-tabs button{
  flex:1; padding:8px 0; border-radius:9px; cursor:pointer; font-family:inherit; font-size:12px;
  border:1px solid rgba(148,163,184,.25); background:transparent; color:#94a3b8;
}
.gs-auth-tabs button.on{color:#5eead4;border-color:rgba(94,234,212,.5);background:rgba(94,234,212,.1)}
.gs-auth-box label{display:block;font-size:11.5px;color:#94a3b8;margin:0 0 12px}
.gs-auth-box input{
  display:block; width:100%; box-sizing:border-box; margin-top:6px; padding:10px 12px;
  border-radius:9px; border:1px solid rgba(148,163,184,.26); background:#111827;
  color:#e8eefc; font-family:inherit; font-size:13px; outline:none;
}
.gs-auth-box input:focus{border-color:rgba(94,234,212,.6)}
.gs-auth-box[data-mode="login"] .gs-reg-only,
.gs-auth-box[data-mode="register"] .gs-login-only{display:none}
.gs-auth-msg{min-height:18px;margin:2px 0 10px;font-size:11.5px;color:#f87171;line-height:1.5}
.gs-auth-msg.ok{color:#5eead4}
.gs-auth-submit{
  width:100%; padding:11px; border:0; border-radius:9px; cursor:pointer;
  background:#5eead4; color:#07201d; font-weight:800; font-size:13px; font-family:inherit;
}
.gs-auth-submit:disabled{opacity:.6;cursor:wait}
.gs-auth-note{margin:12px 0 0;font-size:10.5px;color:#6b7d92;line-height:1.6}
@media(max-width:900px){
  .gs-topbar{left:0;padding:0 12px 0 58px;gap:7px;font-size:10.5px}
  .gs-burger{top:52px;z-index:71}
  .gs-auth-box{padding:20px}
}
@media(max-width:540px){
  .gs-topbar .gs-visits-full{display:none}
  .gs-topbar .gs-visits-short{display:inline}
  .gs-topbar button{padding:5px 10px;font-size:10.5px}
}
