:root {
  --ink: #23201d;
  --ink-2: #57514a;
  --ink-3: #8b8377;
  --paper: #f6f2ea;
  --card: #fffdf8;
  --line: #e7dfd2;
  --jade: #2f5d50;
  --jade-deep: #234239;
  --jade-soft: #e9f1ec;
  --cinnabar: #ab5236;
  --cinnabar-soft: #f8ebe4;
  --amber: #bd8a34;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(35, 32, 29, 0.04), 0 8px 24px rgba(35, 32, 29, 0.06);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  background-image: radial-gradient(circle at 12% 0%, #fdfaf3 0%, transparent 45%),
    radial-gradient(circle at 88% 6%, #f2f6f1 0%, transparent 40%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

@media (min-width: 720px) {
  .app { padding-top: 48px; }
}

/* ---------- Hero ---------- */

.hero { text-align: center; margin-bottom: 26px; }

.hero-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  color: #fdfaf3;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0;
  box-shadow: 0 6px 18px rgba(47, 93, 80, 0.28);
}

.hero h1 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 0 0 10px;
}

.hero-sub {
  margin: 0 auto;
  max-width: 420px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0;
  margin: 16px 0 0;
}

.hero-tags li {
  font-size: 11.5px;
  color: var(--jade-deep);
  background: var(--jade-soft);
  border-radius: 999px;
  padding: 4px 11px;
  letter-spacing: 0.2px;
}

/* ---------- 通用卡片 ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

details.card { padding: 0; overflow: hidden; }

details.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.card > summary::-webkit-details-marker { display: none; }

details.card > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-left: 10px;
  flex: none;
}

details.card[open] > summary::after {
  transform: rotate(-135deg);
}

details.card > .card-body {
  padding: 0 18px 18px;
}

.tip-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
  font-size: 13px;
}

.tip-list li { margin-bottom: 6px; }
.tip-list li:last-child { margin-bottom: 0; }

/* ---------- 上传区 ---------- */

.section-label {
  font-size: 12.5px;
  color: var(--ink-3);
  letter-spacing: 1px;
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shot {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 1.5px dashed #cfc5b4;
  background: rgba(255, 253, 248, 0.7);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.shot:hover { border-color: var(--jade); background: #fff; }

.shot.filled { border-style: solid; border-color: var(--jade); }

.shot-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 12px;
}

.shot-plus {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--jade-soft);
  color: var(--jade);
  font-size: 20px;
  line-height: 34px;
  font-weight: 300;
}

.shot-title { font-size: 13.5px; font-weight: 600; }
.shot-hint { font-size: 11px; color: var(--ink-3); line-height: 1.5; }

.shot-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.shot.filled .shot-preview { display: block; }
.shot.filled .shot-empty { display: none; }

.shot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(35, 32, 29, 0.55);
  color: #fff;
  backdrop-filter: blur(4px);
}

.shot-badge.req { background: rgba(171, 82, 54, 0.9); }

.shot-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(35, 32, 29, 0.6);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  display: none;
}

.shot.filled .shot-clear { display: block; }

/* ---------- 表单 ---------- */

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field label.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #fdfbf6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus, textarea:focus, select:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.08);
  background: #fff;
}

textarea { resize: vertical; min-height: 62px; }

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

.segmented button {
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fdfbf6;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s;
}

.segmented button.on {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
}

/* ---------- 同意 + 主按钮 ---------- */

.consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 18px 2px 16px;
  cursor: pointer;
}

.consent input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--jade);
  flex: none;
}

.btn-primary {
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 15px;
  border: none;
  border-radius: 13px;
  background: var(--jade);
  color: #fdfaf3;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 93, 80, 0.24);
  transition: transform 0.12s, background 0.2s, opacity 0.2s;
}

.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled {
  background: #cfc9bd;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  font: inherit;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  flex: 1;
}

.btn-ghost:active { background: #f3eee4; }

.foot-link {
  text-align: center;
  font-size: 13px;
  margin-top: 18px;
}

.foot-link a { color: var(--jade); text-decoration: none; }
.foot-link a:hover { text-decoration: underline; }

/* ---------- 提示条 ---------- */

.banner {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.banner.warn {
  background: #fdf4e6;
  border-color: #eedcbb;
  color: #82591a;
}

.banner.error {
  background: var(--cinnabar-soft);
  border-color: #eccdbe;
  color: #8f3f26;
}

.banner.info {
  background: var(--jade-soft);
  border-color: #cfe1d6;
  color: var(--jade-deep);
}

.banner strong { font-weight: 600; }

/* ---------- 分析中 ---------- */

.loading-wrap {
  text-align: center;
  padding: 40px 0 20px;
}

.pulse {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--jade);
  display: grid;
  place-items: center;
  color: #fdfaf3;
  font-family: var(--serif);
  font-size: 32px;
  animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(47, 93, 80, 0.28); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 18px rgba(47, 93, 80, 0); }
}

