/* ============================================================
   电玩工具平台 · 外壳样式（深壳 + 浅工作区）
   依赖：/assets/ui-tokens.css
   约束：不给工具页内容区加 overflow:hidden / 固定高度（避免影响弹层）
   ============================================================ */

/* ---------- 外壳骨架 ---------- */
.shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:var(--bg);
}

/* ---------- 顶栏（深色品牌位）---------- */
.shell-topbar{
  position:sticky;
  top:0;
  z-index:60;
  color:var(--shell-txt);
  background:linear-gradient(120deg,var(--shell-bg) 0%,var(--space-800) 55%,#1A1440 100%);
  border-bottom:1px solid var(--shell-line);
}
.shell-topbar-inner{
  max-width:1280px;
  margin:0 auto;
  min-height:var(--shell-top-h);
  padding:10px 20px;
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.shell-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:var(--shell-txt);
  text-decoration:none;
}
.shell-brand-mark{
  flex:none;
  display:inline-flex;
  gap:3px;
  padding:7px 9px;
  border-radius:10px;
  background:linear-gradient(135deg,var(--space-700),var(--violet));
  box-shadow:var(--shadow-card);
}
.shell-brand-mark i{
  display:block;
  width:12px;
  height:12px;
  border-radius:3px;
}
.shell-brand-mark .a{background:var(--ab-a)}
.shell-brand-mark .b{background:var(--ab-b)}
.shell-brand-mark .x{background:var(--ab-x)}
.shell-brand-mark .y{background:var(--ab-y)}
.shell-brand-text{display:flex;flex-direction:column;line-height:1.2;min-width:0}
.shell-brand-name{font-size:15px;font-weight:800;letter-spacing:.4px;white-space:nowrap}
.shell-brand-sub{font-size:11px;color:var(--shell-dim);white-space:nowrap}

.shell-nav{
  display:flex;
  align-items:center;
  gap:4px;
  margin-left:auto;
  flex-wrap:wrap;
}
.shell-nav a{
  display:inline-block;
  padding:6px 11px;
  border-radius:var(--r-pill);
  color:var(--shell-dim);
  font-size:13px;
  text-decoration:none;
  border:1px solid transparent;
  transition:color var(--t-fast) var(--ease),background var(--t-fast) var(--ease),border-color var(--t-fast) var(--ease);
}
.shell-nav a:hover{color:var(--shell-txt);background:rgba(255,255,255,.06)}
.shell-nav a[aria-current="page"]{
  color:var(--shell-txt);
  background:rgba(0,229,255,.12);
  border-color:rgba(0,229,255,.35);
}

/* 桌面端：导航由左侧栏承担，顶栏只保留品牌位，避免两套导航重复 */
@media (min-width:721px){
  .shell-nav{display:none}
}

/* ---------- 主体布局 ---------- */
.shell-layout{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  flex:1;
  display:flex;
  align-items:stretch;
  min-width:0;
}

/* ---------- 侧栏（深色品牌位）---------- */
.shell-side{
  flex:none;
  width:var(--shell-side-w);
  min-height:calc(100vh - var(--shell-top-h));
  padding:16px 12px;
  background:var(--shell-panel);
  border-right:1px solid var(--shell-line);
  position:sticky;
  top:var(--shell-top-h);
  align-self:flex-start;
}
.shell-side-title{
  padding:0 10px 10px;
  color:var(--shell-dim);
  font-size:11px;
  font-weight:700;
  letter-spacing:1px;
}
.shell-side-nav{display:flex;flex-direction:column;gap:2px}
.shell-side a{
  display:flex;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border-radius:9px;
  color:var(--shell-dim);
  font-size:13px;
  text-decoration:none;
  border-left:2px solid transparent;
  transition:background var(--t-fast) var(--ease),color var(--t-fast) var(--ease);
}
.shell-side a:hover{background:rgba(255,255,255,.06);color:var(--shell-txt)}
.shell-side a.is-active{
  background:rgba(0,229,255,.10);
  color:var(--shell-txt);
  border-left-color:var(--cyan);
}
.shell-side-ico{width:16px;text-align:center;flex:none}
.shell-side-home{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--shell-line);
  display:block;
}
.shell-side-home.is-active{background:rgba(0,229,255,.10);color:var(--shell-txt);border-left-color:var(--cyan)}

/* ---------- 工作区（浅色）---------- */
.shell-content{
  flex:1;
  min-width:0;
  padding:20px 24px 48px;
}

/* ---------- 面包屑 ---------- */
.shell-crumb{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:16px;
  font-size:12.5px;
  color:var(--ink-3);
}
.shell-crumb a{color:var(--ink-2);text-decoration:none}
.shell-crumb a:hover{color:var(--cyan-600);text-decoration:underline}
.shell-crumb-sep{color:var(--ink-3);opacity:.7}
.shell-crumb-cur{color:var(--ink);font-weight:600}

