/* vim技术网 (www.scmbob.org) - Local Design System */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --text-muted: #64748b;
  --brand-blue: #0e63a8;
  --brand-sky: #1e88d6;
  --brand-orange: #e66e00;
  --brand-orange-soft: #fff4e8;
  --brand-blue-soft: #eef6fc;
  --term-bg: #0f172a;
  --term-bar: #1e293b;
  --term-text: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-blue);
  text-decoration: none;
}

a:hover {
  color: var(--brand-orange);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code, pre {
  font-family: var(--font-mono);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 44px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.nav-item {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.nav-item.is-active {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-alt);
  padding: 2px 4px 2px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.header-search:focus-within {
  border-color: var(--brand-blue);
  background: #fff;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.86rem;
  color: var(--text);
  width: 148px;
}

.header-search button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 7px;
  border-radius: 999px;
}

.header-search button:hover {
  color: var(--brand-blue);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Announcement Banner */
.announce-bar {
  background: linear-gradient(90deg, #fff8ef 0%, #f1f7fd 100%);
  border-bottom: 1px solid #e6dfd5;
}

.announce-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.announce-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  flex-shrink: 0;
}

.announce-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  word-break: break-word;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 0.94rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--brand-blue);
  color: #fff;
}

.btn-primary:hover {
  background: #0b518b;
  color: #fff;
}

.btn-outline {
  background: #fff;
  color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.btn-outline:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-orange);
  padding-left: 8px;
  padding-right: 8px;
}

.btn-ghost:hover {
  color: #c55d00;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero-section {
  background: radial-gradient(circle at 12% 10%, #eaf4fc 0%, #ffffff 52%, #fff8f0 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 54px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: 36px;
  align-items: center;
}

.hero-kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  border: 1px solid #cfe3f5;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--text);
}

.accent-blue { color: var(--brand-blue); }
.accent-orange { color: var(--brand-orange); }

.hero-lead {
  margin: 0 0 22px;
  color: var(--text-2);
  font-size: 1.02rem;
}

.hero-lead code {
  background: var(--brand-orange-soft);
  color: #b85600;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  box-shadow: var(--shadow-sm);
}

.stat-pill strong {
  font-size: 1.15rem;
  color: var(--brand-blue);
  font-family: var(--font-mono);
}

