:root {
  color-scheme: light;
  --paper: #f7f6f2;
  --panel: #fffdfa;
  --ink: #262a24;
  --muted: #63675d;
  --hair: #e6e3da;
  --green: #2e513e;
  --green-soft: #e9f1e8;
  --error: #8d392e;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; }
:focus-visible { outline: 2px solid #52775c; outline-offset: 3px; }
.shell { max-width: 1440px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 66px); }

.topbar { border-bottom: 1px solid var(--hair); background: rgba(255,253,250,.66); }
.topbar-inner { min-height: 66px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--green); border-radius: 9px; }
.brand-mark i { width: 15px; height: 14px; border: 1.5px solid white; border-top: 0; transform: translateY(3px); position: relative; }
.brand-mark i::before { content: ""; position: absolute; width: 10px; height: 10px; border: solid white; border-width: 1.5px 0 0 1.5px; top: -5px; left: 1px; transform: rotate(45deg); }
.brand-mark i::after { content: ""; position: absolute; height: 7px; width: 4px; border: 1.5px solid white; border-bottom: 0; bottom: 0; left: 4px; }
.brand-word { display: flex; align-items: baseline; gap: 9px; font-size: 21px; letter-spacing: .10em; font-weight: 750; }
.brand-word small { font-size: 9px; font-weight: 700; letter-spacing: .21em; }
.topbar-area { border-left: 1px solid var(--hair); padding-left: 24px; color: var(--muted); font-size: 13px; }
.connection { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #ae7e49; }
.connection.live i { background: #62986f; }
.workspace-head { padding: 27px 0 20px; }
h1, h2, p { margin: 0; }
.workspace-head h1 { font-size: clamp(28px, 3.5vw, 43px); letter-spacing: -.025em; line-height: 1.15; font-weight: 720; }
.workspace-head p { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(325px, 366px); gap: clamp(16px, 2.1vw, 28px); align-items: start; padding-bottom: 40px; }
.preview, .settings { border: 1px solid var(--hair); border-radius: 16px; background: var(--panel); min-width: 0; }
.preview { overflow: hidden; }
.preview-head { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 19px; }
.preview-head h2 { font-size: 19px; line-height: 1.28; font-weight: 710; margin-bottom: 5px; }
.preview-head h2 + span { color: var(--muted); font-size: 12px; display: block; }
.view-switch { display: flex; gap: 2px; background: #f1f0e9; padding: 4px; border-radius: 9px; white-space: nowrap; }
.view-switch button { padding: 7px 11px; min-height: 34px; font-size: 12px; border: 0; border-radius: 6px; color: var(--muted); background: none; }
.view-switch button[aria-pressed="true"] { color: var(--green); background: #fff; box-shadow: 0 1px 2px #32281d15; font-weight: 700; }
.visual { aspect-ratio: 3 / 2; width: 100%; min-height: 248px; background: #eae5d8; position: relative; overflow: hidden; }
.visual img, .visual canvas { width: 100%; height: 100%; display: block; position: absolute; inset: 0; object-fit: cover; }
.visual img.contain { padding: 12px; object-fit: contain; background: #ece9e1; }
.visual canvas { cursor: grab; touch-action: none; background: #35362e; }
.visual canvas:active { cursor: grabbing; }
.visual-state { position: absolute; z-index: 2; inset: 0; background: #303a31c6; color: #fff; display: grid; place-items: center; padding: 38px; text-align: center; line-height: 1.65; }
.visual-tag { display: flex; align-items: center; gap: 7px; position: absolute; left: 13px; top: 13px; z-index: 3; color: #fff; background: #24271dcc; padding: 6px 10px; min-height: 28px; border-radius: 6px; font-size: 12px; }
.visual-tag span { border-radius: 50%; width: 6px; height: 6px; background: #e6d0a2; }
.panorama-actions { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: flex; gap: 3px; padding: 4px; background: #282b23cf; border-radius: 9px; }
.panorama-actions button { min-height: 36px; min-width: 37px; border: 0; background: none; color: #fff; border-radius: 6px; font-size: 13px; padding: 5px 7px; }
.panorama-actions button:hover { background: #ffffff25; }
.preview-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 58px; padding: 12px 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preview-foot a { flex: 0 0 auto; }
.text-action { border: 0; background: none; color: var(--green); padding: 3px 0; font-size: 12px; text-decoration: none; font-weight: 700; }
.text-action:hover { text-decoration: underline; }
.setting-block { padding: 17px 16px 15px; border-bottom: 1px solid var(--hair); }
.setting-block h2 { font-size: 15px; line-height: 1.35; margin-bottom: 10px; font-weight: 730; }
.source-state { display: flex; align-items: center; gap: 10px; min-width: 0; border: 1px solid #e9e5dd; background: #f7f5ef; padding: 6px; border-radius: 9px; }
.source-state img { flex-shrink: 0; width: 50px; height: 36px; object-fit: cover; border-radius: 5px; background: #e7e3d7; }
.source-state > div { display: grid; min-width: 0; gap: 3px; }
.source-state strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-state div span { line-height: 1; font-size: 11px; color: var(--muted); }
.source-state button { margin-left: auto; padding: 6px; white-space: nowrap; }
.source-actions { display: grid; grid-template-columns: .72fr 1fr 1.2fr; gap: 6px; margin-top: 8px; }
.source-actions label { display: grid; place-items: center; text-align: center; min-height: 34px; padding: 5px 4px; border: 1px solid var(--hair); border-radius: 7px; font-size: 12px; white-space: nowrap; cursor: pointer; }
.source-actions label:hover { background: #f1f2eb; }
.file-input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); padding: 0; overflow: hidden; }
.settings:has(#take-photo:focus-visible) label[for="take-photo"], .settings:has(#room-photo:focus-visible) label[for="room-photo"],
.settings:has(#floor-plan:focus-visible) label[for="floor-plan"] { outline: 2px solid #52775c; outline-offset: 2px; }
.style-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.style-choice { display: grid; gap: 5px; min-width: 0; padding: 4px; border: 1px solid transparent; border-radius: 8px; background: #f7f5ef; text-align: center; }
.style-choice:hover { border-color: #acb9a9; }
.style-choice[aria-pressed="true"] { background: var(--green-soft); border-color: #42654e; font-weight: 720; }
.style-choice img { width: 100%; height: 44px; object-fit: cover; border-radius: 4px; background: #e9e1d4; }
.style-choice span { padding: 0 1px 3px; font-size: 11px; line-height: 1.3; }
.material-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--hair); margin-top: -2px; }
.material-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; min-height: 34px; padding: 4px 5px 6px; font-size: 11px; color: var(--muted); }
.material-tabs button[aria-pressed="true"] { border-bottom-color: var(--green); color: var(--green); font-weight: 720; }
.material-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 68px; gap: 6px; padding: 9px 0 4px; }
.option { border: 1px solid var(--hair); background: #fffdfa; border-radius: 7px; padding: 5px; display: grid; align-content: start; justify-items: start; gap: 5px; min-width: 0; font-size: 11px; }
.option[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }
.option:hover { border-color: #71917d; }
.swatch { width: 100%; height: 21px; border-radius: 4px; background: var(--swatch); box-shadow: inset 0 0 0 1px #28251d19; }
.option.wood .swatch { background: repeating-linear-gradient(7deg, #ffffff05 0 2px, #fff1 3px 4px, #523f231c 6px 7px), var(--swatch); }
.material-summary { font-size: 11px; line-height: 1.5; color: var(--green); margin: 3px 0 8px; }
.brief { font-size: 11px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 7px; white-space: nowrap; }
.brief input { min-width: 0; width: 100%; height: 32px; padding: 5px 8px; border: 1px solid var(--hair); border-radius: 6px; color: var(--ink); background: #fffefa; }
.brief input::placeholder { color: #696d61; }
.settings-foot { padding: 14px 16px; }
.generate { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; border: 0; border-radius: 8px; background: var(--green); color: #fff; font-weight: 710; font-size: 14px; }
.generate:hover { background: #244332; }
.generate:disabled { opacity: .65; }
.sparkle { color: #ebdfc7; font-size: 16px; }
.generation-status { margin-top: 9px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.generation-status.error { color: var(--error); }
@media (max-width: 880px) {
  .shell { padding-inline: 20px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 323px; }
  .preview-head { padding-inline: 12px; }
  .view-switch button { padding-inline: 7px; }
}
@media (max-width: 720px) {
  .shell { padding-inline: 14px; }
  .topbar-inner { min-height: 58px; gap: 12px; }
  .topbar-area { display: none; }
  .workspace-head { padding: 24px 2px 18px; }
  .workspace-head p { font-size: 13px; margin-top: 7px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-bottom: 26px; }
  .preview, .settings { border-radius: 13px; }
  .preview-head { min-height: 63px; }
  .preview-head h2 { font-size: 16px; }
  .view-switch button { padding-inline: 6px; font-size: 11px; min-height: 38px; }
  .visual { min-height: 0; }
  .preview-foot { padding: 10px 12px; min-height: 45px; }
  .setting-block { padding: 15px 13px; }
  .source-actions label, .material-tabs button { min-height: 42px; }
  .style-choice img { height: 62px; }
  .material-options { min-height: 72px; }
  .settings-foot { padding: 14px 13px; }
}
@media (max-width: 335px) {
  .shell { padding-inline: 9px; }
  .brand-word small { display: none; }
  .preview-head { padding-inline: 8px; gap: 5px; }
  .view-switch button { padding-inline: 4px; }
}
.preview-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 12px; }
.preview-tools > * { flex: none; }
#choose-panorama { cursor: pointer; }
#region-overlay { position: absolute; z-index: 2; touch-action: none; cursor: crosshair; }
.region-box { position: absolute; border: 2px solid #fcf6df; background: #bfe09746; box-shadow: 0 0 0 1px #2a5238; pointer-events: none; }
.share-box { padding: 12px 18px; border-top: 1px solid var(--hair); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.share-box input { width: min(100%, 380px); min-width: 0; color: var(--ink); border: 1px solid var(--hair); border-radius: 5px; padding: 6px; }
#reference-note { overflow-wrap: anywhere; }

.panorama-generate { min-height: 36px; padding: 6px 10px; font-size: 13px; }

.renovation-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 10px; }
.renovation-options button { min-height: 37px; padding: 5px; border: 1px solid var(--hair); border-radius: 7px; background: #fbfaf6; color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
.renovation-options button[aria-pressed="true"] { border-color: #567354; color: #2a5238; background: #edf0e6; font-weight: 650; }
