/* ============================================================
   produced by YiFangDi.Com
   ============================================================ */

:root {
  --canvas: #f7f8fc;
  --card: #ffffff;
  --field: #f5f6fa;
  --ink: #1c2333;
  --ink-2: #4d5769;
  --muted: #7d8698;
  --faint: #a6aebf;
  --line: #ebedf4;
  --hair: #f0f2f7;

  --brand: #5b58d6;
  --brand-soft: #eeeefb;
  --mint: #14997c;
  --mint-soft: #e6f6f1;
  --sky: #2f86eb;
  --sky-soft: #e8f2fd;
  /* 实心面（按钮/选中态）：浅色用 #2f86eb + 白字；深色用亮蓝 + 深字，保证对比度 */
  --sky-solid: #2f86eb;
  --on-sky: #ffffff;
  --on-sky-shadow: rgba(6, 22, 44, .22);
  --pink: #d2588c;
  --danger: #d4544f;
  --danger-soft: #fdeeee;

  --sh: 0 12px 30px -22px rgba(26, 34, 58, .45);
  --sh-lg: 0 30px 70px -34px rgba(26, 34, 58, .55);

  --sans: "Inter", "HarmonyOS Sans SC", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --r: 18px;
}

[data-theme="dark"] {
  --canvas: #0e1016;
  --card: #15181f;
  --field: #1b1f28;
  --ink: #e9ecf4;
  --ink-2: #c0c7d6;
  --muted: #8b93a6;
  --faint: #798196;
  --line: #242833;
  --hair: #1e222b;

  --brand: #8b88ff;
  --brand-soft: #23233c;
  --mint: #3fd0a6;
  --mint-soft: #16302a;
  --sky: #62a8ff;
  --sky-soft: #16283f;
  /* 深色下浅蓝底不能压白字（仅 2.4:1），改用深色文字 */
  --sky-solid: #62a8ff;
  --on-sky: #0d1420;
  --on-sky-shadow: rgba(13, 20, 32, 0);
  --pink: #ff85b3;
  --danger: #ff7d78;
  --danger-soft: #33201f;

  --sh: 0 14px 34px -26px rgba(0, 0, 0, .95);
  --sh-lg: 0 34px 80px -40px rgba(0, 0, 0, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* 预留纵向滚动条位置：内容高度变化时（滚动条出现/消失）不产生横向位移 */
html { scrollbar-gutter: stable; }

body {
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: var(--sky-soft); color: var(--ink); }

/* ---------- 背景 ---------- */
.wash { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.glow-a { width: 620px; height: 620px; left: -180px; top: -240px; background: radial-gradient(circle, #ded9ff, transparent 68%); opacity: .6; }
.glow-b { width: 520px; height: 520px; right: -200px; bottom: -240px; background: radial-gradient(circle, #d9f0e8, transparent 70%); opacity: .5; }
[data-theme="dark"] .glow { opacity: .16; }

/* ---------- 页面 ---------- */
/* 顶部锚定：topbar / 导航 / 标题 / 网格的起始位置与内容无关，
   切换工具时框架完全不动。页面高度随内容自然增长，内容多的工具直接滚动页面，
   卡片内部不出现滚动条。 */
.page {
  position: relative; z-index: 1; max-width: 1240px; margin: 0 auto;
  padding: 22px 24px 26px; min-height: 100vh;
  display: flex; flex-direction: column;
}
.stage { width: 100%; flex: 1 1 auto; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-mark img { width: 100%; height: 100%; display: block; border-radius: 8px; object-fit: contain; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: .04em; display: flex; align-items: baseline; gap: 7px; }
.brand-name em { font-style: normal; font-size: 10px; font-weight: 500; letter-spacing: .16em; color: var(--faint); }

.top-actions { margin-left: auto; display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--muted); transition: .18s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--ink); background: var(--card); border-color: var(--line); }
.ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }
[data-theme="dark"] .ico-moon { display: block; }

/* 二维码悬浮卡：hover / 键盘聚焦显示；绝对定位不占文档流，不影响顶部锚点 */
.qr-wrap { position: relative; display: flex; }
.qr-popover {
  position: absolute; top: calc(100% + 11px); left: 50%; z-index: 50;
  width: 170px; padding: 11px 11px 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--sh-lg); text-align: center;
  opacity: 0; visibility: hidden; transform: translate(-50%, -6px);
  transition: opacity .18s, transform .18s, visibility 0s linear .18s;
}
/* 桥接按钮与卡片之间的 11px 间隙，避免鼠标移过去时 hover 中断 */
.qr-popover::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
}
.qr-wrap:hover .qr-popover,
.qr-wrap:focus-within .qr-popover {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition-delay: 0s;
}
.qr-popover img {
  display: block; width: 100%; height: auto;
  border-radius: 8px; background: #fff;
}
.qr-popover span {
  display: block; margin-top: 8px;
  font-size: 10.5px; letter-spacing: .03em; color: var(--muted);
}

/* ---------- 工具条：IPv4 / IPv6 两层 ---------- */
.tools {
  display: flex; flex-direction: column; gap: 3px;
  margin: 13px 0 0; padding-bottom: 11px;
}
.tool-row {
  display: flex; align-items: center; gap: 13px;
  min-width: 0;
  padding: 3px 0;
}
.tool-row-label {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  width: 52px;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; color: var(--faint);
  transition: color .18s;
  user-select: none;
}
.tool-row-label::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .4; transition: opacity .18s, box-shadow .18s;
}
.tool-row[data-proto="ipv4"] .tool-row-label::before { background: var(--brand); }
.tool-row[data-proto="ipv6"] .tool-row-label::before { background: var(--sky); }
.tool-row.on .tool-row-label { color: var(--ink-2); }
.tool-row.on .tool-row-label::before { opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }

.tool-row-items {
  display: flex; align-items: center; gap: 1px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.tool-row-items::-webkit-scrollbar { display: none; }
/* 仅在真的溢出时才做右侧渐隐提示 */
.tool-row-items.scrollable {
  mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent);
}
.tool-pill {
  flex: 0 0 auto; height: 28px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 12.5px; white-space: nowrap; transition: .16s;
}
/* IPv6 只有 5 个工具，稍加间距让两层视觉重量接近 */
.tool-row[data-proto="ipv6"] .tool-pill { padding: 0 13px; }
.tool-pill:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 80%, transparent); }
.tool-pill.active {
  background: var(--sky-solid); color: var(--on-sky); font-weight: 500;
  box-shadow: 0 8px 16px -10px color-mix(in srgb, var(--sky-solid) 90%, transparent);
  /* 中蓝底 + 白字对比度约 3.7:1，轻投影补偿小字号可读性 */
  text-shadow: 0 1px 1px var(--on-sky-shadow);
}

