/* ═══════════════════════════════════════════════════════════
   notebook.css — 三上「鹽水 e 世界」week 頁共用樣式
   視覺語言：手稿本（與 index.html 同一套）
   牛皮紙 + 橫格線 + 紅邊線 + 活頁孔 + 便利貼 + 和紙膠帶
   字型：Caveat / Shadows Into Light（手寫英文）
         LXGW WenKai TC（中文楷體）/ Noto Sans TC
   ═══════════════════════════════════════════════════════════ */

:root {
  --paper: #ede3d0;
  --paper-deep: #e0d4ba;
  --rule: #b6a489;
  --pencil: #2b2b2b;
  --pencil-soft: #4a4538;
  --red: #c02e2e;
  --red-soft: #e87878;
  --ink-blue: #1e3a8a;
  --hi-yellow: #ffe45c;
  --note-pink: #ffd0d0;
  --note-green: #cfeacf;
  --note-blue: #d6e3ff;
  --note-yellow: #fff4a8;
  --tape: #f4d28a;
  --white-paper: #fbf6ea;
}

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

html, body {
  background: var(--paper);
  color: var(--pencil);
  font-family: "LXGW WenKai TC", "Noto Sans TC", "PingFang TC", sans-serif;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ─── 筆記本紙張 ─── */
body {
  background-image:
    linear-gradient(transparent 35px, var(--rule) 35px, var(--rule) 36px, transparent 36px),
    linear-gradient(90deg, transparent 95px, rgba(192,46,46,0.35) 95px, rgba(192,46,46,0.35) 97px, transparent 97px);
  background-size: 100% 36px, 100% 100%;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(220,180,120,0.18), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(200,160,100,0.12), transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.7' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0.4 0 0 0 0 0.3 0 0 0 0 0.15 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.6;
  z-index: 1;
}
body::after {
  content: "";
  position: fixed;
  left: 18px;
  top: 0;
  width: 26px;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(circle at 13px 13px, rgba(0,0,0,0.18) 0 8px, transparent 8.5px);
  background-size: 26px 90px;
  background-repeat: repeat-y;
  z-index: 2;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.2));
}

.hand-en { font-family: "Caveat", "Shadows Into Light", cursive; }
.scribble { font-family: "Shadows Into Light", "LXGW WenKai TC", cursive; }

main.notebook {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 36px 90px 92px;
  position: relative;
  z-index: 3;
}

/* ═══ 週間導覽（上下各一條）═══ */
.nb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-family: "Caveat", cursive;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.nb-nav a {
  color: var(--ink-blue);
  text-decoration: none;
  padding: 2px 12px;
  border: 1.5px dashed transparent;
  border-radius: 3px;
  transition: transform .18s, border-color .18s, background .18s;
}
.nb-nav a:hover {
  border-color: var(--ink-blue);
  background: rgba(214,227,255,0.55);
  transform: rotate(-1.2deg);
}
.nb-nav .home {
  color: var(--red);
  background: var(--note-yellow);
  border: 1.5px solid rgba(0,0,0,0.25);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  transform: rotate(-0.8deg);
}
.nb-nav .home:hover { transform: rotate(0.5deg) translateY(-2px); }
.nb-nav .ghost { color: rgba(43,43,43,0.35); cursor: default; }
.nb-nav--foot { margin-top: 60px; margin-bottom: 0; border-top: 2px dashed rgba(0,0,0,0.2); padding-top: 22px; }

/* ═══ 週標頭 ═══ */
.week-head {
  position: relative;
  margin-bottom: 44px;
  padding-bottom: 26px;
  border-bottom: 2px dashed rgba(0,0,0,0.22);
}
.week-head .date-line {
  font-family: "Caveat", cursive;
  font-size: 21px;
  font-weight: 600;
  color: var(--ink-blue);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.week-head .date-line .wk {
  display: inline-block;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 50%;
  min-width: 52px;
  text-align: center;
  padding: 0 8px;
  margin-right: 10px;
  transform: rotate(-4deg);
  background: rgba(255,228,92,0.35);
}
.week-head h1 {
  font-family: "LXGW WenKai TC", sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.2;
  margin: 6px 0 10px;
}
.week-head h1 .hl {
  background: linear-gradient(transparent 58%, var(--hi-yellow) 58%);
  padding: 0 4px;
}
.week-head .sub {
  font-size: 16.5px;
  color: var(--pencil-soft);
  max-width: 560px;
}
.week-head .sub .red-pen { color: var(--red); font-weight: 700; }

/* AI 登場章 */
.ai-stamp {
  position: absolute;
  right: 4px;
  top: 2px;
  transform: rotate(7deg);
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--red);
  border: 3px double var(--red);
  border-radius: 6px;
  padding: 5px 14px;
  background: rgba(255,228,92,0.32);
  animation: stamp-down .55s .3s cubic-bezier(.2,1.3,.4,1) both;
}
@keyframes stamp-down {
  from { opacity: 0; transform: rotate(-14deg) scale(1.5); }
  to   { opacity: 1; transform: rotate(7deg) scale(1); }
}

