/* 设置界面样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

:root {
  --primary-color: #3a86ff;
  --primary-light: #4a90e2;
  --primary-dark: #2a5db0;
  --secondary-color: #ff6b6b;
  --text-color: #333;
  --text-color-light: #666;
  --bg-color: #f5f7fa;
  --bg-panel: #ffffff;
  --border-color: #e1e5eb;
  --success-color: #4caf50;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --border-radius: 10px;
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

/* 当窗口被拖动时禁用所有过渡效果和动画 */
body.is-dragging * {
  transition: none !important;
  animation: none !important;
}

body.is-dragging .settings-container {
  transform: none !important;
  animation: none !important;
  box-shadow: none !important;
  border: 1px solid var(--border-color);
}

body.is-dragging .settings-section:hover {
  box-shadow: var(--shadow-sm) !important;
  transform: none !important;
}

body.is-dragging .settings-section::after {
  opacity: 0 !important;
  height: 0 !important;
}

body.is-dragging .header h1::after {
  width: 0 !important;
}

.settings-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: var(--bg-panel);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeIn 0.3s ease;
  will-change: transform; /* 优化性能 */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  position: relative;
  user-select: none;
}

.header h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
  display: inline-block;
}

.header h1::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: white;
  transition: width 0.3s ease;
}

.header:hover h1::after {
  width: 100%;
}

#close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

#close-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.settings-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background-color: var(--bg-color);
}

.settings-section {
  margin-bottom: 25px;
  background-color: var(--bg-panel);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.settings-section:hover {
  box-shadow: var(--shadow-md);
}

.settings-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(to bottom, rgba(58, 134, 255, 0.05), transparent);
  opacity: 0;
  transition: height 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}

.settings-section:hover::after {
  height: 100%;
  opacity: 1;
}

.settings-section h2 {
  font-size: 16px;
  margin-bottom: 18px;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
}

.settings-section h2::before {
  content: "⚙️";
  margin-right: 8px;
  font-size: 18px;
}

/* 为每个部分添加不同图标 */
.settings-section:nth-child(1) h2::before {
  content: "⚙️";
}

.settings-section:nth-child(2) h2::before {
  content: "🎨";
}

.settings-section:nth-child(3) h2::before {
  content: "🎮";
}

.settings-section:nth-child(4) h2::before {
  content: "ℹ️";
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 0;
  transition: var(--transition);
  border-radius: 8px;
  padding: 12px 10px;
}

.setting-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

/* 复选框样式 */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 22px;
  background: #e0e0e0;
  border-radius: 22px;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

input[type="checkbox"]::after {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 18px;
  background: white;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="checkbox"]:checked {
  background: var(--primary-color);
}

input[type="checkbox"]:checked::after {
  left: 24px;
}

/* 进度条样式 */
input[type="range"] {
  -webkit-appearance: none;
  width: 160px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.pet-skins {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.skin-item {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 8px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background-color: white;
  overflow: hidden;
  will-change: transform, box-shadow, border-color;
}

.skin-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
}

.skin-item.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(58, 134, 255, 0.2);
}

.skin-item.selected::before {
  content: "✓";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  transform: rotate(45deg);
}

.skin-item img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 8px;
  transition: var(--transition);
}

.skin-item:hover img {
  transform: scale(1.05);
}

.skin-item span {
  display: block;
  font-size: 12px;
  margin-top: 5px;
  color: var(--text-color);
  font-weight: 500;
}

.skin-item.locked {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: #f8f8f8;
}

.lock-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
}

.about-info {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-color-light);
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  background: linear-gradient(to right, rgba(58, 134, 255, 0.03), rgba(58, 134, 255, 0.07), rgba(58, 134, 255, 0.03));
  border-radius: 8px;
  padding: 20px;
}

.about-info::before {
  content: "❤️";
  display: block;
  font-size: 24px;
  margin-bottom: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.about-info p {
  margin-bottom: 8px;
}

.footer {
  display: flex;
  justify-content: flex-end;
  padding: 18px 24px;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-color);
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

#save-btn, #reset-btn {
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
  will-change: transform, background-color;
}

#save-btn {
  background-color: var(--primary-color);
  color: white;
  margin-left: 12px;
}

#save-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: var(--transition-fast);
}

#save-btn:active {
  transform: translateY(0);
}

#reset-btn {
  background-color: #f0f0f0;
  color: var(--text-color);
}

#reset-btn:hover {
  background-color: #e0e0e0;
}

/* 添加按钮图标 */
#save-btn::before {
  content: "💾";
  margin-right: 6px;
  font-size: 14px;
}

#reset-btn::before {
  content: "🔄";
  margin-right: 6px;
  font-size: 14px;
}

#save-btn::after, #reset-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

#save-btn:hover::after, #reset-btn:hover::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* 标记"新"的外观选项 */
.skin-item:nth-child(2)::after {
  content: "新";
  position: absolute;
  top: 5px;
  left: 5px;
  background-color: var(--secondary-color);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
}

/* 鼠标悬停时微微抬升所有可交互元素 */
.setting-item:hover label,
.setting-item:hover input[type="checkbox"],
.setting-item:hover input[type="range"] {
  transform: translateY(-1px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
  transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* 保存提示动画 */
.saved-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--success-color);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  opacity: 0;
  transition: var(--transition);
  z-index: 1000;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
}

.saved-notice::before {
  content: "✓";
  margin-right: 8px;
  font-weight: bold;
}

.saved-notice.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 音量调节器特效 */
.setting-item:has(input[type="range"]):hover input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgba(58, 134, 255, 0.15);
} 