* { box-sizing: border-box; }

:root {
  --bg: #0a0a0c;
  --bg-panel: #171511;
  --bg-panel-alt: #1e1a14;
  --gold: #ce853d;
  --gold-bright: #e8b169;
  --rust: #b93b1d;
  --rust-bright: #d94f2c;
  --text: #eae4d8;
  --text-dim: #a89b86;
  --border: #3a2e1f;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }
a { color: var(--gold-bright); }

/* ---- 開場 Loading 動畫 ---- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.4s ease;
  animation: loader-auto-dismiss 0s ease 8s forwards;
}
.page-loader.loader-hidden { opacity: 0; pointer-events: none; }
@keyframes loader-auto-dismiss {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}
.loader-seal {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: loader-seal-fade-in 0.6s ease;
}
.page-loader.bursting .loader-seal {
  animation: loader-seal-exit 0.4s ease forwards;
}
@keyframes loader-seal-fade-in {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes loader-seal-exit {
  to { opacity: 0; transform: scale(1.3); }
}
.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed var(--gold);
  animation: loader-ring-spin 6s linear infinite;
}
.loader-ring-2 {
  inset: 14px;
  border-color: var(--rust-bright);
  animation-duration: 4s;
  animation-direction: reverse;
}
@keyframes loader-ring-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.loader-enter-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--gold-bright);
  background: var(--bg-panel);
  color: var(--gold-bright);
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 2px;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(232, 177, 105, 0.5);
  animation: loader-btn-pulse 2s ease-in-out infinite;
}
.loader-enter-btn:hover { background: var(--bg-panel-alt); }
@keyframes loader-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(232, 177, 105, 0.5); }
  50%      { box-shadow: 0 0 22px rgba(232, 177, 105, 0.7); }
}
.loader-burst {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-bright) 0%, var(--rust-bright) 45%, transparent 72%);
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}
.page-loader.bursting .loader-burst {
  animation: loader-burst-expand 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes loader-burst-expand {
  0%   { transform: scale(0); opacity: 0.9; }
  70%  { opacity: 0.6; }
  100% { transform: scale(45); opacity: 0; }
}

/* ---- 飄落花瓣背景 ---- */
#petal-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ---- 點擊水墨噴濺 ---- */
.ink-splash {
  position: fixed;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  pointer-events: none;
  z-index: 8000;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, rgba(10, 8, 6, 0.6), rgba(10, 8, 6, 0.35) 40%, transparent 70%),
    radial-gradient(circle at 68% 65%, rgba(10, 8, 6, 0.5), transparent 60%);
  box-shadow: 0 0 10px rgba(232, 177, 105, 0.35);
  transform: rotate(var(--r, 0deg)) scale(0);
  animation: ink-splash-anim 0.6s ease-out forwards;
}
@keyframes ink-splash-anim {
  0%   { transform: rotate(var(--r, 0deg)) scale(0); opacity: 0.9; }
  55%  { transform: rotate(var(--r, 0deg)) scale(1); opacity: 0.7; }
  100% { transform: rotate(var(--r, 0deg)) scale(1.35); opacity: 0; }
}

/* ---- 左側可拖曳小窗 ---- */
.side-widget {
  position: fixed;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  z-index: 600;
  width: 180px;
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  padding: 8px;
  user-select: none;
}
.side-widget.dragging { opacity: 0.85; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.7); }
.side-widget-right { left: auto; right: 20px; }
.side-widget-handle {
  cursor: grab;
  text-align: center;
  color: var(--text-dim);
  font-size: 1em;
  padding: 2px 0 6px;
  letter-spacing: 2px;
}
.side-widget-handle:active { cursor: grabbing; }
.side-widget-img {
  display: block;
  width: 100%;
  border-radius: 4px;
  margin-bottom: 6px;
  pointer-events: none;
}
.side-widget-text {
  color: var(--text);
  font-size: 0.85em;
  line-height: 1.6;
  white-space: pre-line;
}
.side-widget-link { display: block; text-decoration: none; }
.side-widget-link:hover .side-widget-img { opacity: 0.9; }

/* ---- 每日籤詩小工具 ---- */
.fortune-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 500;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--bg-panel);
  color: var(--gold-bright);
  font-size: 0.75em;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.fortune-btn:hover { border-color: var(--gold-bright); background: var(--bg-panel-alt); }

.fortune-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fortune-modal.hidden { display: none; }
.fortune-box {
  position: relative;
  width: 90%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}
.fortune-box h2 { margin: 0 0 16px; color: var(--gold-bright); letter-spacing: 2px; }
.fortune-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1em;
  cursor: pointer;
}
.fortune-close:hover { color: var(--gold-bright); }
.fortune-hint { color: var(--text-dim); margin: 0 0 16px; }
.fortune-draw-btn {
  background: var(--rust);
  color: var(--text);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 1em;
  cursor: pointer;
}
.fortune-draw-btn:hover { background: var(--rust-bright); }
.fortune-grade {
  color: var(--gold-bright);
  font-size: 1.3em;
  font-weight: bold;
  letter-spacing: 2px;
  margin: 0 0 12px;
  text-shadow: 0 0 10px rgba(206, 133, 61, 0.4);
}
.fortune-poem {
  white-space: pre-line;
  line-height: 1.9;
  margin: 0 0 14px;
  color: var(--text);
}
.fortune-note {
  color: var(--text-dim);
  font-size: 0.9em;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin: 0;
}

