* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  margin: 0; 
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#mainMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  overflow-x: hidden;
}

.cards-stack {
  position: relative;
  width: 680px;
  height: 1200px;
  perspective: 1200px;
  transform-style: preserve-3d;
  margin: 50px auto;
  padding: 150px 0 80px 0;
}

.card {
  position: absolute;
  width: 640px;
  height: 320px;
  background: rgba(15, 15, 20, 0.92);
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-style: preserve-3d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: visible;
  backdrop-filter: blur(10px);
  left: 50%;
  margin-left: -320px;
  transform-origin: center center;
}

/* 7张卡片，间距165px */
.card:nth-child(1) { transform: translateY(0px) rotateX(55deg); z-index: 1; opacity: 0.91; }
.card:nth-child(2) { transform: translateY(165px) rotateX(55deg); z-index: 2; opacity: 0.93; }
.card:nth-child(3) { transform: translateY(330px) rotateX(55deg); z-index: 3; opacity: 0.95; }
.card:nth-child(4) { transform: translateY(495px) rotateX(55deg); z-index: 4; opacity: 0.98; }
.card:nth-child(5) { transform: translateY(660px) rotateX(55deg); z-index: 5; opacity: 1; }
.card:nth-child(6) { transform: translateY(825px) rotateX(55deg); z-index: 6; opacity: 1; }
.card:nth-child(7) { transform: translateY(990px) rotateX(55deg); z-index: 7; opacity: 1; }

.card:hover {
  z-index: 9999 !important;
  opacity: 1 !important;
  transform: translateY(calc(var(--y-offset, 0px))) rotateX(55deg) scale(1.05);
  box-shadow:
    0 25px 70px rgba(255, 255, 255, 0.3),
    0 15px 40px rgba(255, 255, 255, 0.2);
}

/* hover时的偏移量 */
.card:nth-child(1) { --y-offset: 0px; }
.card:nth-child(2) { --y-offset: 165px; }
.card:nth-child(3) { --y-offset: 330px; }
.card:nth-child(4) { --y-offset: 495px; }
.card:nth-child(5) { --y-offset: 660px; }
.card:nth-child(6) { --y-offset: 825px; }
.card:nth-child(7) { --y-offset: 990px; }

.card-inner {
  width: 100%;
  height: 100%;
  padding: 28px 35px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  position: relative;
}

.card-icon-placeholder {
  width: 52px;
  height: 52px;
  background: rgba(10, 10, 15, 0.5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-info h3 { font-size: 24px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.card-info p { font-size: 13px; color: rgba(255, 255, 255, 0.6); }

.card-badge {
  position: absolute;
  bottom: 22px;
  right: 25px;
  font-size: 48px;
  font-weight: 100;
  color: rgba(255, 255, 255, 0.95);
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
}

.menu-title-wrapper {
  position: absolute;
  top: 30px;
  left: 40px;
  text-align: left;
}

.menu-title-en {
  color: #fff;
  font-size: 28px;
  font-weight: 200;
  letter-spacing: 6px;
  opacity: 0.85;
  margin: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.menu-title-cn {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 200;
  letter-spacing: 4px;
  opacity: 0.7;
  margin: 4px 0 0 0;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

#sceneContainer {
  display: none;
  width: 100%;
  height: 100vh;
}

#sceneContainer canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#controls {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 12px;
  border-radius: 0;
  font-size: 11px;
  z-index: 100;
  min-width: 140px;
  max-width: 180px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#controls.collapsed {
  min-width: 36px;
  max-width: 36px;
  padding: 8px 6px;
  overflow: hidden;
}

#controls .controls-tab-trigger {
  position: absolute;
  top: 50%;
  right: -72px;
  transform: translateY(-50%);
  background: rgba(10, 10, 15, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#controls.collapsed .controls-tab-trigger {
  opacity: 1;
  pointer-events: auto;
}

#controls.collapsed .controls-tab-trigger:hover {
  transform: translateY(-50%) translateX(3px);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.6);
}

#controls.collapsed .control-section,
#controls.collapsed h3,
#controls.collapsed p,
#controls.collapsed button:not(.controls-collapse-btn),
#controls.collapsed input,
#controls.collapsed #status,
#controls.collapsed #transformControls {
  display: none;
}

#controls.collapsed .controls-collapse-btn {
  display: flex !important;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

#controls h3 {
  font-size: 13px;
  margin: 0 0 6px 0;
  font-weight: 600;
  color: rgba(220, 220, 230, 0.9);
}

