/* 🌸 kid-savings.css - 养娃强制攒钱机 · 日系轻拟物与流体玻璃升级样式 */

:root {
  --kid-bg-main: #fcf9f5;
  --kid-ink: #2d2627;
  --kid-ink-light: #5e5256;
  --kid-ink-muted: #96888c;
  
  --kid-sakura-pink: #f28b9f;
  --kid-sakura-soft: #ffe4ec;
  --kid-sakura-glow: rgba(242, 139, 159, 0.35);
  
  --kid-warm-orange: #f59e0b;
  --kid-fresh-blue: #3b82f6;
  --kid-love-red: #ef4444;
  --kid-emerald-green: #10b981;
  --kid-gold: #f59e0b;
  
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 12px 36px rgba(180, 140, 150, 0.12);
  --glass-glow: 0 0 20px rgba(242, 139, 159, 0.18);
  
  --font-main: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
  --radius-panel: 22px;
  --radius-btn: 14px;
}

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

body.kid-game-body {
  font-family: var(--font-main);
  background-color: var(--kid-bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 228, 236, 0.7) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(254, 243, 199, 0.6) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(243, 244, 246, 0.5) 0%, transparent 100%);
  color: var(--kid-ink);
  min-height: 100vh;
  padding: 24px 16px 60px;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 环境光晕 */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}
.ambient-glow--top {
  width: 450px;
  height: 450px;
  top: -100px;
  left: -80px;
  background: radial-gradient(circle, rgba(242, 139, 159, 0.25) 0%, transparent 70%);
}
.ambient-glow--bottom {
  width: 500px;
  height: 500px;
  bottom: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
}

.game-container {
  max-width: 1020px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* 顶部导航与操作 */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.game-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.game-brand__icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0f5, #ffe4ec);
  border: 1px solid rgba(242, 139, 159, 0.3);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
}
.game-brand__text h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--kid-ink);
  line-height: 1.2;
}
.game-brand__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #c8415d;
  background: rgba(242, 139, 159, 0.2);
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 3px;
}

.game-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.glass-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-btn);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  color: var(--kid-ink-light);
  box-shadow: 0 4px 14px rgba(100, 80, 90, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.glass-btn:hover {
  transform: translateY(-2px);
  color: var(--kid-ink);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 18px rgba(242, 139, 159, 0.2);
}
.glass-btn:active {
  transform: translateY(1px);
}
.glass-btn.btn-ctrl--danger {
  color: #d9435e;
}
.glass-btn.btn-ctrl--danger:hover {
  background: #ffebee;
  border-color: rgba(239, 68, 68, 0.3);
}

/* 主网格 */
.game-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 860px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
}

/* 玻璃卡片 */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-panel);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  position: relative;
}

/* 娃的成长卡片 */
.kid-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kid-halo {
  position: relative;
  margin-bottom: 12px;
}
.kid-avatar-wrap {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #fff3f7);
  display: grid;
  place-items: center;
  border: 2px solid rgba(242, 139, 159, 0.4);
  box-shadow: 0 8px 24px rgba(242, 139, 159, 0.25);
  position: relative;
  z-index: 1;
}
.kid-avatar {
  font-size: 52px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kid-avatar-wrap:hover .kid-avatar {
  transform: scale(1.15) rotate(5deg);
}

.kid-identity {
  width: 100%;
  margin-bottom: 20px;
}
.kid-age {
  font-size: 22px;
  font-weight: 900;
  color: var(--kid-ink);
}
.kid-stage-desc {
  font-size: 13px;
  color: var(--kid-ink-muted);
  margin-top: 4px;
}
.kid-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(220, 205, 215, 0.3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}
.kid-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f28b9f, #f59e0b);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.kid-progress-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--kid-ink-muted);
  margin-top: 5px;
}

