/* ============================================================
   星露谷家书 · v3（按前端交付包 README 实现）
   素材：static/handoff/assets/（像素草原 / 木质框体 / 道具图标）
   尺寸照抄规范：信件卡 760x122、图标格 60x60@(31,31)、文字列 x=130 w456、
   徽章 150x54@(595,34)、日期牌 300x68、副标题牌 480x68、标题板 340x96
   ============================================================ */
:root {
  --scene-green: #6BAA3C;
  --panel: #F3CE7C;
  --parchment: #FFF8E8;
  --dialog-bg: #F8D9A8;
  --accent-red: #B4432C;
  --wood: #8A5A28;
  --wood-dark: #5E3A16;
  --sun-yellow: #FFD54A;
  --ink: #4A2F14;
  --plate-text: #8B3600;   /* 木牌文字 */
  --banner-text: #4E1D0E;  /* 横幅文字 */
  --panel-text: #4C2717;   /* 面板文字 */
  --badge-text: #5A2E07;   /* 徽章文字 */
  --btn-text: #CE5252;     /* 按钮文字 */
  --btn-shadow: #9A462A;   /* 按钮描边投影 */
  --pixel-font: "Fusion Pixel 12px Proportional Simplified Chinese", "Microsoft YaHei", sans-serif;
  --hand-font: "Ma Shan Zheng", "KaiTi", "STKaiti", serif;
}

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

body {
  font-family: var(--pixel-font);
  color: var(--ink);
  background: var(--scene-green) url("handoff/assets/scene/scene_meadow.jpg") center / cover no-repeat fixed;
  image-rendering: pixelated;
  min-height: 100vh;
}

/* ============ 首页 · 游戏主菜单（mockup 01） ============ */
.p-hero { text-align: center; padding: 48px 12px 8px; }

.hud-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 68px;
  background: url("handoff/assets/frames/date_chip.png") no-repeat center / contain;
  font-size: 16px;
  color: var(--badge-text);
}

.logo-img {
  width: 480px;
  max-width: 94vw;
  image-rendering: pixelated;
  margin: 14px auto 6px;
  display: block;
}

.sub-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 480px;
  max-width: 94vw;
  height: 68px;
  background: url("handoff/assets/frames/subtitle_chip.png") no-repeat center / contain;
  font-size: 15px;
  color: var(--badge-text);
}

.p-menu { display: flex; justify-content: center; gap: 30px; margin-top: 36px; flex-wrap: wrap; }
.p-btn {
  position: relative;
  display: block;
  width: 228px;
  height: 182px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  text-decoration: none;
}
.p-btn--1 { background-image: url("handoff/assets/buttons/btn_bg_1.png"); }
.p-btn--2 { background-image: url("handoff/assets/buttons/btn_bg_2.png"); }
.p-btn--3 { background-image: url("handoff/assets/buttons/btn_bg_3.png"); }
.p-btn--4 { background-image: url("handoff/assets/buttons/btn_bg_4.png"); }
.p-btn::before {
  content: attr(data-label);
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 34px;
  color: var(--btn-text);
  text-shadow: 2px 2px 0 var(--btn-shadow);
}
.p-btn:hover { transform: translateY(-3px); }
.p-btn:active { transform: translateY(1px); }

/* ============ 列表页 · 游戏邮箱（mockup 02） ============ */
.p-main { max-width: 760px; margin: 0 auto; padding: 28px 8px 10px; }
.p-list-head { text-align: center; margin-bottom: 6px; }

.p-title-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 340px;
  max-width: 94vw;
  height: 96px;
  background: url("handoff/assets/frames/title_plate.png") no-repeat center / contain;
  font-size: 30px;
  color: var(--plate-text);
}

.p-sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 320px;
  max-width: 94vw;
  height: 52px;
  background: url("handoff/assets/frames/list_sub_chip.png") no-repeat center / contain;
  font-size: 13px;
  color: var(--badge-text);
  margin-top: 10px;
}

.p-cards { list-style: none; margin-top: 22px; }

.pcard {
  position: relative;
  display: block;
  width: 760px;
  height: 122px;
  margin-bottom: 8px;
  background: url("handoff/assets/frames/letter_card.png") no-repeat center / contain;
  text-decoration: none;
}
.pcard:hover { transform: translateY(-2px); }

