/* =====================================================================
   Modern Clean Theme — theme-override.css (deduped, keep-all)
   - Header / Navbar(#navbar/.navbar) / Dropdown / Mega / UtilityBar
   - TopNotice & TopBanner / Search Overlay
   - News Cards / Buttons / Section Title / Footer
   - Legacy: procedure / gallery / scrollbars / modal / mini calendar
   - Light/Dark theme (auto; <html data-theme="light|dark"> to force)
   ===================================================================== */

/* ---------------------- CSS Variables (Light) ---------------------- */
:root{
  --font-sans: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","PingFang TC","Microsoft JhengHei",Arial,sans-serif;

  --brand: #2f7df6;
  --brand-2: #6a5acd;
  --accent: #ff6b6b;

  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: rgba(15,23,42,.10);

  --radius: 16px;
  --radius-sm: 10px;

  --shadow-1: 0 2px 8px rgba(15,23,42,.06);
  --shadow-2: 0 10px 24px rgba(15,23,42,.10);

  --container-w: 1200px;
  --header-h: 72px;

  --glass: saturate(120%) blur(6px);

  /* Nav spacing */
  --nav-px: 14px;

  /* Theme toggle (deduped) — replace color-mix() with stable rgba() */
  --toggle-size: 42px; /* 40~44 視覺最剛好 */
  --toggle-bg: rgba(47,125,246,0.10);
  --toggle-bg-hover: rgba(47,125,246,0.18);
  --toggle-border: rgba(47,125,246,0.45);
  --toggle-ring: rgba(47,125,246,0.40);
}

/* ---------------------- Dark (auto) ---------------------- */
@media (prefers-color-scheme: dark){
  :root{
    --bg: #0b1220;
    --surface: #0f172a;
    --ink: #e5e7eb;
    --muted: #9aa4b2;
    --border: rgba(148,163,184,.18);
    --shadow-1: 0 2px 8px rgba(0,0,0,.35);
    --shadow-2: 0 18px 36px rgba(0,0,0,.45);

    /* toggle (auto dark) — replace color-mix() */
    --toggle-bg: rgba(147,197,253,0.14);
    --toggle-bg-hover: rgba(147,197,253,0.22);
    --toggle-border: rgba(147,197,253,0.55);
    --toggle-ring: rgba(147,197,253,0.40);
  }
}
/* manual override */
html[data-theme="light"]{
  --bg:#f7f8fb; --surface:#ffffff; --ink:#0f172a; --muted:#64748b; --border:rgba(15,23,42,.10);
  --shadow-1:0 2px 8px rgba(15,23,42,.06); --shadow-2:0 10px 24px rgba(15,23,42,.10);

  --toggle-bg: rgba(47,125,246,0.10);
  --toggle-bg-hover: rgba(47,125,246,0.18);
  --toggle-border: rgba(47,125,246,0.45);
  --toggle-ring: rgba(47,125,246,0.40);
}
html[data-theme="dark"]{
  --bg:#0b1220; --surface:#0f172a; --ink:#e5e7eb; --muted:#9aa4b2; --border:rgba(148,163,184,.18);
  --shadow-1:0 2px 8px rgba(0,0,0,.35); --shadow-2:0 18px 36px rgba(0,0,0,.45);

  --toggle-bg: rgba(147,197,253,0.14);
  --toggle-bg-hover: rgba(147,197,253,0.22);
  --toggle-border: rgba(147,197,253,0.55);
  --toggle-ring: rgba(147,197,253,0.40);
}

/* ---------------------- Base & Layout ---------------------- */
html, body, #root { height: 100%; }
html { scroll-behavior: smooth; }
#root { display:flex; flex-direction:column; min-height:100svh; background:var(--bg); }
body { margin:0; font-family:var(--font-sans); color:var(--ink); background:var(--bg); line-height:1.6; }
main { flex: 1 0 auto; }
#footer { margin-top:auto; }
.container{ max-width: var(--container-w); width:100%; margin:0 auto; padding:0 20px; }
p, a { font-size: 18px; font-weight: 700; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2); }

/* =====================================================================
   Header / Navbar / Dropdown / Mega
   ===================================================================== */

