
:root {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --primary: #2563ff;
  --primary-dark: #1d4ed8;
  --accent: #00c2a8;
  --accent-dark: #059b8c;
  --danger: #dc2626;
  --success: #0f9f6e;
  --warning: #b7791f;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.09);
  --shadow-soft: 0 14px 36px rgba(15, 23, 42, 0.07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(37, 99, 255, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(0, 194, 168, 0.08), transparent 28%),
    linear-gradient(180deg, #f5f7fb 0%, #f8fafc 52%, #eef3fb 100%);
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.11) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(15, 23, 42, 0.14), transparent 72%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.62; }
.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 58px;
}
.topbar, .page-intro, .tool-card, .panel, .result-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px 18px;
  border-radius: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 850;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 16px 30px rgba(37, 99, 255, 0.2);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.nav a:hover { color: var(--primary); }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 22px 0 -10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span::before {
  content: ">";
  margin-right: 8px;
  color: rgba(100, 116, 139, 0.7);
}
.page-intro {
  margin-top: 30px;
  padding: clamp(28px, 4.6vw, 50px);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(0, 194, 168, 0.12);
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
}
.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.78;
}
.section-head { margin: 38px 0 18px; }
.section-head h2 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 36px); }
.section-head p { max-width: 760px; margin-bottom: 0; color: var(--muted); line-height: 1.7; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 22px;
  border-radius: 26px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 255, 0.18);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.1);
}
.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--primary);
  background: rgba(37, 99, 255, 0.1);
  font-size: 24px;
  font-weight: 950;
}
.card-icon.accent { color: var(--accent-dark); background: rgba(0, 194, 168, 0.12); }
.card-icon.warning { color: var(--warning); background: rgba(245, 158, 11, 0.13); }
.tool-card h3 { margin: 18px 0 8px; font-size: 18px; }
.tool-card p { flex: 1; margin-bottom: 18px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-link, .badge { color: var(--primary); font-size: 14px; font-weight: 900; }
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 18px;
  margin-top: 28px;
}
.panel {
  border-radius: 28px;
  padding: 22px;
}
.panel h2 { margin-bottom: 12px; font-size: 22px; }
.field {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 850;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
textarea, input, select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
textarea {
  min-height: 160px;
  padding: 14px;
  resize: vertical;
  line-height: 1.7;
}
input, select { min-height: 48px; padding: 0 13px; }
textarea:focus, input:focus, select:focus {
  border-color: rgba(37, 99, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(37, 99, 255, 0.1);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 15px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  color: #fff;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 32px rgba(37,99,255,.22);
}
.button.secondary {
  color: var(--primary);
  border-color: rgba(37,99,255,.14);
  background: rgba(255,255,255,.82);
}
.button.danger {
  color: var(--danger);
  border-color: rgba(220, 38, 38, .14);
  background: rgba(255,255,255,.82);
}
.button.wide { width: 100%; }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.choice-field {
  margin-top: 18px;
}
.choice-field legend {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 900;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 108px;
  padding: 13px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 255, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}
.choice-card input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
  flex: 0 0 auto;
}
.choice-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}
.choice-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}
.choice-card:has(input:checked) {
  border-color: rgba(37, 99, 255, 0.5);
  background: rgba(37, 99, 255, 0.07);
}
.loan-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#loanSummary {
  margin-top: 12px;
}

.hint { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 8px 0 0; }
.output-box {
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: #fff;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.big-result {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(37,99,255,.06);
  color: var(--text);
  text-align: center;
}
.big-number {
  display: block;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 950;
  color: var(--primary);
  line-height: 1;
}
.stats-grid, .result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.stat-card, .result-item {
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .07);
}
.stat-card span, .result-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.stat-card strong, .result-item strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.2;
}
.result-item strong.small { font-size: 16px; word-break: break-word; }
.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.choice-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .07);
}
.notice {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(37,99,255,.07);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}
.error {
  color: var(--danger);
  background: rgba(220, 38, 38, .08);
}
.success {
  color: var(--success);
  background: rgba(15, 159, 110, .08);
}
.more-tools {
  margin-top: 28px;
  padding: 22px;
  border-radius: 26px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.07);
  box-shadow: var(--shadow-soft);
}
.more-tools h2 { font-size: 22px; }
.more-links { display: flex; flex-wrap: wrap; gap: 10px; }
.more-links a, .more-links span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(37,99,255,.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}
.more-links span { color: var(--text-soft); background: rgba(15,23,42,.08); }
.footer {
  padding: 34px 0 0;
  color: var(--muted);
  text-align: center;
}
.footer strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
@media (max-width: 1080px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { width: min(100%, calc(100% - 18px)); }
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { justify-content: flex-start; gap: 14px; }
  .page-intro, .panel, .more-tools { padding: 18px; }
  h1 { font-size: 38px; }
  .lead { font-size: 16px; }
  .tool-grid, .field-row, .stats-grid, .result-grid, .choice-grid, .loan-result-grid { grid-template-columns: 1fr; }
  .button { width: 100%; }
}
