/* ===== 全站共享样式（首页卡片 / 法务页 / 工具页通用区块）=====
   来源：原 tools/image-compress/styles.css 拆分。
   工具专属样式（dropzone / 文件列表等）保留在各工具目录内。 */

/* ===== Design tokens ===== */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #18181b;
  --text-secondary: #52525b;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #059669;
  --accent-strong: #047857;
  --accent-soft: #ecfdf5;
  --accent-border: #a7f3d0;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --neutral-soft: #f4f4f5;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow-md: 0 4px 16px rgba(24, 24, 27, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ===== Header ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none;
}
.privacy-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--accent-strong);
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  padding: 5px 12px; border-radius: 999px; font-weight: 500;
}

/* ===== Hero ===== */
.hero { text-align: center; padding: 44px 0 28px; }
.hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.hero .sub { color: var(--text-secondary); margin-top: 8px; font-size: 15px; }

/* ===== 内容区块通用 ===== */
.section-title {
  font-size: 24px; font-weight: 700; letter-spacing: -.01em;
  margin-top: 56px;
}
.section-sub { color: var(--text-secondary); font-size: 14.5px; margin-top: 6px; }

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 0 28px;
  font-size: 12.5px; color: var(--muted);
}
.site-footer p + p { margin-top: 4px; }
.site-footer strong { color: var(--text-secondary); }

/* 主要内容与 footer 之间留出呼吸空间 */
.faq { margin-bottom: 24px; }

.hidden { display: none !important; }

/* ===== Features / Audience ===== */
.feature-grid, .audience-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px;
}
.feature-card, .audience-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.feature-card h3, .audience-item h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.feature-card h3::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); margin-right: 8px;
}
.feature-card p, .audience-item p { font-size: 13.5px; color: var(--text-secondary); }

/* ===== How it works ===== */
.how-body { margin-top: 14px; }
.how-body p { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 12px; }
.how-body strong { color: var(--text); }

/* ===== FAQ ===== */
.faq { margin-top: 56px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}
.faq-item summary {
  cursor: pointer; list-style: none;
  padding: 15px 20px; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 18px; color: var(--muted); font-weight: 500;
  transition: transform .15s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 20px 16px; font-size: 13.5px; color: var(--text-secondary); }

/* ===== 首屏外区块延迟渲染（Core Web Vitals）===== */
.features,
.how-it-works,
.audience,
.faq {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

@media (max-width: 640px) {
  .feature-grid, .audience-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 20px; margin-top: 40px; }
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 26px; }
}

/* ===== 法务页面（隐私政策 / 服务条款）===== */
.legal { padding: 40px 0 8px; }
.legal h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.legal .updated { color: var(--muted); font-size: 13px; margin-top: 8px; }
.legal .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 30px;
  margin-top: 20px;
}
.legal h2 {
  font-size: 17px; font-weight: 700;
  margin-top: 28px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.legal h2:first-of-type { margin-top: 22px; }
.legal p, .legal li { font-size: 14.5px; color: var(--text-secondary); }
.legal p { margin-top: 12px; }
.legal ul { margin: 12px 0 0 20px; list-style: disc; }
.legal li { margin-top: 6px; }
.legal a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.legal strong { color: var(--text); }
.legal .highlight {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 18px;
  font-size: 14.5px;
  color: var(--text-secondary);
}
@media (max-width: 640px) {
  .legal h1 { font-size: 23px; }
  .legal .card { padding: 20px 18px; }
}

/* ===== 页脚导航 ===== */
.footer-links {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 10px;
  font-size: 12.5px;
}
.footer-links a {
  color: var(--accent-strong);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* ===== 面包屑 & 相关工具（与聚合站视觉统一）===== */
.crumb { font-size: 13px; color: var(--muted); margin: 18px 0 0; }
.crumb a { color: var(--accent-strong); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.related { margin-top: 56px; }
.cat-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tool-card {
  display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px 18px; color: inherit; text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tool-card:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); text-decoration: none; }
.tool-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.tool-card p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
