:root {
  color-scheme: light;
  --ink: #152238;
  --muted: #64748b;
  --line: #dbe4ef;
  --surface: #ffffff;
  --canvas: #f5f8fc;
  --blue: #0b57d0;
  --blue-soft: #eaf2ff;
  --green: #168467;
  --green-soft: #e6f7f1;
  --amber: #9a6700;
  --amber-soft: #fff4d6;
  --red: #c43c33;
  --red-soft: #ffebe8;
  font-family: Inter, "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

/**
 * 擴充套件 popup 必須有明確寬度：Chrome 依內容決定視窗大小，沒給寬度就會塌成
 * 最小寬。網頁版則相反，要能跟著視窗縮放，所以固定寬只掛在 .popup 上。
 */
body.popup { width: 600px; min-height: 680px; }
body.web { min-height: 100vh; }

button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
body.web .app-shell {
  width: 100%;
  /**
   * 比擴充套件的 600px 寬得多，但仍設上限：DNS 紀錄值（monospace 長字串）越寬越
   * 好讀，可是說明文字一旦超過約 90 個字元，每行結束後眼睛就很難找回下一行開頭。
   * 1100px 是兩者的折衷，超過的部分留白。
   */
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  box-shadow: 0 0 60px rgba(15, 40, 82, .08);
}

/**
 * 內容不足一屏時，把多餘高度交給正在使用的工具面板吸收。
 *
 * min-height: 100vh 會讓容器撐滿視窗，但內容不夠時那段高度預設堆在最後一個
 * 元素之後——也就是 footer 下方。那裡沒有任何東西，一大片白色讀起來像頁面沒
 * 載完。把它交給空狀態區塊並讓內容垂直置中之後，同一段空白就成了「等待輸入」
 * 的留白，因為那個區塊本來就是為此存在的。
 *
 * 隱藏中的面板不受影響：[hidden] 的 display: none 帶 !important，勝過這裡的 flex。
 */
body.web .app-shell { display: flex; flex-direction: column; }
body.web .tool-panel { display: flex; flex: 1 0 auto; flex-direction: column; }
body.web .tool-panel > .empty-state,
body.web .tool-panel > .loading-state { display: grid; flex: 1 0 auto; align-content: center; }

.hero {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px 24px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(76, 137, 255, .8), transparent 34%),
    linear-gradient(135deg, #092c67 0%, #0b57d0 64%, #12449a 100%);
}

.brand-mark {
  display: grid;
  flex: 0 0 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 14px;
  color: #174ea6;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
  font-size: 24px;
  font-weight: 800;
}

.hero h1 { margin: 2px 0 1px; font-size: 24px; }
.hero p { margin: 0; color: rgba(255,255,255,.78); font-size: 12px; }
.eyebrow { margin: 0; font-size: 10px; font-weight: 800; letter-spacing: .12em; }

.tool-switch {
  position: sticky;
  z-index: 8;
  top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 252, .96);
  backdrop-filter: blur(10px);
}

