/* ===== 工具箱 Toolbox — 共享样式 ===== */
:root {
  --ink: #111827;
  --body: #4b5563;
  --sub: #6b7280;
  --faint: #9ca3af;
  --hairline: #ededf2;
  --line: #e5e7eb;
  --bg: #ffffff;
  --section: #f9f9fb;
  --chip: #f3f4f6;
  --indigo: #6366f1;
  --indigo-dark: #4f46e5;
  --indigo-light: #eef2ff;
  --indigo-badge: #e0e7ff;
  --green: #059669;
  --green-light: #ecfdf5;
  --footer: #111827;
  --radius-card: 16px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== 顶部导航 ===== */
.site-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.brand svg { display: block; }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: 14px; }
.site-nav a { color: var(--body); }
.site-nav a.active { color: var(--indigo); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  height: 36px;
  padding: 0 14px;
  border-radius: 18px;
  background: var(--chip);
  color: var(--faint);
  font-size: 13px;
  border: none;
  cursor: text;
}
.search-pill input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--ink);
  font-family: inherit;
}
.btn-outline-indigo {
  height: 36px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--indigo);
  color: var(--indigo-dark);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ===== 首页 Hero ===== */
.hero {
  padding: 88px 120px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: linear-gradient(to bottom, #eef2ff, #ffffff);
  text-align: center;
}
.badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--indigo-badge);
  color: var(--indigo-dark);
  font-size: 13px;
  font-weight: 600;
}
.hero h1 { font-size: 60px; font-weight: 700; letter-spacing: -0.5px; }
.hero .sub {
  font-size: 17px;
  color: var(--sub);
  max-width: 720px;
  line-height: 28px;
}
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 620px;
  max-width: 100%;
  height: 56px;
  padding: 0 8px 0 20px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px -8px rgba(26, 26, 77, 0.12);
}
.hero-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
}
.hero-search input::placeholder { color: var(--faint); }
.hero-search button {
  height: 42px;
  padding: 0 26px;
  border-radius: 21px;
  border: none;
  background: var(--indigo);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.hot-tags { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hot-tags .label { font-size: 13px; color: var(--faint); }
.tag-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--body);
}

/* ===== 通用 Section ===== */
.section { padding: 72px 120px; }
.section.gray { background: var(--section); }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}
.section-head h2 { font-size: 30px; font-weight: 700; }
.section-head .desc { font-size: 15px; color: var(--sub); margin-top: 8px; }
.section-head.center { flex-direction: column; justify-content: center; text-align: center; }
.link-more {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--indigo-dark);
  font-size: 14px;
  font-weight: 600;
}

/* ===== 工具大卡（首页） ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.tool-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(17, 24, 39, 0.12);
}
.tool-card .icon { width: 44px; height: 44px; }
.tool-card h3 { font-size: 16px; font-weight: 600; }
.tool-card p { font-size: 13px; color: var(--sub); line-height: 20px; }
.tool-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.cat-tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.cat-dev { background: var(--indigo-light); color: var(--indigo-dark); }
.cat-dev-green { background: var(--green-light); color: var(--green); }
.cat-av { background: #fdf2f8; color: #db2777; }
.cat-img { background: #fffbeb; color: #d97706; }
.cat-img-cyan { background: #ecfeff; color: #0891b2; }
.cat-life { background: #f5f3ff; color: #7c3aed; }
.cat-dev-orange { background: #fff7ed; color: #ea580c; }
.cat-dev-teal { background: #f0fdfa; color: #0d9488; }
.usage { font-size: 12px; color: var(--faint); }

/* ===== 分类卡 ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px;
}
.cat-card .left { display: flex; align-items: center; gap: 14px; }
.cat-card h3 { font-size: 16px; font-weight: 600; }
.cat-card .count { font-size: 13px; color: var(--faint); margin-top: 4px; }

/* ===== 特性 ===== */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature h3 { font-size: 18px; font-weight: 600; margin: 14px 0 8px; }
.feature p { font-size: 14px; color: var(--sub); line-height: 22px; }
.feature .icon { width: 44px; height: 44px; }

