:root {
  --ink: #1f2a37;
  --muted: #5b6676;
  --line: #e6e9f0;
  --bg: #fbf8f3;
  --card: #ffffff;
  --side-w: 270px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景的柔和色塊 */
.blob { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .45; z-index: -1; }
.blob.b1 { width: 380px; height: 380px; background: #cfe0ff; top: -120px; left: -80px; }
.blob.b2 { width: 320px; height: 320px; background: #ffd9da; bottom: -100px; left: 35%; }
.blob.b3 { width: 280px; height: 280px; background: #d4f3ea; top: 30%; right: -60px; }

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  gap: 28px;
  align-items: start;
}

/* ---------- 頁首 ---------- */
.top h1 { margin: 0; font-size: 34px; letter-spacing: 1px; }
.top h1 .e {
  display: inline-block;
  background: #ffb547;
  color: #fff;
  border-radius: 12px;
  padding: 0 12px;
  margin-right: 6px;
  transform: rotate(-4deg);
}
.top p { margin: 6px 0 22px; color: var(--muted); font-size: 16px; }

/* ---------- 右側選單 ---------- */
.side { position: sticky; top: 24px; display: grid; gap: 16px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.nav { display: grid; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: #f2f4f8; }
.nav a.on { background: var(--ink); color: #fff; }
.panel h3 { margin: 2px 4px 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.ms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ms li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: center; font-size: 14px; }
.ms .d {
  text-align: center; border-radius: 10px; padding: 4px 0; font-weight: 700; line-height: 1.2;
  background: #f2f4f8;
}
.ms .d small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.ms .t b { display: block; font-weight: 600; }
.ms .t span { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-size: 14px; margin: 4px; }

/* ---------- 米亞卡片 ---------- */
.agents {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--card);
  border-radius: 24px;
  padding: 18px 20px 18px;
  color: inherit;
  text-decoration: none;
  border: 2px solid transparent;
  box-shadow: 0 2px 0 var(--line);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card .stage {
  position: relative;
  height: 190px;
  border-radius: 18px;
  background: var(--soft);
  display: flex; justify-content: center; align-items: flex-end;
  margin-bottom: 14px;
  overflow: visible;
}
.card .stage img {
  height: 175px;
  animation: float 3.2s ease-in-out infinite;
  animation-delay: var(--delay);
  transform-origin: bottom center;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes hop {
  0% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-18px) scale(1.04) rotate(-3deg); }
  55% { transform: translateY(0) scale(.98, 1.02); }
  75% { transform: translateY(-5px) rotate(2deg); }
  100% { transform: translateY(0); }
}
.card:hover .stage img, .card:focus-visible .stage img { animation: hop .7s ease; }
.bubble {
  position: absolute; top: 14px; left: 14px;
  background: #fff; color: var(--ink);
  font-weight: 700; font-size: 14px;
  padding: 6px 12px; border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  opacity: 0; transform: translateY(6px) scale(.9);
  transition: opacity .2s ease, transform .2s ease;
}
.bubble::after {
  content: ""; position: absolute; bottom: -6px; left: 22px;
  border: 6px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.card:hover .bubble, .card:focus-visible .bubble { opacity: 1; transform: none; }
.badge {
  position: absolute; right: 16px; bottom: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color); border: 3px solid #fff;
  display: grid; place-items: center;
}
.badge svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.card:hover, a.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--color);
  box-shadow: 0 12px 28px rgba(31,42,55,.12);
  outline: none;
}
.card h2 { margin: 0; font-size: 22px; color: var(--color); }
.card .sys { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.card .desc { margin: 0 0 12px; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; flex: 1; align-content: flex-start; }
.tags span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--color); font-weight: 600; }
.go {
  align-self: flex-start;
  background: var(--color); color: #fff;
  font-weight: 700; font-size: 14px;
  padding: 7px 16px; border-radius: 999px;
}
.card.soon { box-shadow: none; border: 2px dashed var(--line); }
.card.soon .go { background: #eef0f4; color: var(--muted); }

/* ---------- 一般頁面區塊 ---------- */
.view h2.title { margin: 0 0 4px; font-size: 26px; }
.view p.lead { margin: 0 0 20px; color: var(--muted); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }

/* 組織圖 */
.org { overflow-x: auto; padding: 10px 0 4px; }
.org ul { position: relative; display: flex; justify-content: center; padding: 20px 0 0; margin: 0; list-style: none; }
.org li { position: relative; padding: 20px 8px 0; text-align: center; }
.org li::before, .org li::after {
  content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 20px; border-top: 2px solid #cfd5df;
}
.org li::after { right: auto; left: 50%; border-left: 2px solid #cfd5df; }
.org li:only-child::before, .org li:only-child::after { display: none; }
.org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; }
.org li:last-child::before { border-right: 2px solid #cfd5df; border-radius: 0 8px 0 0; }
.org li:first-child::after { border-radius: 8px 0 0 0; }
.org ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 20px; border-left: 2px solid #cfd5df; }
.org > ul { padding-top: 0; }
.node {
  display: inline-block; min-width: 130px;
  background: #fff; border: 2px solid var(--c, #cfd5df); border-radius: 14px;
  padding: 10px 14px;
}
.node b { display: block; color: var(--c, var(--ink)); }
.node span { font-size: 13px; color: var(--muted); }

/* 成員名單 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters button {
  font: inherit; font-size: 14px; cursor: pointer;
  border: 2px solid var(--c, var(--line)); background: #fff; color: var(--ink);
  padding: 4px 14px; border-radius: 999px;
}
.filters button.on { background: var(--c, var(--ink)); color: #fff; border-color: var(--c, var(--ink)); }
.search {
  font: inherit; width: 100%; max-width: 320px;
  padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; background: #fff;
}
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.person { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 14px; padding: 12px 14px; }
.person b { font-size: 16px; }
.person .role { font-size: 13px; color: var(--c); font-weight: 600; margin-left: 6px; }
.person p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

/* 專案時程 */
.gantt { overflow-x: auto; }
.gantt-inner { min-width: 680px; }
.g-row { display: grid; grid-template-columns: 190px 1fr; align-items: center; min-height: 52px; border-bottom: 1px dashed var(--line); }
.g-row.head { min-height: 32px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.g-label b { display: block; font-size: 15px; }
.g-label span { font-size: 12px; color: var(--muted); }
.g-track { position: relative; height: 100%; min-height: 52px; }
.g-months { position: relative; height: 32px; }
.g-months span { position: absolute; top: 6px; transform: translateX(4px); }
.g-grid { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef0f4; }
.g-bar {
  position: absolute; top: 14px; height: 24px; border-radius: 999px;
  background: var(--c); opacity: .9;
}
.g-bar.plan { background: repeating-linear-gradient(45deg, var(--c), var(--c) 6px, color-mix(in srgb, var(--c) 70%, #fff) 6px, color-mix(in srgb, var(--c) 70%, #fff) 12px); }
.g-bar.done { opacity: .35; }
.g-ms { position: absolute; top: 10px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border: 3px solid var(--ink); transform: rotate(45deg); }
.g-ms-label { position: absolute; top: 38px; font-size: 11px; transform: translateX(-50%); white-space: nowrap; color: var(--ink); }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid #ffb547; z-index: 2; }
.g-today-label { position: absolute; top: 4px; font-size: 11px; background: #ffb547; color: #fff; padding: 0 6px; border-radius: 6px; transform: translateX(-50%); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 22px; height: 10px; border-radius: 6px; background: #94a3b8; vertical-align: middle; margin-right: 4px; }
.legend i.plan { background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 4px, #d5dbe3 4px, #d5dbe3 8px); }
.legend i.done { opacity: .35; }

.note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- 響應式 ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; order: -1; }
  .side .panel.upcoming { display: none; }
  .nav { grid-template-columns: repeat(4, 1fr); }
  .nav a { justify-content: center; flex-direction: column; gap: 2px; font-size: 13px; padding: 8px 4px; }
}
@media (max-width: 560px) {
  .agents { grid-template-columns: 1fr; }
  .top h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .card .stage img, .card:hover .stage img { animation: none; }
}

.shell > .top { grid-column: 1 / -1; }
.shell > .top p { margin-bottom: 0; }
@media (max-width: 980px) { .shell > .top { order: -2; } }

/* 時程表微調：今天標籤不壓到月份、里程碑文字不被切 */
.g-months { height: 46px; }
.g-months span { top: 22px; }
.g-months .g-today-label { top: 0; }
.g-row { min-height: 62px; }
.g-track { min-height: 62px; }

/* 防止內容把版面撐破 */
.shell { grid-template-columns: minmax(0, 1fr) var(--side-w); }
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav a span { white-space: nowrap; font-size: 12px; }
}

/* ===== 橫向小卡（覆蓋上面的大卡設定） ===== */
.agents { gap: 16px; }
.card {
  display: grid;
  grid-template-columns: 112px 1fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 16px;
  padding: 16px;
  border-radius: 20px;
}
.card .stage {
  grid-row: 1 / -1;
  height: 100%;
  min-height: 150px;
  margin: 0;
  border-radius: 16px;
  align-items: center;
}
.card .stage img { height: 104px; }
.badge { width: 32px; height: 32px; right: 6px; bottom: 6px; border-width: 2px; }
.badge svg { width: 16px; height: 16px; }
.bubble { top: -12px; left: 50%; transform: translate(-50%, 6px) scale(.9); font-size: 12px; white-space: nowrap; padding: 4px 10px; z-index: 3; }
.card:hover .bubble, .card:focus-visible .bubble { transform: translate(-50%, 0); }
.card .head h2 { font-size: 20px; line-height: 1.3; }
.card .head .sys { margin: 0 0 4px; }
.card .desc { margin: 0 0 8px; font-size: 14px; }
.can { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px; }
.can li::before { content: "✓ "; color: var(--color); font-weight: 700; }
.card .go { justify-self: start; padding: 5px 14px; font-size: 13px; }
@media (max-width: 560px) {
  .card { grid-template-columns: 88px 1fr; }
  .card .stage img { height: 80px; }
}

/* ===== 首頁：一列四隻＋點擊展開 ===== */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
  position: relative;
  font: inherit; color: inherit; text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--card);
  border: 2px solid transparent; border-radius: 20px;
  padding: 14px 10px 14px;
  box-shadow: 0 2px 0 var(--line);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.tile .pic {
  position: relative; width: 100%; height: 118px; border-radius: 16px;
  background: var(--soft); display: flex; justify-content: center; align-items: center; margin-bottom: 8px;
}
.tile .pic img { height: 100px; animation: float 3.2s ease-in-out infinite; animation-delay: var(--delay); }
.tile:hover .pic img, .tile:focus-visible .pic img { animation: hop .7s ease; }
.tile .badge { width: 30px; height: 30px; right: 6px; bottom: 6px; border-width: 2px; }
.tile .badge svg { width: 15px; height: 15px; }
.tile b { font-size: 17px; color: var(--color); }
.tile small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(31,42,55,.10); outline: none; }
.tile:hover .bubble, .tile:focus-visible .bubble { opacity: 1; transform: translate(-50%, 0); }
.tile .bubble { top: -14px; left: 50%; }
.tile.on { border-color: var(--color); background: var(--soft); }
.tile.on::after {  /* 指向下方展開區的小三角 */
  content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -10px;
  border: 10px solid transparent; border-top-color: var(--color); border-bottom: 0;
}

.detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease, margin .3s ease;
  margin-top: 0;
}
.detail.open { grid-template-rows: 1fr; margin-top: 18px; }
.detail-inner { overflow: hidden; }
.d-body {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px; align-items: center;
  background: var(--card); border: 2px solid var(--color); border-radius: 20px;
  padding: 18px 22px;
}
.d-body img { width: 100%; max-height: 160px; object-fit: contain; background: var(--soft); border-radius: 16px; padding: 10px; }
.d-body h2 { margin: 0; font-size: 22px; color: var(--color); }
.d-body .sys { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.d-body .desc { margin: 0 0 8px; }
.d-body .can { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; }
.d-body .go { display: inline-block; text-decoration: none; background: var(--color); color: #fff; font-weight: 700; padding: 8px 18px; border-radius: 999px; }
.d-body .go.soon { background: #eef0f4; color: var(--muted); font-weight: 400; }
.hint { text-align: center; color: var(--muted); margin: 18px 0 0; font-size: 14px; }

@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile.on::after { display: none; }
  .d-body { grid-template-columns: 1fr; }
  .d-body img { max-height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile .pic img, .tile:hover .pic img { animation: none; }
  .detail { transition: none; }
}

/* ===== 大型活動表 ===== */
.events { padding: 6px 20px; }
.events table { width: 100%; border-collapse: collapse; }
.events th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.events td { padding: 14px 8px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.events tr:last-child td { border-bottom: 0; }
.events td b { font-weight: 600; }
.events tr.past td { color: #a3abb8; }
.events tr.past b { font-weight: 400; }
@media (max-width: 560px) {
  .events thead { display: none; }
  .events tr { display: block; padding: 10px 0; border-bottom: 1px dashed var(--line); }
  .events tr:last-child { border-bottom: 0; }
  .events td { display: block; padding: 2px 0; border: 0; }
  .events td[data-h="時間"], .events td[data-h="負責人"] { font-size: 14px; color: var(--muted); }
}

/* ===== 有趣元素 ===== */
body {
  background-color: var(--bg);
  background-image: radial-gradient(#e7e1d6 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}
.doodles .dd { position: fixed; z-index: -1; color: #d9cfe9; font-size: 28px; animation: drift 9s ease-in-out infinite; }
.doodles .g1 { top: 14%; left: 3%; font-size: 40px; color: #cfdcf6; animation-name: spin; animation-duration: 18s; }
.doodles .g2 { bottom: 12%; right: 4%; font-size: 52px; color: #f6d3d4; animation-name: spin; animation-duration: 24s; }
.doodles .s1 { top: 8%; left: 46%; color: #ffd27a; }
.doodles .s2 { top: 60%; left: 2%; color: #9fd9c9; animation-delay: -3s; }
.doodles .s3 { bottom: 6%; left: 40%; color: #c9b6f2; animation-delay: -5s; }
.doodles .c1 { top: 32%; right: 22%; font-size: 12px; color: #ffb547; animation-delay: -2s; }
@keyframes drift { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(12deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.title-row { display: flex; align-items: flex-end; gap: 6px; }
.peek { height: 58px; margin-bottom: -4px; transform: rotate(12deg); animation: wave 2.6s ease-in-out infinite; transform-origin: bottom center; }
@keyframes wave { 0%,100% { transform: rotate(12deg); } 50% { transform: rotate(-4deg) translateY(-3px); } }
.admin-btn {
  margin-left: auto; align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px;
  background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.admin-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.admin-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.admin-btn.off { opacity: .55; }
.tip {
  display: inline-block; margin: 10px 0 0 !important;
  background: #fff6e2; border: 1.5px dashed #ffb547; border-radius: 12px;
  padding: 4px 12px; font-size: 14px; color: #7a5310;
}
.tip b { background: #ffb547; color: #fff; border-radius: 6px; padding: 0 6px; margin-right: 8px; font-size: 12px; }

/* 米亞卡片變成貼紙感 */
.tile { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.tile:nth-child(odd) { transform: rotate(-1.2deg); }
.tile:nth-child(even) { transform: rotate(1.2deg); }
.tile:hover, .tile:focus-visible { transform: rotate(0) translateY(-4px); box-shadow: 6px 7px 0 var(--ink); }
.tile.on { transform: rotate(0); border-color: var(--color); box-shadow: 4px 4px 0 var(--color); }
.d-body { box-shadow: 5px 5px 0 var(--color); }
.panel { border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.d-body .btns { display: flex; flex-wrap: wrap; gap: 8px; }
.d-body button.go { font: inherit; font-weight: 700; border: 0; cursor: pointer; }
.d-body .go.ghost { background: #fff; color: var(--color); border: 2px solid var(--color); }

.spark { position: fixed; z-index: 50; pointer-events: none; font-size: 14px; animation: spark .7s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }

/* 成員頭像 */
.person { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--c); color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
}

/* ===== AI 副組長小對話框 ===== */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-weight: 700; color: #fff; cursor: pointer;
  background: #7b4bd6; border: 2px solid var(--ink); border-radius: 999px;
  padding: 6px 18px 6px 6px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .15s ease;
}
.chat-fab:hover { transform: translateY(-3px); }
.chat-fab img { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 50%; background: #eee6ff; }
.chat-fab.hide { display: none; }
.chat-box {
  position: fixed; right: 22px; bottom: 22px; z-index: 41;
  width: 340px; height: 460px; max-height: calc(100vh - 44px);
  display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--ink); border-radius: 20px; box-shadow: 6px 6px 0 #7b4bd6;
  overflow: hidden; animation: pop .2s ease;
}
.chat-box[hidden] { display: none; }
@keyframes pop { from { transform: scale(.9) translateY(10px); opacity: 0; } }
.chat-box header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #eee6ff; border-bottom: 2px solid var(--ink); }
.chat-box header img { width: 38px; height: 38px; object-fit: cover; object-position: top; border-radius: 50%; background: #fff; }
.chat-box header b { display: block; line-height: 1.2; color: #5631a3; }
.chat-box header small { color: var(--muted); }
.chat-x { margin-left: auto; font-size: 22px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ink); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fbf9ff; }
.msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: #fff; border: 1.5px solid #d9ccf5; border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: #7b4bd6; color: #fff; border-bottom-right-radius: 4px; }
.msg.note { color: var(--muted); font-size: 13px; background: transparent; border-style: dashed; }
.msg.typing { color: var(--muted); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; font: inherit; font-size: 14px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.chat-form input:focus { outline: none; border-color: #7b4bd6; }
.chat-form button { width: 40px; border: 0; border-radius: 12px; background: #7b4bd6; cursor: pointer; display: grid; place-items: center; }
.chat-form button svg { width: 18px; height: 18px; fill: #fff; }

@media (max-width: 560px) {
  .peek { height: 44px; }
  .admin-btn { font-size: 12px; padding: 4px 10px; }
  .admin-btn svg { display: none; }
  .chat-box { right: 12px; left: 12px; bottom: 12px; width: auto; height: 62vh; }
  .chat-fab { right: 14px; bottom: 14px; }
  .chat-fab span { display: none; }
  .chat-fab { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .doodles .dd, .peek { animation: none; }
}

/* ===== 活動專家快捷按鈕 ===== */
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.quick > span:first-child { font-size: 13px; color: var(--muted); margin-right: 2px; }
.quick a, .quick .todo {
  font-size: 13px; font-weight: 600; text-decoration: none;
  padding: 5px 12px; border-radius: 10px;
  border: 2px solid var(--color); color: var(--color); background: var(--soft);
}
.quick a:hover { background: var(--color); color: #fff; }
.quick .todo { border-style: dashed; opacity: .6; cursor: default; }

/* ===== 節日布置 ===== */
.fest-badge { display: inline-block; margin-left: 6px; font-size: 30px; animation: drift 3s ease-in-out infinite; }
.fest .top h1 .e { background: var(--fest); }
.fest .tip { background: color-mix(in srgb, var(--fest) 10%, #fff); border-color: var(--fest); color: var(--ink); }
.fest .tip b { background: var(--fest); }
.fest-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fest-layer span { position: absolute; top: -40px; animation: fall linear infinite; opacity: .85; }
@keyframes fall {
  0% { transform: translateY(-40px) rotate(0); }
  100% { transform: translateY(110vh) rotate(260deg); }
}
.fest-xmas .tile:nth-child(1) .pic::before,
.fest-xmas .tile .pic::before { content: "🎅"; position: absolute; top: -10px; left: 8px; font-size: 24px; transform: rotate(-15deg); }
.fest-cny .tile .pic::before { content: "🧧"; position: absolute; top: -8px; left: 8px; font-size: 22px; transform: rotate(-12deg); }
.fest-cny .tile, .fest-cny .panel { box-shadow: 4px 4px 0 #d62828; }