#controls button,
#controls .control-section button {
  padding: 6px 8px;
  background: rgba(20, 20, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  width: 100%;
  margin-top: 5px;
  transition: all 0.2s ease;
}

#controls button:hover {
  background: rgba(30, 30, 35, 0.8);
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
}

#controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#controls .transform-mode-btn {
  flex: 1;
  min-width: 60px;
  padding: 6px 8px !important;
  font-size: 10px !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 !important;
  margin-right: 4px;
  margin-top: 0 !important;
}
#controls .transform-mode-btn:last-child {
  margin-right: 0;
}
#controls .transform-mode-btn.active {
  background: rgba(30, 30, 35, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: white !important;
}

.controls-collapse-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(20, 20, 25, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 9px !important;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.controls-collapse-btn:hover {
  background: rgba(30, 30, 35, 0.8) !important;
}

.control-section { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.control-section:last-child { border-bottom: none; }

button {
  padding: 8px 14px;
  background-color: rgba(20, 20, 25, 0.7);
  color: white;
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
  margin-top: 5px;
}

#exitBtn {
  position: fixed;
  top: 10px;
  left: 200px;
  width: auto;
  padding: 8px 16px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 9999;
}

#exitBtn:hover {
  background: rgba(20, 20, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.35);
}

#objectPanel {
  position: absolute;
  top: 30%;
  right: 10px;
  transform: translateY(-50%);
  background: rgba(10, 10, 15, 0.85);
  color: white;
  padding: 15px;
  border-radius: 0;
  font-size: 12px;
  width: 270px;
  display: none;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  z-index: 997;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
#objectPanel.active { display: block; }

.transform-group { margin-bottom: 12px; background: rgba(10, 10, 15, 0.4); padding: 10px; border-radius: 0; }
.transform-input { display: flex; gap: 5px; margin-bottom: 4px; }
.transform-input input[type="range"] { flex: 1; }
.transform-input input[type="number"] { width: 55px; background: rgba(10, 10, 15, 0.7); border: 1px solid rgba(255, 255, 255, 0.15); color: white; }

#contextMenu {
  position: fixed;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  padding: 12px;
  z-index: 10001;
  display: none;
  min-width: 240px;
}

#aiGenerateBtn { background-color: rgba(20, 20, 25, 0.7); margin-top: 8px; }

#aiToolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 280px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  color: white;
  z-index: 1000;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: width 0.3s ease;
}

#aiToolbar.collapsed {
  width: 36px;
  overflow: hidden;
}

#aiToolbar.collapsed .ai-toolbar-header h3,
#aiToolbar.collapsed .ai-toolbar-buttons,
#aiToolbar.collapsed .ai-panel-content {
  display: none;
}

#aiToolbar.collapsed .ai-collapse-btn {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.ai-tab-trigger {
  position: absolute;
  top: 50%;
  left: -72px;
  transform: translateY(-50%);
  background: rgba(10, 10, 15, 0.85);
  color: white;
  padding: 8px 12px;
  border-radius: 0 0 0 0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#aiToolbar.collapsed .ai-tab-trigger {
  opacity: 1;
  pointer-events: auto;
}

.ai-tab-trigger:hover {
  transform: translateY(-50%) translateX(-3px);
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.6);
}

.ai-toolbar-header {
  padding: 10px 14px;
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-toolbar-header h3 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
}

