/* ============================================================
   旅行蛤蟆 · 主页样式（最终版：M1~M5 全部里程碑合在一起）
   风格：二次元贴纸感——奶黄纸底、圆角卡片、粗描边、小阴影
   注意：不引用任何外部字体/图片/CDN，全部用系统自带资源
   上半部分是 M1 的庭院样式，中间是 M2 新增的钱包条 / 标签页 /
   商店 / 行囊，其后是 M3 新增的出发 / 旅行 / 相册；
   文末是 M4（第 10 课）新增的：庭院天空小装饰（太阳/云朵/池塘/
   花丛）、SVG 蛤蟆贴纸的尺寸、拍立得照片卡按地点配色、
   玩法说明页；以及 M5（第 11 课）新增的重置按钮
   ============================================================ */

/* 全局：暖纸色背景 + 圆润的字体 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  /* 奶黄底色 + 浅绿斑点，像院子里的草地点心垫 */
  background-color: #f7f2e3;
  background-image: radial-gradient(#d8ecc4 8%, transparent 9%);
  background-size: 46px 46px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #4a4234;
}

.page {
  width: 100%;
  max-width: 420px;
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

/* ---- 标题 ---- */
.header {
  text-align: center;
}

.header h1 {
  font-size: 34px;
  letter-spacing: 6px;
  color: #3e6b34;
  text-shadow: 2px 2px 0 #fffdf2;
}

.subtitle {
  margin-top: 6px;
  font-size: 13px;
  color: #8d8271;
}

/* ---- 庭院草地 ----
   M4：底部还是草绿，上空加一段浅蓝天空，太阳和云朵才有地方待 */
.yard {
  position: relative;
  width: 100%;
  height: 230px;
  background: linear-gradient(#cfe9f5 0%, #cfe8b5 52%, #b4d997 100%);
  border: 3px solid #5c7a44;
  border-radius: 24px;
  box-shadow: 0 4px 0 #5c7a44;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* M4：蛤蟆贴纸换成手绘 SVG，装在 .toad 容器里，呼吸动画不变 */
.toad {
  width: 142px;
  line-height: 1;
  /* 轻轻上下浮动，像在呼吸 */
  animation: breathe 2.6s ease-in-out infinite;
  filter: drop-shadow(2px 3px 0 rgba(92, 122, 68, 0.45));
}

.toad svg {
  display: block;
  width: 100%;
  height: auto;
}

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

/* 挂在庭院边上的木牌状态 */
.status-sign {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: #f2e3c0;
  border: 2px solid #a3814f;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  color: #6b543a;
  box-shadow: 0 2px 0 #a3814f;
}

.grass {
  position: absolute;
  bottom: 8px;
  font-size: 20px;
  letter-spacing: 8px;
  opacity: 0.85;
}

/* ---- 三叶草面板 ---- */
.panel {
  width: 100%;
  background: #fffdf2;
  border: 3px solid #5c7a44;
  border-radius: 24px;
  box-shadow: 0 4px 0 #5c7a44;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.clover-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.clover-icon {
  font-size: 30px;
}

.clover-num {
  font-size: 40px;
  font-weight: bold;
  color: #3e6b34;
  min-width: 64px;   /* 数字位数变化时按钮不跳动 */
  text-align: center;
}

.clover-unit {
  font-size: 14px;
  color: #8d8271;
}

/* 收割按钮：贴纸质感 */
.harvest-btn {
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fffdf2;
  background: #6faa54;
  border: 3px solid #3e6b34;
  border-radius: 999px;
  padding: 12px 46px;
  cursor: pointer;
  box-shadow: 0 4px 0 #3e6b34;
  transition: transform 0.06s, box-shadow 0.06s;
}

/* 按下去：按钮下沉，像贴纸被按进纸里 */
.harvest-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #3e6b34;
}

.harvest-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* +N 小提示从按钮上方飘出后消失 */
.toast-area {
  position: relative;
  height: 22px;
  font-size: 16px;
  font-weight: bold;
  color: #4a8c3f;
}

.toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  animation: floatUp 1.1s ease-out forwards;
}

@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 8px); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -18px); }
}

/* ---- 页脚 ---- */
.footer {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  line-height: 1.8;
  color: #a49a87;
}

/* ============================================================
   以下为 M2 新增（第 8 课）：钱包条、标签页、商店、行囊
   ============================================================ */