.stat-pill span {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Terminal Card */
.hero-terminal {
  background: var(--term-bg);
  color: var(--term-text);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  border: 1px solid #334155;
  min-width: 0;
}

.term-bar {
  background: var(--term-bar);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid #334155;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-r { background: #ef4444; }
.dot-y { background: #f59e0b; }
.dot-g { background: #22c55e; }

.term-title {
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-body {
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.65;
  overflow-x: auto;
}

.term-line {
  margin-bottom: 6px;
  word-break: break-all;
}

.t-prompt { color: #38bdf8; font-weight: 700; margin-right: 6px; }
.t-cmd { color: #f8fafc; }
.t-comment { color: #94a3b8; }
.t-mode { color: #fb923c; font-weight: 700; margin-right: 6px; }
.t-key { color: #fde047; font-weight: 700; }
.term-divider { height: 1px; background: #1e293b; margin: 12px 0; }
.term-out { color: #cbd5e1; padding-left: 14px; border-left: 2px solid #334155; margin: 6px 0; }
.t-ok { color: #4ade80; border-left-color: #22c55e; }

/* Sections */
.section {
  padding: 46px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0 0 4px;
  font-size: 1.45rem;
  line-height: 1.3;
}

.section-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.more-link {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand-blue);
  white-space: nowrap;
}

/* Topic Cards */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.topic-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-card:hover {
  border-color: var(--brand-sky);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.topic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.topic-tag, .cat-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tag-c, #0e63a8) 12%, #ffffff);
  color: var(--tag-c, #0e63a8);
}

.topic-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.topic-card h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.topic-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Featured Grid */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.featured-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.meta-dot::before {
  content: "·";
  margin-right: 8px;
  color: var(--border-strong);
}

.featured-title {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.4;
}

.featured-title a {
  color: var(--text);
}

.featured-title a:hover {
  color: var(--brand-blue);
}

.card-excerpt {
  margin: 0;
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.65;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.mini-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 6px;
}

.mini-tag:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

/* Cheat Mini Grid */
.cheat-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cheat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-width: 0;
}

.cheat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cheat-group {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  padding: 2px 8px;
  border-radius: 5px;
}

.cheat-cmd {
  background: var(--term-bg);
  color: #38bdf8;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.84rem;
  overflow-x: auto;
  margin-bottom: 8px;
}

.cheat-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-2);
}

.copy-btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.copy-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.copy-btn.is-copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

/* Home Split & Lists */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.article-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.article-row-title {
  margin: 8px 0 8px;
  font-size: 1.14rem;
  line-height: 1.4;
}

.article-row-title a {
  color: var(--text);
}

.article-row-title a:hover {
  color: var(--brand-blue);
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.side-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.side-box h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.side-tools {
  background: linear-gradient(180deg, #f3f9ff 0%, #ffffff 100%);
  border-color: #cde1f4;
}

.side-note {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.tool-links {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-links li a {
  display: block;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.tool-links li a:hover {
  border-color: var(--brand-blue);
}

.tool-links strong {
  display: block;
  font-size: 0.9rem;
  color: var(--brand-blue);
}

.tool-links span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cloud-tag {
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.cloud-tag:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

/* Page Banner */
.page-banner {
  background: linear-gradient(180deg, #f3f8fd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 30px;
}

.page-banner-compact {
  padding: 24px 0 26px;
}

.breadcrumb {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-banner h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  line-height: 1.3;
}

.banner-desc {
  margin: 0;
  color: var(--text-2);
  max-width: 780px;
}

.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.topic-tab {
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 0.86rem;
  font-weight: 500;
}

.topic-tab.is-active, .topic-tab:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.list-summary {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Rank List */
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
}

.rank-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.rank-list a {
  color: var(--text-2);
}

.rank-list a:hover {
  color: var(--brand-blue);
}

.side-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Article Detail */
.article-h1 {
  margin: 10px 0 12px;
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  line-height: 1.3;
}

.article-summary {
  margin: 0;
  color: var(--text-2);
  font-size: 1rem;
  max-width: 840px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 32px;
  align-items: start;
}

.article-main {
  min-width: 0;
}

.article-aside {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.86rem;
}

.toc-lv-3 {
  padding-left: 14px;
}

.toc-list a {
  color: var(--text-2);
  display: block;
  padding: 3px 0;
}

.toc-list a:hover {
  color: var(--brand-blue);
}

.mobile-toc {
  display: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 22px;
}

.mobile-toc summary {
  font-weight: 600;
  cursor: pointer;
}

.mobile-toc ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
}

/* Prose */
.prose {
  font-size: 1.02rem;
  line-height: 1.82;
  color: var(--text);
}

.prose h2 {
  margin: 30px 0 12px;
  font-size: 1.38rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.prose h3 {
  margin: 22px 0 10px;
  font-size: 1.12rem;
  scroll-margin-top: 84px;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul, .prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 6px;
}

.prose code {
  background: #f1f5f9;
  color: #be4d00;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
}

.prose pre {
  position: relative;
  background: var(--term-bg);
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  max-width: 100%;
  margin: 16px 0 20px;
  font-size: 0.87rem;
  line-height: 1.6;
}

.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.prose blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--brand-blue);
  background: var(--brand-blue-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
}

.prose .callout {
  background: var(--brand-orange-soft);
  border: 1px solid #f7d9b8;
  border-left: 4px solid var(--brand-orange);
  padding: 14px 16px;
  border-radius: 8px;
  margin: 18px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}

.prose th {
  background: var(--bg-alt);
  font-weight: 600;
}

.pre-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(30, 41, 59, 0.92);
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 6px;
  font-size: 0.74rem;
  padding: 3px 9px;
  cursor: pointer;
}

.pre-copy-btn:hover {
  color: #fff;
  border-color: #38bdf8;
}

.article-footer-bar {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-notice {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.related-section {
  margin-top: 34px;
}

.related-section h2 {
  font-size: 1.25rem;
  margin: 0 0 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 16px;
  color: var(--text);
}

.related-card:hover {
  border-color: var(--brand-blue);
  color: var(--text);
}

.related-cat {
  font-size: 0.78rem;
  color: var(--brand-blue);
  font-weight: 600;
}

.related-card h3 {
  margin: 6px 0;
  font-size: 1rem;
  line-height: 1.4;
}

.related-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cheatsheet Page */
.cheat-toolbar {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cheat-search-input {
  width: 100%;
  max-width: 560px;
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
}

.cheat-search-input:focus {
  outline: none;
  border-color: var(--brand-blue);
}

.cheat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  cursor: pointer;
}

.pill-btn.is-active, .pill-btn:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}

.cheat-section {
  margin-bottom: 32px;
}

.cheat-section-title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--brand-blue);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.cheat-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cheat-table th, .cheat-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.cheat-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text-2);
}

.cheat-table tr:last-child td {
  border-bottom: none;
}

.cmd-chip {
  display: inline-block;
  background: var(--term-bg);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.84rem;
}

.example-chip {
  display: inline-block;
  background: #f1f5f9;
  color: #0f172a;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.82rem;
  word-break: break-all;
}

/* Tools Page */
.tools-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tool-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.tool-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--brand-orange);
  background: var(--brand-orange-soft);
  padding: 3px 9px;
  border-radius: 6px;
}

.tool-head h2 {
  margin: 8px 0 6px;
  font-size: 1.25rem;
}

.tool-head p {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 0.93rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
  align-items: start;
}

.tool-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-2);
}

.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  background: #fff;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-2);
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.tool-output {
  background: var(--term-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #334155;
  min-width: 0;
}

.out-bar {
  background: var(--term-bar);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #cbd5e1;
}

.code-out {
  margin: 0;
  padding: 14px 16px;
  color: #e2e8f0;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  max-width: 100%;
}

.out-tip {
  margin: 0;
  padding: 9px 16px 12px;
  font-size: 0.8rem;
  color: #94a3b8;
  border-top: 1px solid #1e293b;
}

/* Search & About & 404 */
.search-page-form {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  max-width: 640px;
}

.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 0.96rem;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.stat-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.empty-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  color: var(--text-2);
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 800;
  color: var(--brand-blue);
  line-height: 1;
  margin-bottom: 10px;
}

.pagination {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.page-btn {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
}

.page-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: #f8fafc;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  padding-top: 38px;
  padding-bottom: 32px;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 12px;
}

.footer-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 420px;
}

.footer-col h3 {
  margin: 0 0 12px;
  font-size: 0.96rem;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.88rem;
}

.footer-col a {
  color: var(--text-2);
}

.footer-col a:hover {
  color: var(--brand-blue);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom p {
  margin: 0;
}

.footer-beian a {
  color: var(--text-muted);
}

.footer-beian a:hover {
  color: var(--brand-blue);
}

/* Responsive Breakpoints */
@media (max-width: 1080px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    box-shadow: var(--shadow);
  }
  .main-nav.is-open {
    display: flex;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .hero-grid,
  .home-split,
  .article-layout,
  .about-grid,
  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-aside {
    position: static;
  }
  .toc-box {
    display: none;
  }
  .mobile-toc {
    display: block;
  }
}

@media (max-width: 820px) {
  .topic-grid,
  .cheat-mini-grid,
  .featured-grid,
  .related-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 540px) {
  .container {
    padding: 0 14px;
  }
  .header-inner {
    min-height: 60px;
    gap: 8px;
  }
  .brand-logo {
    height: 36px;
  }
  .header-search input {
    width: 104px;
    font-size: 0.82rem;
  }
  .announce-inner {
    align-items: flex-start;
    gap: 8px;
  }
  .hero-section {
    padding: 28px 0 34px;
  }
  .section {
    padding: 32px 0;
  }
  .tool-card {
    padding: 16px;
  }
  .search-page-form {
    flex-direction: column;
  }
}