.ai-collapse-btn {
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(20, 20, 25, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 10px !important;
  cursor: pointer !important;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ai-collapse-btn:hover {
  background: rgba(30, 30, 35, 0.8) !important;
}

.ai-toolbar-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 12px !important;
  width: 100% !important;
  margin: 0 !important;
}

.ai-tool-btn:hover {
  background: rgba(30, 30, 35, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

.ai-tool-btn.active {
  background: rgba(100, 100, 110, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: white !important;
}

.ai-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.ai-label {
  font-size: 12px;
  font-weight: 500;
}

.ai-panel-content {
  display: none;
  padding: 18px;
}

.ai-panel-content.active { display: block; }

.ai-panel-content > label {
  display: block;
  font-size: 11px;
  color: rgba(220, 220, 230, 0.9);
  margin-bottom: 6px;
}

.ai-panel-content textarea {
  width: 100%;
  padding: 8px;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  color: white;
  resize: vertical;
  font-size: 12px;
  margin-bottom: 10px;
  font-family: inherit;
}

.ai-panel-content textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
}

.ai-options-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-options-mini select,
.ai-options-mini input[type="number"] {
  flex: 1;
  min-width: calc(50% - 3px);
  padding: 6px 8px;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  color: white;
  font-size: 11px;
}

.upload-area-mini {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 0;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

.upload-area-mini:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

.upload-label-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  cursor: pointer;
  color: rgba(220, 220, 230, 0.7);
  font-size: 13px;
}

.voice-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.voice-btn {
  flex: 1;
  padding: 10px !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: white !important;
  font-size: 12px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
}

.voice-btn.recording {
  animation: pulse 1s infinite;
  background: rgba(100, 100, 110, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.voice-upload-label {
  padding: 10px 15px !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  font-size: 12px !important;
  color: white !important;
}

.voice-preview {
  background: rgba(10, 10, 15, 0.5);
  padding: 10px;
  border-radius: 0;
  margin-bottom: 10px;
}

.voice-preview audio {
  width: 100%;
  height: 32px;
  margin-bottom: 6px;
}

.transcript-text {
  font-size: 11px;
  color: rgba(220, 220, 230, 0.8);
  font-style: italic;
  margin: 0;
}

.ai-submit-btn {
  width: 100% !important;
  padding: 8px !important;
  background: rgba(100, 100, 110, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: white !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.ai-submit-btn:hover {
  background: rgba(120, 120, 130, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  transform: translateY(-1px);
}

.ai-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  transform: none !important;
}

#aiProgressArea {
  padding: 15px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-bar-mini {
  width: 100%;
  height: 6px;
  background: rgba(10, 10, 15, 0.5);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-text-mini {
  font-size: 12px;
  color: rgba(220, 220, 230, 0.9);
  margin: 0;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #808080, #B0B0B0);
  border-radius: 0;
  transition: width 0.3s ease;
  box-shadow: 0 0 4px rgba(128, 128, 128, 0.25);
}

.progress-fill.complete {
  background: linear-gradient(90deg, #0066FF, #4499FF) !important;
  box-shadow: 0 0 4px rgba(0, 102, 255, 0.3) !important;
}

#aiResultArea {
  padding: 15px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.result-title {
  color: #0066FF;
  margin-bottom: 10px;
  font-size: 16px;
}

.result-preview-mini img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 0;
  margin-bottom: 10px;
}

.result-actions-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.action-btn-mini {
  padding: 10px !important;
  background: rgba(20, 20, 25, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: white !important;
  font-size: 12px !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.action-btn-mini.primary {
  background: rgba(100, 100, 110, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.action-btn-mini:hover {
  transform: translateY(-1px);
}

/* 白色线框图标系统 */
.btn-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  top: -1px;
}

.btn-icon-sm {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.btn-icon-lg {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 时间轴 */
.timeline {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(calc(100% - 28px));
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline.visible {
  transform: translateY(-50%) translateX(0);
}

.timeline-toggle {
  width: 28px;
  height: 60px;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-radius: 0 0 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.timeline-toggle:hover {
  background: rgba(255, 0, 0, 0.35);
}

.timeline-content {
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-right: none;
  border-radius: 0 0 0 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.timeline-title {
  color: rgba(220, 220, 230, 0.8);
  font-size: 11px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 4px;
  margin-bottom: 4px;
}

.timeline-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.timeline-line {
  width: 2px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 10, 15, 0.85);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.timeline-dot:hover {
  transform: scale(1.1);
}

.timeline-dot.active {
  background: rgba(255, 0, 0, 0.2);
}

.dot-year {
  color: white;
  font-size: 10px;
  font-weight: bold;
}

.timeline-dot.active .dot-year {
  color: #FF0000;
}

#sceneLoadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.8s ease;
}

#sceneLoadingOverlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loading-ring {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top: 3px solid rgba(255, 255, 255, 1);
  border-right: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
  position: relative;
}

.loading-ring::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  animation: spin 1.2s linear infinite reverse;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.3), 0 0 80px rgba(255, 255, 255, 0.15);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { 
    opacity: 0.6; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 255, 255, 0.15);
  }
  50% { 
    opacity: 1; 
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.3), 0 0 80px rgba(255, 255, 255, 0.15);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.mode-switch-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 10000;
  background: rgba(10, 10, 15, 0.88);
  padding: 10px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-row-admin {
  gap: 8px;
}

.mode-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 30, 35, 0.6);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  font-weight: 500;
}

.mode-btn.active {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
  color: #FF0000;
}

.mode-btn:hover {
  background: rgba(50, 50, 55, 0.8);
  color: #fff;
}

.mode-btn.active:hover {
  background: rgba(255, 0, 0, 0.3);
  color: #FF0000;
}

.mode-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.mode-label.active {
  color: rgba(220, 220, 230, 0.95);
}

.mode-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  cursor: pointer;
}

.mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20, 20, 25, 0.95);
  border: 1px solid rgba(160, 160, 180, 0.4);
  border-radius: 11px;
  transition: all 0.3s ease;
}

.mode-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: rgba(220, 220, 230, 0.9);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mode-switch input:checked + .mode-slider {
  background: rgba(20, 20, 25, 0.95);
  border-color: rgba(160, 160, 180, 0.6);
}

.mode-switch input:checked + .mode-slider::before {
  transform: translateX(22px);
  background: rgba(220, 220, 230, 0.9);
}

#adminPanel {
  position: absolute;
  top: 80px;
  left: 40px;
  right: 40px;
  bottom: 40px;
  background: rgba(10, 10, 12, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  z-index: 5;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.admin-header {
  padding: 24px 30px;
  background: rgba(15, 15, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: rgba(220, 220, 230, 0.95);
  margin: 0;
}

.admin-header p {
  font-size: 12px;
  color: rgba(160, 160, 180, 0.7);
  margin: 6px 0 0 0;
}

.admin-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px 30px;
}

.admin-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: rgba(220, 220, 230, 0.9);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-list {
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}

.admin-list::-webkit-scrollbar {
  width: 4px;
}

.admin-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.admin-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
}

.admin-empty {
  padding: 30px;
  text-align: center;
  color: rgba(160, 160, 180, 0.4);
  font-size: 12px;
}

.admin-item {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: rgba(200, 200, 210, 0.85);
  transition: background 0.2s ease;
}

.admin-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.admin-item-field {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}

.admin-item-label {
  color: rgba(160, 160, 180, 0.6);
  font-size: 11px;
}

.admin-item-value {
  color: rgba(220, 220, 230, 0.9);
  font-weight: 500;
}

.admin-item-value.highlight {
  color: #FF0000;
}

.admin-item-value.highlight-old {
  color: #0066FF;
}

#commentModeBtn {
  background: rgba(60, 60, 70, 0.7);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  width: 100%;
}

#commentModeBtn:hover {
  background: rgba(80, 80, 90, 0.8);
}

#commentModeBtn.active {
  background: rgba(255, 0, 0, 0.25);
  border-color: rgba(255, 0, 0, 0.5);
  color: #FF0000;
}

#commentDialog {
  position: fixed;
  z-index: 100000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
}

.comment-dialog-header {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}

#commentInput {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  padding: 10px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: inherit;
}

#commentInput:focus {
  border-color: rgba(255, 0, 0, 0.5);
}

#commentInput::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.comment-dialog-btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

#commentCancelBtn {
  background: rgba(60, 60, 70, 0.6);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

#commentCancelBtn:hover {
  background: rgba(80, 80, 90, 0.7);
}

