/* ============================================================
   Record 游戏样式 - games/record.css
   ============================================================ */

:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --secondary: #8BC34A;
  --accent: #CDDC39;
  --bg-gradient: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 50%, #A5D6A7 100%);
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-primary: #2E7D32;
  --text-secondary: #558B2F;
  --shadow: 0 8px 32px rgba(46, 125, 50, 0.2);
}

body.record-page {
  min-height: 100vh;
  background: var(--bg-gradient);
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.record-container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.record-header {
  text-align: center;
  padding: 20px 0 16px;
}

.record-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--primary-dark);
  margin: 0 0 8px 0;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
  letter-spacing: 2px;
}

.record-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 600;
}

/* ============ 历史入口链接 ============ */
.history-link {
  display: block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  text-align: center;
  padding: 12px 20px;
  border-radius: 16px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}
.history-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ============ 今日面板 ============ */

/* 分数显示 */
.score-display {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 20px 30px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.score-display::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}
.score-value {
  font-size: 64px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.score-value.bump { transform: scale(1.15); }
.score-label {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: 1px;
}

/* 名言/古诗模块 */
.quote-card {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  border: 2px solid rgba(76, 175, 80, 0.2);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.quote-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 6px;
  transition: opacity 0.4s ease;
  min-height: 2em;
  white-space: pre-line;
}
.quote-text.fade-out { opacity: 0; }
.quote-text.fade-in { opacity: 1; }
.quote-source {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 12px;
  transition: opacity 0.4s ease;
}
.quote-source.fade-out { opacity: 0; }
.quote-source.fade-in { opacity: 1; }
.quote-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quote-nav-left { display: flex; gap: 6px; }
.quote-btn {
  background: rgba(76,175,80,0.15); border: none; border-radius: 10px;
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  color: var(--primary-dark); font-weight: 700; transition: background 0.2s;
}
.quote-btn:hover { background: rgba(76,175,80,0.3); }
.quote-speak-btn {
  background: rgba(76,175,80,0.15); border: none; border-radius: 10px;
  padding: 6px 14px; font-size: 12px; cursor: pointer;
  color: var(--primary-dark); font-weight: 700; transition: background 0.2s;
}
.quote-speak-btn:hover { background: rgba(76,175,80,0.3); }
.quote-speak-btn.speaking { background: rgba(76,175,80,0.4); }

/* ============ 量筒 + 树苗区域 ============ */
.tree-container {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 16px 16px 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  grid-template-rows: auto 1fr auto;
  gap: 0 8px;
}

/* 量筒在左列 */
.tree-container > .water-column-wrap {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  gap: 4px;
}
.water-column-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 5;
  flex-shrink: 0;
}
.water-column {
  position: relative;
  width: 36px;
  background: #E3F2FD;
  border: 3px solid #1976D2;
  border-radius: 0 0 18px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.water-column-wrap .water-column {
  flex: 1;
  min-height: 120px;
  max-height: 220px;
}
.water-fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, #2196F3, #64B5F6);
  transition: height 0.5s ease, background 0.5s ease;
  border-radius: 0 0 15px 15px;
}
.water-level-marks {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.water-level-marks .mark {
  position: absolute;
  left: 100%;
  font-size: 9px;
  color: #1976D2;
  font-weight: 700;
  margin-left: 2px;
  transform: translateY(50%);
}
.water-score-label {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 900;
  color: #1565C0;
  text-shadow: 0 0 4px rgba(255,255,255,0.8);
  pointer-events: none;
}
.water-column-label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  margin-top: 2px;
}

/* 浇水按钮在中列顶部 */
.tree-container > .water-btn {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  margin: 0 0 8px 0;
  white-space: nowrap;
}
.water-btn {
  background: linear-gradient(135deg, #29B6F6, #0288D1);
  color: white; border: none; border-radius: 20px;
  padding: 5px 10px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(2,136,209,0.4);
}
.water-btn:hover { transform: scale(1.05); box-shadow: 0 3px 12px rgba(2,136,209,0.6); }
.water-btn:active { transform: scale(0.95); }
.water-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 树苗在中列中间 */
.tree-container > #tree-area {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 2;
}
#tree-area { min-height: 100px; }
.tree-wrapper { position: relative; display: block; text-align: center; }
.tree-image {
  width: 140px; height: auto; display: block; margin: 0 auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}
