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

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  animation: fadeInDown 0.6s ease;
}

header h1 {
  font-size: 2.8em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: bold;
}

.subtitle {
  font-size: 1.3em;
  opacity: 0.95;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* 卡片样式优化 */
.card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.card h2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  font-size: 1.6em;
  font-weight: bold;
}

/* 角色选择网格优化 */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
}

.role-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 25px 15px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 3px solid transparent;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

.role-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.role-card:hover::before {
  left: 100%;
}

.role-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.role-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, #e8eaff 0%, #d0d4ff 100%);
  transform: scale(1.08);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.role-avatar {
  font-size: 3.5em;
  margin-bottom: 12px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.15));
  transition: all 0.3s ease;
}

.role-card:hover .role-avatar {
  transform: scale(1.15) rotate(-5deg);
}

.role-card.selected .role-avatar {
  animation: bounce 0.6s ease;
}

.role-name {
  font-size: 1.05em;
  font-weight: bold;
  color: #333;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* 计时器设置优化 */
.timer-setting {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.timer-setting label {
  font-size: 1.2em;
  color: #555;
  font-weight: 600;
}

.timer-setting input {
  padding: 12px 15px;
  font-size: 1.3em;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  width: 150px;
  transition: all 0.3s ease;
  background: white;
  font-weight: bold;
  color: #667eea;
}

.timer-setting input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  transform: scale(1.05);
}

.timer-presets {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.05em;
  font-weight: 600;
  transition: all 0.3s ease;
  color: #555;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.preset-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(102, 126, 234, 0.3);
}

.preset-btn:active {
  transform: translateY(-1px);
}

/* 开始按钮优化 */
.start-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.4em;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.start-btn:hover:not(:disabled)::before {
  width: 300px;
  height: 300px;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* 陪伴进行区域优化 */
.timer-display {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 20px;
  padding: 35px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.time-remaining {
  font-size: 4.5em;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Courier New', monospace;
  text-shadow: none;
  letter-spacing: 2px;
}

.current-role {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 20px;
  padding: 35px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.role-avatar-large {
  font-size: 6em;
  margin-bottom: 15px;
  filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

.role-name-large {
  font-size: 2em;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 操作按钮优化 */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.action-btn {
  padding: 18px 25px;
  border: none;
  border-radius: 16px;
  font-size: 1.15em;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  font-weight: bold;
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.action-btn:hover::after {
  left: 100%;
}

.encourage-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.hurry-btn {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: #333;
}

.custom-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.action-btn:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.action-btn:active {
  transform: translateY(-2px) scale(1);
}

/* 自定义文本区域优化 */
.custom-text-area {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.custom-text-area textarea {
  width: 100%;
  min-height: 120px;
  padding: 18px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1.15em;
  resize: vertical;
  margin-bottom: 18px;
  font-family: inherit;
  transition: all 0.3s ease;
  background: white;
}

.custom-text-area textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  transform: scale(1.01);
}

.custom-text-buttons {
  display: flex;
  gap: 12px;
}

.text-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1.15em;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: bold;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

#speakCustomBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cancel-btn {
  background: linear-gradient(135deg, #999 0%, #777 100%);
}

.text-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* 状态消息优化 */
.status-message {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.3em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
  min-height: 60px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  animation: fadeIn 0.4s ease;
}

/* 停止按钮优化 */
.stop-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.4s ease;
  box-shadow: 0 8px 20px rgba(255, 71, 87, 0.3);
  font-weight: bold;
}

.stop-btn:hover {
  background: linear-gradient(135deg, #ff3838 0%, #ff1f1f 100%);
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(255, 71, 87, 0.4);
}

/* 结果区域优化 */
.result-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
  border-radius: 20px;
  padding: 45px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: zoomIn 0.6s ease;
}

.result-card h2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.3em;
  margin-bottom: 25px;
  font-weight: bold;
}

.result-avatar {
  font-size: 7em;
  margin-bottom: 25px;
  filter: drop-shadow(4px 4px 10px rgba(0, 0, 0, 0.25));
  animation: bounce 1s ease infinite;
}

.result-message {
  font-size: 1.6em;
  color: #555;
  margin-bottom: 35px;
  line-height: 1.6;
  font-weight: 600;
}

.restart-btn {
  padding: 18px 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1.3em;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  font-weight: bold;
}

.restart-btn:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* 动画效果 */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(5deg);
  }
  75% {
    transform: translateY(-10px) rotate(-5deg);
  }
}

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

/* 响应式设计优化 */
@media (max-width: 600px) {
  header h1 {
    font-size: 2em;
  }

  .subtitle {
    font-size: 1.1em;
  }

  .time-remaining {
    font-size: 3em;
  }

  .role-avatar-large {
    font-size: 4em;
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .role-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 20px;
  }

  .result-card {
    padding: 30px 20px;
  }

  .result-avatar {
    font-size: 5em;
  }

  .result-message {
    font-size: 1.3em;
  }
}