/* 標頭旁邊的紅筆眉批 */
.margin-note {
  position: absolute;
  right: 0;
  bottom: 14px;
  transform: rotate(5deg);
  font-family: "Caveat", cursive;
  color: var(--red);
  font-size: 20px;
  font-weight: 600;
  max-width: 180px;
  text-align: center;
  line-height: 1.3;
}

/* ═══ 筆記段落（entry）═══ */
.entry { margin-bottom: 48px; position: relative; }

/* 和紙膠帶段落標 */
.entry-head {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 26px 10px 20px;
  background: var(--tape);
  border-top: 2px dashed rgba(255,255,255,0.55);
  border-bottom: 2px dashed rgba(255,255,255,0.55);
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
  transform: rotate(-0.6deg);
  margin-bottom: 22px;
  max-width: 100%;
}
.entry:nth-of-type(even) .entry-head { background: var(--note-blue); transform: rotate(0.5deg); }
.entry:nth-of-type(3n) .entry-head { background: var(--note-green); }
.entry-head .no {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 30px;
  color: var(--red);
  line-height: 1;
}
.entry-head h2 {
  font-family: "LXGW WenKai TC", sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: var(--pencil);
}
.entry-head .en {
  font-family: "Caveat", cursive;
  font-size: 18px;
  color: var(--ink-blue);
}

.entry > p { max-width: 640px; margin-bottom: 14px; font-size: 16.5px; }
.entry strong { background: linear-gradient(transparent 60%, var(--hi-yellow) 60%); padding: 0 2px; }
.entry em { font-style: normal; color: var(--ink-blue); font-weight: 700; }
.entry code {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.92em;
  background: var(--white-paper);
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 3px;
  padding: 1px 7px;
  white-space: nowrap;
}

/* ═══ 今天要做的事：手畫勾選清單 ═══ */
ul.todo {
  list-style: none;
  max-width: 640px;
  margin: 6px 0 10px;
}
ul.todo li {
  position: relative;
  padding: 7px 4px 7px 46px;
  font-size: 16.5px;
  border-bottom: 1px dashed rgba(0,0,0,0.14);
}
ul.todo li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--pencil);
  border-radius: 3px;
  background: rgba(255,255,255,0.55);
  transform: rotate(-2deg);
}
ul.todo li.done::after {
  content: "✓";
  position: absolute;
  left: 6px;
  top: -2px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 30px;
  color: var(--red);
  transform: rotate(-10deg);
}

/* ═══ 步驟卡（1→2→3）═══ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin: 18px 0 8px;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--white-paper);
  border: 2px solid var(--pencil);
  border-radius: 4px;
  padding: 40px 16px 14px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
  font-size: 15px;
}
.step:nth-child(odd)  { transform: rotate(-0.7deg); }
.step:nth-child(even) { transform: rotate(0.6deg); }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: -14px;
  left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--red);
  background: var(--note-yellow);
  color: var(--red);
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
}
.step strong {
  display: block;
  font-size: 16.5px;
  margin-bottom: 4px;
  background: none;
  padding: 0;
}
.step span { color: var(--pencil-soft); }

/* ═══ 拍立得照片框（真截圖）═══ */
figure.photo {
  display: inline-block;
  background: #fdfbf5;
  padding: 14px 14px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 3px 5px 10px rgba(0,0,0,0.18);
  transform: rotate(-1deg);
  margin: 18px 0;
  max-width: 100%;
  position: relative;
}
figure.photo:nth-of-type(even) { transform: rotate(0.9deg); }
figure.photo::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 88px;
  height: 24px;
  background: rgba(212,180,80,0.55);
  border: 1px dashed rgba(0,0,0,0.2);
  transform: translateX(-50%) rotate(-2deg);
}
figure.photo img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid rgba(0,0,0,0.2);
}
figure.photo figcaption {
  font-family: "Caveat", cursive;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-blue);
  padding: 8px 4px 2px;
  text-align: center;
}
figure.photo figcaption .src {
  display: block;
  font-family: "LXGW WenKai TC", sans-serif;
  font-size: 12.5px;
  color: var(--pencil-soft);
  font-weight: 400;
}

/* ═══ 待截圖佔位框 ═══
   用法：
   <figure class="photo photo--todo">
     <div class="todo-shot">
       <span class="cam">📷</span>
       <strong>【待截圖】</strong>
       <span>Windows 開始選單 → 電源 → 關機 的畫面</span>
     </div>
     <figcaption>關機就從這裡點</figcaption>
   </figure>                                        */
