:root { color-scheme: dark; --ink: var(--sws-text); --muted: var(--sws-text-muted); --line: var(--sws-line); --soft: var(--sws-surface-raised); --panel: var(--sws-surface); --dark: var(--sws-surface-strong); --orange: var(--sws-accent); --orange-dark: var(--sws-accent); --danger: var(--sws-danger); font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; }
body { margin: 0; overflow: hidden; background: var(--sws-canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.panorama-topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: var(--sws-surface-strong);
  color: #f7f8fa;
}
.panorama-identity, .topbar-actions, .panorama-brand { min-width: 0; display: flex; align-items: center; }
.panorama-identity { gap: 12px; }
.panorama-brand { gap: 9px; padding-right: 14px; border-right: 1px solid var(--line-strong); font-weight: 650; }
.panorama-brand img { border-radius: 7px; }
.product-name { color: var(--sws-text-soft); font-size: 13px; }
.project-heading { min-width: 0; display: grid; gap: 3px; margin-left: 12px; }
.project-heading strong { max-width: 320px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.project-heading small { color: var(--muted); font-size: 12px; }
.topbar-actions { gap: 8px; }
.topbar-actions a, .topbar-actions button { min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line); padding: 0 14px; background: transparent; color: #e5e7ea; font-size: 13px; cursor: pointer; border-radius: 12px; transition: background var(--sws-motion-fast) ease, border-color var(--sws-motion-fast) ease; }
.topbar-actions .primary, .primary { border-color: var(--orange); background: var(--orange); color: #18120a; font-weight: 750; }
button:disabled { opacity: .45; cursor: not-allowed; }

.panorama-shell { height: calc(100svh - 72px); }
.studio-state { height: 100%; display: grid; place-content: center; justify-items: start; padding: clamp(24px,7vw,100px); background: radial-gradient(ellipse at 70% 25%,rgba(255,157,92,.07),transparent 40%),var(--sws-canvas); }
.studio-state > span { width: 34px; height: 34px; justify-self: center; border: 2px solid var(--sws-line-strong); border-top-color: var(--orange); border-radius: 50%; animation: pano-spin .8s linear infinite; }
.studio-state h1 { max-width: 720px; margin: 0; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: clamp(36px,5vw,64px); font-weight: 600; line-height: 1.12; letter-spacing: -.04em; }
.studio-state p { max-width: 640px; margin: 20px 0 0; color: var(--muted); line-height: 1.8; }
.studio-state a, .studio-state button { min-height: 48px; display: inline-flex; align-items: center; margin-top: 26px; border: 1px solid var(--orange); padding: 0 20px; background: var(--orange); cursor: pointer; border-radius: 12px; color: #20150d; font-size: 14px; font-weight: 650; }
.eyebrow { margin-bottom: 10px !important; color: var(--orange-dark) !important; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
.panorama-dialog fieldset label:has(input:checked) { border-color: var(--orange); background: var(--sws-accent-soft);
}
:where(button, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--sws-focus); outline-offset: 3px;
}
:where(button, input, select, textarea):disabled { opacity: .45; cursor: not-allowed;
}
@keyframes pano-spin { to { transform: rotate(1turn); } }

.panorama-editor { height: 100%; display: grid; grid-template-columns: 248px minmax(360px,1fr) 288px; gap: 16px; background: var(--sws-canvas); padding: 16px; }
.scene-panel, .settings-panel { min-width: 0; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scene-panel { padding-bottom: 24px; }
.panel-heading { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 20px; }
.panel-heading span { display: block; margin-bottom: 4px; color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.upload-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); padding: 0 12px; background: var(--sws-surface-raised); font-size: 12px; cursor: pointer; border-radius: 10px; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.panel-help { margin: 12px 16px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.upload-status { min-height: 18px; margin: 0 16px 8px; color: var(--orange-dark); font-size: 12px; }
.scene-list { display: grid; gap: 10px; padding: 0 14px; }
.scene-card { min-width: 0; display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 12px; align-items: center; border: 1px solid var(--line); padding: 10px; background: var(--sws-surface-raised); text-align: left; cursor: pointer; border-radius: 12px; transition: border-color var(--sws-motion-fast) ease, background var(--sws-motion-fast) ease; }
.scene-card:hover, .scene-card.is-active { border-color: var(--orange); background: var(--sws-accent-soft); }
.scene-thumb { width: 64px; height: 48px; display: grid; place-items: center; overflow: hidden; background: var(--sws-canvas); color: var(--sws-text-soft); font-size: 12px; border-radius: 8px; }
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-card strong, .scene-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-card strong { font-size: 12px; }
.scene-card small { margin-top: 5px; color: var(--muted); font-size: 12px; }

.viewer-panel { position: relative; min-width: 0; overflow: hidden; background: #13161a; border-radius: 20px; border: 1px solid var(--line); }
.panorama-stage { position: absolute; inset: 0; }
.viewer-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 30px; background: radial-gradient(ellipse at 50% 30%,rgba(255,157,92,.09),transparent 55%),var(--sws-surface-strong); color: #f5f6f7; text-align: center; }
.viewer-empty strong { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 28px; font-weight: 600; letter-spacing: -.035em; }
.viewer-empty p { max-width: 500px; margin: 14px 0 22px; color: var(--sws-text-soft); font-size: 12px; line-height: 1.7; }
.viewer-empty .upload-button { min-height: 42px; border-color: var(--orange); padding: 0 18px; background: var(--orange); color: #17120b; }
.viewer-toolbar { position: absolute; z-index: 6; left: 50%; bottom: 18px; display: flex; align-items: center; gap: 6px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.2); padding: 8px; background: rgba(20,23,28,.9); box-shadow: 0 14px 40px rgba(0,0,0,.28); color: #f7f8fa; backdrop-filter: blur(12px); border-radius: 16px; max-width: calc(100% - 32px); }
.viewer-toolbar button { min-height: 40px; border: 1px solid var(--line); padding: 0 12px; background: var(--sws-surface-raised); color: #f0f2f4; font-size: 12px; cursor: pointer; border-radius: 10px; white-space: nowrap; }
.viewer-toolbar button.is-active { border-color: var(--orange); background: var(--orange); color: #17120b; }
.viewer-toolbar span { padding: 0 8px; color: var(--sws-text-soft); font-size: 12px; white-space: nowrap; }
.pnlm-container { background: #15181c; }

.settings-panel { padding-bottom: 28px; }
.settings-panel > section { border-bottom: 1px solid var(--line); padding: 0 16px 20px; }
.settings-panel > section:first-child { padding: 0 16px 22px; }
.settings-panel > section:first-child .panel-heading { margin: 0 -16px 18px; }
.settings-panel label { display: grid; gap: 7px; margin-top: 14px; color: var(--sws-text-soft); font-size: 12px; }
.settings-panel input, .settings-panel textarea, .panorama-dialog input, .panorama-dialog textarea, .panorama-dialog select { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; background: var(--sws-canvas); color: var(--ink); outline: none; font-size: 13px; }
.settings-panel input:focus, .settings-panel textarea:focus, .panorama-dialog input:focus, .panorama-dialog textarea:focus, .panorama-dialog select:focus { border-color: var(--orange); }
.settings-panel textarea { resize: vertical; line-height: 1.6; }
.settings-panel section > button { min-height: 40px; margin-top: 12px; border: 1px solid #cfd4da; padding: 0 12px; background: var(--sws-surface-raised); font-size: 12px; cursor: pointer; border-radius: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 8px; }
.section-heading h3 { margin: 0; font-size: 14px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.section-heading .danger { border: 0; background: transparent; color: var(--danger); font-size: 12px; cursor: pointer; }
.hotspot-list { display: grid; gap: 7px; }
.hotspot-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); padding: 12px; background: var(--sws-surface-raised); border-radius: 12px; }
.hotspot-card strong, .hotspot-card small { display: block; }
.hotspot-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hotspot-card small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.hotspot-card div:last-child { display: flex; gap: 4px; }
.hotspot-card button { border: 0; padding: 5px; background: transparent; color: var(--sws-text-soft); font-size: 12px; cursor: pointer; }
.hotspot-empty { border: 1px dashed var(--sws-line-strong); padding: 18px 10px; color: var(--muted); font-size: 12px; text-align: center; border-radius: 12px; }

.panorama-dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100svh - 32px); overflow: auto; border: 1px solid var(--line-strong); padding: 0; background: var(--sws-surface-strong); color: var(--ink); box-shadow: 0 36px 100px rgba(0,0,0,.55); border-radius: 24px; }
.panorama-dialog::backdrop { background: rgba(12,14,17,.64); backdrop-filter: blur(8px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 20px 22px; }
.dialog-heading span { color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.dialog-heading h2 { margin: 5px 0 0; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 27px; font-weight: 600; letter-spacing: -.025em; }
.dialog-heading > button { width: 40px; height: 40px; border: 1px solid var(--sws-line-strong); background: var(--sws-surface-raised); color: var(--sws-text-soft); cursor: pointer; border-radius: 12px; }
.panorama-dialog form > p, .panorama-dialog form > label, .panorama-dialog fieldset { margin: 18px 22px 0; }
.panorama-dialog form > p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.panorama-dialog form > label { display: grid; gap: 7px; color: var(--sws-text-soft); font-size: 12px; }
.panorama-dialog textarea { resize: vertical; line-height: 1.6; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 22px; border-top: 1px solid var(--line); padding: 16px 22px; }
.dialog-footer button { min-height: 44px; border: 1px solid #cfd4da; padding: 0 16px; background: var(--sws-surface-raised); cursor: pointer; border-radius: 12px; font-size: 13px; }
.dialog-footer .primary { border-color: var(--orange); background: var(--orange); color: #20150d; }
.dialog-footer [data-unpublish] { margin-right: auto; color: var(--danger); }
.dialog-error { min-height: 18px; color: var(--danger) !important; }
.panorama-dialog fieldset { display: grid; gap: 8px; border: 0; padding: 0; }
.panorama-dialog legend { margin-bottom: 9px; color: var(--sws-text-soft); font-size: 12px; }
.panorama-dialog fieldset label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); padding: 13px; cursor: pointer; border-radius: 12px; background: var(--sws-surface); }
.panorama-dialog fieldset input { width: auto; margin-top: 2px; accent-color: var(--orange); }
.panorama-dialog fieldset strong, .panorama-dialog fieldset small { display: block; }
.panorama-dialog fieldset strong { font-size: 12px; }
.panorama-dialog fieldset small { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.panorama-toast { position: fixed; z-index: 50; right: 18px; bottom: 18px; max-width: min(420px, calc(100vw - 36px)); border-left: 3px solid var(--orange); padding: 13px 16px; background: var(--sws-surface-strong); color: var(--sws-text); box-shadow: 0 18px 55px rgba(0,0,0,.28); font-size: 13px; border-radius: 12px; border: 1px solid var(--line-strong); }

@media (max-width: 1080px) {

 body { overflow: auto;
 }

 .panorama-shell { height: auto; min-height: calc(100svh - 72px);
 }

 .panorama-editor { height: auto; min-height: calc(100svh - 72px); grid-template-columns: 220px minmax(0,1fr); grid-template-rows: minmax(520px,65svh) auto;
 }

 .viewer-panel { min-height: 520px;
 }

 .settings-panel { position: static; width: auto; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-left: 1px solid var(--line); box-shadow: none;
 }

 .settings-panel > section { border-bottom: 0;
 }

 .scene-panel { max-height: 65svh;
 }
}
@media (max-width: 720px) {

 .panorama-topbar { position: sticky; top: 0; z-index: 20; height: auto; min-height: 72px; padding: 12px; flex-wrap: wrap; gap: 12px;
 }

 .panorama-identity { gap: 10px; flex: 1 1 auto;
 }

 .product-name, .project-heading small { display: none;
 }

 .topbar-actions { width: 100%; justify-content: flex-end;
 }

 .project-heading { margin-left: 0;
 }

 .project-heading strong { max-width: 160px;
 }

 .panorama-shell { height: auto;
 }

 .panorama-editor { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(420px,60svh) auto auto; padding: 12px; gap: 12px;
 }

 .viewer-panel { grid-row: 1; min-height: 420px;
 }

 .scene-panel { position: static; width: auto; max-height: 320px; border: 1px solid var(--line); box-shadow: none;
 }

 .settings-panel { position: static; grid-template-columns: 1fr; max-height: none;
 }

 .viewer-toolbar { width: calc(100% - 24px); bottom: 12px; overflow-x: auto;
 }

 .viewer-toolbar span { display: none;
 }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (hover: hover) and (pointer: fine) {

 .topbar-actions :is(a,button):hover:not(:disabled) { border-color: var(--sws-accent); background: var(--sws-accent-soft);
 }

 .upload-button:hover { border-color: var(--sws-accent);
 }
}