/* sticky header（視覺底＋品牌底線） */
header.sticky-top{
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h); display:flex; align-items:center;
  background:
    radial-gradient(1200px 220px at 20% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
    radial-gradient(1200px 220px at 80% 0%, color-mix(in srgb, var(--brand-2) 12%, transparent), transparent 60%),
    var(--surface);
  border-bottom: none;
  backdrop-filter: var(--glass);
  box-shadow: 0 1px 0 var(--border), var(--shadow-1);
}
header.sticky-top::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:6px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); opacity:.22;
}

/* Utility Bar */
.utility-bar{
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size:13px;
}
.utility-bar .container{ display:flex; justify-content:space-between; padding:6px 0; }
.utility-bar a{ color:inherit; text-decoration:none; margin-right:14px; }
.utility-bar .icon-btn{ all:unset; cursor:pointer; padding:4px; }

/* Scroll 縮小效果（配合 .site-header.is-scrolled） */
.site-header{ background:var(--surface); transition: all .25s ease; border-bottom:1px solid var(--border); }
.site-header.is-scrolled{ box-shadow: var(--shadow-2); }
.hdr-wrap{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
.site-header.is-scrolled .hdr-wrap{ padding:8px 0; }

/* Brand */
.brand{ margin:0; font-size:18px; }
.brand a{ display:flex; align-items:center; gap:12px; text-decoration:none; color:inherit; }
.brand-badge{
  width:36px; height:36px; border-radius:10px; display:grid; place-items:center;
  background: linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; font-weight:800;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent);
}
.site-header.is-scrolled .brand-badge{ transform:scale(.92); }
.brand-text{ display:inline-flex; flex-direction:column; line-height:1.05; font-weight:800; letter-spacing:.02em; }
.brand-text small{ display:block; font-size:12px; color:var(--muted); margin-top:-2px; }

/* Navbar：支援 #navbar 與 .navbar .nav-list 兩種結構 */
#navbar, header, header .container { overflow: visible !important; }
/* 固定 Navbar 高度與避免抖動 */
.navbar{ min-height: var(--header-h); display:flex; align-items:center; }
#navbar ul, .navbar .nav-list{ display:flex; gap:6px; list-style:none; margin:0; padding:0; }

#navbar a, .navbar a{
  position:relative; display:inline-flex; align-items:center; gap:.4rem;
  padding:14px 14px; border-radius:12px; color:var(--ink);
  font-weight:800; letter-spacing:.02em; text-decoration:none;
  line-height:1; box-sizing:border-box;
}
#navbar a:hover, .navbar a:hover{ background: color-mix(in srgb, var(--ink) 6%, transparent); }
#navbar a::after, .navbar a::after{
  content:""; position:absolute; left:12px; right:12px; bottom:6px;
  height:3px; background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transform: scaleX(0); transform-origin: left; transition: transform .18s ease; border-radius:2px;
}
#navbar a:hover::after, #navbar a.active::after,
.navbar a:hover::after, .navbar a.active::after{ transform: scaleX(1); }
#navbar a.active, .navbar a.active{ color: var(--brand); background: transparent; }

/* Dropdown（Split-button + .open） */
#navbar .dropdown, .navbar .dropdown{ position:relative; display:flex; align-items:center; }
#navbar .drop-title, .navbar .drop-title{ border-top-right-radius:0; border-bottom-right-radius:0; }
#navbar .drop-toggle, .navbar .drop-toggle{
  all:unset; cursor:pointer; padding:14px 14px; border-left:none;
  border-top-right-radius:12px; border-bottom-right-radius:12px;
}
#navbar .drop-toggle:hover, #navbar .drop-title:hover,
.navbar .drop-toggle:hover, .navbar .drop-title:hover{ background: color-mix(in srgb, var(--ink) 6%, transparent); }
#navbar .drop-toggle i, .navbar .drop-toggle i{ font-size:12px; transition: transform .18s ease; }
#navbar .dropdown.open .drop-toggle i, .navbar .dropdown.open .drop-toggle i{ transform: rotate(180deg); }

/* Dropdown Menu rules moved to public/theme-override.css
   to centralize positioning and remove the 8px gap.
   (Original rules left commented out here as a backup.) */
