:root {
  --report-paper: #f4efe5;
  --report-sheet: #fffdf8;
  --report-ink: #28251f;
  --report-muted: #746d61;
  --report-gold: #bd8732;
  --report-green: #315f4d;
  --report-line: rgba(122, 101, 66, 0.2);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--report-paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--report-ink);
  background:
    linear-gradient(rgba(122, 101, 66, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 101, 66, 0.055) 1px, transparent 1px),
    var(--report-paper);
  background-size: 38px 38px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

button, select, input, textarea { font: inherit; }
button, select, input { min-height: 44px; }
button { cursor: pointer; }

.report-nav {
  width: min(100%, 1120px);
  height: 66px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-brand, .report-back { color: var(--report-ink); text-decoration: none; }
.report-brand { display: flex; align-items: center; gap: 9px; font-family: "Noto Serif SC", serif; font-size: 21px; font-weight: 800; }
.report-brand span { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--report-ink) 0 50%, var(--report-gold) 0); }
.report-back { display: inline-flex; align-items: center; gap: 5px; color: var(--report-muted); font-size: 14px; }

.report-page { width: min(100% - 48px, 1180px); margin: 0 auto; padding: 48px 0 80px; }
.report-intro { max-width: 760px; padding-bottom: 42px; }
.report-eyebrow, .report-section-heading p { margin: 0 0 10px; color: var(--report-gold); font-size: 13px; font-weight: 800; }
.report-intro h1 { margin: 0; max-width: 720px; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 42px; line-height: 1.3; letter-spacing: 0; }
.report-intro > p:not(.report-eyebrow) { max-width: 680px; margin: 20px 0 0; color: var(--report-muted); font-size: 16px; line-height: 1.9; }
.report-disclaimer-note { margin-top: 18px !important; color: var(--report-muted); font-size: 13px !important; }