#commentSubmitBtn {
  background: rgba(255, 0, 0, 0.2);
  color: #FF0000;
  border: 1px solid rgba(255, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

#commentSubmitBtn:hover {
  background: rgba(255, 0, 0, 0.35);
}

.comment-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #FF0000;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100001;
  border: 1px solid rgba(255, 0, 0, 0.3);
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#loginOverlay, #adminLoginOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: rgba(15, 15, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.login-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.login-tab.active {
  color: #FF0000;
  border-bottom-color: #FF0000;
}

.login-tab:hover {
  color: rgba(255, 255, 255, 0.8);
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.login-form input:focus {
  border-color: rgba(255, 0, 0, 0.5);
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.login-submit-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.4);
  border-radius: 10px;
  color: #FF0000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.login-submit-btn:hover {
  background: rgba(255, 0, 0, 0.35);
}

.login-msg {
  text-align: center;
  font-size: 12px;
  margin-top: 12px;
  min-height: 18px;
}

.login-msg.success { color: #0066FF; }
.login-msg.error { color: #f44336; }

.login-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.login-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-login-title {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 20px 0;
}

#adminLoginOverlay .login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

#adminLoginOverlay .login-card input:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

.admin-logout-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 6px 16px;
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
  border-radius: 8px;
  color: #f44336;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-logout-btn:hover {
  background: rgba(244, 67, 54, 0.3);
}

.ranking-toggle-btn {
  position: fixed;
  bottom: 24px;
  left: 0;
  z-index: 10000;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 15, 0.85);
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ranking-toggle-btn:hover {
  background: rgba(255, 0, 0, 0.15);
  border-color: rgba(255, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.85);
}

#rankingPanel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  background: rgba(5, 5, 10, 0.95);
  backdrop-filter: blur(20px);
  overflow-y: auto;
  visibility: hidden;
  pointer-events: none;
}