/*
#navbar .dropdown>.menu, .navbar .dropdown>.menu{
  position:absolute; top:calc(100% + 8px); right:0; min-width:200px;
  padding:8px; background:var(--surface); border:1px solid var(--border);
  border-radius:12px; box-shadow: var(--shadow-2); display:none; z-index:1200;
}
#navbar .dropdown>.menu>li, .navbar .dropdown>.menu>li{ list-style:none; }
#navbar .dropdown>.menu>li>a, .navbar .dropdown>.menu>li>a{
  display:block; padding:10px 12px; border-radius:10px; color:var(--ink); white-space:nowrap;
}
#navbar .dropdown>.menu>li>a:hover,
.navbar .dropdown>.menu>li>a:hover{
  background: color-mix(in srgb, var(--brand) 12%, var(--surface)); color: var(--brand);
}
#navbar .dropdown:hover>.menu, #navbar .dropdown:focus-within>.menu, #navbar .dropdown.open>.menu,
.navbar .dropdown:hover>.menu, .navbar .dropdown:focus-within>.menu, .navbar .dropdown.open>.menu{ display:block; }
#navbar .dropdown::after, .navbar .dropdown::after{ content:""; position:absolute; left:0; right:0; top:100%; height:10px; }
*/

/* Mini Mega moved to public/theme-override.css to remove gap */
/*
#navbar .dropdown .mega, .navbar .dropdown .mega{
  position:absolute; top:calc(100% + 8px); right:0; width:min(560px,92vw);
  background:var(--surface); border:1px solid var(--border);
  border-radius:12px; box-shadow: var(--shadow-2); padding:16px; display:none; gap:16px; z-index:1200;
}
#navbar .dropdown:hover .mega, .navbar .dropdown:hover .mega{ display:grid; grid-template-columns:1fr 1fr; }
#navbar .dropdown.open .mega, .navbar .dropdown.open .mega{ display:grid; grid-template-columns:1fr 1fr; }
*/

.mega-col h6{ margin:0 0 8px; font-weight:800; font-size:13px; color:var(--muted); }
.mega-card{ display:flex; gap:10px; text-decoration:none; color:var(--ink); padding:8px; border-radius:10px; }
.mega-card img{ width:88px; height:56px; border-radius:8px; object-fit:cover; }
.mega-card:hover{ background: color-mix(in srgb, var(--ink) 6%, transparent); }
.mega-list{ margin:0; padding-left:16px; color:var(--ink); }
.mega-more{ display:inline-block; margin-top:8px; font-size:14px; color:var(--brand); }

/* =====================================================================
   Top Notice & Top Banner
   ===================================================================== */
.topnotice{
  position:sticky; top:0; z-index:996;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border-bottom:1px solid var(--border);
  color: var(--ink); height:36px; display:flex; align-items:center;
  transition:transform .25s ease;
}
.topnotice.hide{ transform:translateY(-100%); }
.topnotice .container{ display:flex; align-items:center; gap:12px; }
.topnotice .dot{ width:8px; height:8px; border-radius:50%; background: var(--brand); }
.topnotice .cta{ margin-left:auto; text-decoration:none; color: var(--brand); font-weight:700; }
.topnotice .x{ all:unset; margin-left:8px; cursor:pointer; padding:0 6px; color: var(--muted); }

