:root { color-scheme: light; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #173d36; background: #f4f2eb; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { display: flex; justify-content: space-between; align-items: center; padding: 18px clamp(16px, 3vw, 44px); border-bottom: 1px solid #d8ddd5; background: #fffdf7; font-size: 14px; }
a { color: #16594f; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #b58d45; outline-offset: 2px; }
main { max-width: 1500px; margin: auto; padding: clamp(18px, 3vw, 44px); }
.heading { max-width: 820px; margin-bottom: 24px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; color: #56766f; }
h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(28px, 3vw, 46px); margin: 8px 0 12px; font-weight: 500; }
.heading p:last-child, .plan-panel p, .hint { color: #52645e; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 18px; }
.viewer, .plan-panel { border: 1px solid #d9dfd7; border-radius: 18px; background: #fff; overflow: hidden; }
.viewer { position: relative; height: 565px; min-height: 0; background: #dbe5dc; }
#canvas-root { position: absolute; inset: 0; }
#canvas-root canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#canvas-root canvas:active { cursor: grabbing; }
.viewer-overlay { position: absolute; inset: 16px 16px auto; display: flex; justify-content: space-between; pointer-events: none; gap: 12px; }
.viewer-overlay span { padding: 8px 12px; border-radius: 999px; background: #fffef1e8; font-size: 13px; }
.comparison-labels { position: absolute; z-index: 2; inset: auto 16px 16px; display: flex; justify-content: space-between; pointer-events: none; }
.comparison-labels span { padding: 6px 10px; border: 1px solid #ffffffb8; border-radius: 6px; background: #173d36d9; color: white; font-size: 12px; }
.comparison-divider { position: absolute; z-index: 2; inset: 0 auto 0 50%; width: 44px; transform: translateX(-50%); cursor: col-resize; pointer-events: auto; touch-action: none; }
.comparison-divider::before { position: absolute; inset: 0 auto 0 50%; border-left: 2px solid #fff; box-shadow: 0 0 6px #14261f99; content: ""; }
.comparison-grip { position: absolute; top: 50%; left: 50%; display: flex; width: 42px; aspect-ratio: 1; align-items: center; justify-content: center; gap: 4px; transform: translate(-50%, -50%); border: 2px solid white; border-radius: 50%; background: #195b4e; box-shadow: 0 2px 10px #14261f70; pointer-events: none; }
.comparison-grip i { width: 2px; height: 14px; border-radius: 1px; background: white; }
.arrival-card { position: absolute; left: 24px; right: 24px; bottom: 24px; width: min(640px, calc(100% - 48px)); max-height: calc(100% - 48px); overflow: auto; z-index: 3; padding: 23px 25px; border-radius: 16px; background: #fffdf6f2; box-shadow: 0 16px 42px #0c2c2270; }
.arrival-card .eyebrow { margin: 0 0 8px; }
.arrival-card h2 { font-family: Georgia, "Songti SC", serif; font-size: clamp(23px, 2.3vw, 30px); font-weight: 500; line-height: 1.35; margin: 0 0 8px; }
.arrival-card p:not(.eyebrow) { color: #52645e; font-size: 13px; line-height: 1.6; }
.arrival-card a { display: inline-block; margin-top: 7px; padding: 11px 14px; border-radius: 9px; background: #195b4e; color: white; font-size: 13px; font-weight: 700; }
.plan-panel { padding: 18px; }
.scene-switch { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.scene-switch button { border: 1px solid #c8d8ce; border-radius: 8px; padding: 8px 10px; background: #fffdf6; color: #195b4e; font: inherit; font-size: 12px; cursor: pointer; }
.scene-switch button[aria-pressed="true"] { border-color: #195b4e; background: #195b4e; color: #fff; }
.scene-switch button:disabled { cursor: not-allowed; opacity: .48; }
.comparison-range { display: grid; grid-template-columns: auto minmax(80px, 1fr) auto; align-items: center; gap: 9px; margin: 4px 0 14px; color: #52645e; font-size: 11px; }
.comparison-range input { width: 100%; min-width: 0; accent-color: #195b4e; }
.scene-state-note { margin: 0 0 14px; color: #52645e; font-size: 12px; line-height: 1.55; }
.plan-editor { margin: 0 0 16px; padding-top: 14px; border-top: 1px solid #d9dfd7; }
.plan-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-editor-heading h2 { font-size: 16px; font-weight: 600; }
.plan-editor-heading span { color: #62746a; font-size: 11px; }
.plan-editor > p { margin: 7px 0 10px; color: #52645e; font-size: 12px; line-height: 1.55; }
.fabric-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fabric-choice { display: flex; min-width: 0; min-height: 42px; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border: 1px solid #cbd4ce; border-radius: 6px; background: #fff; color: #344a42; font-size: 11px; }
.fabric-choice[aria-pressed="true"] { border-color: #195b4e; box-shadow: inset 0 0 0 1px #195b4e; }
.fabric-swatch { flex: 0 0 16px; width: 16px; aspect-ratio: 1; border: 1px solid #5b625b66; border-radius: 50%; }
.plan-editor-actions { display: flex; gap: 8px; margin-top: 9px; }
.plan-editor-actions button { min-height: 36px; padding: 7px 11px; border: 1px solid #c9d6ce; border-radius: 6px; background: #fff; color: #17443a; font-size: 12px; }
.plan-editor-actions #plan-edit-save { border-color: #195b4e; background: #195b4e; color: #fff; }
.plan-editor-actions button:disabled { cursor: default; opacity: .48; }
.plan-edit-status { min-height: 1.5em; }
.plan-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.plan-panel h2 { font-size: 18px; font-weight: 500; margin: 0; }
#progress-label { color: #197164; font-size: 13px; font-weight: 700; }
#floorplan-map { display: block; width: 100%; height: auto; max-height: 460px; background: #fafafa; border-radius: 10px; }
.plan-panel p { font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.controls button, .calibration button { border: 1px solid #c9d6ce; border-radius: 10px; padding: 10px 14px; background: #fff; color: #17443a; }
.controls button:hover, .controls button:focus-visible { background: #e4efe8; }
.controls button:disabled { opacity: .5; cursor: default; }
.controls #play, .controls #resume { background: #195b4e; color: white; }
.hint { font-size: 13px; margin-top: 12px; }
.calibration { margin-top: 24px; padding: 16px; border: 1px solid #d0dbd1; background: #fff; border-radius: 12px; }
.calibration p { font-size: 12px; color: #52645e; }
.calibration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.calibration-grid label { display: grid; gap: 4px; font-size: 12px; }
.calibration-grid input { min-width: 0; width: 100%; padding: 8px; border: 1px solid #c4d3c7; border-radius: 6px; }
.calibration pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.viewer-loading { position: absolute; inset: 40% 18px auto; text-align: center; padding: 14px; border-radius: 10px; background: #fffdf5; color: #315b46; }
.viewer-error { position: absolute; inset: auto 20px 20px; z-index: 5; max-width: 510px; padding: 18px; border-radius: 12px; background: #fffdf5; box-shadow: 0 12px 28px #0c2c2270; line-height: 1.6; }
.viewer-error p { margin: 5px 0 10px; }
.viewer-error a { display: inline-block; margin: 4px 12px 0 0; padding: 8px 11px; border-radius: 8px; background: #195b4e; color: white; }
.arrival-match { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: start; }
.arrival-photo { position: relative; min-height: 130px; overflow: hidden; border-radius: 9px; background: #e5e6df; }
.arrival-photo img { display: block; width: 100%; height: 130px; object-fit: cover; object-position: center 46%; }
.arrival-photo span { position: absolute; inset: auto 0 0; padding: 12px 5px 5px; color: white; background: linear-gradient(transparent, #172820bb); font-size: 10px; }
.arrival-photo small { display: block; padding: 12px; font-size: 11px; }
.arrival-match p { margin: 0; }
.arrival-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.arrival-card a.secondary { background: #e6efe8; color: #195b4e; }
@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .viewer { height: 440px; min-height: 0; }
  .plan-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .comparison-range { grid-column: 1 / -1; }
  .plan-heading { grid-column: 1 / -1; }
  .plan-panel p { margin-top: 0; }
}
@media (max-width: 520px) {
  header { font-size: 12px; }
  .viewer { height: 420px; min-height: 0; }
  .plan-panel { display: block; }
  .controls button { flex: 1 1 28%; min-height: 42px; }
  .arrival-card { left: 14px; right: 14px; bottom: 14px; width: calc(100% - 28px); max-height: calc(100% - 28px); padding: 16px; }
  .arrival-match { grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  .arrival-photo, .arrival-photo img { height: 116px; min-height: 116px; }
  .viewer-error { inset: auto 14px 14px; }
  .calibration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.scene-notice { position: absolute; z-index: 2; top: 58px; left: 16px; max-width: min(430px, calc(100% - 32px)); margin: 0; padding: 8px 11px; border-radius: 8px; background: #fff9e7e8; color: #5d5136; font-size: 12px; line-height: 1.5; pointer-events: none; }