/* ---- 钱包条：三叶草余额，切到商店也看得见，像一张贴在页顶的存折 ---- */
.wallet {
  width: 100%;
  background: #fffdf2;
  border: 3px solid #5c7a44;
  border-radius: 18px;
  box-shadow: 0 4px 0 #5c7a44;
  padding: 12px 20px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---- 标签页：圆胶囊按钮，谁被选中谁变绿 ---- */
.tabs {
  width: 100%;
  display: flex;
  gap: 8px;
}

.tab {
  flex: 1;                     /* 五个标签平分一行 */
  font-size: 15px;             /* M4：标签从 4 个变 5 个，字号微调防挤爆 */
  font-weight: bold;
  letter-spacing: 1px;
  color: #6b543a;
  background: #f2e3c0;
  border: 3px solid #a3814f;
  border-radius: 999px;
  padding: 8px 0;
  cursor: pointer;
  box-shadow: 0 3px 0 #a3814f;
  transition: transform 0.06s, box-shadow 0.06s;
}

/* 当前所在的标签页：像被按进去的贴纸 */
.tab.active {
  color: #fffdf2;
  background: #6faa54;
  border-color: #3e6b34;
  box-shadow: 0 3px 0 #3e6b34;
  transform: translateY(2px);
}

/* 五个视图段：占满整列，里面的庭院/面板才能正常铺开 */
.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* hidden 类 = 藏起来的开关，标签页切换全靠它。
   注意必须写在 .view 的后面：视图段同时带 view 和 hidden 两个类时，
   两条规则优先级相同，靠"后者胜出"才能把 display:flex 盖成 none */
.hidden {
  display: none;
}

/* ---- 商店 / 行囊共用：标题和列表容器 ---- */
.panel-title {
  font-size: 18px;
  letter-spacing: 2px;
  color: #3e6b34;
}

.item-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 商店一行商品：虚线框，像货架上的价签 */
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fbf6e7;
  border: 2px dashed #a3814f;
  border-radius: 14px;
}

.item-emoji {
  font-size: 26px;
}

.item-name {
  flex: 1;                     /* 名字占中间大块，价格和按钮靠右排 */
  font-size: 16px;
  font-weight: bold;
  color: #4a4234;
}

.item-price {
  font-size: 14px;
  color: #8d8271;
}

/* 买按钮：南瓜橙色小胶囊，和收割按钮同一贴纸手感 */
.buy-btn {
  font-size: 15px;
  font-weight: bold;
  color: #fffdf2;
  background: #e8a13c;
  border: 2px solid #b06f1c;
  border-radius: 999px;
  padding: 6px 18px;
  cursor: pointer;
  box-shadow: 0 3px 0 #b06f1c;
  transition: transform 0.06s, box-shadow 0.06s;
}

.buy-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #b06f1c;
}

.buy-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ---- 行囊 ---- */
/* 行囊一行物品：实线框，和商店的虚线价签区分开 */
.bag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fbf6e7;
  border: 2px solid #a3814f;
  border-radius: 14px;
}

.item-count {
  font-size: 16px;
  font-weight: bold;
  color: #3e6b34;
}

/* 行囊空着时的引导语 */
.empty-tip {
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #a49a87;
}

/* ============================================================
   以下为 M3 新增（第 9 课）：出发按钮、旅行中贴纸、旅行说明、相册
   ============================================================ */

/* ---- 出发按钮：和收割按钮一样的贴纸手感，换成南瓜橙区分主次 ---- */
.depart-btn {
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fffdf2;
  background: #e8954a;
  border: 3px solid #b06a1c;
  border-radius: 999px;
  padding: 10px 40px;
  cursor: pointer;
  box-shadow: 0 4px 0 #b06a1c;
  transition: transform 0.06s, box-shadow 0.06s;
}

/* 按下去：按钮下沉，像贴纸被按进纸里 */
.depart-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #b06a1c;
}

/* 蛤蟆出门期间按不了（也由 yard.js 置灰） */
.depart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- 旅行中：蛤蟆贴纸藏起来，换成随风飘的🍃和一串小脚印 ---- */
.toad-away {
  font-size: 84px;
  line-height: 1;
  /* 左右摇 + 上下浮，像叶子被风吹着 */
  animation: drift 2.4s ease-in-out infinite;
  filter: drop-shadow(2px 3px 0 rgba(92, 122, 68, 0.45));
}

@keyframes drift {
  0%, 100% { transform: translate(-26px, 0) rotate(-10deg); }
  50%      { transform: translate(26px, -9px) rotate(12deg); }
}

.footprints {
  position: absolute;
  bottom: 34px;
  font-size: 20px;
  letter-spacing: 16px;
  opacity: 0.8;
}

/* ---- 旅行中的说明行：告诉同学还要等几秒 ---- */
.travel-note {
  font-size: 14px;
  font-weight: bold;
  color: #6b543a;
  background: #f2e3c0;
  border: 2px solid #a3814f;
  border-radius: 999px;
  padding: 6px 18px;
}

/* ---- 相册：照片画成一张张拍立得卡片，土特产复用行囊的行样式 ---- */
.photo-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* M4：照片卡片升级成拍立得——白边相纸、顶部一条胶带、微微歪着贴 */
.photo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px 10px;
  background: #fffef8;
  border: 2px solid #e8dcc0;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(74, 66, 52, 0.14);
}

