/* 安妮花测评解析系统 · 设计规范：白底弱边界 + 橙色强调，圆角 16px */
:root {
  --bg: #F7F7F5;
  --card: #FFFFFF;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.16);
  --ink: #1C1C1A;
  --ink-2: #5F5E5A;
  --ink-3: #918F88;
  --brand: #EC940B;
  --brand-deep: #C97A04;
  --brand-soft: #FFF6E8;
  --ok: #3B6D11;
  --ok-soft: #EAF3DE;
  --warn: #BA7517;
  --warn-soft: #FAEEDA;
  --risk: #A32D2D;
  --risk-soft: #FCEBEB;
  --info: #185FA5;
  --info-soft: #E6F1FB;
  --r: 16px;
  --r-sm: 10px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.side {
  width: 236px;
  flex: 0 0 236px;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-soft);
  border: 1px solid rgba(236, 148, 11, 0.3);
  display: grid; place-items: center;
  color: var(--brand-deep); font-weight: 700; font-size: 15px;
}
.brand-txt { font-weight: 600; letter-spacing: .2px; }
.brand-sub { font-size: 11px; color: var(--ink-3); margin-top: -2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; color: var(--ink-3); padding: 14px 10px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-2);
  cursor: pointer; font-size: 13.5px; border: 1px solid transparent;
}
.nav-item:hover { background: #FAFAF8; }
.nav-item.on { background: var(--brand-soft); color: var(--brand-deep); border-color: rgba(236, 148, 11, 0.22); font-weight: 500; }
.nav-count { font-size: 11px; color: var(--ink-3); }

.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; }
.page-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 16px;
}
.card.tight { padding: 14px 16px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stat-label { font-size: 12px; color: var(--ink-3); }
.stat-num { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.5px; }
.stat-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- 表单 ---------- */
label { font-size: 12.5px; color: var(--ink-2); display: block; margin-bottom: 5px; }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(236, 148, 11, 0.12); }
textarea { resize: vertical; min-height: 62px; line-height: 1.6; }
.field { margin-bottom: 13px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- 按钮 ---------- */
button { font-family: inherit; font-size: 13.5px; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  transition: .15s;
}
.btn:hover { border-color: var(--line-2); background: #FAFAF8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn-ghost { border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #F2F2EF; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------- 胶囊 / 标签 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: var(--r-pill); font-size: 11.5px;
  background: #F2F2EF; color: var(--ink-2); border: 1px solid transparent; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.risk { background: var(--risk-soft); color: var(--risk); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.brand { background: var(--brand-soft); color: var(--brand-deep); }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FCFCFB; }
.tbl-wrap { overflow-x: auto; }
td input, td select { padding: 6px 8px; font-size: 12.5px; }
td input[type="number"] { width: 72px; }
.muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 12px; font-size: 13px; }

/* ---------- 步骤条 ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 130px; padding: 11px 14px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
}
.step.on { border-color: rgba(236, 148, 11, .45); background: var(--brand-soft); }
.step.done { border-color: rgba(59, 109, 17, .3); background: var(--ok-soft); }
.step-no { font-size: 11px; color: var(--ink-3); }
.step.on .step-no, .step.on .step-name { color: var(--brand-deep); }
.step.done .step-no { color: var(--ok); }
.step-name { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* ---------- 上传区 ---------- */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  padding: 26px 18px; text-align: center; color: var(--ink-3);
  background: #FCFCFB; cursor: pointer; transition: .15s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.drop b { color: var(--ink); font-size: 13.5px; display: block; margin-bottom: 3px; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.thumb { width: 108px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 92px; object-fit: cover; display: block; background: #F2F2EF; }
.thumb-name { font-size: 10.5px; color: var(--ink-3); padding: 4px 6px; word-break: break-all; }

/* ---------- 分数条 ---------- */
.bar-row { display: grid; grid-template-columns: 88px 1fr 54px; gap: 10px; align-items: center; margin-bottom: 9px; }
.bar-label { font-size: 12.5px; color: var(--ink-2); }
.bar-track { height: 8px; background: #F2F2EF; border-radius: var(--r-pill); overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: var(--r-pill); background: var(--brand); }
.bar-fill.ok { background: #7BBF3D; }
.bar-fill.warn { background: var(--brand); }
.bar-fill.risk { background: #E24B4A; }
.bar-val { font-size: 12.5px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 报告 ---------- */
.report {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 34px 42px; max-width: 900px; margin: 0 auto;
  box-shadow: 0 8px 30px rgba(28, 28, 26, .05);
}
.report-cover {
  border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 24px;
}
.report-kicker { color: var(--brand-deep); font-size: 11px; letter-spacing: 1.5px; font-weight: 600; }
.report-meta { color: var(--ink-3); font-size: 12px; margin-top: 8px; }
.report-section-label { color: var(--brand-deep); font-size: 12px; font-weight: 600; margin: 22px 0 8px; }
.report-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.report-compare > div { background: var(--brand-soft); border: 1px solid rgba(236,148,11,.18); border-radius: 12px; padding: 12px; }
.report-compare b { display: block; font-size: 20px; margin-top: 3px; }
.report-print-tip { max-width: 900px; margin: 0 auto 12px; }
.pdf-only { display: none !important; }
.pdf-exporting { background: #fff !important; color: #1C1C1A !important; }
.pdf-exporting .pdf-only { display: block !important; }
.pdf-exporting .report { box-shadow: none; border: none; max-width: 820px; padding: 28px 34px; }
.pdf-exporting .report h2 { break-after: avoid; page-break-after: avoid; }
.pdf-exporting .report h3 { break-after: avoid; page-break-after: avoid; }
.pdf-exporting .report table, .pdf-exporting .report blockquote { break-inside: avoid; page-break-inside: avoid; }
.pdf-exporting .report-compare { grid-template-columns: repeat(3, 1fr); }
.pdf-exporting .pdf-page-break { page-break-before: always; }

.report h1 { font-size: 21px; margin: 0 0 10px; font-weight: 600; }
.report h2 { font-size: 15.5px; margin: 26px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.report h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
.report p { margin: 8px 0; line-height: 1.75; }
.report ul, .report ol { margin: 8px 0; padding-left: 22px; line-height: 1.85; }
.report li { margin: 3px 0; }
.report hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }
.report blockquote {
  margin: 10px 0; padding: 10px 14px; background: var(--brand-soft);
  border-left: 3px solid var(--brand); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--brand-deep);
}
.report table { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.report th { background: #FAFAF8; }
.report strong { font-weight: 600; }
.report em { color: var(--ink-3); font-size: 12.5px; }

/* ---------- 提示 ---------- */
.notice {
  padding: 11px 14px; border-radius: var(--r-sm); font-size: 12.5px; margin-bottom: 14px;
  border: 1px solid transparent; line-height: 1.65;
}
.notice.info { background: var(--info-soft); color: var(--info); border-color: rgba(24, 95, 165, .18); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(186, 117, 23, .2); }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(59, 109, 17, .2); }
.notice.risk { background: var(--risk-soft); color: var(--risk); border-color: rgba(163, 45, 45, .2); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28, 28, 26, .35);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--r); padding: 22px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border: 1px solid var(--line);
}
.modal h3 { margin: 0 0 14px; font-size: 16px; }

/* ---------- 加载 ---------- */
.spin {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
.loading { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 16px 14px 50px; }
  .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
  .report { padding: 24px 17px; border-radius: 12px; box-shadow: none; }
  .report h1 { font-size: 20px; }
  .report h2 { font-size: 15px; margin-top: 22px; }
  .report-compare { grid-template-columns: 1fr; }
  .report table { font-size: 12px; }
  .report th, .report td { padding: 8px 6px; }
}

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  .report { box-shadow: none; border: none; padding: 0; max-width: none; }
  .report h1 { font-size: 22px; }
  .report h2 { break-after: avoid; }
  .report h3 { break-after: avoid; }
  .report table { break-inside: avoid; }
  .report blockquote { break-inside: avoid; }
  .report-compare { grid-template-columns: repeat(3, 1fr); }
}


@media print {
  .side, .page-head, .btn-row, .steps, .notice { display: none !important; }
  .main { padding: 0; }
  .report { border: none; max-width: none; padding: 0; }
  body { background: #fff; }
}