.ranking-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: rgba(5, 5, 10, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10;
}

.ranking-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: #FF0000;
  margin: 0;
}

.ranking-header p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

.ranking-close-btn {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 30, 35, 0.6);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ranking-close-btn:hover {
  background: rgba(244, 67, 54, 0.3);
  border-color: rgba(244, 67, 54, 0.5);
  color: #f44336;
}

.ranking-content {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-empty {
  text-align: center;
  color: rgba(160, 160, 180, 0.4);
  font-size: 14px;
  padding: 60px 20px;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(20, 20, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.ranking-item:hover {
  background: rgba(30, 30, 40, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.ranking-item.rank-gold {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.06);
}

.ranking-item.rank-silver {
  border-color: rgba(192, 192, 192, 0.3);
  background: rgba(192, 192, 192, 0.04);
}

.ranking-item.rank-bronze {
  border-color: rgba(205, 127, 50, 0.3);
  background: rgba(205, 127, 50, 0.04);
}

.ranking-rank {
  font-size: 22px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.rank-gold .ranking-rank { color: #0066FF; }
.rank-silver .ranking-rank { color: #C0C0C0; }
.rank-bronze .ranking-rank { color: #0066FF; }

.ranking-info {
  flex: 1;
  min-width: 0;
}

.ranking-model-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-scene {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}

.ranking-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ranking-stat {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.ranking-score {
  font-size: 13px;
  font-weight: 700;
  color: #FF0000;
  min-width: 50px;
  text-align: right;
}

.ranking-like-btn {
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(40, 40, 45, 0.6);
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ranking-like-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.4);
  color: #f44336;
}

@media (max-width: 768px) {
  .cards-stack {
    width: 100%;
    height: auto;
    padding: 120px 0 80px 0;
    margin: 0;
  }

  .card {
    width: 90vw !important;
    height: 200px !important;
    margin-left: -45vw !important;
    left: 50% !important;
    border-radius: 10px;
  }

  .card[data-scene="zone_2026"] {
    width: 90vw !important;
    height: 240px !important;
    margin-left: -45vw !important;
  }

  .card:nth-child(1) { transform: translateY(0px) rotateX(45deg); }
  .card:nth-child(2) { transform: translateY(120px) rotateX(45deg); }
  .card:nth-child(3) { transform: translateY(240px) rotateX(45deg); }
  .card:nth-child(4) { transform: translateY(360px) rotateX(45deg); }
  .card:nth-child(5) { transform: translateY(480px) rotateX(45deg); }
  .card:nth-child(6) { transform: translateY(600px) rotateX(45deg); }
  .card:nth-child(7) { transform: translateY(720px) rotateX(45deg); }

  .card-inner {
    padding: 16px 20px;
  }

  .card-info h3 { font-size: 18px; }
  .card-info p { font-size: 11px; }
  .card-badge { font-size: 32px; bottom: 14px; right: 16px; }

  .menu-title-wrapper {
    top: 16px;
    left: 16px;
  }

  .menu-title-en { font-size: 22px; letter-spacing: 4px; }
  .menu-title-cn { font-size: 11px; letter-spacing: 2px; }

  .mode-switch-wrapper {
    bottom: 12px;
    right: 8px;
    padding: 6px 10px;
    gap: 4px;
    border-radius: 20px;
  }

  .mode-btn {
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 12px;
  }

  .mode-label { font-size: 10px; }
  .mode-switch { width: 36px; height: 18px; }
  .mode-slider::before { width: 12px; height: 12px; }
  .mode-switch input:checked + .mode-slider::before { transform: translateX(18px); }

  #adminPanel {
    top: 50px;
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .admin-content {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  #controls {
    top: 4px;
    left: 4px;
    min-width: 120px;
    max-width: 150px;
    padding: 8px;
    font-size: 10px;
  }

  #aiToolbar {
    right: 4px;
    width: 220px;
  }

  #objectPanel {
    width: 240px;
    right: 4px;
  }

  #exitBtn {
    top: 4px;
    left: 130px;
    padding: 6px 12px;
    font-size: 11px;
  }

  .login-card {
    width: 320px;
    padding: 24px;
  }
}