﻿:root {
  --bg: #f5efe5;
  --paper: rgba(255, 250, 242, 0.92);
  --paper-strong: #fffaf2;
  --ink: #1e2023;
  --muted: #63696f;
  --line: rgba(30, 32, 35, 0.1);
  --accent: #bc5f2d;
  --accent-deep: #8b3f15;
  --accent-soft: rgba(188, 95, 45, 0.12);
  --good: #1b7f5d;
  --good-bg: rgba(27, 127, 93, 0.12);
  --bad: #b24833;
  --bad-bg: rgba(178, 72, 51, 0.12);
  --neutral-bg: rgba(49, 64, 86, 0.12);
  --shadow: 0 24px 60px rgba(51, 36, 25, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at top left, rgba(188, 95, 45, 0.14), transparent 28%),
    radial-gradient(circle at bottom right, rgba(33, 76, 119, 0.12), transparent 30%),
    linear-gradient(180deg, #f7f2eb 0%, #efe7db 100%);
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero,
.card {
  background: var(--paper);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  padding: 28px;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(188, 95, 45, 0.2), transparent 70%);
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-deep);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero h1,
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  max-width: 12ch;
}

.hero-text,
.section-tip,
.form-hint,
.summary-panel,
.metric-card span,
.hero-stat span {
  color: var(--muted);
}

.hero-text {
  max-width: 54ch;
  margin: 14px 0 0;
  line-height: 1.75;
}

.hero-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.hero-stat,
.metric-card,
.formula-box,
.summary-panel,
.stats-panel,
.stats-item {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hero-stat {
  padding: 18px 18px 16px;
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  font-family: var(--serif);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 20px;
  margin-top: 20px;
}

.card {
  border-radius: var(--radius-xl);
  padding: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.section-tip {
  margin: 0;
  font-size: 14px;
  max-width: 34ch;
  line-height: 1.6;
  text-align: right;
}

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

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

.score-form span {
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 14px 14px 13px;
  font-size: 18px;
  color: var(--ink);
  border: 1px solid rgba(30, 32, 35, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(188, 95, 45, 0.12);
  transform: translateY(-1px);
}

.form-hint {
  margin: 16px 0;
  line-height: 1.6;
}

.form-hint.error {
  color: var(--bad);
}

.formula-box {
  padding: 16px 18px;
  line-height: 1.8;
}

.formula-box p {
  margin: 0;
}

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

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  font-family: var(--serif);
}

.summary-panel {
  margin-top: 16px;
  padding: 16px 18px;
  line-height: 1.7;
}

.status-badge {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.good {
  background: var(--good-bg);
  color: var(--good);
}

.status-badge.bad {
  background: var(--bad-bg);
  color: var(--bad);
}

.status-badge.neutral {
  background: var(--neutral-bg);
  color: #314056;
}

.stats-card,
.ranking-card {
  margin-top: 20px;
}

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

.stats-item {
  padding: 18px;
}

.stats-item h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-family: var(--serif);
}

.stats-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.stat-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  border: 1px solid rgba(188, 95, 45, 0.18);
  background: rgba(188, 95, 45, 0.08);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 12px;
  min-width: 112px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.stat-chip:hover,
.stat-chip:focus-visible {
  transform: translateY(-2px);
  background: rgba(188, 95, 45, 0.14);
  border-color: rgba(188, 95, 45, 0.3);
  outline: none;
}

.stat-chip small,
.stat-chip strong {
  display: block;
}

.stat-chip small {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-chip strong {
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper-strong);
}

th,
 td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(30, 32, 35, 0.08);
  font-size: 14px;
}

th {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(250, 243, 235, 0.95);
}

tbody tr:hover {
  background: rgba(188, 95, 45, 0.05);
}

tbody tr.user-row {
  background: rgba(188, 95, 45, 0.12);
}

tbody tr.user-row td {
  font-weight: 700;
}

.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 28px 18px;
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(33, 76, 119, 0.1);
  color: #214c77;
  font-weight: 700;
}

@media (max-width: 960px) {
  .hero,
  .layout,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .section-head {
    flex-direction: column;
  }

  .section-tip {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding: 18px 0 28px;
  }

  .hero,
  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .score-form,
  .result-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-stat strong,
  .metric-card strong {
    font-size: 26px;
  }
}