/* ---------- 工具标题 ---------- */
.toolbar { display: flex; align-items: center; gap: 13px; margin: 10px 0 18px; }
.tool-icon {
  flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 13px; color: var(--brand);
  background: var(--brand-soft);
}
.tool-icon svg { width: 21px; height: 21px; }
.tool-icon.v6 { color: var(--sky); background: color-mix(in srgb, var(--sky) 12%, transparent); }
.tool-text { min-width: 0; }
.tool-text h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.tool-text p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tool-actions { margin-left: auto; display: flex; gap: 6px; }
.ghost-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--muted); transition: .18s;
}
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn:hover { color: var(--sky); border-color: color-mix(in srgb, var(--sky) 35%, var(--line)); }

/* ---------- 卡片 ---------- */
/* 网格按内容自然高度排布，两卡各自完整展开，互不裁切、不出现内部滚动条。 */
.grid {
  display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 18px;
  align-items: start;
}
.card {
  min-width: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh); overflow: hidden;
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--hair);
  font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); margin-left: auto; animation: pulse 1.9s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
/* 卡片内容完整展开，不设内部滚动 */
.card-body { padding: 18px; }

/* ---------- 表单 ---------- */
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; color: var(--ink-2); }
.field .hint { font-size: 10.5px; color: var(--faint); }

.control {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--field); color: var(--ink);
  font-family: var(--mono); font-size: 12.5px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
select.control {
  font-family: var(--sans); font-size: 12.5px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.control:focus { border-color: color-mix(in srgb, var(--sky) 45%, var(--line)); background: var(--card); box-shadow: 0 0 0 3.5px var(--sky-soft); }
.control:disabled { opacity: .55; }

.octets { display: flex; align-items: center; gap: 4px; min-width: 0; }
.octets input {
  flex: 1 1 0; min-width: 0; width: 100%; height: 42px; text-align: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--field); color: var(--ink);
  font-family: var(--mono); font-size: 12.5px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.octets input:focus { border-color: color-mix(in srgb, var(--sky) 45%, var(--line)); background: var(--card); box-shadow: 0 0 0 3.5px var(--sky-soft); }
.octet-sep { color: var(--faint); font-family: var(--mono); font-size: 11.5px; }

.segmented { display: flex; flex-wrap: wrap; gap: 5px; }
.segmented label {
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--field);
  font-size: 12px; color: var(--muted); transition: .16s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:hover { color: var(--ink-2); }
.segmented label:has(input:checked) { background: var(--sky-solid); color: var(--on-sky); border-color: transparent; text-shadow: 0 1px 1px var(--on-sky-shadow); }

.range { display: flex; align-items: center; gap: 12px; }
.range input[type="range"] { flex: 1; height: 5px; accent-color: var(--sky); }
.range input[type="number"] {
  width: 78px; height: 42px; flex: 0 0 78px; text-align: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--field); color: var(--ink);
  font-family: var(--mono); font-size: 13px; font-weight: 600; outline: none;
}