/* ===== 页脚 ===== */
.site-footer { background: var(--footer); padding: 64px 120px 32px; color: #fff; }
.footer-top { display: flex; gap: 80px; }
.footer-brand { width: 320px; flex-shrink: 0; }
.footer-brand .logo-row { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.footer-brand p { margin-top: 14px; font-size: 13px; color: var(--faint); line-height: 20px; }
.footer-group { flex: 1; }
.footer-group h4 { font-size: 13px; font-weight: 600; color: #e5e7eb; margin-bottom: 12px; }
.footer-group li { margin-bottom: 12px; }
.footer-group a { font-size: 13px; color: var(--faint); }
.footer-group a:hover { color: #fff; }
.footer-divider { height: 1px; background: #1f2937; margin: 48px 0 32px; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sub);
}

/* ===== 列表页 ===== */
.list-head { padding: 48px 120px 28px; }
.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.list-title-row h1 { font-size: 32px; font-weight: 700; }
.list-title-row .count { font-size: 14px; color: var(--sub); margin-top: 6px; }
.list-search { width: 260px; height: 40px; border-radius: 20px; padding: 0 16px; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tab {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--body);
  cursor: pointer;
  font-family: inherit;
}
.tab.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.list-grid { padding: 8px 120px 72px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tool-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(17, 24, 39, 0.1); }
.tool-item .icon { width: 40px; height: 40px; flex-shrink: 0; }
.tool-item h3 { font-size: 15px; font-weight: 600; }
.tool-item p { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* ===== 详情页 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 120px 0;
  font-size: 13px;
  color: var(--faint);
}
.breadcrumb .sep { color: #d1d5db; }
.breadcrumb .current { color: var(--ink); font-weight: 500; }
.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 120px 40px;
}
.tool-hero .left { display: flex; align-items: center; gap: 20px; }
.tool-hero .icon { width: 72px; height: 72px; flex-shrink: 0; }
.tool-hero h1 { font-size: 32px; font-weight: 700; }
.tool-hero .desc { font-size: 15px; color: var(--sub); line-height: 24px; max-width: 620px; margin-top: 8px; }
.tool-hero .meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--faint); }
.tool-hero .actions { display: flex; gap: 12px; flex-shrink: 0; }
.btn-primary {
  height: 44px;
  padding: 0 28px;
  border-radius: 22px;
  border: none;
  background: var(--indigo);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-ghost-lg {
  height: 44px;
  padding: 0 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.detail-section { padding: 8px 120px 56px; }
.detail-section h2 { font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 620px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 4px;
}
.step-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card { background: var(--section); border-radius: 16px; padding: 20px; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--indigo-badge);
  color: var(--indigo-dark);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-card h3 { font-size: 16px; font-weight: 600; margin: 12px 0 8px; }
.step-card p { font-size: 13px; color: var(--sub); line-height: 20px; }

/* ===== 工具使用页 ===== */
.tool-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--chip);
  overflow: hidden;
}
.app-header {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.app-header .left { display: flex; align-items: center; gap: 12px; }
.app-header .name { font-size: 16px; font-weight: 600; }
.app-header .right { display: flex; align-items: center; gap: 12px; }
.back-link { font-size: 13px; color: var(--sub); }
.btn-sm {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-sm.primary { background: var(--indigo); border-color: var(--indigo); color: #fff; font-weight: 600; }
.btn-sm.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.toolbar .group { display: flex; gap: 8px; }
.app-body { flex: 1; display: flex; min-height: 0; }
.options-panel {
  width: 248px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--hairline);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}
.opt-label { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 10px; }
.indent-pills { display: flex; gap: 8px; }
.indent-pill {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--chip);
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
}
.indent-pill.active { background: var(--indigo-light); color: var(--indigo-dark); font-weight: 600; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--body);
}
.switch {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #e5e7eb;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s ease;
}
.switch .knob {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.15s ease;
}
.switch.on { background: var(--indigo); }
.switch.on .knob { transform: translateX(16px); }
.editors {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
  min-width: 0;
}
.editor {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f2f2f5;
}
.editor-head .label { font-size: 13px; font-weight: 600; color: #374151; }
.editor-chip { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.editor-chip.gray { background: var(--chip); color: var(--sub); }
.editor-chip.green { background: var(--green-light); color: var(--green); }
.editor textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: #374151;
  background: transparent;
}
.status-bar {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: #fff;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
}
.status-bar .ok { color: var(--green); font-weight: 500; }
.status-bar .meta { color: var(--faint); }

/* ===== 响应式 ===== */
@media (max-width: 960px) {
  .site-header { padding: 0 20px; }
  .site-nav { display: none; }
  .hero, .section, .list-head, .list-grid, .breadcrumb, .tool-hero, .detail-section { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 36px; }
  .tool-grid, .cat-grid, .list-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-row, .step-row { grid-template-columns: 1fr; }
  .site-footer { padding: 48px 20px 24px; }
  .footer-top { flex-direction: column; gap: 32px; }
  .tool-hero { flex-direction: column; align-items: flex-start; }
  .options-panel { display: none; }
  .editors { flex-direction: column; }
}

/* ===== 文章列表页 ===== */
.featured-card {
  display: flex;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 32px;
}
.featured-cover { width: 380px; flex-shrink: 0; min-height: 220px; }
.featured-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}
.featured-body h2 { font-size: 22px; font-weight: 700; line-height: 32px; }
.featured-body p.excerpt { font-size: 14px; color: var(--sub); line-height: 22px; }
.featured-body .link-more { margin-top: auto; }
.badge-amber { padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #b45309; font-size: 12px; font-weight: 500; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -8px rgba(17, 24, 39, 0.12); }
.article-card .cover { height: 170px; }
.article-card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card h3 { font-size: 16px; font-weight: 600; line-height: 24px; }
.article-card .excerpt { font-size: 13px; color: var(--sub); line-height: 20px; }
.article-card .meta { font-size: 12px; color: var(--faint); margin-top: auto; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.page-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
  font-family: inherit;
}
.page-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

/* ===== 文章详情页 ===== */
.article-head { padding: 24px 120px 32px; }
.article-head h1 { font-size: 36px; font-weight: 700; line-height: 48px; margin: 14px 0; max-width: 900px; }
.article-meta { font-size: 13px; color: var(--faint); }

.article-main {
  padding: 0 120px 64px;
  display: flex;
  gap: 48px;
  align-items: flex-start;
}
.article-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.article-cover { height: 340px; border-radius: 16px; }
.article-content p { font-size: 15px; line-height: 26px; color: #4b5563; }
.article-content h2 { font-size: 22px; font-weight: 700; margin-top: 8px; }
.code-block {
  background: var(--ink);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
}
.code-block pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: #e5e7eb;
  white-space: pre;
}
.tags { font-size: 13px; color: var(--indigo-dark); font-weight: 500; margin-top: 8px; }
.prevnext {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--hairline);
  padding: 16px 0 0;
  font-size: 14px;
  color: var(--sub);
}
.prevnext .next { text-align: right; }

.article-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 80px;
}
.side-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.side-card h4 { font-size: 14px; font-weight: 600; }
.toc-item { font-size: 13px; color: var(--sub); }
.toc-item.active { color: var(--indigo-dark); font-weight: 600; }
.rel-item { display: flex; align-items: center; gap: 10px; }
.rel-item .texts { flex: 1; min-width: 0; }
.rel-item h5 { font-size: 13px; font-weight: 600; }
.rel-item .d { font-size: 11px; color: var(--faint); margin-top: 2px; }
.hot-item { display: flex; flex-direction: column; gap: 2px; }
.hot-item h5 { font-size: 13px; font-weight: 500; }
.hot-item .m { font-size: 11px; color: var(--faint); }

@media (max-width: 960px) {
  .featured-card { flex-direction: column; }
  .featured-cover { width: 100%; height: 180px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-head, .article-main { padding-left: 20px; padding-right: 20px; }
  .article-main { flex-direction: column; }
  .article-sidebar { width: 100%; position: static; }
}
