/* ============ Design Tokens (ui-ux-pro-max: Minimalism & Swiss) ============ */
:root {
  --color-primary: #1E3A5F;
  --color-on-primary: #FFFFFF;
  --color-secondary: #2563EB;
  --color-accent: #059669;
  --color-accent-fg: #FFFFFF;
  --color-background: #F8FAFC;
  --color-foreground: #0F172A;
  --color-card: #FFFFFF;
  --color-muted: #F1F3F5;
  --color-muted-fg: #475569;
  --color-border: #E4E7EB;
  --color-danger: #DC2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
  --shadow-hover: 0 4px 8px rgba(15, 23, 42, .08), 0 12px 28px rgba(15, 23, 42, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-background);
  color: var(--color-foreground);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; border-radius: 4px; }

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

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.site-header .inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--color-primary); cursor: pointer; }
.logo svg { width: 26px; height: 26px; }
.header-nav { margin-left: auto; display: flex; gap: 18px; }
.header-nav a { color: var(--color-muted-fg); font-size: 14px; font-weight: 500; }
.header-nav a:hover { color: var(--color-primary); text-decoration: none; }

/* ============ Hero ============ */
.hero { padding: 56px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 700; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--color-secondary); }
.hero p { margin-top: 12px; color: var(--color-muted-fg); font-size: 16px; }
.hero .badges { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.badge {
  font-size: 13px; color: var(--color-primary); background: #EAF1F8;
  padding: 4px 12px; border-radius: 999px; font-weight: 500;
}
.badge-hot { background: var(--color-accent); color: #fff; font-weight: 700; }

/* 广告位：空内容时自动折叠，不留空白 */

/* ============ Tool cards ============ */
.cat-title {
  display: flex; align-items: center; gap: 10px;
  margin: 36px 0 16px; font-size: 20px; font-weight: 700;
}
.cat-title .cnt { font-size: 13px; font-weight: 500; color: var(--color-muted-fg); background: var(--color-muted); padding: 2px 10px; border-radius: 999px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tool-card {
  position: relative;
  display: block; background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 20px; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: #CBD5E1; text-decoration: none; }
.tool-card .ic {
  width: 42px; height: 42px; border-radius: 10px; background: #EAF1F8;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.tool-card .ic svg { width: 22px; height: 22px; stroke: var(--color-primary); }
.tool-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.tool-card p { font-size: 13px; color: var(--color-muted-fg); line-height: 1.5; }
.tool-card .hot {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; color: #B45309; background: #FEF3C7; border-radius: 999px; padding: 2px 8px; font-weight: 600;
  white-space: nowrap;
}

/* ============ Tool page layout ============ */
.tool-page { padding: 32px 0 64px; }
.crumb { font-size: 13px; color: var(--color-muted-fg); margin-bottom: 16px; }
.tool-head { margin-bottom: 24px; }
.tool-head h1 { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tool-head .sub { color: var(--color-muted-fg); font-size: 14px; margin-top: 6px; }
.panel {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--color-muted-fg); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--color-border); border-radius: 8px; background: #FFF; color: var(--color-foreground);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.field .hint { font-size: 12px; color: var(--color-muted-fg); margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; font-size: 15px; font-weight: 600; font-family: inherit;
  border-radius: 8px; border: none; cursor: pointer;
  transition: background .2s ease, transform .1s ease, box-shadow .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover { background: #16304F; }
.btn-accent { background: var(--color-accent); color: var(--color-accent-fg); }
.btn-accent:hover { background: #047857; }
.btn-ghost { background: transparent; color: var(--color-secondary); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: var(--color-muted); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ Result ============ */
.result-box {
  margin-top: 20px; background: #F0F7F3; border: 1px solid #CBE5D8;
  border-radius: var(--radius); padding: 20px;
}
.result-box.hide { display: none; }
.result-box h3 { color: var(--color-accent); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed #D9E8DF; gap: 12px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--color-muted-fg); font-size: 14px; }
.kv .v { font-weight: 700; font-size: 18px; color: var(--color-foreground); font-variant-numeric: tabular-nums; }
.kv .v.big { font-size: 26px; color: var(--color-accent); }
.kv .v.small { font-size: 14px; }

/* ============ Table ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--color-border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl th { background: var(--color-muted); font-weight: 600; color: var(--color-muted-fg); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr:hover td { background: #FAFBFC; }
.tbl-wrap { overflow-x: auto; }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--color-border); background: #FFF; color: var(--color-muted-fg);
  cursor: pointer; transition: all .15s ease; font-family: inherit;
}
.tab:hover { border-color: var(--color-secondary); color: var(--color-secondary); }
.tab.active { background: var(--color-primary); border-color: var(--color-primary); color: #FFF; }
.tabpane.hide { display: none; }

/* ============ Notice / dropzone / misc ============ */
.notice {
  margin-top: 16px; font-size: 12px; color: var(--color-muted-fg);
  background: var(--color-muted); border-radius: 8px; padding: 10px 14px; line-height: 1.7;
}
.dropzone {
  border: 2px dashed var(--color-border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--color-muted-fg);
  cursor: pointer; transition: border-color .2s ease, background .2s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--color-secondary); background: #F5F9FF; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { background: var(--color-muted); border-radius: 10px; padding: 14px; text-align: center; }
.stat .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--color-muted-fg); margin-top: 2px; }
.share-box {
  margin-top: 16px; background: #EEF4FF; border: 1px solid #D6E2FB; border-radius: var(--radius); padding: 18px;
}
.share-box textarea { width: 100%; min-height: 90px; font-family: inherit; font-size: 14px; padding: 10px; border: 1px solid var(--color-border); border-radius: 8px; resize: vertical; }

/* ============ SEO 内容区（静态写入，利于收录） ============ */
.seo-section { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 28px; margin-top: 24px; }
.seo-section h2 { font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.seo-section h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: var(--color-primary); }
.seo-section p { font-size: 14.5px; line-height: 1.85; color: var(--color-muted-fg); margin-bottom: 10px; }
.steps { counter-reset: step; list-style: none; margin: 10px 0; }
.steps li {
  position: relative; padding-left: 34px; margin-bottom: 12px;
  font-size: 14.5px; line-height: 1.7; color: var(--color-muted-fg);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--color-primary); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.faq { margin-top: 10px; }
.faq details {
  border: 1px solid var(--color-border); border-radius: 10px;
  margin-bottom: 10px; background: #fff; overflow: hidden;
  transition: border-color .15s ease;
}
.faq details[open] { border-color: #CBD5E1; }
.faq summary {
  padding: 13px 16px; cursor: pointer; font-size: 14.5px; font-weight: 600;
  list-style: none; display: flex; align-items: center; gap: 10px;
  transition: background .15s ease;
}
.faq summary:hover { background: var(--color-muted); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; flex-shrink: 0;
  width: 8px; height: 8px; border-right: 2px solid var(--color-muted-fg); border-bottom: 2px solid var(--color-muted-fg);
  transform: rotate(45deg) translateY(-2px); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq .answer { padding: 0 16px 14px; font-size: 14px; line-height: 1.8; color: var(--color-muted-fg); }
.keywords { margin-top: 16px; font-size: 12.5px; color: var(--color-muted-fg); }
.keywords b { color: var(--color-primary); font-weight: 600; }

/* ============ 交互增强 ============ */
.result-box { position: relative; animation: resultIn .28s ease; }
@keyframes resultIn { from { opacity: 0; transform: translateY(-6px) } to { opacity: 1; transform: none } }
.result-box.flash { box-shadow: 0 0 0 3px rgba(5, 150, 105, .25); }
.copy-result {
  position: absolute; top: 14px; right: 14px;
  font-size: 12px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, .85); border: 1px solid #CBE5D8; color: var(--color-accent);
  font-weight: 600; font-family: inherit; transition: background .15s ease;
}
.copy-result:hover { background: #fff; }
.tool-head .ic {
  width: 38px; height: 38px; border-radius: 10px; background: #EAF1F8;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tool-head .ic svg { width: 20px; height: 20px; stroke: var(--color-primary); }
.tool-head .title-row { display: flex; align-items: center; gap: 12px; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { opacity: 1; }
.field input:focus-visible, .field select:focus-visible { outline: none; }
.calc-hint { font-size: 12.5px; color: var(--color-muted-fg); margin-top: 10px; }
.calc-hint kbd {
  background: var(--color-muted); border: 1px solid var(--color-border); border-radius: 4px;
  padding: 1px 6px; font-size: 11.5px; font-family: inherit; font-weight: 600;
}

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--color-border); background: #FFF; padding: 28px 0; margin-top: 40px; }
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: 0 20px; font-size: 13px; color: var(--color-muted-fg); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ============ Responsive / motion ============ */
@media (max-width: 640px) {
  .hero { padding: 36px 0 20px; }
  .panel { padding: 18px; }
  .header-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
