/* 基础样式 */
:root {
  --primary-color: #00f3ff;
  --secondary-color: #ff00a0;
  --accent-color: #ffcc00;
  --bg-color: #0a0a12;
  --panel-bg: rgba(20, 20, 35, 0.85);
  --text-color: #e0e0e0;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 返回链接 */
.back-link {
  position: fixed;
  top: 15px;
  left: 15px;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 20px;
  font-size: 14px;
  z-index: 100;
  transition: all var(--transition-speed);
}

.back-link:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: translateY(-2px);
}

/* 标题样式 */
.header {
  text-align: center;
  padding: 20px 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}

.title {
  font-size: 2.5rem;
  color: var(--primary-color);
  text-shadow:
    0 0 5px var(--primary-color),
    0 0 10px rgba(0, 243, 255, 0.5);
  margin-bottom: 5px;
}

.subtitle {
  font-size: 1rem;
  color: var(--secondary-color);
  opacity: 0.8;
}

/* 场景容器 */
.scene-container {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* 控制面板 */
.controls-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--panel-bg);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  box-shadow: 0 -5px 15px var(--shadow-color);
  z-index: 20;
  transition: transform var(--transition-speed);
  max-height: 80vh;
  overflow-y: auto;
}

.controls-panel:not(.expanded) .controls-content {
  display: none;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-header h3 {
  font-size: 1.2rem;
  font-weight: 500;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform var(--transition-speed);
}

.toggle-btn.active {
  transform: rotate(180deg);
}

.controls-content {
  padding: 15px 20px;
}

/* 上传区域 */
.upload-section {
  margin-bottom: 20px;
}

.primary-btn {
  background-color: var(--primary-color);
  color: var(--bg-color);
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-speed);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 243, 255, 0.3);
}

.preset-images {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.preset-image {
  width: 60px;
  height: 60px;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-speed);
  border: 2px solid transparent;
}

.preset-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-image.active {
  border-color: var(--primary-color);
  transform: scale(1.05);
  box-shadow: 0 0 10px var(--primary-color);
}

/* 滑块控制 */
.control-group {
  margin-bottom: 15px;
}

.control-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 5px var(--primary-color);
}

.value-display {
  min-width: 40px;
  text-align: right;
  font-size: 0.9rem;
}

/* 颜色控制 */
.color-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.color-option {
  flex: 1;
}

.color-option label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.color-option input[type="color"] {
  width: 100%;
  height: 30px;
  border: none;
  border-radius: 5px;
  background: none;
  cursor: pointer;
}

/* 预设按钮 */
.presets-container {
  margin-bottom: 15px;
}

.presets-container h4 {
  margin-bottom: 10px;
  font-size: 1rem;
  font-weight: 500;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.preset-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.preset-btn.active {
  background-color: var(--primary-color);
  color: var(--bg-color);
}

/* 操作按钮 */
.buttons-row {
  display: flex;
  gap: 10px;
}

.btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--text-color);
  cursor: pointer;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-speed);
}

.btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* 使用提示 */
.tips-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background-color: var(--panel-bg);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  gap: 15px;
  box-shadow: 0 5px 15px var(--shadow-color);
  z-index: 30;
  opacity: 0;
  transition: all 0.5s ease;
}

.tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 5px;
  margin-left: 10px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--panel-bg);
  border-radius: 10px;
  padding: 20px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 5px 15px var(--shadow-color);
}

.modal-content h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.modal-content p {
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.close-modal {
  float: right;
  font-size: 1.5rem;
  cursor: pointer;
  margin-top: -5px;
  margin-right: -5px;
}

/* 分享选项 */
.share-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.share-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 10px;
  border-radius: 5px;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-speed);
}

.share-btn i {
  font-size: 1.5rem;
}

.share-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.qr-code-container {
  text-align: center;
  margin-top: 15px;
}

/* 加载指示器 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 243, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: var(--primary-color);
  font-size: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式设计 */
@media (max-width: 767px) {
  .title {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 0.9rem;
  }
  
  .controls-panel {
    max-height: 70vh;
  }
  
  .tips-container {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
}

@media (min-width: 768px) {
  .controls-panel {
    width: 350px;
    left: auto;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 15px;
    max-height: 80vh;
  }
  
  .controls-panel:not(.expanded) {
    transform: translateY(-50%) translateX(calc(100% - 50px));
  }
  
  .controls-panel:not(.expanded) .controls-content {
    display: none;
  }
  
  .controls-header {
    padding: 15px;
  }
  
  .toggle-btn.active {
    transform: rotate(-90deg);
  }
}