.loading-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.loading-sub { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }

.steps {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 260px;
  text-align: left;
}

.steps li {
  font-size: 13px;
  color: var(--ink-3);
  padding: 7px 0 7px 24px;
  position: relative;
  transition: color 0.3s;
}

.steps li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #cfc5b4;
  background: transparent;
}

.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--jade); border-color: var(--jade); }

.steps li.active { color: var(--jade-deep); font-weight: 600; }
.steps li.active::before {
  border-color: var(--jade);
  background: var(--jade);
  box-shadow: 0 0 0 4px rgba(47, 93, 80, 0.14);
}

/* ---------- 报告 ---------- */

.report-head {
  text-align: center;
  margin-bottom: 18px;
}

.report-head .kicker {
  font-size: 11.5px;
  letter-spacing: 2px;
  color: var(--ink-3);
  text-transform: uppercase;
}

.report-head h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 6px 0 8px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.report-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.tag-mock {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fdf1e3;
  border: 1px solid #efdcc0;
  color: #8a5c1c;
}

.constitution-card {
  background: linear-gradient(160deg, #2f5d50 0%, #234239 100%);
  color: #f4f0e6;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(35, 66, 57, 0.24);
}

.constitution-card .label {
  font-size: 11.5px;
  letter-spacing: 2px;
  opacity: 0.68;
  margin-bottom: 8px;
}

.constitution-card .primary {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

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

.chip {
  font-size: 11.5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.chip.conf { background: rgba(255, 255, 255, 0.08); }

.card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--jade-deep);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--jade);
}

.obs-row {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}

.obs-row:last-child { border-bottom: none; padding-bottom: 0; }
.obs-row:first-child { padding-top: 0; }

.obs-key {
  font-size: 13px;
  color: var(--ink-3);
  letter-spacing: 0.5px;
}

.obs-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.obs-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }

.summary-text { font-size: 14px; color: var(--ink-2); line-height: 1.85; margin: 0; }

.sug-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
  line-height: 1.7;
}

.sug-item:last-child { border-bottom: none; padding-bottom: 0; }
.sug-item:first-child { padding-top: 0; }

.sug-cat {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--jade-soft);
  color: var(--jade-deep);
  height: fit-content;
  margin-top: 2px;
}

.sug-cat.c-就医 { background: var(--cinnabar-soft); color: var(--cinnabar); }
.sug-cat.c-作息 { background: #eef2f8; color: #3c5c85; }
.sug-cat.c-情志 { background: #f6eef7; color: #7a4a80; }
.sug-cat.c-运动 { background: #f7f1e4; color: #8a6a25; }

.caution-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.75;
}

.caution-list li { margin-bottom: 7px; }
.caution-list li:last-child { margin-bottom: 0; }

.disclaimer {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.75;
  background: #f4efe4;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0 18px;
}

.report-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.fade-in { animation: fadeIn 0.35s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 历史页 ---------- */

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-link {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-head h1 {
  font-family: var(--serif);
  font-size: 19px;
  margin: 0;
  font-weight: 600;
  letter-spacing: 1px;
}

.record {
  display: flex;
  gap: 13px;
  padding: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 11px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(35, 32, 29, 0.03);
  transition: box-shadow 0.2s, transform 0.12s;
}

.record:hover { box-shadow: var(--shadow); }
.record:active { transform: scale(0.995); }

.record-thumb {
  width: 62px;
  height: 78px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  background: #eee7da;
}

.record-body { min-width: 0; flex: 1; }

.record-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.record-primary {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.record-time { font-size: 11px; color: var(--ink-3); flex: none; }
.record-summary {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-3);
}

.empty .empty-mark {
  font-family: var(--serif);
  font-size: 34px;
  color: #d6cdbd;
  margin-bottom: 12px;
}

.empty p { font-size: 13.5px; margin: 0 0 18px; }

.record-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-danger {
  font: inherit;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid #e8cdc2;
  background: #fdf6f2;
  color: var(--cinnabar);
  cursor: pointer;
  flex: none;
}