/* 卡片顶上的胶带：半透明黄胶带，斜着贴一条 */
.photo-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 64px;
  height: 18px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(242, 217, 138, 0.75);
  border-radius: 2px;
}

/* 奇偶张卡片朝相反方向歪一点点，像手工贴的 */
.photo-card:nth-child(odd) {
  transform: rotate(-0.8deg);
}

.photo-card:nth-child(even) {
  transform: rotate(0.8deg);
}

/* M4：照片框变大、带边框，默认底色是草地绿 */
.photo-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 92px;
  font-size: 44px;
  line-height: 1;
  background: linear-gradient(#eef4d8, #dcefb6);
  border: 2px solid #e8dcc0;
  border-radius: 6px;
  margin-bottom: 4px;
}

/* M4：照片底色按地点变—— yard.js 把地点写在卡片的 data-place 上，
   这里按地点换一张"风景底色"（后山绿、湖边蓝、老街暖黄……） */
.photo-card[data-place="校园后山"] .photo-pic {
  background: linear-gradient(#dcedc2, #a8d48a);
}

.photo-card[data-place="湖边"] .photo-pic {
  background: linear-gradient(#c9e8f2, #8fc9dd);
}

.photo-card[data-place="老街"] .photo-pic {
  background: linear-gradient(#f7e3c0, #e9bd7e);
}

.photo-card[data-place="红树林栈道"] .photo-pic {
  background: linear-gradient(#d4ecc8, #93c98a);
}

.photo-card[data-place="灯塔沙滩"] .photo-pic {
  background: linear-gradient(#fdecc8, #f7c98b);
}

.photo-place {
  font-size: 15px;
  font-weight: bold;
  color: #3e6b34;
}

.photo-caption {
  font-size: 14px;
  line-height: 1.6;
  color: #4a4234;
  text-align: center;
}

.photo-time {
  font-size: 12px;
  color: #a49a87;
}

/* ============================================================
   以下为 M4 新增（第 10 课）：庭院小装饰 + 玩法说明页
   ============================================================ */

/* ---- 太阳：挂在庭院右上角，带一圈光晕 ---- */
.sun {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe98a, #f6c445 72%);
  box-shadow: 0 0 0 8px rgba(246, 196, 69, 0.25);
}

/* ---- 云朵：白色胶囊 + 两个鼓包，在天空里轻轻晃 ---- */
.cloud {
  position: absolute;
  width: 62px;
  height: 18px;
  background: #fffdf8;
  border-radius: 999px;
  opacity: 0.9;
  animation: sway 5.5s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: #fffdf8;
  border-radius: 50%;
}

.cloud::before {
  width: 22px;
  height: 22px;
  top: -10px;
  left: 12px;
}

.cloud::after {
  width: 16px;
  height: 16px;
  top: -7px;
  right: 12px;
}

@keyframes sway {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(14px); }
}

.cloud-a {
  top: 52px;
  left: 36%;
}

.cloud-b {
  top: 88px;
  right: 12%;
  transform: scale(0.72);
  animation-delay: 1.6s;
  opacity: 0.75;
}

/* ---- 池塘：庭院左下角一汪小水塘 ---- */
.pond {
  position: absolute;
  bottom: 8px;
  left: 12px;
  width: 74px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(#a8dbee, #6fb7d6);
  border: 2px solid #5f93ad;
  opacity: 0.9;
}

/* ---- 花丛：庭院右下角两朵小花 ---- */
.flowers {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 16px;
  letter-spacing: 2px;
}

/* ---- 玩法说明页：一步一行，序号圆牌 + 贴纸 + 一句话 ---- */
.help-steps {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: step;
}

.help-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fbf6e7;
  border: 2px dashed #a3814f;
  border-radius: 14px;
  font-size: 15px;
  font-weight: bold;
  color: #4a4234;
}

/* 行头的序号：绿色小圆牌，像贴纸编号 */
.help-steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #6faa54;
  border: 2px solid #3e6b34;
  color: #fffdf2;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-sticker {
  flex: none;
  font-size: 22px;
  line-height: 1;
}

/* ============================================================
   以下为 M5 新增（第 11 课）：重置数据开关
   ============================================================ */

/* 重置区：和上面的玩法步骤用虚线隔开，像另一个柜台 */
.reset-zone {
  width: 100%;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 2px dashed #e8dcc0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* 重置按钮：砖红色，和绿/橙的普通按钮一眼区分开——这是大动作 */
.reset-btn {
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 2px;
  color: #fffdf2;
  background: #e06a5a;
  border: 3px solid #a84434;
  border-radius: 999px;
  padding: 10px 36px;
  cursor: pointer;
  box-shadow: 0 4px 0 #a84434;
  transition: transform 0.06s, box-shadow 0.06s;
}

.reset-btn:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #a84434;
}

.reset-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* 后果提示：重置不可恢复，这一行是必须留给同学看的 */
.reset-note {
  font-size: 12px;
  color: #a84434;
  text-align: center;
}