.report-workspace { display: grid; grid-template-columns: minmax(540px, 1fr) minmax(260px, 320px); gap: 32px; align-items: start; padding: 44px 0 64px; border-top: 1px solid var(--report-line); border-bottom: 1px solid var(--report-line); }
.report-preview { min-width: 0; }
.report-control-column { min-width: 0; }
.report-field { display: grid; gap: 10px; font-size: 14px; font-weight: 800; }
.report-field select { width: 100%; padding: 0 44px 0 14px; color: var(--report-ink); border: 1px solid var(--report-line); border-radius: 6px; background: var(--report-sheet); box-sizing: border-box; }
.report-field-help, .report-charge-note { margin: 9px 0 0; color: var(--report-muted); font-size: 12px; line-height: 1.7; }
.report-notice {
  margin-top: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(164,85,50,.28);
  border-radius: 6px;
  color: #71422f;
  background: rgba(255,248,238,.76);
  font-size: 13px;
  line-height: 1.65;
}
.report-notice p { margin: 0; }
.report-notice-action { flex: 0 0 auto; color: var(--report-green); font-weight: 800; text-underline-offset: 3px; }
.report-offer { margin: 30px 0 20px; padding: 22px 0; border-top: 1px solid var(--report-line); border-bottom: 1px solid var(--report-line); }
.report-offer-label { display: block; margin-bottom: 7px; color: var(--report-muted); font-size: 12px; }
.report-offer strong { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--report-green); font-family: "Noto Serif SC", serif; font-size: 26px; }
.report-promotion-badge { align-self: center; padding: 4px 8px; border-radius: 999px; color: #fffaf0; background: #a45532; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.report-original-price { color: var(--report-muted); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 13px; font-weight: 500; white-space: nowrap; }
.report-savings { color: #a45532; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 12px; font-weight: 800; white-space: nowrap; }
.report-offer p { margin: 8px 0 0; color: var(--report-muted); font-size: 14px; line-height: 1.65; }
.report-primary, .report-feedback-band button, .report-result-actions button {
  min-height: 48px; border: 0; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; color: white; background: var(--report-green); font-weight: 800;
}
.report-primary { width: 100%; }
.report-primary:disabled { cursor: not-allowed; opacity: .45; }

.report-preview { min-height: 470px; border: 1px solid rgba(189,135,50,.42); border-radius: 8px; overflow: hidden; background: var(--report-sheet); box-shadow: 0 18px 48px rgba(72,55,30,.09); box-sizing: border-box; }
.report-preview-cover { min-height: 215px; padding: 28px; color: #f7f0e3; background: var(--report-green); }
.report-preview-brand { color: #e7bc6b; font-size: 13px; font-weight: 800; }
.report-preview-cover h2 { margin: 28px 0 12px; font-family: "Noto Serif SC", serif; font-size: 35px; line-height: 1.3; letter-spacing: 0; }
.report-preview-cover p { margin: 0; color: rgba(255,255,255,.68); font-size: 13px; }
.report-preview-pages { padding: 26px 28px; }
.report-preview-pages h3 { margin: 0 0 14px; font-size: 15px; }
.report-preview-pages ol { list-style: none; margin: 0; padding: 0; }
.report-preview-pages li { min-height: 38px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--report-line); font-size: 13px; }
.report-preview-pages li span { color: var(--report-gold); font-family: monospace; }
.report-preview-pages > p { margin: 18px 0 0; color: var(--report-muted); font-size: 12px; }

.report-progress { margin-top: 28px; min-height: 150px; padding: 22px; border: 1px solid var(--report-line); border-radius: 7px; background: rgba(255,253,248,.7); overflow: hidden; }
.report-progress-head { display: flex; justify-content: space-between; gap: 14px; }
.report-progress-head span { color: var(--report-gold); font-weight: 800; }
.report-progress-track { height: 7px; margin-top: 14px; overflow: hidden; background: rgba(49,95,77,.12); }
.report-progress-track span { display: block; width: 0; height: 100%; background: var(--report-green); transition: width .35s ease; }
.report-progress p { min-height: 44px; margin: 14px 0 0; color: var(--report-muted); font-size: 13px; line-height: 1.65; }
.report-result-actions { margin-top: 16px; display: flex; gap: 10px; }
.report-result-actions .quiet { color: var(--report-muted); border: 1px solid var(--report-line); background: transparent; }

.report-history-band { padding: 64px 0 22px; }
.report-section-heading h2, .report-feedback-band h2 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 28px; letter-spacing: 0; }
.report-history { margin-top: 24px; border-top: 1px solid var(--report-line); }
.report-history-item { min-height: 92px; padding: 18px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center; border-bottom: 1px solid var(--report-line); }
.report-history-item h3 { margin: 0; font-size: 15px; }
.report-history-item p { margin: 7px 0 0; color: var(--report-muted); font-size: 12px; line-height: 1.5; }
.report-history-item .report-history-error { color: #9a5038; }
.report-history-actions { display: flex; gap: 8px; }
.report-history-actions button { min-height: 44px; padding: 0 12px; border: 1px solid var(--report-line); border-radius: 5px; color: var(--report-ink); background: rgba(255,255,255,.45); }
.report-empty { padding: 28px 0; color: var(--report-muted); line-height: 1.7; }
.report-empty a { color: var(--report-green); font-weight: 700; text-underline-offset: 3px; }

.report-feedback-band { margin-top: 48px; padding: 42px 0; display: grid; grid-template-columns: minmax(0, .85fr) minmax(320px, 1fr); gap: 64px; border-top: 1px solid var(--report-line); }
.report-feedback-band > div > p:last-child { color: var(--report-muted); line-height: 1.7; }
.report-feedback-band form { display: grid; gap: 16px; }
.report-feedback-band label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.report-feedback-band input, .report-feedback-band textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--report-line); border-radius: 5px; color: var(--report-ink); background: var(--report-sheet); resize: vertical; }
.report-feedback-band button { justify-self: start; }

.report-toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 1000; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 6px; color: white; background: rgba(35,32,27,.93); opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: .2s ease; }
.report-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .report-nav { padding: 0 12px; }
  .report-page { width: calc(100% - 32px); max-width: 1180px; padding-top: 28px; }
  .report-page > *, .report-workspace > *, .report-history-item > *, .report-feedback-band > * { min-width: 0; }
  .report-intro h1 { font-size: 31px; }
  .report-intro > p:not(.report-eyebrow) { font-size: 15px; }
  .report-workspace { grid-template-columns: 1fr; gap: 34px; padding-top: 32px; }
  .report-preview { min-height: 0; }
  .report-preview-cover { min-height: 185px; }
  .report-preview-cover h2 { font-size: 30px; }
  .report-history-item { grid-template-columns: 1fr; gap: 12px; }
  .report-notice { align-items: flex-start; flex-direction: column; }
  .report-history-actions { width: 100%; }
  .report-history-actions button { flex: 1; }
  .report-feedback-band { grid-template-columns: 1fr; gap: 26px; }
  .report-feedback-band button { width: 100%; }
  .report-result-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* [主题补全] 8.15 深度报告页面、付费提示、历史记录与表单的深色视觉适配。 */
