/* ===== 工具箱 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 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  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(3, 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;
}
.ext-note {
  font-size: 12px;
  color: var(--sub);
  align-self: center;
  line-height: 1.5;
}
.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;
  overflow: hidden;
}
.screenshot-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}
.prose { font-size: 15px; line-height: 1.75; color: var(--body); overflow-wrap: break-word; word-break: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.6em; }
.prose li { margin: 0.25em 0; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { font-weight: 700; color: #111827; margin: 1.2em 0 0.6em; }
.prose a { color: var(--indigo-dark); text-decoration: underline; }
.prose code { font-family: var(--mono); font-size: 13px; background: var(--chip); color: #db2777; padding: 0.15em 0.4em; border-radius: 4px; }
.prose pre { background: #f6f8fa; border: 1px solid var(--hairline); border-radius: 10px; padding: 16px; overflow-x: auto; }
.prose blockquote { border-left: 4px solid var(--indigo-badge); background: var(--section); margin: 0 0 1em; padding: 10px 16px; border-radius: 0 8px 8px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1em auto; border-radius: 8px; }
.prose iframe, .prose video { max-width: 100%; height: auto; }
.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: calc(100vh - 64px);
  height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--chip);
  overflow: hidden;
}
#toolAppBody {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  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;
  min-height: 0;
  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); }

/* ===== Markdown 在线编辑器 ===== */
.md-editors.mode-edit #previewPane { display: none; }
.md-editors.mode-preview #editorPane { display: none; }
.code-area { flex: 1; display: flex; min-height: 0; }
.line-numbers {
  width: 44px;
  flex-shrink: 0;
  text-align: right;
  padding: 16px 10px 16px 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 22px;
  color: #cbd5e1;
  background: #fafafa;
  border-right: 1px solid var(--hairline);
  overflow: hidden;
  user-select: none;
  white-space: pre;
}
.editor .code-area textarea { height: 100%; }
.md-preview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  background: #fff;
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  word-wrap: break-word;
}
.md-preview > *:first-child { margin-top: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4, .md-preview h5, .md-preview h6 {
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  margin: 1.2em 0 0.6em;
}
.md-preview h1 { font-size: 28px; border-bottom: 1px solid var(--hairline); padding-bottom: 8px; }
.md-preview h2 { font-size: 22px; border-bottom: 1px solid var(--hairline); padding-bottom: 6px; }
.md-preview h3 { font-size: 18px; }
.md-preview h4 { font-size: 16px; }
.md-preview h5 { font-size: 15px; }
.md-preview h6 { font-size: 14px; color: var(--sub); }
.md-preview p { margin: 0 0 1em; }
.md-preview a { color: var(--indigo-dark); text-decoration: underline; }
.md-preview ul, .md-preview ol { margin: 0 0 1em; padding-left: 1.6em; }
.md-preview ul { list-style: disc; }
.md-preview ol { list-style: decimal; }
.md-preview li { margin: 0.25em 0; }
.md-preview li > ul, .md-preview li > ol { margin-bottom: 0; }
.md-preview blockquote {
  border-left: 4px solid var(--indigo-badge);
  background: var(--section);
  margin: 0 0 1em;
  padding: 10px 16px;
  color: var(--body);
  border-radius: 0 8px 8px 0;
}
.md-preview blockquote p { margin: 0; }
.md-preview code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--chip);
  color: #db2777;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.md-preview pre {
  background: #f6f8fa;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 1em;
}
.md-preview pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  display: block;
  line-height: 22px;
  font-size: 13px;
}
.md-preview table { border-collapse: collapse; width: 100%; margin: 0 0 1em; font-size: 14px; }
.md-preview th, .md-preview td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.md-preview th { background: var(--chip); font-weight: 600; }
.md-preview tr:nth-child(even) td { background: var(--section); }
.md-preview img { max-width: 100%; border-radius: 8px; }
.md-preview hr { border: none; border-top: 1px solid var(--line); margin: 1.5em 0; }
.md-preview input[type="checkbox"] { margin-right: 6px; }
.md-preview.dark { background: #0d1117; color: #c9d1d9; }
.md-preview.dark h1, .md-preview.dark h2, .md-preview.dark h3, .md-preview.dark h4, .md-preview.dark h5, .md-preview.dark h6 { color: #e6edf3; }
.md-preview.dark h1, .md-preview.dark h2 { border-bottom-color: #30363d; }
.md-preview.dark blockquote { background: #161b22; border-left-color: #30363d; color: #8b949e; }
.md-preview.dark code { background: #21262d; color: #79c0ff; }
.md-preview.dark pre { background: #161b22; border-color: #30363d; }
.md-preview.dark a { color: #58a6ff; }
.md-preview.dark th { background: #161b22; }
.md-preview.dark th, .md-preview.dark td { border-color: #30363d; }
.md-preview.dark tr:nth-child(even) td { background: #161b22; }
.md-preview.dark hr { border-top-color: #30363d; }
@media (max-width: 960px) {
  .md-editors { flex-direction: column; }
  .md-editors.mode-edit #previewPane { display: none; }
  .md-editors.mode-preview #editorPane { display: none; }
}

/* ===== 响应式 ===== */
@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; }
  .app-header { padding: 0 12px; }
  .app-header .name { white-space: nowrap; }
  .app-header .cat-tag { display: none; }
  .app-header .right { gap: 6px; }
  .back-link { font-size: 12px; white-space: nowrap; }
  .toolbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .toolbar .group { flex-wrap: wrap; gap: 6px; }
  .btn-sm { white-space: nowrap; padding: 0 10px; }
}

/* ===== 文章列表页 ===== */
.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; }
}

/* ===== PDF 工具通用界面 ===== */
.pdf-body {
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  gap: 16px;
  align-items: stretch;
}
.pdf-drop {
  flex-shrink: 0;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pdf-drop strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.pdf-drop span { font-size: 13px; color: var(--sub); }
.pdf-drop:hover, .pdf-drop.drag { border-color: var(--indigo); background: var(--indigo-light); }

.pdf-panel {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 18px;
}
.pdf-panel-grow { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.pdf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pdf-panel-title { font-size: 14px; font-weight: 600; color: #374151; }
.pdf-inline-hint { font-size: 12px; color: var(--sub); }
.pdf-inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sub);
}
.pdf-inline-field input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}

.pdf-form { display: flex; flex-direction: column; gap: 14px; }
.pdf-form-row { flex-direction: row; flex-wrap: wrap; gap: 18px; }
.pdf-form-row .pdf-field { flex: 1 1 180px; }
.pdf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pdf-field > label { font-size: 13px; font-weight: 600; color: #374151; }
.pdf-field input[type="text"], .pdf-field input[type="number"], .pdf-field select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  width: 100%;
  max-width: 320px;
}
.pdf-field input[type="color"] {
  width: 56px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.pdf-field input[type="range"] { width: 100%; max-width: 280px; accent-color: var(--indigo); }
.pdf-field input:disabled { background: var(--chip); color: var(--faint); }
.pdf-hint { font-size: 12px; color: var(--faint); line-height: 1.6; }
.pdf-value { font-weight: 500; color: var(--indigo-dark); }
.pdf-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #374151; }
.pdf-check input { width: 15px; height: 15px; accent-color: var(--indigo); }
.pdf-result { font-size: 13px; color: var(--body); line-height: 1.7; }

.pdf-list { display: flex; flex-direction: column; gap: 8px; }
.pdf-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--section);
}
.pdf-idx {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--indigo-badge);
  color: var(--indigo-dark);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-size { flex-shrink: 0; font-size: 12px; color: var(--faint); }
.pdf-ops { flex-shrink: 0; display: flex; gap: 6px; }
.pdf-mini {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--body);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.pdf-mini:hover:not(:disabled) { border-color: var(--indigo); color: var(--indigo-dark); }
.pdf-mini:disabled { opacity: .4; cursor: not-allowed; }
.pdf-muted { font-size: 13px; color: var(--faint); margin: 0; }
.pdf-thumb-sm {
  flex-shrink: 0;
  width: 34px;
  height: 42px;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdf-thumb-sm img { width: 100%; height: 100%; object-fit: cover; }

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.pdf-page {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--section);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pdf-page.deleted { opacity: .45; }
.pdf-page.deleted .pdf-page-thumb { filter: grayscale(1); }
.pdf-page-thumb {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
}
.pdf-page-thumb canvas, .pdf-page-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .15s;
}
.pdf-page-no { font-size: 12px; color: var(--sub); text-align: center; }
.pdf-page-ops { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.pdf-page-ops .pdf-mini { padding: 0 8px; height: 24px; }

.pdf-sign-pad {
  position: relative;
  height: 200px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.pdf-sign-pad canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.pdf-sign-tip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  color: var(--faint);
  pointer-events: none;
}
.pdf-sign-preview img { max-width: 220px; max-height: 90px; display: block; }

.pdf-textarea {
  flex: 1 1 auto;
  min-height: 320px;
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  background: #fff;
  resize: vertical;
  outline: none;
}

/* ===== 服务端转换工具（上传 / 排队轮询 / 下载结果） ===== */
.srv-notice {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--indigo-light);
  color: #4338CA;
  font-size: 12px;
  line-height: 1.7;
}
.srv-disabled {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #FEF2F2;
  color: #B91C1C;
  font-size: 12px;
  line-height: 1.7;
}
.srv-progress { flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.srv-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--chip);
  overflow: hidden;
}
.srv-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--indigo), #8B5CF6);
  transition: width .3s;
}
.srv-bar.busy > span {
  width: 100%;
  background: linear-gradient(90deg, var(--indigo), #8B5CF6, var(--indigo));
  background-size: 200% 100%;
  animation: srv-shimmer 1.4s linear infinite;
}
@keyframes srv-shimmer {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}
.srv-progress-text { font-size: 13px; color: var(--sub); }
.srv-progress-text.error { color: #DC2626; }
.srv-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.srv-result-name {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.srv-result-size { flex-shrink: 0; font-size: 12px; color: var(--faint); }
.srv-result-tip { flex-basis: 100%; font-size: 12px; color: var(--faint); line-height: 1.7; }
.srv-download {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--indigo);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.srv-download:hover { background: var(--indigo-dark); }
.srv-progress[hidden], .pdf-panel[hidden], .srv-disabled[hidden] { display: none; }

@media (max-width: 960px) {
  .pdf-body { padding: 14px; }
  .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .pdf-page-thumb { height: 140px; }
  .pdf-form-row { flex-direction: column; gap: 14px; }
}