.tool-tab {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 11px;
  border: 1px solid #cfd9e7;
  border-radius: 12px;
  color: #526178;
  background: #fff;
  text-align: left;
}
.tool-tab:hover { border-color: #9fb9e2; background: #f9fbff; }
.tool-tab.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(11,87,208,.08); }
.tool-tab-icon { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border-radius: 9px; color: #fff; background: #7587a3; font-size: 11px; font-weight: 900; }
.tool-tab.active .tool-tab-icon { background: var(--blue); }
.tool-tab strong, .tool-tab small { display: block; }
.tool-tab strong { font-size: 13px; }
.tool-tab small { margin-top: 3px; color: #7b889b; font-size: 11px; }
.tool-panel { min-height: 350px; }

.check-form {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.97);
}

.check-form > label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.input-row { display: flex; gap: 8px; }

input {
  min-width: 0;
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #b7c5d8;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,87,208,.12); }

.primary, .secondary {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-weight: 750;
}

.primary:disabled { cursor: wait; opacity: .62; }
.secondary { width: 100%; margin-top: 14px; }
.primary:hover, .secondary:hover { background: #0847ad; }

.check-form > label .label-hint { color: var(--muted); font-size: 11px; font-weight: 500; }
.form-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }
.form-error { margin: 8px 0 0; color: var(--red); font-size: 12px; }
.field-notice { margin: 8px 0 0; padding: 9px 11px; border-radius: 7px; color: #0b3f96; background: var(--blue-soft); font-size: 11px; line-height: 1.6; }

.selector-settings { margin-top: 9px; color: var(--muted); }
.selector-settings summary { cursor: pointer; font-size: 11px; font-weight: 750; }
.selector-settings label { display: block; margin: 9px 0 5px; color: var(--ink); font-size: 11px; font-weight: 750; }
.selector-settings input { width: 100%; height: 38px; font-size: 12px; }
.selector-settings p { margin: 6px 0 0; font-size: 11px; line-height: 1.55; }
.selector-settings code { padding: 1px 3px; border-radius: 3px; color: #465a78; background: #edf2f8; }

.type-picker { position: relative; margin-top: 10px; }
.type-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 8px 11px; border: 1px solid #cad5e3; border-radius: 9px; cursor: pointer; list-style: none; color: var(--muted); background: #f9fbfe; font-size: 11px; }
.type-picker > summary::-webkit-details-marker { display: none; }
.type-picker > summary strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.type-picker > summary::after { flex: 0 0 auto; color: #718096; content: "▾"; }
.type-picker[open] > summary { border-color: var(--blue); border-radius: 9px 9px 0 0; }
.type-picker-menu { padding: 10px; border: 1px solid var(--blue); border-top: 0; border-radius: 0 0 10px 10px; background: #fff; box-shadow: 0 12px 24px rgba(28,48,77,.1); }
.type-picker-actions { display: flex; gap: 7px; margin-bottom: 9px; }
.type-picker-actions button { padding: 5px 10px; border: 1px solid #cbd7e6; border-radius: 6px; color: var(--blue); background: #f6f9fe; font-size: 11px; font-weight: 750; }
.type-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.type-options label { display: flex; gap: 6px; align-items: center; min-width: 0; padding: 7px; border: 1px solid #e1e7f0; border-radius: 7px; cursor: pointer; color: var(--muted); font-size: 10px; }
.type-options label:has(input:checked) { border-color: #a8c7fa; color: #315d9b; background: #f2f7ff; }
.type-options input { flex: 0 0 auto; width: 13px; height: 13px; margin: 0; accent-color: var(--blue); box-shadow: none; }
.type-options span { min-width: 0; line-height: 1.25; }
.type-options b { display: block; color: var(--ink); font-size: 11px; }

.empty-state, .loading-state {
  padding: 56px 40px 66px;
  text-align: center;
  color: var(--muted);
}
.compact-empty { padding-top: 44px; padding-bottom: 52px; }

.empty-state h2 { margin: 18px 0 8px; color: var(--ink); font-size: 19px; }
.empty-state p, .loading-state p { margin: 0 auto; max-width: 390px; font-size: 13px; line-height: 1.65; }

.radar {
  position: relative;
  width: 80px;
  height: 80px;
  margin: auto;
  overflow: hidden;
  border: 1px solid #a8c7fa;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 15px, rgba(11,87,208,.13) 16px 17px);
}

.radar::before, .radar::after { position: absolute; content: ""; background: rgba(11,87,208,.14); }
.radar::before { width: 1px; height: 100%; left: 50%; }
.radar::after { width: 100%; height: 1px; top: 50%; left: 0; }
.radar span { position: absolute; inset: 50% 0 0 50%; background: conic-gradient(from 270deg, rgba(11,87,208,.45), transparent 35%); transform-origin: 0 0; animation: sweep 2.2s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }

.spinner { width: 38px; height: 38px; margin: 0 auto 18px; border: 3px solid #d7e3f7; border-top-color: var(--blue); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tool-results { padding: 18px 24px 24px; }

.dns-result-summary { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 17px 18px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 14px; background: #fff; box-shadow: 0 6px 22px rgba(28,48,77,.06); }
.dns-result-summary h2 { margin: 4px 0 5px; font-size: 18px; }
.dns-result-summary p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.query-count { display: grid; flex: 0 0 68px; height: 68px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); text-align: center; font-size: 11px; font-weight: 850; line-height: 1.3; }
.dns-lookup-list { display: grid; gap: 10px; margin-top: 12px; }
.dns-lookup-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(28,48,77,.04); }
.dns-lookup-head { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-bottom: 1px solid #edf1f6; }
.dns-type-badge { display: grid; min-width: 48px; height: 28px; padding: 0 7px; place-items: center; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.dns-lookup-title { min-width: 0; flex: 1; }
.dns-lookup-title strong { display: block; font-size: 14px; line-height: 1.4; word-break: break-all; }
.dns-lookup-title small { color: var(--muted); font-size: 11px; }
.dns-statuses { display: flex; gap: 4px; }
.dns-status { padding: 4px 7px; border-radius: 5px; color: #57677e; background: #edf2f7; font-size: 10px; font-weight: 750; }
.dns-status.good { color: var(--green); background: var(--green-soft); }
.dns-status.warn { color: var(--amber); background: var(--amber-soft); }
.dns-status.danger { color: var(--red); background: var(--red-soft); }
.dns-answer-list { padding: 9px 13px 11px; }
.dns-answer { display: grid; grid-template-columns: 68px minmax(0, 1fr) 32px auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed #e4eaf2; }
.dns-answer:last-child { border-bottom: 0; }
/*
 * 兩台解析器回覆不同的紀錄：只要不是 G 與 CF 都回傳就標示，不分紀錄類型。
 * 用琥珀色而非紅色 —— 最常見的成因是 DNS 傳播中或 CDN 地理路由，都不是錯誤，
 * 標成紅色會讓使用者很快學會忽略它。負 margin 讓色帶貼齊卡片邊緣，較好掃視。
 */
.dns-answer.partial { margin: 0 -13px; padding: 10px 13px 10px 10px; border-left: 3px solid #e8b53f; background: #fffaf0; }
.dns-answer.partial .dns-answer-value { color: #6b4c00; }
.resolver-tag { display: inline-block; padding: 1px 5px; border-radius: 4px; color: #51647f; background: #edf2f7; font-weight: 750; }
.resolver-tag.partial { color: var(--amber); background: var(--amber-soft); }
.lookup-mismatch { color: var(--amber); font-weight: 750; }
.dns-answer-type { color: #315d9b; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; font-weight: 850; }
.dns-answer-value { min-width: 0; color: #34445e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.55; word-break: break-all; }
.dns-answer-meta { color: #8a97a9; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.dns-no-answer { margin: 0; padding: 7px 0; color: var(--muted); font-size: 12px; }
.record-copy-button { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid #d6e0ec; border-radius: 7px; color: #5d6f88; background: #f8fafc; font-size: 15px; line-height: 1; }
.record-copy-button:hover { border-color: #a8c7fa; color: var(--blue); background: var(--blue-soft); }
.record-copy-button:focus-visible, .group-copy-button:focus-visible { outline: 2px solid #8ab4f8; outline-offset: 2px; }
.record-copy-button.copied { border-color: #a7d9c8; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 850; }
.dns-group-actions { display: flex; justify-content: flex-end; padding: 8px 13px 10px; border-top: 1px solid #edf1f6; background: #fbfcfe; }
.group-copy-button { min-height: 31px; padding: 6px 12px; border: 1px solid #c9d8ef; border-radius: 7px; color: var(--blue); background: #fff; font-size: 11px; font-weight: 800; }
.group-copy-button:hover { border-color: #8ab4f8; background: var(--blue-soft); }
.group-copy-button.copied { border-color: #a7d9c8; color: var(--green); background: var(--green-soft); }
.result-actions-boxed { padding: 0 2px; }

.summary-card, .official-card, .records-panel, .mail-auth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 22px rgba(28, 48, 77, .06);
}

.summary-card { display: flex; gap: 18px; align-items: center; justify-content: space-between; padding: 18px; }
.summary-card h2 { margin: 4px 0 6px; font-size: 19px; }
.summary-card p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.summary-card.good { border-left: 4px solid var(--green); }
.summary-card.warn { border-left: 4px solid #e2a400; }
.summary-card.danger { border-left: 4px solid var(--red); }

.risk-badge { display: grid; flex: 0 0 72px; height: 72px; place-items: center; border-radius: 50%; text-align: center; font-size: 11px; font-weight: 850; line-height: 1.25; }
.risk-badge.good { color: var(--green); background: var(--green-soft); }
.risk-badge.warn { color: var(--amber); background: var(--amber-soft); }
.risk-badge.danger { color: var(--red); background: var(--red-soft); }

.signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.signal-card { min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.signal-card .label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.signal-card h3 { margin: 8px 0 4px; font-size: 15px; }
.signal-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; word-break: break-word; }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.signal-dot.good { background: var(--green); }
.signal-dot.warn { background: #e2a400; }
.signal-dot.danger { background: var(--red); }

.mail-auth-card { margin: 12px 0; padding: 18px; }
.mail-auth-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mail-auth-heading h2 { margin: 4px 0 0; font-size: 17px; }
.provider-count { padding: 6px 11px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.provider-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.provider-chip { padding: 6px 11px; border: 1px solid #cddcf2; border-radius: 999px; color: #24508c; background: #f4f8ff; font-size: 11px; font-weight: 750; }
.provider-chip small { margin-left: 4px; color: #70829c; font-size: 10px; font-weight: 650; }
.provider-empty { margin: 10px 0; color: var(--muted); font-size: 12px; }
.mail-auth-list { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.auth-row { border-bottom: 1px solid #e7edf5; }
.auth-row:last-child { border-bottom: 0; }
.auth-row summary { display: flex; gap: 10px; align-items: center; padding: 12px; cursor: pointer; list-style: none; }
.auth-row summary::-webkit-details-marker { display: none; }
.auth-symbol { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 9px; font-size: 11px; font-weight: 900; }
.auth-symbol.good { color: var(--green); background: var(--green-soft); }
.auth-symbol.warn { color: var(--amber); background: var(--amber-soft); }
.auth-symbol.danger { color: var(--red); background: var(--red-soft); }
.auth-copy { min-width: 0; flex: 1; }
.auth-copy strong { display: block; margin-bottom: 3px; font-size: 13px; }
.auth-copy span { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
.auth-chevron { color: #8794a8; font-size: 13px; transition: transform .15s ease; }
.auth-row[open] .auth-chevron { transform: rotate(90deg); }
.auth-body { padding: 0 12px 12px 60px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-body p { margin: 0 0 8px; }
.auth-issues { margin: 0 0 9px; padding: 0; list-style: none; }
.auth-issues li { position: relative; margin: 5px 0; padding-left: 12px; }
.auth-issues li::before { position: absolute; top: .52em; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; content: ""; }
.auth-issues li.danger::before { background: var(--red); }
.auth-issues li.warn::before { background: #e2a400; }
.auth-record { margin: 6px 0; padding: 8px 10px; border-radius: 7px; color: #3d506e; background: #f4f7fb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.55; word-break: break-all; }
.auth-record b { margin-right: 5px; color: var(--blue); font-family: inherit; }
.dkim-limit { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.official-card { margin: 12px 0; padding: 18px; }
.official-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.official-heading h2 { margin: 4px 0 0; font-size: 17px; }
/* pre-line：#official-detail 會用換行分隔結果內文與來源說明。 */
.official-card > p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; white-space: pre-line; }
.official-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.official-badge.neutral { color: #596579; background: #edf1f6; }
.official-badge.good { color: var(--green); background: var(--green-soft); }
.official-badge.danger { color: var(--red); background: var(--red-soft); }
.fine-print { font-size: 11px !important; }

.records-panel { overflow: hidden; }
.records-panel summary { padding: 15px 17px; cursor: pointer; font-size: 13px; font-weight: 800; }
.records-panel[open] summary { border-bottom: 1px solid var(--line); }
.record-group { padding: 14px 17px; border-bottom: 1px solid #edf1f6; }
.record-group:last-child { border-bottom: 0; }
.record-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.record-type { display: inline-grid; min-width: 46px; min-height: 27px; padding: 5px 9px; place-items: center; border-radius: 6px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 900; }
.record-count { color: var(--muted); font-size: 12px; }
.record-value { display: flex; gap: 9px; align-items: flex-start; margin: 9px 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; line-height: 1.55; word-break: break-all; }
.record-content { min-width: 0; flex: 1; }
.resolver-chip { flex: 0 0 auto; margin-top: 2px; padding: 2px 6px; border-radius: 4px; color: #51647f; background: #eef2f7; font-family: inherit; font-size: 11px; }
/* 與 DNS Check 的 .dns-answer.partial 同一套標示語彙。 */
.record-value.partial { margin: 9px -17px; padding: 5px 17px 5px 14px; border-left: 3px solid #e8b53f; background: #fffaf0; }
.record-value.partial .record-content { color: #6b4c00; }
.resolver-chip.partial { color: var(--amber); background: var(--amber-soft); font-weight: 750; }
.empty-record { color: var(--muted); font-size: 12px; }
.gws-group-actions { display: flex; justify-content: flex-end; margin-top: 9px; padding-top: 9px; border-top: 1px dashed #e4eaf2; }
.resolver-warning { margin: 12px 14px 0; padding: 10px 12px; border-radius: 8px; color: var(--amber); background: var(--amber-soft); font-size: 12px; line-height: 1.55; }

.result-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 12px; }
.text-button { padding: 4px 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 750; }

.history-panel { margin: 4px 24px 12px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 6px 22px rgba(28,48,77,.06); }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-heading h2 { margin: 4px 0 0; font-size: 17px; }
.history-heading-actions { display: flex; gap: 8px; align-items: center; }
.history-heading-actions span { color: var(--muted); font-size: 11px; }
.history-heading-actions button { padding: 5px 8px; border: 0; color: var(--red); background: transparent; font-size: 11px; font-weight: 750; }
.history-heading-actions button:disabled { color: #aeb8c6; cursor: default; }
.history-empty, .history-notice { margin: 13px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.history-notice { padding: 8px 9px; border-radius: 7px; color: var(--amber); background: var(--amber-soft); }
.history-list { display: grid; gap: 7px; margin-top: 12px; }
.history-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid #e2e8f1; border-radius: 9px; background: #fbfcfe; }
.history-mode { min-width: 44px; padding: 5px 7px; border-radius: 6px; color: var(--blue); background: var(--blue-soft); text-align: center; font-size: 10px; font-weight: 900; }
.history-mode.gws { color: #76520a; background: var(--amber-soft); }
.history-info { min-width: 0; }
.history-info strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-info span { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.history-actions { display: flex; gap: 3px; }
.history-actions button { padding: 5px 9px; border: 0; border-radius: 5px; color: #4f6179; background: #edf2f7; font-size: 11px; font-weight: 750; }
.history-actions button:hover { color: var(--blue); background: var(--blue-soft); }
.history-actions button[data-action="delete"]:hover { color: var(--red); background: var(--red-soft); }

/* 延伸查詢：導向第三方網站的連結。標示得明確一點，讓使用者知道要離站了。 */
.external-links { margin: 12px 24px 0; padding: 12px 14px; border: 1px dashed #d6e0ec; border-radius: 10px; background: #fbfcfe; }
.external-links-label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.external-links-label small { display: block; margin-top: 2px; font-weight: 500; letter-spacing: 0; line-height: 1.5; }
.external-links-row { display: flex; flex-wrap: wrap; gap: 8px; }
.external-link { display: inline-flex; gap: 5px; align-items: center; padding: 7px 11px; border: 1px solid #d6e0ec; border-radius: 7px; color: var(--blue); background: #fff; font-size: 12px; font-weight: 750; text-decoration: none; }
.external-link:hover { border-color: #a8c7fa; background: var(--blue-soft); }

/* who.is 提醒：只在 DNS 查不到時出現，說明 DNS 與註冊狀態是兩回事。 */
.whois-hint { margin: 9px 0 0; padding: 9px 10px; border: 1px solid #f0d79a; border-radius: 8px; color: #76520a; background: var(--amber-soft); font-size: 12px; line-height: 1.6; }
.whois-link { display: inline-flex; gap: 4px; align-items: center; margin-left: 2px; color: var(--blue); font-weight: 750; text-decoration: none; white-space: nowrap; }
.whois-link:hover { text-decoration: underline; }
.external-icon { flex: 0 0 auto; opacity: .8; }

/* 供應商標籤：附加資訊，視覺重量刻意低於紀錄值本身。 */
.infra-tag { display: inline-block; margin-left: 7px; padding: 1px 6px; border: 1px solid #dde5f0; border-radius: 5px; color: #5a6b85; background: #f4f7fb; font-family: Inter, "Noto Sans TC", system-ui, sans-serif; font-size: 10px; font-weight: 700; vertical-align: 1px; white-space: nowrap; }

.history-pause { display: flex; gap: 9px; align-items: flex-start; margin-top: 13px; padding: 9px 10px; border: 1px solid #e2e8f1; border-radius: 8px; background: #fbfcfe; cursor: pointer; }
.history-pause input { flex: 0 0 auto; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--blue); }
.history-pause strong { display: block; font-size: 12px; }
.history-pause small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.history-pause:has(input:checked) { border-color: #f0d79a; background: var(--amber-soft); }

footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 14px 24px 18px; color: var(--muted); font-size: 11px; }
footer a { color: var(--blue); text-decoration: none; }
/* flex: 1 0 100% 讓版權自成一行，不跟上面兩項擠在同一列被 space-between 拉開。 */
.copyright { flex: 1 0 100%; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); color: #94a3b8; text-align: center; font-size: 10px; letter-spacing: .02em; }

[hidden] { display: none !important; }

/**
 * 網頁版字級。
 *
 * 基礎字級是為 600px 寬的擴充套件 popup 訂的——在那種寬度下 10～12px 是必要的
 * 妥協。網頁版沒有這個限制，沿用只會讓內容又小又難讀，所以整體往上調一到三級。
 *
 * 調整幅度刻意不一致：標題與內文加最多，chip／badge／狀態標籤這類結構性小字只
 * 微調或不動——它們是視覺錨點不是閱讀內容，放大只會把版面撐鬆、讓真正該讀的東西
 * 反而不突出。
 */
body.web .hero h1 { font-size: 27px; }
body.web .hero p { font-size: 14px; }
body.web .eyebrow { font-size: 11px; }

body.web .tool-tab strong { font-size: 15px; }
body.web .tool-tab small { font-size: 13px; }

body.web .check-form > label { font-size: 15px; }
body.web .check-form > label .label-hint { font-size: 12px; }
body.web .form-meta { font-size: 12px; }
body.web .form-error { font-size: 13px; }
body.web .field-notice { font-size: 12px; }
body.web .type-picker > summary,
body.web .type-picker > summary strong { font-size: 12px; }
body.web .type-picker-actions button { font-size: 12px; }
body.web .type-options label { font-size: 12px; }
body.web .type-options b { font-size: 13px; }
body.web .selector-settings summary,
body.web .selector-settings label,
body.web .selector-settings p { font-size: 12px; }
body.web .selector-settings input { font-size: 14px; }

body.web .empty-state h2 { font-size: 22px; }
body.web .empty-state p,
body.web .loading-state p { max-width: 460px; font-size: 15px; }

body.web .dns-result-summary h2,
body.web .summary-card h2 { font-size: 21px; }
body.web .dns-result-summary p:last-child,
body.web .summary-card p:last-child { font-size: 14px; }
body.web .dns-lookup-title strong { font-size: 16px; }
body.web .dns-lookup-title small { font-size: 12px; }
body.web .dns-answer-type { font-size: 13px; }
body.web .dns-answer-value { font-size: 15px; }
body.web .dns-answer-meta { font-size: 12px; }
body.web .dns-no-answer { font-size: 13px; }
body.web .group-copy-button { font-size: 12px; }

body.web .signal-card .label { font-size: 11px; }
body.web .signal-card h3 { font-size: 17px; }
body.web .signal-card p { font-size: 13px; }

body.web .mail-auth-heading h2,
body.web .official-heading h2,
body.web .history-heading h2 { font-size: 19px; }
body.web .provider-chip { font-size: 12px; }
body.web .provider-empty { font-size: 13px; }
body.web .auth-copy strong { font-size: 15px; }
body.web .auth-copy span { font-size: 13px; }
body.web .auth-body,
body.web .auth-record { font-size: 13px; }
body.web .dkim-limit { font-size: 12px; }
body.web .official-card > p { font-size: 13px; }
body.web .fine-print { font-size: 12px; }

body.web .records-panel summary { font-size: 15px; }
body.web .record-type,
body.web .record-count { font-size: 13px; }
body.web .record-value { font-size: 14px; }
body.web .empty-record { font-size: 13px; }
body.web .resolver-warning { font-size: 13px; }
body.web .text-button { font-size: 13px; }
body.web .whois-hint { font-size: 13px; }
body.web .external-links-label { font-size: 12px; }
body.web .external-link { font-size: 13px; }
body.web .infra-tag { font-size: 11px; }

body.web .history-info strong { font-size: 14px; }
body.web .history-info span { font-size: 12px; }
body.web .history-empty,
body.web .history-notice { font-size: 13px; }
body.web .history-actions button,
body.web .history-heading-actions span,
body.web .history-heading-actions button { font-size: 12px; }
body.web .history-pause strong { font-size: 13px; }
body.web .history-pause small { font-size: 12px; }
body.web footer { font-size: 12px; }
body.web .copyright { font-size: 11px; }

/**
 * 紀錄類型改用 auto-fit：欄數跟著可用寬度自己長，不必為每個斷點各寫一次。
 * 手機約排 2 欄、平板 3～4 欄、桌機 6 欄以上，都不會出現半空的一列。
 */
body.web .type-options { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/**
 * 寬螢幕：容器變寬之後，24px 的內距會讓內容看起來貼著邊。
 */
@media (min-width: 900px) {
  body.web .hero { padding: 26px 34px 24px; }
  body.web .check-form { padding: 22px 34px 18px; }
  body.web .tool-results { padding: 22px 34px 28px; }
  body.web .empty-state,
  body.web .loading-state { padding-right: 34px; padding-left: 34px; }
  body.web .history-panel { margin-right: 34px; margin-left: 34px; }
  body.web footer { padding: 16px 34px 22px; }
  /* 5 張訊號卡排 3 欄是 3+2，比 2 欄的 2+2+1 平衡，也避免卡片被拉得又寬又空。 */
  body.web .signal-grid { grid-template-columns: repeat(3, 1fr); }
}

/**
 * 窄螢幕（手機直向）調整。只針對網頁版：擴充套件 popup 永遠是 600px，套用這些
 * 規則反而會讓它在寬度充足時擠成單欄。
 */
@media (max-width: 560px) {
  body.web .hero { padding: 18px 16px 16px; }
  body.web .tool-switch,
  body.web .check-form,
  body.web .tool-results,
  body.web .empty-state,
  body.web .loading-state { padding-right: 16px; padding-left: 16px; }
  /* .history-panel 是靠 margin 而非 padding 內縮的卡片。 */
  body.web .history-panel { margin-right: 16px; margin-left: 16px; }
  body.web footer { padding: 14px 16px 18px; }
  body.web .signal-grid { grid-template-columns: 1fr; }
  body.web .type-options { grid-template-columns: repeat(2, 1fr); }
  body.web .input-row { flex-wrap: wrap; }
  body.web .input-row input { flex: 1 1 100%; }
  body.web .input-row button { flex: 1 1 100%; }
  /* 四欄的紀錄列在窄螢幕會把值擠成一字一行；改成兩欄，TTL 與解析器標籤移到次行。 */
  body.web .dns-answer { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  body.web .dns-answer-type { grid-column: 1; }
  body.web .dns-answer-value { grid-column: 1 / -1; }
  body.web .dns-answer-meta { grid-column: 1 / -1; }
  body.web .history-item { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  body.web .history-actions { grid-column: 1 / -1; }
}
