:root {
  --brand: #2563eb;
  --brand-2: #7c3aed;
  --brand-soft: rgba(37, 99, 235, .10);
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, .92);
  --surface-solid: #ffffff;
  --surface-sub: #f1f5f9;
  --line: rgba(15, 23, 42, .08);
  --line-strong: rgba(15, 23, 42, .14);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .03);
  --shadow-lg: 0 18px 42px rgba(15, 23, 42, .10);
  --radius: 16px;
}

html.dark {
  --bg: #070b14;
  --surface: rgba(17, 24, 39, .88);
  --surface-solid: #111827;
  --surface-sub: #1e293b;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f8fafc;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }

/* 极光背景光晕（克制柔光，增强高级层次感） */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: .34;
}
.bg-orb-1 {
  width: 520px; height: 520px;
  top: -180px; left: 160px;
  background: radial-gradient(circle, rgba(37, 99, 235, .42), transparent 70%);
}
.bg-orb-2 {
  width: 480px; height: 480px;
  bottom: -160px; right: -80px;
  background: radial-gradient(circle, rgba(124, 58, 237, .35), transparent 70%);
}
html.dark .bg-orb { opacity: .24; }

.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ---------------- 左侧玻璃侧边栏 ---------------- */
.sidebar {
  width: 256px;
  flex: 0 0 256px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .28);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; font-weight: 700; }
.brand-copy span { font-size: 10px; letter-spacing: 1px; color: var(--text-3); font-weight: 600; }
.sb-close { display: none; border: 0; background: transparent; color: var(--text-2); font-size: 18px; cursor: pointer; }

.sb-scroll { flex: 1; overflow-y: auto; padding-top: 8px; }
.sb-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  padding: 12px 10px 6px;
  letter-spacing: .5px;
}
.sb-list { display: flex; flex-direction: column; gap: 3px; }
.sb-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: .15s;
}
.sb-btn:hover { background: var(--surface-sub); color: var(--text); }
.sb-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
html.dark .sb-btn.active { color: #60a5fa; }

.sb-svg {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.sb-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-num {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-sub);
  color: var(--text-3);
}
.sb-btn.active .sb-num { background: var(--brand); color: #fff; }

.sb-bottom { padding-top: 12px; }
.sb-status-box {
  background: var(--surface-sub);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.sb-status-dot {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; margin-bottom: 4px;
}
.sb-status-dot span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .22);
}
.sb-status-box p { margin: 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

/* ---------------- 主舞台 & 顶栏 ---------------- */
.main-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.tb-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.tb-burger {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 9px;
  cursor: pointer;
}

.search-omni {
  flex: 1;
  max-width: 700px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-sub);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px 5px 4px 12px;
  transition: .16s;
}
.search-omni:focus-within {
  background: var(--surface-solid);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.so-ico { color: var(--text-3); flex: 0 0 auto; }
.search-omni input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; color: var(--text);
  font-size: 13.5px; padding: 7px 0; outline: none;
}
.so-kbd {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 2px 6px;
  font-family: inherit;
}
.so-clear {
  border: 0; background: transparent; color: var(--text-3);
  cursor: pointer; font-size: 13px; padding: 0 4px;
}
.so-go {
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tb-actions { display: flex; align-items: center; gap: 10px; }
.tb-stat {
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-sub);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 999px;
}
.tb-icon-btn {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.tb-icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------------- 主体 Bento 布局 ---------------- */
.container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bento-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .95fr);
  gap: 16px;
}

.bento-main {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e1b4b 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}
.bento-main::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, .35), transparent 70%);
  pointer-events: none;
}

.bento-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #bfdbfe;
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .22);
}

.bento-main h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.32;
  font-weight: 800;
  letter-spacing: -.4px;
}
.bento-main p {
  margin: 0;
  font-size: 13.5px;
  color: rgba(226, 232, 240, .82);
  max-width: 540px;
}

