/* ============================================
   老婆评分系统 - 样式表
   ============================================ */

/* === CSS 变量 === */
:root {
  /* 氛围颜色 - 由 JS 动态切换 */
  --bg-top: #d4c5b9;
  --bg-bottom: #b8a99a;
  --stage-floor: #9b8b7c;
  --accent: #8b7d6b;
  --text-primary: #5c4f3f;
  --text-secondary: #8b7d6b;
  --card-bg: rgba(255,255,255,0.6);
  --card-border: rgba(255,255,255,0.4);

  /* 角色尺寸 */
  --char-size: 80px;

  /* 动画 */
  --transition-speed: 0.5s;

  /* 圆角 */
  --radius: 16px;
  --radius-sm: 8px;

  /* 字体 */
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 氛围主题 */
body.atmosphere-sunny {
  --bg-top: #fce4b8;
  --bg-bottom: #f8d0a0;
  --stage-floor: #c8e6c9;
  --accent: #f4a460;
  --text-primary: #6b4226;
  --text-secondary: #a08060;
  --card-bg: rgba(255,248,230,0.75);
}

body.atmosphere-mild {
  --bg-top: #c9ddf0;
  --bg-bottom: #b8cfe0;
  --stage-floor: #c5cae9;
  --accent: #7e9eb8;
  --text-primary: #3e5468;
  --text-secondary: #6b859e;
  --card-bg: rgba(240,245,250,0.7);
}

body.atmosphere-cloudy {
  --bg-top: #b8bcc0;
  --bg-bottom: #9a9ea3;
  --stage-floor: #8d8f93;
  --accent: #7a7d82;
  --text-primary: #4a4d51;
  --text-secondary: #6e7175;
  --card-bg: rgba(235,235,238,0.7);
}

body.atmosphere-rainy {
  --bg-top: #6b7b8d;
  --bg-bottom: #556270;
  --stage-floor: #4a5560;
  --accent: #7b8ea0;
  --text-primary: #e0e5ea;
  --text-secondary: #b0bcc8;
  --card-bg: rgba(40,50,60,0.7);
  --card-border: rgba(255,255,255,0.15);
}

body.atmosphere-stormy {
  --bg-top: #3a3f4b;
  --bg-bottom: #2a2d35;
  --stage-floor: #1e2126;
  --accent: #5a5f6b;
  --text-primary: #d0d3d8;
  --text-secondary: #989ba3;
  --card-bg: rgba(30,33,38,0.8);
  --card-border: rgba(255,255,255,0.1);
}

body.atmosphere-frozen {
  --bg-top: #1a2030;
  --bg-bottom: #0d1525;
  --stage-floor: #1a2535;
  --accent: #3a5070;
  --text-primary: #c0d0e8;
  --text-secondary: #7080a0;
  --card-bg: rgba(15,20,35,0.85);
  --card-border: rgba(255,255,255,0.08);
}

/* === 全局样式 === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* === Canvas 粒子层 === */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* === 主容器 === */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 16px 120px;
  min-height: 100vh;
}

/* === 纪念日横幅 === */
.special-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  padding: 6px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 1px;
  animation: banner-shine 2s ease-in-out infinite;
}

@keyframes banner-shine {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

@keyframes float-hat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}

/* === 信箱按钮 === */
.msg-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.msg-btn:active { transform: scale(0.9); }

.msg-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 14px;
  height: 14px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carrot-container {
  position: relative;
  z-index: 3;
  margin: 0 8px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.carrot-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.5);
  transform-origin: bottom center;
}

.carrot-head {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffe0c0;
  position: relative;
}

.carrot-hair {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  height: 18px;
  background: #8B4513;
  border-radius: 20px 20px 0 0;
}

.carrot-eyes { gap: 6px; }

.carrot-eyes .eye {
  width: 6px;
  height: 6px;
  background: #333;
  border-radius: 50%;
}

.carrot-eyes.happy .eye { height: 4px; border-radius: 0 0 4px 4px; }
.carrot-eyes.sad .eye { height: 7px; }
.carrot-eyes.cry .eye { height: 6px; }
.carrot-eyes.cry .eye::after { content: '💧'; position: absolute; top: 4px; font-size: 6px; }

