body {
  min-height: 100vh;
  background: linear-gradient(135deg, #fff5eb 0%, #ffe8d6 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
}

.game-container {
  padding: 20px 15px;
  min-height: 100vh;
  box-sizing: border-box;
  margin-top: 60px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* 响应式布局 */
@media (min-width: 768px) {
  .header-section,
  .mode-section,
  .control-section,
  .mode-control-section,
  .global-control-section,
  .input-section,
  .result-section,
  .hint-section,
  .solution-section,
  .stats-section,
  .history-section,
  .solvability-section {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .numbers-display {
    gap: 30px;
  }
  
  .number-card {
    width: 80px;
    height: 80px;
  }
  
  .number-text {
    font-size: 24px;
  }
  
  .mode-tabs {
    gap: 20px;
  }
  
  .custom-inputs {
    gap: 20px;
  }
  
  .custom-input {
    width: 120px;
    height: 80px;
    font-size: 20px;
  }
  
  .global-control-buttons {
    gap: 20px;
  }
  
  .stats-grid {
    gap: 30px;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .game-container {
    padding: 30px 20px;
  }
  
  .header-section,
  .mode-section,
  .control-section,
  .mode-control-section,
  .global-control-section,
  .input-section,
  .result-section,
  .hint-section,
  .solution-section,
  .stats-section,
  .history-section,
  .solvability-section {
    max-width: 900px;
  }
  
  .numbers-display {
    gap: 40px;
  }
  
  .number-card {
    width: 90px;
    height: 90px;
  }
  
  .number-text {
    font-size: 28px;
  }
  
  .game-title {
    font-size: 32px;
  }
  
  .game-desc {
    font-size: 18px;
  }
  
  .game-rules {
    font-size: 16px;
  }
}

/* 头部说明区域 */
.header-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.game-title {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: #ff6b35;
  margin-bottom: 15px;
}

.game-desc {
  display: block;
  font-size: 16px;
  color: #666;
  line-height: 1.4;
  margin-bottom: 10px;
}

.game-rules {
  display: block;
  font-size: 14px;
  color: #ff6b35;
  font-weight: 600;
  background: rgba(255, 107, 53, 0.1);
  padding: 12px 15px;
  border-radius: 10px;
  border-left: 4px solid #ff6b35;
  margin: 0 10px;
}

/* 模式切换选项卡 */
.mode-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 12px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.mode-tabs {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.mode-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 8px;
  border-radius: 12px;
  background: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.mode-tab.active {
  background: linear-gradient(135deg, #ff7f4d, #ffa66e);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.2);
}

.mode-tab:active {
  opacity: 0.9;
}

.mode-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.mode-tab.active .mode-icon,
.mode-tab.active .mode-text {
  color: white;
}

.mode-text {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

/* 控制区域 */
.control-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.hidden-control {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.numbers-display {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 0;
}

.number-card {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.number-card.first {
  background: linear-gradient(135deg, #ff9a56, #ff7f4d);
}

.number-card.second {
  background: linear-gradient(135deg, #4ecdc4, #3db8a8);
}

.number-card.third {
  background: linear-gradient(135deg, #45b7d1, #3ca5c0);
}

.number-card.fourth {
  background: linear-gradient(135deg, #a29bfe, #74b9ff);
}

.number-text {
  font-size: 20px;
  font-weight: 800;
  color: white;
}

/* 模式特定控制区域 */
.mode-control-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.mode-specific-btn {
  background: linear-gradient(135deg, #ff7f4d, #ffa66e);
  color: white;
  border: none;
  border-radius: 15px;
  padding: 20px 40px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.2);
  transition: all 0.2s ease;
  display: block;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}

.mode-specific-btn .btn-icon,
.mode-specific-btn .btn-text {
  color: white;
}

.mode-specific-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

/* 自定义输入区域 */
.custom-input-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 15px;
  margin-top: 10px;
}

.custom-inputs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.custom-input {
  width: 100px;
  height: 70px;
  border: 2px solid #ff9a56;
  border-radius: 12px;
  font-size: 18px;
  text-align: center;
  color: #333;
  font-weight: 700;
  background: white;
  outline: none;
}

.custom-input:focus {
  border-color: #ff6b35;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.random-generate-btn {
  background: linear-gradient(135deg, #45b7d1, #96e6a1);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 15px 25px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 8px 25px rgba(69, 183, 209, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  min-width: 120px;
  height: 80px;
  cursor: pointer;
}

.random-generate-btn:active {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 30px rgba(69, 183, 209, 0.4);
}

.random-generate-btn .btn-icon {
  font-size: 18px;
  color: white;
}

.random-generate-btn .btn-text {
  font-size: 14px;
  color: white;
  font-weight: 600;
}

.custom-actions {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.custom-btn {
  flex: 1;
  background: white;
  border: 2px solid #ff9a56;
  border-radius: 10px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  min-height: 70px;
  cursor: pointer;
}

.custom-btn:active {
  background: #ff9a56;
  transform: scale(0.95);
}

.custom-btn:active .btn-icon,
.custom-btn:active .btn-text {
  color: white;
}

.custom-btn:disabled {
  opacity: 0.5;
  background: #f8f9fa;
  cursor: not-allowed;
}

.check-solvability-btn {
  border-color: #45b7d1;
}

.use-custom-btn {
  border-color: #2ed573;
}

/* 可解性结果区域 */
.solvability-section {
  margin-bottom: 15px;
}

.solvability-box {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 15px;
  padding: 20px 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.solvability-box.solvable {
  border: 1px solid #2ed573;
  background: rgba(46, 213, 115, 0.1);
}

.solvability-box.unsolvable {
  border: 1px solid #ff4757;
  background: rgba(255, 71, 87, 0.1);
}

.solvability-icon {
  font-size: 40px;
}

.solvability-message {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  text-align: center;
}

.solvability-solutions {
  width: 100%;
  margin-top: 10px;
}

.solution-count {
  font-size: 16px;
  color: #666;
  text-align: center;
  margin-bottom: 15px;
}

.solution-item {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
}

.solution-expression {
  font-size: 16px;
  color: #333;
  font-family: 'Monaco', 'Menlo', monospace;
  text-align: center;
}

/* 全局控制按钮 */
.global-control-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.global-control-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.global-control-btn {
  flex: 1;
  background: white;
  border: 2px solid #ff9a56;
  border-radius: 12px;
  padding: 15px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  min-height: 70px;
  cursor: pointer;
}

.global-control-btn:active {
  background: rgba(255, 154, 86, 0.1);
}

.global-control-btn:active .btn-icon,
.global-control-btn:active .btn-text {
  color: #ff6b35;
}

.global-control-btn:disabled {
  opacity: 0.5;
  background: #f8f9fa;
  cursor: not-allowed;
}

.global-control-btn.hint-btn {
  border-color: #4ecdc4;
}

.global-control-btn.solution-btn {
  border-color: #45b7d1;
}

.btn-icon {
  font-size: 20px;
  color: #ff9a56;
}

.btn-text {
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

/* 输入区域 */
.input-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.expression-input-container {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 15px;
  padding: 0 20px;
  margin-bottom: 20px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.expression-input-container:focus-within {
  border-color: #ff9a56;
  background: white;
  box-shadow: 0 0 0 8px rgba(255, 154, 86, 0.1);
}

.expression-input {
  flex: 1;
  font-size: 18px;
  border: none;
  outline: none;
  color: #333;
  font-weight: 500;
  background: transparent;
  padding: 24px 0;
  font-family: 'Monaco', 'Menlo', monospace;
  min-height: 60px;
}

.clear-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 15px;
  min-width: 50px;
  cursor: pointer;
}

.action-buttons {
  text-align: center;
  margin-top: 20px;
}

.check-btn {
  background: linear-gradient(135deg, #ff7f4d, #ffa66e);
  color: white;
  border: none;
  border-radius: 15px;
  padding: 20px 40px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.2);
  transition: all 0.2s ease;
  cursor: pointer;
}

.check-btn:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(255, 107, 53, 0.3);
}

.check-btn:disabled {
  background: #ddd;
  box-shadow: none;
  cursor: not-allowed;
}

/* 结果显示区域 */
.result-section {
  margin-bottom: 20px;
}

.result-box {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 25px 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.result-box.correct {
  border: 1px solid #2ed573;
  background: rgba(46, 213, 115, 0.1);
}

.result-box.incorrect {
  border: 1px solid #ff4757;
  background: rgba(255, 71, 87, 0.1);
}

.result-icon {
  font-size: 48px;
}

.result-message {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  text-align: center;
}

.result-expression {
  text-align: center;
}

.expression-display {
  font-size: 20px;
  color: #666;
  font-family: 'Monaco', 'Menlo', monospace;
  background: rgba(255, 255, 255, 0.5);
  padding: 20px 30px;
  border-radius: 15px;
}

/* 提示和答案区域 */
.hint-section,
.solution-section {
  margin-bottom: 15px;
}

.hint-box,
.solution-box {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 25px 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.hint-header,
.solution-header {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

.hint-content {
  margin-bottom: 40px;
}

.hint-text {
  font-size: 20px;
  color: #555;
  line-height: 1.6;
  background: rgba(255, 193, 7, 0.1);
  padding: 30px;
  border-radius: 18px;
  border-left: 5px solid #ffc107;
}

.close-hint-btn,
.close-solution-btn {
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 18px;
  padding: 25px 50px;
  font-size: 20px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
}

.solution-list {
  margin-bottom: 40px;
}

.solution-item {
  background: rgba(69, 183, 209, 0.1);
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 20px;
  border-left: 5px solid #45b7d1;
}

.solution-expression {
  display: block;
  font-size: 20px;
  color: #45b7d1;
  font-weight: 700;
  font-family: 'Monaco', 'Menlo', monospace;
  margin-bottom: 10px;
}

.solution-desc {
  display: block;
  font-size: 16px;
  color: #666;
  line-height: 1.4;
}

/* 统计区域 */
.stats-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  margin-bottom: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.stats-grid {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.stat-number {
  font-size: 20px;
  font-weight: 800;
  color: #ff6b35;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  text-align: center;
}

/* 历史记录区域 */
.history-section {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 20px 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
  margin-bottom: 15px;
}

.history-header {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px 20px;
}

.history-numbers {
  display: flex;
  gap: 8px;
}

.history-number {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #ff9a56;
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-result {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
}

.history-result.solved {
  background: #2ed573;
  color: white;
}

.history-result.unsolved {
  background: #ff4757;
  color: white;
}

/* 动画效果 */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

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