:root {
  --bg: #faf9f6;
  --sidebar: #f3f2ed;
  --card: #ffffff;
  --card-hv: #fcfcfa;
  --text: #18181b;
  --sub: #52525b;
  --mut: #8a8a93;
  --line: #e7e5de;
  --line-s: #f0eee8;
  --brand: #2563eb;
  --brand-soft: #eff6ff;
  --accent: #e11d48;
  --accent-soft: #fff1f2;
  --r: 12px;
  --r-sm: 8px;
}

[data-theme="dark"] {
  --bg: #13191c;
  --sidebar: #0f1417;
  --card: #182024;
  --card-hv: #1d272c;
  --text: #f1f5f9;
  --sub: #9aa5b1;
  --mut: #6b7785;
  --line: #263137;
  --line-s: #1e272c;
  --brand: #60a5fa;
  --brand-soft: rgba(59, 130, 246, 0.14);
  --accent: #fb7185;
  --accent-soft: rgba(244, 63, 94, 0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
img { max-width: 100%; }
button { font: inherit; }

/* ===== App Shell: 左侧固定边栏 + 右侧主区 ===== */
.app-shell {
  display: flex;
  min-height: 100dvh;
}

.rail {
  position: sticky;
  top: 0;
  width: 204px;
  height: 100dvh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 12px 14px;
  z-index: 60;
}

.rail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.brand svg, .brand-logo { flex-shrink: 0; width: 28px; height: 28px; }
.brand-logo { object-fit: contain; background: transparent; }
.brand-t { display: flex; flex-direction: column; min-width: 0; }
.brand-t b { font-size: 18px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15; color: var(--text); }
.brand-t small { font-size: 10px; color: var(--mut); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rail-close { display: none !important; }

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
}

.rail-sec {
  padding: 10px 10px 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--mut);
  letter-spacing: .04em;
}

.rail-list { display: flex; flex-direction: column; gap: 2px; }

.rail-a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 33px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.rail-a svg { flex-shrink: 0; opacity: .75; }
.rail-a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-a:hover { color: var(--text); background: rgba(128, 128, 128, .08); }
.rail-a.is-active {
  color: var(--text);
  background: var(--card);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  border: 1px solid var(--line);
}
.rail-a.is-active svg { opacity: 1; color: var(--brand); }
.rail-a kbd {
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--mut);
}

.rail-ft {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
}

.rail-theme {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.rail-theme:hover { color: var(--text); border-color: var(--mut); }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: inline-block; }
[data-theme="dark"] .i-moon { display: none; }

.rail-mail {
  padding: 10px 4px 0;
  font-size: 11.5px;
  color: var(--sub);
  user-select: all;
}
.rail-copy {
  padding: 4px 4px 0;
  font-size: 11px;
  color: var(--mut);
}

.rail-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 55;
}

/* ===== 右侧舞台区 ===== */
.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.m-hd {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  height: 54px;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.m-brand { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.m-brand svg { width: 22px; height: 22px; }
.ibtn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ibtn:hover { color: var(--text); border-color: var(--mut); }

.stage-in {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 26px 36px 56px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 28px;
  align-items: start;
}
.main { min-width: 0; }

/* ===== 页面头部 ===== */
.page-hd {
  margin-bottom: 18px;
}
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.k-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.page-hd-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.page-hd h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -.4px;
  line-height: 1.25;
}
.page-hd p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--mut);
}
.hd-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sub);
  white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
}
.hd-more:hover { color: var(--text); border-color: var(--mut); }

/* ===== 顶部 Bento 精选网格 (1 大 + 2 小) ===== */
.bento-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.b-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  transition: border-color .16s ease, background-color .16s ease;
}
.b-card:hover {
  border-color: #c8c5bc;
  background: var(--card-hv);
}
[data-theme="dark"] .b-card:hover { border-color: #3a4a54; }

.b-card[data-idx="1"] {
  grid-row: span 2;
  padding: 20px 22px;
}

.b-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.b-no {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.b-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--line-s);
  color: var(--sub);
  border: 1px solid transparent;
}
.tag-chip:hover { color: var(--text); border-color: var(--line); }
.tag-chip.is-top {
  background: var(--accent-soft);
  color: var(--accent);
}

.b-title {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.2px;
}
.b-card[data-idx="1"] .b-title {
  font-size: 20px;
  line-height: 1.38;
  margin-bottom: 10px;
}
.b-title a:hover { color: var(--brand); }

.b-exc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.b-card[data-idx="1"] .b-exc {
  -webkit-line-clamp: 4;
  font-size: 13.5px;
}
.b-cover {
  display: block;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  height: 112px;
  background: var(--bg);
}
.b-card[data-idx="1"] .b-cover { height: 156px; }
.b-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.b-foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.b-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--mut);
}
.b-src { font-weight: 600; color: var(--sub); }

