:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #111827;
  background: #f7f8fa;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.65;
}

a { color: #1d4ed8; text-underline-offset: 3px; }
a:hover { color: #1e40af; }

.page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 16px 32px;
}

.site-header { margin-bottom: 28px; }
h1, h2, h3 { line-height: 1.3; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 6vw, 2.35rem); letter-spacing: -0.03em; }
h2 { margin: 0 0 16px; font-size: 1.35rem; }
h3 { margin: 24px 0 6px; font-size: 1rem; }
p { margin: 0 0 14px; }
.tagline { margin: 0 0 8px; color: #374151; font-weight: 650; }
.intro, .muted, .hint { color: #6b7280; }
.intro { max-width: 590px; }
.hint { display: block; margin-top: 6px; font-size: 0.875rem; }

.card {
  margin: 0 0 22px;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.field { margin-bottom: 20px; }
label, legend { display: block; margin-bottom: 7px; font-weight: 650; }
input, select, button { font: inherit; }
input[type="password"], input[type="text"], input[type="number"], select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #111827;
  background: #fff;
  font-size: 16px;
}

input:focus, select:focus, button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
  border-color: #2563eb;
}

.input-with-action { display: flex; gap: 8px; }
.input-with-action input { min-width: 0; }
button {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-weight: 650;
}
button:hover { background: #f8fafc; }
button:disabled { cursor: wait; opacity: .68; }
.input-action { flex: 0 0 auto; min-width: 68px; }
.primary { width: 100%; border-color: #1d4ed8; background: #1d4ed8; color: #fff; }
.primary:hover { background: #1e40af; }
.secondary { width: 100%; }

details { border-top: 1px solid #e5e7eb; margin-top: 22px; padding-top: 18px; }
summary { cursor: pointer; font-weight: 700; }
.advanced { padding-top: 20px; }
.advanced-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
.check-label input { width: 18px; height: 18px; }
.algorithm { padding: 10px 12px; border-radius: 7px; background: #f3f4f6; color: #374151; }
.message { min-height: 26px; margin: 10px 0 0; color: #b42318; font-size: .92rem; }

.result-card { border-color: #bfdbfe; }
.result-card[hidden] { display: none; }
.result-value { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; }
.status { min-height: 25px; margin: 8px 0 0; color: #166534; text-align: center; font-size: .9rem; }
.security-note { padding-left: 14px; border-left: 3px solid #2563eb; }

.content-section { padding: 28px 4px; border-bottom: 1px solid #e5e7eb; }
.example-list { padding-left: 22px; }
.formula { padding: 14px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; }
.warning { padding: 14px; border: 1px solid #fed7aa; border-radius: 7px; background: #fff7ed; }
.faq-item { border-top: 0; margin: 0; padding: 13px 0; border-bottom: 1px solid #e5e7eb; }
.faq-item summary { font-weight: 650; }
.faq-item p { padding-top: 8px; color: #4b5563; }

.site-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 28px; color: #6b7280; font-size: .9rem; }
.footer-links { display: flex; gap: 16px; }
.plain-header a { color: inherit; text-decoration: none; }
.prose ul { padding-left: 22px; }

@media (max-width: 520px) {
  .page { padding-top: 28px; }
  .card { padding: 19px 16px; }
  .advanced-grid, .rules { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

