:root {
  --bg: #f7f9fb;
  --bg-alt: #eef3f6;
  --panel: #ffffff;
  --text: #0f1b2a;
  --muted: #5b6b7d;
  --border: #dde5ec;
  --accent: #0b7285;
  --accent-strong: #095c6b;
  --accent-soft: #e3f3f6;
  --ok: #157f3b;
  --ok-soft: #e4f5ea;
  --warn-bg: #fff7e6;
  --warn-text: #7a4b00;
  --err-bg: #fdecec;
  --err-text: #9b1c1c;
  --shadow: 0 1px 2px rgba(15, 27, 42, .05), 0 8px 24px -12px rgba(15, 27, 42, .18);
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520;
    --bg-alt: #111c29;
    --panel: #142130;
    --text: #e6edf3;
    --muted: #9aabbd;
    --border: #243447;
    --accent: #3cc3d6;
    --accent-strong: #6dd5e3;
    --accent-soft: #11313a;
    --ok: #4ccf7c;
    --ok-soft: #12301f;
    --warn-bg: #33270d;
    --warn-text: #f2c66d;
    --err-bg: #3a1717;
    --err-text: #f4a3a3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header and footer */
.site-header { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 600; }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: .95rem; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--text); background: var(--bg-alt); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; color: var(--muted); }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu ul { position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 150px; }
.lang-menu li a { display: block; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.lang-menu li a:hover, .lang-menu li a[aria-current] { background: var(--accent-soft); }
@media (max-width: 640px) {
  .brand-name { display: none; }
  .main-nav a { padding: 6px 8px; font-size: .88rem; }
  .main-nav a:first-child { display: none; } /* the logo already links to the tool */
}
.site-footer { border-top: 1px solid var(--border); background: var(--panel); margin-top: 48px; padding: 32px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 24px; }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; }
.site-footer nav a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.site-footer nav a:hover { color: var(--text); }
.footer-langs { flex-direction: row !important; flex-wrap: wrap; gap: 6px 14px !important; align-content: flex-start; }
.footer-bottom { margin-top: 20px; font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* Buttons, alerts, cards */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #06222a; } }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary:hover { color: #06222a; } }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 20px; font-size: 1.05rem; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; }
.alert-error { background: var(--err-bg); color: var(--err-text); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
@media (max-width: 520px) { .card { padding: 18px; } }

/* Hero and tool */
.hero { padding: 40px 0 32px; background: linear-gradient(180deg, var(--accent-soft), var(--bg) 70%); }
.hero h1 { text-align: center; }
.lead { font-size: 1.1rem; color: var(--muted); text-align: center; max-width: 640px; margin: 0 auto 16px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; list-style: none; padding: 0; margin: 0 0 24px; font-size: .92rem; }
.trust li { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { color: var(--ok); width: 18px; height: 18px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 32px 16px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--bg); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { display: flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.drop-title { font-weight: 600; font-size: 1.1rem; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--bg-alt); border-radius: 8px; font-size: .9rem; }
.file-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.bad { background: var(--err-bg); color: var(--err-text); }
.client-error { margin-top: 12px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0 6px; }
@media (max-width: 520px) { .options { grid-template-columns: 1fr; } }
.field label { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field output { font-family: var(--mono); color: var(--accent); }
select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range-labels { display: flex; justify-content: space-between; }
.field.is-disabled { opacity: .45; }
.progress { position: relative; height: 40px; margin-top: 12px; border-radius: 10px; background: var(--bg-alt); overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-soft); transition: width .2s; }
.progress span { position: relative; display: flex; height: 100%; align-items: center; justify-content: center; font-weight: 600; font-size: .92rem; }
.privacy-line { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; color: var(--muted); }
.privacy-line svg { flex: none; color: var(--ok); width: 18px; height: 18px; margin-top: 2px; }

/* Result */
.result-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.result-head h2 { margin-bottom: .2em; }
.ok-icon { flex: none; display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.file-results { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.file-result { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.file-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-meta { display: flex; flex-direction: column; min-width: 0; }
.file-name { overflow-wrap: anywhere; }
.report { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.report-title { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.report ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.report li { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .92rem; }
.report li::before { content: "✕"; color: var(--err-text); font-weight: 700; }
.report-key { font-weight: 600; }
.report-value { font-family: var(--mono); font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }

/* Sections */
.section { padding: 48px 0; }
.section.alt { background: var(--bg-alt); }
.section-title { font-size: 1.6rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.feature p { margin: 0; font-size: .95rem; }
.two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; gap: 16px; } }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 4px 46px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.faq details { border-bottom: 1px solid var(--border); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 28px 12px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.3rem; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); }
.post-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.post-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); font-weight: 700; }
.post-title { font-weight: 700; font-size: 1.05rem; line-height: 1.35; }
.post-meta { color: var(--muted); }
.donate, .cta-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.donate h2, .cta-box h2 { font-size: 1.2rem; margin-bottom: .3em; }
.donate p, .cta-box p { margin: 0; }

/* Blog */
.page-head { padding: 36px 0 20px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 4px; }
.page-head .lead { text-align: left; margin-left: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .9rem; background: var(--panel); }
.chips a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.takeaways { background: var(--accent-soft); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
.takeaways-title { font-weight: 700; margin-bottom: 6px; }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { margin-bottom: 4px; }
.toc { margin-bottom: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.toc summary { cursor: pointer; padding: 12px 18px; font-weight: 600; }
.toc ol { margin: 0; padding: 0 18px 14px 38px; }
.toc li { margin-bottom: 4px; }
.disclosure { background: var(--bg-alt); border-radius: 8px; padding: 10px 14px; color: var(--muted); }
.prose { font-size: 1.05rem; line-height: 1.75; }
.prose h2 { margin-top: 1.8em; scroll-margin-top: 80px; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 0 0 1em; padding: 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: .93rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-alt); }
.prose .note, .prose .warning { border-radius: 10px; padding: 14px 18px; margin: 0 0 1.2em; }
.prose .note { background: var(--accent-soft); }
.prose .warning { background: var(--warn-bg); color: var(--warn-text); }
.prose .note p:last-child, .prose .warning p:last-child { margin-bottom: 0; }
.cta-box { margin: 28px 0; }
.cta-title { font-weight: 700; font-size: 1.1rem; margin-bottom: .2em !important; }
.article-faq { margin-top: 40px; }
.simple-page { padding-bottom: 24px; }
