:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --paper: #fffdf8;
  --paper-soft: #f9f5ee;
  --ink: #282520;
  --muted: #716860;
  --line: #ded2c2;
  --brown: #6a5035;
  --brown-dark: #4c3927;
  --green: #2f6b59;
  --blue: #4f6475;
  --danger: #a45143;
  --shadow: 0 18px 52px rgba(72, 55, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(47, 107, 89, 0.08), transparent 35%),
    linear-gradient(300deg, rgba(106, 80, 53, 0.08), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.brand-strip {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(222, 210, 194, 0.86);
  background: rgba(244, 241, 235, 0.94);
  padding: 12px clamp(16px, 4vw, 40px);
  backdrop-filter: blur(16px);
}

.brand-link,
.brand-strip nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  color: var(--brown-dark);
  font-weight: 760;
}

.brand-link img {
  width: 30px;
  height: 30px;
}

.brand-strip nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.brand-strip nav a {
  border-radius: 999px;
  padding: 8px 10px;
}

.brand-strip nav a:hover {
  background: rgba(106, 80, 53, 0.08);
  color: var(--brown-dark);
}

.page {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-panel,
.record-card,
.side-panel,
.summary-panel,
.boundary {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: clamp(28px, 5vw, 54px);
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  color: var(--brown-dark);
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-panel p:not(.eyebrow) {
  max-width: 800px;
  color: #4b4741;
  font-size: 19px;
  line-height: 1.85;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.record-card,
.side-panel,
.summary-panel,
.boundary {
  padding: 24px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
  gap: 16px;
}

label,
.full-field,
.field-group {
  display: grid;
  gap: 9px;
}

label span,
.full-field span {
  color: var(--brown-dark);
  font-size: 14px;
  font-weight: 720;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input:focus,
textarea:focus {
  border-color: rgba(47, 107, 89, 0.7);
  box-shadow: 0 0 0 3px rgba(47, 107, 89, 0.1);
}

input[type="range"] {
  accent-color: var(--green);
  padding: 10px 0;
  box-shadow: none;
}

.record-card {
  display: grid;
  gap: 20px;
}

.field-head,
.button-row,
.panel-head,
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-head h2,
.panel-head h2,
.summary-head h2 {
  color: var(--brown-dark);
  font-size: 18px;
  line-height: 1.25;
}

.field-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--brown-dark);
  padding: 9px 12px;
}

.chip.selected {
  border-color: var(--green);
  background: var(--green);
  color: #fffdf8;
}

.primary-button,
.secondary-button,
.text-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 720;
}

.primary-button {
  background: var(--brown-dark);
  color: #fffdf8;
}

.secondary-button {
  border-color: var(--line);
  background: var(--paper);
  color: var(--brown-dark);
}

.text-button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
}

.full {
  width: 100%;
}

.side-panel {
  position: sticky;
  top: 76px;
}

.record-list {
  display: grid;
  max-height: 560px;
  overflow: auto;
  gap: 10px;
  margin: 18px 0;
  padding-right: 4px;
}

.empty {
  color: var(--muted);
  line-height: 1.7;
}

.record-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-soft);
  padding: 14px;
}

.record-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.record-meta b {
  color: var(--green);
}

.record-item h3 {
  margin: 8px 0 10px;
  color: var(--brown-dark);
  font-size: 16px;
  line-height: 1.45;
}

.record-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.record-item .text-button {
  margin-top: 10px;
  color: var(--danger);
}

.side-actions {
  display: grid;
  gap: 10px;
}

.privacy-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.summary-panel {
  margin-top: 18px;
}

.summary-overview {
  max-width: 900px;
  margin-top: 16px;
  color: #4b4741;
  font-size: 17px;
  line-height: 1.8;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 22px;
  border: 1px solid rgba(47, 107, 89, 0.18);
  background: rgba(47, 107, 89, 0.18);
}

.summary-grid article {
  min-height: 190px;
  background: #f8fbf7;
  padding: 18px;
}

.summary-grid h3 {
  margin-bottom: 14px;
  color: var(--green);
  font-size: 16px;
}

.summary-grid ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.boundary {
  margin-top: 18px;
  background: #fff8f2;
}

.boundary h2 {
  margin-bottom: 10px;
  color: var(--danger);
  font-size: 20px;
}

.boundary p {
  color: var(--muted);
  line-height: 1.75;
}

.hidden {
  display: none;
}

.icp-footer {
  padding: 4px 24px 28px;
  text-align: center;
  font-size: 13px;
}

.icp-footer a {
  color: var(--muted);
}

@media (max-width: 980px) {
  .layout,
  .field-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .brand-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row,
  .summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row button,
  .summary-head button {
    width: 100%;
  }
}
