/* ===========================================================
   ASTRA ツールボックス 共通スタイル
   色はここの変数を変えるだけでサイト全体に反映されます
   =========================================================== */
:root {
  --bg: #f6f7fb;
  --bg-grad-1: #eef1ff;
  --bg-grad-2: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f2f4f9;
  --text: #141824;
  --muted: #5d6578;
  --border: #e3e6ef;
  --accent: #5b5bf7;
  --accent-2: #8b5cf6;
  --accent-soft: #eceafe;
  --accent-text: #ffffff;
  --ok: #12936b;
  --ok-soft: #e3f6ef;
  --err: #d93c4b;
  --err-soft: #fdecee;
  --code-bg: #f4f5fa;
  --shadow-sm: 0 1px 2px rgba(20, 24, 36, .06);
  --shadow: 0 1px 2px rgba(20, 24, 36, .04), 0 8px 24px rgba(20, 24, 36, .06);
  --shadow-lg: 0 2px 4px rgba(20, 24, 36, .04), 0 16px 40px rgba(60, 60, 140, .12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1017;
    --bg-grad-1: #171a2e;
    --bg-grad-2: #0e1017;
    --surface: #161924;
    --surface-2: #1d2130;
    --text: #e8eaf2;
    --muted: #9aa1b5;
    --border: #272c3d;
    --accent: #8b8bff;
    --accent-2: #b18cff;
    --accent-soft: #23234a;
    --accent-text: #0e1017;
    --ok: #3fd19e;
    --ok-soft: #12302a;
    --err: #ff7a86;
    --err-soft: #3a1a20;
    --code-bg: #1d2130;
    --shadow-sm: none;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- ヘッダー ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
header.site .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: .02em; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 4px 12px rgba(91, 91, 247, .35);
}
header.site nav { display: flex; gap: 4px; }
header.site nav a {
  color: var(--muted); font-size: .9rem; font-weight: 500; padding: 6px 12px; border-radius: 8px;
}
header.site nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
@media (max-width: 560px) {
  header.site nav a { padding: 6px 8px; font-size: .82rem; }
  .logo-text { display: none; }
}

/* ---------- ページ見出し(ヒーロー) ---------- */
.hero {
  background:
    radial-gradient(900px 300px at 10% -20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(700px 300px at 95% 0%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  border-bottom: 1px solid var(--border);
}
.hero .container { padding-top: 56px; padding-bottom: 48px; }
.hero.small .container { padding-top: 36px; padding-bottom: 32px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 800;
}
.hero.small h1 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { color: var(--muted); font-size: 1.05rem; max-width: 720px; margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.badge svg { color: var(--ok); }
.page-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px rgba(91, 91, 247, .3);
}

/* ---------- 本文 ---------- */
main { padding: 32px 0 64px; }
h2 { font-size: 1.35rem; margin: 48px 0 12px; letter-spacing: -.005em; }
h3 { font-size: 1.05rem; margin: 28px 0 6px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 20px; }
.section-title h2 { margin: 0; }
.prose { max-width: 760px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose h2 { padding-top: 8px; border-top: 1px solid var(--border); padding-top: 32px; }
.note { font-size: .85rem; color: var(--muted); }

/* ---------- カード ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); text-decoration: none; }
.tool-card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.tool-card h3 { margin: 4px 0 0; font-size: 1.05rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.tool-card .go { margin-top: auto; font-size: .85rem; font-weight: 600; color: var(--accent); }
.tool-card.soon { opacity: .6; pointer-events: none; box-shadow: none; border-style: dashed; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 8px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .icon { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.feature h3 { margin: 0 0 2px; font-size: .98rem; }
.feature p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }

/* ---------- ツールの操作パネル ---------- */
.tool-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 20px; margin-top: -56px; position: relative;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.toolbar .spacer { flex: 1; }
.row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 12px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.field-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

textarea, input[type=text], input[type=number], select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea {
  width: 100%; font-family: var(--mono); font-size: .86rem; line-height: 1.6; min-height: 320px; resize: vertical; tab-size: 2;
}
textarea[readonly] { background: var(--code-bg); }
select { padding-right: 28px; cursor: pointer; }

button {
  font: inherit; font-weight: 600; font-size: .92rem; padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 4px 14px rgba(91, 91, 247, .3); transition: transform .12s, box-shadow .12s, filter .12s;
}
button:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(91, 91, 247, .38); }
button:active { transform: translateY(1px); }
button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
button.secondary:hover { background: var(--surface-2); filter: none; }
button.ghost { background: transparent; color: var(--muted); box-shadow: none; padding: 6px 10px; }
button.ghost:hover { background: var(--surface-2); color: var(--text); }

label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.msg { min-height: 1.6em; font-size: .88rem; margin-top: 10px; }
.msg:empty { display: none; }
.msg.ok, .msg.err { display: inline-block; padding: 6px 12px; border-radius: 8px; font-weight: 500; }
.msg.ok { color: var(--ok); background: var(--ok-soft); }
.msg.err { color: var(--err); background: var(--err-soft); }

code, .mono { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.big {
  font-family: var(--mono); font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 700; word-break: break-all; line-height: 1.3;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ip-display { text-align: center; padding: 24px 8px 8px; }
.ip-display .caption { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
table.info { border-collapse: collapse; width: 100%; margin-top: 16px; }
table.info th, table.info td { border-top: 1px solid var(--border); padding: 12px 8px; text-align: left; vertical-align: top; font-size: .92rem; }
table.info th { width: 32%; color: var(--muted); font-weight: 500; }

.strength { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.strength > span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s, background .3s; }

/* ---------- 広告枠(AdSense合格後にコードを入れる) ---------- */
.ad-slot { margin: 32px 0; }
.ad-slot:empty { display: none; }

/* ---------- フッター ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; }
footer.site .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; padding-bottom: 32px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--text); }
