/* =====================================================
   1. 顏色與字體變數（淺色模式）
   想換整體色調，主要改這一區就好。
   下面的 var(--xxx) 都會讀這裡的值。
   ===================================================== */
:root {
  --bg: #f5efe6;          /* 頁面背景（米色） */
  --surface: #fbf7f1;     /* 卡片背景 */
  --wordmark: #ffffff;    /* 左上角字標顏色 #785d27*/
  --ink: #2a221d;         /* 主要文字 */
  --heading: #e8b870;     /* 標題顏色（h1、h2、h3），目前與主要文字同色 */
  --muted: #7d6f63;      /* 次要文字：副標、標籤、footer */
  --line: #e4d8c8;        /* 邊框、分隔線 */
  --accent: #a4623a;      /* 強調色：連結、按鈕、hover 邊框 */
  --accent-soft: #f0dfcf; /* 提示框背景 */
  --done: #a4623a;        /* [LeetCode] 熱力圖：已完成 */
  --partial: #e3c3a5;     /* [LeetCode] 熱力圖：部分完成 */
  --none: #ebe2d6;        /* [LeetCode] 熱力圖：未完成 */
  --danger: #a33d2f;      /* 錯誤、刪除 */
  --radius: 14px;         /* 卡片圓角 */
  --serif: "Cormorant Garamond", "Klee One", Georgia, serif; /* 標題字體 */
  --sans: "Chocolate Classical Sans", -apple-system, "Segoe UI", sans-serif; /* 內文字體 */
}

/* =====================================================
   2. 深色模式
   系統設成深色時，用這組同名變數覆蓋上面的值。
   改了淺色記得這裡也要對應調整。
   【目前已整段註解掉，只使用淺色模式；要恢復就把下方 @media 區塊前後的註解符號拿掉】
   ===================================================== */
/*
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1714;
    --surface: #241e1a;
    --wordmark: #d9905f;
    --ink: #eee4d8;
    --heading: #eee4d8;
    --muted: #a8988a;
    --line: #3a302a;
    --accent: #d9905f;
    --accent-soft: #3b2c22;
    --done: #d9905f;
    --partial: #6e4c35;
    --none: #2f2823;
    --danger: #e0786a;
  }
}
*/

/* =====================================================
   3. 全站基本設定
   ===================================================== */
* { box-sizing: border-box; }

body {
  margin: 0;
  background:
  linear-gradient(rgba(109, 77, 30, 0.2), rgba(109, 77, 30, 0.2)),
  url("./images/curtain-sunlight.jpg") center 75% / cover fixed no-repeat ;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 置中容器：最寬 720px，左右留 20px */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* =====================================================
   4. 首頁排版
   ===================================================== */

/* 頂部列：左 wordmark、右導覽 */
.site-header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 28px 0 8px;
}
.wordmark {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 500;
  letter-spacing: 0.10em; color: var(--wordmark);
  border-left: 4px solid var(--accent);
  display: inline-block;     /* 讓上下 padding 真的撐出空間 */
  padding: 0px 60px 0px 10px;   /* 上 右 下 左：右邊留多一點，淡出才有空間 */

}
.wordmark:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 18px; font-size: 0.9rem; }
.site-header nav a { color: var(--muted); }
.site-header nav a.nav-btn {
  background: var(--accent);
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
}
.site-header nav a.nav-btn:hover {
  filter: brightness(1.05);
  text-decoration: none;
}


html {
  scroll-snap-type: y mandatory;   /* 垂直方向，強制吸附 */
  scroll-behavior: smooth;         /* 吸附時平滑移動 */
}
.hero {
  position: relative;
  height: 100vh;                         /* 剛好一個螢幕高 */
  height: 100dvh;                        /* 手機上扣掉網址列，較準確 */
  background: url("./images/old-town-facades.jpg") center 75%/ cover no-repeat;

  display: flex;
  align-items: center;       /* 垂直置中 */
  justify-content: center;   /* 水平置中 */
}
.hero h1 { 
  color: #fff; 
  font-size: clamp(3rem, 6vw, 7.5rem);
  font-weight: 500;
  /* letter-spacing: -0.02em; */
}
.hero-down {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);           /* 水平置中 */
  color: #fff;
  font-size: 2.5rem;
}
.hero,
.wrap {
  scroll-snap-align: start;        /* 每一頁的頂端是吸附點 */
  scroll-snap-stop: always;        /* 快速滾動時也不會跳過這一頁 */
}