.announcement-bar {
  background: var(--rust);
  border-bottom: 1px solid var(--gold);
  overflow: hidden;
  white-space: nowrap;
}
.announcement-track {
  display: inline-block;
  padding-left: 100%;
  color: var(--text);
  font-weight: bold;
  animation-name: announcement-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes announcement-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.site-header {
  background: #000;
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 12px rgba(206, 133, 61, 0.15);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; min-height: 50px; }
.header-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.header-right a, .header-right .link-btn { color: var(--text-dim); text-decoration: none; font-size: 0.85em; }
.header-right a:hover, .header-right .link-btn:hover, .admin-entry-link:hover { color: var(--gold-bright); }

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}
.hamburger-btn span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--gold-bright); }

.header-search {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 320px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.header-search input {
  flex: 1;
  min-width: 0;
  background: var(--bg-panel);
  border: none;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.85em;
}
.header-search input:focus { outline: none; background: var(--bg-panel-alt); }
.header-search button {
  background: var(--bg-panel-alt);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 10px;
  cursor: pointer;
}
.header-search button:hover { color: var(--gold-bright); }

.mobile-nav {
  display: none;
  flex-direction: column;
  background: #000;
  border-bottom: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  font-size: 0.95em;
}
.mobile-nav-link:hover { background: var(--bg-panel-alt); color: var(--gold-bright); }

@media (max-width: 640px) {
  .hamburger-btn { display: flex; }
  .header-search { max-width: none; order: 3; flex-basis: 100%; }
  .board-tabs { display: none; }
}

.img-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.3;
  border: 1px dashed var(--border);
  background: repeating-linear-gradient(45deg, #14110c, #14110c 8px, #1a160f 8px, #1a160f 16px);
  color: var(--text-dim); font-size: 0.7em; text-decoration: none;
  border-radius: 2px; flex-shrink: 0;
}
.hamburger-placeholder { width: 32px; height: 50px; cursor: default; }
.logo-placeholder { width: 89px; height: 40px; color: var(--gold-bright); }
.logo-link {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  text-decoration: none;
}
.logo-link img { display: block; }
/* Logo 旁邊的「首頁」文字，圖片實際寬高在後台設定，這裡不寫死 */
.logo-home-label {
  color: var(--gold-bright);
  font-size: 1.05em;
  font-weight: bold;
  letter-spacing: 3px;
  white-space: nowrap;
}
.logo-link:hover .logo-home-label { color: var(--gold); }
.board-tabs-cta { width: 190px; height: 58px; font-size: 0.85em; font-weight: bold; }

main.container { padding: 0 16px 60px; min-height: 60vh; }

.hero-banner {
  margin: 0 0 32px;
  padding: 70px 20px;
  text-align: center;
  background: linear-gradient(180deg, #1a1006 0%, #0a0a0c 100%);
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.hero-banner h2 {
  color: var(--gold-bright);
  font-size: 1.8em;
  letter-spacing: 4px;
  margin: 0 0 8px;
  text-shadow: 0 0 16px rgba(206, 133, 61, 0.4);
}
.hero-banner p { margin: 0; font-size: 0.9em; }
.hero-banner-image { padding: 0; overflow: hidden; }
.hero-banner-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 板塊列：項目太多放不下一整排時，不用橫向滑軌，
   平常只顯示一排（超出的部分被截掉），滑鼠移到這一整條上會往下展開顯示全部項目 */
.board-tabs {
  background: #000;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
}
.board-tabs-inner { display: flex; align-items: flex-start; padding: 0 16px; }
.board-tabs-cta-row { display: flex; justify-content: flex-end; padding: 8px 16px; }
.board-tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 54px;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.board-tabs:hover .board-tabs-list,
.board-tabs-list:focus-within {
  max-height: 400px;
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.6);
}
.board-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95em;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.board-tab:hover { color: var(--gold-bright); }
.board-tab.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
  font-weight: bold;
}
.board-tab-icon { width: 18px; height: 18px; object-fit: cover; border-radius: 2px; }

.board-tabs-write {
  flex-shrink: 0;
  margin-left: 16px;
  padding: 7px 16px;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #1a1006; font-weight: bold; text-decoration: none;
  border-radius: 2px; font-size: 0.9em; letter-spacing: 1px;
}
.board-tabs-write:hover { background: linear-gradient(180deg, #f5c37e 0%, var(--gold-bright) 100%); }

h1 { font-size: 1.7em; margin-top: 24px; color: var(--gold-bright); letter-spacing: 1px; }
.board-section-title { padding-top: 12px; border-top: 1px dashed var(--border); }
.board-section-title:first-of-type { border-top: none; padding-top: 0; }

.board-list, .post-list { list-style: none; padding: 0; margin: 16px 0; }
.board-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.board-list-cell-text { flex: 1 1 100%; }
.board-list-cell-image { flex: 0 0 auto; }
.board-item, .post-item {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
}
.board-item {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.board-item:hover { border-left-color: var(--gold-bright); background: var(--bg-panel-alt); }
.board-item-img { object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.board-item-body { min-width: 0; flex: 1; }
.board-item-image-only {
  padding: 0;
  border-left: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.board-item-image-only img {
  display: block;
  object-fit: cover;
  border-radius: 4px;
  overflow: hidden;
  width: 110px !important;
  height: 110px !important;
}
.board-item-image-title {
  color: var(--gold-bright);
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
}
.board-name { font-size: 1.15em; font-weight: bold; text-decoration: none; color: var(--gold-bright); display: block; }
.board-desc { color: var(--text-dim); margin: 6px 0 0; font-size: 0.95em; }
.board-count { color: var(--text-dim); font-size: 0.85em; }

.post-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.post-item-main { flex: 1; min-width: 0; }
.post-item-title { color: var(--text); text-decoration: none; font-size: 1.05em; }
.post-item-title:hover { color: var(--gold-bright); }
.post-excerpt {
  color: var(--text-dim); font-size: 0.85em; margin: 4px 0 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-item-meta { flex-shrink: 0; text-align: right; }
.post-date { color: var(--text-dim); font-size: 0.85em; display: block; }
.post-views { color: var(--text-dim); font-size: 0.8em; }

.post-detail { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px; padding: 24px; border-top: 2px solid var(--gold); }
.post-meta { color: var(--text-dim); font-size: 0.85em; margin-bottom: 16px; }
.post-content { word-wrap: break-word; }
.post-content img { max-width: 100%; border-radius: 2px; margin: 8px 0; border: 1px solid var(--border); cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
.lightbox-close {
  position: absolute;
  top: 16px; right: 24px;
  color: var(--text);
  font-size: 2em;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { color: var(--gold-bright); }

/* ---- 江湖英雄榜浮動卡片：匾額風格雙層邊框 ---- */
.leaderboard-widget {
  top: 90px;
  left: 20px;
  transform: none;
  position: fixed;
  border: 2px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #1c1610 0%, var(--bg-panel) 60%) padding-box,
    linear-gradient(135deg, var(--gold-bright), var(--rust), var(--gold-bright)) border-box;
  box-shadow: 0 0 24px rgba(232, 177, 105, 0.3), 0 2px 16px rgba(0, 0, 0, 0.6);
}
.leaderboard-widget::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(232, 177, 105, 0.35);
  border-radius: 4px;
  pointer-events: none;
}
.leaderboard-widget-title {
  color: var(--gold-bright);
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.4;
  text-shadow: 0 0 8px rgba(206, 133, 61, 0.5);
}
.leaderboard-widget .side-widget-text { text-align: center; margin: 0 0 8px; white-space: normal; }
.leaderboard-widget-arrow { color: var(--rust-bright); font-weight: bold; text-align: center; font-size: 0.85em; margin-top: 4px; }

/* ---- BGM 開關 ---- */
.bgm-toggle {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 500;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--bg-panel);
  color: var(--gold-bright);
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.bgm-toggle:hover { border-color: var(--gold-bright); background: var(--bg-panel-alt); }
.bgm-toggle.playing { animation: bgm-pulse 1.6s ease-in-out infinite; }
@keyframes bgm-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(232, 177, 105, 0.5); }
  50% { box-shadow: 0 0 16px rgba(232, 177, 105, 0.7); }
}

/* ---- 藏寶彩蛋 ---- */
.treasure-spot {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 221, 150, 1), rgba(232, 177, 105, 0.5) 55%, transparent 75%);
  box-shadow: 0 0 18px 6px rgba(255, 210, 120, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  cursor: pointer;
  z-index: 400;
  animation: treasure-twinkle 1.4s ease-in-out infinite;
}
.treasure-spot::before { content: '✨'; }
@keyframes treasure-twinkle {
  0%, 100% { opacity: 0.75; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.2); }
}
.treasure-box { text-align: center; }

/* ---- 日夜循環 ---- */
/* 白天：暖色調，金黃陽光感 */
:root[data-daytime="day"] {
  --bg: #1c1206;
  --bg-panel: #241a0d;
  --bg-panel-alt: #2c2110;
  --border: #4a3418;
}
/* 夜晚：冷色調，深藍紫夜空感 */
:root[data-daytime="night"] {
  --bg: #050510;
  --bg-panel: #12111d;
  --bg-panel-alt: #191828;
  --border: #2a2a40;
}

/* 全頁氛圍疊層：從天空圖案位置往外暈開的環境光 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  transition: background 1s ease;
}
:root[data-daytime="day"] body::before {
  background: radial-gradient(circle at 85% 8%, rgba(255, 180, 70, 0.22), transparent 45%);
}
:root[data-daytime="night"] body::before {
  background: radial-gradient(circle at 85% 8%, rgba(160, 180, 255, 0.14), transparent 50%),
              radial-gradient(circle at 50% 0%, rgba(30, 20, 70, 0.35), transparent 60%);
}

.daytime-orb {
  position: fixed;
  top: 60px;
  right: 60px;
  z-index: 3;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  pointer-events: none;
  animation: daytime-orb-float 6s ease-in-out infinite;
}
@keyframes daytime-orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
:root[data-daytime="day"] .daytime-orb {
  background: radial-gradient(circle at 35% 35%, #fff6d8, #ffcf5e 45%, #ff9d3d 80%);
  box-shadow:
    0 0 40px 14px rgba(255, 210, 100, 0.55),
    0 0 100px 50px rgba(255, 170, 60, 0.35),
    0 0 200px 100px rgba(255, 150, 40, 0.15);
}
:root[data-daytime="day"] .daytime-orb::after {
  content: '';
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 220, 140, 0.35) 0deg 4deg, transparent 4deg 18deg);
  animation: daytime-orb-spin 30s linear infinite;
  z-index: -1;
}
@keyframes daytime-orb-spin {
  to { transform: rotate(360deg); }
}
:root[data-daytime="night"] .daytime-orb {
  background: radial-gradient(circle at 35% 35%, #ffffff, #dfe6f5 55%, #aeb9d6 85%);
  box-shadow:
    0 0 30px 10px rgba(200, 210, 255, 0.5),
    0 0 80px 40px rgba(150, 165, 230, 0.3),
    0 0 160px 90px rgba(100, 115, 200, 0.15);
}
:root[data-daytime="night"] .daytime-orb::before {
  content: '';
  position: absolute;
  top: 8px; left: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 10px 2px rgba(0,0,0,0.25) inset;
}
@media (max-width: 640px) {
  .daytime-orb { width: 56px; height: 56px; top: 44px; right: 20px; }
}

/* ---- 首頁下方資訊區塊 ---- */
.home-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 32px 0;
}
.home-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: 3px;
  padding: 16px 18px;
}
.home-panel-title {
  margin: 0 0 12px;
  font-size: 1.05em;
  color: var(--gold-bright);
  letter-spacing: 1px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 8px;
}
.home-more-link { float: right; font-size: 0.8em; font-weight: normal; }
.home-list, .home-rank-list { list-style: none; padding: 0; margin: 0; }
.home-list > li {
  padding: 8px 0;
  border-bottom: 1px dashed rgba(58, 46, 31, 0.6);
}
.home-list > li:last-child { border-bottom: none; }
.home-list-title { color: var(--text); text-decoration: none; font-size: 0.95em; }
.home-list-title:hover { color: var(--gold-bright); }
.home-list-meta { color: var(--text-dim); font-size: 0.78em; margin-top: 3px; }
.home-list-excerpt { color: var(--text-dim); font-size: 0.82em; margin: 4px 0 0; line-height: 1.5; }
.home-list-sub { color: var(--text-dim); font-size: 0.78em; text-decoration: none; }
.home-list-sub:hover { color: var(--gold-bright); }
.home-comment-head { display: flex; justify-content: space-between; gap: 8px; }

.home-rank-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(58, 46, 31, 0.6);
}
.home-rank-list > li:last-child { border-bottom: none; }
.home-rank-list .home-list-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-rank-list .home-list-meta { margin: 0; flex-shrink: 0; }
.home-rank-num {
  flex-shrink: 0;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75em; font-weight: bold;
}
.home-rank-num.rank-1 { background: var(--gold); color: #1a1006; border-color: var(--gold-bright); }
.home-rank-num.rank-2 { background: #8a8175; color: #14110c; border-color: #a89b86; }
.home-rank-num.rank-3 { background: var(--rust); color: #f5e5d5; border-color: var(--rust-bright); }

.home-monsters { margin: 32px 0; }

.leaderboard-roster { list-style: none; padding: 0; margin: 16px 0; }
.leaderboard-roster-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 12px 18px; margin-bottom: 8px; border-left: 3px solid var(--gold);
}
.leaderboard-roster-item.rank-first { background: rgba(232, 177, 105, 0.12); }
.leaderboard-roster-item.rank-second { background: rgba(168, 155, 134, 0.1); }
.leaderboard-roster-item.rank-third { background: rgba(217, 79, 44, 0.08); }
.leaderboard-rank { font-size: 1.2em; width: 32px; text-align: center; flex-shrink: 0; }
.leaderboard-trophy { font-size: 1.6em; width: 40px; text-align: center; flex-shrink: 0; }
.leaderboard-trophy img { width: 40px; height: 40px; object-fit: contain; }
.leaderboard-roster-name { flex: 1; font-weight: bold; color: var(--gold-bright); font-size: 1.05em; }
.leaderboard-roster-level { color: var(--text-dim); font-size: 0.9em; flex-shrink: 0; }

/* ---- 首頁文章輪播 ---- */
.post-carousel {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 130px;
  margin: 16px auto;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.post-carousel-track { position: relative; width: 100%; height: 100%; }
.post-carousel-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.post-carousel-slide.is-active { opacity: 1; pointer-events: auto; }
.post-carousel-caption { padding: 10px 14px; width: 100%; }
.post-carousel-tag {
  display: inline-block; background: var(--gold); color: #1a1006;
  font-size: 0.68em; font-weight: bold; padding: 1px 6px; border-radius: 2px; margin-bottom: 4px;
}
.post-carousel-title {
  display: block; color: #fff; font-size: 1em; font-weight: bold;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.post-carousel-views { display: block; color: #f0d9b8; font-size: 0.75em; margin-top: 2px; }
.post-carousel-dots { position: absolute; bottom: 6px; right: 10px; display: flex; gap: 5px; }
.post-carousel-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.35); transition: background 0.3s; }
.post-carousel-dot.is-active { background: var(--gold-bright); }

@media (max-width: 640px) {
  .post-carousel { height: 100px; }
  .post-carousel-title { font-size: 0.9em; }
}

/* ---- 置頂 ---- */
.post-item-pinned { border-left-color: var(--rust-bright); background: rgba(217, 79, 44, 0.06); }
.post-flag {
  display: inline-block; font-size: 0.72em; font-weight: bold;
  padding: 1px 7px; border-radius: 2px; margin-right: 6px; vertical-align: middle;
}
.post-flag-pin { background: var(--rust); color: #f5e5d5; }
.post-flag-btn {
  background: var(--bg-panel-alt); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 3px; padding: 6px 14px; cursor: pointer; font-size: 0.85em;
}
.post-flag-btn:hover { border-color: var(--gold); color: var(--text); }
.post-flag-btn.is-on { background: var(--gold); border-color: var(--gold-bright); color: #1a1006; font-weight: bold; }

/* ---- 掉落物反查 ---- */
.drop-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.drop-tag {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 14px; color: var(--gold-bright); text-decoration: none; font-size: 0.85em;
}
.drop-tag:hover { border-color: var(--gold); background: var(--bg-panel-alt); }

.drop-result-list { list-style: none; padding: 0; margin: 16px 0; }
.drop-result-item { margin-bottom: 8px; }
.drop-result-link {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--bg-panel); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 3px; padding: 12px 16px;
}
.drop-result-link:hover { background: var(--bg-panel-alt); border-left-color: var(--gold-bright); }
.drop-result-img {
  width: 52px; height: 52px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
  font-size: 0.7em;
}
.drop-result-body { flex: 1; min-width: 0; }
.drop-result-monster { display: block; color: var(--gold-bright); font-weight: bold; }
.drop-result-location { display: block; color: var(--text-dim); font-size: 0.8em; margin-top: 2px; }
.drop-result-item-info { text-align: right; flex-shrink: 0; }
.drop-result-name { display: block; color: var(--text); font-size: 0.9em; }
.drop-result-rate { display: block; color: var(--rust-bright); font-weight: bold; font-size: 0.85em; margin-top: 2px; }

/* ---- 幸運轉盤 ---- */
.wheel-stage { text-align: center; margin: 24px 0 40px; position: relative; }
.wheel-wrap { display: inline-block; position: relative; }
.wheel-pointer {
  color: var(--gold-bright); font-size: 2em; line-height: 1;
  margin-bottom: -6px; position: relative; z-index: 2;
  text-shadow: 0 0 10px rgba(232, 177, 105, 0.7);
}
#wheel-canvas { max-width: 100%; height: auto; filter: drop-shadow(0 4px 20px rgba(0,0,0,0.5)); }
.wheel-spin-btn {
  display: block; margin: 20px auto 0;
  background: linear-gradient(180deg, var(--rust-bright), var(--rust));
  color: #f5e5d5; border: 2px solid var(--gold);
  border-radius: 30px; padding: 12px 40px; font-size: 1.05em; font-weight: bold;
  letter-spacing: 2px; cursor: pointer;
  box-shadow: 0 0 16px rgba(217, 79, 44, 0.4);
}
.wheel-spin-btn:hover:not(:disabled) { background: linear-gradient(180deg, #e8613c, var(--rust-bright)); }
.wheel-spin-btn:disabled { opacity: 0.5; cursor: default; }
.wheel-result {
  margin-top: 20px; font-size: 1.2em; font-weight: bold; color: var(--gold-bright);
  min-height: 1.6em; opacity: 0; transition: opacity 0.4s ease;
  text-shadow: 0 0 12px rgba(206, 133, 61, 0.5);
}
.wheel-result.wheel-result-show { opacity: 1; }

/* 格子寬度固定、欄數隨容器自動排（900px 容器約一排 10 個），與道具／魔法圖鑑一致 */
.monster-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 16px 0;
}
.monster-card { width: auto; }
.monster-card.monster-card-hidden { display: none; }
.monster-card a { display: block; text-decoration: none; text-align: center; }
.monster-card-img {
  width: 100%; max-width: 64px; aspect-ratio: 1 / 1; margin: 0 auto;
  object-fit: contain; border-radius: 4px;
  background: var(--bg-panel); padding: 3px;
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 0.7em;
}
.monster-card a:hover .monster-card-img { border-color: var(--gold); }
.monster-more-wrap { text-align: center; margin: 16px 0; }
.monster-more-btn {
  background: var(--bg-panel); border: 1px solid var(--gold); color: var(--gold-bright);
  border-radius: 3px; padding: 8px 24px; cursor: pointer; font-size: 0.9em;
}
.monster-more-btn:hover { background: var(--bg-panel-alt); border-color: var(--gold-bright); }

@media (max-width: 640px) {
  /* auto-fill 會自己依螢幕寬度排，只需縮小間距 */
  .monster-grid { gap: 8px; }
}
.monster-card-name { display: block; margin-top: 5px; color: var(--gold-bright); font-weight: bold; font-size: 0.78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 出沒地圖可能很長，限制單行省略，否則卡片高度不一會讓整排歪掉 */
.monster-card-location { display: block; margin-top: 1px; color: var(--text-dim); font-size: 0.7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monster-location { color: var(--text-dim); font-size: 0.9em; margin: 4px 0; }
.monster-card-level { color: var(--text-dim); font-size: 0.85em; font-weight: normal; }
.monster-level { color: var(--rust-bright); font-size: 0.6em; font-weight: normal; vertical-align: middle; }

.monster-detail { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px; padding: 24px; border-top: 2px solid var(--gold); }
.monster-detail-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.monster-detail-img { width: 180px; height: 180px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0; }
.monster-description { color: var(--text-dim); white-space: pre-line; }

.drop-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.drop-row input { flex: 1; }

.search-form { display: flex; gap: 8px; max-width: 480px; margin: 16px 0 24px; }
.search-form input {
  flex: 1; background: var(--bg-panel); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 2px; font-size: 0.95em;
}
.search-form input:focus { outline: none; border-color: var(--gold); }
.search-submit {
  background: var(--rust); color: var(--text); border: 1px solid var(--gold);
  border-radius: 2px; padding: 10px 20px; cursor: pointer;
}
.search-submit:hover { background: var(--rust-bright); }
.post-board-tag {
  display: inline-block; color: var(--gold-bright); font-size: 0.85em;
  border: 1px solid var(--border); border-radius: 2px; padding: 0 6px; margin-right: 6px;
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 24px 0; }
.pagination-link { color: var(--gold-bright); text-decoration: none; }
.pagination-link:hover { text-decoration: underline; }
.pagination-disabled { color: var(--text-dim); opacity: 0.4; pointer-events: none; }
.pagination-status { color: var(--text-dim); font-size: 0.9em; }

.rating-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border);
}
.rating-badge {
  font-weight: bold; padding: 4px 12px; border-radius: 3px; letter-spacing: 1px;
  border: 1px solid var(--border);
}
.rating-badge.rank-none { color: var(--text-dim); }
.rating-badge.rank-novice { color: #b8f0c8; border-color: #1e7e34; }
.rating-badge.rank-adept { color: var(--gold-bright); border-color: var(--gold); }
.rating-badge.rank-master {
  color: #fff; background: linear-gradient(90deg, var(--rust), var(--gold));
  border-color: var(--gold-bright); text-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.rating-count { color: var(--text-dim); font-size: 0.9em; }
.rating-btn {
  background: var(--rust); color: var(--text); border: 1px solid var(--gold);
  border-radius: 3px; padding: 6px 16px; cursor: pointer; font-size: 0.9em;
}
.rating-btn:hover:not(:disabled) { background: var(--rust-bright); }
.rating-btn:disabled { opacity: 0.5; cursor: default; }

.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 16px 0 28px;
}
.admin-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 14px 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85em;
  font-weight: bold;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.admin-menu-card:hover { border-color: var(--gold-bright); background: var(--bg-panel-alt); transform: translateY(-2px); }
.admin-menu-icon { font-size: 1.4em; line-height: 1; }
.admin-menu-card-primary { border-top-color: var(--rust-bright); background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(217,79,44,0.08) 100%); }
.admin-menu-card-primary:hover { border-color: var(--rust-bright); }

.reward-list { list-style: none; padding: 0; margin: 16px 0; }
.reward-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 10px 14px; margin-bottom: 6px; border-left: 3px solid var(--gold);
}

.comments-section { margin-top: 32px; }
.comment-list { list-style: none; padding: 0; margin: 16px 0; }
.comment-item {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 12px 16px; margin-bottom: 8px; border-left: 3px solid var(--gold);
}
.comment-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.comment-author { color: var(--gold-bright); font-weight: bold; font-size: 0.9em; }
.comment-date { color: var(--text-dim); font-size: 0.8em; }
.comment-content { margin: 0; white-space: pre-line; word-wrap: break-word; }
.comment-form { max-width: 100%; margin-top: 16px; }

.empty-hint { color: var(--text-dim); }
.error-msg { color: #ffb4a3; background: rgba(185, 59, 29, 0.15); border: 1px solid var(--rust); padding: 10px 14px; border-radius: 2px; }
.success-msg { color: #b8f0c8; background: rgba(30, 126, 52, 0.15); border: 1px solid #1e7e34; padding: 10px 14px; border-radius: 2px; }

.form-box { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 2px; padding: 24px; max-width: 500px; border-top: 2px solid var(--gold); }
.form-box.post-form { max-width: 900px; }
.form-box label { display: block; margin-bottom: 14px; font-weight: bold; font-size: 0.95em; color: var(--text-dim); }
.form-box input[type="text"],
.form-box input[type="password"],
.form-box input[type="number"],
.form-box textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 2px; font-size: 1em; font-family: inherit;
  background: #0e0c09; color: var(--text);
}
.form-box input:focus, .form-box textarea:focus {
  outline: none; border-color: var(--gold);
}
.image-insert-box { margin-bottom: 16px; font-size: 0.9em; color: var(--text-dim); }

.editor-source { display: none; }
.editor-hint { font-size: 0.8em; color: var(--text-dim); margin: 6px 0 16px; }

.editor-toolbar.ql-toolbar.ql-snow {
  background: #0e0c09;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}
.editor-toolbar.ql-toolbar.ql-snow .ql-formats {
  display: inline-flex;
  align-items: center;
  height: 28px;
}
.ql-snow .ql-stroke { stroke: var(--text-dim); }
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill { fill: var(--text-dim); }
.ql-snow .ql-picker { color: var(--text-dim); }
.ql-toolbar.ql-snow .ql-picker-label { border: none; }
.ql-snow .ql-picker-options {
  background: #171511; border: 1px solid var(--border);
}
/* Quill 內建只幫 header/font/size 選單寫了顯示文字的規則，自訂的「特效」選單要自己補 */
.ql-snow .ql-picker.ql-effect .ql-picker-label[data-label]:not([data-label=''])::before,
.ql-snow .ql-picker.ql-effect .ql-picker-item[data-label]:not([data-label=''])::before {
  content: attr(data-label);
}
.ql-snow .ql-picker.ql-effect { width: 84px; }
.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow button.ql-active .ql-stroke { stroke: var(--gold-bright); }
.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow button.ql-active .ql-fill { fill: var(--gold-bright); }
.ql-toolbar.ql-snow button:hover .ql-picker-label,
.ql-toolbar.ql-snow .ql-picker-label.ql-active { color: var(--gold-bright); }
.ql-snow.ql-toolbar button:hover, .ql-snow .ql-toolbar button:hover { color: var(--gold-bright); }
.editor-toolbar.ql-toolbar.ql-snow button {
  width: 28px; height: 24px;
}

.editor-container.ql-container.ql-snow {
  background: #0e0c09;
  border: 1px solid var(--border);
  border-radius: 0 0 2px 2px;
  color: var(--text);
  font-size: 1em;
  height: 260px;
  width: 100%;
  resize: both;
  overflow: auto;
}
.ql-editor { min-height: 100%; }
.ql-editor.ql-blank::before { color: var(--text-dim); font-style: normal; }

/* 動態文字特效：後台編輯器與前台文章頁共用同一份規則 */
.fx-wrap[data-effect="blink"] {
  animation: fx-blink 1s step-start infinite;
}
@keyframes fx-blink {
  50% { opacity: 0; }
}

.fx-wrap[data-effect="rainbow"] {
  animation: fx-rainbow 3s linear infinite;
}
@keyframes fx-rainbow {
  0%   { color: #ff5555; }
  17%  { color: #ffb347; }
  34%  { color: #f5e050; }
  50%  { color: #6bdc6b; }
  67%  { color: #55c8ff; }
  84%  { color: #b18cff; }
  100% { color: #ff5555; }
}

.fx-wrap[data-effect="gradient"] {
  background-image: linear-gradient(90deg, var(--gold), var(--rust-bright), var(--gold-bright), var(--gold));
  background-size: 300% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: fx-gradient-move 3s linear infinite;
}
@keyframes fx-gradient-move {
  to { background-position: -300% center; }
}

.fx-wrap[data-effect="marquee"] {
  display: inline-block;
  width: 180px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  animation: fx-marquee 6s linear infinite;
}
@keyframes fx-marquee {
  from { text-indent: 100%; }
  to { text-indent: -100%; }
}

.color-formats { gap: 2px; padding: 0 4px; }
.color-swatch-item {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 2px;
  overflow: hidden; cursor: pointer;
}
.color-swatch-icon {
  pointer-events: none; font-size: 0.75em; font-weight: bold; color: var(--text-dim);
}
.color-swatch-icon-bg { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.color-swatch-item input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: none; background: none; cursor: pointer; opacity: 0.02;
}

.emoji-picker-wrap { position: relative; display: inline-block; vertical-align: middle; }
#emojiButton {
  background: none; border: 1px solid transparent; border-radius: 2px;
  color: var(--text-dim); font-size: 1.1em; line-height: 1;
  width: 28px; height: 24px; padding: 0; margin: 2px;
  cursor: pointer; vertical-align: middle;
}
#emojiButton:hover, #emojiButton.is-open { color: var(--gold-bright); border-color: var(--border); }
.emoji-panel {
  position: absolute; top: 100%; left: 0; z-index: 20;
  width: 260px;
  background: #171511; border: 1px solid var(--border); border-radius: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.6);
}
.emoji-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
  font-size: 0.8em; color: var(--text-dim);
}
.emoji-close-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 1em; line-height: 1; padding: 2px 4px; border-radius: 2px;
}
.emoji-close-btn:hover { color: var(--gold-bright); background: rgba(206, 133, 61, 0.15); }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 8px; }
.emoji-option {
  background: none; border: none; font-size: 1.2em; padding: 4px;
  cursor: pointer; border-radius: 2px; line-height: 1;
}
.emoji-option:hover { background: rgba(206, 133, 61, 0.2); }
.ql-snow .ql-tooltip {
  background: #171511; border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.ql-snow .ql-tooltip input[type=text] {
  background: #0e0c09; border: 1px solid var(--border); color: var(--text);
}
.ql-snow .ql-tooltip a.ql-action::after { color: var(--gold-bright); }

.icon-current { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; font-weight: normal; font-size: 0.85em; }
.icon-remove-checkbox { display: flex; align-items: center; gap: 4px; font-weight: normal; }

.btn {
  display: inline-block;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #1a1006; font-weight: bold; border: 1px solid #8a5a26;
  padding: 9px 20px; border-radius: 2px; cursor: pointer; font-size: 1em;
  text-decoration: none; letter-spacing: 1px;
}
.btn:hover { background: linear-gradient(180deg, #f5c37e 0%, var(--gold-bright) 100%); }
.btn-danger { background: linear-gradient(180deg, var(--rust-bright) 0%, var(--rust) 100%); color: #fff; border-color: #7a2812; }
.btn-danger:hover { background: linear-gradient(180deg, #e8654a 0%, var(--rust-bright) 100%); }
.btn-image { background: none; padding: 0; border-radius: 0; border: none; }
.btn-image img { max-height: 40px; display: block; }

.admin-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.inline-form { display: inline-block; margin: 0; }
.link-btn {
  background: none; border: none; color: var(--gold-bright); text-decoration: underline;
  cursor: pointer; padding: 0; font-size: 1em; font-family: inherit;
}
.link-btn-danger { color: var(--rust-bright); }

.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-panel); }
.admin-table th, .admin-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; font-size: 0.95em; }
.admin-table th { background: #241d14; color: var(--gold-bright); }
.admin-row-actions a, .admin-row-actions button { margin-right: 10px; }

.button-preview { max-height: 40px; }

.site-footer { text-align: center; color: var(--text-dim); padding: 24px 0; font-size: 0.85em; border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer-link { color: var(--gold-bright); text-decoration: none; }
.site-footer-link:hover { text-decoration: underline; }

/* ---- 道具／魔法圖鑑 ---- */
.dict-search { display: flex; gap: 8px; align-items: center; max-width: 520px; margin: 16px 0 12px; flex-wrap: wrap; }
.dict-search-input {
  flex: 1; min-width: 180px; background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: 3px; font-family: inherit;
}
.dict-search-input:focus { outline: none; border-color: var(--gold); }
.dict-search-btn {
  background: var(--bg-panel-alt); border: 1px solid var(--gold); color: var(--gold-bright);
  padding: 8px 18px; border-radius: 3px; cursor: pointer; font-family: inherit;
}
.dict-search-btn:hover { border-color: var(--gold-bright); background: #2a231a; }
.dict-reset { color: var(--text-dim); font-size: 0.85em; text-decoration: none; }
.dict-reset:hover { color: var(--gold-bright); text-decoration: underline; }

.dict-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.dict-filter {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--border); border-radius: 3px;
  background: var(--bg-panel); color: var(--text-dim); text-decoration: none; font-size: 0.8em;
}
.dict-filter:hover { border-color: var(--gold); color: var(--gold-bright); }
.dict-filter.active { border-color: var(--gold); background: var(--bg-panel-alt); color: var(--gold-bright); }
.dict-filter-count { color: var(--text-dim); font-size: 0.85em; opacity: 0.7; }
.dict-count { color: var(--text-dim); font-size: 0.85em; margin: 0 0 12px; }

/* 官方圖示原生只有 64x64，欄寬用 auto-fill 讓格子維持小尺寸，放大就會糊 */
.dict-grid {
  list-style: none; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px; padding: 0; margin: 16px 0;
}
.dict-grid-small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.dict-card a { display: block; text-decoration: none; text-align: center; }
.dict-card-img {
  width: 100%; max-width: 64px; aspect-ratio: 1 / 1; margin: 0 auto;
  object-fit: contain; border-radius: 4px;
  background: var(--bg-panel); border: 1px solid var(--border); padding: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 0.65em;
}
.dict-card a:hover .dict-card-img { border-color: var(--gold); }
.dict-card-name {
  display: block; margin-top: 5px; color: var(--gold-bright); font-size: 0.78em;
  font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dict-card-meta { display: block; color: var(--text-dim); font-size: 0.7em; }

.dict-option-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dict-option-list li {
  background: var(--bg-panel-alt); border: 1px solid var(--border); border-radius: 3px;
  padding: 5px 12px; font-size: 0.85em; color: var(--text);
}

.spell-list { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.spell-row a {
  display: flex; gap: 12px; align-items: flex-start; text-decoration: none;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 3px; padding: 10px 12px;
}
.spell-row a:hover { border-color: var(--gold); background: var(--bg-panel-alt); }
.spell-row-img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.spell-row-body { flex: 1; min-width: 0; }
.spell-row-name { display: block; color: var(--gold-bright); font-weight: bold; font-size: 0.95em; }
.spell-row-desc { display: block; color: var(--text-dim); font-size: 0.82em; margin: 2px 0 5px; }
.spell-row-meta, .spell-detail-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.spell-tag {
  display: inline-block; background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: 2px; padding: 1px 7px; font-size: 0.72em; color: var(--text-dim);
}
.spell-tag-mp { border-color: #2f4a6b; color: #7fb0dd; }
.spell-tag-hp { border-color: var(--rust); color: var(--rust-bright); }
.spell-tag-class { color: var(--gold-bright); border-color: var(--gold); }
.spell-detail-meta { margin-top: 8px; }

@media (max-width: 640px) {
  /* auto-fill 會自己依螢幕寬度排，手機不需要另外指定欄數 */
  .dict-grid, .dict-grid-small { gap: 8px; }
}

/* 首頁道具／魔法圖示是小尺寸方形 icon，用 contain 才不會被裁掉 */
.monster-card-img-contain {
  object-fit: contain; background: var(--bg-panel); padding: 6px;
  max-width: 64px; max-height: 64px; margin: 0 auto;
}

/* 道具／魔法明細頁的圖示：原生 64x64，不放大 */
.dict-detail-img {
  width: 64px; height: 64px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-panel); padding: 4px; flex-shrink: 0;
}

/* 全站搜尋：各類結果分區 */
.search-section { margin-bottom: 28px; }
.search-section-count {
  display: inline-block; background: var(--bg-panel-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 8px; font-size: 0.7em; color: var(--text-dim); vertical-align: middle;
}
.search-summary { color: var(--text-dim); font-size: 0.88em; }

/* ---- 首頁三欄展示區（左小窗／武林盟主榜／右小窗）---- */
.home-showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0;
  align-items: stretch;
}
/* 三張卡片統一採用武林盟主榜的匾額風格：漸層底 + 雙層金色邊框 */
.showcase-card {
  position: relative;
  background: linear-gradient(160deg, #221b12, var(--bg-panel));
  border: 1px solid var(--gold);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--bg-panel), inset 0 0 0 4px rgba(206, 133, 61, 0.35);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.showcase-card:hover {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 0 3px var(--bg-panel), inset 0 0 0 4px rgba(232, 177, 105, 0.65),
              0 0 18px rgba(206, 133, 61, 0.25);
}
/* 四角雲紋裝飾，強化匾額感 */
.showcase-card::before,
.showcase-card::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid rgba(206, 133, 61, 0.6);
  pointer-events: none;
}
.showcase-card::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.showcase-card::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.showcase-link {
  display: flex; flex-direction: column; flex: 1;
  text-decoration: none; color: inherit; text-align: center;
}
.showcase-img {
  display: block; width: 100%; height: 132px; object-fit: cover;
  border-radius: 3px; border: 1px solid rgba(206, 133, 61, 0.4); margin: 0 auto 10px;
}
.showcase-text {
  color: var(--text); line-height: 1.7; white-space: pre-line; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  letter-spacing: 1px;
}
.showcase-text-center { text-align: center; }
/* 三張卡片共用的匾額標題列 */
.showcase-title {
  color: var(--gold-bright); font-weight: bold; font-size: 1.02em;
  letter-spacing: 2px; text-align: center; margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(206, 133, 61, 0.45);
  text-shadow: 0 0 10px rgba(206, 133, 61, 0.35);
}
.showcase-arrow { color: var(--text-dim); font-size: 0.8em; text-align: center; margin-top: 10px; }
.showcase-card:hover .showcase-arrow { color: var(--gold-bright); }

.showcase-trophy { width: 84px; height: 84px; object-fit: contain; margin-bottom: 8px; }
.showcase-label {
  display: block; color: var(--text-dim); font-size: 0.78em; letter-spacing: 3px; margin-bottom: 2px;
}
.showcase-champion {
  display: block; color: var(--gold-bright); font-size: 1.35em; letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(206, 133, 61, 0.45);
}

@media (max-width: 640px) {
  .home-showcase { grid-template-columns: 1fr; gap: 12px; }
  .showcase-img { height: 170px; }
}
.showcase-body { display: block; white-space: pre-line; line-height: 1.7; color: var(--text); }
/* 沒有連結時底部提示列留空，但保留高度讓三張卡片底部對齊 */
.showcase-arrow:empty::before { content: '\00a0'; }

/* 後台表單：選項群組與說明文字 */
.form-fieldset {
  border: 1px solid var(--border); border-radius: 3px;
  padding: 12px 14px; margin: 14px 0; background: var(--bg-panel-alt);
}
.form-fieldset legend { color: var(--gold-bright); padding: 0 6px; font-size: 0.9em; }
.form-fieldset .checkbox-label { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.form-fieldset .checkbox-label span { line-height: 1.5; }
.form-fieldset .checkbox-label strong { color: var(--gold-bright); }
.form-hint { color: var(--text-dim); font-size: 0.82em; margin: 4px 0 12px; }

/* 整頁背景模式下，內容區塊要有底色才讀得清楚 */
.hero-banner { position: relative; z-index: 3; }
