/* ===== 家庭奖惩管理系统 - 可爱粉紫风格 ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --pink: #ff8fb3;
  --pink-light: #ffc2d6;
  --purple: #a78bfa;
  --purple-light: #ddd6fe;
  --blue: #7dd3fc;
  --blue-light: #e0f2fe;
  --yellow: #fde68a;
  --green: #86efac;
  --red: #fca5a5;
  --text: #4a3a5c;
  --text-light: #7c6a8a;
  --white: #ffffff;
  --shadow: 0 8px 24px rgba(167, 139, 250, 0.18);
  --shadow-soft: 0 4px 14px rgba(255, 143, 179, 0.15);
  --radius: 22px;
  --radius-sm: 14px;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "ZCOOL KuaiLe", "Comic Sans MS", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #ffd6ec 0%, #e0c3fc 45%, #c2e9fb 100%);
  background-attachment: fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 30px;
}

/* 浮动装饰元素 */
.decor {
  position: fixed;
  pointer-events: none;
  font-size: 26px;
  opacity: 0.75;
  z-index: 0;
  animation: floaty 6s ease-in-out infinite;
}
.decor.d1 { top: 8%; left: 5%; animation-delay: 0s; }
.decor.d2 { top: 15%; right: 6%; animation-delay: 1s; font-size: 32px; }
.decor.d3 { top: 50%; left: 3%; animation-delay: 2s; font-size: 22px; }
.decor.d4 { top: 70%; right: 4%; animation-delay: 0.5s; }
.decor.d5 { top: 85%; left: 8%; animation-delay: 1.5s; font-size: 28px; }
.decor.d6 { top: 30%; left: 50%; animation-delay: 2.5s; font-size: 24px; opacity: 0.5; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* 容器 */
.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 14px 40px;
  position: relative;
  z-index: 1;
}

