@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Manrope:wght@400;500;600&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f1e8;
  --bg-accent: #efe5d6;
  --ink: #1d2625;
  --muted: #5a6c6a;
  --brand: #1f6b64;
  --brand-soft: #d8ece7;
  --accent: #d87c3a;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(31, 38, 37, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at 10% 0%, #fffaf2, transparent 55%),
    linear-gradient(120deg, var(--bg), var(--bg-accent));
  color: var(--ink);
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  opacity: 0.15;
  filter: blur(0px);
}

.bg-shape.one {
  width: 420px;
  height: 420px;
  background: #f1b48a;
  top: -140px;
  right: -120px;
}

.bg-shape.two {
  width: 340px;
  height: 340px;
  background: #9ad0c7;
  bottom: -120px;
  left: -120px;
}

.hero {
  padding: 52px 20px 20px;
  text-align: center;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 14px;
  letter-spacing: 0.2px;
}

h1 {
  font-family: "Fraunces", "Songti SC", serif;
  font-size: clamp(28px, 4vw, 44px);
  margin: 18px 0 10px;
}

.subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
}

.app {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0 20px 20px;
}

.tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 10px auto 4px;
}

.tab-btn {
  border: 1px solid #e0d2bf;
  background: #fff7ec;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}

.tab-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  animation: fadeUp 0.6s ease both;
}

.card h2 {
  font-family: "Fraunces", "Songti SC", serif;
  margin-top: 0;
}

.hint {
  color: var(--muted);
  margin-top: -6px;
}

.field-group {
  margin-top: 24px;
}

.preset-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.preset-btn {
  border: 1px solid #e0d2bf;
  background: #fff7ec;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
}

.preset-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.preset-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.role-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.role-hidden {
  display: none;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-title {
  font-weight: 600;
}

.field-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

input,
select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d8d8d8;
  font-size: 15px;
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 107, 100, 0.25);
  border-color: var(--brand);
}

.radio-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8f3ea;
  border: 1px solid #eadfce;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f8f3ea;
  border: 1px solid #eadfce;
  font-size: 14px;
}

.chip input {
  margin-right: 6px;
}

.round-card {
  border: 1px solid #f0e4d3;
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
  background: #fff9f1;
}

.round-card h4 {
  margin: 0 0 12px;
  font-family: "Fraunces", "Songti SC", serif;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.results h3 {
  margin-top: 24px;
}

.summary {
  background: var(--brand-soft);
  border-radius: 14px;
  padding: 16px;
  line-height: 1.7;
}

.summary strong {
  color: var(--brand);
}

.alerts {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.alert {
  padding: 12px;
  border-radius: 12px;
  background: #fff1e6;
  border: 1px solid #f4cda5;
  color: #7a3c10;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e0d7c9;
}

tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #f1e7d7;
}

.details {
  margin-top: 20px;
  border-radius: 14px;
  background: #f9f4eb;
  padding: 12px 16px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.chart-card {
  border: 1px solid #f0e4d3;
  border-radius: 14px;
  padding: 16px;
  background: #fff9f1;
}

.chart-card h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.chart {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart svg {
  width: 100%;
  height: 180px;
}

.details summary {
  cursor: pointer;
  font-weight: 600;
}

.details-body {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.explain-card {
  background: #fff9f1;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #f0e4d3;
}

.explain-card h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 16px;
}

.footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 20px 50px;
  font-size: 13px;
}

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

@media (max-width: 720px) {
  .hero {
    padding-top: 40px;
  }

  .summary {
    font-size: 14px;
  }
}