/* 三大属性状态条 */
.meters-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255, 255, 255, 0.5);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}
.meter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.meter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}
.meter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kid-ink-light);
}
.meter-val {
  color: var(--kid-ink);
}
.meter-track {
  width: 100%;
  height: 10px;
  background: rgba(235, 225, 230, 0.4);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s;
}
.meter-track--food .meter-fill {
  background: linear-gradient(90deg, #f97316, #fb923c);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}
.meter-track--edu .meter-fill {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.meter-track--love .meter-fill {
  background: linear-gradient(90deg, #ef4444, #f87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

/* 财务面板统计 */
.stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 14px;
  padding: 12px;
  text-align: left;
}
.stat-card--highlight {
  background: linear-gradient(135deg, #fff5f7, #ffffff);
  border-color: rgba(242, 139, 159, 0.35);
}
.stat-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--kid-ink-muted);
}
.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 900;
  color: #c83253;
  margin: 4px 0 2px;
}
.stat-value--warning {
  color: #ea580c;
}
.stat-sub {
  font-size: 10px;
  color: var(--kid-ink-muted);
}

/* 右侧账单区 */
.bill-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.creditor-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.creditor-badge {
  font-size: 11px;
  font-weight: 800;
  color: #b03a54;
  background: rgba(242, 139, 159, 0.18);
  padding: 3px 8px;
  border-radius: 6px;
}
.creditor-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--kid-ink);
}
.bill-id-tag {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 800;
  color: var(--kid-ink-muted);
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 拟物信函账单 */
.bill-letter {
  background: linear-gradient(175deg, #ffffff 0%, #fffdfa 100%);
  border: 2px dashed #e8ded4;
  border-radius: 18px;
  padding: 26px 24px;
  position: relative;
  box-shadow: 0 8px 24px rgba(100, 70, 80, 0.06);
  overflow: hidden;
  transition: transform 0.3s;
}
.bill-letter.shake {
  animation: billShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes billShake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.bill-stamp {
  position: absolute;
  top: 14px;
  right: 18px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 900;
  color: #dc2626;
  border: 2px solid #dc2626;
  border-radius: 6px;
  padding: 2px 8px;
  transform: rotate(12deg);
  opacity: 0.85;
  letter-spacing: 1px;
}
.bill-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #dc2626;
  background: #fee2e2;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.bill-reason {
  font-size: 18px;
  font-weight: 800;
  color: var(--kid-ink);
  line-height: 1.4;
}
.bill-detail {
  font-size: 13px;
  color: var(--kid-ink-light);
  line-height: 1.6;
  margin-top: 6px;
}

.bill-amount-wrap {
  margin: 18px 0 10px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #c82449;
}
.currency-symbol {
  font-size: 20px;
  font-weight: 800;
}
.bill-amount {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1.5px;
  font-family: ui-monospace, monospace;
}

.bill-countdown-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #ea580c;
  margin-bottom: 18px;
}
.bill-countdown-bar.overdue {
  color: #dc2626;
}

/* 打款按钮组 */
.bill-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-pay {
  flex: 2;
  min-width: 170px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(135deg, #e63956, #c82343);
  border: none;
  border-radius: var(--radius-btn);
  box-shadow: 0 6px 20px rgba(225, 45, 80, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(225, 45, 80, 0.45);
}
.btn-pay:active {
  transform: translateY(1px);
}

.btn-skip {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: var(--kid-ink-muted);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e0d5cb;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-skip:hover {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.4);
  background: #fff5f5;
}

/* 已打款遮罩 */
.bill-paid-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: #ecfdf5;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  color: #059669;
  font-size: 16px;
  font-weight: 800;
  margin-top: 10px;
}

/* 流水日志 */
.log-panel {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 16px;
}
.log-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.log-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--kid-ink-light);
  display: flex;
  align-items: center;
  gap: 6px;
}
.log-clear-btn {
  font-size: 11px;
  color: var(--kid-ink-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
}
.log-clear-btn:hover {
  color: var(--kid-ink);
}
.log-scroll-area {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}
.log-scroll-area::-webkit-scrollbar {
  width: 5px;
}
.log-scroll-area::-webkit-scrollbar-thumb {
  background: #d8cdd2;
  border-radius: 4px;
}
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.log-item__icon {
  flex-shrink: 0;
  font-size: 14px;
}
.log-item__content {
  flex: 1;
}
.log-item.log-item--pay .log-item__content {
  color: #059669;
}
.log-item.log-item--miss .log-item__content {
  color: #dc2626;
  font-weight: 700;
}

/* 弹窗模态框 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 20, 25, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}
.modal-overlay[hidden] {
  display: none !important;
}

.glass-modal {
  max-width: 520px;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(80, 40, 50, 0.25);
  padding: 36px 30px;
  text-align: center;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes modalPopIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}
.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--kid-ink);
  margin-bottom: 8px;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--kid-ink-light);
  line-height: 1.6;
  margin-bottom: 20px;
}

.setup-group {
  margin-bottom: 18px;
  text-align: left;
}
.setup-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--kid-ink);
  margin-bottom: 10px;
}
.tier-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.tier-card {
  padding: 12px 10px;
  background: #faf8f5;
  border: 2px solid #e8e0d7;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.tier-card strong {
  display: block;
  font-size: 13px;
  color: var(--kid-ink);
}
.tier-card span {
  display: block;
  font-size: 11px;
  color: var(--kid-ink-muted);
  margin-top: 3px;
}
.tier-card.active {
  border-color: #e63956;
  background: #fff5f7;
  box-shadow: 0 4px 12px rgba(230, 57, 86, 0.15);
}
.tier-card.active strong {
  color: #c82343;
}

.btn-modal-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #e63956, #c82343);
  border: none;
  border-radius: var(--radius-btn);
  box-shadow: 0 6px 20px rgba(225, 45, 80, 0.3);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: 10px;
}
.btn-modal-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(225, 45, 80, 0.4);
}

.end-money-box {
  background: #fff5f7;
  border: 1px solid rgba(242, 139, 159, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.end-money-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--kid-ink-muted);
}
.end-money-val {
  font-size: 32px;
  font-weight: 900;
  color: #c82343;
  font-family: ui-monospace, monospace;
  margin-top: 4px;
}
.end-note {
  font-size: 12px;
  color: var(--kid-ink-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* 页脚说明 */
.game-footer {
  text-align: center;
  font-size: 12px;
  color: var(--kid-ink-muted);
  margin-top: 36px;
  line-height: 1.8;
}