/* 顶部标题栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  border: 2px solid rgba(255, 255, 255, 0.8);
}
.topbar .user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}
.topbar .avatar {
  font-size: 30px;
}
.topbar .star-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #7c4a03;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 3px 8px rgba(251, 191, 36, 0.35);
}

/* 导航 */
.nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 4px 2px;
}
.nav a {
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  padding: 9px 16px;
  border-radius: 18px;
  font-size: 14px;
  white-space: nowrap;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.nav a.active, .nav a:hover {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

/* 卡片 */
.card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}
.card h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card h3 {
  font-size: 16px;
  margin: 10px 0 8px;
  color: var(--text);
}

/* 大星星显示 */
.big-star {
  text-align: center;
  padding: 10px 6px 6px;
}
.big-star .num {
  font-size: 56px;
  font-weight: bold;
  background: linear-gradient(135deg, #f59e0b, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.big-star .label {
  font-size: 15px;
  color: var(--text-light);
}
.big-star .star-emoji {
  font-size: 34px;
  display: block;
  margin-bottom: 2px;
  animation: spin 8s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 按钮 */
.btn {
  display: inline-block;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
  transition: all 0.2s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(167, 139, 250, 0.4); }
.btn:active { transform: translateY(0); }
.btn.full { display: block; width: 100%; }
.btn.green { background: linear-gradient(135deg, #86efac, #34d399); box-shadow: 0 4px 12px rgba(52, 211, 153, 0.3); }
.btn.blue { background: linear-gradient(135deg, #7dd3fc, #60a5fa); box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3); }
.btn.yellow { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #7c4a03; box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35); }
.btn.red { background: linear-gradient(135deg, #fca5a5, #f87171); box-shadow: 0 4px 12px rgba(248, 113, 113, 0.3); }
.btn.gray { background: linear-gradient(135deg, #e5e7eb, #d1d5db); color: #6b7280; }
.btn.sm { padding: 7px 14px; font-size: 13px; border-radius: 14px; }

/* 表单 */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text);
}
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--purple-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
}
textarea { resize: vertical; min-height: 60px; }

.form-row {
  display: flex;
  gap: 10px;
}
.form-row > * { flex: 1; }

/* 登录页 */
.login-wrap {
  max-width: 380px;
  margin: 40px auto 0;
}
.login-card {
  text-align: center;
  padding: 30px 24px;
}
.login-card .logo {
  font-size: 60px;
  margin-bottom: 8px;
  display: block;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.login-card .title {
  font-size: 26px;
  color: var(--text);
  margin-bottom: 4px;
}
.login-card .subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 22px;
}
.login-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 14px;
  border-radius: 14px;
  text-align: left;
}

/* 小朋友列表 */
.child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.child-card {
  background: linear-gradient(135deg, rgba(255, 194, 214, 0.5), rgba(221, 214, 254, 0.5));
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
}
.child-card .avatar { font-size: 36px; }
.child-card .name { font-size: 16px; margin: 4px 0; }
.child-card .stars {
  font-size: 14px; color: #b45309; font-weight: bold;
  display: inline-flex; align-items: center; gap: 3px;
}

/* 商城网格 */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.shop-item {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.shop-item .emoji { font-size: 38px; }
.shop-item .name { font-size: 14px; font-weight: bold; }
.shop-item .desc { font-size: 11px; color: var(--text-light); min-height: 26px; }
.shop-item .cost {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #7c4a03;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: bold;
}
.shop-item .tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
}
.shop-item .tag.gift { background: var(--pink); }
.shop-item .tag.activity { background: var(--blue); }

/* 记录列表 */
.log-list {
  list-style: none;
}
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.25);
}
.log-item:last-child { border-bottom: none; }
.log-item .icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.log-item .icon.plus { background: rgba(134, 239, 172, 0.4); }
.log-item .icon.minus { background: rgba(252, 165, 165, 0.4); }
.log-item .icon.exchange { background: rgba(125, 211, 252, 0.4); }
.log-item .body { flex: 1; min-width: 0; }
.log-item .body .top { font-size: 14px; }
.log-item .body .meta { font-size: 11px; color: var(--text-light); }
.log-item .delta {
  font-weight: bold;
  font-size: 16px;
}
.log-item .delta.plus { color: #16a34a; }
.log-item .delta.minus { color: #dc2626; }

/* 状态标签 */
.status {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: bold;
}
.status.pending { background: rgba(253, 230, 138, 0.6); color: #92400e; }
.status.approved { background: rgba(134, 239, 172, 0.6); color: #166534; }
.status.rejected { background: rgba(252, 165, 165, 0.6); color: #991b1b; }

/* 消息提示 */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash.ok { background: rgba(134, 239, 172, 0.5); color: #166534; }
.flash.err { background: rgba(252, 165, 165, 0.55); color: #991b1b; }
.flash.warn { background: rgba(253, 230, 138, 0.6); color: #92400e; }

/* 待办徽章 */
.badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 24px 10px;
  color: var(--text-light);
  font-size: 14px;
}
.empty .emoji { font-size: 40px; display: block; margin-bottom: 8px; opacity: 0.6; }

/* 行内表单 */
.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.inline-form input, .inline-form select {
  padding: 8px 10px;
  font-size: 14px;
  flex: 1 1 auto;
  min-width: 0;
}
.inline-form .btn { flex: 0 0 auto; }

/* 详情行 */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.2);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .v { font-weight: bold; }

/* 操作按钮组 */
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

table.mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.mini th, table.mini td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.2);
}
table.mini th { color: var(--text-light); font-weight: normal; }

/* 小屏适配 */
@media (max-width: 360px) {
  .shop-grid { grid-template-columns: 1fr; }
  .big-star .num { font-size: 46px; }
}

/* 折叠区块（添加小朋友） */
.toggle-summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  padding: 4px 0;
}
.toggle-summary::-webkit-details-marker { display: none; }
.toggle-summary::before {
  content: "▸";
  font-size: 16px;
  color: var(--purple);
  transition: transform 0.2s;
}
details[open] .toggle-summary::before {
  transform: rotate(90deg);
}
/* date 输入框适配 */
input[type=date] {
  font-family: inherit;
}

/* ===== 日期控件美化 ===== */
input[type=date] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--purple-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
input[type=date]:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.18);
}
input[type=date]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(35%) sepia(45%) saturate(650%) hue-rotate(235deg) brightness(0.95);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
}
input[type=date]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.12);
}
input[type=date]::-moz-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(35%) sepia(45%) saturate(650%) hue-rotate(235deg) brightness(0.95);
  opacity: 0.85;
}

/* ===== 日历视图 ===== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
}
.cal-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(167,139,250,0.15);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.cal-nav:hover {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  transform: scale(1.08);
}
.cal-month-total {
  text-align: center;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 12px;
}
.cal-month-total b { font-size: 18px; }
.cal-month-total b.plus { color: #16a34a; }
.cal-month-total b.minus { color: #dc2626; }
.cal-today-link {
  display: inline-block;
  margin-left: 10px;
  font-size: 12px;
  color: var(--purple);
  text-decoration: none;
  padding: 2px 8px;
  background: rgba(167,139,250,0.15);
  border-radius: 10px;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.cal-weekdays > div {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  font-weight: bold;
  padding: 4px 0;
}
.cal-weekdays > div:first-child, .cal-weekdays > div:last-child {
  color: var(--pink);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1 / 1.05;
  background: rgba(255,255,255,0.6);
  border-radius: 10px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  transition: all 0.15s;
  min-height: 48px;
}
.cal-cell.out {
  background: transparent;
  opacity: 0.25;
  cursor: default;
}
.cal-cell:hover:not(.out) {
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.cal-cell.today {
  border-color: var(--pink);
  background: rgba(255,194,214,0.4);
}
.cal-cell.selected {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  box-shadow: var(--shadow-soft);
  border-color: rgba(255,255,255,0.7);
}
.cal-cell.selected .cal-day { color: #fff; }
.cal-day {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.2;
}
.cal-total {
  font-size: 12px;
  font-weight: bold;
  margin-top: 2px;
}
.cal-total.plus { color: #16a34a; }
.cal-total.minus { color: #dc2626; }
.cal-cell.selected .cal-total { color: #fff; }
.cal-cnt {
  font-size: 9px;
  color: var(--text-light);
}
.cal-cell.selected .cal-cnt { color: rgba(255,255,255,0.85); }
.login-details {
  text-align: left;
  margin-top: 18px;
}

/* ===== 兑换确认弹框 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(60,30,80,0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 20px;
}
.modal-mask.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: linear-gradient(160deg, #fff 0%, #fff5fb 100%);
  border-radius: 24px;
  padding: 24px 22px 18px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(120,60,140,0.35);
  transform: scale(0.85);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
  border: 2px solid rgba(255,255,255,0.8);
}
.modal-mask.show .modal-card { transform: scale(1); }
.modal-emoji {
  font-size: 56px;
  margin-bottom: 6px;
  line-height: 1;
}
.modal-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 4px;
}
.modal-name {
  font-size: 16px;
  color: var(--purple);
  font-weight: bold;
  margin-bottom: 16px;
}
.modal-info {
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 6px 0;
  color: var(--text-light);
}
.modal-row b { font-size: 15px; color: var(--text); }
.modal-row b.minus { color: #dc2626; }
.modal-row b.plus { color: #16a34a; }
.modal-row.total {
  border-top: 1px dashed rgba(167,139,250,0.4);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: bold;
}
.modal-tip {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions .btn { flex: 1; }

/* ===== v2: 主页文件夹 + APP图标网格 ===== */
.topbar-badges { display:flex; gap:6px; align-items:center; }
.coin-badge {
  display:inline-flex; align-items:center; gap:3px;
  background:linear-gradient(135deg,#fde68a,#f59e0b);
  color:#7c4a03; padding:5px 12px; border-radius:20px;
  font-size:15px; font-weight:bold;
  box-shadow:0 3px 8px rgba(245,158,11,0.35);
}
.balance-card {
  display:flex; align-items:center; justify-content:space-around;
  padding:18px 10px;
}
.bal-item { text-align:center; flex:1; }
.bal-emoji { font-size:30px; }
.bal-num {
  font-size:34px; font-weight:bold; line-height:1.1;
  background:linear-gradient(135deg,#f59e0b,#ec4899);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
.bal-label { font-size:13px; color:var(--text-light); }
.bal-divider { width:1px; height:50px; background:rgba(167,139,250,0.3); }

.folder-section {
  display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:4px;
}
.folder-card {
  background:rgba(255,255,255,0.85);
  border-radius:var(--radius); padding:22px 14px;
  text-align:center; text-decoration:none; color:var(--text);
  border:2px solid rgba(255,255,255,0.9);
  box-shadow:var(--shadow);
  transition:all 0.2s;
}
.folder-card:hover { transform:translateY(-3px); box-shadow:0 10px 24px rgba(167,139,250,0.3); }
.folder-icon { font-size:48px; margin-bottom:8px; }
.folder-name { font-size:17px; font-weight:bold; }
.folder-desc { font-size:11px; color:var(--text-light); margin-top:4px; }

/* APP 图标网格 */
.app-grid {
  display:grid; grid-template-columns:repeat(4,1fr); gap:14px 8px; padding:6px 2px;
}
.app-icon {
  text-decoration:none; color:var(--text);
  display:flex; flex-direction:column; align-items:center; gap:5px;
  padding:6px 2px; border-radius:14px; transition:all 0.15s;
}
.app-icon:hover { background:rgba(255,255,255,0.6); transform:translateY(-2px); }
.app-emoji {
  font-size:32px; width:58px; height:58px;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, rgba(255,194,214,0.6), rgba(221,214,254,0.6));
  border-radius:16px;
  box-shadow:0 4px 10px rgba(255,143,179,0.2);
  border:1.5px solid rgba(255,255,255,0.8);
}
.app-label { font-size:12px; text-align:center; line-height:1.2; }

/* ===== 开心币发放卡片 ===== */
.coin-grant-card {
  border:2px dashed rgba(245,158,11,0.4);
  border-radius:14px; padding:12px; margin-bottom:12px;
}
.coin-grant-head {
  display:flex; justify-content:space-between; align-items:center;
  font-size:16px; font-weight:bold; margin-bottom:10px;
}

/* ===== 星星换币 ===== */
.exchange-rate {
  display:flex; align-items:center; justify-content:center; gap:18px;
  margin:14px 0;
}
.er-item { font-size:22px; font-weight:bold; padding:10px 20px; border-radius:16px; background:rgba(255,255,255,0.7); }
.er-item.gold { background:linear-gradient(135deg,#fde68a,#f59e0b); color:#7c4a03; }
.er-arrow { font-size:26px; color:var(--purple); }
.exchange-preview {
  font-size:15px; color:var(--text); margin-bottom:14px;
  padding:10px; background:rgba(255,255,255,0.7); border-radius:12px;
}
.exchange-preview b { color:#b45309; font-size:18px; }

/* ===== 公主换装 ===== */
.princess-grid {
  display:grid; grid-template-columns:repeat(2,1fr); gap:14px;
}
.princess-card {
  background:rgba(255,255,255,0.9); border-radius:var(--radius);
  padding:12px 10px 14px; text-align:center; text-decoration:none; color:var(--text);
  border:2px solid rgba(255,255,255,0.9); box-shadow:var(--shadow-soft);
  transition:all 0.2s; overflow:hidden;
}
.princess-card:hover { transform:translateY(-3px); box-shadow:0 10px 22px rgba(167,139,250,0.28); }
.princess-thumb {
  width:100%; aspect-ratio:3/3.6; object-fit:cover; object-position:top center;
  border-radius:16px; margin-bottom:8px;
  background:linear-gradient(135deg,#ffd6ec,#c2e9fb);
}
.princess-name { font-size:16px; font-weight:bold; }
.princess-progress { margin-top:4px; }
.progress-text { font-size:12px; color:var(--text-light); }

/* 换装舞台 */
.dress-stage { text-align:center; position:relative; overflow:hidden; }
.stage-img-wrap {
  position:relative; display:inline-block; border-radius:18px; overflow:hidden;
  box-shadow:0 8px 24px rgba(167,139,250,0.3);
}
.stage-img {
  width:200px; height:auto; display:block;
  border-radius:18px;
  background:linear-gradient(135deg,#ffd6ec,#e0c3fc);
}
.legendary-on .stage-img-wrap {
  box-shadow:0 0 0 3px #fbbf24, 0 0 28px rgba(251,191,36,0.6);
  animation:legendGlow 2s ease-in-out infinite;
}
@keyframes legendGlow {
  0%,100% { box-shadow:0 0 0 3px #fbbf24, 0 0 22px rgba(251,191,36,0.5); }
  50% { box-shadow:0 0 0 3px #fbbf24, 0 0 40px rgba(251,191,36,0.85); }
}
.legend-particles {
  position:absolute; inset:0; pointer-events:none; z-index:2;
}
.legend-particles span {
  position:absolute; font-size:18px; opacity:0;
  animation:flyUp 4s linear infinite;
}
.legend-particles span:nth-child(1){ left:10%; animation-delay:0s; }
.legend-particles span:nth-child(2){ left:30%; animation-delay:0.8s; font-size:20px; }
.legend-particles span:nth-child(3){ left:50%; animation-delay:1.6s; }
.legend-particles span:nth-child(4){ left:70%; animation-delay:2.4s; }
.legend-particles span:nth-child(5){ left:85%; animation-delay:3.2s; }
.legend-particles span:nth-child(6){ left:45%; animation-delay:1.2s; font-size:16px; }
@keyframes flyUp {
  0% { bottom:-10px; opacity:0; transform:translateX(0) scale(0.6); }
  20% { opacity:1; }
  80% { opacity:1; }
  100% { bottom:110%; opacity:0; transform:translateX(20px) scale(1.1); }
}
.stage-name { font-size:18px; font-weight:bold; margin:10px 0 12px; }

/* 当前穿搭列表 */
.wearing-list { display:flex; flex-direction:column; gap:7px; margin-top:6px; }
.wear-slot {
  display:flex; align-items:center; gap:8px;
  background:rgba(255,255,255,0.7); border-radius:12px; padding:8px 12px;
  font-size:14px; border:2px solid transparent;
}
.wear-slot.legendary { border-color:#fbbf24; background:rgba(253,230,138,0.5); }
.wear-slot.epic { border-color:var(--purple); background:rgba(221,214,254,0.5); }
.wear-slot.rare { border-color:#60a5fa; background:rgba(186,230,253,0.4); }
.wear-slot.common { border-color:rgba(156,163,175,0.5); }
.wear-slot.empty { opacity:0.6; }
.ws-emoji { font-size:20px; }
.ws-name { flex:1; text-align:left; }
.ws-rarity { font-size:10px; }

/* 稀有度标签 */
.rarity-tag {
  font-size:10px; padding:2px 8px; border-radius:8px; color:#fff; font-weight:bold;
}
.rarity-tag.common { background:#9ca3af; }
.rarity-tag.fine { background:#60a5fa; }
.rarity-tag.epic { background:#a78bfa; }
.rarity-tag.myth { background:linear-gradient(135deg,#ec4899,#f472b6); box-shadow:0 0 8px rgba(236,72,153,0.5); }
.rarity-tag.legendary {
  background:linear-gradient(135deg,#fbbf24,#f59e0b);
  box-shadow:0 0 8px rgba(251,191,36,0.6);
}

/* 分类标签 */
.cat-tabs {
  display:flex; gap:8px; margin-bottom:14px; overflow-x:auto; padding:4px 2px;
}
.cat-tab {
  flex:0 0 auto; text-decoration:none; color:var(--text);
  background:rgba(255,255,255,0.7); padding:9px 16px; border-radius:18px;
  font-size:14px; white-space:nowrap; border:2px solid transparent; transition:all 0.2s;
}
.cat-tab.active, .cat-tab:hover {
  background:linear-gradient(135deg,var(--pink),var(--purple)); color:#fff;
  border-color:rgba(255,255,255,0.7); transform:translateY(-1px);
}

/* 衣物网格 */
.clothes-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
}
.clothes-card {
  background:rgba(255,255,255,0.9); border-radius:14px; padding:10px 6px;
  text-align:center; border:2px solid transparent;
  display:flex; flex-direction:column; align-items:center; gap:5px;
  transition:all 0.15s; position:relative;
}
.clothes-card.common { border-color:rgba(156,163,175,0.4); }
.clothes-card.rare { border-color:rgba(96,165,250,0.6); box-shadow:0 0 10px rgba(96,165,250,0.2); }
.clothes-card.epic { border-color:rgba(167,139,250,0.7); box-shadow:0 0 12px rgba(167,139,250,0.3); }
.clothes-card.legendary {
  border-color:#fbbf24; box-shadow:0 0 14px rgba(251,191,36,0.5);
  background:linear-gradient(160deg,rgba(255,255,255,0.95),rgba(253,230,138,0.4));
  animation:legendCardGlow 2.5s ease-in-out infinite;
}
@keyframes legendCardGlow {
  0%,100% { box-shadow:0 0 12px rgba(251,191,36,0.4); }
  50% { box-shadow:0 0 20px rgba(251,191,36,0.7); }
}
.clothes-card.owned { background:linear-gradient(160deg,rgba(255,255,255,0.95),rgba(134,239,172,0.25)); }
.clothes-card.wearing-now {
  background:linear-gradient(135deg,rgba(255,194,214,0.6),rgba(221,214,254,0.6));
  border-width:3px;
}
.cc-emoji { font-size:30px; }
.cc-name { font-size:12px; line-height:1.2; min-height:28px; }
.cc-status { font-size:11px; color:var(--text-light); }
.cc-status.wearing { color:#16a34a; font-weight:bold; }
.cc-status.owned { color:var(--text-light); }
.cc-status.locked { color:#b45309; font-weight:bold; }

@media (max-width:360px){
  .clothes-grid { grid-template-columns:repeat(2,1fr); }
  .app-grid { grid-template-columns:repeat(3,1fr); }
  .folder-section { grid-template-columns:1fr; }
}

/* ===== v3: 目录吸顶条 + 子页加载 ===== */
.cat-bar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 14px;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.cat-bar-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 8px;
}
.cat-back { text-decoration:none; font-size:17px; color:var(--text); white-space:nowrap; }
.cat-bar-title { font-size:18px; font-weight:bold; flex:1; }
.cat-bar .app-grid { padding: 4px 2px; }

/* 收缩态：吸顶固定，图标变小横向排列 */
.cat-bar.collapsed {
  position: sticky; top: 0; z-index: 50;
  padding: 8px 12px 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px rgba(167,139,250,0.25);
}
.cat-bar.collapsed .cat-bar-head { margin-bottom: 8px; }
.cat-bar.collapsed .cat-bar-title { font-size: 15px; }
.cat-bar.collapsed .app-grid {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0;
  grid-template-columns: none;
}
.cat-bar.collapsed .app-icon { flex: 0 0 auto; flex-direction: row; gap: 4px; padding: 4px 8px; }
.cat-bar.collapsed .app-emoji { width: auto; height: auto; font-size: 18px; background: none; box-shadow: none; border: none; padding: 0; }
.cat-bar.collapsed .app-label { font-size: 11px; white-space: nowrap; }
.cat-bar.collapsed .app-icon.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; border-radius: 12px;
}
.cat-bar.collapsed .app-icon.active .app-emoji,
.cat-bar.collapsed .app-icon.active .app-label { color: #fff; }

/* 子页容器 */
#subPage.subpage-empty { display: none; }
#subPage:not(.subpage-empty) {
  min-height: 60vh;
}
.sub-loading {
  text-align: center; padding: 30px; color: var(--text-light); font-size: 14px;
}
.sub-loading .emoji { font-size: 32px; display: block; margin-bottom: 8px; animation: bounce 1s infinite; }

/* 子页加载后，因为已剥离 topbar，卡片直接展示；移除底部多余 padding */

/* ===== v4: 游戏人物界面布局 ===== */

/* ===== 公主升级系统 ===== */
.princess-thumb-wrap {
  border-radius: 16px; overflow: hidden; margin-bottom: 8px;
  position: relative;
}
.princess-thumb-wrap.myth { box-shadow: 0 0 12px rgba(236,72,153,0.5); }
.princess-thumb-wrap.legendary { box-shadow: 0 0 16px rgba(251,191,36,0.6); }

/* 展示舞台 */
.dress-stage { text-align: center; position: relative; overflow: hidden; }
.stage-center {
  display: flex; flex-direction: column; align-items: center;
}
.stage-center .stage-img-wrap {
  position: relative; display: inline-block; border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(167,139,250,0.3);
}
.stage-img {
  width: 220px; height: auto; display: block; border-radius: 18px;
  background: linear-gradient(135deg,#ffd6ec,#e0c3fc);
}
.myth-stage .stage-img-wrap {
  box-shadow: 0 0 0 3px #ec4899, 0 0 28px rgba(236,72,153,0.6);
  animation: mythGlow 2.5s ease-in-out infinite;
}
.legendary-stage .stage-img-wrap {
  box-shadow: 0 0 0 3px #fbbf24, 0 0 32px rgba(251,191,36,0.7);
  animation: legendGlow 2s ease-in-out infinite;
}
@keyframes mythGlow {
  0%,100% { box-shadow: 0 0 0 3px #ec4899, 0 0 20px rgba(236,72,153,0.5); }
  50% { box-shadow: 0 0 0 3px #ec4899, 0 0 40px rgba(236,72,153,0.85); }
}
@keyframes legendGlow {
  0%,100% { box-shadow: 0 0 0 3px #fbbf24, 0 0 22px rgba(251,191,36,0.5); }
  50% { box-shadow: 0 0 0 3px #fbbf24, 0 0 45px rgba(251,191,36,0.9); }
}

/* 神话光效 */
.myth-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at 50% 40%, rgba(236,72,153,0.25), transparent 60%);
  animation: mythPulse 3s ease-in-out infinite;
}
@keyframes mythPulse {
  0%,100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* 传说漂浮粒子 */
.legend-particles {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.legend-particles span {
  position: absolute; font-size: 18px; opacity: 0;
  animation: flyUp 4s linear infinite;
}
.legend-particles span:nth-child(1){ left:10%; animation-delay:0s; }
.legend-particles span:nth-child(2){ left:30%; animation-delay:0.8s; font-size:20px; }
.legend-particles span:nth-child(3){ left:50%; animation-delay:1.6s; }
.legend-particles span:nth-child(4){ left:70%; animation-delay:2.4s; }
.legend-particles span:nth-child(5){ left:85%; animation-delay:3.2s; }
.legend-particles span:nth-child(6){ left:45%; animation-delay:1.2s; font-size:16px; }
@keyframes flyUp {
  0% { bottom:-10px; opacity:0; transform:translateX(0) scale(0.6); }
  20% { opacity:1; }
  80% { opacity:1; }
  100% { bottom:110%; opacity:0; transform:translateX(20px) scale(1.1); }
}
.stage-name { font-size: 18px; font-weight: bold; margin: 10px 0 8px; }

/* 升级路径 */
.upgrade-path {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin: 14px 0 10px; flex-wrap: wrap;
}
.upgrade-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: bold; color: #fff;
  border: 2px solid transparent;
}
.step-circle.common { background: #9ca3af; }
.step-circle.fine { background: #60a5fa; }
.step-circle.epic { background: #a78bfa; }
.step-circle.myth { background: linear-gradient(135deg,#ec4899,#f472b6); box-shadow: 0 0 8px rgba(236,72,153,0.5); }
.step-circle.legendary { background: linear-gradient(135deg,#fbbf24,#f59e0b); box-shadow: 0 0 10px rgba(251,191,36,0.6); }
.upgrade-step.done .step-circle { opacity: 0.6; }
.upgrade-step.current .step-circle { transform: scale(1.15); box-shadow: 0 0 12px rgba(167,139,250,0.6); }
.upgrade-step.locked .step-circle { background: #d1d5db; color: #9ca3af; }
.step-name { font-size: 11px; font-weight: bold; }
.step-name.common { color: #9ca3af; }
.step-name.fine { color: #60a5fa; }
.step-name.epic { color: #a78bfa; }
.step-name.myth { color: #ec4899; }
.step-name.legendary { color: #f59e0b; }
.upgrade-step.locked .step-name { color: #d1d5db; }
.upgrade-arrow {
  font-size: 16px; color: #d1d5db; margin: 0 2px;
  align-self: flex-start; margin-top: 8px;
}
.upgrade-arrow.reached { color: #a78bfa; }

/* 升级操作区 */
.upgrade-action {
  margin-top: 14px; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,219,230,0.6), rgba(221,214,254,0.6));
  text-align: center;
}
.upgrade-info {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
  font-size: 14px; margin-bottom: 12px;
}
.rarity-text.common { color: #9ca3af; }
.rarity-text.fine { color: #60a5fa; }
.rarity-text.epic { color: #a78bfa; }
.rarity-text.myth { color: #ec4899; }
.rarity-text.legendary { color: #f59e0b; }
.max-level {
  text-align: center; padding: 16px; font-size: 16px; font-weight: bold;
  color: #f59e0b; background: linear-gradient(135deg, rgba(253,230,138,0.4), rgba(255,194,214,0.4));
  border-radius: 14px; margin-top: 10px;
}

/* 形态画廊 */
.tier-gallery {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}
.tier-card {
  text-align: center; border-radius: 12px; padding: 6px 4px;
  border: 2px solid transparent; position: relative;
  background: rgba(255,255,255,0.7); transition: all 0.2s;
}
.tier-card.common { border-color: rgba(156,163,175,0.4); }
.tier-card.fine { border-color: rgba(96,165,250,0.6); }
.tier-card.epic { border-color: rgba(167,139,250,0.7); box-shadow: 0 0 8px rgba(167,139,250,0.2); }
.tier-card.myth { border-color: #ec4899; box-shadow: 0 0 10px rgba(236,72,153,0.3); }
.tier-card.legendary {
  border-color: #fbbf24; box-shadow: 0 0 12px rgba(251,191,36,0.4);
  background: linear-gradient(160deg,rgba(255,255,255,0.95),rgba(253,230,138,0.3));
}
.tier-card.current { border-width: 3px; transform: scale(1.05); }
.tier-card.locked { opacity: 0.5; filter: grayscale(0.6); }
.tier-img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top center;
  border-radius: 8px; background: linear-gradient(135deg,#ffd6ec,#c2e9fb);
}
.tier-label { font-size: 11px; font-weight: bold; margin-top: 4px; }
.tier-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; padding: 1px 5px; border-radius: 6px; color: #fff;
}
.tier-badge.current { background: #a78bfa; }
.tier-badge.done { background: #22c55e; }
.tier-badge.locked { background: #9ca3af; }

@media (max-width: 380px) {
  .tier-gallery { grid-template-columns: repeat(3, 1fr); }
  .stage-img { width: 180px; }
}

/* ===== 形态切换按钮 ===== */
.tier-form { margin: 0; padding: 0; }
.tier-btn {
  display: block; width: 100%; padding: 0; margin: 0;
  background: none; border: none; cursor: pointer;
  text-align: center; color: inherit; font: inherit;
}
.tier-btn .tier-img { display: block; }
.tier-badge.switch {
  background: linear-gradient(135deg, #a78bfa, #ec4899);
  animation: switchPulse 2s ease-in-out infinite;
}
@keyframes switchPulse {
  0%,100% { box-shadow: 0 0 4px rgba(167,139,250,0.4); }
  50% { box-shadow: 0 0 10px rgba(236,72,153,0.7); }
}
.upgrade-step.unlocked .step-circle {
  opacity: 0.85; border: 2px dashed rgba(167,139,250,0.5);
}
.tier-card:not(.locked) { cursor: pointer; }
.tier-card:not(.locked):hover { transform: translateY(-2px); }

/* ===== 消费记录 ===== */
.type-toggle {
  display: flex; gap: 8px;
}
.type-opt {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 10px; border-radius: 12px; cursor: pointer;
  border: 2px solid rgba(167,139,250,0.2); background: rgba(255,255,255,0.7);
  transition: all 0.2s; font-size: 14px;
}
.type-opt input { display: none; }
.type-opt.expense-opt.active {
  border-color: #dc2626; background: rgba(254,202,202,0.6);
  color: #dc2626; font-weight: bold;
}
.type-opt.income-opt.active {
  border-color: #16a34a; background: rgba(187,247,208,0.6);
  color: #16a34a; font-weight: bold;
}
.fab-add {
  position: sticky; bottom: 12px; z-index: 10;
  box-shadow: 0 4px 16px rgba(167,139,250,0.4);
}

/* 消费记录-记一笔长条 */
.expense-add-bar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(255,194,214,0.7), rgba(221,214,254,0.7));
  border: 2px dashed rgba(167,139,250,0.5);
  border-radius: 14px;
  padding: 14px 18px; margin-bottom: 12px;
  cursor: pointer; transition: all 0.2s;
  color: var(--text);
}
.expense-add-bar:hover {
  background: linear-gradient(135deg, rgba(255,194,214,0.9), rgba(221,214,254,0.9));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(167,139,250,0.25);
}
.eab-icon { font-size: 20px; }
.eab-text { flex: 1; font-size: 15px; font-weight: bold; }
.eab-arrow { font-size: 20px; color: var(--text-light); }

/* ===== 益智模块 ===== */
.puzzle-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.puzzle-card {
  background: rgba(255,255,255,0.9); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; text-decoration: none; color: var(--text);
  border: 2px solid rgba(255,255,255,0.9); box-shadow: var(--shadow-soft);
  transition: all 0.2s;
}
.puzzle-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(167,139,250,0.25); }
.puzzle-emoji { font-size: 36px; margin-bottom: 6px; }
.puzzle-name { font-size: 15px; font-weight: bold; }
.puzzle-desc { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.puzzle-progress { font-size: 10px; color: var(--text-light); margin-top: 6px; padding: 4px 8px; background: rgba(167,139,250,0.1); border-radius: 8px; }

.puzzle-info {
  display: flex; justify-content: space-between; font-size: 13px; color: var(--text-light);
  background: rgba(255,255,255,0.6); padding: 8px 12px; border-radius: 10px; margin-bottom: 14px;
}
.puzzle-locked {
  background: rgba(254,202,202,0.5); color: #dc2626; padding: 10px; border-radius: 10px;
  text-align: center; font-size: 13px; margin-bottom: 14px;
}

/* 口算 - 分页版 */
.math-q-page {
  background: rgba(255,255,255,0.7); padding: 16px; border-radius: 14px; margin-bottom: 14px; text-align: center;
}
.math-q-num { font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.math-q-text { font-size: 24px; font-weight: bold; margin-bottom: 12px; color: var(--text); }
.math-input {
  width: 120px; padding: 10px; border: 2px solid rgba(167,139,250,0.3);
  border-radius: 10px; font-size: 22px; text-align: center; background: #fff;
}
.math-input:focus { outline: none; border-color: var(--purple); }
.math-nav {
  display: flex; justify-content: space-between; align-items: center; margin: 14px 0;
}
.math-nav #pageInfo { font-size: 14px; color: var(--text-light); }

/* 古诗词 - 选词填空 */
.poem-card {
  background: linear-gradient(135deg, rgba(255,250,240,0.9), rgba(255,235,205,0.7));
  border: 2px solid rgba(251,191,36,0.4); border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.poem-title { font-size: 16px; font-weight: bold; text-align: center; margin-bottom: 12px; color: #92400e; }
.poem-lines { text-align: center; }
.poem-line { font-size: 18px; line-height: 2.2; color: var(--text); }
.poem-blanks { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.poem-blank-slot {
  flex: 1; min-width: 100px; background: rgba(255,255,255,0.7); border: 2px solid rgba(251,191,36,0.3);
  border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.poem-blank-slot.active { border-color: #f59e0b; background: rgba(253,230,138,0.4); }
.blank-label { font-size: 10px; color: var(--text-light); display: block; }
.blank-fill { font-size: 16px; font-weight: bold; color: #b45309; }
.poem-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.poem-opt {
  padding: 8px 14px; background: rgba(167,139,250,0.2); border: 2px solid rgba(167,139,250,0.3);
  border-radius: 18px; font-size: 15px; cursor: pointer; transition: all 0.2s; color: var(--text);
}
.poem-opt:hover { background: rgba(167,139,250,0.4); }
.poem-opt.used { opacity: 0.3; pointer-events: none; }

/* 单词卡 - 26键拼词 */
.word-stage { text-align: center; padding: 16px 0; }
.word-progress { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.word-emoji-big { font-size: 56px; margin-bottom: 8px; }
.word-cn { font-size: 22px; font-weight: bold; color: var(--purple); margin-bottom: 14px; }
.word-spell { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.spell-slot {
  width: 36px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(167,139,250,0.4); border-radius: 8px; font-size: 20px; font-weight: bold;
  background: rgba(255,255,255,0.8); color: var(--text);
}
.spell-slot.filled { background: rgba(167,139,250,0.2); border-color: var(--purple); }
.word-keyboard {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px;
}
.word-key {
  padding: 10px 0; background: rgba(255,255,255,0.9); border: 1px solid rgba(167,139,250,0.3);
  border-radius: 8px; font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.15s; color: var(--text);
}
.word-key:hover { background: rgba(167,139,250,0.3); transform: translateY(-1px); }
.word-key:active { transform: scale(0.95); }
.word-key-del { grid-column: span 2; background: rgba(254,202,202,0.5); }
.word-bank-list { display: grid; gap: 6px; }
.word-bank-item {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.7);
  padding: 8px 12px; border-radius: 10px;
}
.wb-emoji { font-size: 20px; }
.wb-word { font-weight: bold; color: var(--purple); min-width: 80px; }
.wb-cn { color: var(--text-light); flex: 1; }

/* 听写 */
.dict-create {
  background: rgba(221,214,254,0.3); border: 2px dashed rgba(167,139,250,0.4);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.dict-list { display: grid; gap: 8px; }
.dict-task-card {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.8); padding: 12px 16px; border-radius: 12px;
  text-decoration: none; color: var(--text); border: 2px solid transparent; transition: all 0.2s;
}
.dict-task-card:hover { border-color: var(--purple); transform: translateX(4px); }
.dict-task-title { font-size: 15px; font-weight: bold; }
.dict-task-meta { font-size: 12px; color: var(--text-light); }
.dict-words { display: grid; gap: 8px; margin-bottom: 14px; }
.dict-word-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.7); padding: 10px; border-radius: 10px;
}
.dict-play-btn {
  font-size: 20px; background: rgba(167,139,250,0.2); border: none;
  border-radius: 50%; width: 36px; height: 36px; cursor: pointer; transition: all 0.2s;
}
.dict-play-btn:hover { background: rgba(167,139,250,0.4); transform: scale(1.1); }
.dict-word-num { font-size: 14px; color: var(--text-light); min-width: 24px; }
.dict-input {
  flex: 1; padding: 6px 10px; border: 2px solid rgba(167,139,250,0.3);
  border-radius: 8px; font-size: 15px; background: #fff;
}
.dict-input:focus { outline: none; border-color: var(--purple); }

@media (max-width:360px){
  .puzzle-grid { grid-template-columns: 1fr; }
}

/* 快捷奖励按钮 */
.quick-bar { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(167,139,250,0.3); }
.quick-title { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.quick-grid { display: grid; gap: 8px; }
.quick-btn {
  width: 100%; padding: 10px 14px; text-align: left;
  background: linear-gradient(135deg, rgba(167,139,250,0.15), rgba(196,181,253,0.15));
  border: 2px solid rgba(167,139,250,0.3); border-radius: 12px;
  font-size: 14px; color: var(--text); cursor: pointer; transition: all 0.2s;
}
.quick-btn:hover { background: rgba(167,139,250,0.3); transform: translateX(4px); }
.quick-btn:active { transform: scale(0.98); }

/* ===== 宠物系统 ===== */
.pet-intro { font-size: 14px; color: var(--text-light); margin-bottom: 16px; text-align: center; }
.pet-adopt-grid { display: grid; gap: 14px; }
.pet-adopt-card {
  background: linear-gradient(135deg, rgba(255,143,179,0.1), rgba(167,139,250,0.1));
  border: 2px solid rgba(255,143,179,0.2); border-radius: 18px; padding: 18px; text-align: center;
}
.pet-adopt-card.free { border-color: rgba(34,197,94,0.3); background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(255,143,179,0.08)); }
.pet-adopt-card.locked { opacity: 0.55; }
.pet-adopt-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 20px rgba(255,143,179,0.3); margin-bottom: 10px; }
.pet-adopt-name { font-size: 18px; font-weight: bold; color: var(--text); margin-bottom: 4px; }
.pet-adopt-desc { font-size: 13px; color: var(--text-light); margin-bottom: 12px; }
.pet-locked { font-size: 14px; color: var(--text-light); padding: 10px; background: rgba(0,0,0,0.05); border-radius: 10px; }
.pet-card { text-align: center; }
.pet-stage { position: relative; display: inline-block; }
.pet-img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; cursor: pointer;
  box-shadow: 0 10px 30px rgba(255,143,179,0.4); border: 4px solid #fff; transition: transform 0.2s; }
.pet-img:hover { transform: scale(1.05); }
.pet-img.jump { animation: petJump 0.5s ease; }
.pet-img.lick { animation: petLick 0.6s ease; }
.pet-img.spin { animation: petSpin 0.7s ease; }
.pet-img.wiggle { animation: petWiggle 0.5s ease; }
@keyframes petJump { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-30px) scale(1.05)} }
@keyframes petLick { 0%,100%{transform:scale(1)} 30%{transform:scale(1.08) translateY(-5px)} 60%{transform:scale(0.95)} }
@keyframes petSpin { 0%,100%{transform:rotate(0)} 50%{transform:rotate(360deg)} }
@keyframes petWiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-10deg)} 75%{transform:rotate(10deg)} }
.pet-bubble {
  position: absolute; top: -10px; right: -20px;
  background: #fff; color: var(--purple); font-size: 14px; font-weight: bold;
  padding: 6px 14px; border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0; transform: scale(0.5); transition: all 0.3s; pointer-events: none; white-space: nowrap;
}
.pet-bubble.show { opacity: 1; transform: scale(1); }
.pet-info { margin-top: 14px; }
.pet-name { font-size: 20px; font-weight: bold; color: var(--text); }
.pet-overall { font-size: 14px; color: var(--text-light); margin-top: 4px; }
.pet-state-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.pet-state-label { font-size: 14px; width: 60px; flex-shrink: 0; }
.pet-state-bar { flex: 1; height: 18px; background: rgba(0,0,0,0.06); border-radius: 9px; overflow: hidden; }
.pet-state-fill { height: 100%; border-radius: 9px; transition: width 0.4s; }
.pet-state-fill.satiety { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.pet-state-fill.cleanliness { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.pet-state-fill.mood { background: linear-gradient(90deg, #f472b6, #ec4899); }
.pet-state-val { font-size: 14px; font-weight: bold; width: 36px; text-align: right; }
.pet-state-desc { font-size: 12px; color: var(--text-light); margin: 2px 0 10px 70px; }
.pet-act-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pet-act-form { margin: 0; }
.pet-act-btn {
  width: 100%; padding: 14px 8px; text-align: center;
  background: linear-gradient(135deg, rgba(255,143,179,0.15), rgba(167,139,250,0.15));
  border: 2px solid rgba(255,143,179,0.25); border-radius: 14px;
  cursor: pointer; transition: all 0.2s;
}
.pet-act-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(255,143,179,0.25); }
.pet-act-btn.done { opacity: 0.5; cursor: not-allowed; background: rgba(0,0,0,0.04); }
.pet-act-emoji { font-size: 28px; }
.pet-act-name { font-size: 14px; font-weight: bold; color: var(--text); margin: 4px 0 2px; }
.pet-act-cost { font-size: 12px; color: var(--text-light); }
.pet-tip { font-size: 12px; color: var(--text-light); margin-top: 12px; text-align: center; }

/* 宠物改名 + 互动弹窗 */
.pet-rename-btn { background: rgba(255,143,179,0.15); border: 1px solid rgba(255,143,179,0.3); border-radius: 8px;
  padding: 2px 8px; font-size: 14px; cursor: pointer; margin-left: 6px; vertical-align: middle; }
.pet-rename-btn:hover { background: rgba(255,143,179,0.3); }
.pet-thanks { background: linear-gradient(135deg, rgba(255,143,179,0.1), rgba(167,139,250,0.1));
  border-radius: 12px; padding: 12px; margin: 12px 0; font-size: 14px; color: var(--purple); line-height: 1.6; }
.rename-input { width: 100%; padding: 12px 14px; border: 2px solid rgba(167,139,250,0.3); border-radius: 12px;
  font-size: 16px; text-align: center; margin-top: 8px; box-sizing: border-box; }
.rename-input:focus { outline: none; border-color: var(--purple); }

/* ===== 瑞幸咖啡 ===== */
.coffee-folder { background: linear-gradient(135deg, rgba(255,143,179,0.12), rgba(139,90,43,0.08)) !important; }
.coffee-home { text-align: center; }
.coffee-hero { font-size: 56px; margin: 10px 0; }
.coffee-search-row { display: flex; gap: 8px; align-items: center; }
.coffee-input { flex: 1; padding: 12px 14px; border: 2px solid rgba(167,139,250,0.25); border-radius: 12px;
  font-size: 15px; box-sizing: border-box; }
.coffee-input:focus { outline: none; border-color: var(--purple); }
.coffee-shop-card { background: rgba(255,143,179,0.06); border: 1px solid rgba(255,143,179,0.15);
  border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.coffee-shop-name { font-size: 15px; font-weight: bold; color: var(--text); margin-bottom: 4px; }
.coffee-shop-addr { font-size: 12px; color: var(--text-light); margin-bottom: 6px; line-height: 1.4; }
.coffee-shop-meta { font-size: 12px; color: var(--text-light); display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.coffee-shop-status { color: #22c55e; font-weight: bold; }
.coffee-selected-shop { background: rgba(167,139,250,0.1); border-radius: 10px; padding: 8px 12px;
  font-size: 13px; color: var(--purple); margin-bottom: 12px; }
.coffee-quick-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.coffee-tag { padding: 8px 14px; background: rgba(255,143,179,0.1); border: 1px solid rgba(255,143,179,0.2);
  border-radius: 20px; font-size: 13px; cursor: pointer; color: var(--text); }
.coffee-product-card { display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,143,179,0.06); border: 1px solid rgba(255,143,179,0.15);
  border-radius: 14px; padding: 14px; margin-bottom: 10px; gap: 10px; }
.coffee-product-info { flex: 1; }
.coffee-product-name { font-size: 15px; font-weight: bold; color: var(--text); }
.coffee-product-price { font-size: 14px; color: #ef4444; margin-top: 2px; }
.coffee-product-spec { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.coffee-confirm-section { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed rgba(0,0,0,0.08); }
.coffee-confirm-label { width: 60px; font-size: 13px; color: var(--text-light); flex-shrink: 0; }
.coffee-confirm-value { flex: 1; font-size: 14px; color: var(--text); }
.coffee-order-id { font-size: 12px; color: var(--text-light); margin: 8px 0; word-break: break-all; }
.coffee-qr-box { display: inline-block; padding: 14px; background: #fff; border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1); margin: 10px 0; }
.coffee-qr-img { width: 220px; height: 220px; object-fit: contain; }

/* 咖啡完整菜单 */
.coffee-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.coffee-menu-card { background: rgba(255,143,179,0.06); border: 1px solid rgba(255,143,179,0.15);
  border-radius: 14px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.coffee-menu-img { width: 80px; height: 80px; object-fit: contain; margin: 4px auto 6px; border-radius: 10px; }
.coffee-menu-img-placeholder { width: 80px; height: 80px; line-height: 80px; font-size: 36px; margin: 4px auto 6px;
  background: rgba(0,0,0,0.04); border-radius: 10px; }
.coffee-menu-name { font-size: 13px; font-weight: bold; color: var(--text); line-height: 1.3; min-height: 34px; }
.coffee-menu-price { font-size: 14px; color: #ef4444; font-weight: bold; margin: 4px 0; }
.coffee-menu-tags { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 4px; }
.coffee-menu-tag { font-size: 10px; padding: 2px 6px; background: rgba(255,143,179,0.15);
  border-radius: 8px; color: var(--purple); }

/* 常用门店 */
.coffee-fav-card { border: 2px solid rgba(255,193,7,0.3) !important; background: linear-gradient(135deg, rgba(255,193,7,0.08), rgba(255,143,179,0.06)) !important; }

/* 双账号比价 */
.coffee-compare { display: flex; gap: 8px; }
.coffee-compare-card { flex: 1; padding: 10px; border-radius: 12px; text-align: center;
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.08); }
.coffee-compare-card.cheapest { background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(255,143,179,0.08));
  border: 2px solid rgba(34,197,94,0.3); }
.coffee-compare-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.coffee-compare-price { font-size: 20px; font-weight: bold; color: #ef4444; margin-bottom: 8px; }
.coffee-compare-card.cheapest .coffee-compare-price { color: #22c55e; }

/* 取餐码 */
.coffee-poll-status { margin-top: 14px; padding: 10px; font-size: 13px; color: var(--text-light);
  background: rgba(255,200,0,0.08); border-radius: 10px; }
.coffee-pickup-box { padding: 20px 16px; text-align: center; border-radius: 16px;
  background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(255,143,179,0.08));
  border: 2px solid rgba(34,197,94,0.3); margin-top: 14px; }
.coffee-pickup-title { font-size: 16px; color: var(--text); margin-bottom: 10px; }
.coffee-pickup-code { font-size: 42px; font-weight: bold; color: #ef4444; letter-spacing: 4px; margin: 8px 0; }
.coffee-pickup-label { font-size: 13px; color: var(--text-light); margin-bottom: 10px; }
.coffee-pickup-qr { width: 140px; height: 140px; border-radius: 10px; margin: 8px auto; display: block; }
.coffee-pickup-shop { font-size: 14px; margin-top: 8px; }
.coffee-pickup-addr { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.coffee-pickup-amount { font-size: 14px; color: #22c55e; margin-top: 8px; font-weight: bold; }
.coffee-pickup-status { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.coffee-order-item { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }

/* 咖啡规格选择 */
.coffee-spec-header { display:flex; gap:12px; align-items:center; margin-bottom:16px; }
.coffee-spec-img { width:80px; height:80px; border-radius:12px; object-fit:cover; }
.coffee-spec-name { font-size:16px; font-weight:bold; color:var(--text); }
.coffee-spec-price { font-size:20px; color:var(--purple); font-weight:bold; margin-top:4px; }
.spec-group { margin-bottom:14px; }
.spec-group-label { font-size:13px; color:var(--text-light); margin-bottom:8px; font-weight:500; }
.spec-options { display:flex; gap:8px; flex-wrap:wrap; }
.spec-btn { padding:8px 14px; border:2px solid rgba(167,139,250,0.25); border-radius:20px;
  background:white; cursor:pointer; font-size:13px; color:var(--text); transition:all 0.15s;
  display:inline-flex; align-items:center; gap:4px; line-height:1.2; }
.spec-btn:hover:not(.disabled):not(.active) { border-color:var(--purple); background:rgba(167,139,250,0.08); }
.spec-btn.active { background:linear-gradient(135deg,#a78bfa,#c4b5fd); border-color:#a78bfa; color:white; font-weight:bold; }
.spec-btn.disabled { opacity:0.4; cursor:not-allowed; background:rgba(0,0,0,0.03); }
.spec-btn.loading { opacity:0.6; }
.spec-btn-price { font-size:11px; opacity:0.85; }

/* 城市快速选择 */
.coffee-city-tags { margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(167,139,250,0.25); }
.coffee-city-title { font-size: 13px; color: var(--text-light); margin-bottom: 8px; }
.coffee-city-list { display: flex; flex-wrap: wrap; gap: 8px; }
.coffee-city-tag { padding: 6px 14px; border: 1.5px solid rgba(167,139,250,0.3); border-radius: 16px;
  background: linear-gradient(135deg, rgba(167,139,250,0.08), rgba(196,181,253,0.08));
  color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.coffee-city-tag:hover { background: linear-gradient(135deg,#a78bfa,#c4b5fd); color: white; border-color: #a78bfa; transform: translateY(-1px); }
.coffee-city-tag:active { transform: scale(0.96); }

/* 取餐码二维码（SVG 自适应） */
.coffee-pickup-qr-wrap { margin: 12px auto; width: 180px; height: 180px; padding: 10px;
  background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.coffee-pickup-qr-wrap svg { width: 100% !important; height: 100% !important; display: block; }

/* 订单备注 */
.spec-remark { margin-top: 16px; padding-top: 14px; border-top: 1px dashed rgba(167,139,250,0.25); }
.spec-remark-label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 8px; font-weight: 500; }
.spec-remark-input { width: 100%; }
