:root {
  color-scheme: light;
  --paper: #f5f3ec;
  --ink: #192a23;
  --subtle: #556258;
  --line: #d9ddd1;
  --green: #204e3a;
  --green-dark: #143a2a;
  --card: #fcfbf7;
  --mint: #a8d9b3;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; }
button, a, label.file-label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, label:focus-within { outline: 3px solid #679978; outline-offset: 4px; }
button:disabled, .file-label:has(input:disabled) { opacity: .55; cursor: wait; }
.top { width: min(1120px, 100% - 64px); margin: 0 auto; height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-size: 1.35rem; font-family: "Songti SC", "Noto Serif SC", serif; font-weight: 800; text-decoration: none; letter-spacing: .13em; }
.text-button { padding: 8px 0; background: none; border: 0; color: var(--green); font-weight: 700; cursor: pointer; text-underline-offset: 4px; }
main { flex: 1; width: min(1080px, 100% - 64px); margin: 0 auto; padding: clamp(30px, 6.8vw, 92px) 0 48px; }
.capture-grid { display: grid; grid-template-columns: 1fr 1.03fr; gap: clamp(30px, 6vw, 95px); align-items: center; }
h1,h2,p { margin: 0; }
h1 { font-family: "Songti SC", "Noto Serif SC", serif; line-height: 1.16; letter-spacing: -.045em; font-size: clamp(2.6rem, 5.3vw, 4.7rem); font-weight: 800; }
.subtitle { margin-top: 20px; font-size: 1.0625rem; line-height: 1.65; color: var(--subtle); }
fieldset { border: 0; padding: 0; margin: 30px 0 20px; }
legend { font-size: .95rem; font-weight: 700; margin-bottom: 10px; }
.segments { display: inline-flex; padding: 4px; gap: 3px; background: #e9ece1; border: 1px solid var(--line); border-radius: 11px; }
.segments label { display: flex; position: relative; cursor: pointer; }
.segments input, .file-label input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segments span { display: block; padding: 8px 13px; border-radius: 7px; font-size: .925rem; }
.segments input:checked + span { background: var(--card); box-shadow: 0 1px 3px #192a2318; color: var(--green-dark); font-weight: 700; }
.actions, .result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.primary,.outline { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 19px; border-radius: 8px; border: 1px solid var(--green); font-weight: 700; cursor: pointer; text-decoration: none; }
.primary { background: var(--green); color: #fff; }
.primary:hover { background: var(--green-dark); }
.outline { background: transparent; color: var(--green); }
.outline:hover { background: #e6eee4; }
.file-label { position: relative; }
#back-result { margin-top: 12px; }
.privacy,.round { color: var(--subtle); font-size: .875rem; line-height: 1.6; margin-top: 14px; }
.round { margin: 0 0 16px; }
.camera-card { background: #152b23; border-radius: 19px; padding: 12px; color: #f7faf2; box-shadow: 0 16px 35px #142e241b; min-width: 0; }
.viewfinder { position: relative; display: grid; place-items: center; isolation: isolate; border-radius: 11px; overflow: hidden; aspect-ratio: 4/3.5; background: radial-gradient(ellipse at 50% 42%, #2b5742, #173427 70%, #10291e); }
.viewfinder video,.viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #13271e; }
.reticle { width: 65%; height: 74%; position: absolute; border: 1px dashed #b8dfbbad; border-radius: 26px; box-shadow: 0 0 0 200px #0e241622; pointer-events: none; }
#preview-label { color: #e9f3e5; align-self: end; padding: 0 0 20px; font-size: .9rem; z-index: 1; }
.camera-caption { display: flex; gap: 11px; align-items: center; min-height: 61px; padding: 7px 11px 2px; line-height: 1.45; }
.indicator { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: #8e9e8e; }
.indicator[data-mode="live"] { background: var(--mint); box-shadow: 0 0 0 4px #a8d9b328; }
.indicator[data-mode="error"] { background: #f2bd98; }
.result-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 28px; }
.eyebrow { margin-bottom: 9px; font-weight: 700; color: var(--green); }
.result-heading .subtitle { margin-top: 10px; }
.result-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 20px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 12px; }
.panel h2 { font-size: 1.2rem; }
.score { color: var(--green); font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
progress { width: 100%; height: 12px; display: block; accent-color: var(--green); }
.score-lines { list-style: none; padding: 0; margin: 15px 0 12px; }
.score-lines li { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.score-lines p { grid-column: 1/-1; font-size: .925rem; color: var(--subtle); line-height: 1.5; }
.score-lines span,.muted { color: var(--subtle); font-size: .9rem; line-height: 1.55; }
.photo-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 12px; max-height: 410px; overflow: auto; }
.photo-strip a { text-decoration: none; font-size: .875rem; }
.photo-strip img { display: block; width: 100%; aspect-ratio: 5/6; object-fit: cover; border-radius: 7px; margin-bottom: 3px; }
.report-panel { margin-top: 18px; }
.report-panel iframe { width: 100%; height: min(950px, 80vh); min-height: 480px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
#result-message { margin-top: 14px; color: #8b3925; }
.history-list { margin: 22px 0; display: grid; gap: 10px; }
.history-item { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; }
footer { text-align: center; padding: 20px; color: var(--subtle); font-size: .875rem; }
@media (max-width: 700px) {
  .top,main { width: calc(100% - 36px); }
  .top { height: 60px; }
  main { padding-top: 28px; }
  .capture-grid,.result-grid { grid-template-columns: 1fr; gap: 14px; }
  .capture-grid { gap: 23px; align-items: start; }
  h1 { font-size: 2.72rem; }
  .subtitle { margin-top: 10px; }
  fieldset { margin: 21px 0 14px; }
  .viewfinder { aspect-ratio: 1; max-height: 62vh; }
  .result-heading { flex-direction: column; align-items: start; }
  .panel { padding: 14px; }
}
@media (max-width: 380px) {
  h1 { font-size: 2.32rem; }
}