.b-stat {
  text-align: right;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.b-stat b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.b-card[data-idx="1"] .b-stat b { font-size: 24px; }
.b-stat small {
  font-size: 10.5px;
  color: var(--mut);
}

/* ===== 紧凑资讯流列表 ===== */
.list-sec-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 10px;
}
.list-sec-hd span { font-size: 13px; font-weight: 700; color: var(--text); }
.list-sec-hd small { font-size: 11.5px; color: var(--mut); }

.feed-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.r-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-s);
  transition: background-color .15s ease;
}
.r-item:last-child { border-bottom: 0; }
.r-item:hover { background: var(--card-hv); }

.r-no {
  width: 24px;
  flex-shrink: 0;
  padding-top: 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.r-thumb {
  flex: 0 0 116px;
  height: 76px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
.r-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.r-body { flex: 1; min-width: 0; }
.r-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.r-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -.15px;
}
.r-title a:hover { color: var(--brand); }
.r-tags { display: inline-flex; gap: 5px; }

.r-exc {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.r-side {
  flex-shrink: 0;
  text-align: right;
  min-width: 82px;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.r-stat { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; }
.r-stat b { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.2; }
.r-stat span { font-size: 11px; color: var(--mut); }
.r-date { display: block; margin-top: 4px; font-size: 11px; color: var(--mut); }

/* ===== 右侧：云厂商实时优惠板 ===== */
.side { position: sticky; top: 24px; min-width: 0; }
.deals {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.deals-hd {
  padding: 18px 18px 12px;
  background: var(--card);
}
.deals-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
}
.deals-title small {
  display: block;
  margin-top: 4px;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--mut);
}
.deals-bd { padding: 0 16px 16px; }

.d-promo {
  margin-bottom: 14px;
}
.d-promo-label { display: none; }
.d-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
  background: var(--bg);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.d-btn:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }

.d-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.d-tabs::-webkit-scrollbar { display: none; }
.d-tab {
  flex: 1 1 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 8px 4px 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mut);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.d-tab:hover { color: var(--text); }
.d-tab.on {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--text);
}