.carrot-mouth {
  width: 10px;
  height: 4px;
  background: #e88;
  border-radius: 0 0 6px 6px;
  margin-top: 6px;
}

.carrot-mouth.smile { height: 6px; border-radius: 0 0 8px 8px; }
.carrot-mouth.frown { height: 4px; border-radius: 6px 6px 0 0; }
.carrot-mouth.open { width: 8px; height: 8px; border-radius: 50%; }

.carrot-torso {
  width: 20px;
  height: 24px;
  border-radius: 8px 8px 4px 4px;
  background: #ff9800;
  margin-top: -4px;
}

.carrot-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 2px;
  font-weight: 600;
}

/* 小萝卜跳动 */
.carrot-container.bounce {
  animation: carrot-hop 0.4s ease-out;
}

@keyframes carrot-hop {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-15px); }
  60% { transform: translateY(-5px); }
}

.carrot-container.cry {
  animation: carrot-shake 0.3s ease-in-out infinite;
}

@keyframes carrot-shake {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

/* === 消息弹窗 === */
.modal-msg {
  border-radius: 20px;
  margin: auto 16px;
  max-height: 80vh;
}

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.msg-item {
  padding: 12px;
  background: #f8f8f8;
  border-radius: 12px;
  position: relative;
}

.msg-item.from-chufan {
  background: #ffe0e6;
  margin-right: 30px;
}

.msg-item.from-华清 {
  background: #e0ecff;
  margin-left: 30px;
}

.msg-item .msg-sender {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.msg-item .msg-text {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-item .msg-photo {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 8px;
  display: block;
  cursor: pointer;
}

.msg-item .msg-time {
  font-size: 10px;
  color: #aaa;
  margin-top: 6px;
  text-align: right;
}

.msg-item .msg-delete {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  background: none;
  border: none;
}

.msg-item:hover .msg-delete { opacity: 0.6; }

.msg-compose {
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.msg-input {
  width: 100%;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  font-family: var(--font);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.msg-input:focus { border-color: var(--accent); }

.msg-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.msg-photo-btn {
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.msg-photo-btn:hover { background: rgba(0,0,0,0.05); }

.msg-photo-name {
  flex: 1;
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-send-btn {
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  flex-shrink: 0;
}

.msg-send-btn:hover { filter: brightness(1.1); }
.msg-send-btn:active { transform: scale(0.95); }

/* === 照片全屏查看 === */
.photo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
}

/* === 角色切换 === */
.role-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 3px;
  gap: 2px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.role-option {
  width: 32px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-secondary);
  transition: all 0.25s;
  line-height: 28px;
  text-align: center;
}

.role-option.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* === 倒计时条 === */
.countdown-bar {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-speed);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  font-weight: 500;
}

.countdown-bar .countdown-days {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  margin: 0 2px;
}

.countdown-icon {
  font-size: 16px;
  animation: pulse-icon 2s ease-in-out infinite;
}

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

.countdown-text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* === 舞台区 === */
.stage {
  position: relative;
  height: 280px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* 舞台顶部装饰灯 */
.stage::before {
  content: '💡💡💡💡💡';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 8px;
  z-index: 6;
  opacity: 0.5;
  transition: opacity 0.5s;
  pointer-events: none;
}

body.atmosphere-stormy .stage::before,
body.atmosphere-frozen .stage::before {
  opacity: 0.15;
}

/* 舞台地板 */
.stage::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--stage-floor);
  border-radius: 0 0 var(--radius) var(--radius);
  transition: background 1s ease;
}

/* 场景道具层 */
.scene-props {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 40px);
  pointer-events: none;
  z-index: 2;
}

.scene-props .prop {
  position: absolute;
  font-size: 28px;
  animation: prop-appear 0.3s ease-out forwards;
}

@keyframes prop-appear {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 场景特效文字 */
.scene-effect-text {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: bold;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  white-space: nowrap;
}

.scene-effect-text.show {
  animation: effect-text-pop 0.8s ease-out forwards;
}

@keyframes effect-text-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

/* === 角色基础样式 === */
.character {
  position: relative;
  z-index: 3;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wife-container {
  margin-right: 20px;
  transform: translateY(0);
}

.husband-container {
  margin-left: 20px;
  transform: translateY(0);
}

/* 角色身体 */
.character-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* 老公可扇巴掌提示 */
.husband-container { cursor: pointer; }
.husband-container::after {
  content: '👈';
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 10;
}
.husband-container:hover::after,
.husband-container:active::after { opacity: 0.7; }

/* 角色阴影 */
.character::before {
  content: '';
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 8px;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  transition: all 0.5s;
}

/* === 头部 === */
.head {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.wife-head {
  background: #fdd9b5;
}

.husband-head {
  background: #f5c6a0;
}

/* === 头发 === */
.hair {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  height: 32px;
  border-radius: 30px 30px 0 0;
  z-index: 3;
}

.wife-hair {
  background: #3d2b1f;
}

.wife-hair::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 6px;
  background: #3d2b1f;
  border-radius: 0 0 4px 4px;
}

/* 老婆的小辫子 */
.bow {
  position: absolute;
  top: -14px;
  right: -6px;
  font-size: 16px;
  z-index: 4;
}

.husband-hair {
  background: #2c1810;
}

/* === 面部 === */
.face {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* 眼睛 */
.eyes {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.eye {
  width: 7px;
  height: 7px;
  background: #333;
  border-radius: 50%;
  display: block;
}

/* 眼睛表情变体 */
.eyes.angry .eye {
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: #333;
  transform: rotate(-10deg);
}

.eyes.happy .eye {
  width: 7px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: #333;
  /* 需要 border-top: none 效果用伪元素覆盖 */
  clip-path: ellipse(50% 40% at 50% 100%);
}

.eyes.teary .eye {
  position: relative;
  width: 7px;
  height: 7px;
  background: #333;
  border-radius: 50%;
}

.eyes.teary .eye::after {
  content: '💧';
  position: absolute;
  top: 6px;
  left: -2px;
  font-size: 8px;
  animation: tear-drop 0.8s ease-in infinite;
}

@keyframes tear-drop {
  0% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(8px); }
}

.eyes.dead .eye {
  width: 6px;
  height: 2px;
  background: #666;
  border-radius: 2px;
}

.eyes.heart .eye {
  width: 7px;
  height: 7px;
  background: transparent;
  position: relative;
}

.eyes.heart .eye::before {
  content: '♥';
  position: absolute;
  top: -2px;
  left: -3px;
  font-size: 10px;
  color: #e74c3c;
}

/* 嘴巴 */
.mouth {
  width: 14px;
  height: 6px;
  background: #e88;
  border-radius: 0 0 8px 8px;
  transition: all 0.3s;
}

/* 嘴巴变体 */
.mouth.smile {
  width: 16px;
  height: 8px;
  border-radius: 0 0 10px 10px;
  background: #e88;
}

.mouth.open {
  width: 12px;
  height: 10px;
  border-radius: 50%;
  background: #c44;
}

.mouth.small-o {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c44;
}

.mouth.flat {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: #c44;
}

.mouth.frown {
  width: 14px;
  height: 6px;
  border-radius: 8px 8px 0 0;
  background: #c44;
}

.mouth.tremble {
  animation: tremble 0.2s ease-in-out infinite;
}

@keyframes tremble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* === 身体 === */
.torso {
  width: 30px;
  height: 36px;
  border-radius: 10px 10px 6px 6px;
  position: relative;
  z-index: 1;
  margin-top: -6px;
}

.wife-torso {
  background: #e898a0;
}

.wife-torso .dress {
  position: absolute;
  bottom: -8px;
  left: -6px;
  right: -6px;
  height: 16px;
  background: #e898a0;
  border-radius: 0 0 8px 8px;
}

.husband-torso {
  background: #6b8e9b;
}

.husband-torso .shirt {
  position: absolute;
  inset: 0;
  background: #6b8e9b;
  border-radius: 10px 10px 6px 6px;
}

/* === 手臂 === */
.arms {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 30px;
  z-index: 0;
  display: flex;
  justify-content: space-between;
}

.arm {
  width: 10px;
  height: 28px;
  border-radius: 5px;
  transform-origin: top center;
  transition: transform 0.3s;
}

.wife-arms .arm {
  background: #fdd9b5;
}

.husband-arms .arm {
  background: #f5c6a0;
}

/* === 腿 === */
.legs {
  display: flex;
  gap: 6px;
  margin-top: -2px;
}

.leg {
  width: 10px;
  height: 24px;
  border-radius: 4px;
  background: #555;
}

/* === 对话气泡 === */
.speech-bubble {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  transition: opacity 0.3s;
  z-index: 10;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid white;
}

.speech-bubble.show {
  opacity: 1;
  animation: bubble-pop 0.3s ease-out;
}

@keyframes bubble-pop {
  0% { transform: translateX(-50%) scale(0.5); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.wife-bubble {
  color: #c0392b;
}

.husband-bubble {
  color: #2c3e50;
}

/* === 分数展示区 === */
.score-section {
  text-align: center;
  padding: 16px 0;
  transition: all var(--transition-speed);
}

.score-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.score-value {
  font-size: 72px;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  transition: color 0.5s;
  position: relative;
  display: inline-block;
}

.score-value.shake {
  animation: score-shake 0.5s ease-out;
}

@keyframes score-shake {
  0%, 100% { transform: translateY(0); }
  10% { transform: translateY(-10px); }
  20% { transform: translateY(8px); }
  30% { transform: translateY(-6px); }
  40% { transform: translateY(4px); }
  50% { transform: translateY(-2px); }
}

.score-value.flip {
  animation: score-flip 0.6s ease-out;
}

@keyframes score-flip {
  0% { transform: rotateX(0); }
  40% { transform: rotateX(90deg); }
  60% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

.score-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 2px;
  transition: all 0.5s;
  letter-spacing: 2px;
}

.score-mood {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-style: italic;
  transition: all 0.5s;
}

/* 趋势图 */
.trend-canvas {
  width: 100%;
  height: 160px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  display: block;
}

/* === 操作按钮 === */
.action-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.action-btn {
  flex: 1;
  padding: 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.action-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  border-radius: inherit;
  pointer-events: none;
}

.action-btn:active {
  transform: scale(0.92);
}

.btn-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.deduct-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
  animation: btn-pulse-deduct 3s ease-in-out infinite;
}

@keyframes btn-pulse-deduct {
  0%, 100% { box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4); }
  50% { box-shadow: 0 6px 25px rgba(231, 76, 60, 0.7); }
}

.bonus-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
  animation: btn-pulse-bonus 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes btn-pulse-bonus {
  0%, 100% { box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4); }
  50% { box-shadow: 0 6px 25px rgba(46, 204, 113, 0.7); }
}

/* === AI 顾问按钮 === */
.ai-advice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.3);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.ai-advice-btn:hover { background: rgba(255,255,255,0.5); }
.ai-advice-btn:active { transform: scale(0.98); }
.ai-advice-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.ai-btn-icon { font-size: 20px; }

.ai-btn-loading {
  animation: ellipsis 1.2s infinite;
}

@keyframes ellipsis {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

/* AI 结果面板 */
.ai-result {
  background: #fffef5;
  border: 1px solid #e8d5a0;
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  font-weight: 700;
  font-size: 14px;
}

.ai-result-close {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-result-content {
  padding: 14px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* === 底部标签页 === */
.tab-container {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition-speed);
}

.tab-header {
  display: flex;
  border-bottom: 1px solid var(--card-border);
}

.tab-btn {
  flex: 1;
  padding: 14px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  position: relative;
}

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

.tab-panel {
  display: none;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.tab-panel.active {
  display: block;
}

/* === 筛选栏 === */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}


/* === 记录列表 === */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-secondary);
  font-size: 14px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  position: relative;
  transition: transform 0.2s;
}

.history-item:active {
  transform: scale(0.98);
}

.history-item .item-icon {
  font-size: 24px;
  flex-shrink: 0;
}

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

.history-item .item-name {
  font-size: 14px;
  font-weight: 600;
}

.history-item .item-reason {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item .item-time {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.history-item .item-points {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.history-item .item-points.deduct {
  color: #e74c3c;
}

.history-item .item-points.bonus {
  color: #27ae60;
}

.history-item .item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-item:hover .item-delete,
.history-item:active .item-delete {
  opacity: 1;
}

/* === 统计面板 === */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
}

.stat-card-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
}

.deduct-card .stat-card-value { color: #e74c3c; }
.bonus-card .stat-card-value { color: #27ae60; }
.count-card .stat-card-value { color: var(--accent); }

.chart-section {
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  width: 80px;
  font-size: 12px;
  text-align: right;
  flex-shrink: 0;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: rgba(0,0,0,0.08);
  border-radius: 11px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 11px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  min-width: 26px;
}

.bar-fill.deduct-fill {
  background: linear-gradient(90deg, #e74c3c, #f39c12);
}

.bar-fill.bonus-fill {
  background: linear-gradient(90deg, #27ae60, #2ecc71);
}

/* === 管理面板 === */
.manage-section {
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-header h3 {
  font-size: 15px;
}

.add-btn {
  padding: 6px 14px;
  border: 2px dashed var(--accent);
  background: transparent;
  border-radius: 20px;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.add-btn:hover {
  background: var(--accent);
  color: white;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.manage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
}

.manage-item .mi-icon {
  font-size: 22px;
}

.manage-item .mi-info {
  flex: 1;
  min-width: 0;
}

.manage-item .mi-name {
  font-size: 14px;
  font-weight: 500;
}

.manage-item .mi-points {
  font-size: 12px;
  color: var(--text-secondary);
}

.manage-item .mi-actions {
  display: flex;
  gap: 6px;
}

.mi-actions button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  background: rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.mi-actions button:hover {
  background: rgba(0,0,0,0.15);
}

.mi-actions .edit-item-btn { color: var(--accent); }
.mi-actions .delete-item-btn { color: #e74c3c; }

/* 管理区折叠 */
.manage-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px;
  margin-top: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  user-select: none;
}

.manage-toggle:hover {
  background: rgba(0,0,0,0.04);
}

.manage-toggle-arrow {
  font-size: 11px;
  transition: transform 0.2s;
}

.manage-inline {
  border-top: 1px solid var(--card-border);
  margin-top: 8px;
  padding-top: 12px;
}

.danger-zone {
  padding: 16px;
  background: rgba(231,76,60,0.08);
  border: 1px solid rgba(231,76,60,0.2);
  border-radius: var(--radius-sm);
  text-align: center;
}

.danger-zone h3 {
  font-size: 14px;
  color: #e74c3c;
  margin-bottom: 10px;
}

.danger-btn {
  padding: 10px 24px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.danger-btn:hover {
  background: #c0392b;
}

/* === 弹窗 === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 16px 20px 24px;
}

/* === 选项列表 === */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f8f8f8;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.option-item:hover {
  background: #f0f0f0;
  border-color: var(--accent);
}

.option-item:active {
  transform: scale(0.98);
}

.option-item.custom-option {
  border-style: dashed;
  border-color: #ccc;
  opacity: 0.8;
}

.oi-points.custom {
  color: #999;
  font-size: 14px;
  font-style: italic;
}

.option-item .oi-icon {
  font-size: 28px;
}

.option-item .oi-info {
  flex: 1;
}

.option-item .oi-name {
  font-size: 15px;
  font-weight: 600;
}

.option-item .oi-scene {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.option-item .oi-points {
  font-size: 20px;
  font-weight: 700;
}

.option-item .oi-points.deduct { color: #e74c3c; }
.option-item .oi-points.bonus { color: #27ae60; }

/* === 备注区 === */
.note-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.note-input {
  width: 100%;
  height: 80px;
  border: 2px solid #eee;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  font-family: var(--font);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.note-input:focus {
  border-color: var(--accent);
}

.note-actions,
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-cancel,
.btn-confirm,
.btn-danger {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.btn-cancel {
  background: #f0f0f0;
  color: #666;
}

.btn-confirm {
  background: var(--accent);
  color: white;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

/* === 编辑弹窗 === */
.modal-edit {
  border-radius: 20px;
  margin: auto 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #eee;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--accent);
}

/* === 场景动画 - 舞台震动 === */
.stage.shake {
  animation: stage-shake 0.6s ease-out;
}

@keyframes stage-shake {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-6px); }
  20% { transform: translateX(6px); }
  30% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  50% { transform: translateX(-2px); }
  60% { transform: translateX(2px); }
}

/* === 角色位置动画 === */
/* 老婆逼近 */
.wife-container.approach {
  transform: translateX(30px) scale(1.1);
}

/* 老公后退 */
.husband-container.retreat {
  transform: translateX(-20px) scale(0.9);
}

/* 老公转身 (回避聊天) */
.husband-container.turn-away .husband-body {
  animation: turn-away 0.5s ease-in-out forwards;
}

@keyframes turn-away {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(160deg); }
}

/* 老公缩小 (瘫坐) */
.husband-container.shrink {
  transform: scale(0.7) translateY(10px);
}

/* 老公躺平 */
.husband-container.lay-down .husband-body {
  animation: lay-down 0.5s ease-in-out forwards;
}

@keyframes lay-down {
  0% { transform: rotate(0); }
  100% { transform: rotate(90deg) translateY(10px); }
}

/* 老婆变大 */
.wife-container.grow {
  transform: scale(1.2);
}

/* 老婆跳动 */
.wife-container.bounce {
  animation: char-bounce 0.4s ease-out;
}

@keyframes char-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-20px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-10px); }
}

/* 老公弹跳 */
.husband-container.jump {
  animation: char-jump 0.5s ease-out;
}

@keyframes char-jump {
  0% { transform: translateY(0); }
  40% { transform: translateY(-30px); }
  50% { transform: translateY(-30px); }
  60% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* 老公发抖 */
.husband-container.shiver .husband-body {
  animation: shiver 0.15s linear infinite;
}

@keyframes shiver {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-3px) rotate(-3deg); }
  75% { transform: translateX(3px) rotate(3deg); }
}

/* 老公单膝跪地 */
.husband-container.kneel {
  transform: translateY(20px);
}

.husband-container.kneel .husband-body {
  transform: scaleY(0.7);
}

/* === 特定道具动画 === */
/* 爱心飘动 */
.prop-heart {
  position: absolute;
  font-size: 20px;
  animation: float-heart 1.5s ease-out forwards;
}

@keyframes float-heart {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-100px) scale(0.8); opacity: 0; }
}

/* 垃圾弹出 */
.prop-trash {
  position: absolute;
  font-size: 22px;
  animation: trash-pop 0.4s ease-out forwards;
}

@keyframes trash-pop {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* 生气符号 */
.prop-anger {
  position: absolute;
  font-size: 20px;
  animation: anger-float 0.8s ease-out forwards;
}

@keyframes anger-float {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  30% { transform: translateY(-15px) scale(1.5); opacity: 1; }
  100% { transform: translateY(-40px) scale(0.5); opacity: 0; }
}

/* 汗滴 */
.prop-sweat {
  position: absolute;
  font-size: 16px;
  animation: sweat-drop 0.6s ease-in forwards;
}

@keyframes sweat-drop {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  30% { transform: translateY(5px) scale(1.2); opacity: 1; }
  100% { transform: translateY(20px) scale(1); opacity: 0; }
}

/* 星光 */
.prop-sparkle {
  position: absolute;
  font-size: 16px;
  animation: sparkle-twinkle 1s ease-out forwards;
}

/* 巴掌特效 */
@keyframes slap-hit {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 1; }
  30% { transform: scale(1.4) rotate(5deg); opacity: 1; }
  60% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  100% { transform: scale(0.8) translateY(-30px); opacity: 0; }
}

@keyframes slap-burst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.8); opacity: 0.8; }
  100% { transform: scale(0.5) translateY(-40px); opacity: 0; }
}

@keyframes dmg-float {
  0% { transform: translateY(0) scale(0.5); opacity: 1; }
  30% { transform: translateY(-20px) scale(1.3); opacity: 1; }
  100% { transform: translateY(-50px) scale(0.8); opacity: 0; }
}

@keyframes hp-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5); }
}

@keyframes drip {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(8px); opacity: 0; }
}

