:root {
  color-scheme: dark;
  --bg: #080b13;
  --bg-soft: #0d111c;
  --surface: #101522;
  --surface-2: #151b2a;
  --border: rgba(255,255,255,.10);
  --border-strong: rgba(255,255,255,.18);
  --text: #f2f5f9;
  --muted: #96a0b2;
  --accent: #8b7cff;
  --accent-2: #56d5ff;
  --yellow: #ffd76b;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
  --radius: 18px;
  --shell: 1220px;
  --header: 72px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #edf0f7;
  --surface: #fff;
  --surface-2: #f1f3f8;
  --border: rgba(10,20,40,.10);
  --border-strong: rgba(10,20,40,.18);
  --text: #111624;
  --muted: #657087;
  --shadow: 0 24px 70px rgba(26,38,71,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.skip-link { position: fixed; left: 16px; top: -100px; z-index: 999; background: var(--text); color: var(--bg); padding: 10px 16px; }
.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 36px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.04em; font-size: 21px; white-space: nowrap; }
.brand-mark { position: relative; display: inline-block; width: 29px; height: 26px; }
.brand-mark i { position: absolute; bottom: 2px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 13px solid currentColor; transform: rotate(0deg); }
.brand-mark i:nth-child(1) { left: 0; }
.brand-mark i:nth-child(2) { left: 8px; bottom: 10px; color: var(--yellow); transform: scale(.55); }
.brand-mark i:nth-child(3) { right: 0; }
.desktop-nav { flex: 1; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.nav-list a { display: block; padding: 9px 12px; color: var(--muted); border-radius: 10px; font-size: 14px; transition: .2s ease; }
.nav-list a:hover { color: var(--text); background: var(--surface); }
.header-actions { display: flex; align-items: center; gap: 5px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 50%; cursor: pointer; }
.icon-button:hover { background: var(--surface); }
.login-button { border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 15px; margin-left: 4px; font-size: 14px; }
.language-menu { position: relative; }
.language-popover { display: none; position: absolute; top: calc(100% + 10px); right: 0; min-width: 160px; padding: 8px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 14px; }
.language-menu.is-open .language-popover { display: block; }
.language-popover a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); }
.language-popover a:hover, .language-popover a.is-current { color: var(--text); background: var(--surface-2); }

