/* ===== 顏色：白天 / 晚上兩套，換主題只要改這裡 ===== */
:root,
[data-theme="day"] {
  --bg: #F7F2EA;          /* 米白 */
  --text: #4A3F35;
  --text-soft: #8A7A6A;
  --accent: #B89A7E;      /* 奶茶色 */
  --green: #6B7F67;       /* 淡綠 */
  --card: #FFFDF9;
  --card-border: #EADFD0;
  --shadow: 0 4px 16px rgba(120, 95, 70, 0.10);
  --polaroid: #FFFFFF;
  --photo: #EFE6D8;
  color-scheme: light;
}
[data-theme="night"] {
  --bg: #18203A;          /* 深藍 */
  --text: #EDE6D3;
  --text-soft: #A9AEC4;
  --accent: #F3E3B5;      /* 月光金 */
  --green: #9DB39A;
  --card: #222B4A;
  --card-border: #323C61;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  --polaroid: #2A3456;
  --photo: #1E2644;
  color-scheme: dark;
}

/* ===== 字體 ===== */
:root {
  --font-title: "Noto Serif TC", serif;
  --font-body: "Noto Sans TC", -apple-system, "PingFang TC", sans-serif;
  --font-hand: "LXGW WenKai TC", "Noto Serif TC", serif;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }

html {
  -webkit-text-size-adjust: 100%;   /* iPhone 轉橫向時不要自己放大字 */
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;              /* 手機網址列縮放時高度也正確 */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;                 /* 16px 以上，iPhone 點輸入框才不會自動放大 */
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .6s ease, color .6s ease;
}

/* 晚上的星星（純 CSS，不用圖片） */
[data-theme="night"] body {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 8%, #fff8, transparent),
    radial-gradient(1px 1px at 30% 18%, #fff9, transparent),
    radial-gradient(1.5px 1.5px at 55% 6%, #fffa, transparent),
    radial-gradient(1px 1px at 72% 14%, #fff8, transparent),
    radial-gradient(2px 2px at 88% 9%, #F3E3B5, transparent),
    radial-gradient(1px 1px at 20% 30%, #fff6, transparent),
    radial-gradient(1px 1px at 82% 28%, #fff7, transparent);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ===== 版面：避開 iPhone 瀏海和底部橫桿 ===== */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 32px)
    calc(env(safe-area-inset-right) + 20px)
    calc(env(safe-area-inset-bottom) + 32px)
    calc(env(safe-area-inset-left) + 20px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero { text-align: center; }
.greeting {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--accent);
}
.title {
  margin: 4px 0 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: .06em;
}
.subtitle { margin: 4px 0 0; font-size: 14px; color: var(--text-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--green);
}

/* 拍立得 */
.polaroid {
  position: relative;
  align-self: center;
  width: 78%;
  max-width: 300px;
  padding: 14px 14px 10px;
  border-radius: 4px;
  background: var(--polaroid);
  transform: rotate(-2deg);
}
.polaroid::before {               /* 紙膠帶 */
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  width: 90px; height: 24px;
  transform: translateX(-50%) rotate(3deg);
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 2px;
}
.photo {
  aspect-ratio: 1 / 1;
  background: var(--photo);
  display: grid;
  place-items: center;
}
.photo-icon { font-size: 64px; }
.hand {
  margin: 10px 0 0;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 18px;
}

.checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.checks li { display: flex; align-items: flex-start; gap: 10px; }
.checks b { font-variant-numeric: tabular-nums; }
.dot { flex: none; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; }
.dot.ok { background: #7DB36F; }
.dot.wait { background: #E0B85C; }
.dot.bad { background: #D9776A; }

.btn {
  display: block;
  width: 100%;
  min-height: 48px;                /* 手指好按的大小 */
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}
[data-theme="night"] .btn { background: var(--accent); color: #18203A; }
.btn:active { transform: scale(.97); opacity: .9; }
