:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --text: #17283b;
  --muted: #7b8b9d;
  --muted-strong: #52667b;
  --line: #dfe6ee;
  --blue: #3d73d9;
  --blue-soft: #e8f0ff;
  --green: #1c9b75;
  --shadow: 0 16px 40px rgba(47, 75, 105, .09);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }

.shell { width: min(100%, 1440px); min-height: 100vh; margin: 0 auto; overflow: hidden; background: var(--bg); }
.topbar { height: 70px; padding: 0 6%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(246, 248, 251, .94); position: sticky; top: 0; z-index: 5; }
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 800; letter-spacing: -.07em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--text); font: 500 21px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.08em; }
.brand-mark.small { width: 22px; height: 22px; border-radius: 7px; font-size: 15px; }
.brand-dot { color: var(--blue); }
.topnav { display: flex; align-self: stretch; gap: 25px; }
.topnav a { display: flex; align-items: center; position: relative; color: var(--muted); font-size: 14px; font-weight: 700; }
.topnav a:hover, .topnav a.active { color: var(--text); }
.topnav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--blue); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.language-button, .icon-button { min-width: 34px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); background: var(--surface); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.language-button:hover, .icon-button:hover { border-color: var(--blue); color: var(--blue); }
.icon-button { padding: 0; font-size: 17px; line-height: 1; }

