/* ===== UYA 3D Review — 监修预览页专用样式 ===== */
:root {
  --bg: #eceef1;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.88);
  --text: #1a1d21;
  --text-sub: #6b7178;
  --line: #dfe2e7;
  --accent: #1a1d21;
  --danger: #b42318;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(20, 24, 31, 0.14);
}
body.dark {
  --bg: #14161a;
  --surface: #1e2126;
  --surface-glass: rgba(30, 33, 38, 0.88);
  --text: #e8eaed;
  --text-sub: #9aa1a9;
  --line: #343941;
  --accent: #e8eaed;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.rv-body {
  font-family: "Helvetica Neue", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease;
}

/* ---------- 顶栏 ---------- */
.rv-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.rv-brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.rv-brand .mark { font-weight: 800; font-size: 16px; letter-spacing: .12em; }
.rv-brand .sub { font-size: 10px; letter-spacing: .24em; color: var(--text-sub); }
.rv-title { min-width: 0; }
.rv-title h1 {
  font-size: 14px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rv-title .meta { font-size: 11px; color: var(--text-sub); margin-top: 1px; }
.rv-title .badge {
  display: inline-block; font-size: 10px; border-radius: 4px; padding: 1px 6px;
  margin-left: 8px; vertical-align: 1px; letter-spacing: .05em;
}
.badge-wip { background: #fdf3e0; color: #b7791f; }
body.dark .badge-wip { background: #43351a; color: #e0b25c; }
.badge-review { background: #e8f0fd; color: #2b6cb0; }
body.dark .badge-review { background: #1d3252; color: #7fb0ef; }
.badge-prep { background: #eceef1; color: #6b7178; }
body.dark .badge-prep { background: #2a2e34; color: #9aa1a9; }

/* ---------- 準備中占位（无模型时） ---------- */
.rv-comingsoon {
  position: absolute; inset: 0; display: none; z-index: 6;
  align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  font-size: 14px; color: var(--text-sub); background: var(--bg);
}
.rv-comingsoon strong { font-size: 16px; color: var(--text); letter-spacing: .04em; }
.rv-comingsoon.show { display: flex; }
body.no-model .rv-controls,
body.no-model .rv-views { display: none; }
.rv-actions { display: flex; gap: 6px; flex-shrink: 0; }

.rv-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 7px; padding: 6px 11px; font-size: 12px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.rv-btn:hover { background: var(--bg); }
.rv-btn:active { transform: translateY(1px); }
.rv-btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.rv-btn.primary:hover { opacity: .88; }

/* ---------- 查看器 ---------- */
.rv-stage { position: fixed; inset: 0; }
model-viewer.rv-viewer {
  width: 100%; height: 100%;
  --poster-color: transparent;
  background: var(--bg);
}
.rv-progress {
  position: absolute; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent); transition: width .2s ease; z-index: 5;
}
.rv-error {
  position: absolute; inset: 0; display: none; z-index: 6;
  align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  font-size: 14px; color: var(--danger); background: var(--surface);
}
.rv-error.show { display: flex; }

/* ---------- 焦距 / 灯光 / 曝光控制（左下，视角按钮上方） ---------- */
.rv-controls {
  position: fixed; left: 16px; bottom: 60px; z-index: 25;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.ctl-row {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.ctl-label {
  font-size: 11px; color: var(--text-sub); letter-spacing: .03em;
  background: var(--surface-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
  white-space: nowrap;
}
.ctl-unit { font-size: 11px; color: var(--text-sub); margin-left: 2px; }
.rv-btn.ctl { padding: 4px 9px; font-size: 11.5px; background: var(--surface-glass); backdrop-filter: blur(8px); }
.rv-btn.ctl.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ctl-sliders input[type="range"] {
  width: 110px; height: 4px; accent-color: var(--accent); cursor: pointer;
}

/* ---------- 预设视角（左下） ---------- */
.rv-views {
  position: fixed; bottom: 16px; left: 16px; z-index: 25;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.rv-views .rv-btn { background: var(--surface-glass); backdrop-filter: blur(8px); }

/* ---------- 监修面板（右） ---------- */
.rv-panel {
  position: fixed; top: 58px; right: 0; bottom: 16px; width: 300px; z-index: 25;
  background: var(--surface-glass); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-right: none;
  border-radius: 12px 0 0 12px;
  transition: transform .28s ease;
  overflow-y: auto;
  padding: 14px 16px 16px;
}
.rv-panel.collapsed { transform: translateX(calc(100% + 1px)); }
.rv-panel-toggle {
  position: absolute; top: 12px; left: -36px;
  width: 36px; height: 36px; border-radius: 9px 0 0 9px;
  background: var(--surface-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-right: none;
  cursor: pointer; display: grid; place-items: center;
  font-size: 13px; color: var(--text);
}
.rv-panel h3 {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 10px;
  color: var(--text-sub);
}
.rv-section { margin-bottom: 18px; }
.rv-info { font-size: 12.5px; line-height: 1.9; }
.rv-info b { font-weight: 600; }
.rv-check { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 13px; cursor: pointer; }
.rv-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.rv-check input:checked + span { color: var(--text-sub); text-decoration: line-through; }
.rv-textarea {
  width: 100%; min-height: 110px; resize: vertical;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font-size: 13px; line-height: 1.6;
  font-family: inherit;
}
.rv-textarea:focus { outline: none; border-color: var(--accent); }
.rv-hint { font-size: 11px; color: var(--text-sub); margin-top: 6px; }

/* ---------- 底部提示条 ---------- */
.rv-footer-note {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  font-size: 11px; color: var(--text-sub);
  background: var(--surface-glass); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px;
  white-space: nowrap;
}
body.panel-open .rv-footer-note { left: calc((100% - 300px) / 2); }

/* ---------- 操作提示 toast ---------- */
.rv-toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
  background: #23262b; color: #fff; padding: 9px 16px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.7; text-align: center;
  opacity: 0; transition: opacity .4s; z-index: 40; pointer-events: none;
}
.rv-toast.show { opacity: .92; }

/* ---------- 状态弹层（反馈导出确认） ---------- */
.rv-modal-mask {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center;
  background: rgba(10, 12, 16, .45); backdrop-filter: blur(2px);
}
.rv-modal-mask.show { display: flex; }
.rv-modal {
  width: min(92vw, 480px); max-height: 80vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
}
.rv-modal h2 { font-size: 15px; margin-bottom: 10px; }
.rv-modal pre {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 11.5px; line-height: 1.7; white-space: pre-wrap;
  font-family: Consolas, "Courier New", monospace;
  max-height: 320px; overflow: auto; color: var(--text);
}
.rv-modal .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

@media (max-width: 768px) {
  .rv-panel { width: 260px; top: 96px; }
  .rv-footer-note { display: none; }
  .rv-title .meta { display: none; }
  .rv-btn { padding: 5px 8px; font-size: 11px; }
  .rv-controls { bottom: 54px; max-width: calc(100vw - 32px); }
  .ctl-sliders input[type="range"] { width: 80px; }
}
