/* ------------------------------------------------------------------
   itdoor.net 手机空号检测 —— 视觉系统对齐 net.itdoor.net 工具站
   变量、按钮、卡片、页头页脚均取自主站 app.css，保证两个站观感一致。
   ------------------------------------------------------------------ */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f6f8fc;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef2ff;
  --success: #047857;
  --success-soft: #ecfdf5;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #92400e;
  --warn-soft: #fffbeb;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --ring: rgba(79, 70, 229, 0.35);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 30px 70px -30px rgba(15, 23, 42, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --header-h: 68px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0f172a;
  --surface: #111a2c;
  --surface-2: #16203a;
  --text: #e5edf9;
  --text-soft: #c7d2e3;
  --muted: #93a3bb;
  --border: #22304a;
  --border-strong: #2f4160;
  --primary: #818cf8;
  --primary-strong: #a5b4fc;
  --primary-soft: #1e2550;
  --success: #6ee7b7;
  --success-soft: #10291f;
  --danger: #fca5a5;
  --danger-soft: #2a1517;
  --warn: #fcd34d;
  --warn-soft: #2a2210;
  --info: #93c5fd;
  --info-soft: #12233f;
  --ring: rgba(129, 140, 248, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 34px 80px -34px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
}

h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
}

h2 {
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

h3 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
}

img {
  max-width: 100%;
}

.container {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
  vertical-align: -0.18em;
}

/* Header ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--surface);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 750;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* Hero ------------------------------------------------------------ */
.page-hero {
  padding: 2.2rem 0 1.4rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.page-hero h1 {
  margin-bottom: 0.3rem;
}

.page-hero-sub {
  color: var(--muted);
  max-width: 760px;
  margin-bottom: 0.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
}

.badge-soft {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.badge[hidden] {
  display: none;
}

.badge.is-success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
}

.badge.is-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  color: var(--danger);
}

.badge.is-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
}

/* Sections & cards ------------------------------------------------ */
.section {
  padding: 2.6rem 0;
}

.section-muted {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-title {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
}

.section-lead {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 620;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--primary);
}

.btn-primary:hover {
  background: var(--primary-strong);
  color: #fff;
}

html[data-theme="dark"] .btn-primary {
  color: #0b1220;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm {
  padding: 0.42rem 0.75rem;
  font-size: 0.83rem;
  border-radius: 8px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Query form ------------------------------------------------------ */
.query-card {
  padding: 1.5rem;
  border-top: 3px solid var(--primary);
}

.query-grid {
  display: grid;
  gap: 0.9rem;
}

.field {
  position: relative;
}

.field-input {
  width: 100%;
  padding: 0.78rem 2.8rem 0.78rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.field-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.field-clear:hover {
  background: var(--surface-2);
  color: var(--text);
}

.field-clear[hidden] {
  display: none;
}

.captcha-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.captcha-row .icon {
  color: var(--primary);
}

.query-submit {
  width: 100%;
  padding: 0.78rem 1rem;
  font-size: 0.98rem;
}

.result-wrap {
  margin-top: 1.2rem;
}

.result-wrap:empty {
  display: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table thead th,
.table tr th[colspan] {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
}

.table tbody tr:last-child th,
.table tbody tr:last-child td {
  border-bottom: 0;
}

.table td {
  color: var(--text-soft);
}

.flash-text {
  color: var(--danger);
}

.flash-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loading {
  display: grid;
  place-items: center;
  gap: 0.6rem;
  padding: 1.2rem 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Definitions ----------------------------------------------------- */
.def-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.def-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-soft);
}

.def-item b {
  color: var(--text);
}

.def-item .icon {
  color: var(--primary);
  margin-top: 0.35rem;
}

/* Alerts ---------------------------------------------------------- */
.alert {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.alert .icon {
  color: var(--warn);
  margin-top: 0.2rem;
}

.alert-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
}

.alert-info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 28%, transparent);
}

.alert-info .icon {
  color: var(--info);
}

.alert p {
  margin: 0;
}

.alert p + p {
  margin-top: 0.5rem;
}

/* Tool cards ------------------------------------------------------ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 0.85rem;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
}

.tool-card-body {
  min-width: 0;
}

.tool-card-title {
  display: block;
  font-weight: 640;
  font-size: 0.95rem;
}

.tool-card-desc {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.tone-indigo { background: #eef2ff; color: #4f46e5; }
.tone-violet { background: #f5f3ff; color: #7c3aed; }
.tone-blue { background: #eff6ff; color: #2563eb; }
.tone-cyan { background: #ecfeff; color: #0891b2; }
.tone-emerald { background: #ecfdf5; color: #059669; }
.tone-amber { background: #fffbeb; color: #d97706; }
.tone-rose { background: #fff1f2; color: #e11d48; }
.tone-orange { background: #fff7ed; color: #ea580c; }

html[data-theme="dark"] .tone-indigo { background: #1e2550; color: #a5b4fc; }
html[data-theme="dark"] .tone-violet { background: #281d4a; color: #c4b5fd; }
html[data-theme="dark"] .tone-blue { background: #13294b; color: #93c5fd; }
html[data-theme="dark"] .tone-cyan { background: #10333c; color: #67e8f9; }
html[data-theme="dark"] .tone-emerald { background: #10312a; color: #6ee7b7; }
html[data-theme="dark"] .tone-amber { background: #332a12; color: #fcd34d; }
html[data-theme="dark"] .tone-rose { background: #351923; color: #fda4af; }
html[data-theme="dark"] .tone-orange { background: #35210f; color: #fdba74; }

/* Footer ---------------------------------------------------------- */
.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr minmax(0, 1fr);
  gap: 2rem;
  padding: 2.2rem 0 1.4rem;
}

.footer-brand p {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 380px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: var(--text-soft);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-note {
  margin: 0;
  padding: 0.9rem 0 1.6rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

.prose {
  max-width: 780px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.prose h2 {
  margin-top: 1.6rem;
}

.prose ul {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.sr-only {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .brand-tagline {
    display: none;
  }
}