/* 輕量 TopBanner（可選） */
.top-banner{ background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 10%, #fff), color-mix(in srgb, var(--brand-2) 8%, #fff)); border-bottom:1px solid var(--border); }
.banner-wrap{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; }
.banner-text{ color:var(--ink); text-decoration:none; font-weight:600; }
.banner-text .banner-more{ color: var(--brand); margin-left:6px; }
.banner-close{ all:unset; cursor:pointer; padding:6px; border-radius:8px; }
.banner-close:hover{ background: color-mix(in srgb, var(--brand) 12%, #fff); }

/* =====================================================================
   Search Overlay（Header.jsx 用）
   ===================================================================== */
.search-layer{ position:fixed; inset:0; background:rgba(2,6,23,.6); display:grid; place-items:start center; padding-top:12vh; z-index:1100; }
.search-box{ background:var(--surface); width:min(920px, 92vw); border-radius:14px; padding:14px; display:flex; gap:10px; box-shadow: var(--shadow-2); }
.search-box input{ flex:1; height:44px; border:1px solid var(--border); border-radius:10px; padding:0 12px; color:var(--ink); background:var(--surface); }

/* =====================================================================
   Section Title / Cards / Buttons / Footer / News
   ===================================================================== */
.title .section-headline h2{
  position: relative; display:inline-block; margin: 10px 0 8px;
  font-weight: 900; letter-spacing:.02em;
  background: linear-gradient(135deg,var(--brand),var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title .section-headline h2::after{
  content:""; display:block; height:4px; width:56%; margin:.5rem auto 0;
  background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 2px;
}

.card{ background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-1); }

.button, .btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:36px; padding:0 14px; border-radius:999px; font-weight:900; line-height:1;
  text-decoration:none; white-space:nowrap; cursor:pointer; border:0;
}
.btn-primary, .button{
  background: linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 24%, transparent);
}
.btn-primary:hover, .button:hover{ filter:saturate(110%); transform: translateY(-1px); }
.btn-ghost{
  background: rgba(47,125,246,0.10); color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(47,125,246,0.22);
}
.btn-ghost:hover{ background: rgba(47,125,246,0.14); }

/* News */
.news-list{ display:grid; grid-template-columns: 1fr; gap:16px; }
.news-card{
  display:flex; align-items:flex-start; gap:14px; padding:16px 18px;
  border-radius: var(--radius); background:var(--surface);
  border:1px solid var(--border); box-shadow: var(--shadow-1);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: visible;
}
.news-card:hover{ transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.news-date{
  min-width:74px; text-align:center; line-height:1.1; padding:10px 8px; border-radius:12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 10%, #fff), color-mix(in srgb, var(--brand-2) 10%, #fff));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
}
.news-date .day{ font-weight:800; font-size: 20px; color:var(--brand); }
.news-date .ym{ font-size:12px; color:var(--muted); }
.news-body{ display:flex; flex-direction:column; gap:8px; }
.news-title{ font-weight:900; margin:2px 0 4px; color: var(--ink); }
.news-meta{ font-size:12px; color:var(--muted); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.news-actions .button, .news-actions .button *{ writing-mode: horizontal-tb !important; white-space: nowrap !important; }
.news-actions .button{ min-width:112px; }

/* Footer */
#footer{
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface) 80%, transparent));
  border-top: 1px solid var(--border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  padding: 16px 0;
}
/*#footer, #footer * { color: var(--ink) !important; }*/
#footer .copyright { color: var(--muted) !important; }
#footer a { color: var(--brand) !important; font-weight:700; }
#footer a:hover { color: var(--brand-2) !important; }
#footer .footer-wrap{
  display:grid; grid-template-columns: 1fr; gap: 8px; align-items:center;
}
#footer .brand{ display:inline-flex; align-items:center; gap:10px; }
#footer .brand svg{ width:28px; height:28px; border-radius:8px; }
#footer .brand .title{ font-weight:800; letter-spacing:.02em; }
#footer .links{ display:flex; gap:16px; flex-wrap:wrap; }
#footer .links a{ color:var(--brand); text-decoration:none; font-weight:700; }
#footer .links a:hover{ color:var(--brand-2); }
#footer .copyright{ color: var(--muted); font-size: 13px; }
@media (min-width:768px){
  #footer .footer-wrap{ grid-template-columns: 1fr auto; }
}

/* =====================================================================
   Legacy kept
   ===================================================================== */