/* ---------- 快捷填值 ---------- */
.presets { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; }
.presets-label { font-size: 11px; color: var(--faint); }
.preset-chip {
  border: 0; background: none; padding: 0;
  font-size: 11.5px; color: var(--muted);
  border-bottom: 1px dashed var(--line-2, var(--line)); transition: .16s;
}
.preset-chip:hover { color: var(--sky); border-bottom-color: var(--sky); }

/* ---------- 操作 ---------- */
.card-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.primary-btn {
  height: 36px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--sky-solid); color: var(--on-sky); font-size: 12.5px; font-weight: 600;
  transition: transform .18s, filter .18s;
  /* 中蓝底 + 白字对比度约 3.7:1，轻投影补偿小字号可读性 */
  text-shadow: 0 1px 1px var(--on-sky-shadow);
}
.primary-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.link-btn { border: 0; background: none; padding: 0; font-size: 12px; color: var(--muted); }
.link-btn:hover { color: var(--sky); }

/* ---------- 结果 ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 17px; border-radius: 14px;
  background: var(--brand-soft);
}
/* 入场动画只在切换工具时触发一次，数值更新不重播，避免整块结果闪烁 */
.hero.enter { animation: fadeUp .32s cubic-bezier(.2, .7, .3, 1) both; }
.hero.tone-mint { background: var(--mint-soft); }
.hero.tone-violet { background: color-mix(in srgb, var(--pink) 12%, transparent); }
.hero.tone-cyan { background: color-mix(in srgb, var(--sky) 12%, transparent); }
.hero.is-error { background: var(--danger-soft); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero-label { font-size: 11px; color: var(--ink-2); }
.hero-value {
  display: block; margin-top: 4px;
  font-family: var(--mono); font-size: clamp(20px, 2.3vw, 27px); font-weight: 650;
  letter-spacing: -.02em; line-height: 1.25; color: var(--ink); word-break: break-all;
}
.hero.is-error .hero-value { font-size: 14px; font-family: var(--sans); font-weight: 500; color: var(--danger); letter-spacing: 0; }
.hero-copy {
  flex-shrink: 0; height: 28px; padding: 0 12px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--sky) 22%, transparent);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--ink-2); font-size: 11.5px; transition: .16s;
}
.hero-copy:hover { color: var(--sky); border-color: var(--sky); }

.rows { margin-top: 14px; border-top: 1px solid var(--hair); }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 1px; border-bottom: 1px solid var(--hair);
}
/* 行入场只在切换工具时播一次；数值更新即时呈现，不整列闪烁 */
.rows.enter .row { animation: fadeUp .3s both; }
.row-key { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-val {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink);
  text-align: right; word-break: break-all; cursor: copy;
}
.row-val.accent { color: var(--brand); }
.row-val.mint { color: var(--mint); }
.row-val.violet { color: var(--pink); }
.row-val.cyan { color: var(--sky); }
.row-val.error { color: var(--danger); }
.row-val:hover { text-decoration: underline dotted; text-underline-offset: 3px; }

.note {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  background: var(--field); color: var(--muted); font-size: 11.5px; line-height: 1.7;
}
.note.is-error { background: var(--danger-soft); color: var(--danger); }

/* 表格随卡片内容自然展开，滚动交给外层卡片体统一处理，避免双层滚动条 */
.table-wrap { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.table-wrap:empty { display: none; }
.subnet-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; }
.subnet-table th {
  position: sticky; top: 0; z-index: 1;
  padding: 9px 12px; text-align: left; font-size: 10px; font-weight: 600;
  color: var(--muted); background: var(--card); border-bottom: 1px solid var(--line);
}
.subnet-table td { padding: 8px 12px; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.subnet-table tr:last-child td { border-bottom: 0; }
.subnet-table tr:hover td { background: var(--field); color: var(--ink); }

/* ---------- 页脚 ---------- */
.foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; font-size: 10.5px; color: var(--faint);
}
.foot i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.foot-right { margin-left: auto; }
/* 页脚链接与同行文字完全一致：无下划线、继承同一颜色（含访问/悬停状态） */
.foot a,
.foot a:visited,
.foot a:hover,
.foot a:focus { color: inherit; text-decoration: none; }