.d-panel { display: none; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-panel.on { display: grid; }
.d-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.d-gh {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 7px 6px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--line);
  line-height: 1.3;
}
a.d-gh:hover { border-color: var(--brand); }
.d-gh-row { display: inline-flex; align-items: center; gap: 5px; }
.d-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.d-ali .d-dot { background: #f97316; }
.d-tx .d-dot { background: #0284c7; }
.d-hw .d-dot { background: #e11d48; }
.d-gh b { font-size: 13px; font-weight: 700; color: var(--text); }
.d-gh small { font-size: 10.5px; color: var(--brand); margin-top: 2px; font-weight: 500; }

.d-item {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  background: var(--card);
}
a.d-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.d-row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.d-name { font-size: 12px; font-weight: 700; color: var(--text); }
.d-price { font-size: 12px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.d-spec { margin-top: 2px; font-size: 10.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 文章详情页 ===== */
.art {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 34px;
}
.art-hd { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.art-title { margin: 0 0 12px; font-size: 26px; line-height: 1.35; font-weight: 800; letter-spacing: -.35px; }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.art-cat { padding: 2px 8px; border-radius: 5px; background: var(--line-s); color: var(--sub); font-size: 11.5px; font-weight: 500; }
.art-cat:hover { color: var(--text); background: var(--line); }
.m-i { display: inline-flex; align-items: center; gap: 5px; }
.art-cover { width: 100%; border-radius: var(--r-sm); margin-bottom: 22px; border: 1px solid var(--line); }

.content { font-size: 15.5px; line-height: 1.88; word-break: break-word; color: var(--text); }
.content > *:first-child { margin-top: 0; }
.content p { margin: 0 0 1.15em; }
.content h2 { font-size: 19.5px; margin: 1.8em 0 .6em; padding-left: 11px; border-left: 3px solid var(--brand); line-height: 1.4; }
.content h3 { font-size: 16.5px; margin: 1.4em 0 .55em; }
.content a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, .28);
  padding-bottom: 1px;
  transition: border-color .15s ease, background-color .15s ease;
}
.content a:hover {
  border-bottom-color: var(--brand);
  background: var(--brand-soft);
  border-radius: 3px;
}
[data-theme="dark"] .content a { border-bottom-color: rgba(96, 165, 250, .35); }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.content li { margin: .35em 0; }
.content pre { background: #141a1e; color: #e2e8f0; padding: 36px 18px 16px; border-radius: var(--r-sm); overflow: auto; font-size: 13px; line-height: 1.65; margin: 0; }
.content pre.is-wrap { white-space: pre-wrap; word-break: break-word; overflow-x: visible; }
.code-box { position: relative; margin: 1.2em 0; }
.code-tools { position: absolute; top: 8px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.code-btn {
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #cbd5e1;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  transition: all .15s ease;
}
.code-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .28); }
.code-btn.on { background: rgba(59, 130, 246, .28); color: #93c5fd; border-color: rgba(96, 165, 250, .5); }
.content code { background: var(--line-s); color: var(--brand); padding: 2px 5px; border-radius: 4px; font-size: .88em; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; border: 1px solid var(--line); }
.content pre code { background: none; color: inherit; padding: 0; border: 0; }
.content blockquote {
  margin: 1.2em 0;
  padding: 6px 0 6px 14px;
  border-left: 2.5px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 14.5px;
}
.content blockquote p:last-child { margin-bottom: 0; }
.content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  margin: 1.2em 0;
  border: 0;
}
.content th {
  background: transparent;
  font-weight: 600;
  color: var(--sub);
  text-align: left;
  border-bottom: 1.5px solid var(--line);
}
.content td, .content th {
  border: 0;
  border-bottom: 1px solid var(--line-s);
  padding: 9px 12px;
}
.content tr:last-child td { border-bottom: 0; }

.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pn-i { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.pn-i:hover { border-color: var(--mut); }
.pn-i small { display: block; font-size: 11.5px; color: var(--mut); margin-bottom: 3px; }
.pn-i span { font-weight: 600; font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pn-r { text-align: right; grid-column: 2; }

/* ===== 分页 & 空状态 & 搜索弹窗 ===== */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 18px 0 0; }
.pager-b { padding: 6px 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; }
a.pager-b:hover { border-color: var(--mut); color: var(--text); }
.pager-b.is-off { opacity: .4; }
.pager-n { font-size: 12.5px; color: var(--mut); }
.empty { background: var(--card); border: 1px dashed var(--line); padding: 40px; border-radius: var(--r); text-align: center; color: var(--mut); }

.s-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(4px); z-index: 80; display: grid; place-items: start center; padding-top: 10vh; }
.s-modal[hidden] { display: none; }
.s-box { width: min(600px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .2); overflow: hidden; }
.s-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.s-head svg { color: var(--mut); flex-shrink: 0; }
.s-head input { flex: 1; border: 0; background: none; color: var(--text); font: inherit; font-size: 14.5px; outline: none; }
.s-close { border: 1px solid var(--line); background: var(--bg); color: var(--mut); border-radius: 5px; padding: 2px 7px; font-size: 11px; cursor: pointer; }
.s-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.s-item { display: block; padding: 10px 12px; border-radius: var(--r-sm); }
.s-item:hover { background: var(--line-s); }
.s-item b { display: block; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.s-item span { display: block; font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-empty { padding: 26px; text-align: center; color: var(--mut); font-size: 13px; }

/* Koenig 卡片 */
.kg-width-wide { margin-left: -16px; margin-right: -16px; max-width: calc(100% + 32px); }
.kg-width-full { margin-left: -36px; margin-right: -36px; max-width: calc(100% + 72px); }
.kg-card { margin: 1.4em 0; }
.kg-image { max-width: 100%; height: auto; }
.kg-bookmark-card a { display: flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; text-decoration: none; }
.kg-bookmark-content { padding: 12px 16px; flex: 1; }
.kg-bookmark-thumbnail { width: 150px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 文章页右下角悬浮目录 ===== */
.content h2, .content h3 { scroll-margin-top: 24px; }
.toc-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.toc-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.toc-fab:hover, .toc-fab.is-open {
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}
.toc-pop {
  width: min(300px, calc(100vw - 32px));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
  overflow: hidden;
}
.toc-pop[hidden] { display: none; }
.toc-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.toc-top-btn {
  border: 0;
  background: none;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--mut);
  cursor: pointer;
}
.toc-top-btn:hover { color: var(--brand); background: var(--line-s); }
.toc-list {
  flex: 1;
  min-height: 0;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.toc-a {
  display: block;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-a.is-h2 { padding-left: 16px; }
.toc-a.is-h3 { padding-left: 26px; font-size: 12px; color: var(--mut); }
.toc-a:hover { background: var(--line-s); color: var(--text); }
.toc-a.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ===== 响应式断点 ===== */
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .side { position: static; }
}

@media (max-width: 960px) {
  .app-shell { display: block; }
  .m-hd { display: flex; }
  .rail {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    width: 248px;
  }
  .rail.open { transform: translateX(0); }
  .rail-close { display: grid !important; }
  .stage-in { padding: 18px 16px 40px; }
  .art { padding: 22px 18px; }
  .kg-width-wide, .kg-width-full { margin-left: 0; margin-right: 0; max-width: 100%; }
}

@media (max-width: 680px) {
  .bento-grid { grid-template-columns: 1fr; }
  .b-card[data-idx="1"] { grid-row: auto; padding: 16px 18px; }
  .b-card[data-idx="1"] .b-title { font-size: 17px; }
  .r-item { padding: 13px 14px; gap: 10px; }
  .r-no { width: 20px; font-size: 11.5px; }
  .r-title { font-size: 14.5px; }
  .r-side { min-width: 48px; }
  .pn { grid-template-columns: 1fr; }
  .pn-r { grid-column: auto; }
}

@media (max-width: 480px) {
  .d-panel.on { grid-template-columns: 1fr; }
}
