/* cf-static — Global Styles */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text2: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --max-w: 960px;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --surface: #f8f9fa;
    --border: #e2e5e9;
    --text: #1a1d27;
    --text2: #6b7280;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #16a34a;
    --error: #dc2626;
    --warning: #d97706;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── Main ── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
}

/* ── 覆盖 app-layout 下的 main ── */
.app-layout > main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ── Hero ── */
.hero-description {
  color: var(--text2);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  margin-top: 0.8rem;
}

.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.8rem;
}

.hero .description {
  color: var(--text2);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Tools Grid ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tool-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.8rem;
}

.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.tool-card p {
  color: var(--text2);
  font-size: 0.85rem;
}

/* ── Tool Area ── */
.tool-area {
  margin: 2rem 0;
}

.tool-container textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.tool-input,
.tool-output {
  margin-bottom: 1rem;
}

.tool-input textarea {
  min-height: 150px;
}

.tool-output textarea {
  min-height: 150px;
  background: var(--bg);
}

.tool-actions {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary:hover { border-color: var(--accent); }

/* ── FAQ ── */
.faq {
  margin-top: 3rem;
}

.faq h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

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

.faq details p {
  margin-top: 0.8rem;
  color: var(--text2);
}

/* ── Footer ── */
footer {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  transition: margin-left 0.3s ease;
  color: var(--text2);
  font-size: 0.85rem;
}

footer nav {
  justify-content: center;
  margin-top: 0.5rem;
}

footer nav a {
  color: var(--text2);
  text-decoration: none;
  margin: 0 0.8rem;
}

footer nav a:hover { color: var(--accent); }

/* ── Article/Blog ── */
.article-container {
  max-width: 720px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.article-date {
  color: var(--text2);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.article-description {
  color: var(--text2);
  font-size: 1.05rem;
  line-height: 1.6;
}

.article-content {
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-content h3 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.article-content p {
  margin-bottom: 1.2rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content code {
  background: var(--surface);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
}

.article-content a:hover {
  color: var(--accent-hover);
}

/* ── Docs ── */
.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.docs-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.docs-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.docs-nav h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 0.8rem;
  letter-spacing: 0.05em;
}

.docs-nav ul {
  list-style: none;
  padding: 0;
}

.docs-nav li {
  margin-bottom: 0.5rem;
}

.docs-nav a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.docs-nav a:hover, .docs-nav a.active {
  color: var(--accent);
}

.docs-content {
  min-width: 0;
}

.docs-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.docs-pagination a {
  color: var(--accent);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.docs-pagination a:hover {
  border-color: var(--accent);
}

/* ── Lists ── */
.posts-list, .docs-list {
  display: grid;
  gap: 1.2rem;
  margin-top: 2rem;
}

.post-card, .doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}

.post-card:hover, .doc-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.post-card time, .doc-card time {
  color: var(--text2);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

.post-card h3, .doc-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.post-card p, .doc-card p {
  color: var(--text2);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Status Messages ── */
.error {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.success {
  color: var(--success);
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid var(--success);
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text2);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .separator {
  color: var(--border);
  user-select: none;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

/* ── Related Tools ── */
.related-tools {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-tools h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text2);
}

.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}

.related-tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s;
  font-size: 0.9rem;
}

.related-tool-card:hover {
  border-color: var(--accent);
}

.related-tool-card .tool-icon {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.related-tool-card h4 {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.related-tool-card p {
  color: var(--text2);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .tools-grid { grid-template-columns: 1fr; }
  main { padding: 1rem; }
  .article-header h1 { font-size: 1.5rem; }
  .article-content h2 { font-size: 1.3rem; }
  .docs-pagination { flex-direction: column; gap: 0.8rem; }
}

/* ── Print ── */
@media print {
  header, footer, .nav-links, .tool-actions, .related-tools, .breadcrumb { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
  main { padding: 0; }
}

/* ── 分类系统 ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: block;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.category-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  color: var(--accent);
}

.category-count {
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 1rem;
}

.category-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-tool {
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 0.5rem;
}

.preview-more {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  padding: 0.5rem;
}

.tool-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--accent);
  color: white;
  border-radius: 1rem;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

.related-categories {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.category-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.category-tag:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.category-tag.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

/* ── Posts & Docs Grid ── */
.posts-grid, .docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

/* ── Calculator Form ── */
.calculator-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.form-group input[type="number"],
.form-group select {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-hint {
  display: block;
  color: var(--text2);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.form-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.2rem;
}

.form-fieldset legend {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0 0.5rem;
  color: var(--text);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.calculator-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  line-height: 1.8;
}

.calculator-result table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.calculator-result th,
.calculator-result td {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.calculator-result th {
  background: var(--bg);
  font-weight: 600;
}

/* ── Tool Page ── */
.tool-page {
  max-width: 1200px;
  margin: 0 auto;
}

.tool-page article header {
  margin-bottom: 1.5rem;
}

.tool-page .description {
  color: var(--text2);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.tool-content {
  margin: 1.5rem 0;
}

.mode-toggle {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.mode-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ── Post/Doc Page ── */
.post-meta {
  display: flex;
  gap: 1rem;
  color: var(--text2);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.post-content, .doc-content {
  line-height: 1.8;
}

.post-content h2, .doc-content h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.post-content h3, .doc-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}

.post-content p, .doc-content p {
  margin-bottom: 1rem;
}

.post-content ul, .doc-content ul,
.post-content ol, .doc-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.post-content a, .doc-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content a:hover, .doc-content a:hover {
  color: var(--accent-hover);
}

/* ── Calculator Result Styles ── */

/* Shared result sections */
.result-section {
  margin-bottom: 1.5rem;
}

.result-section h2,
.result-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}

/* Income Tax Calculator table styles */
.result-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.result-table td {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.result-table .amount {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
}

.result-table .negative {
  color: var(--error);
}

.result-table .positive {
  color: var(--success);
}

.result-table tr.highlight td {
  background: rgba(99, 102, 241, 0.08);
  font-weight: 600;
}

.result-table tr.total td {
  background: rgba(34, 197, 94, 0.08);
  border-top: 2px solid var(--accent);
}

.result-table tr .subtitle {
  font-weight: 600;
  color: var(--text);
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.recommendation {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Social Insurance Calculator styles */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 0.5rem 0;
}

.info-item {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.info-item .label {
  color: var(--text2);
  flex-shrink: 0;
}

.info-item .value {
  font-weight: 600;
  font-family: var(--font-mono);
}

.info-item .value.small {
  font-size: 0.8rem;
  font-weight: 400;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.detail-table th,
.detail-table td {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.detail-table th {
  background: var(--bg);
  font-weight: 600;
}

.detail-table .total-row td {
  background: rgba(34, 197, 94, 0.08);
  border-top: 2px solid var(--accent);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.summary-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.summary-item .label {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
}

.summary-item .value {
  font-size: 1.2rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.summary-item.highlight {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.summary-item.highlight .value {
  color: var(--accent);
}

.result-section .note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════
   侧栏导航 + 分类页面样式（新增）
   ═══════════════════════════════════════════════════ */

/* ── 应用布局：grid 让 sidebar + main-content 并排 ── */
.app-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 60px);
  position: relative;
}

@media (min-width: 1024px) {
  .app-layout {
    grid-template-columns: 260px 1fr;
  }
}

/* ── 侧栏 ── */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 260px;
  height: calc(100vh - 60px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
  }
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* ── 遮罩层（移动端） ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

/* ── 侧栏内容 ── */
.sidebar-content {
  padding: 1rem 0;
}

.sidebar-category {
  border-bottom: 1px solid var(--border);
}

.sidebar-category-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-category-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
}

.sidebar-category-icon {
  font-size: 1.1rem;
}

.sidebar-category-name {
  flex: 1;
}

.sidebar-category-chevron {
  width: 16px;
  height: 16px;
  border-left: 2px solid var(--text2);
  border-bottom: 2px solid var(--text2);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-right: 4px;
}

.sidebar-category.is-expanded .sidebar-category-chevron {
  transform: rotate(45deg);
}

/* ── 侧栏工具列表 ── */
.sidebar-tools {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-category.is-expanded .sidebar-tools {
  max-height: 1000px;
}

.sidebar-tool-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.sidebar-tool-link:hover {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

/* 当前页面高亮 */
.sidebar-tool-link.active {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  font-weight: 600;
  border-right: 3px solid var(--accent);
}

.sidebar-tool-icon {
  font-size: 1rem;
}

.sidebar-tool-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── 汉堡按钮 ── */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.nav-hamburger.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (min-width: 1024px) {
  .nav-hamburger {
    display: none;
  }
}

/* ── 主内容区 ── */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1rem;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    padding: 2rem 2rem;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 2rem 3rem;
    max-width: 1200px;
    width: 100%;
  }
}
/* ── 分类页面 ── */
.tools-category-page {
  max-width: 1200px;
  margin: 0 auto;
}

.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.category-tab-icon {
  font-size: 1.1rem;
}

.category-tab-title {
  font-weight: 500;
}

.category-tab-count {
  background: var(--border);
  color: var(--text2);
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
}

.category-section {
  margin-bottom: 3rem;
}

.category-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.category-header h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.category-header p {
  color: var(--text2);
  font-size: 0.95rem;
}

/* ── 工具卡片 ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tool-card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
}

.tool-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.tool-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tool-card p {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
}