/* ---------- 首页 Hero ---------- */
.shell-hero{
  position:relative;
  padding:22px 24px;
  margin-bottom:6px;
  background:linear-gradient(135deg,#FFFFFF 0%,#F7FAFF 60%,#EEF9FC 100%);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-card);
}
.shell-hero::before{
  content:"";
  position:absolute;
  left:0;top:18px;bottom:18px;
  width:3px;
  border-radius:3px;
  background:linear-gradient(180deg,var(--cyan),var(--violet));
}
.shell-hero h1{
  margin:0 0 6px;
  font-size:var(--fs-display);
  font-weight:900;
  letter-spacing:.3px;
  color:var(--ink);
}
.shell-hero p{margin:0;color:var(--ink-2);font-size:13.5px}
.shell-hero code{
  padding:1px 6px;
  border-radius:4px;
  background:var(--cyan-100);
  color:var(--cyan-600);
  font-family:ui-monospace,Consolas,monospace;
  font-size:12.5px;
}
.shell-hero-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.shell-hero-meta span{
  font-size:11.5px;
  color:var(--ink-2);
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-pill);
  padding:4px 10px;
}
.shell-warn{color:var(--warn) !important;background:var(--warn-bg) !important;border-color:#F3D9AE !important}

/* ---------- 分区 ---------- */
.shell-section{margin:28px 0}
.shell-section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.shell-section-head h2{
  margin:0;
  font-size:16px;
  font-weight:800;
  color:var(--ink);
}
.shell-section-count{font-size:12px;color:var(--ink-3)}
.shell-empty{
  padding:28px;
  text-align:center;
  color:var(--ink-3);
  background:var(--card);
  border:1px dashed var(--line);
  border-radius:var(--r-lg);
}

/* ---------- 工具卡片 ---------- */
.tool-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(250px,1fr));
  gap:14px;
}
.tool-card{
  display:flex;
  flex-direction:column;
  gap:7px;
  min-width:0;
  padding:16px 18px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--r-lg);
  box-shadow:var(--shadow-card);
  color:var(--ink);
  text-decoration:none;
  transition:transform var(--t-fast) var(--ease),box-shadow var(--t-fast) var(--ease),border-color var(--t-fast) var(--ease);
}
.tool-card:hover{
  transform:translateY(-2px);
  border-color:rgba(8,145,178,.45);
  box-shadow:0 12px 30px -14px rgba(16,22,42,.28);
}
.tool-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.tool-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:var(--cyan-100);
  font-size:17px;
  flex:none;
}
.tool-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.tool-name{
  margin:2px 0 0;
  font-size:15px;
  font-weight:800;
  color:var(--ink);
  overflow-wrap:anywhere;
}
.tool-desc{
  margin:0;
  font-size:12.5px;
  line-height:1.55;
  color:var(--ink-2);
  overflow-wrap:anywhere;
}
.tool-tags{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px}
.tool-tags span{
  font-size:10.5px;
  color:var(--ink-2);
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:var(--r-pill);
  padding:2px 8px;
}

/* ---------- 状态徽章（必须带文字）---------- */
.status-badge,
.type-badge{
  display:inline-block;
  font-size:10.5px;
  font-weight:700;
  line-height:1;
  padding:4px 8px;
  border-radius:var(--r-pill);
  white-space:nowrap;
}
.st-live{color:var(--ok);background:var(--ok-bg);border:1px solid #BFE7CE}
.st-beta{color:var(--info);background:var(--info-bg);border:1px solid #C9DCFB}
.st-soon{color:var(--warn);background:var(--warn-bg);border:1px solid #F3D9AE}
.st-offline{color:var(--ink-3);background:#F1F2F6;border:1px solid var(--line)}
.type-badge{color:var(--ink-3);background:var(--bg);border:1px solid var(--line)}

/* ---------- 页脚 ---------- */
.shell-foot{
  margin-top:auto;
  border-top:1px solid var(--line);
  background:var(--card);
  color:var(--ink-3);
  font-size:12px;
}
.shell-foot-inner{
  max-width:1280px;
  margin:0 auto;
  padding:16px 20px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* ---------- 通用链接 ---------- */
.shell-link{color:var(--cyan-600);text-decoration:none}
.shell-link:hover{text-decoration:underline}

/* ---------- 移动端 ≤720px ---------- */
@media (max-width:720px){
  .shell-topbar-inner{
    padding:10px 14px;
    gap:8px;
  }
  .shell-brand-sub{display:none}
  .shell-nav{
    width:100%;
    margin-left:0;
    flex-wrap:nowrap;
    overflow-x:auto;
    padding-bottom:2px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    -ms-overflow-style:none;
  }
  .shell-nav::-webkit-scrollbar{display:none}
  .shell-nav a{flex:none}

  .shell-layout{flex-direction:column}
  /* 移动端顶部导航已覆盖全部分类，侧栏不重复占用首屏高度 */
  .shell-side{display:none}

  .shell-content{padding:16px 14px 40px}
  .shell-hero{padding:18px 18px}
  .tool-grid{grid-template-columns:1fr}
  .shell-section-head{flex-wrap:wrap}
  .shell-foot-inner{padding:14px 14px;flex-direction:column;gap:6px}
}

/* ---------- 降级提示（registry 加载失败）---------- */
.shell-fallback-note{
  margin:0 0 14px;
  padding:9px 12px;
  border:1px solid #F3D9AE;
  background:var(--warn-bg);
  color:var(--warn);
  border-radius:var(--r-sm);
  font-size:12.5px;
}