.p-icon {
  position: absolute;
  left: 31px;
  top: 31px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-icon img { max-width: 60px; max-height: 60px; image-rendering: pixelated; }

.p-text {
  position: absolute;
  left: 130px;
  top: 0;
  width: 456px;
  height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.p-title { font-size: 19px; color: var(--banner-text); }
.p-meta { font-size: 12px; color: var(--panel-text); margin-top: 7px; }

.p-badge {
  position: absolute;
  left: 595px;
  top: 34px;
  width: 150px;
  height: 54px;
  background: url("handoff/assets/frames/badge_chip.png") no-repeat center / contain;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--badge-text);
}

.p-footer {
  text-align: center;
  font-size: 13px;
  color: var(--banner-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  padding: 22px 10px 30px;
}
.p-footer a { color: var(--banner-text); }
.p-footer small { opacity: .8; }

/* 首页右下角彩蛋：体力条对话框 */
.tired {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: 245px;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 5;
}

/* ============ 管理页共用组件（写信/统计/设计） ============ */
main { max-width: 720px; margin: 0 auto; padding: 20px 16px 30px; }
.sec-head { text-align: center; margin: 10px 0 20px; }

.board-title {
  display: inline-block;
  background: var(--panel);
  border: 4px solid var(--wood-dark);
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px var(--wood), 0 4px 0 rgba(0, 0, 0, .25);
  color: var(--accent-red);
  padding: 14px 40px;
  font-size: clamp(30px, 7vw, 48px);
  letter-spacing: 4px;
  text-shadow: 2px 2px 0 rgba(94, 58, 22, .25);
}
.board-title--sm { padding: 8px 26px; font-size: clamp(22px, 5vw, 30px); letter-spacing: 3px; }

.panel-box {
  background: var(--parchment);
  border: 3px solid var(--wood);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 15px;
  color: var(--panel-text);
}
.panel-box h2 { font-size: 17px; color: var(--accent-red); margin-bottom: 10px; }
.panel-box ul { list-style: none; }
.panel-box li { padding: 4px 0; border-bottom: 1px dashed var(--wood); font-size: 14px; }
.panel-box li:last-child { border-bottom: none; }
.panel-box a { color: var(--wood-dark); }
.stats-sum { text-align: center; font-size: 16px; }

.input {
  width: 100%;
  background: var(--parchment);
  border: 3px solid var(--wood);
  padding: 8px 10px;
  font-family: var(--pixel-font);
  font-size: 15px;
  color: var(--ink);
  margin-top: 4px;
}
.btn {
  display: inline-block;
  background: var(--panel);
  border: 3px solid var(--wood-dark);
  box-shadow: 0 3px 0 var(--wood-dark);
  padding: 8px 18px;
  font-family: var(--pixel-font);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--wood-dark); }

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 3px;
  border: 2px solid var(--wood-dark);
  vertical-align: middle;
}

.dialog {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--dialog-bg);
  border: 3px solid var(--wood-dark);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
  padding: 14px 16px;
  font-family: var(--hand-font);
  font-size: 19px;
  color: var(--panel-text);
}

.colophon {
  text-align: center;
  font-size: 12px;
  color: var(--banner-text);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  padding: 0 12px 26px;
}
.colophon a { color: var(--wood-dark); }

/* ============ 响应式适配（平板 / 手机） ============ */
/* 平板及以下：信件卡放弃固定横幅图（拉伸会糊），改用流式羊皮纸卡 */
@media (max-width: 800px) {
  .p-main { max-width: 100%; padding: 20px 10px 6px; }
  .pcard {
    width: 100%;
    height: auto;
    background: var(--parchment);
    border: 3px solid var(--wood);
    box-shadow: 0 3px 0 rgba(0, 0, 0, .22);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .p-icon, .p-text, .p-badge { position: static; }
  .p-icon { width: 44px; height: 44px; flex: 0 0 44px; }
  .p-text { width: auto; height: auto; flex: 1; align-items: flex-start; text-align: left; }
  .p-badge {
    width: auto;
    height: auto;
    padding: 3px 8px;
    background: var(--dialog-bg);
    border: 2px solid var(--wood-dark);
    flex: 0 0 auto;
  }
}

/* 手机：logo / 牌子 / 按钮等比缩小（框体比例保持，避免变形） */
@media (max-width: 520px) {
  .logo-img { width: 300px; }
  .hud-chip { width: 220px; height: 50px; font-size: 13px; }
  .sub-chip { width: 340px; height: 48px; font-size: 13px; }
  .p-menu { gap: 14px; }
  .p-btn { width: 160px; height: 128px; }
  .p-btn::before { top: 24px; font-size: 24px; }
  .p-title-plate { width: 240px; height: 68px; font-size: 22px; }
  .p-sub { width: 240px; height: 39px; font-size: 11px; }
}