.tree-image.tree-grow {
  animation: treeGrow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tree-stage-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  text-align: center;
  margin-top: 4px;
}
@keyframes treeGrow {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 太阳在右列 */
.tree-container > .sun {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  position: relative;
  top: 0; right: 0;
  margin-top: 4px;
}
.sun {
  width: 50px; height: 50px;
  background: radial-gradient(circle, #FFD54F, #FFCA28);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255,213,79,0.6);
  flex-shrink: 0;
}
.sun.pulsing { animation: sunPulse 2s ease-in-out infinite; }
@keyframes sunPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(255,213,79,0.6); }
  50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(255,213,79,0.8); }
}

/* 地面 */
.tree-ground {
  grid-column: 1 / 4;
  grid-row: 3;
  position: relative;
  height: 8px;
  background: linear-gradient(to top, #8D6E63, #A1887F);
  border-radius: 0 0 24px 24px;
  width: calc(100% + 32px);
  margin-left: -16px;
}

/* 浇水动画 */
.watering-area {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}
.water-drop {
  position: absolute;
  width: 8px; height: 12px;
  background: linear-gradient(180deg, #4FC3F7, #29B6F6);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: dripFall 1s ease-in forwards;
  pointer-events: none;
  z-index: 10;
  opacity: 0.9;
}
@keyframes dripFall {
  0% { transform: translateY(0) scale(1); opacity: 0.9; }
  70% { opacity: 1; }
  100% { transform: translateY(180px) scale(0.4); opacity: 0; }
}

/* 树苗成长提示 */
.stage-toast {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #FFD700, #FFA000);
  color: #333;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 4px 15px rgba(255,215,0,0.5);
  pointer-events: none;
}
.stage-toast.positive { animation: stageUp 1.2s ease-out forwards; }
.stage-toast.negative { animation: stageDown 1.2s ease-out forwards; }
@keyframes stageUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-20px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-30px) scale(1); opacity: 0; }
}
@keyframes stageDown {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(10px) scale(0.9); opacity: 1; }
  100% { transform: translateY(15px) scale(0.8); opacity: 0; }
}

/* ============ 任务列表 ============ */
.task-section {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  flex: 1;
}
.task-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.task-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin: 0; }
.task-progress { font-size: 14px; color: var(--text-secondary); font-weight: 600; }

.task-list { list-style: none; padding: 0; margin: 0; }
.task-item {
  background: linear-gradient(135deg, #F1F8E9, #DCEDC8);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  border: 3px solid transparent;
  animation: slideIn 0.4s ease;
}
.task-item.completed {
  background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
  border-color: var(--primary);
}
.task-item.skipped {
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border-color: #FF9800;
  opacity: 0.7;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.task-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.task-content { flex: 1; }
.task-name { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.task-desc { font-size: 14px; color: var(--text-secondary); margin: 0; }
.task-points {
  font-size: 18px; font-weight: 900;
  padding: 8px 16px; border-radius: 12px; flex-shrink: 0;
}
.task-points.positive { background: linear-gradient(135deg, #4CAF50, #66BB6A); color: white; }
.task-points.negative { background: linear-gradient(135deg, #EF5350, #E57373); color: white; }
.task-buttons { display: flex; gap: 12px; justify-content: center; }
.task-btn {
  flex: 1; padding: 12px 20px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.3s ease;
}
.yes-btn { background: linear-gradient(135deg, #4CAF50, #66BB6A); color: white; }
.yes-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(76,175,80,0.4); }
.no-btn { background: linear-gradient(135deg, #FF7043, #FF5722); color: white; }
.no-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255,112,67,0.4); }

.completion-message {
  text-align: center; padding: 20px; margin-top: 16px;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-radius: 16px;
  opacity: 0; transform: translateY(10px);
  transition: all 0.4s ease;
}
.completion-message.visible { opacity: 1; transform: translateY(0); }
.completion-message h3 { margin: 0 0 8px 0; color: var(--primary-dark); font-size: 18px; }
.completion-message p { margin: 0; color: var(--text-secondary); font-size: 14px; }

.refresh-btn {
  display: block; width: 100%; padding: 16px;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; border-radius: 16px;
  font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76,175,80,0.3);
}
.refresh-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(76,175,80,0.4); }

.back-link {
  position: fixed; top: 16px; left: 16px;
  background: rgba(255,255,255,0.95); padding: 10px 18px;
  border-radius: 12px; text-decoration: none; color: var(--primary-dark);
  font-weight: 700; font-size: 14px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease; z-index: 100;
}
.back-link:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }

.empty-msg { text-align: center; color: #999; padding: 30px 0; font-size: 14px; }

/* 加载动画 */
.loading-msg { text-align: center; color: #999; padding: 30px 0; font-size: 14px; }
