/* ==================== 全域導覽列與使用者區 ==================== */
:root{
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #667eea;
  --primary-600: #5568d3;
  --ring: rgba(102,126,234,.28);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --navbar-bg: #ffffff;
  --search-bg: #ffffff;
  --search-border: #dddddd;
  --mobile-btn-bg: #f3f4f6;
  --mobile-btn-text: #111827;
}

*{ -webkit-tap-highlight-color: transparent; }

html[data-theme="dark"]{
  --bg: #0b1220;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #7c8cf8;
  --primary-600: #6f7ef0;
  --ring: rgba(124,140,248,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.35);
  --shadow-md: 0 10px 28px rgba(0,0,0,.5);
  --navbar-bg: #0f172a;
  --search-bg: #111827;
  --search-border: #334155;
  --mobile-btn-bg: #1f2937;
  --mobile-btn-text: #e5e7eb;
}

html, body{
  background: var(--bg);
  color: var(--text);
}

/* 更一致的 focus 樣式（鍵盤操作更清楚） */
:where(a, button, input, select, textarea, [role="button"]):focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-color: var(--primary);
}

.navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: var(--navbar-bg) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  padding: 15px 30px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* 導覽列內搜尋（與下方「目前活動」對齊置中） */
.navbar-with-search {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 24px;
}
.navbar-with-search .navbar-center {
  flex: 1;
}
.navbar-center {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
.navbar-search {
  width: 100%;
  max-width: 460px;
  display: flex !important;
  align-items: center !important;
  gap: 8px;
}
/* 左側 spacer 與按鈕同寬，讓搜尋框本身對齊頁面中央 */
.navbar-search .search-btn-spacer {
  flex: 0 0 auto;
  width: 70px;
}
.navbar-search .search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.navbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.navbar-search .search-icon svg {
  display: block;
}
.navbar-search .search-icon .search-svg-icon{
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: .78;
}
.navbar-search .search-icon img {
  display: block;
  width: 16px;
  height: 16px;
  opacity: .72;
}
.mobile-search-toggle-btn .search-svg-icon{
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: .92;
}
.mobile-search-toggle-btn img{
  width: 16px;
  height: 16px;
  display: block;
  opacity: .9;
}
.navbar-search input {
  flex: 1;
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--search-border);
  background: var(--search-bg);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  text-align: left;
}
.navbar-search input::placeholder {
  text-align: left;
}
.navbar-search input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}
.navbar-search button {
  flex: 0 0 auto;
  min-width: 70px;
  height: 36px;
  padding: 0 18px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
.navbar-search button:hover {
  background: #5568d3;
}

/* Logo 品牌區 */
.navbar-brand {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.navbar-brand a {
  text-decoration: none;
  color: inherit;
  display: inline-block;
}

.navbar-brand img {
  height: 40px !important;
  vertical-align: middle !important;
}

/* 使用者操作區（登入/註冊/設定） */
.navbar-user {
  display: flex !important;
  align-items: center !important;
  gap: 20px;
}

.navbar-mobile-actions,
.mobile-search-panel,
.mobile-menu-overlay,
.mobile-menu-panel{
  display: none;
}

.mobile-icon-btn{
  appearance: none;
  border: 1px solid rgba(15,23,42,.12);
  background: var(--mobile-btn-bg);
  color: var(--mobile-btn-text);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

/* ==================== Cookie 同意橫幅 ==================== */
.cookie-consent{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1300;
  background: #111827;
  color: #f9fafb;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.cookie-consent[hidden]{ display:none !important; }
.cookie-consent__content{ min-width: 0; }
.cookie-consent__title{
  font-weight: 800;
  margin-bottom: 4px;
}
.cookie-consent__text{
  font-size: 13px;
  color: #e5e7eb;
  line-height: 1.55;
}
.cookie-consent__text a{
  color: #93c5fd;
  margin-left: 6px;
}
.cookie-consent__actions{
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.cookie-btn{
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 10px;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.cookie-btn--secondary{
  background: transparent;
  color: #f9fafb;
}
.cookie-btn--primary{
  background: #4f46e5;
  color: #fff;
  border-color: #6366f1;
}
.cookie-btn--primary:hover{ background: #4338ca; }

/* ==================== 全站內容頂部留白（避免各頁不一致） ==================== */
/* 很多頁面各自定義 .container padding-top，會造成「導覽列下方空隙」不一致；
   這裡用全域規則統一，讓所有頁面（含首頁）視覺一致。 */
.container{
  padding-top: 100px !important;
}

/* 使用者信箱顯示 */
.user-email {
  color: var(--muted);
  font-size: 14px;
}

/* 導覽連結按鈕 */
.nav-link {
  background: #667eea;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.nav-link:hover {
  background: #5568d3;
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

/* ==================== 通用按鈕 ==================== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* ==================== 通用表單控件 ==================== */
input[type="text"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea{
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ==================== Chip / 篩選膠囊 ==================== */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 14px;
  border-radius:999px;
  text-decoration:none;
  font-size:14px;
  font-weight:600;
  color:#4c51bf;
  background:#eef2ff;
  border:1px solid rgba(102,126,234,.18);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  user-select:none;
}
.chip:hover{
  background:#c7d2fe;
  color:#4338ca;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(67,56,202,.12);
}
.chip--active{
  background: var(--primary);
  color:#fff;
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 10px 22px rgba(102,126,234,.22);
}

/* ==================== 列表篩選列 ==================== */
.filters-bar{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  margin: -10px 0 24px;
}
.filters-form{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
}
.filters-label{
  font-size:13px;
  color: var(--muted);
  font-weight:700;
}
.filters-select{
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ==================== 訊息提示 ==================== */
.flash-messages {
  margin-bottom: 20px;
}

.flash-message {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.flash-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* ==================== 響應式導覽列 ==================== */
@media (max-width: 768px) {
  /* 手機：改成 FB 風格上方橫列（logo + icon） */
  .navbar {
    padding: 8px 12px !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px;
    /* 手機改用 sticky：不遮住內容 */
    position: sticky !important;
    top: 0;
  }

  .container{
    padding-top: 16px !important;
  }

  .navbar-with-search { display: flex !important; }

  .navbar-brand {
    display: flex;
    justify-content: flex-start !important;
    align-items: center;
    width: auto !important;
  }

  .navbar-brand img {
    height: 32px !important;
  }

  .navbar-mobile-actions{
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .navbar-center{ display: none !important; }

  .navbar-user {
    display: none !important;
  }

  /* 手機上隱藏返回類按鈕（使用手機系統返回手勢） */
  .back-link,
  .btn-back,
  .btn-quiet {
    display: none !important;
  }

  .mobile-search-panel{
    display: none;
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    background: var(--surface);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 12px 24px rgba(15,23,42,.16);
    z-index: 1100;
  }
  .mobile-search-panel.is-open{ display: block; }
  .mobile-search-form{
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .mobile-search-form input{
    flex: 1;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--search-bg);
    color: var(--text);
    border-radius: 8px;
    padding: 0 12px;
  }
  .mobile-search-form button{
    height: 36px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: #fff;
    padding: 0 12px;
    font-weight: 600;
  }

  .mobile-menu-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.38);
    z-index: 1200;
  }
  .mobile-menu-overlay.is-open{ display: block; }

  .mobile-menu-panel{
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    width: min(82vw, 320px);
    height: 100vh;
    background: var(--surface);
    box-shadow: -12px 0 28px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .22s ease;
    z-index: 1210;
  }
  .mobile-menu-panel.is-open{ transform: translateX(0); }

  .mobile-menu-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
  }
  .mobile-menu-close{
    border: none;
    background: var(--mobile-btn-bg);
    color: var(--text);
    width: 34px;
    height: 34px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .mobile-menu-body{
    padding: 10px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .mobile-menu-link{
    text-decoration: none;
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    background: color-mix(in oklab, var(--surface) 88%, var(--bg));
    border: 1px solid var(--border);
    font-weight: 600;
  }
.mobile-menu-link:hover{ background: color-mix(in oklab, var(--primary) 18%, var(--surface)); }
  .mobile-menu-lang{
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  body.mobile-menu-open{
    overflow: hidden;
  }

  .cookie-consent{
    left: 10px;
    right: 10px;
    bottom: 10px;
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-consent__actions{
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 6px 10px !important;
    position: sticky !important;
    top: 0;
  }

  .container{
    padding-top: 14px !important;
  }

  .navbar-brand img {
    height: 28px !important;
  }

  /* 超小螢幕直接隱藏 email，只保留按鈕與圖示 */
  .user-email {
    display: none !important;
  }

  .navbar-brand { justify-content: flex-start !important; }
}

/* ==================== 社群風三欄殼（類臉書） ==================== */
.app-shell{
  --side-w: 260px;
  --rail-w: 320px;
  --main-w: 760px; /* 中間資訊流最大寬（類 FB） */
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, var(--main-w)) var(--rail-w);
  gap: 18px;
  align-items: start;
  width: 100%;
  justify-content: space-between; /* 左右貼邊，中間保持固定最大寬 */
}

.app-shell__side{
  position: sticky;
  top: 88px; /* navbar 高度附近 */
  max-height: calc(100vh - 100px);
  overflow: auto;
  padding-right: 4px;
}

.app-shell__main{
  min-width: 0;
}

.feed{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 首頁 ICON 快捷列（類 FB 上方 ICON 導覽） */
.icon-nav{
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 16px;
  padding: 8px 0 4px;
}
.icon-nav__btn{
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 22px;
  cursor:pointer;
  text-decoration:none;
  color: #4b5563;
  position: relative;
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.icon-nav__btn:hover{
  background: rgba(15,23,42,.06);
  transform: translateY(-1px);
}
.icon-nav__btn.is-active{
  background: rgba(102,126,234,.18);
  color: #1f2937;
}
.icon-nav__btn--profile-svg img{
  display: block;
  width: 24px;
  height: auto;
  opacity: .95;
}
.icon-nav__btn span{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* 左側：階層式捷徑 */
.side-nav{
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 6px 4px;
}
.side-nav__section + .side-nav__section{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.side-nav__title{
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  margin: 6px 10px 8px;
  display:flex;
  align-items:center;
  justify-content: space-between;
}
.side-nav__title--summary{
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.side-nav__title--summary::-webkit-details-marker{ display:none; }
.side-nav__chev{ opacity:.65; font-size: 12px; }

.side-nav__item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--text);
  transition: background .12s ease, transform .12s ease;
}
.side-nav__item:hover{
  background: rgba(15,23,42,.055);
  transform: translateY(-1px);
}
.side-nav__item.is-active{
  background: rgba(102,126,234,.14);
}
.side-nav__icon{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15,23,42,.05);
  display:flex;
  justify-content:center;
  align-items:center;
  opacity: .95;
}
.side-nav__icon--profile-svg img{
  display: block;
  max-width: 22px;
  height: auto;
}

/* ==================== 深色模式：全頁修正層 ==================== */
html[data-theme="dark"] body{
  background: var(--bg) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .container,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .app-shell__main,
html[data-theme="dark"] .app-shell__side{
  background: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .post-card,
html[data-theme="dark"] .header,
html[data-theme="dark"] .profile-section,
html[data-theme="dark"] .exhibition-header,
html[data-theme="dark"] .exhibition-hero.no-banner,
html[data-theme="dark"] .media-card,
html[data-theme="dark"] .rail-card,
html[data-theme="dark"] .settings-menu,
html[data-theme="dark"] .composer-card,
html[data-theme="dark"] .container > .header{
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

html[data-theme="dark"] .navbar{
  border-bottom: 1px solid var(--border) !important;
}

html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .page-header p,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .post-card__title,
html[data-theme="dark"] .post-card__meta,
html[data-theme="dark"] .profile-label,
html[data-theme="dark"] .profile-value,
html[data-theme="dark"] .media-title,
html[data-theme="dark"] .media-meta,
html[data-theme="dark"] .side-nav__label,
html[data-theme="dark"] .right-rail,
html[data-theme="dark"] .list-panel-title,
html[data-theme="dark"] .exhibition-title{
  color: var(--text) !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] small,
html[data-theme="dark"] li,
html[data-theme="dark"] label,
html[data-theme="dark"] td,
html[data-theme="dark"] th{
  color: var(--text) !important;
}

html[data-theme="dark"] .hint,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .post-card__meta,
html[data-theme="dark"] .media-meta,
html[data-theme="dark"] .list-date,
html[data-theme="dark"] .cookie-consent__text{
  color: #b6c2d3 !important;
}

html[data-theme="dark"] a{
  color: #a5b4fc;
}

html[data-theme="dark"] a:hover{
  color: #c7d2fe;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select{
  background: #0f172a !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{
  color: #7c8aa0 !important;
}
html[data-theme="dark"] .navbar-search .search-icon img,
html[data-theme="dark"] .mobile-search-toggle-btn img{
  filter: brightness(0) invert(0.88);
  opacity: .95;
}
html[data-theme="dark"] .navbar-search .search-icon .search-svg-icon,
html[data-theme="dark"] .mobile-search-toggle-btn .search-svg-icon{
  color: #cbd5e1;
  opacity: .98;
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-quiet,
html[data-theme="dark"] .nav-link{
  border-color: var(--border) !important;
}

html[data-theme="dark"] .btn-primary{
  background: var(--primary) !important;
  color: #fff !important;
}

html[data-theme="dark"] .btn-primary:hover{
  background: var(--primary-600) !important;
}

html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .btn-quiet,
html[data-theme="dark"] .btn-back{
  background: #1f2937 !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .mobile-menu-link,
html[data-theme="dark"] .side-nav__item,
html[data-theme="dark"] .icon-nav__btn{
  color: var(--text) !important;
}

html[data-theme="dark"] .rail-link{
  background: #1e293b !important;
  color: #c7d2fe !important;
  border-color: #3b4d66 !important;
}

html[data-theme="dark"] .rail-link:hover{
  background: #2a3a63 !important;
  color: #eef2ff !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.35) !important;
}

html[data-theme="dark"] .chip{
  background: #1c2742 !important;
  color: #c7d2fe !important;
  border-color: #334a75 !important;
}

html[data-theme="dark"] .chip:hover{
  background: #2a3a63 !important;
  color: #eef2ff !important;
  box-shadow: 0 6px 16px rgba(0,0,0,.35) !important;
}

html[data-theme="dark"] .chip--active{
  background: #7c8cf8 !important;
  color: #0b1220 !important;
  border-color: #a5b4fc !important;
}

html[data-theme="dark"] .chip span{
  color: inherit !important;
}

html[data-theme="dark"] .filters-select{
  background: #0f172a !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .filters-select option{
  background: #0f172a;
  color: var(--text);
}

html[data-theme="dark"] .media-preview-wrap,
html[data-theme="dark"] .media-preview,
html[data-theme="dark"] .exhibition-cover,
html[data-theme="dark"] .floorplan-container{
  background: #0f172a !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .flash-message,
html[data-theme="dark"] .alert{
  border-color: var(--border) !important;
}

html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty-photos{
  background: #111827 !important;
  color: #dbe6f5 !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.32) !important;
}

html[data-theme="dark"] .empty-state h1,
html[data-theme="dark"] .empty-state h2,
html[data-theme="dark"] .empty-state h3,
html[data-theme="dark"] .empty-photos h1,
html[data-theme="dark"] .empty-photos h2,
html[data-theme="dark"] .empty-photos h3{
  color: #e5edf8 !important;
}

html[data-theme="dark"] .empty-state p,
html[data-theme="dark"] .empty-state small,
html[data-theme="dark"] .empty-state span,
html[data-theme="dark"] .empty-photos p,
html[data-theme="dark"] .empty-photos small,
html[data-theme="dark"] .empty-photos span,
html[data-theme="dark"] .empty-photos-icon{
  color: #b6c2d3 !important;
}

/* 針對大量 inline style 的頁面做保底覆蓋 */
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:white"]{
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] [style*="background: #f5f7fa"],
html[data-theme="dark"] [style*="background:#f5f7fa"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f8fafc"]{
  background: #0f172a !important;
}

html[data-theme="dark"] [style*="color: #333"],
html[data-theme="dark"] [style*="color:#333"],
html[data-theme="dark"] [style*="color: #1f2937"],
html[data-theme="dark"] [style*="color:#1f2937"],
html[data-theme="dark"] [style*="color: #111827"],
html[data-theme="dark"] [style*="color:#111827"]{
  color: var(--text) !important;
}

html[data-theme="dark"] [style*="color: #666"],
html[data-theme="dark"] [style*="color:#666"],
html[data-theme="dark"] [style*="color: #6b7280"],
html[data-theme="dark"] [style*="color:#6b7280"],
html[data-theme="dark"] [style*="color: #999"],
html[data-theme="dark"] [style*="color:#999"]{
  color: #b6c2d3 !important;
}

html[data-theme="dark"] [style*="color: #4f46e5"],
html[data-theme="dark"] [style*="color:#4f46e5"],
html[data-theme="dark"] [style*="color: #667eea"],
html[data-theme="dark"] [style*="color:#667eea"]{
  color: #b8c2ff !important;
}
.side-nav__label{
  font-weight: 750;
  font-size: 15px;
}

/* FB 風：側欄更像「捷徑清單」的外框 */
.app-shell__side--left{
  padding-top: 4px;
}

/* 右側：資訊欄 */
.right-rail{
  display:flex;
  flex-direction: column;
  gap: 12px;
}
.rail-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 14px 14px;
}
.rail-card__title{
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}
.rail-list{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.rail-list__item + .rail-list__item{ margin-top: 6px; }
.rail-muted{ color: var(--muted); font-size: 13px; }
.rail-actions{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.rail-link{
  text-decoration:none;
  color: var(--primary-600);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(102,126,234,.08);
  border: 1px solid rgba(102,126,234,.18);
}
.rail-link:hover{
  background: rgba(102,126,234,.14);
}
.rail-chips{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip--soft{
  background: rgba(102,126,234,.08);
  color: #4338ca;
  border: 1px solid rgba(102,126,234,.16);
  font-weight: 700;
}

/* 主欄：貼文卡 */
.post-card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.post-card__header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}
.post-card__title{
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  margin: 0;
}
.post-card__meta{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-card__body{
  padding: 0 16px 14px;
  color: var(--text);
}
.post-card__actions{
  display:flex;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
}
.btn-quiet{
  background: rgba(15,23,42,.04);
  color: var(--text);
  border: 1px solid rgba(15,23,42,.08);
}
.btn-quiet:hover{ background: rgba(15,23,42,.06); }

/* 右上角「⋯」更多（純樣式，JS 由各頁需要時加） */
.kebab{
  appearance: none;
  border: 1px solid rgba(15,23,42,.18);
  background: #ffffff;
  color: #111827;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 6px 14px rgba(15,23,42,.18);
}
.kebab:hover{
  background: #f8fafc;
  border-color: rgba(15,23,42,.28);
}

.photo-menu{
  position:absolute;
  top:10px;
  right:10px;
  z-index:10;
}
.photo-menu-panel{
  position:absolute;
  top:40px;
  right:0;
  min-width:160px;
  background:#fff;
  border-radius:10px;
  box-shadow:0 10px 25px rgba(15,23,42,.18);
  padding:6px 0;
  display:none;
}
.photo-menu-item{
  width:100%;
  padding:8px 14px;
  border:none;
  background:transparent;
  text-align:left;
  font-size:13px;
  cursor:pointer;
}
.photo-menu-item:hover{
  background:rgba(15,23,42,.04);
}
.photo-menu-item-danger{
  color:#b91c1c;
}

/* RWD：平板改雙欄；手機單欄 */
@media (max-width: 992px){
  .app-shell{
    grid-template-columns: var(--side-w) minmax(0, 1fr);
    justify-content: start;
  }
  .app-shell__side--right{ display:none; }
}
@media (max-width: 768px){
  .app-shell{
    grid-template-columns: 1fr;
    justify-content: start;
  }
  .app-shell__side--left{ display:none; }
  .app-shell__side{ position: static; max-height: none; }
}