figure.photo--todo { background: var(--white-paper); }
.todo-shot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 280px;
  min-height: 170px;
  padding: 26px 22px;
  border: 2.5px dashed var(--red-soft);
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, rgba(232,120,120,0.07) 14px 28px);
  text-align: center;
}
.todo-shot .cam { font-size: 34px; filter: grayscale(0.3); }
.todo-shot strong {
  font-family: "LXGW WenKai TC", sans-serif;
  color: var(--red);
  font-size: 16px;
  background: none;
  letter-spacing: 0.15em;
}
.todo-shot span:not(.cam) {
  font-size: 14px;
  color: var(--pencil-soft);
  max-width: 340px;
  line-height: 1.6;
}

/* ═══ 手繪鍵帽 ═══ */
.keys {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  vertical-align: middle;
  margin: 0 3px;
}
.keycap {
  display: inline-block;
  font-family: "Consolas", monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--pencil);
  background: var(--white-paper);
  border: 2px solid var(--pencil);
  border-radius: 6px;
  padding: 2px 10px;
  box-shadow: 0 3px 0 var(--pencil), 0 4px 0 rgba(0,0,0,0.2);
  transform: rotate(-1deg);
  line-height: 1.5;
}
.keys .plus { font-family: "Caveat", cursive; font-weight: 700; color: var(--red); font-size: 20px; }

/* ═══ Copilot 對話泡泡 ═══ */
.chat {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}
.bubble {
  position: relative;
  max-width: 82%;
  padding: 12px 18px;
  font-size: 15.5px;
  line-height: 1.7;
  border: 2px solid var(--pencil);
  background: var(--white-paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.09);
}
.bubble .who {
  display: block;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 2px;
}
.bubble--me {
  align-self: flex-end;
  border-radius: 14px 14px 3px 14px;
  transform: rotate(0.5deg);
  background: var(--note-yellow);
}
.bubble--me .who { color: var(--pencil-soft); }
.bubble--ai {
  align-self: flex-start;
  border-radius: 14px 14px 14px 3px;
  transform: rotate(-0.5deg);
  border-color: var(--ink-blue);
  background: var(--note-blue);
}
.bubble--ai .who { color: var(--ink-blue); }
.bubble--ai.wrong { border-color: var(--red); background: var(--note-pink); }
.bubble--ai.wrong::after {
  content: "亂講的！要查證 !!";
  position: absolute;
  right: -8px;
  bottom: -22px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 19px;
  color: var(--red);
  transform: rotate(-4deg);
}

/* ═══ 提詞評分卡（爛 / 中 / 好）═══ */
.grades {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin: 18px 0;
}
.grade {
  position: relative;
  background: var(--white-paper);
  border: 2px solid var(--pencil);
  padding: 18px 16px 14px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
  font-size: 15px;
}
.grade .mark {
  position: absolute;
  top: -16px;
  right: 10px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 30px;
  transform: rotate(8deg);
  line-height: 1;
}
.grade--bad  { transform: rotate(-0.8deg); }
.grade--bad .mark { color: var(--pencil-soft); }
.grade--mid  { transform: rotate(0.5deg); }
.grade--mid .mark { color: var(--ink-blue); }
.grade--good { transform: rotate(-0.4deg); border-color: var(--red); border-width: 2.5px; }
.grade--good .mark { color: var(--red); }
.grade .q {
  font-size: 15.5px;
  padding: 6px 10px;
  background: rgba(255,244,168,0.6);
  border: 1.5px dashed rgba(0,0,0,0.25);
  margin: 6px 0 8px;
  display: block;
}
.grade .why { color: var(--pencil-soft); font-size: 14px; }
.grade .tag {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 19px;
}
.grade--bad .tag { color: var(--pencil-soft); }
.grade--mid .tag { color: var(--ink-blue); }
.grade--good .tag { color: var(--red); }

