/* ============================================================================
   文件：style.css —— ToolPocket 全站样式（小鲸 · 2026-10-11 重做）
   设计原则：
     · 快 —— 零外部请求（不引字体、不引框架），约 7KB，浏览器缓存后其它页面零成本；
     · 干净 —— 一个主色 + 中性灰，工具站该像工具，不玩花活；
     · 手机优先 —— 绝大多数访问来自手机搜索，先写窄屏，再在 640px 以上铺开。
   命名：语义化短类名，不引 BEM 那套长名字（页面结构简单，长名字只会更难读）。
   ============================================================================ */

:root {
  --bg: #ffffff;
  --fg: #111318;
  --muted: #626a78;
  --line: #e8eaf0;
  --card: #fbfcfe;
  --brand: #2f6df6;
  --brand-2: #6f9bff;
  --brand-soft: #eff4ff;
  --ok: #0b8a4b;
  --bad: #d33a3a;
  --radius: 14px;
  --maxw: 900px;
  --shadow: 0 1px 2px rgba(17, 19, 24, .04), 0 8px 24px rgba(17, 19, 24, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --fg: #e9ebf0;
    --muted: #98a1b0;
    --line: #23262e;
    --card: #14171d;
    --brand: #6f9bff;
    --brand-2: #9db9ff;
    --brand-soft: #141c2e;
    --ok: #4ade80;
    --bad: #f87171;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; padding: 0 18px 64px;
  background: var(--bg); color: var(--fg);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "PingFang SC", "Microsoft YaHei", sans-serif;
}
main { max-width: var(--maxw); margin: 0 auto; }

/* ── 顶栏 ── */
.top {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 12px; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; text-decoration: none; color: var(--fg); letter-spacing: -.2px; }
.langs { display: flex; gap: 2px; }
.langs a {
  font-size: 13px; text-decoration: none; color: var(--muted);
  padding: 5px 9px; border-radius: 8px;
}
.langs a:hover { background: var(--brand-soft); color: var(--brand); }
.langs a.on { color: var(--fg); font-weight: 700; background: var(--brand-soft); }

/* ── 标题与正文 ── */
h1 { font-size: 27px; line-height: 1.25; margin: 24px 0 10px; letter-spacing: -.4px; }
h2 { font-size: 17px; margin: 34px 0 12px; letter-spacing: -.2px; }
.lead { color: var(--muted); margin: 0 0 14px; }
p { margin: 12px 0; }
a { color: var(--brand); }
code { background: var(--brand-soft); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.crumb { margin: 18px 0 0; font-size: 13px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--brand); }
.badge-line { margin: 0 0 4px; }
.pill {
  display: inline-block; font-size: 12px; line-height: 1.5; padding: 5px 11px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line);
}

/* ── 首页工具网格 ── */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid a {
  display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; gap: 2px 12px;
  text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.grid a:hover { border-color: var(--brand); transform: translateY(-2px); }
.grid .ico { grid-row: 1 / span 2; font-size: 25px; line-height: 1.2; }
.grid b { font-size: 15.5px; font-weight: 650; }
.grid .sub { color: var(--muted); font-size: 13px; line-height: 1.55; }

.why { background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px 18px 18px; margin-top: 34px; }

/* ── 工具面板 ── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 18px 0 0; box-shadow: var(--shadow); }
.opts { margin: 4px 0 10px; }
.lbl { font-size: 14px; font-weight: 600; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 11px 0; font-size: 14px; color: var(--fg); }
.row .lbl { min-width: 0; }
.note { font-size: 12.5px; color: var(--muted); }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--line); }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 16px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--fg); }
.drop b { color: var(--fg); font-size: 15px; }
input[type=file] { display: none; }

textarea {
  width: 100%; min-height: 150px; padding: 12px 13px; resize: vertical;
  border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--fg);
  font: 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
textarea.tall { min-height: 170px; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
select, input[type=number], input[type=text] {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--fg); font-size: 14px; max-width: 100%;
}
input[type=range] { flex: 1; min-width: 140px; accent-color: var(--brand); }
input[type=number] { width: 116px; }
input[type=color] { width: 52px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: none; cursor: pointer; }

button {
  font: inherit; font-size: 14.5px; font-weight: 620; padding: 11px 19px; border-radius: 11px;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
button:hover { opacity: .92; }
button:active { transform: translateY(1px); }
button.ghost { background: transparent; color: var(--brand); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.status { font-size: 13px; margin: 10px 0 0; min-height: 1em; color: var(--muted); }
.status.ok { color: var(--ok); font-weight: 600; }
.status.bad { color: var(--bad); }
.swatch { height: 46px; border-radius: 11px; border: 1px solid var(--line); margin: 12px 0 0; background: #2f6df6; }

/* ── 结果列表（图片类）── */
.results { list-style: none; padding: 0; margin: 16px 0 0; }
.results li {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px;
}
.results img { width: 52px; height: 52px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.results .meta { flex: 1; min-width: 0; }
.results .meta b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .saved { color: var(--ok); font-weight: 600; }
.results button.dl {
  font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 9px;
  background: transparent; color: var(--brand); border: 1px solid var(--line);
}
.results button.dl:hover { border-color: var(--brand); }

/* ── FAQ ── */
.faq { margin-top: 34px; }
details { border-bottom: 1px solid var(--line); padding: 13px 0; }
details:last-of-type { border-bottom: 0; }
summary { cursor: pointer; font-weight: 620; font-size: 15px; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "＋ "; color: var(--brand); font-weight: 700; }
details[open] summary::before { content: "－ "; }
details p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }

/* ── 泄露检测区块（默认收起，用户点开才出现 —— 联网功能必须显式同意）── */
.pwn {
  margin: 18px 0 0; padding: 15px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg);
}
.pwn .btnrow { margin-top: 10px; }
.pwn .confirm {
  margin-top: 12px; padding: 13px 14px; border-radius: 11px;
  background: var(--brand-soft); border: 1px solid var(--brand);
}
.pwn .confirm .note { color: var(--fg); }
.pwn .confirm button:not(.ghost) { background: var(--brand); }


/* ── 广告位（纯静态卡片：无脚本、无 iframe、无额外请求）── */
.ad {
  position: relative; margin: 34px 0 0; padding: 18px 18px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--brand-soft), transparent 70%);
}
.ad-label {
  position: absolute; top: -9px; left: 14px; font-size: 11px; letter-spacing: .04em;
  padding: 2px 9px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); text-transform: uppercase;
}
.ad-body b { display: block; font-size: 15.5px; margin-bottom: 5px; }
.ad-body p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }
.ad-cta { font-size: 13.5px; font-weight: 620; text-decoration: none; }

/* ── 招租页的规格表 ── */
table.spec { width: 100%; border-collapse: collapse; font-size: 14px; margin: 6px 0 0; }
table.spec td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.spec td:first-child { width: 30%; }
table.spec td:not(:first-child) { color: var(--muted); }
.contact code { font-size: 13px; padding: 4px 9px; }

/* ── 提示条 ── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: #111318; color: #fff; padding: 12px 20px; border-radius: 11px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s;
  max-width: 84vw; text-align: center; z-index: 99;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 页脚 ── */
footer { max-width: var(--maxw); margin: 46px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ── 宽屏 ── */
@media (min-width: 640px) {
  body { padding: 0 24px 90px; }
  h1 { font-size: 33px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 20px; }
}
