/* 海放設計・工具箱：深色舞台感，琥珀色重點（跟「時間扣扣」一致） */
:root {
  --bg: #0e1114;
  --panel: #161a1f;
  --panel-2: #1c2128;
  --line: #262c35;
  --fg: #eceef1;
  --muted: #8d95a2;
  --accent: #f2b33d;
  --accent-ink: #1a1406;
  --ok: #4fc58a;
  --paid: #8fb4ff;
  --soon: #6c7480;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Noto Sans TC", system-ui, "Microsoft JhengHei", "PingFang TC", sans-serif;
  --radius: 10px;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { max-width: 1080px; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- 頂欄 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; min-width: 0; }
.brand .zh { font-weight: 700; font-size: 17px; letter-spacing: .04em; white-space: nowrap; }
.brand .en { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); white-space: nowrap; }
html[lang="en"] .brand .en { display: none; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; flex: none; }
.spacer { flex: 1; }
.lang {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; flex: none;
}
.lang button {
  font: 500 13px var(--sans); color: var(--muted); background: none; border: 0;
  padding: 4px 12px; border-radius: 999px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--panel-2); color: var(--fg); }

/* ---------- 首頁開頭 ---------- */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.2; margin: 0 0 12px; letter-spacing: .02em; }
.hero p { color: var(--muted); max-width: 40em; margin: 0; font-size: 17px; }

.catnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.catnav a {
  text-decoration: none; font-size: 14px; padding: 6px 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.catnav a:hover { color: var(--fg); border-color: var(--muted); }
.catnav .count { font-family: var(--mono); font-size: 12px; margin-left: 6px; opacity: .7; }

/* ---------- 分類區塊 ---------- */
.cat { padding: 28px 0 12px; }
.cat-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 16px; }
.cat-head h2 { font-size: 22px; margin: 0; }
.cat-head p { margin: 0; color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }

.card {
  display: grid; grid-template-rows: auto 1fr auto; gap: 10px;
  padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit; min-height: 180px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: #3a424e; }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-2px); } }
.card.is-soon { opacity: .72; }
.card-top { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 40px; height: 40px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  font: 600 14px var(--mono); letter-spacing: .02em;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--accent);
}
.card h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.card-foot .go { color: var(--fg); white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--accent); }
.badge.free { color: var(--ok); }
.badge.paid { color: var(--paid); }
.badge.soon { color: var(--soon); }

/* ---------- 工具介紹頁 ---------- */
.back { display: inline-block; margin: 28px 0 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--fg); }
.detail { padding: 20px 0 48px; max-width: 760px; }
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.detail-head .mark { width: 56px; height: 56px; font-size: 18px; border-radius: 12px; }
.detail h1 { margin: 0; font-size: clamp(26px, 5vw, 36px); line-height: 1.2; }
.detail .cat-label { color: var(--muted); font-size: 14px; }
.detail .lead { font-size: 18px; margin: 0 0 14px; }
.detail .about { color: #c3c8d0; margin: 0 0 24px; }
.detail h2 { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: .04em; margin: 28px 0 8px; }
.detail ul { margin: 0; padding-left: 1.2em; }
.detail li { margin: 4px 0; }
.detail li::marker { color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 15px var(--sans); text-decoration: none;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); color: var(--fg);
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.note { color: var(--muted); font-size: 14px; margin-top: 16px; }

/* ---------- 頁尾 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.footer .container { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

@media (max-width: 520px) {
  .brand .en { display: none; }
  .brand .zh { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .hero { padding-top: 36px; }
}
