:root {
  color-scheme: light;
  --bg: #f3eee6;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: #fff8f0;
  --ink: #1d262f;
  --muted: #54606b;
  --line: rgba(29, 38, 47, 0.1);
  --steel: #41627a;
  --steel-deep: #22394d;
  --rust: #c46b3d;
  --sand: #e7d2be;
  --mint: #dce8df;
  --shadow: 0 22px 50px rgba(36, 43, 51, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-display: "STKaiti", "KaiTi", "Songti SC", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(231, 210, 190, 0.8), transparent 30%),
    radial-gradient(circle at right 10% top 20%, rgba(65, 98, 122, 0.2), transparent 20%),
    linear-gradient(160deg, #f7f1e8 0%, #f0e5d6 48%, #e7ece9 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(29, 38, 47, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 38, 47, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent 85%);
}

.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 22px;
}

.hero-copy,
.hero-highlight,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-copy {
  padding: 42px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 107, 61, 0.22), transparent 70%);
}

.eyebrow,
.kicker {
  margin: 0 0 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-highlight {
  display: grid;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(145deg, rgba(65, 98, 122, 0.9), rgba(34, 57, 77, 0.92)),
    var(--panel);
}

.highlight-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f9f4ef;
}

.highlight-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.highlight-card strong {
  display: block;
  font-size: 1.18rem;
  line-height: 1.45;
}

.highlight-accent {
  background: rgba(231, 210, 190, 0.14);
}

.workspace {
  display: grid;
  gap: 22px;
}

.panel {
  padding: 28px;
}

.section-heading,
.block-title,
.repeat-head,
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-heading h2,
.block-title h3,
.card-header h3,
.note-card h3,
.repeat-head h4 {
  margin: 0;
}

.section-heading h2 {
  font-size: 1.7rem;
}

.section-heading p,
.block-title p,
.card-header p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.note-grid,
.summary-grid,
.result-grid {
  display: grid;
  gap: 18px;
}

.note-grid {
  margin-top: 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.note-card {
  padding: 18px 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42));
  border: 1px solid rgba(65, 98, 122, 0.08);
}

.note-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.panel-form {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(255, 248, 240, 0.92)),
    var(--panel);
}

form {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.form-block {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(29, 38, 47, 0.06);
}

.with-action {
  align-items: center;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.five-up {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.repeat-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.repeat-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.92);
  border: 1px solid rgba(29, 38, 47, 0.08);
}

.repeat-head {
  margin-bottom: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--steel-deep);
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(65, 98, 122, 0.2);
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--rust);
  box-shadow: 0 0 0 4px rgba(196, 107, 61, 0.14);
  transform: translateY(-1px);
}

button {
  font: inherit;
  cursor: pointer;
}

.ghost-button,
.solid-button,
.remove-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ghost-button {
  background: rgba(65, 98, 122, 0.08);
  color: var(--steel-deep);
}

.solid-button {
  background: var(--steel);
  color: #fff;
  box-shadow: 0 12px 24px rgba(65, 98, 122, 0.2);
}

.remove-button {
  background: rgba(196, 107, 61, 0.1);
  color: #8f4927;
}

.ghost-button:hover,
.solid-button:hover,
.remove-button:hover {
  transform: translateY(-1px);
}

.summary-grid {
  margin-top: 22px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(220, 232, 223, 0.78)),
    var(--panel-strong);
  border: 1px solid rgba(29, 38, 47, 0.06);
}

.summary-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  font-family: var(--font-display);
}

.summary-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.result-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  margin-top: 22px;
}

.result-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(29, 38, 47, 0.06);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(29, 38, 47, 0.08);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.9rem;
  color: var(--steel-deep);
}

td {
  color: var(--muted);
  line-height: 1.55;
}

tbody tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: rgba(65, 98, 122, 0.12);
}

.formula-card {
  margin-top: 18px;
}

.formula-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.75;
}

.formula-list p {
  margin: 0;
}

@media (max-width: 1120px) {
  .hero,
  .result-grid,
  .note-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .five-up,
  .three-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 18px;
  }

  .hero-copy,
  .panel {
    padding: 22px;
  }

  .two-up,
  .five-up,
  .three-up {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .section-heading,
  .block-title,
  .repeat-head,
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  table {
    min-width: 560px;
  }
}