/* ---------- 搜索面板 ---------- */
.palette { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; }
.palette[hidden] { display: none; }
.palette-mask { position: absolute; inset: 0; background: rgba(24, 29, 44, .26); backdrop-filter: blur(3px); animation: fadeIn .18s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.palette-panel {
  position: relative; width: min(520px, 92vw); margin-top: 14vh;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--sh-lg); overflow: hidden;
  animation: popIn .2s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.palette-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.palette-top svg { width: 16px; height: 16px; color: var(--faint); }
.palette-top input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13.5px; }
.palette-top input::placeholder { color: var(--faint); }
kbd {
  font-family: var(--mono); font-size: 9.5px; line-height: 1;
  padding: 3px 6px; border-radius: 5px; background: var(--field); color: var(--faint);
}
.palette-list {
  max-height: 46vh; overflow-y: auto; padding: 6px;
  mask-image: linear-gradient(180deg, #000 calc(100% - 20px), transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 20px), transparent);
}
.palette-group { padding: 9px 10px 5px; font-size: 10px; letter-spacing: .1em; color: var(--faint); }
.palette-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 9px; border: 0;
  background: transparent; color: var(--ink-2); text-align: left; transition: .14s;
}
.palette-item:hover, .palette-item.selected { background: var(--field); color: var(--ink); }
.palette-item.selected { background: var(--sky-soft); }
.palette-item.selected .pi-copy strong { color: var(--sky); }
.pi-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pi-copy strong { font-size: 12.5px; font-weight: 500; }
.pi-copy small { font-size: 10.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-tag { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.palette-empty { padding: 30px; text-align: center; color: var(--faint); font-size: 12px; }

/* ---------- 说明抽屉 ---------- */
.drawer-mask { position: fixed; inset: 0; z-index: 60; background: rgba(22, 27, 42, .28); backdrop-filter: blur(2px); }
.drawer-mask[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(400px, 92vw); display: flex; flex-direction: column;
background: var(--card); border-left: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  transform: translateX(102%);
  /* 关闭时 visibility:hidden —— 否则抽屉虽在视口外，其内部按钮仍能被 Tab 聚焦 */
  visibility: hidden;
  transition: transform .28s cubic-bezier(.2, .7, .3, 1), visibility 0s linear .28s;
}
.drawer.open {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--hair); }
.drawer-head strong { font-size: 13.5px; font-weight: 600; }
.drawer-head button { width: 30px; height: 30px; border: 0; border-radius: 9px; background: var(--field); color: var(--muted); font-size: 17px; line-height: 1; }
.drawer-body { padding: 4px 20px 36px; overflow-y: auto; }
.drawer-tool { padding: 16px 0 4px; }
.drawer-tool strong { display: block; font-size: 14px; font-weight: 600; }
.drawer-tool code {
  display: block; margin-top: 7px; padding: 10px 12px; border-radius: 10px;
  background: var(--field); color: var(--ink-2);
  font-family: var(--mono); font-size: 11px; line-height: 1.8; word-break: break-word;
}
.drawer-body h3 { margin: 22px 0 9px; font-size: 11px; letter-spacing: .08em; color: var(--faint); font-weight: 600; }
.drawer-body p { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
.keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.keys li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.detail { list-style: none; margin: 0; padding: 0; }
.detail li { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.detail li:last-child { border-bottom: 0; }
.detail span { font-size: 12px; font-weight: 600; color: var(--ink); }
.detail em { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; line-height: 1.75; color: var(--muted); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 120;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: var(--canvas);
  font-size: 11.5px; box-shadow: var(--sh-lg);
  transition: transform .22s, opacity .22s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  /* 移动端两卡纵向堆叠，页面自然滚动，卡片内容完整展开 */
  .page { padding: 18px 16px 24px; }
  .stage { display: block; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tool-text p { display: none; }
  /* 窄屏下二维码卡改为右对齐按钮，避免居中被视口右缘裁切 */
  .qr-popover { left: auto; right: -2px; transform: translateY(-6px); }
  .qr-wrap:hover .qr-popover,
  .qr-wrap:focus-within .qr-popover { transform: translateY(0); }
}

@media (max-width: 560px) {
  .brand-name em { display: none; }
  .toolbar { gap: 10px; }
  .tool-text h1 { font-size: 17px; }
  .octets input { font-size: 12px; }
  .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .row-val { text-align: left; }
  .hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero-copy { align-self: flex-end; }
  .foot-right { display: none; }
  /* 窄屏收紧层标签，给药丸让出横向空间 */
  .tool-row { gap: 9px; }
  .tool-row-label { width: 42px; font-size: 10px; gap: 5px; }
  .tool-pill { padding: 0 9px; font-size: 12px; }
  .tool-row[data-proto="ipv6"] .tool-pill { padding: 0 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