.procedure p::after{
  content:""; position:relative; right:0; display:inline-block;
  width:10px; height:35px; margin:10px; padding-left:10px; background:#b5970f;
}
.procedure .row{ background: var(--surface); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.procedure img{ border-radius: 12px; box-shadow: var(--shadow-1); margin:.5rem 0 0; max-width:100%; height:auto; }

.gallery-wrapper{ position: relative; overflow: hidden; }
.gallery{ position: relative; white-space: nowrap; font-size: 0; }
.item-wrapper{ cursor:pointer; width:23%; display:inline-block; background:var(--surface); }
.gallery-item{ opacity:.5; transition: opacity .2s ease; }
.gallery-item.active, .gallery-item:hover{ opacity:1; }
.controls{ font-size:30px; border-top:none; }
.move-btn{ display:inline-block; width:49%; border:none; color:#b5970f; background:transparent; padding:15px; opacity:.5; transition:.3s; }
.move-btn:hover{ opacity:1; }
.move-btn.left{ margin-bottom:10px; cursor:w-resize; }
.move-btn.right{ cursor:e-resize; }

.card img{ width:348px; height:348px; object-fit:cover; }
.card-text{ height:27px; }
.card-body{ padding:1rem 1.25rem 1.25rem; }

.portfolioContainer{ max-height:900px; overflow-y:auto; }
.portfolioContainer::-webkit-scrollbar-track,
.events-container::-webkit-scrollbar-track{ box-shadow: inset 0 0 6px rgba(0,0,0,.3); border-radius:20px; background:#ffffff10; }
.portfolioContainer::-webkit-scrollbar,
.events-container::-webkit-scrollbar{ width:12px; background:transparent; }
.portfolioContainer::-webkit-scrollbar-thumb,
.events-container::-webkit-scrollbar-thumb{ border-radius:20px; box-shadow: inset 0 0 6px rgba(0,0,0,.3); background: rgba(2,72,142,.5); }

.modal-content{ border-radius:1rem; background:var(--surface); color:var(--ink); }
.modal-header{ padding:1rem 1rem 1rem 3rem; }
.modal-footer{ justify-content:center; }
.modal-footer button{ border-radius:10px; }
.modal-dialog{ max-width:80%; margin:1.75rem auto; }
.modal-dialog.non{ max-width:50%; margin:1.75rem auto; }
.modal-body{ max-height: calc(100vh - 210px); overflow-y:auto; padding:3rem 5rem; }
.modal-body .content{ width:100%; max-width:80%; margin:20px auto; position:relative; }
.modal-body.horizon img{ max-width:80%; display:block; margin:40px auto 1rem; float:inherit; }
.modal-body.horizon .content{ padding-left:0; }

.events-container{
  overflow-y:auto; height:30vw; float:right; width:50%;
  margin-top:40px; display:block; padding:0; border-radius:20px;
  background:#6e96be;
}
.event-card{ padding:20px 20px; background:var(--surface); border:none; margin:20px 12px; border-radius:15px; }
.event-count,.event-name,.event-cancelled{ display:inline; padding:0 10px; font-size:1rem; }
.event-cancelled{ color:#cd4dcc; }

/* Mini Calendar */
.mini-cal { padding: 10px 0 16px; }
.mini-cal__wrap { border:1px solid var(--border); border-radius:16px; padding:14px; background:var(--surface); }
.mini-cal__head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.mini-cal__grid { display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; }
.mini-cal__label { grid-column: 1 / -1; font-weight:800; color:var(--ink); }
.mini-cal__dow { font-weight:700; color:var(--muted); text-align:center; }
.mini-cal__cell{ min-height:72px; background:color-mix(in srgb, var(--surface) 94%, transparent); border:1px solid var(--border); border-radius:12px; padding:6px; display:flex; flex-direction:column; gap:6px; }
.mini-cal__day { font-weight:800; font-size:13px; color:var(--ink); }
.mini-cal__list { display:flex; flex-direction:column; gap:4px; }
.mini-cal__item{ display:block; font-size:12px; color:var(--ink); text-decoration:none; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:4px 6px; }
.mini-cal__item:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, transparent); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }

/* =====================================================================
   Clean-ups
   ===================================================================== */
#hero{ display:none !important; }
section{ padding: 0 25px; animation: ani ease 1s forwards; }
@keyframes ani{ 0%{opacity:0;} 100%{opacity:1; transform: translateY(50px);} }

/* Responsive */
@media (max-width: 991px){
  header .container{ padding: 0 16px; }
  #navbar ul, .navbar .nav-list{ flex-wrap: wrap; gap:4px; }
  .dropdown .mega{ right:8px; width:min(92vw, 560px); }
  .news-list{ grid-template-columns: 1fr; }
}
@media (max-width: 768px){
  .banner-wrap{ padding: 8px 0; }
  .banner-text{ font-size: 14px; }
}
@media (max-width: 560px){
  .mini-cal__cell{ min-height: 64px; }
}

/* ======= 活動月曆（Announcement） ======= */
.cal { padding: 12px; border-radius: 16px; }
.cal-header{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding: 8px 6px 12px;
}
.cal-title{ font-weight: 900; letter-spacing:.02em; }
.cal-actions{ display:flex; gap:8px; }

.cal-grid{
  display:grid; gap: 8px;
  grid-template-columns: repeat(7, 1fr);
}
.cal-weekday{
  text-align:center; font-weight:800; color:#475569; padding: 6px 0;
  background: #f3f6ff; border-radius: 10px; border: 1px solid rgba(47,125,246,.15);
}
.cal-cell{
  min-height: 112px; border-radius: 14px; padding: 8px;
  background: #fff; border: 1px solid rgba(15,23,42,.08);
  position: relative; box-shadow: 0 1px 4px rgba(15,23,42,.04);
}
.cal-cell.is-out{ background: #fafbfe; color:#94a3b8; }
.cal-cell.is-today{ box-shadow: 0 0 0 2px rgba(47,125,246,.3) inset; }

.cal-date{ font-weight: 800; font-size: 14px; color:#0f172a; }
.cal-events{ margin-top: 6px; display:flex; flex-direction: column; gap: 6px; }
.cal-link{ text-decoration:none; }
.cal-link.disabled{ pointer-events:none; opacity:.66; }
.cal-chip{
  display:inline-flex; align-items:center; max-width: 100%;
  background: linear-gradient(90deg,#eef3ff,#e9ecff);
  color:#1f2a44; border: 1px solid rgba(47,125,246,.18);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-more{ font-size: 12px; color:#64748b; }

/* 手機：格子高度放小一點 */
@media (max-width: 560px){
  .cal-cell{ min-height: 92px; }
}

/* 導覽列上的主題切換按鈕（與導覽項同高、置中） */
.navbar .nav-list{
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: var(--header-h); /* 讓整排吃滿 header 高度，便於置中 */
}
.navbar .nav-list > li{
  display: flex;
  align-items: center;
}

/* 將右側動作（主題鈕）推到「成果花絮」右邊：把該 <li> 加上 .right-actions 或 .ml-auto */
.navbar .nav-list > li.right-actions,
.navbar .nav-list > li.ml-auto{ margin-left: auto; }

/* 導覽連結 / split 標題 / split 開關 / 主題鈕：同高度、同左右內距 */
.navbar .nav-list > li > a,
.navbar .nav-list > li > .drop-title,
.navbar .nav-list > li > .drop-toggle,
.navbar .nav-list > li > .nav-icon-btn{
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
  padding: 0 var(--nav-px);
  border-radius: 12px;
}

/* 主題鈕（單一版本，已去重） */
.nav-list .nav-icon-btn{
  display: grid; place-items: center;
  width: var(--toggle-size); height: var(--toggle-size);
  padding: 0; margin-left: 6px;
  border-radius: 12px; /* 改成 50% 可做圓形 */
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  color: inherit; cursor: pointer;
  transition: background .18s, transform .08s, box-shadow .18s;
}
.nav-list .nav-icon-btn:hover{ background: var(--toggle-bg-hover); }
.nav-list .nav-icon-btn:active{ transform: translateY(.5px); }

/* 只在鍵盤導覽時顯示外圈；滑鼠點擊不顯示 */
.nav-list .nav-icon-btn:focus{ outline: none; }
.nav-list .nav-icon-btn:focus:not(:focus-visible){ box-shadow: none; }
.nav-list .nav-icon-btn:focus-visible{ box-shadow: 0 0 0 2px var(--toggle-ring); }

/* 分隔線（放在「成果花絮」與主題鈕之間，已去重） */
.nav-list .nav-sep{
  align-self: stretch; width: 1px; margin: 0 6px;
  background: color-mix(in srgb, currentColor 20%, transparent);
  opacity: .6;
}

/* 若有導覽底線動畫，調整位置（保留你的設定） */
/*#navbar a::after{ bottom: 10px; }*/

/* --- 修正主題切換鈕過高（覆蓋原本 var(--header-h)）--- */
.navbar .nav-list > li > .nav-icon-btn{
  align-self: center;
}

/* 實際尺寸（36x36）與樣式 */
.navbar .right-actions .nav-icon-btn{
  width: 36px !important;
  height: 42px !important;
  line-height: 42px !important;
  border-radius: 30% !important;
  display: grid !important;
  place-items: center !important;
  margin-left: 8px;
  margin-right: 4px;
  padding: 5px 0 !important;
}

/* 圖示大小與置中 */
.navbar .right-actions .nav-icon-btn i{
  font-size: 18px;
  line-height: 1;
}