@keyframes sparkle-twinkle {
  0% { transform: scale(0) rotate(0); opacity: 0; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
  100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* === 响应式 === */

/* 小屏手机 (iPhone SE, 375px 以下) */
@media (max-width: 374px) {
  :root { --char-size: 60px; }
  .app-container { padding: 6px 10px 100px; }
  .stage { height: 200px; }
  .trend-canvas { height: 130px; }
  .score-title { font-size: 15px; }
  .stage::before { font-size: 8px; letter-spacing: 4px; }
  .stage::after { height: 28px; }
  .head { width: 40px; height: 40px; }
  .hair { top: -3px; left: -3px; right: -3px; height: 22px; }
  .face { top: 12px; width: 26px; gap: 5px; }
  .eye { width: 5px; height: 5px; }
  .eyes { gap: 6px; }
  .mouth { width: 10px; height: 4px; }
  .torso { width: 22px; height: 26px; margin-top: -4px; }
  .arms { top: 42px; width: 36px; }
  .arm { width: 7px; height: 20px; }
  .leg { width: 7px; height: 16px; }
  .legs { gap: 4px; }
  .speech-bubble { font-size: 11px; padding: 4px 8px; top: -38px; }
  .score-value { font-size: 44px; }
  .score-label { font-size: 12px; }
  .score-mood { font-size: 13px; }
  .action-btn { padding: 12px; font-size: 15px; border-radius: 12px; }
  .btn-icon { font-size: 22px; }
  .tab-btn { padding: 10px 4px; font-size: 12px; }
  .countdown-bar { font-size: 11px; padding: 6px 12px; }
  .countdown-bar .countdown-days { font-size: 14px; }
  .wife-container { margin-right: 8px; }
  .husband-container { margin-left: 8px; }
  .modal { max-height: 75vh; }
  .option-item { padding: 10px 12px; }
  .option-item .oi-icon { font-size: 22px; }
  .option-item .oi-name { font-size: 13px; }
  .option-item .oi-points { font-size: 16px; }
}

/* 中等手机 (iPhone 12/13/14, 375-390px) */
@media (min-width: 375px) and (max-width: 390px) {
  :root { --char-size: 70px; }
  .stage { height: 240px; }
  .head { width: 48px; height: 48px; }
  .face { top: 14px; width: 30px; gap: 6px; }
  .torso { width: 26px; height: 30px; }
  .arms { top: 50px; width: 44px; }
  .score-value { font-size: 56px; }
  .action-btn { padding: 14px; font-size: 17px; }
  .btn-icon { font-size: 24px; }
}

/* 大屏手机 (iPhone Pro Max, Android, 390-430px) */
@media (min-width: 391px) and (max-width: 430px) {
  .stage { height: 260px; }
  .score-value { font-size: 62px; }
}

/* 平板竖屏 */
@media (min-width: 600px) and (max-width: 899px) {
  .app-container { max-width: 560px; }
  .stage { height: 340px; }
  .score-value { font-size: 80px; }
  .modal { max-width: 560px; border-radius: 20px; margin-bottom: 20px; }
}

/* 桌面端 */
@media (min-width: 900px) {
  .app-container {
    padding-top: 30px;
  }
  .stage {
    height: 360px;
  }
  .score-value {
    font-size: 96px;
  }
  .modal {
    border-radius: 20px;
    margin-bottom: 40px;
    max-width: 480px;
  }
  .action-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .action-btn:hover {
    transform: translateY(-3px);
  }
  .deduct-btn:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.6);
  }
  .bonus-btn:hover {
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.6);
  }
}

/* 通用移动端优化 */
@media (max-width: 599px) {
  .tab-panel {
    max-height: 300px;
    -webkit-overflow-scrolling: touch;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 65vh;
  }
  .modal-body {
    padding: 12px 16px 20px;
  }
  .modal-header {
    padding: 12px 16px;
  }
  .modal-header h3 {
    font-size: 16px;
  }
  .option-item {
    padding: 12px 14px;
  }
  .note-input {
    height: 60px;
    font-size: 16px; /* 防止 iOS 缩放 */
  }
  .form-group input,
  .form-group select {
    font-size: 16px; /* 防止 iOS 缩放 */
  }
  .action-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* 横屏手机 */
@media (max-height: 500px) and (orientation: landscape) {
  .stage { height: 150px; }
  .score-section { padding: 4px 0; }
  .score-value { font-size: 40px; }
  .score-mood { font-size: 12px; margin-top: 2px; }
  .action-buttons { margin-bottom: 8px; }
  .action-btn { padding: 10px; font-size: 14px; }
  .countdown-bar { padding: 4px 12px; font-size: 11px; margin-bottom: 6px; }
}
