/* Desmond EdTech Lab 教學工具實驗室
   版面結構沿用「出通告小助手 / 奕鈞老師工作坊」路線：
   玻璃卡片 + Noto Sans TC + 900 字重大標題 + 柔和漸層底。
   配色由薄荷綠改為暖橙。 */

:root {
  --page-bg: linear-gradient(160deg, #fffaf4 0%, #ffeedd 38%, #ffe0c4 72%, #ffd8c6 100%);
  --glass-bg: rgba(255, 255, 255, .72);
  --glass-border: rgba(176, 88, 24, .16);
  --glass-hover: rgba(255, 255, 255, .94);
  --field-bg: #ffffff;
  --text: #4a2410;
  --text-soft: #8a4f24;
  --text-muted: #a06a42;
  --accent: #ea7a2b;
  --accent-deep: #c05a13;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg) fixed;
  color: var(--text);
  font-family: "Noto Sans TC", Inter, -apple-system, "PingFang TC",
               "Microsoft JhengHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── 頂部列 ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

.topbar .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #f79a4a, #e2661f);
  color: #fff;
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: -.02em;
  flex: none;
}

.topbar .name { font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.topbar .spacer { flex: 1; }

.topbar nav { display: flex; gap: 1.1rem; overflow-x: auto; }
.topbar nav::-webkit-scrollbar { display: none; }

.topbar a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: .92rem;
  white-space: nowrap;
  transition: var(--transition);
}
.topbar a:hover { color: var(--accent-deep); }

/* ── 版心 ─────────────────────────────────────────────── */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(1.8rem, 5vw, 3.2rem) clamp(1rem, 4vw, 2rem) 4rem;
}

/* ── Hero ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--glass-border);
  font-size: .85rem;
  color: var(--text-soft);
}

.badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(234, 122, 43, .6);
}

h1 {
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 1rem 0 .5rem;
}

h1 .accent {
  background: linear-gradient(100deg, var(--accent), #f2a03c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  color: var(--text-soft);
  font-size: 1.04rem;
  margin: 0 0 1.6rem;
  max-width: 46rem;
}

/* ── 統計條 ───────────────────────────────────────────── */
.stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.8rem; }

.stat {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: .55rem 1rem;
  font-size: .9rem;
  color: var(--text-soft);
}
.stat b { color: var(--accent-deep); font-weight: 900; font-size: 1.05rem; }

/* ── 搜尋 ─────────────────────────────────────────────── */
.searchbar { position: relative; margin-bottom: 2.4rem; max-width: 30rem; }

.searchbar input {
  width: 100%;
  padding: .7rem 1rem .7rem 2.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid #f0cfae;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.searchbar input::placeholder { color: var(--text-muted); }
.searchbar input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(234, 122, 43, .18);
}
.searchbar::before {
  content: "🔍";
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  opacity: .55;
  pointer-events: none;
}

/* ── 區塊 ─────────────────────────────────────────────── */
.section { margin-bottom: 3rem; scroll-margin-top: 5rem; }
.section.hidden { display: none; }

.section > .eyebrow {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: .15rem;
}

.section > h2 {
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  font-weight: 900;
  letter-spacing: -.015em;
  margin: 0 0 .3rem;
}

.section > .section-desc {
  color: var(--text-soft);
  font-size: .96rem;
  margin: 0 0 1.3rem;
  max-width: 46rem;
}

/* ── 卡片格網 ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(150, 76, 20, .07);
  padding: 1.25rem 1.3rem 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}
.card.hidden { display: none; }

.card:hover {
  background: var(--glass-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(150, 76, 20, .13);
}

.card h3 {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .4rem;
  line-height: 1.45;
}

.card p {
  font-size: .92rem;
  color: var(--text-soft);
  margin: 0 0 .9rem;
  line-height: 1.65;
  flex: 1;
}

.card .tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }

.card .tag {
  font-size: .74rem;
  font-weight: 500;
  padding: .12rem .6rem;
  border-radius: 999px;
  background: rgba(234, 122, 43, .1);
  border: 1px solid rgba(234, 122, 43, .2);
  color: var(--accent-deep);
}

.card .go {
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card .go::after { content: "→"; transition: var(--transition); }
.card:hover .go::after { transform: translateX(3px); }

.card .host {
  display: block;
  font-size: .76rem;
  color: var(--text-muted);
  margin-top: .35rem;
  word-break: break-all;
}

/* ── 空狀態 ───────────────────────────────────────────── */
.empty {
  display: none;
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: .95rem;
}
.empty.show { display: block; }

/* ── 頁腳 ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--glass-border);
  margin-top: 1rem;
  padding: 2rem clamp(1rem, 4vw, 2rem) 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
}
footer a { color: var(--accent-deep); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .sep { margin: 0 .5rem; opacity: .5; }

/* ── 動效 ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ── 卡片內的次要連結 ─────────────────────────────────── */
.card .go + .go { margin-top: .3rem; }

.card .go.doc {
  font-weight: 500;
  color: var(--text-soft);
}
.card .go.doc::after { content: "↗"; }
.card:hover .go.doc::after { transform: none; }
.card .go.doc:hover { color: var(--accent-deep); }

.card .go { text-decoration: none; }
.card .go:hover { text-decoration: underline; }