html[data-theme="dark"] body {
  background-color: var(--theme-canvas);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-nav {
  background-color: var(--theme-surface);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-brand,
html[data-theme="dark"] .report-back,
html[data-theme="dark"] .report-intro h1,
html[data-theme="dark"] .report-section-heading h2,
html[data-theme="dark"] .report-feedback-band h2 {
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-intro > p:not(.report-eyebrow),
html[data-theme="dark"] .report-field-help,
html[data-theme="dark"] .report-charge-note,
html[data-theme="dark"] .report-history-item p,
html[data-theme="dark"] .report-feedback-band > div > p:last-child {
  color: var(--theme-text-2);
}

html[data-theme="dark"] .report-eyebrow,
html[data-theme="dark"] .report-offer-label,
html[data-theme="dark"] .report-section-heading p {
  color: var(--theme-gold);
}

html[data-theme="dark"] .report-workspace,
html[data-theme="dark"] .report-preview,
html[data-theme="dark"] .report-history-band,
html[data-theme="dark"] .report-feedback-band {
  background-color: var(--theme-surface);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-field select {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line-strong);
  caret-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-notice,
html[data-theme="dark"] .report-offer,
html[data-theme="dark"] .report-progress,
html[data-theme="dark"] .report-empty {
  background-color: var(--theme-surface-soft);
  border-color: var(--theme-line);
  color: var(--theme-text-2);
}

html[data-theme="dark"] .report-preview-cover,
html[data-theme="dark"] .report-preview-pages {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-history-item {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-feedback-band input,
html[data-theme="dark"] .report-feedback-band textarea {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line-strong);
  caret-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-primary,
html[data-theme="dark"] .report-feedback-band button,
html[data-theme="dark"] .report-result-actions button {
  background-color: var(--theme-gold-soft);
  border-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-primary:hover {
  background-color: var(--theme-gold);
  border-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .report-primary:focus-visible {
  outline-color: var(--theme-gold);
  box-shadow: 0 0 0 4px var(--theme-gold-soft);
}

html[data-theme="dark"] .report-primary:disabled {
  background-color: var(--theme-surface-soft);
  border-color: var(--theme-line);
  color: var(--theme-text-disabled);
}

html[data-theme="dark"] .report-toast {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line-strong);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text-1);
}

/* [主题补全] 正式打印与浏览器导出固定为稳定浅色，不继承设备夜间偏好。 */
@media print {
  :root,
  html[data-theme="dark"],
  html[data-theme="light"] {
    color-scheme: light;
    --theme-canvas: #F4F0E7;
    --theme-canvas-alt: #EAE4D8;
    --theme-surface: #FFFDF8;
    --theme-surface-raised: #FFFEFB;
    --theme-surface-soft: #F6F1E8;
    --theme-text-1: #2E2922;
    --theme-text-2: #5F5548;
    --theme-text-3: #897C6B;
    --theme-line: rgba(94,76,52,.14);
    --theme-line-strong: rgba(94,76,52,.24);
    --theme-gold: #B98632;
    --theme-gold-soft: #F4E7CB;
    --theme-shadow: none;
  }

  body,
  .report-page,
  .report-workspace,
  .report-preview,
  .report-history-band,
  .report-history-item {
    background-color: #FFFDF8;
    color: #2E2922;
    box-shadow: none;
  }
}