.bento-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}
.hero-chip {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .10);
  color: #f8fafc;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: .15s;
}
.hero-chip span { color: #93c5fd; font-weight: 700; }
.hero-chip:hover { background: rgba(255, 255, 255, .20); }

.bento-side-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bento-stat-card, .bento-code-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.bsc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.bsc-tag {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, .12);
  padding: 2px 9px;
  border-radius: 999px;
}
.bsc-nums {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bsc-nums > div {
  background: var(--surface-sub);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}
.bsc-nums strong { font-size: 20px; font-weight: 800; line-height: 1.2; }
.bsc-nums span { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.bento-code-card { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.bcc-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.bcc-row { display: flex; gap: 8px; }
.bcc-row input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface-sub);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  outline: none;
}
.bcc-row input:focus { border-color: var(--brand); background: var(--surface-solid); }
.bcc-row button {
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.bcc-row button:hover { filter: brightness(1.08); }

/* ---------------- 口令直达命中卡片 ---------------- */
.hit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface-solid);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .12);
}
.hb-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 9px;
  border-radius: 6px;
  margin-bottom: 5px;
}
.hb-info h3 { margin: 0 0 4px; font-size: 17px; }
.hb-info p { margin: 0; font-size: 13px; color: var(--text-2); }
.hb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hb-copy {
  border: 1px dashed var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hb-go {
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------------- 分区容器 & 卡片矩阵 ---------------- */
.panel { display: flex; flex-direction: column; gap: 14px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.ph-title h2 { margin: 0; font-size: 18px; font-weight: 700; }
.ph-title span { font-size: 12.5px; color: var(--text-3); }
.ph-controls { display: flex; gap: 8px; }
.seg-group {
  display: inline-flex;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.seg-btn.active { background: var(--text); color: var(--surface-solid); }

.res-matrix.view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.res-matrix.view-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rcard {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: .18s cubic-bezier(.2,.8,.2,1);
}
.rcard:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.rc-top { display: flex; align-items: center; gap: 10px; }
.rc-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.rc-meta-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-cat { font-size: 12px; font-weight: 700; }
.rc-meta { font-size: 11px; color: var(--text-3); }
.rc-detail-btn {
  border: 1px solid var(--line);
  background: var(--surface-sub);
  color: var(--text-2);
  border-radius: 7px;
  padding: 3px 9px;
  font-size: 11.5px;
  cursor: pointer;
}
.rc-detail-btn:hover { border-color: var(--brand); color: var(--brand); }

.rc-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}
.rc-title:hover { color: var(--brand); }
.rc-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}

.rc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.rc-code {
  border: 1px dashed var(--line-strong);
  background: var(--surface-sub);
  color: var(--text-2);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.rc-code:hover, .rc-code.copied {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.rc-save {
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9px;
}
.rc-save:hover { filter: brightness(1.08); }

/* 列表模式适配 */
.res-matrix.view-list .rcard {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
}
.res-matrix.view-list .rc-top { min-width: 210px; }
.res-matrix.view-list .rc-desc { display: none; }
.res-matrix.view-list .rc-title { flex: 1; min-width: 220px; }
.res-matrix.view-list .rc-foot { border-top: 0; padding-top: 0; }

/* ---------------- 工具网址导航网格 ---------------- */
.tools-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tcard {
  text-decoration: none;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: .16s;
}
.tcard:hover { border-color: var(--brand); transform: translateY(-2px); }
.tc-badge {
  width: 38px; height: 38px;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.tc-info { flex: 1; min-width: 0; }
.tc-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-desc { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-arrow { color: var(--text-3); font-size: 13px; }
.tcard:hover .tc-arrow { color: var(--brand); }

/* ---------------- 指南 & 页脚 ---------------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.guide-item {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.gi-step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  color: var(--brand);
  margin-bottom: 6px;
}
.guide-item h3 { margin: 0 0 6px; font-size: 15px; }
.guide-item p { margin: 0; font-size: 13px; color: var(--text-2); }

.empty-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 16px;
  background: var(--surface-solid);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-3);
}

.footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 详情弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, .56);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.md-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.md-cat {
  font-size: 12px; font-weight: 700;
  color: var(--brand); background: var(--brand-soft);
  padding: 3px 10px; border-radius: 999px;
}
.md-close {
  border: 0; background: transparent; color: var(--text-3);
  font-size: 18px; cursor: pointer;
}
.md-body { padding: 18px 20px; }
.md-body h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.35; }
.md-meta { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.md-body p { margin: 0 0 14px; font-size: 13.5px; color: var(--text-2); line-height: 1.65; }
.md-code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-sub);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}
.md-code-bar b { color: var(--brand); font-size: 15px; }
.md-code-bar button {
  border: 1px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.md-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-sub);
}
.md-btn-sec {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.md-btn-pri {
  flex: 1.3;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
}

.drawer-mask { display: none; }

@media (max-width: 1100px) {
  .bento-hero { grid-template-columns: 1fr; }
  .res-matrix.view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .sidebar { position: fixed; left: -275px; top: 0; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .sb-close, .tb-burger { display: inline-flex; }
  .drawer-mask.show {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45); z-index: 40;
  }
  .tb-inner { padding: 10px 14px; }
  .so-kbd, .tb-stat { display: none; }
  .container { padding: 16px 14px 42px; }
  .res-matrix.view-grid, .tools-matrix, .guide-grid { grid-template-columns: 1fr; }
}