/* ═══ 任務單（白稿紙）═══ */
.worksheet {
  max-width: 640px;
  background: var(--white-paper);
  border: 2px solid var(--pencil);
  padding: 26px 28px 22px;
  box-shadow: 4px 5px 0 rgba(0,0,0,0.1);
  transform: rotate(-0.4deg);
  position: relative;
  margin: 20px 0;
  background-image: linear-gradient(transparent 31px, rgba(0,0,0,0.09) 31px, rgba(0,0,0,0.09) 32px, transparent 32px);
  background-size: 100% 32px;
}
.worksheet::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 34px;
  width: 74px;
  height: 22px;
  background: rgba(150,180,230,0.5);
  border: 1px dashed rgba(0,0,0,0.2);
  transform: rotate(-3deg);
}
.worksheet h3 {
  font-family: "LXGW WenKai TC", sans-serif;
  font-size: 19px;
  color: var(--red);
  margin-bottom: 12px;
}
.worksheet h3::before { content: "✎ "; }
.worksheet p, .worksheet li { font-size: 15.5px; line-height: 2.07; }
.worksheet ol { padding-left: 26px; }
.worksheet .blank {
  display: inline-block;
  min-width: 130px;
  border-bottom: 2px solid rgba(0,0,0,0.45);
  margin: 0 4px;
}
.worksheet .cbx {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--pencil);
  vertical-align: -2px;
  margin-right: 5px;
  background: #fff;
}

/* ═══ 老師的紅筆（提醒框）═══ */
.red-note {
  max-width: 640px;
  margin: 20px 0;
  padding: 16px 20px 14px 56px;
  border: 2.5px solid var(--red);
  border-radius: 4px;
  background: rgba(255,208,208,0.35);
  position: relative;
  transform: rotate(-0.3deg);
  font-size: 15.5px;
}
.red-note::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 10px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 42px;
  color: var(--red);
  line-height: 1;
  transform: rotate(-8deg);
}
.red-note .rn-title {
  display: block;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 20px;
  color: var(--red);
  margin-bottom: 2px;
}

/* ═══ 手繪插圖容器 ═══ */
.sketch {
  margin: 20px 0;
  max-width: 640px;
}
.sketch svg { width: 100%; height: auto; display: block; }
.sketch .cap {
  font-family: "Caveat", cursive;
  font-size: 19px;
  color: var(--ink-blue);
  text-align: center;
  transform: rotate(-1deg);
  margin-top: 4px;
}

/* ═══ 表格（手繪風）═══ */
.entry table {
  border-collapse: collapse;
  margin: 16px 0;
  max-width: 640px;
  width: 100%;
  background: var(--white-paper);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.08);
  font-size: 15px;
}
.entry th, .entry td {
  border: 1.5px solid var(--pencil);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.entry th {
  font-family: "LXGW WenKai TC", sans-serif;
  background: var(--note-yellow);
  font-size: 15px;
}

/* ═══ 想學更多：小便利貼 ═══ */
.mini-notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  margin-top: 14px;
  padding: 6px 2px;
}
a.mini-note {
  display: block;
  position: relative;
  padding: 16px 16px 14px;
  background: var(--note-yellow);
  color: var(--pencil);
  text-decoration: none;
  font-size: 14px;
  box-shadow: 2px 4px 6px rgba(0,0,0,0.12);
  transition: transform .22s cubic-bezier(.3,.8,.3,1.2), box-shadow .22s;
}
a.mini-note:nth-child(3n+1) { transform: rotate(-1.3deg); }
a.mini-note:nth-child(3n+2) { transform: rotate(0.9deg); background: var(--note-pink); }
a.mini-note:nth-child(3n)   { transform: rotate(-0.5deg); background: var(--note-green); }
a.mini-note::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 52px;
  height: 16px;
  background: rgba(212,180,80,0.55);
  border: 1px dashed rgba(0,0,0,0.2);
  transform: translateX(-50%) rotate(-3deg);
}
a.mini-note:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.03);
  box-shadow: 4px 8px 14px rgba(0,0,0,0.18);
}
a.mini-note .kind {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 16px;
  color: var(--red);
  letter-spacing: 0.08em;
}
a.mini-note strong {
  display: block;
  font-size: 15px;
  margin: 2px 0 4px;
  background: none;
  padding: 0;
}
a.mini-note span.desc { color: var(--pencil-soft); display: block; }

/* ═══ 頁尾簽名 ═══ */
.page-sig {
  margin-top: 46px;
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--ink-blue);
  transform: rotate(-1.5deg);
  text-align: right;
  max-width: 720px;
}

/* ═══ 進場動畫 ═══ */
@keyframes write-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.week-head { animation: write-in .7s .1s both; }
.entry:nth-of-type(1) { animation: write-in .7s .25s both; }
.entry:nth-of-type(2) { animation: write-in .7s .4s both; }
.entry:nth-of-type(3) { animation: write-in .7s .55s both; }
.entry:nth-of-type(n+4) { animation: write-in .7s .7s both; }

/* ═══ RWD ═══ */
@media (max-width: 820px) {
  main.notebook { padding: 32px 20px 70px 58px; }
  body::after { left: 8px; }
  .ai-stamp { position: static; display: inline-block; margin-bottom: 10px; }
  .margin-note { display: none; }
  .bubble { max-width: 94%; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .mini-notes { grid-template-columns: 1fr; }
  .todo-shot { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
