:root {
  --bg: #f6f8ef;
  --ink: #142127;
  --ink-soft: #46585f;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(20, 33, 39, 0.12);
  --brand: #0f766e;
  --brand-strong: #0f5c56;
  --accent: #ef6c2f;
  --danger: #c43d2f;
  --safe: #1e8a5f;
  --shadow: 0 20px 40px rgba(15, 38, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 10% 20%, #fffce9 0%, #f4f8f4 32%, #eef4f2 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -2;
  filter: blur(8px);
  border-radius: 50%;
}

.orb-a {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle at 30% 30%, rgba(15, 118, 110, 0.35), rgba(15, 118, 110, 0));
  top: -80px;
  right: -100px;
}

.orb-b {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at 50% 50%, rgba(239, 108, 47, 0.22), rgba(239, 108, 47, 0));
  bottom: -140px;
  left: -120px;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(20, 33, 39, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 39, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
}

.layout {
  width: min(1080px, 92vw);
  margin: 32px auto 72px;
  display: grid;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 26px;
  animation: rise 520ms ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  padding: 30px;
  background: linear-gradient(120deg, rgba(15, 118, 110, 0.14), rgba(239, 108, 47, 0.12) 70%, rgba(255, 255, 255, 0.7));
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.tag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.15);
  color: var(--brand-strong);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: "ZCOOL XiaoWei", serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: 0.02em;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 33, 39, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
}

.lang-caption {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: rgba(20, 33, 39, 0.16);
  border-radius: 999px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(20, 33, 39, 0.24);
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: var(--brand);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
}

.hero-desc {
  margin: 14px 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.hero-meta {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-meta span {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(20, 33, 39, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.form-card h2,
.result-card h2 {
  margin-bottom: 16px;
  font-size: 1.22rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
}

.form-grid span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(20, 33, 39, 0.18);
  border-radius: 12px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
}

#predict-btn {
  background: linear-gradient(120deg, var(--brand), #16978f);
  color: #fff;
  min-width: 128px;
}

#predict-btn:hover {
  filter: brightness(1.06);
}

button.ghost {
  background: transparent;
  border: 1px solid rgba(20, 33, 39, 0.25);
  color: var(--ink);
}

.result-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
  align-items: start;
}

.risk-meter {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 4px auto 12px;
  background: conic-gradient(var(--brand) 0turn, rgba(20, 33, 39, 0.12) 0turn);
  display: grid;
  place-items: center;
  transition: background 300ms ease;
}

.risk-meter-inner {
  width: 76%;
  height: 76%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 8px;
}

.meter-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

#risk-percent {
  font-size: 1.6rem;
  line-height: 1;
}

.risk-text {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
}

.detail-wrap {
  display: grid;
  gap: 10px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(20, 33, 39, 0.09);
}

.metric-row strong {
  font-size: 1rem;
}

.note-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.force-wrap {
  margin-top: 6px;
  border: 1px solid rgba(20, 33, 39, 0.1);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.force-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--ink-soft);
}

.force-meta strong {
  color: var(--ink);
}

.force-svg {
  width: 100%;
  height: auto;
  margin-top: 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 248, 244, 0.88));
  min-height: 420px;
}

.footer {
  width: min(1080px, 92vw);
  margin: -52px auto 26px;
  color: #5f6b70;
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .hero-top {
    display: grid;
    gap: 8px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .result-layout {
    grid-template-columns: 1fr;
  }

  .risk-meter {
    width: 160px;
    height: 160px;
  }

  .force-meta {
    display: grid;
    gap: 4px;
  }
}
