:root {
  color-scheme: light;
  --page: #f4f1e9;
  --paper: #fffdf8;
  --ink: #242521;
  --muted: #827f75;
  --line: #e5e0d6;
  --accent: #ed6b31;
  --accent-dark: #b94b21;
  --accent-pale: #fcf0e7;
  --stage: #dedfd9;
  --radius: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
button { touch-action: manipulation; }
button svg, .selected-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button:disabled { cursor: wait; opacity: 0.45; }
[hidden] { display: none !important; }
.app-shell { max-width: 1920px; margin: auto; padding: 0 24px; }
.app-header { height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 38px; height: 43px; display: grid; place-items: center; color: var(--accent); }
.brand-mark svg { width: 34px; height: 34px; }
.brand strong { display: block; font-size: 17px; letter-spacing: 2.6px; font-weight: 750; line-height: 1.2; }
.brand-subtitle { display: block; margin-top: 5px; font-size: 11px; letter-spacing: 1.1px; color: var(--muted); }
.project-meta { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.project-meta strong { color: #5e6057; font-weight: 550; font-variant-numeric: tabular-nums; margin-left: 5px; }
.project-dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.meta-divider { color: #c8c0b2; margin: 0 14px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 18px; align-items: stretch; }
.preview-panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px 16px; gap: 20px; }
.eyebrow { display: block; color: #9b978a; font-size: 9px; letter-spacing: 2px; font-weight: 650; }
h1, h2, p { margin: 0; }
h1 { font-weight: 600; font-size: 18px; letter-spacing: 0.7px; margin-top: 6px; }
.icon-button { display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; }
.icon-button:hover { background: #f0ede5; }
.view-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 14px; }
.view-tabs { display: flex; gap: 3px; border-radius: 8px; background: #f1eee7; padding: 3px; }
.view-button { display: flex; align-items: center; justify-content: center; gap: 5px; background: none; border: 0; padding: 7px 11px; font-size: 12px; color: #7d7b70; border-radius: 6px; white-space: nowrap; transition: background .16s, color .16s; }
.view-button svg { width: 15px; height: 15px; }
.view-button:hover { color: var(--ink); }
.view-button.is-active, .view-button.active, .view-button.selected, .view-button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px #2425210c; }
.scene-tools { display: flex; align-items: center; gap: 2px; }
.tool-button { display: flex; align-items: center; gap: 4px; padding: 6px 8px; color: #858177; background: transparent; border: 0; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.tool-button svg { width: 15px; height: 15px; }
.tool-button:hover { background: #efebe2; color: var(--ink); }
.tool-button[aria-pressed="true"] { color: #54574d; }
.canvas-wrap { position: relative; flex: 1; min-height: 564px; isolation: isolate; background: var(--stage); overflow: hidden; }
#viewer { position: absolute; inset: 0; overflow: hidden; touch-action: none; z-index: 1; }
#viewer canvas { display: block; width: 100%; height: 100%; outline: none; }
.viewport-caption { position: absolute; top: 19px; left: 21px; display: flex; align-items: center; gap: 7px; z-index: 4; pointer-events: none; color: #676d62; font-size: 10px; letter-spacing: 1px; }
.live-dot { width: 4px; height: 4px; border-radius: 50%; background: #7d8874; }
.selected-surface { position: absolute; left: 20px; bottom: 20px; z-index: 4; display: flex; align-items: center; gap: 11px; max-width: calc(100% - 40px); padding: 13px 17px; border: 1px solid #ffffffc2; border-radius: 10px; background: #fffdf3e8; box-shadow: 0 5px 20px #2c2e2108; pointer-events: none; backdrop-filter: blur(12px); }
.selected-icon { display: grid; place-items: center; color: var(--accent); width: 28px; height: 30px; flex-shrink: 0; }
.selected-surface strong { display: block; font-size: 12px; font-weight: 600; }
.selected-surface p { font-size: 11px; color: #969180; margin-top: 5px; line-height: 1.5; }
.viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 22px; font-size: 11px; color: #999485; min-height: 37px; }
.viewer-mode { color: #beb8aa; white-space: nowrap; letter-spacing: .7px; }
.loading-overlay { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; background: #e7e7deee; backdrop-filter: blur(8px); }
.loading-overlay strong { font-size: 14px; font-weight: 600; letter-spacing: .4px; margin-top: 10px; }
.loading-overlay > span { font-size: 11px; color: var(--muted); }
.loading-spinner { width: 34px; height: 34px; border: 2px solid #cfcabd; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-track { height: 2px; width: 142px; border-radius: 2px; overflow: hidden; background: #ceccbf; margin-top: 6px; }
#loadProgress { display: block; width: 0%; height: 100%; background: var(--accent); transition: width .18s; }
.error-message { position: absolute; z-index: 9; top: 55px; left: 20px; right: 20px; padding: 14px 18px; color: #933e1f; background: #fff4e7; border: 1px solid #dba788; border-radius: 9px; font-size: 12px; line-height: 1.7; }
.hotspot, .scene-label, .surface-label { position: absolute; z-index: 3; transform: translate(-50%, -50%); display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid #ffffffea; border-radius: 50%; background: var(--accent); color: white; font-weight: 650; font-size: 12px; box-shadow: 0 2px 10px #35291c33; cursor: pointer; pointer-events: auto; }
.hotspot:hover, .scene-label:hover, .surface-label:hover { background: var(--accent-dark); }
.hotspot.selected, .scene-label.selected, .surface-label.selected, .hotspot.is-selected, .scene-label.is-selected, .surface-label.is-selected { box-shadow: 0 0 0 5px #ee6a3133, 0 2px 10px #35291c33; }
.asset-panel { padding: 22px 20px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.asset-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: .6px; margin-top: 6px; }
.count-badge { font-size: 10px; background: #f3eee2; padding: 5px 8px; color: #8d8676; border-radius: 6px; white-space: nowrap; }
.asset-intro { margin-top: 13px; margin-bottom: 20px; font-size: 11px; color: #8e887a; line-height: 1.9; }
.slot-list { display: grid; gap: 9px; }
.slot-card { position: relative; padding-bottom: 28px; border: 1px solid var(--line); border-radius: 9px; background: #fffefa; overflow: hidden; transition: border-color .16s, background .16s; }
.slot-card:hover { border-color: #cebea8; }
.slot-select { display: flex; align-items: flex-start; gap: 11px; padding: 13px 12px 0; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; }
.slot-number { width: 26px; height: 28px; display: grid; place-items: center; flex-shrink: 0; color: #aaa28f; font-size: 13px; letter-spacing: .3px; font-weight: 500; font-variant-numeric: tabular-nums; border-right: 1px solid #e6e0d4; padding-right: 11px; margin-right: 1px; }
.slot-content { flex: 1; min-width: 0; }
.slot-content strong { display: block; font-size: 12px; font-weight: 600; line-height: 1.35; letter-spacing: .4px; }
.slot-size { display: block; margin-top: 5px; font-size: 12px; color: #626357; letter-spacing: .1px; font-variant-numeric: tabular-nums; }
.slot-content small, .reference-card small { font-size: 10px; color: #a09a8b; font-weight: normal; }
.slot-pixels { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 10px; color: #a59c89; font-variant-numeric: tabular-nums; }
.ratio { display: inline-block; padding-left: 5px; margin-left: auto; color: #b4ac9b; font-size: 10px; }
.slot-chevron { width: 13px; height: 13px; color: #c0b6a2; margin-top: 4px; }
.slot-upload { position: absolute; right: 12px; bottom: 7px; display: flex; align-items: center; gap: 4px; background: none; border: 0; color: #aaa18e; font-size: 10px; padding: 1px 0; }
.slot-upload svg { width: 11px; height: 11px; stroke-width: 1.4; }
.slot-upload:hover { color: var(--accent-dark); }
.banner-preview-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin: 12px 12px 0; }
.banner-preview-options button { min-width: 0; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); text-align: left; }
.banner-preview-options img { display: block; width: 100%; aspect-ratio: 52/15; object-fit: fill; background: #3a3e43; border-radius: 3px; }
.banner-preview-options span { display: block; padding: 5px 3px 2px; font-size: 11px; }
.banner-preview-options button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-dark); box-shadow: 0 0 0 1px var(--accent); }
.banner-preview-note { margin: 8px 12px 0; font-size: 10px; line-height: 1.6; color: #827f75; }
.banner-flat-link { display: inline-block; margin: 5px 12px 7px; font-size: 10px; color: var(--accent-dark); text-decoration: none; }
.banner-flat-link:hover { text-decoration: underline; }
.slot-card:has(.slot-select[aria-pressed="true"]), .slot-card:has(.slot-select.selected), .slot-card:has(.slot-select.is-selected), .slot-card:has(.slot-select.active) { background: var(--accent-pale); border-color: #e5a687; }
.slot-select[aria-pressed="true"] .slot-number, .slot-select.selected .slot-number, .slot-select.is-selected .slot-number, .slot-select.active .slot-number { color: var(--accent); border-right-color: #e7c9b7; }
.slot-select[aria-pressed="true"] strong, .slot-select.selected strong, .slot-select.is-selected strong, .slot-select.active strong { color: var(--accent-dark); }
.asset-spec-note { display: flex; align-items: flex-start; gap: 8px; margin: 15px 0 13px; font-size: 10px; color: #a09a8a; line-height: 1.8; }
.note-symbol { font-size: 14px; color: #a69b87; line-height: 1.2; }
.asset-spec-note strong { font-weight: 500; color: #8e8573; }
.download-button { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #33392c; border-radius: 7px; background: #33392c; color: #fffcf4; width: 100%; min-height: 36px; font-size: 11px; letter-spacing: .6px; transition: background .16s; }
.download-button svg { width: 14px; height: 14px; }
.download-button:hover { background: #21251b; }
.reference-card { display: flex; gap: 11px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.reference-card img { width: 43px; height: 65px; border-radius: 4px; object-fit: cover; object-position: center; background: #d9d4c5; flex-shrink: 0; }
.reference-card > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.reference-label { color: #8c806a; font-size: 10px; letter-spacing: .1px; }
.reference-card strong { color: #656455; font-size: 12px; font-weight: 550; }
.reference-card div > span:not(.reference-label) { color: #a49d8b; font-size: 10px; }
.reference-card p { color: #aca492; font-size: 9px; line-height: 1.5; }
.local-note { color: #b8af9d; font-size: 9px; margin-top: 11px; }
.app-footer { display: flex; align-items: center; justify-content: space-between; padding: 16px 2px 19px; gap: 20px; color: #b5ad9b; font-size: 9px; letter-spacing: .5px; }

@media (min-width: 1600px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 346px; gap: 22px; }
  .canvas-wrap { min-height: 660px; }
  .asset-panel { padding-left: 24px; padding-right: 24px; }
  .slot-card { padding-bottom: 30px; }
  .slot-select { padding-top: 15px; }
  .slot-size { margin-top: 7px; }
}
@media (max-width: 1100px) {
  .app-shell { padding: 0 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; }
  .preview-toolbar { padding-left: 17px; padding-right: 17px; }
  .view-controls { flex-wrap: wrap; padding-left: 17px; padding-right: 17px; gap: 7px; }
  .view-tabs { flex: 1; }
  .view-button { padding-left: 7px; padding-right: 7px; flex: 1; }
  .scene-tools { margin-left: auto; }
  .asset-panel { padding: 20px 16px; }
  .slot-select { gap: 8px; padding-left: 10px; padding-right: 10px; }
  .project-meta { font-size: 10px; }
  .meta-divider { margin: 0 9px; }
}
@media (max-width: 800px) {
  .app-header { height: 76px; gap: 12px; }
  .brand strong { font-size: 14px; letter-spacing: 2px; }
  .brand-subtitle { font-size: 9px; letter-spacing: .4px; }
  .brand-mark { width: 30px; }
  .brand-mark svg { width: 29px; height: 29px; }
  .project-meta { font-size: 9px; }
  .project-dot, .meta-divider { display: none; }
  .project-meta > span:last-child { display: flex; flex-direction: column; gap: 3px; text-align: right; }
  .workspace { grid-template-columns: 1fr; }
  .preview-toolbar { padding-top: 17px; padding-bottom: 12px; }
  h1 { font-size: 16px; }
  .view-controls { flex-wrap: nowrap; padding-bottom: 12px; }
  .canvas-wrap { min-height: 440px; height: 57vh; max-height: 680px; flex: none; }
  .asset-panel { padding: 20px; }
  .asset-intro { max-width: 380px; margin-bottom: 16px; }
  .slot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .slot-card:last-child { grid-column: 1 / -1; }
  .slot-card:last-child .slot-select { max-width: 310px; }
  .asset-spec-note { max-width: 350px; }
  .download-button { width: auto; min-width: 220px; padding: 0 18px; }
  .reference-card { margin-top: 17px; padding-top: 15px; }
  .local-note { margin-top: 8px; }
}
@media (max-width: 520px) {
  .app-shell { padding: 0 10px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 13px; }
  .project-meta { font-size: 8px; }
  .preview-toolbar { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 14px; letter-spacing: .3px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .view-controls { padding: 0 12px 11px; gap: 5px; flex-wrap: wrap; }
  .view-tabs { flex-basis: 100%; }
  .view-button { padding: 7px 5px; }
  .scene-tools { margin-left: 0; justify-content: flex-end; width: 100%; }
  .tool-button { font-size: 10px; padding-top: 4px; padding-bottom: 1px; }
  .canvas-wrap { min-height: 370px; height: 51vh; }
  .viewport-caption { top: 14px; left: 14px; font-size: 8px; }
  .selected-surface { left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 10px 12px; gap: 5px; }
  .selected-surface strong { font-size: 11px; }
  .selected-surface p { font-size: 9px; }
  .viewer-footer { padding: 10px 14px; font-size: 8px; }
  .viewer-mode { display: none; }
  .asset-panel { padding: 20px 16px; }
  .slot-list { grid-template-columns: 1fr; }
  .slot-card:last-child { grid-column: auto; }
  .slot-card:last-child .slot-select { max-width: none; }
  .slot-card { padding-bottom: 22px; }
  .slot-select { padding-top: 12px; }
  .slot-size { font-size: 12px; }
  .slot-pixels { font-size: 10px; }
  .slot-number { width: 31px; }
  .download-button { width: 100%; }
  .app-footer { font-size: 8px; padding-left: 3px; padding-right: 3px; }
  .app-footer > span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.download-button { text-decoration: none; }

.download-button svg { fill: none; stroke: currentColor; stroke-width: 1.55; }