.hero {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(8,11,19,.12), var(--bg)),
    radial-gradient(circle at 50% 28%, rgba(86,213,255,.09), transparent 38%);
}
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 108px 0 82px; }
.hero-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .22; }
.hero-glow-a { width: 420px; height: 280px; left: 18%; top: 5%; background: var(--accent); }
.hero-glow-b { width: 360px; height: 320px; right: 18%; top: 18%; background: var(--accent-2); }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow svg { color: var(--yellow); width: 15px; }
.hero h1 { margin: 25px 0 16px; font-size: clamp(48px, 7vw, 84px); line-height: 1.04; letter-spacing: -.065em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--text) 20%, var(--accent-2) 55%, var(--accent)); -webkit-background-clip: text; color: transparent; }
.hero > .hero-inner > p { margin: 0 auto 30px; max-width: 650px; color: var(--muted); font-size: 18px; }
.hero-search, .search-form { width: min(100%, 650px); margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 18px; background: color-mix(in srgb, var(--surface) 86%, transparent); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.hero-search > svg { width: 17px; color: var(--accent-2); }
.hero-search input, .search-form input { flex: 1; min-width: 0; color: var(--text); background: transparent; border: 0; outline: none; padding: 10px 0; }
.hero-search input::placeholder, .search-form input::placeholder { color: var(--muted); }
.hero-search button { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; border: 0; background: var(--text); color: var(--bg); cursor: pointer; }
.hero-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.hero-links a { color: var(--text); }

.section { padding: 88px 0; border-bottom: 1px solid var(--border); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2, .editor-picks h2 { margin: 4px 0 0; font-size: 30px; letter-spacing: -.045em; }
.section-kicker { color: var(--accent-2); }
.section-kicker svg { width: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.text-link svg { width: 16px; transition: transform .2s; }
.text-link:hover { color: var(--text); }
.text-link:hover svg { transform: translateX(3px); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease; }
.tool-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.tool-preview { height: 210px; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tool-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.tool-card:hover .tool-preview img { transform: scale(1.025); }
.tool-preview.is-placeholder { background: radial-gradient(circle at 35% 20%, color-mix(in srgb, var(--accent) 48%, transparent), transparent 45%), linear-gradient(140deg, var(--surface-2), var(--bg)); }
.tool-preview.is-placeholder span { font-size: 72px; font-weight: 800; opacity: .7; }
.tool-card-body { padding: 18px; }
.tool-title-row { display: flex; align-items: center; gap: 12px; }
.tool-logo, .ranking-logo { flex: 0 0 auto; width: 42px; height: 42px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; background: #fff; color: #121826; font-weight: 800; }
.tool-logo img, .ranking-logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-title-row h3 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.025em; }
.category-link { display: inline-block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tool-card-body > p { height: 50px; overflow: hidden; color: var(--muted); line-height: 1.55; font-size: 14px; margin: 16px 0; }
.tool-card-meta { min-height: 26px; display: flex; gap: 6px; flex-wrap: wrap; }
.tool-card-meta a, .fact-tags a, .category-pill { padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 11px; }
.empty-state { padding: 70px 30px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty-state svg { width: 36px; height: 36px; color: var(--accent-2); }
.empty-state h3, .empty-state h2 { color: var(--text); margin-bottom: 4px; }

.section-trending { background: var(--bg-soft); }
.split-section { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); gap: 50px; }
.section-heading.compact { margin-bottom: 18px; }
.ranking-list { border-top: 1px solid var(--border); }
.ranking-item { display: grid; grid-template-columns: 42px 44px 1fr 24px; align-items: center; gap: 14px; padding: 15px 10px; border-bottom: 1px solid var(--border); }
.ranking-item:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.rank-number { color: var(--muted); font-family: ui-monospace, monospace; font-size: 12px; }
.ranking-copy { min-width: 0; display: flex; align-items: center; gap: 12px; }
.ranking-copy strong { flex: 0 0 130px; }
.ranking-copy small { color: var(--muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.ranking-arrow { color: var(--muted); }
.ranking-arrow svg { width: 16px; }
.editor-picks { align-self: start; position: sticky; top: calc(var(--header) + 24px); padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.editor-picks > p { color: var(--muted); font-size: 14px; }
.pick-item { display: grid; grid-template-columns: 42px 1fr 20px; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.pick-item strong, .pick-item small { display: block; }
.pick-item small { color: var(--muted); }
.pick-item svg { width: 16px; color: var(--muted); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.category-card { min-height: 100px; display: grid; grid-template-columns: 44px 1fr 20px; align-items: center; gap: 13px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; transition: .2s; }
.category-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.category-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent-2); font-size: 22px; }
.category-card strong, .category-card small { display: block; }
.category-card small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.category-card svg { width: 16px; color: var(--muted); }
.cta-section { padding: 52px 0; }
.cta-inner { min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 45px 55px; border: 1px solid var(--border); border-radius: 24px; background: radial-gradient(circle at 80% 10%, rgba(139,124,255,.22), transparent 36%), var(--surface); }
.cta-inner h2 { margin: 7px 0; font-size: 34px; letter-spacing: -.045em; }
.cta-inner p { margin: 0; color: var(--muted); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 11px; background: var(--text); color: var(--bg); font-weight: 700; white-space: nowrap; }
.primary-button svg { width: 17px; }

.site-footer { padding: 70px 0 110px; border-top: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 60px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-grid .brand { color: var(--text); }
.footer-grid p { max-width: 410px; margin: 14px 0 0; }
.footer-grid strong { color: var(--text); margin-bottom: 8px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; }
.mobile-dock { display: none; }

.search-dialog { display: none; position: fixed; inset: 0; z-index: 100; align-items: flex-start; justify-content: center; padding-top: 13vh; }
.search-dialog.is-open { display: flex; }
.search-backdrop { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.68); backdrop-filter: blur(7px); }
.search-panel { position: relative; width: min(calc(100% - 32px), 720px); padding: 24px; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.search-panel-head { display: flex; align-items: center; justify-content: space-between; }
.search-panel h2 { margin: 0 0 18px; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; font-size: 24px; }
.search-form { width: 100%; box-shadow: none; background: var(--surface-2); }
.search-form button { border: 0; border-radius: 10px; padding: 9px 15px; background: var(--text); color: var(--bg); font-weight: 700; }
.search-panel > p { color: var(--muted); font-size: 13px; margin-bottom: 0; }

.archive-main { min-height: 70vh; padding: 70px 0 100px; }
.archive-header { margin-bottom: 38px; }
.archive-header h1 { margin: 8px 0; font-size: clamp(40px, 6vw, 70px); letter-spacing: -.055em; }
.archive-header p { color: var(--muted); }
.pagination { margin-top: 40px; }
.nav-links { display: flex; justify-content: center; gap: 8px; }
.page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; }
.page-numbers.current { background: var(--text); color: var(--bg); }

.single-hero { position: relative; overflow: hidden; padding: 60px 0; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.single-glow { position: absolute; width: 500px; height: 300px; left: 25%; top: -180px; background: var(--accent); opacity: .18; filter: blur(90px); }
.single-heading { position: relative; }
.back-link { display: inline-block; margin-bottom: 34px; color: var(--muted); font-size: 14px; }
.single-title-row { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 26px; }
.single-logo { width: 100px; height: 100px; display: grid; place-items: center; overflow: hidden; background: #fff; color: #121826; border-radius: 24px; font-size: 42px; font-weight: 800; }
.single-logo img { width: 100%; height: 100%; object-fit: cover; }
.single-title-row h1 { margin: 8px 0 4px; font-size: clamp(38px, 6vw, 64px); line-height: 1; letter-spacing: -.055em; }
.single-title-row p { max-width: 680px; margin: 12px 0 0; color: var(--muted); }
.single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 50px; padding-top: 60px; padding-bottom: 90px; }
.single-preview { margin: 0 0 40px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.single-preview img { width: 100%; height: auto; }
.prose { color: var(--muted); }
.prose h1, .prose h2, .prose h3, .prose strong { color: var(--text); }
.prose h2 { font-size: 28px; letter-spacing: -.035em; }
.prose a { color: var(--accent-2); text-decoration: underline; }
.tool-facts { align-self: start; position: sticky; top: calc(var(--header) + 24px); padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tool-facts h2 { margin-top: 0; font-size: 18px; }
.tool-facts dl { margin: 0; }
.tool-facts dl div { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid var(--border); }
.tool-facts dt { color: var(--muted); }
.tool-facts dd { margin: 0; text-align: right; }
.fact-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.page-main { min-height: 70vh; padding: 70px 0 100px; }
.page-shell { max-width: 860px; }
.page-content { padding: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.page-content h1 { margin-top: 0; font-size: 48px; letter-spacing: -.05em; }
.not-found { margin-top: 30px; }
.not-found > span { display: block; color: var(--accent); font-size: 92px; font-weight: 900; line-height: 1; }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .header-inner { justify-content: space-between; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .split-section { grid-template-columns: 1fr; }
  .editor-picks { position: static; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-grid > div:last-child { display: none; }
  .single-title-row { grid-template-columns: 86px 1fr; }
  .single-logo { width: 86px; height: 86px; border-radius: 20px; }
  .visit-button { grid-column: 2; justify-self: start; }
  .single-layout { grid-template-columns: 1fr; }
  .tool-facts { position: static; }
}

@media (max-width: 680px) {
  :root { --header: 62px; }
  .shell { width: min(calc(100% - 32px), var(--shell)); }
  .header-actions .login-button, .header-actions [data-theme-toggle] { display: none; }
  .brand { font-size: 19px; }
  .hero { min-height: auto; }
  .hero-inner { padding: 66px 0 48px; text-align: left; }
  .eyebrow { font-size: 10px; }
  .hero h1 { margin-top: 18px; font-size: 47px; }
  .hero > .hero-inner > p { font-size: 15px; margin-bottom: 24px; }
  .hero-search { padding-left: 14px; border-radius: 16px; }
  .hero-links { justify-content: flex-start; gap: 8px 12px; }
  .section { padding: 54px 0; }
  .section-heading { align-items: center; }
  .section-heading h2, .editor-picks h2 { font-size: 25px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-preview { height: 220px; }
  .ranking-item { grid-template-columns: 32px 42px 1fr 18px; gap: 10px; padding-inline: 4px; }
  .ranking-copy { display: block; }
  .ranking-copy strong { display: block; }
  .ranking-copy small { display: block; max-width: 210px; }
  .editor-picks { padding: 22px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 84px; }
  .cta-inner { min-height: 0; align-items: flex-start; flex-direction: column; padding: 28px; }
  .cta-inner h2 { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .footer-grid > div:nth-child(3) { display: none; }
  .footer-bottom { display: block; }
  .footer-bottom span { display: block; }
  .site-footer { padding-bottom: 120px; }
  .mobile-dock { position: fixed; z-index: 45; left: 10px; right: 10px; bottom: 10px; height: 66px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
  .mobile-dock a, .mobile-dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; color: var(--muted); border: 0; font-size: 10px; }
  .mobile-dock svg { width: 20px; }
  .mobile-dock .is-primary { color: var(--accent-2); }
  .archive-main { padding-top: 45px; }
  .archive-header h1 { font-size: 43px; }
  .single-hero { padding: 34px 0 42px; }
  .back-link { margin-bottom: 26px; }
  .single-title-row { grid-template-columns: 70px 1fr; gap: 16px; }
  .single-logo { width: 70px; height: 70px; border-radius: 17px; }
  .single-title-row h1 { font-size: 36px; }
  .single-title-row p { font-size: 14px; }
  .visit-button { grid-column: 1 / -1; width: 100%; }
  .single-layout { padding-top: 34px; gap: 30px; }
  .page-main { padding-top: 35px; }
  .page-content { padding: 25px; }
  .page-content h1 { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