.home-hero { min-height: 500px; padding: 64px 20px 78px; display: flex; flex-direction: column; align-items: center; text-align: center; background: radial-gradient(circle at 50% 34%, rgba(226, 237, 255, .82), transparent 34%), var(--bg); }
.eyebrow { color: var(--blue); font: 500 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.pulse, .live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(28, 155, 117, .1); }
.live-dot { width: 5px; height: 5px; margin-right: 5px; box-shadow: none; }
h1, h2, p { margin-top: 0; }
.home-hero h1 { max-width: 800px; margin: 22px 0 18px; font-size: clamp(48px, 6vw, 76px); line-height: 1.04; letter-spacing: -.085em; }
h1 em { color: var(--blue); font-style: normal; }
.home-lede { max-width: 560px; margin-bottom: 28px; color: var(--muted-strong); font-size: 16px; line-height: 1.75; }
.current-ip-card { width: min(100%, 760px); margin-bottom: 40px; padding: 27px 30px 22px; text-align: left; box-shadow: var(--shadow); }
.current-ip-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.current-ip-top h2 { margin: 10px 0 5px; font-size: 28px; }
.current-ip-top p { margin: 0; color: var(--muted-strong); font-size: 14px; line-height: 1.6; }
.current-ip-status { flex: 0 0 auto; padding: 7px 10px; border-radius: 7px; color: var(--green); background: #e6f7f1; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.current-ip-status.is-error { color: #b66b1e; background: #fff1e3; }
.current-ip-main { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.current-ip-main strong { min-width: 0; color: var(--text); font: 500 clamp(42px, 7vw, 68px)/1.05 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.1em; overflow-wrap: anywhere; }
.copy-button { flex: 0 0 auto; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); background: var(--surface-soft); font-size: 13px; font-weight: 700; }
.copy-button:hover:not(:disabled), .refresh-button:hover { border-color: var(--blue); color: var(--blue); }
.copy-button:disabled { cursor: not-allowed; opacity: .5; }
.current-ip-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.current-ip-meta div { display: grid; gap: 5px; min-width: 0; }
.current-ip-meta span { color: var(--muted); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.current-ip-meta strong { overflow: hidden; color: var(--muted-strong); font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.current-ip-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 15px; }
.current-ip-notice { color: var(--muted); font-size: 12px; }
.refresh-button { padding: 3px 0; color: var(--muted-strong); background: transparent; font-size: 13px; font-weight: 700; }
.lookup-heading { width: min(100%, 620px); margin-bottom: 15px; text-align: left; }
.lookup-heading h2 { margin: 9px 0 5px; font-size: 28px; }
.lookup-heading p { margin: 0; color: var(--muted-strong); font-size: 14px; line-height: 1.7; }
.search-box { width: min(100%, 620px); min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.search-box:focus-within { border-color: #9ab9f4; box-shadow: 0 14px 36px rgba(61, 115, 217, .13); }
.search-icon { color: var(--muted); font-size: 26px; transform: rotate(-18deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #9ca9b8; }
.search-box button, .primary-button { height: 44px; padding: 0 17px; border-radius: 9px; color: #fff; background: var(--text); font-size: 14px; font-weight: 700; transition: background .2s, transform .2s; }
.search-box button:hover, .primary-button:hover { background: var(--blue); transform: translateY(-1px); }
.search-box button span + span { margin-left: 8px; font-size: 15px; }
.search-hints { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.search-hints button { padding: 2px 0; border-bottom: 1px dashed #aeb9c6; color: var(--muted-strong); background: transparent; font: inherit; }
.search-hints button:hover { border-color: var(--blue); color: var(--blue); }
.home-note, .privacy-note { margin: 34px 0 0; color: var(--muted); font-size: 13px; }
.home-note .live-dot { vertical-align: 1px; }

.quick-tools { padding: 58px 7.6% 62px; background: var(--surface); }
.section-heading { margin-bottom: 20px; }
h2 { margin: 9px 0 0; font-size: 28px; letter-spacing: -.06em; }
.section-heading p { max-width: 620px; margin: 8px 0 0; color: var(--muted-strong); font-size: 14px; line-height: 1.7; }
.tool-group + .tool-group { margin-top: 34px; }
.tool-group h3 { margin: 0 0 13px; color: var(--muted); font: 500 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-card { min-height: 132px; display: grid; grid-template-columns: 35px 1fr 18px; gap: 12px; align-items: center; padding: 21px; box-shadow: 0 7px 22px rgba(46, 76, 106, .035); transition: border-color .2s, transform .2s, box-shadow .2s; }
.tool-card:hover { border-color: #9ab9f4; box-shadow: 0 12px 28px rgba(46, 76, 106, .08); transform: translateY(-2px); }
.tool-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); font: 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.tool-icon.icon-indigo { color: #6366f1; background: #6366f115; }
.tool-icon.icon-cyan { color: #0ea5e9; background: #0ea5e915; }
.tool-icon.icon-green { color: var(--green); background: #10b98115; }
.tool-icon.icon-violet { color: #8b5cf6; background: #8b5cf615; }
.tool-icon.icon-orange { color: #f59e0b; background: #f59e0b15; }
.tool-icon.icon-slate { color: #64748b; background: #64748b15; }
.tool-card > span:nth-child(2) { display: grid; gap: 6px; }
.tool-card strong { color: var(--muted-strong); font-size: 14px; }
.tool-card small { color: var(--muted); font-size: 12px; line-height: 1.6; }
.tool-card b { color: var(--muted); font-size: 17px; font-weight: 400; }
.tool-card:hover strong, .tool-card:hover b { color: var(--blue); }
.privacy-note { display: flex; gap: 7px; align-items: center; margin-top: 20px; }
.transparency-note { display: flex; align-items: flex-start; gap: 13px; margin-top: 34px; padding: 18px 20px; }
.transparency-note .tool-icon { flex: 0 0 auto; }
.transparency-note strong { display: block; margin: 2px 0 5px; color: var(--muted-strong); font-size: 14px; }
.transparency-note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.result-view { padding: 56px 7.6% 70px; background: var(--bg); }
.result-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px; margin-bottom: 22px; }
.back-button, .outline-button { padding: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 700; text-align: left; }
.back-button:hover, .outline-button:hover { color: var(--text); }
.result-heading { text-align: center; }
.result-heading h1 { margin: 9px 0 0; font: 500 clamp(27px, 4vw, 42px) ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.08em; }
.result-mode { justify-self: end; padding: 7px 10px; border-radius: 7px; color: var(--green); background: #e6f7f1; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.result-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-bottom: 12px; }
.result-summary, .result-score { min-height: 190px; padding: 23px; }
.summary-label { margin-bottom: 7px; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; }
.summary-value { display: block; margin-bottom: 21px; color: var(--text); font-size: 16px; }
.summary-value:last-child { margin-bottom: 0; }
.score-value { display: flex; align-items: baseline; gap: 5px; margin: 18px 0 13px; }
.score-value strong { font: 500 48px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.12em; }
.score-value span { color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; }
.score-bar { height: 5px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.score-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #8ec55b); transition: width .4s ease; }
.result-score p { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.result-insights { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-bottom: 12px; }
.result-metrics, .result-signals { padding: 20px 23px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.metric-grid div { display: grid; gap: 6px; }
.metric-grid span { color: var(--muted); font-size: 10px; }
.metric-grid strong { font: 500 18px ui-monospace, SFMono-Regular, Consolas, monospace; }
.signal-list { display: grid; gap: 10px; margin-top: 15px; }
.signal-row { display: flex; align-items: center; gap: 8px; color: var(--muted-strong); font-size: 11px; }
.signal-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--green); background: #eaf8f3; font-size: 12px; }
.signal-row.warn .signal-icon { color: #b66b1e; background: #fff1e3; }
.signal-row strong { margin-left: auto; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.sources-card { overflow: hidden; }
.sources-card summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 19px; color: var(--muted-strong); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.sources-card summary::-webkit-details-marker { display: none; }
.sources-card summary::after { content: "⌄"; color: var(--muted); font-size: 15px; }
.sources-card[open] summary::after { content: "⌃"; }
.source-count { margin-left: auto; margin-right: 12px; padding: 4px 7px; border-radius: 5px; color: var(--green); background: #e6f7f1; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th, td { padding: 13px 19px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 11px; }
th { color: var(--muted); background: var(--surface-soft); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
td { color: var(--muted-strong); }
td strong { color: var(--text); font-weight: 700; }
.source-name { display: flex; align-items: center; gap: 8px; }
.source-logo { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--text); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.source-name span { display: grid; gap: 3px; }
.source-name small { color: var(--muted); font-size: 9px; }
.latency { color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.status-ok { color: var(--green); font-size: 10px; font-weight: 700; }
.status-error { color: #ca5360; font-size: 10px; font-weight: 700; }
.status-skipped { color: var(--muted); font-size: 10px; font-weight: 700; }
.source-note { display: flex; gap: 7px; margin: 0; padding: 13px 19px; color: var(--muted); font-size: 10px; }
.source-note > span:first-child { color: var(--green); }
.result-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 17px; }
.outline-button { height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted-strong); }
.outline-button:hover { border-color: var(--blue); color: var(--blue); }
.footer { display: flex; align-items: center; gap: 24px; padding: 22px 7.6%; color: var(--muted); background: var(--surface); }
.footer-brand { color: var(--text); font-size: 16px; }
.footer p { margin: 0; font-size: 12px; }
.footer-links { display: flex; gap: 17px; margin-left: auto; font-size: 12px; }
.footer-links a:hover { color: var(--blue); }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 20; padding: 11px 15px; border: 1px solid var(--line); border-radius: 9px; color: #fff; background: var(--text); box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.dark { --bg: #0c1622; --surface: #122131; --surface-soft: #172a3d; --text: #eaf1f7; --muted: #8da0b2; --muted-strong: #c4d1de; --line: #263b4f; --blue-soft: #1b3159; --shadow: 0 16px 45px rgba(0, 0, 0, .17); }
body.dark .topbar { background: rgba(12, 22, 34, .94); }
body.dark .home-hero { background: radial-gradient(circle at 50% 34%, rgba(30, 61, 101, .45), transparent 34%), var(--bg); }
body.dark .result-mode, body.dark .source-count, body.dark .current-ip-status { background: #153b35; }
body.dark .current-ip-status.is-error { background: #4a331e; }
body.dark .tool-icon.icon-indigo, body.dark .tool-icon.icon-cyan, body.dark .tool-icon.icon-green, body.dark .tool-icon.icon-violet, body.dark .tool-icon.icon-orange, body.dark .tool-icon.icon-slate { background: color-mix(in srgb, currentColor 17%, transparent); }
body.dark .score-bar { background: #223345; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .topbar { height: 64px; padding: 0 5%; }
  .topnav { display: none; }
  .home-hero { min-height: 470px; padding: 48px 5% 64px; }
  .home-hero h1 { font-size: clamp(42px, 13vw, 62px); }
  .current-ip-card { padding: 22px 18px 18px; }
  .current-ip-top { flex-direction: column; gap: 14px; }
  .current-ip-status { align-self: flex-start; }
  .current-ip-main { align-items: flex-start; flex-direction: column; gap: 12px; }
  .copy-button { width: 100%; }
  .current-ip-bottom { align-items: flex-start; flex-direction: column; }
  .quick-tools, .result-view { padding-left: 5%; padding-right: 5%; }
  .tool-grid, .result-grid, .result-insights { grid-template-columns: 1fr; }
  .result-header { grid-template-columns: 1fr auto; align-items: center; }
  .result-heading { grid-column: 1 / -1; grid-row: 1; text-align: left; }
  .back-button { grid-column: 1; grid-row: 2; }
  .result-mode { grid-column: 2; grid-row: 2; }
  .footer { align-items: flex-start; flex-wrap: wrap; gap: 12px 20px; padding-left: 5%; padding-right: 5%; }
  .footer p { flex-basis: 100%; order: 3; }
  .footer-links { margin-left: 0; }
}

@media (max-width: 480px) {
  .search-box { flex-wrap: wrap; padding: 12px; }
  .search-icon { display: none; }
  .search-box input { width: 100%; flex-basis: 100%; height: 32px; }
  .search-box button { width: 100%; }
  .search-hints { gap: 9px; font-size: 12px; }
  .current-ip-meta { grid-template-columns: repeat(2, 1fr); gap: 15px 12px; }
  .current-ip-meta div:last-child { grid-column: 1 / -1; }
  .current-ip-meta strong { font-size: 13px; }
  .current-ip-notice { font-size: 12px; }
  .transparency-note { padding: 16px; }
  .tool-card { padding: 17px; }
  .result-actions { justify-content: stretch; }
  .result-actions button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
