*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #C8974A; --gold-light: #F5E6CC; --gold-bg: #FEF9F0;
  --ink: #2C2416; --ink-light: #6B5E4A; --ink-muted: #9E9485;
  --white: #FFFFFF; --bg: #FAF7F2; --border: #E8E0D3;
  --shadow: 0 2px 12px rgba(44,36,22,0.06);
  --radius: 12px; --radius-sm: 8px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
}
.btn.small { max-width: 100%; white-space: normal; }
.container { max-width: 520px; margin: 0 auto; padding: 0 20px; width: 100%; }
.wide { max-width: 960px; }
.header { text-align: center; padding: 28px 20px 0; }
.header-logo { font-size: 22px; font-weight: 700; color: var(--gold); letter-spacing: 2px; }
.header-subtitle { font-size: 13px; color: var(--ink-muted); margin-top: 6px; line-height: 1.5; }
.card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px; margin-top: 20px;
}
.card h2 { font-size: 18px; margin-bottom: 6px; }
.card .desc { font-size: 13px; color: var(--ink-muted); margin-bottom: 14px; }
label.f { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=date], input[type=password], input[type=number], select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; background: var(--white); color: var(--ink); outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
.btn {
  display: block; width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 18px;
  background: var(--gold); color: #fff; transition: opacity .2s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: var(--white); color: var(--gold); border: 1.5px solid var(--gold); }
.btn.small { width: auto; display: inline-block; padding: 8px 16px; font-size: 14px; margin: 0; }
.hint { font-size: 12px; color: var(--ink-muted); margin-top: 6px; }
.error { color: #A32D2D; background: #FCEBEB; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-top: 12px; display: none; }
.error.show { display: block; }
.footer { text-align: center; padding: 24px 0 28px; font-size: 12px; color: var(--ink-muted); margin-top: auto; }
.steps { display: flex; gap: 8px; padding-top: 24px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); font-style: normal; }
.steps i.on { background: var(--gold); }
.spin {
  width: 42px; height: 42px; border: 4px solid var(--gold-light); border-top-color: var(--gold);
  border-radius: 50%; margin: 26px auto 14px; animation: sp 1s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }
.center { text-align: center; }
/* 自适应画布预览：把固定尺寸的报告/说明书按屏幕宽度缩放，桌面显示原尺寸、手机自动缩小，整页自然滚动、无横向溢出 */
.viewer-wrap { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; margin: 16px auto 0; max-width: 100%; }
.viewer-wrap iframe { border: 0; display: block; background: #fff; }
.viewer-hint { text-align: center; font-size: 12px; color: var(--ink-muted); margin-top: 8px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #EAF3DE; color: #3B6D11; }
.badge.warn { background: #FAEEDA; color: #854F0B; }
.badge.bad { background: #FCEBEB; color: #A32D2D; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-scroll table { min-width: 560px; margin-top: 0; }
.table-scroll td, .table-scroll th { white-space: nowrap; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--ink-muted); font-weight: 600; }
