:root {
  color-scheme: light;
  --boot-bg: #f3f4f6;
  --boot-fg: #1f2937;
  --boot-fg-subtle: #6b7280;
  --boot-accent: #3b82f6;
  --boot-card: #ffffff;
  --boot-border: #e5e7eb;
  --art-filter: none;
  --art-opacity: 1;
}
html.dark {
  color-scheme: dark;
  --boot-bg: #0f1218;
  --boot-fg: #e3e8f0;
  --boot-fg-subtle: #8e98a8;
  --boot-accent: #60a5fa;
  --boot-card: #171b23;
  --boot-border: #2a3040;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--surface-page, var(--boot-bg));
  color: var(--fg-strong, var(--boot-fg));
  font-family: 'PingFang SC', 'Microsoft YaHei', 'SimHei', sans-serif;
}
body {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('images/bg2.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: var(--art-filter);
  opacity: var(--art-opacity);
  pointer-events: none;
}
a { color: var(--accent-fg, var(--boot-accent)); }
a:hover { text-decoration: underline; }

.tool-main {
  width: min(64rem, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 48px;
  flex: 1 0 auto;
}

.tool-card {
  background: var(--surface-1, var(--boot-card));
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgb(0 0 0 / 0.05));
  padding: 1.5rem;
}
.tool-card + .tool-card { margin-top: 1.5rem; }

.tool-tester {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 0.75rem;
}
.tool-tester .tool-lead {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
}
.tool-tester #app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tool-lead { margin: 0 0 1.5rem; }
.tool-lead h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--fg-strong, #1f2937);
}
.tool-lead p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-subtle, var(--boot-fg-subtle));
}

#app { min-height: 12rem; }
.app-boot {
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}
.app-boot-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg-strong, var(--boot-fg));
}
.app-boot-sub {
  margin: 8px 0 0;
  color: var(--boot-fg-subtle);
  font-size: 0.875rem;
}

.tool-article {
  line-height: 1.8;
  font-size: 0.95rem;
}
.tool-article h2 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg-strong, #1f2937);
}
.tool-article h2 + * { margin-top: 0; }
.tool-article h2:not(:first-child) { margin-top: 32px; }
.tool-article h3 {
  margin: 20px 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg-strong, #1f2937);
}
.tool-article p { margin: 0 0 12px; }
.tool-article .muted {
  color: var(--fg-subtle, var(--boot-fg-subtle));
  font-size: 0.875rem;
}

.formula {
  margin: 0 0 12px;
  padding: 1rem;
  background: var(--surface-2, #f9fafb);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.tool-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 8px;
  font-size: 0.9rem;
}
.tool-article th,
.tool-article td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle, var(--boot-border));
}
.tool-article th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-subtle, var(--boot-fg-subtle));
  background: var(--surface-2, #f9fafb);
}
.tool-article td:last-child,
.tool-article th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tool-article tbody tr:last-child td { border-bottom: 0; }

.tool-links {
  margin: 0;
  color: var(--fg-subtle, var(--boot-fg-subtle));
}
.tool-links a { color: var(--accent-fg, var(--boot-accent)); }

.tool-faq { margin-top: 8px; }
.tool-faq .faq-item {
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle, var(--boot-border));
}
.tool-faq .faq-item:last-child {
  border-bottom: 1px solid var(--border-subtle, var(--boot-border));
}
.tool-faq h3 { margin: 0 0 4px; }
.tool-faq p { margin: 0; color: var(--fg-subtle, var(--boot-fg-subtle)); }
.tool-faq table { margin: 8px 0 0; }
.tier-name { font-weight: 650; }
.tier-name.tier-1 { color: var(--tier-1-fg, #07773e); }
.tier-name.tier-2 { color: var(--tier-2-fg, #0b5fe9); }
.tier-name.tier-3 { color: var(--tier-3-fg, #ac4a10); }
.tier-name.tier-4 { color: var(--tier-4-fg, #d6040f); }
.tier-name.tier-5 { color: var(--tier-5-fg, #ce1338); }
.tier-name.tier-6 { color: var(--tier-6-fg, #a4243b); }

.site-footer {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 12px 16px 16px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fg-subtle, var(--boot-fg-subtle));
}
.site-footer a {
  color: inherit;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

@media (max-width: 640px) {
  .tool-main { padding: 8px 0 48px; }
  .tool-card { padding: 1rem; }
  .tool-tester { padding-top: 0.75rem; }
}