/* 首頁第二頁：固定佔滿一個螢幕，內容垂直置中 */
.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.page main {
  flex: 1;                   /* 讓 main 吃掉 header 和 footer 之外的空間 */
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 讓內容貼在最上面 */
  padding: 10vh 0 0;       /* 上方留螢幕高度的 10% */
}
.page .lede,
.page .eyebrow { color: #fff; }


/* 標題：h2 用 clamp()，依螢幕寬度在 2.2rem ~ 3.2rem 間縮放 */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.25; margin: 0; color: var(--heading); }
h1 { font-size: clamp(3rem, 6vw, 7.5rem); }
h2 { font-size: clamp(2.1rem, 6vw, 2.7rem); }
h3 { font-size: 1.5rem; }

/* 副標（lede）與小標（eyebrow：「a quiet loft」） */
.lede { color: var(--muted); font-size: 1.05rem; margin: 12px 0 0; }
.eyebrow { font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* 主內容區上下留白 */
main { padding: 48px 0 80px; }

/* 卡片外觀：背景、邊框、圓角、內距 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

/* 卡片排列：每張至少 200px 寬，放不下自動換行；gap 是卡片間距 */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 40px; }

/* 首頁的可點卡片：hover 時邊框變強調色並上移 2px */
.tile { display: block; color: var(--ink); transition: border-color 0.2s, transform 0.2s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.tile h3 { font-size: 1.35rem; margin-bottom: 6px; }
.tile p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.tile .tag { display: inline-block; margin-top: 14px; font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
/* 「即將推出」卡片：半透明且不能點 */
.tile.soon { opacity: 0.6; pointer-events: none; }

/* =====================================================
   5. 表單、按鈕、提示框（申請頁等會用到）
   ===================================================== */
label { display: block; font-size: 0.88rem; color: var(--muted); margin: 16px 0 6px; }
input, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 96px; resize: vertical; }

button, .btn {
  font: inherit; font-weight: 400; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 10px 18px;
}
button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.ghost:hover { color: var(--ink); border-color: var(--muted); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }

.notice { margin-top: 16px; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); font-size: 0.92rem; }
.notice.error { color: var(--danger); }
.hidden { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 頁尾 */
footer { color: var(--muted); font-size: 0.8rem; padding: 24px 0 40px; border-top: 1px solid var(--line); }

/* =====================================================
   6. LeetCode 打卡頁（首頁沒用到）
   ===================================================== */
.streak { display: flex; gap: 32px; align-items: flex-end; flex-wrap: wrap; }
.streak .num { font-family: var(--serif); font-size: 4rem; line-height: 1; color: var(--accent); }
.streak .label { color: var(--muted); font-size: 0.85rem; }
.streak .best .num { font-size: 2rem; color: var(--ink); }

.heat { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; margin-top: 24px; max-width: 420px; }
.heat span { aspect-ratio: 1; border-radius: 4px; background: var(--none); }
.heat span.done { background: var(--done); }
.heat span.partial { background: var(--partial); }
.heat span.today { outline: 1.5px solid var(--ink); outline-offset: 1px; }

.daybar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 40px 0 16px; }
.daybar .date { font-family: var(--serif); font-size: 1.5rem; }
.daybar .nav { display: flex; gap: 8px; }
.daybar .nav button { padding: 6px 12px; }

.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: none; }
.tasks input[type="checkbox"] { width: 20px; height: 20px; flex: none; accent-color: var(--accent); cursor: pointer; }
.tasks .title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tasks li.done .title { color: var(--muted); text-decoration: line-through; }
.tasks .remove { background: none; color: var(--muted); padding: 4px 8px; font-size: 1.1rem; line-height: 1; }
.tasks .remove:hover { color: var(--danger); }
.empty { color: var(--muted); padding: 12px 0; margin: 0; }

.addform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 16px; }
@media (max-width: 560px) { .addform { grid-template-columns: 1fr; } }

/* =====================================================
   7. 管理頁（首頁沒用到）
   ===================================================== */
.member { padding: 16px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: none; }
.member .who { font-weight: 400; }
.member .meta { color: var(--muted); font-size: 0.85rem; }
.member .msg { margin: 8px 0 0; font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.member .actions { display: flex; gap: 8px; margin-top: 10px; }
.section-title { margin: 32px 0 8px; }

@media (max-width: 480px) {
  #who { display: none; }
  .site-header nav { gap: 14px; }
}
