:root {
  --bg: #12100e;
  --panel: #1d1915;
  --panel-raised: #25201b;
  --text: #e9dfc8;
  --text-soft: #a3967f;
  --line: rgba(233, 223, 200, 0.16);
  --line-strong: rgba(233, 223, 200, 0.34);
  --cinnabar: #c0463a;
  --cinnabar-deep: #8e2a22;
  --jade: #5fa68e;
  --el-金: #b8954a;
  --el-木: #5f8f58;
  --el-水: #4f7aa0;
  --el-火: #c0463a;
  --el-土: #9b7a50;
  --el-無: #7a7266;
  --font: "Noto Serif", "LXGW WenKai TC", "DFKai-SB", "BiauKai", "標楷體", "KaiTi", "Noto Serif TC", serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.92 0 0 0 0 0.87 0 0 0 0 0.78 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% -10%, rgba(70, 82, 96, 0.35), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0, 0, 0, 0.6), transparent 60%);
  background-attachment: fixed;
}

button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.scenery { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.moon { position: absolute; top: 12px; left: 2%; width: 96px; height: 96px; opacity: 0.4; }
.mountains { position: absolute; left: 0; bottom: 0; width: 100%; height: 34vh; }
.bamboo { position: absolute; right: -10px; top: -20px; width: 110px; height: 300px; }

html, body { height: 100%; overflow: hidden; }

main {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px 0;
  height: 100vh;
  height: 100dvh;
}
main:not([hidden]) { display: flex; flex-direction: column; }
main > header, main > .status, main > .tabs { flex: none; }

#tab-forge:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#tab-forge > * { flex: none; }
#tab-forge > .inventory {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: flex-start;
  padding: 12px 2px 24px;
  margin: 0 -2px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 5px, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 5px, #000 calc(100% - 24px), transparent 100%);
}
.pane:not([hidden]) { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 24px; }

.muted { color: var(--text-soft); }
.small { font-size: 13px; }
.center { text-align: center; }
.error { color: #e07a6c; min-height: 1.6em; margin: 10px 0 0; }

/* 印章 */
.seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--cinnabar);
  color: #f6ecd6;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 2px rgba(246, 236, 214, 0.3), inset 0 0 6px rgba(0, 0, 0, 0.3);
  transform: rotate(-2deg);
}
.seal-small { font-size: 12px; padding: 1px 5px; }
.name-seal { font-size: 15px; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;; cursor: pointer; }

/* 按鈕 */
.seal-btn {
  position: relative;
  border: none;
  background: linear-gradient(180deg, #c8493c, var(--cinnabar-deep));
  color: #f6ecd6;
  font-weight: 700;
  border-radius: 6px;
  padding: 10px 22px;
  letter-spacing: 0.25em;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(246, 236, 214, 0.22), 0 2px 10px rgba(192, 70, 58, 0.25);
  transition: transform 0.1s, filter 0.2s;
}
.seal-btn:hover:not(:disabled) { filter: brightness(1.1); }
.seal-btn:active:not(:disabled) { transform: translateY(1px); }
.seal-btn:disabled { background: #2c2620; color: #7d7262; cursor: default; box-shadow: inset 0 0 0 1px var(--line); }
.seal-btn.wide { display: block; width: 100%; padding: 13px; font-size: 19px; letter-spacing: 0.5em; }
#act.seal-btn.wide { padding: 10px; font-size: 17px; }

.ink-btn {
  border: 1.5px solid var(--line-strong);
  background: transparent;
  border-radius: 6px;
  padding: 9px 18px;
  cursor: pointer;
  letter-spacing: 0.15em;
}
.ink-btn:hover:not(:disabled) { border-color: var(--text); }
.ink-btn:disabled { opacity: 0.45; cursor: default; }
.ink-btn.danger { color: #e07a6c; border-color: rgba(224, 122, 108, 0.6); }

/* 卷軸 */
.scroll {
  position: relative;
  background: linear-gradient(180deg, #241f19, #1c1813);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 30px 22px 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin: 14px 0;
}
.scroll::before, .scroll::after {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(180deg, #7a5634, #3d2a19 70%, #24180d);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.scroll::before { top: -10px; }
.scroll::after { bottom: -10px; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(5, 4, 3, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
}
.overlay[hidden] { display: none; }
#login { background: transparent; }

.login-scroll { width: 100%; max-width: 380px; text-align: center; animation: unroll 0.6s ease-out; }
.login-title { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand { margin: 0; font-size: 42px; letter-spacing: 0.2em; font-weight: 700; text-shadow: 0 0 18px rgba(233, 223, 200, 0.25); }
.brand-logo { margin: 4px 0 18px; text-shadow: none; line-height: 0; }
.brand-logo img { display: block; width: 300px; max-width: 100%; height: auto; }
.lead { color: var(--text-soft); margin: 12px 0 22px; }
#login-form { display: flex; flex-direction: column; gap: 12px; }
#login-form .seal-btn { margin-top: 4px; }
.login-note { margin: 12px 0 0; }
.auth-tabs { display: flex; justify-content: center; gap: 4px; margin: 6px 0 14px; border-bottom: 1px solid var(--line); }
.auth-tab { flex: 1; background: none; border: none; color: var(--text-soft); padding: 8px 0; cursor: pointer; letter-spacing: 0.15em; font: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.auth-tab.active { color: var(--text); border-bottom-color: var(--cinnabar); font-weight: 700; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; letter-spacing: 0.3em; }
.code-row .ink-btn { flex: none; padding: 8px 12px; white-space: nowrap; }
#naming-form { display: flex; flex-direction: column; gap: 12px; }
.small-brand { font-size: 30px; margin: 0; }
.rename-form { display: flex; gap: 8px; }
.rename-form input { flex: 1; min-width: 0; }
.rename-form .seal-btn { flex: none; padding: 8px 18px; }
.account-actions { margin-top: 14px; }
.sound-btn { background: none; border: none; color: var(--text-soft); padding: 4px; cursor: pointer; display: inline-flex; align-items: center; flex: none; }
.sound-btn:hover { color: var(--text); }
.sound-btn.off { opacity: 0.5; }
.sound-row { display: flex; align-items: center; gap: 12px; margin: 0 0 8px; }
.sound-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.sound-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--cinnabar); }

input, .search {
  background: rgba(233, 223, 200, 0.05);
  border: none;
  border-bottom: 1.5px solid var(--line-strong);
  padding: 9px 6px;
  outline: none;
}
input::placeholder { color: rgba(163, 150, 127, 0.75); }
input:focus { border-bottom-color: var(--cinnabar); }

/* 頂部 */
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.logo { font-size: 26px; font-weight: 700; letter-spacing: 0.15em; text-shadow: 0 0 14px rgba(233, 223, 200, 0.2); flex: none; white-space: nowrap; }
.title-tag { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.realm-row > span { white-space: nowrap; }
@media (max-width: 360px) {
  .realm-row { font-size: 14px; }
  .realm-row #cultivation { font-size: 16px; }
}
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.badge { font-size: 12px; border: 1px solid #e07a6c; color: #e07a6c; border-radius: 4px; padding: 0 6px; }

.status { padding: 10px 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.status-row { display: flex; justify-content: space-between; }
.inv-stat { display: inline-flex; align-items: center; white-space: nowrap; }
.expand-btn {
  margin-left: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 18px;
  font-size: 14px;
  border: 1px solid var(--cinnabar);
  border-radius: 3px;
  background: transparent;
  color: var(--cinnabar);
  cursor: pointer;
}
.expand-btn:hover { background: rgba(192, 70, 58, 0.18); }
.status b { font-size: 18px; }
.ink-bar { height: 10px; margin: 6px 0 4px; background: rgba(233, 223, 200, 0.07); border-radius: 6px 3px 7px 2px; overflow: hidden; }
#stamina-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(95, 166, 142, 0.55), var(--jade) 85%, #8fd1b8);
  border-radius: 6px 10px 3px 7px;
  box-shadow: 0 0 8px rgba(95, 166, 142, 0.5);
  transition: width 0.4s;
}

/* 分頁 */
.tabs { display: flex; justify-content: space-around; gap: 4px; margin-bottom: 8px; }
.tab {
  background: none;
  border: none;
  padding: 4px 6px 8px;
  font-size: 18px;
  letter-spacing: 0.15em;
  cursor: pointer;
  color: var(--text-soft);
  position: relative;
  white-space: nowrap;
}
.tab.active { color: var(--text); font-weight: 700; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 2px;
  height: 4px;
  background: var(--cinnabar);
  border-radius: 50% 40% 60% 30%;
  transform: rotate(-1.5deg);
}

/* 悟道台 */
.forge-stage { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 2px 0 10px; }
.taiji-stage { width: 92px; height: 92px; flex: none; color: var(--text); overflow: visible; }
.taiji-stage .bagua { opacity: 0.45; transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
.taiji-stage .taiji { transform-box: fill-box; transform-origin: center; transition: filter 0.3s; }
.forge-stage.brewing .taiji { animation: spin 1.4s linear infinite; filter: drop-shadow(0 0 10px rgba(233, 223, 200, 0.55)); }
.forge-stage.brewing .bagua { animation: spin 6s linear infinite reverse; opacity: 0.85; }

.slot {
  flex: 1;
  max-width: 112px;
  aspect-ratio: 1;
  border: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M62 9 C86 14 96 38 90 60 C84 84 58 95 36 88 C14 81 5 58 10 38 C14 22 26 11 44 8' fill='none' stroke='%23e9dfc8' stroke-width='4' stroke-linecap='round' opacity='0.7'/%3E%3C/svg%3E") center / contain no-repeat;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  gap: 2px;
  text-align: center;
}
.slot-hint { color: var(--text-soft); font-size: 14px; letter-spacing: 0.2em; }
.slot-emoji { font-size: 26px; line-height: 1.1; }
.slot-name { font-size: 14px; font-weight: 700; word-break: break-all; line-height: 1.25; }
.slot.filled { background-color: rgba(233, 223, 200, 0.06); border-radius: 50%; }

.busy::after {
  content: "推演天機中…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: inherit;
  border-radius: inherit;
  letter-spacing: 0.2em;
  font-size: 17px;
}

.search-wrap { margin: 10px 0 8px; display: flex; gap: 6px; align-items: stretch; }
.search { width: 100%; flex: 1; min-width: 0; }
/* 道庫多選出售 */
.multi-sell { flex: none; padding: 0 10px; }
.multi-sell.active { border-color: #d8b56a; color: #f0d48a; background: rgba(216, 181, 106, 0.12); }
.selecting #inventory .chip.nosell { opacity: 0.32; }
#tab-forge.selecting > .inventory { padding-left: 7px; }
.selecting #inventory .chip.picked { box-shadow: none; border-color: var(--line); }
.chip.sel { border-color: #d8b56a !important; box-shadow: 0 0 0 1px #d8b56a, 0 0 10px rgba(216, 181, 106, 0.35) !important; }
.chip.sel::before { content: "✓"; position: absolute; top: -7px; left: -6px; width: 16px; height: 16px; border-radius: 50%; background: #d8b56a; color: #1b140c; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; z-index: 2; }
.sell-bar { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 8px 10px; background: rgba(18, 15, 12, 0.97); border: 1px solid rgba(216, 181, 106, 0.7); border-radius: 6px; box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.5); }
.sell-sum { display: flex; flex-direction: column; gap: 2px; min-width: auto; font-size: 13.5px; }
.sell-sum b { font-weight: 600; color: #f0d48a; white-space: nowrap; }
.sell-sum small { font-size: 12px; }
.sell-over { color: #e07a6a; }
.sell-acts { display: flex; gap: 6px; flex: none; margin-left: auto; }
.sell-sum small { white-space: nowrap; }
/* 窄螢幕：總計一列、按鈕一列 */
@media (max-width: 380px) {
  .sell-bar { flex-wrap: wrap; row-gap: 6px; }
  .sell-sum { flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
  .sell-acts { flex: 1 1 100%; justify-content: flex-end; }
}

/* 道庫：籤條 */
.inventory { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}
.chip:hover { border-color: var(--line-strong); background: var(--panel-raised); transform: translateY(-1px); }
.chip.picked { border-color: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar), 0 0 10px rgba(192, 70, 58, 0.35); }
.chip .el {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: #f6ecd6;
  background: var(--el-無);
  border-radius: 3px;
}
.chip[data-el="金"] .el { background: var(--el-金); }
.chip[data-el="木"] .el { background: var(--el-木); }
.chip[data-el="水"] .el { background: var(--el-水); }
.chip[data-el="火"] .el { background: var(--el-火); }
.chip[data-el="土"] .el { background: var(--el-土); }
.chip .em { filter: saturate(0.75); margin-right: -3px; }
.em, .slot-emoji, .big-emoji { font-family: var(--emoji); }

/* 結果與詳情 */
/* 確認視窗（取代瀏覽器的 confirm） */
#confirm { z-index: 30; }
.confirm-scroll { width: 100%; max-width: 360px; animation: unroll 0.3s ease-out; }
.confirm-text { margin: 4px 0 18px; font-size: 16px; line-height: 1.7; text-align: center; white-space: pre-line; }

.result-scroll, .detail-scroll {
  width: 100%;
  max-width: 400px;
  text-align: center;
  padding: 0;
  animation: unroll 0.45s ease-out;
}
.scroll-body { max-height: calc(100vh - 106px); overflow-y: auto; padding: 30px 16px 26px 22px; margin: 8px 6px 8px 0; }
.kind { font-size: 15px; letter-spacing: 0.3em; color: var(--text-soft); margin-bottom: 4px; padding: 0 56px; }
.kind.found { color: #e0786b; font-weight: 700; }
.big-emoji { font-size: 64px; line-height: 1.25; margin: 4px 0; filter: drop-shadow(0 0 12px rgba(233, 223, 200, 0.18)); }
.result-name { font-size: 30px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.3; }
.meta { color: var(--text-soft); font-size: 14px; }
.formula { margin-top: 8px; color: var(--text-soft); }
.desc { margin: 14px 0; font-size: 16px; text-align: left; text-indent: 2em; }
.reward { color: var(--jade); margin: 0 0 16px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.stamp {
  position: absolute;
  top: 18px;
  right: 16px;
  z-index: 1;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--cinnabar);
  border: 3px solid var(--cinnabar);
  border-radius: 8px;
  transform: rotate(-12deg);
  opacity: 0.9;
  writing-mode: vertical-rl;
  letter-spacing: 0.05em;
  animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) 0.25s both;
}
.stamp:empty { display: none; }
.stamp.fail { color: var(--text-soft); border-color: var(--text-soft); opacity: 0.75; }
.stamp.found { background: var(--cinnabar); color: #f6ecd6; }

.result-scroll.fail .big-emoji { filter: grayscale(1) brightness(0.8); }

.close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-soft);
}
/* 造物詳情 */
.detail-tags { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 2px; }
.tier-badge { font-size: 13px; padding: 1px 8px; border-radius: 3px; border: 1px solid currentColor; letter-spacing: 0.15em; white-space: nowrap; }
.tier-base { color: var(--text-soft); }
/* 品階十二階：凡、良、精、靈、寶、玄、地、天、聖、仙、神、道 */
.tier-0 { color: #a89e8c; }
.tier-1 { color: #ffffff; }
.tier-2 { color: #7cc48a; }
.tier-3 { color: #6fd0c4; }
.tier-4 { color: #79a9e6; }
.tier-5 { color: #b48ae8; }
.tier-6 { color: #d9a45a; }
.tier-7 { color: #f0cc5a; }
.tier-8 { color: #ff9a5a; }
.tier-badge.tier-5 { box-shadow: 0 0 6px rgba(180, 138, 232, 0.35); }
.tier-badge.tier-6 { box-shadow: 0 0 6px rgba(217, 164, 90, 0.4); }
.tier-badge.tier-7 { box-shadow: 0 0 10px rgba(240, 204, 90, 0.5); background: rgba(240, 204, 90, 0.08); }
.tier-badge.tier-8 { box-shadow: 0 0 10px rgba(255, 154, 90, 0.5); background: rgba(255, 154, 90, 0.08); }
.tier-9 { color: #a8f5dc; text-shadow: 0 0 8px rgba(168, 245, 220, 0.6); }
.tier-badge.tier-9 { box-shadow: 0 0 12px rgba(168, 245, 220, 0.5); background: rgba(168, 245, 220, 0.08); }
.tier-10, .tier-11 {
  color: transparent;
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: rank-sheen 3s linear infinite;
}
.tier-10 { background-image: linear-gradient(100deg, #e05a3a 15%, #ffe3a0 45%, #f0a040 60%, #e05a3a 85%); }
.tier-11 { background-image: linear-gradient(100deg, #8a7040 10%, #fff6d8 40%, #1c1610 55%, #d8b56a 70%, #8a7040 90%); }
.tier-badge.tier-10 { border-color: #f0a040; box-shadow: 0 0 12px rgba(240, 120, 60, 0.5); }
.tier-badge.tier-11 { border-color: #e2bf72; box-shadow: 0 0 14px rgba(226, 191, 114, 0.6); }
.lore {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--cinnabar);
  background: rgba(233, 223, 200, 0.04);
  text-align: left;
  font-size: 15px;
  line-height: 1.7;
  color: #d9cdb2;
}
.lore.pending { color: var(--text-soft); border-left-color: var(--line-strong); font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(233, 223, 200, 0.03); white-space: nowrap; }
.stat-label { font-size: 12px; color: var(--text-soft); letter-spacing: 0.1em; }
.stat-value { font-size: 15px; font-weight: 700; }
.products li.product { cursor: pointer; }
.products li.product:hover .product-result { color: #f3d27a; }
.product-result { white-space: nowrap; }
.sell-note { margin: 0 0 8px; text-align: center; }
@media (max-width: 380px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; text-align: left; margin: 0 0 16px; }
.facts dt { color: var(--text-soft); }
.facts dd { margin: 0; }
h4 { text-align: left; margin: 0 0 6px; letter-spacing: 0.2em; }
.recipes { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; max-height: 180px; overflow-y: auto; }
.recipes li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 10px; }

/* 天道榜 */
.world { margin-bottom: 4px; }
/* Two boards side by side only when each column has room; phones get one column. */
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 10px 0 12px; }
.bang {
  min-width: 0;
  background: rgba(29, 25, 21, 0.85);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
}
.bang h3 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.15em; }
/* One shared grid per board so columns line up: rank | name (takes the rest) | realm | value (as wide as the longest). */
.bang ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1.4em minmax(3em, 1fr) auto auto; column-gap: 6px; }
.bang li {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
  white-space: nowrap;
}
.bang li.empty { display: block; grid-column: 1 / -1; }
.bang-unit { font-size: 12px; color: var(--text-soft); margin-left: 2px; }
.bang li:last-child { border-bottom: none; }
.bang li.empty { color: var(--text-soft); }
.bang-no { text-align: right; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.bang li.top1 .bang-no { color: #e8c160; font-weight: 700; }
.bang li.top2 .bang-no { color: #cfd8e0; font-weight: 700; }
.bang li.top3 .bang-no { color: #cd8a5a; font-weight: 700; }
.bang-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bang-realm { font-size: 12px; color: var(--text-soft); }
.bang-value { text-align: right; font-variant-numeric: tabular-nums; }
.recent { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.recent li { border: 1px solid var(--line); border-radius: 3px; padding: 2px 10px; font-size: 14px; background: var(--panel); }

/* 通知：畫面正中央的小卷軸（與其他視窗同風格），點一下可提早關閉 */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: max-content;
  max-width: min(340px, calc(100% - 56px));
  padding: 18px 22px;
  background: linear-gradient(180deg, #241f19, #1c1813);
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(216, 181, 106, 0.12);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: pre-line;
  cursor: pointer;
  animation: toast-in 0.22s ease-out;
}
.toast::before, .toast::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(180deg, #7a5634, #3d2a19 70%, #24180d);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.toast::before { top: -7px; }
.toast::after { bottom: -7px; }
.toast.leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -50%) scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation: none; } }

/* 稱號與境界 */
.title-tag { font-size: 13px; color: #d8b56a; letter-spacing: 0.1em; white-space: nowrap; }
.realm-row {
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.realm-name { color: #d8b56a; letter-spacing: 0.1em; }
.ink-bar.thin { height: 5px; margin: 3px 0 8px; }
#cultivation-bar {
  height: 100%;
  background: linear-gradient(90deg, rgba(216, 181, 106, 0.45), #d8b56a);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(216, 181, 106, 0.5);
  transition: width 0.4s;
}
.realm-list { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; }
.realm-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 8px; }
.realm-list li.passed { opacity: 0.55; }
.realm-list li.current { border-color: #d8b56a; box-shadow: 0 0 10px rgba(216, 181, 106, 0.25); }
.realm-head { display: flex; justify-content: space-between; align-items: baseline; }
.realm-title { font-size: 19px; font-weight: 700; letter-spacing: 0.2em; }
.realm-perks { color: #d8b56a; font-size: 14px; margin-top: 2px; }
.extra { color: #d8b56a; white-space: pre-line; margin: -6px 0 16px; }

/* 入門 */
.tutorial {
  border: 1px dashed rgba(192, 70, 58, 0.7);
  background: rgba(192, 70, 58, 0.08);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  margin: 4px 0 6px;
}

/* 典籍 */
.books { display: flex; flex-direction: column; gap: 12px; }
.book { border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; background: rgba(29, 25, 21, 0.85); }
.book-head { display: flex; align-items: center; gap: 10px; }
.book-name { font-size: 19px; font-weight: 700; letter-spacing: 0.15em; }
.book-progress { color: var(--text-soft); flex: 1; }
.book-desc { margin: 4px 0 10px; }
.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.book-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  color: var(--text-soft);
  min-width: 0;
}
.book-cell .em { font-size: 18px; line-height: 1.2; }
.book-cell.done { border-style: solid; border-color: rgba(216, 181, 106, 0.55); color: var(--text); background: rgba(216, 181, 106, 0.06); }
.book-label { font-size: 13px; font-weight: 700; }
.book-item { font-size: 11px; color: var(--text-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 市集 */
.subtabs { display: flex; gap: 8px; margin: 2px 0 10px; }
.subtab {
  flex: 1;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-soft);
  letter-spacing: 0.2em;
}
.subtab.active { border-color: var(--cinnabar); color: var(--text); }
.lock-note { border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; color: var(--text-soft); font-size: 14px; }
.trade-form { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.trade-form select, .trade-form input:first-child { flex: 1; min-width: 0; }
.trade-form input[type="number"] { width: 90px; }
.trade-form .seal-btn { padding: 8px 14px; letter-spacing: 0.15em; }
select {
  background: rgba(233, 223, 200, 0.05);
  color: var(--text);
  border: none;
  border-bottom: 1.5px solid var(--line-strong);
  padding: 9px 4px;
  outline: none;
  font: inherit;
}
select option { background: #1d1915; color: var(--text); }
.trade-list { list-style: none; padding: 0; margin: 10px 0 0; }
.trade-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line); }
.trade-list li.empty { justify-content: center; border: none; }
.trade-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-name { font-weight: 700; }
.trade-side { display: flex; align-items: center; gap: 10px; flex: none; }
.price { color: #d8b56a; white-space: nowrap; }
.small-btn { padding: 5px 12px; font-size: 14px; letter-spacing: 0.1em; }

/* 渡劫 */
#cultivation-bar.peak { background: linear-gradient(90deg, #d8b56a, #fff0c4); animation: peak-glow 1.6s ease-in-out infinite alternate; }
.break-btn { display: block; width: 100%; margin: 2px 0 10px; padding: 8px; letter-spacing: 0.3em; animation: break-pulse 1.8s ease-in-out infinite; }
.trib-scroll { overflow: visible; }
.trib-scroll .stamp { right: auto; left: 16px; transform: rotate(12deg); }
.trib-rate { font-size: 20px; margin: 6px 0 2px; }
.trib-rate b { color: #d8b56a; font-size: 26px; }
.trib-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 16px; }
.trib-outcome { white-space: pre-line; font-size: 17px; margin: 18px 0; }
.trib-outcome.ok { color: #d8b56a; }
.trib-outcome.bad { color: #e0786b; }
.trib-scroll.thunder { animation: thunder-shake 0.25s linear 5; }
.overlay:has(.trib-scroll.thunder) { animation: thunder-flash 1.6s ease-out; }
.trib-bolt {
  position: fixed;
  top: 0;
  left: 50%;
  width: 90px;
  height: 60vh;
  transform: translateX(-50%);
  fill: #fff6d8;
  filter: drop-shadow(0 0 14px #fff0c4) drop-shadow(0 0 30px rgba(160, 180, 255, 0.8));
  pointer-events: none;
  z-index: 15;
  animation: bolt 1.6s ease-out both;
}

@keyframes peak-glow { from { box-shadow: 0 0 4px rgba(255, 240, 196, 0.4); } to { box-shadow: 0 0 14px rgba(255, 240, 196, 0.9); } }
@keyframes break-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(192, 70, 58, 0); } 50% { box-shadow: 0 0 18px rgba(255, 120, 90, 0.7); } }
@keyframes thunder-shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3px, 1px); } 75% { transform: translate(3px, -1px); } }
@keyframes thunder-flash {
  0% { background: rgba(5, 4, 3, 0.7); }
  8% { background: rgba(230, 236, 255, 0.55); }
  14% { background: rgba(5, 4, 3, 0.8); }
  30% { background: rgba(230, 236, 255, 0.35); }
  40% { background: rgba(5, 4, 3, 0.75); }
  100% { background: rgba(5, 4, 3, 0.7); }
}
@keyframes bolt {
  0% { opacity: 0; clip-path: inset(0 0 100% 0); }
  10% { opacity: 1; clip-path: inset(0 0 0 0); }
  25% { opacity: 0.2; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

/* 戰力 */
.power { color: #e0786b; letter-spacing: 0.05em; }
.power-rules { text-align: left; line-height: 1.7; }

/* 論道 */
#tab-chat:not([hidden]) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* 論道分頁：論道／系統 */
.chat-list li.chat-system.chat-news { border-color: rgba(93, 202, 165, 0.5); background: linear-gradient(90deg, rgba(93, 202, 165, 0.03), rgba(93, 202, 165, 0.12), rgba(93, 202, 165, 0.03)); }
.chat-list li.chat-news .chat-system-head { color: #9fe1cb; }
.chat-system-text .nw { white-space: nowrap; }
.chat-tabs { flex: none; }
.chat-tabs .subtab { position: relative; }
.chat-tabs .dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e0503c; box-shadow: 0 0 6px rgba(224, 80, 60, 0.7); }
.chat-list[hidden], .chat-form[hidden], .chat-note[hidden] { display: none !important; }
.chat-note { margin: 2px 0 8px; flex: none; }
.chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 4px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-list li { max-width: 88%; align-self: flex-start; }
.chat-list li.mine { align-self: flex-end; }
.chat-list li.empty { align-self: center; max-width: none; margin-top: 30px; }
.chat-head { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 3px; flex-wrap: nowrap; white-space: nowrap; min-width: 0; }
.chat-list li.mine .chat-head { justify-content: flex-end; }
.chat-realm { font-size: 11px; padding: 0 4px; }
.chat-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-head > :not(.chat-name) { flex: none; }
.chat-time { color: var(--text-soft); font-size: 12px; }

/* 論道名次 */
.chat-rank {
  font-size: 12px;
  line-height: 1.5;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  color: var(--text-soft);
  white-space: nowrap;
  letter-spacing: 0.05em;
}
.chat-rank.r1,
.chat-rank.r2,
.chat-rank.r3 {
  font-weight: 700;
  color: transparent;
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: rank-sheen 3s linear infinite;
}
/* 發光：陰影固定畫在偽元素上，只改透明度（交給顯示卡合成，不必每格重畫） */
.chat-rank.r1,
.chat-rank.r2,
.chat-rank.r3,
.chat-rank.r4 { position: relative; }
.chat-rank.r1::after,
.chat-rank.r2::after,
.chat-rank.r3::after,
.chat-rank.r4::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 10px var(--glow);
  pointer-events: none;
  opacity: 0.2;
  will-change: opacity;
  animation: rank-glow 2.4s ease-in-out infinite alternate;
}
.chat-rank.r4::after { animation-duration: 2.8s; }
.chat-rank.r1 {
  background-image: linear-gradient(100deg, #b8862e 20%, #fff1c2 45%, #e8c160 55%, #b8862e 80%);
  border-color: #e0b85a;
  --glow: rgba(240, 196, 90, 0.75);
  padding: 0 8px;
}
.chat-rank.r1::before { content: "✦ "; color: #f3d27a; -webkit-text-fill-color: #f3d27a; }
.chat-rank.r2 {
  background-image: linear-gradient(100deg, #8f9aa6 20%, #ffffff 45%, #cfd8e0 55%, #8f9aa6 80%);
  border-color: #c9d2da;
  --glow: rgba(214, 226, 238, 0.6);
}
.chat-rank.r3 {
  background-image: linear-gradient(100deg, #9a5a32 20%, #f2c6a0 45%, #cd8a5a 55%, #9a5a32 80%);
  border-color: #c98457;
  --glow: rgba(214, 140, 90, 0.55);
}
.chat-rank.r4 {
  color: #d9b8f0;
  border-color: rgba(176, 128, 220, 0.75);
  background: rgba(120, 70, 170, 0.18);
  --glow: rgba(176, 128, 220, 0.55);
}
.chat-rank.r7 {
  color: #9fd8c4;
  border-color: rgba(95, 166, 142, 0.7);
  background: rgba(95, 166, 142, 0.12);
  box-shadow: 0 0 6px rgba(95, 166, 142, 0.35);
}
/* 漸層寬度是框的 2 倍，每輪剛好移動一整個週期，循環時不會跳回 */
@keyframes rank-sheen { from { background-position: 0 0; } to { background-position: -200% 0; } }
@keyframes rank-glow { from { opacity: 0.2; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .chat-rank, .chat-rank::after, .vip-badge.v10, .vip-name-chijin { animation: none !important; }
  .chat-rank::after { opacity: 0.6; }
}
.chat-text {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 2px 10px 10px 10px;
  padding: 7px 12px;
  word-break: break-word;
  white-space: pre-wrap;
}
.chat-list li.mine .chat-text { background: rgba(192, 70, 58, 0.16); border-color: rgba(192, 70, 58, 0.45); border-radius: 10px 2px 10px 10px; }
.chat-form { flex: none; display: flex; gap: 8px; padding: 10px 0 16px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; }
.chat-form .seal-btn { padding: 8px 16px; letter-spacing: 0.15em; }
.chat-form.locked { opacity: 0.6; }

@media (max-width: 420px) {
  .tab { font-size: 16px; letter-spacing: 0.08em; padding: 4px 2px 8px; }
}

@keyframes unroll {
  from { clip-path: inset(48% 0 48% 0); opacity: 0.3; }
  to { clip-path: inset(-20px -20px -20px -20px); opacity: 1; }
}
@keyframes stamp {
  from { transform: rotate(-12deg) scale(2.4); opacity: 0; }
  to { transform: rotate(-12deg) scale(1); opacity: 0.9; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  .slot { max-width: 96px; padding: 12px; }
  .taiji-stage { width: 84px; height: 84px; }
  .forge-stage { margin: 0 0 8px; }
}

@media (max-width: 380px) {
  .taiji-stage { width: 80px; height: 80px; }
  .brand { font-size: 36px; }
}

@media (max-width: 700px) {
  .moon { display: none; }
}

@media (max-height: 720px) {
  .forge-stage { margin: 0 0 8px; }
  .slot { max-width: 96px; padding: 12px; }
  .taiji-stage { width: 80px; height: 80px; }
  .status { padding: 6px 0 8px; margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 捲動條：細、淡、離邊框一小段，配合水墨卷軸 */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: rgba(233, 223, 200, 0.22);
  border: 4px solid transparent;
  border-radius: 12px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(233, 223, 200, 0.4); }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(233, 223, 200, 0.28) transparent; }
}

/* ── 仙緣閣：VIP、行囊、商城、儲值、稱號 ── */
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.vip-badge {
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.05em;
  padding: 4px 7px;
  border-radius: 3px;
  border: 1px solid #6d655a;
  color: #a39a8a;
  background: rgba(233, 223, 200, 0.04);
  cursor: pointer;
  white-space: nowrap;
}
.vip-badge.v1 { border-color: #4fa89a; color: #7fd1c2; background: rgba(79, 168, 154, 0.1); }
.vip-badge.v4 { border-color: #9a6fc9; color: #cfb0f0; background: rgba(154, 111, 201, 0.12); }
.vip-badge.v7 { border-color: #d8b56a; color: #f0d48a; background: rgba(216, 181, 106, 0.14); box-shadow: 0 0 8px rgba(216, 181, 106, 0.3); }
.vip-badge.v10 {
  border-color: #e8a04a;
  color: transparent;
  background-image: linear-gradient(100deg, #c0463a 15%, #ffe3a0 45%, #e8a04a 60%, #c0463a 85%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: rank-sheen 3s linear infinite;
  box-shadow: 0 0 10px rgba(232, 160, 74, 0.45);
}
.vip-badge.big { font-size: 20px; padding: 8px 12px; cursor: default; }
.vip-badge.mini { font-size: 10px; padding: 1px 4px; cursor: default; }
.regen-side { display: inline-flex; align-items: center; gap: 8px; }
.vessel-btn {
  font: inherit;
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid rgba(79, 168, 154, 0.7);
  border-radius: 3px;
  background: transparent;
  color: #7fd1c2;
  cursor: pointer;
  white-space: nowrap;
}
.vessel-btn:disabled { opacity: 0.45; cursor: default; }
.vip-scroll { width: 100%; max-width: 460px; }
.jade-line { text-align: right; font-size: 14px; margin: -4px 0 10px; color: var(--text-soft); }
.jade-line b { color: #7fd1c2; font-size: 16px; }
.vip-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.vip-progress { flex: 1; min-width: 0; }
.vip-progress .ink-bar { margin: 6px 0 4px; }
#vip-bar { height: 100%; width: 0; background: linear-gradient(90deg, #4fa89a, #d8b56a); border-radius: inherit; }
.vip-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.vip-browse { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 6px; }
.vip-view-title { flex: 1; text-align: center; font-weight: 700; letter-spacing: 0.05em; }
.vip-perks { list-style: none; padding: 0; margin: 0 0 8px; }
.vip-perks li { padding: 5px 0 5px 20px; position: relative; color: var(--text-soft); }
.vip-perks li::before { content: "◇"; position: absolute; left: 2px; color: var(--text-soft); }
.vip-perks li.got { color: var(--text); }
.vip-perks li.got::before { content: "◆"; color: #d8b56a; }
.vip-gift { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 10px; font-size: 14px; }
.vip-gift:empty { display: none; }
.vip-hide { display: block; margin: 10px 0 6px; font-size: 14px; }
.bag-main { min-width: 0; flex: 1; }
.bag-desc { white-space: normal; margin-top: 2px; }
.topup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 10px; }
.topup-card { border: 1px solid var(--line); border-radius: 4px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.topup-name { font-weight: 700; letter-spacing: 0.1em; }
.topup-jade { color: #7fd1c2; }
.topup-bonus { font-size: 12px; color: var(--text-soft); }
.topup-bonus.first { color: #f0d48a; }
.topup-card .seal-btn { margin-top: 4px; }
.title-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.title-chip {
  font: inherit;
  font-size: 14px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: #d8b56a;
  cursor: pointer;
  letter-spacing: 0.08em;
}
.title-chip:first-child { color: var(--text-soft); }
.title-chip.worn { border-color: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar); }
.trib-boost { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.boost-count { min-width: 1.5em; text-align: center; font-weight: 700; }
.vip-name-qing { color: #7fd1c2; }
.vip-name-zi { color: #cfb0f0; }
.vip-name-jin { color: #f0d48a; text-shadow: 0 0 6px rgba(240, 212, 138, 0.35); }
.vip-name-chijin {
  color: transparent;
  background-image: linear-gradient(100deg, #e07a6c 15%, #ffe3a0 45%, #e8a04a 60%, #e07a6c 85%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: rank-sheen 3s linear infinite;
}
.chat-list li.vip-bubble .chat-text { border: 1px solid rgba(216, 181, 106, 0.45); box-shadow: 0 0 8px rgba(216, 181, 106, 0.15); }
/* 窄螢幕：標題列放得下道號與 VIP 徽章；稱號改在論道與帳號視窗顯示 */
#player-name { flex: 0 1 auto; min-width: 3em; }
@media (max-width: 420px) {
  .logo { font-size: 22px; letter-spacing: 0.08em; }
  .brand { gap: 6px; }
  #player-title { display: none; }
}
.vip-scroll .scroll-body { text-align: left; }
.vip-scroll .result-name { text-align: center; }
.vip-row > span { min-width: 0; }
.vip-row button, .vip-gift button, .vip-browse button, .trade-side button { flex: none; white-space: nowrap; }
.vessel-note { display: block; margin-top: 2px; }
.bag-list li { flex-wrap: wrap; row-gap: 6px; }
.bag-list .bag-main { flex: 1 1 100%; }
.bag-list .trade-side { margin-left: auto; }
.vip-view-title { white-space: pre-line; line-height: 1.5; font-size: 14px; }
.vip-view-title::first-line { font-size: 18px; }
.topup-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 108px), 1fr)); }
/* 論道標頭太擠時，先縮稱號、最後才縮道號 */
.chat-head .chat-name { flex: 0 1 auto; min-width: 4em; }
.chat-head .title-tag { flex: 0 1000 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-text .chat-time { float: right; margin: 6px 0 0 10px; font-size: 11px; color: var(--text-soft); white-space: nowrap; line-height: 1.4; }
.chat-text::after { content: ""; display: block; clear: both; }
.chat-head { gap: 4px; }
.chat-list li { max-width: 94%; }
.book-bar { margin: 6px 0 8px; }
.book-bar > div { height: 100%; background: linear-gradient(90deg, #8e6f3a, #d8b56a); border-radius: inherit; }
.book-toggle { margin-bottom: 8px; }
.book-grid[hidden] { display: none; }

/* ── 禮包 ── */
.vip-tabs .subtab { letter-spacing: 0.05em; padding: 6px 2px; font-size: 14px; }
.vip-badge.has-dot { position: relative; }
.vip-badge.has-dot::after, .mail-btn.has-dot::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e0453a;
  box-shadow: 0 0 6px rgba(224, 69, 58, 0.8);
}
.code-form { display: flex; gap: 8px; margin-bottom: 12px; }
.code-form input { flex: 1; min-width: 0; text-transform: uppercase; }
/* ── 禮包卡片：上方插圖橫幅（動態背景），下方內容 ── */
.pack-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.pack-card {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pc1) 70%, transparent);
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pc0) 60%, #1c1813), #17130f);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.pack-banner {
  position: relative;
  height: 104px;
  overflow: hidden;
  background:
    radial-gradient(90% 130% at 85% 40%, color-mix(in srgb, var(--pc1) 85%, transparent) 0%, transparent 70%),
    linear-gradient(120deg, var(--pc0) 0%, color-mix(in srgb, var(--pc1) 45%, var(--pc0)) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--pc1) 60%, transparent);
}
.pk-mist {
  position: absolute;
  inset: -30% -40%;
  background:
    radial-gradient(28% 38% at 30% 62%, var(--pcg), transparent 70%),
    radial-gradient(22% 30% at 68% 30%, rgba(255, 255, 255, 0.1), transparent 70%);
  animation: pk-drift 9s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes pk-drift { from { transform: translateX(-7%) scale(1); } to { transform: translateX(7%) scale(1.06); } }
.pk-art-wrap { position: absolute; right: 4px; bottom: 0; width: 128px; height: 98px; animation: pk-float 4.2s ease-in-out infinite alternate; will-change: transform; }
.pk-art { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px var(--pcg)); }
@keyframes pk-float { from { transform: translateY(3px); } to { transform: translateY(-4px); } }
.pk-flame { transform-origin: 50% 100%; animation: pk-flicker 1.2s ease-in-out infinite alternate; }
@keyframes pk-flicker { from { transform: scaleY(0.92); opacity: 0.7; } to { transform: scaleY(1.05); opacity: 0.95; } }
.pk-tag {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: 11px;
  letter-spacing: 0.15em;
  padding: 1px 7px;
  border-radius: 2px;
  color: #fff6e6;
  background: color-mix(in srgb, var(--pc1) 75%, #000);
  border: 1px solid color-mix(in srgb, var(--pc2) 50%, transparent);
}
.pack-card.kind-buy .pk-tag, .pack-card.kind-fund .pk-tag { background: #b23a2e; border-color: #f0a49a; }
.pk-title {
  position: absolute;
  left: 12px;
  top: 34px;
  right: 120px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.25;
  color: #fff7e2;
  text-shadow: 0 0 12px var(--pcg), 0 2px 3px rgba(0, 0, 0, 0.7);
}
.pk-sub { position: absolute; left: 12px; bottom: 10px; font-size: 13px; color: var(--pc2); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.pk-shine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -45%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  transform: skewX(-20deg);
  opacity: 0;
}
.pack-card.buy .pk-shine, .pack-card.claim .pk-shine { opacity: 1; animation: pk-shine 5s ease-in-out infinite; }
@keyframes pk-shine { 0%, 55% { transform: translateX(0) skewX(-20deg); } 100% { transform: translateX(400%) skewX(-20deg); } }
.pk-sparks { position: absolute; inset: 0; pointer-events: none; }
.pk-spark {
  position: absolute;
  bottom: -6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--pc2);
  box-shadow: 0 0 6px var(--pcg);
  opacity: 0;
  animation: pk-rise 4.2s linear infinite;
}
.pk-sparks.petal .pk-spark { width: 6px; height: 4px; border-radius: 60% 40%; background: #f7c6d0; }
.pk-sparks.ember .pk-spark { background: #ffb040; box-shadow: 0 0 6px rgba(255, 120, 60, 0.8); }
.pk-sparks.star .pk-spark { width: 3px; height: 3px; background: #ffffff; }
.pk-sparks.mist .pk-spark { width: 10px; height: 10px; background: rgba(220, 255, 240, 0.25); box-shadow: none; }
.pk-sparks.firefly .pk-spark { background: #ffe08a; }
@keyframes pk-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translate(10px, -110px); opacity: 0; }
}
/* 畫面外的卡片暫停動畫；已領／已購的卡片不播放 */
.pack-card:not(.live) .pack-banner *, .pack-card:not(.live) .pack-banner { animation-play-state: paused !important; }
.pack-card.done .pack-banner { filter: grayscale(0.75) brightness(0.7); }
.pack-card.done .pack-banner * { animation: none !important; }
.pack-card.done { opacity: 0.75; }
.pack-card.claim { border-color: #e8c66a; box-shadow: 0 0 0 1px rgba(232, 198, 106, 0.5), 0 0 16px rgba(232, 198, 106, 0.35); }
.pack-body { padding: 10px 12px 12px; }
.pack-desc { font-size: 13px; line-height: 1.6; color: var(--text-soft); }
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; align-items: center; }
.pk-chip {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  color: var(--pc2);
  background: color-mix(in srgb, var(--pc1) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc1) 55%, transparent);
}
.pk-chip-label { font-size: 12px; color: var(--text-soft); }
.pack-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .pack-banner *, .pack-banner { animation: none !important; }
}
.pack-actions button { white-space: nowrap; }
.fund-list { margin: 6px 0; }
.fund-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.fund-row button { flex: none; }

/* ── 信箱 ── */
.mail-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid #6d655a;
  border-radius: 3px;
  background: rgba(233, 223, 200, 0.04);
  color: #c9bea9;
  cursor: pointer;
  flex: none;
}
.mail-btn:hover { border-color: var(--text); color: var(--text); }
.mail-tools { justify-content: flex-end; margin-bottom: 8px; }
.mail-list { list-style: none; padding: 0; margin: 0 0 10px; }
.mail-item { padding: 10px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.mail-item:hover { background: rgba(233, 223, 200, 0.04); }
.mail-item.unread .mail-name { font-weight: 700; color: var(--text); }
.mail-item.unread .mail-name::before { content: "● "; color: #e0453a; font-size: 10px; vertical-align: middle; }
.mail-item.empty { cursor: default; text-align: center; }
.mail-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail-name { color: var(--text-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-tag { flex: none; font-size: 12px; border: 1px solid rgba(216, 181, 106, 0.7); color: #f0d48a; border-radius: 3px; padding: 0 5px; }
.mail-tag.done { border-color: var(--line); color: var(--text-soft); }
.mail-title { margin: 12px 0 4px; font-size: 18px; letter-spacing: 0.08em; }
.mail-body { white-space: pre-wrap; line-height: 1.8; margin: 12px 0; }
.mail-rewards { color: #7fd1c2; margin-bottom: 12px; }

/* ── 完善：分頁紅點、說明鈕、典籍階段 ── */
.tab.has-dot, .subtab.has-dot { position: relative; }
.tab.has-dot::before, .subtab.has-dot::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e0453a;
  box-shadow: 0 0 5px rgba(224, 69, 58, 0.8);
}
.info-btn {
  background: none;
  border: 0;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  padding: 0 4px;
  margin-left: 4px;
  cursor: pointer;
  vertical-align: baseline;
}
.info-btn:hover, .info-btn:focus-visible { color: var(--text); }
.bag-tools { justify-content: flex-end; margin-bottom: 4px; }
.vip-perks li.perk-head { padding-left: 0; color: var(--text); font-weight: 700; font-size: 14px; }
.vip-perks li.perk-head::before { content: none; }
.book-stages { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
#trib-vip { margin-bottom: 8px; }
#confirm-cancel[hidden] { display: none; }
.sound-check.vip-hide { display: flex; align-items: flex-start; gap: 6px; white-space: normal; line-height: 1.5; }
.sound-check.vip-hide input { flex: none; margin-top: 4px; }
#confirm .row button { white-space: nowrap; }
/* 目前值與「／上限」同大小，不另外放大 */
.status #cultivation, .status #inv-count, .status #stamina, .status #cult-today { font-size: inherit; font-weight: inherit; }

/* ── 入門與新手功課 ── */
.tutorial.fresh { animation: banner-in 0.5s ease-out; }
@keyframes banner-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tutorial-step { color: #f0a49a; font-weight: 700; white-space: nowrap; }
.tutorial-reward { color: #d8b56a; font-size: 13px; margin-top: 2px; }
.tutorial.quest { display: flex; align-items: center; gap: 10px; border-color: rgba(216, 181, 106, 0.55); background: rgba(216, 181, 106, 0.06); }
.quest-main { flex: 1; min-width: 0; }
.quest-head { color: var(--text); font-weight: 700; }
.quest-desc { color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.tutorial.quest .small-btn { flex: none; }
/* 下一步要點的地方：朱砂虛線光圈，緩慢呼吸 */
.guide { outline: 2px dashed rgba(224, 96, 80, 0.95); outline-offset: 3px; animation: guide-breathe 1.4s ease-in-out infinite alternate; }
@keyframes guide-breathe { from { outline-color: rgba(224, 96, 80, 0.35); } to { outline-color: rgba(240, 120, 100, 1); } }
.stamina-tip { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: #f0a49a; margin-top: 4px; white-space: nowrap; }
.stamina-tip .small-btn { padding: 3px 10px; }
@media (prefers-reduced-motion: reduce) {
  .guide, .tutorial.fresh { animation: none; }
}
.result-guide { margin: 4px 0 10px; }

/* ── 物品欄（行囊、商城）：格子排列，點選才顯示說明 ── */
.item-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 10px; }
.item-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(233, 223, 200, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.item-cell:hover { border-color: var(--line-strong); background: rgba(233, 223, 200, 0.08); }
.item-cell.picked { border-color: #d8b56a; box-shadow: 0 0 0 1px #d8b56a, 0 0 8px rgba(216, 181, 106, 0.35); }
.item-cell.empty { cursor: default; background: rgba(0, 0, 0, 0.18); border-style: dashed; opacity: 0.55; }
.item-cell.off { opacity: 0.5; }
.item-emoji { font-family: var(--emoji); font-size: 24px; line-height: 1; }
.item-name { font-size: 11px; color: var(--text-soft); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-corner { position: absolute; right: 3px; top: 1px; font-size: 11px; color: #f0d48a; font-weight: 700; }
.item-name.price { color: #7fd1c2; }
.item-detail { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; min-height: 52px; background: rgba(0, 0, 0, 0.15); margin-bottom: 8px; }
.item-detail-head { display: flex; align-items: center; gap: 8px; }
.item-detail-emoji { font-family: var(--emoji); font-size: 22px; }
.item-detail-title { font-weight: 700; flex: 1; min-width: 0; }
.item-detail-sub { color: #d8b56a; font-size: 13px; white-space: nowrap; }
.item-detail-desc { margin: 6px 0 8px; font-size: 14px; line-height: 1.6; color: var(--text-soft); }
.item-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-hint { margin: 6px 0; text-align: center; }

/* ══ 仙緣閣：整體美化 ══ */
#vip .vip-scroll {
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(216, 181, 106, 0.14), transparent 60%),
    radial-gradient(80% 40% at 50% 100%, rgba(192, 70, 58, 0.1), transparent 70%),
    linear-gradient(180deg, #271f17, #16110d);
  border-left-color: rgba(216, 181, 106, 0.35);
  border-right-color: rgba(216, 181, 106, 0.35);
}
#vip .scroll-body > .result-name {
  font-size: 30px;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: transparent;
  background: linear-gradient(180deg, #fff6d8 10%, #e2bf72 55%, #9c7330 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(216, 181, 106, 0.35));
  margin-bottom: 2px;
}
#vip .scroll-body > .result-name::after {
  content: "";
  display: block;
  width: 170px;
  height: 12px;
  margin: 4px auto 6px;
  background:
    radial-gradient(circle at 50% 50%, #e2bf72 0 3px, transparent 3.5px),
    radial-gradient(circle at 30% 50%, rgba(226, 191, 114, 0.8) 0 1.6px, transparent 2px),
    radial-gradient(circle at 70% 50%, rgba(226, 191, 114, 0.8) 0 1.6px, transparent 2px),
    linear-gradient(90deg, transparent, rgba(226, 191, 114, 0.75) 25%, rgba(226, 191, 114, 0.75) 75%, transparent) center / 100% 1px no-repeat;
}
/* 分頁：嵌在一條暗色底槽中的牌匾，選中為朱砂底金字 */
#vip .vip-tabs {
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(216, 181, 106, 0.22);
  border-radius: 6px;
}
#vip .vip-tabs .subtab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
#vip .vip-tabs .subtab.active {
  color: #fff3cf;
  background: linear-gradient(180deg, #ab3b2d, #6c1e15);
  border-color: rgba(232, 168, 100, 0.8);
  box-shadow: 0 0 10px rgba(192, 70, 58, 0.45), inset 0 1px 0 rgba(255, 220, 180, 0.3);
}
/* 仙玉餘額：玉珮小標 */
#vip .jade-line { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 0 0 12px; }
#vip .jade-line b {
  padding: 2px 12px 2px 28px;
  border-radius: 14px;
  font-size: 16px;
  color: #a9f0e0;
  border: 1px solid rgba(127, 209, 194, 0.5);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23d8fff4'/%3E%3Cstop offset='1' stop-color='%232f8a72'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='10' cy='10' r='8' fill='url(%23g)' stroke='%23e8fff8' stroke-width='1'/%3E%3Ccircle cx='10' cy='10' r='2.6' fill='%23103028'/%3E%3C/svg%3E") 8px center / 15px no-repeat,
    linear-gradient(180deg, rgba(127, 209, 194, 0.18), rgba(127, 209, 194, 0.06));
  box-shadow: 0 0 10px rgba(127, 209, 194, 0.18);
}
/* 特權頁 */
#vip .vip-head {
  padding: 12px;
  border: 1px solid rgba(216, 181, 106, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(216, 181, 106, 0.14), rgba(0, 0, 0, 0.25));
  box-shadow: inset 0 1px 0 rgba(255, 236, 190, 0.08);
}
#vip .vip-badge.big {
  width: 74px;
  height: 74px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border-width: 2px;
  font-size: 18px;
  padding: 0;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35), 0 0 16px rgba(216, 181, 106, 0.3);
}
#vip .vip-progress .ink-bar { height: 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(216, 181, 106, 0.25); }
#vip #vip-bar { background: linear-gradient(90deg, #8a6a2a, #f0d48a 70%, #fff6d8); box-shadow: 0 0 8px rgba(240, 212, 138, 0.5); }
#vip #vip-next { white-space: pre-line; line-height: 1.6; }
#vip .vip-row {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}
#vip .vip-browse { margin: 16px 0 8px; }
#vip .vip-view-title { color: #f0d48a; text-shadow: 0 0 8px rgba(240, 212, 138, 0.3); }
#vip .vip-perks {
  padding: 8px 12px;
  border: 1px solid rgba(216, 181, 106, 0.25);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
}
#vip .vip-perks li.perk-head { display: flex; flex-direction: column; color: #f0d48a; border-bottom: 1px solid rgba(216, 181, 106, 0.2); padding-bottom: 6px; margin-bottom: 2px; }
.perk-head-sub { font-size: 12px; font-weight: 400; color: var(--text-soft); letter-spacing: 0.02em; }
#vip .vip-gift {
  border-color: rgba(232, 198, 106, 0.55);
  background: linear-gradient(90deg, rgba(232, 198, 106, 0.18), rgba(232, 198, 106, 0.04));
  border-radius: 6px;
}
.vip-hide span { display: flex; flex-direction: column; }
.vip-hide small { font-size: 12px; color: var(--text-soft); }
/* 兌換碼 */
#vip .code-form input { border: 1px solid rgba(216, 181, 106, 0.3); background: rgba(0, 0, 0, 0.3); border-radius: 4px; }
/* 儲值方案 */
#vip .topup-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
#vip .topup-card {
  position: relative;
  overflow: hidden;
  gap: 0;
  padding: 10px 8px 12px;
  border: 1px solid rgba(127, 209, 194, 0.35);
  border-radius: 8px;
  background:
    radial-gradient(90% 55% at 50% 22%, rgba(127, 209, 194, 0.2), transparent 70%),
    linear-gradient(180deg, #1a2723, #131010);
}
#vip .topup-card.plan-5, #vip .topup-card.plan-6 {
  border-color: rgba(232, 198, 106, 0.6);
  background:
    radial-gradient(90% 55% at 50% 22%, rgba(232, 198, 106, 0.22), transparent 70%),
    linear-gradient(180deg, #2a2112, #131010);
}
.topup-art { height: 58px; display: flex; justify-content: center; }
.topup-art svg { height: 100%; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
#vip .topup-name { font-size: 15px; color: var(--text); margin-top: 2px; }
#vip .topup-jade { font-size: 22px; font-weight: 700; color: #a9f0e0; text-shadow: 0 0 10px rgba(127, 209, 194, 0.45); line-height: 1.2; margin-top: 2px; }
.topup-unit { font-size: 12px; color: var(--text-soft); }
#vip .topup-bonus { margin: 4px 0 8px; font-size: 12px; }
#vip .topup-bonus.first { color: #f0d48a; }
.topup-ribbon {
  position: absolute;
  top: 10px;
  right: -26px;
  width: 96px;
  text-align: center;
  transform: rotate(38deg);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #fff3cf;
  background: linear-gradient(180deg, #c64a3a, #8a2418);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  padding: 2px 0;
}
/* 物品欄 */
#vip .item-cell {
  border-color: rgba(216, 181, 106, 0.28);
  background: radial-gradient(circle at 50% 35%, rgba(216, 181, 106, 0.12), rgba(0, 0, 0, 0.3));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
#vip .item-cell.empty { background: rgba(0, 0, 0, 0.22); border-color: rgba(216, 181, 106, 0.12); }
#vip .item-cell.picked { border-color: #e8c66a; box-shadow: 0 0 0 1px #e8c66a, 0 0 10px rgba(232, 198, 106, 0.45); }
#vip .item-detail { border-color: rgba(216, 181, 106, 0.3); background: linear-gradient(180deg, rgba(216, 181, 106, 0.08), rgba(0, 0, 0, 0.25)); border-radius: 6px; }
/* 禮包標題永不換行（名稱較長時壓在插圖上，有陰影可讀） */
.pk-title { right: 12px; white-space: nowrap; z-index: 2; letter-spacing: 0.08em; }
.pk-sub, .pk-tag { z-index: 2; }
#vip .vip-head { flex-wrap: wrap; }
#vip #vip-next { flex-basis: 100%; text-align: center; padding-top: 8px; border-top: 1px dashed rgba(216, 181, 106, 0.2); }
/* 段落最後一行不留孤字；短標題平均分行 */
p, li, .desc, .muted, .pack-desc, .quest-desc, .item-detail-desc { text-wrap-style: pretty; }
h1, h2, h3, h4, .result-name, .kind, .pk-title, .topup-name, .quest-head { text-wrap: balance; }
/* 矮螢幕：橫幅與提示較多時，悟道頁可整頁捲動，道庫至少留兩排 */
#tab-forge:not([hidden]) { overflow-y: auto; }
#tab-forge > .inventory { min-height: 112px; }
@media (max-height: 720px) {
  .tutorial { font-size: 13px; padding: 6px 10px; line-height: 1.5; }
  .tutorial-reward, .quest-desc { font-size: 12px; }
  .stamina-tip { margin-top: 2px; }
}
/* 境界說明：名稱、修為範圍一行；數值兩欄小格 */
.realm-head { align-items: center; gap: 8px; }
.realm-title { white-space: nowrap; }
.realm-range { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.realm-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin: 6px 0 2px; }
.realm-stat { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; border-bottom: 1px dotted var(--line); padding: 1px 0; }
.realm-k { color: var(--text-soft); white-space: nowrap; }
.realm-v { white-space: nowrap; }
.realm-perks::before { content: "◆ "; font-size: 10px; vertical-align: 1px; }
/* 按鈕、標記不在字中間斷行：一列放不下就整顆換到下一列 */
.row { flex-wrap: wrap; }
button, .badge, .seal, .tag, .pk-chip, .vip-badge, .tier-badge { white-space: nowrap; }
.realm-perk-desc { display: block; font-size: 12px; color: var(--text-soft); padding-left: 14px; }
.realm-stat.wide { grid-column: 1 / -1; }

/* 道庫格子：名稱帶品階色（凡品灰、良品白、精品綠…），寶品以上加一道底線光 */
.chip.t0 .nm, .chip.t1 .nm, .chip.t2 .nm, .chip.t3 .nm, .chip.t4 .nm, .chip.t5 .nm, .chip.t6 .nm, .chip.t7 .nm, .chip.t8 .nm, .chip.t9 .nm { color: inherit; }
.chip.t0 { color: #a89e8c; }
.chip.t1 { color: #ffffff; }
.chip.t2 { color: #7cc48a; }
.chip.t3 { color: #6fd0c4; }
.chip.t4 { color: #79a9e6; }
.chip.t5 { color: #b48ae8; }
.chip.t6 { color: #d9a45a; }
.chip.t7 { color: #f0cc5a; }
.chip.t8 { color: #ff9a5a; }
.chip.t9 { color: #a8f5dc; }
.chip.t10 { color: #ffb070; }
.chip.t11 { color: #f0d48a; }
.chip.t4, .chip.t5, .chip.t6, .chip.t7, .chip.t8, .chip.t9, .chip.t10, .chip.t11 { box-shadow: inset 0 -2px 0 currentColor; }
.chip.t7, .chip.t8, .chip.t9, .chip.t10, .chip.t11 { box-shadow: inset 0 -2px 0 currentColor, 0 0 8px color-mix(in srgb, currentColor 35%, transparent); }
.chip.picked { box-shadow: 0 0 0 1px var(--cinnabar), 0 0 10px rgba(192, 70, 58, 0.35); }
.tier-text { font-weight: 700; }
/* 論道：天道公告 */
.chat-list li.chat-system { max-width: 100%; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; margin: 4px auto; border: 1px solid rgba(240, 204, 90, 0.45); border-radius: 4px; background: linear-gradient(90deg, rgba(240, 204, 90, 0.04), rgba(240, 204, 90, 0.14), rgba(240, 204, 90, 0.04)); }
.chat-system-text { color: #f0d48a; text-align: center; text-shadow: 0 0 8px rgba(240, 204, 90, 0.4); }
.chat-system .chat-time { position: static; }
/* 商城染色（論道道號） */
.dye-xia { color: #ff9a8a; text-shadow: 0 0 8px rgba(255, 140, 120, 0.45); }
.dye-yue { color: #eef4ff; text-shadow: 0 0 8px rgba(220, 235, 255, 0.6); }
.dye-bi { color: #7ec8ff; text-shadow: 0 0 8px rgba(120, 190, 255, 0.5); }
.dye-swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); }
.swatch-xia { background: radial-gradient(circle at 35% 35%, #ffd0c6, #ff7a68 60%, #a83a2a); }
.swatch-yue { background: radial-gradient(circle at 35% 35%, #ffffff, #dfe8f6 60%, #8a98b0); }
.swatch-bi { background: radial-gradient(circle at 35% 35%, #d6f0ff, #6ab8f0 60%, #24608e); }
/* 雲紋氣泡 */
.chat-list li.cloud-bubble .chat-text {
  border: 1px solid rgba(190, 220, 255, 0.55);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12px 100%, rgba(190, 220, 255, 0.16) 0 10px, transparent 11px),
    radial-gradient(circle at calc(100% - 14px) 0, rgba(190, 220, 255, 0.14) 0 12px, transparent 13px),
    var(--panel-raised);
  box-shadow: 0 0 10px rgba(170, 210, 255, 0.18);
}
/* 商城格子：圖示、名稱、價格三行 */
.item-cell.shop-cell { aspect-ratio: auto; min-height: 70px; gap: 1px; }
.item-cell.shop-cell .item-emoji { font-size: 20px; }
.item-cell.shop-cell .dye-swatch { width: 20px; height: 20px; }
/* ── 固定版面：不可反白、不可縮放 ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* iPhone 在可捲動的區塊裡會重設 touch-action，所以每個元素都設：只擋雙擊放大，不影響捲動 */
*, *::before, *::after { touch-action: manipulation; }
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
/* 只有輸入框可以選取文字；字級 16px 以上，iPhone 點進輸入框時不會自動放大 */
input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
  font-size: max(16px, 1em);
}
.chat-system-head { color: #f0d48a; font-weight: 700; letter-spacing: 0.3em; padding-left: 0.3em; font-size: 15px; }
.chat-system-text { font-size: 14px; text-wrap: balance; }
.chat-system .tier-badge { font-size: 12px; padding: 0 6px; letter-spacing: 0.1em; }
#rank-tiers .tier-badge { font-size: 12px; padding: 0 6px; letter-spacing: 0.1em; }
#shop-grid { grid-template-columns: repeat(4, 1fr); }
.shop-cell .item-name { letter-spacing: 0; }
.item-detail-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 道庫在可捲動的區塊裡，外側光圈會被裁切：格子的光圈畫在內側 */
.chip.guide { outline-offset: -4px; outline-width: 2px; }
.guide { outline-offset: -4px; }
.seal-btn.guide { animation-name: guide-breathe-light; }
@keyframes guide-breathe-light { from { outline-color: rgba(255, 236, 200, 0.35); } to { outline-color: rgba(255, 244, 220, 1); } }
/* VIP 特權列表：朱印＋說明，數字金色強調 */
#vip .vip-perks li.perk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(216, 181, 106, 0.14);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}
#vip .vip-perks li.perk:last-child { border-bottom: 0; }
#vip .vip-perks li.perk::before { content: none; }
.perk-seal {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #a89e8c;
  border: 1px solid rgba(168, 158, 140, 0.45);
  background: rgba(0, 0, 0, 0.25);
}
.perk-text { flex: 1; min-width: 0; }
.perk-num { color: #cdb98a; font-weight: 700; margin: 0 1px; }
.perk-state { flex: none; font-size: 12px; color: #d8b56a; border: 1px solid rgba(216, 181, 106, 0.5); border-radius: 3px; padding: 0 6px; }
#vip .vip-perks li.perk.got { color: var(--text); }
li.perk.got .perk-seal {
  color: #fff3cf;
  background: linear-gradient(180deg, #b0402f, #6e1f16);
  border-color: #e0a060;
  box-shadow: 0 0 8px rgba(192, 70, 58, 0.35);
}
li.perk.got .perk-num { color: #f0d48a; }

/* ── 外觀視窗 ── */
.look-preview { border: 1px solid rgba(216, 181, 106, 0.3); border-radius: 6px; padding: 8px 10px 4px; margin: 4px 0 12px; background: linear-gradient(180deg, rgba(216, 181, 106, 0.08), rgba(0, 0, 0, 0.25)); }
.look-label { font-size: 12px; color: var(--text-soft); margin-bottom: 4px; letter-spacing: 0.1em; }
#look-preview { max-height: none; overflow: visible; padding: 0; }
#look-preview li { max-width: 100%; }
.dye-chip { display: inline-flex; align-items: center; gap: 6px; }
.dye-chip .dye-swatch { width: 14px; height: 14px; }
.title-chip.locked { opacity: 0.6; }
.look-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0, 0, 0, 0.2); }
#look h4 { margin: 14px 0 6px; color: #f0d48a; letter-spacing: 0.15em; }

/* ── 造物詳情：配方分頁籤 ── */
.recipe-tabs { margin: 4px 0 6px; }
.recipe-tabs .subtab { letter-spacing: 0.15em; white-space: nowrap; }
.tab-count { margin-left: 6px; font-size: 13px; color: var(--text-soft); letter-spacing: 0; }
.recipe-tabs .subtab.active .tab-count { color: #f0d48a; }
#detail .recipes { max-height: none; overflow: visible; margin-bottom: 10px; }
#detail .recipes li { align-items: center; }
.recipe-mats { min-width: 0; overflow-wrap: anywhere; }
.recipe-side { display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap; }
.found-seal { margin-right: 6px; vertical-align: 1px; }
.tiny-btn { padding: 2px 10px; font-size: 13px; letter-spacing: 0.1em; }
.more-btn { margin: 0 0 16px; font-size: 14px; }

/* 天道榜：數字前標名稱；境界榜以境界為主角 */
.bang-label { font-size: 12px; color: var(--text-soft); margin-right: 6px; letter-spacing: 0.1em; }
.bang-realm.realm-main { font-size: 15px; color: #f0d48a; letter-spacing: 0.08em; }


/* ── 創世錄 ── */
.books-tabs { margin: 2px 0 10px; }
.creations-summary { text-align: center; margin: 2px 0 10px; letter-spacing: 0.1em; }
.creations-summary .creations-num { font-size: 20px; color: #f0d48a; margin: 0 2px; font-variant-numeric: tabular-nums; }
.creations-summary p { margin: 4px 0 0; letter-spacing: 0; text-wrap: pretty; }
.creations-list { list-style: none; margin: 0 0 12px; padding: 0; }
.creation { padding: 9px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.creation:hover .creation-name { color: #f3d27a; }
.creation-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.creation-em { flex: none; }
.creation-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.creation-head .tier-badge { flex: none; margin-left: auto; }
.creation-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 12px; color: var(--text-soft); }
.creation-meta span { white-space: nowrap; }
.creation-gone { color: #c98a6a; }
.empty-note { text-align: center; padding: 18px 0; }
/* 道庫：自己創世的造物 */
.chip .mine-mark { position: absolute; top: -6px; right: -5px; font-size: 9px; line-height: 1; padding: 2px 3px; border-radius: 3px; background: var(--cinnabar); color: #f6ecd6; letter-spacing: 0; pointer-events: none; }

/* ── 帳號視窗 ── */
.account-scroll .scroll-body { padding-top: 6px; }
.acc-card { display: flex; align-items: center; gap: 14px; padding: 12px 12px; margin: 4px 0 12px; border: 1px solid rgba(216, 181, 106, 0.28); border-radius: 8px; background: linear-gradient(135deg, rgba(216, 181, 106, 0.1), rgba(0, 0, 0, 0.25) 60%); }
.acc-seal { flex: none; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; color: #f6ecd6; background: radial-gradient(circle at 35% 30%, #c9503f, #8e2a20); border: 2px solid #e8b9a3; border-radius: 10px; box-shadow: inset 0 0 0 3px #8e2a20, inset 0 0 0 4px rgba(246, 236, 214, 0.45), 0 2px 10px rgba(0, 0, 0, 0.45); font-family: var(--font-title, inherit); }
.acc-id { min-width: 0; flex: 1; text-align: left; }
.acc-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acc-name { font-size: 24px; font-weight: 700; letter-spacing: 0.08em; color: #f3e6c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-name-row .title-tag { flex: none; }
.acc-badges { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
.acc-email { font-size: 13px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-since { font-size: 12px; color: var(--text-soft); margin-top: 2px; white-space: nowrap; }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 14px; }
.acc-stat { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0, 0, 0, 0.22); min-width: 0; }
.acc-stat-k { font-size: 12px; color: var(--text-soft); letter-spacing: 0.15em; }
.acc-stat-v { font-size: 19px; color: #f0d48a; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-stat-s { font-size: 11px; color: var(--text-soft); white-space: nowrap; }
.acc-group { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.acc-group-title { font-size: 12px; letter-spacing: 0.3em; color: #c9a55e; padding: 7px 12px 5px; border-bottom: 1px solid var(--line); background: rgba(216, 181, 106, 0.06); text-align: left; }
.acc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; background: none; border: none; border-bottom: 1px dashed var(--line); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.acc-group > .acc-row:last-child, .acc-group > .acc-panel:last-child { border-bottom: none; }
button.acc-row:hover { background: rgba(216, 181, 106, 0.07); }
.acc-ico { flex: none; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; color: #f0d48a; border: 1px solid rgba(216, 181, 106, 0.45); border-radius: 50%; background: rgba(0, 0, 0, 0.3); }
.acc-label { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 16px; letter-spacing: 0.1em; }
.acc-label small { font-size: 12px; color: var(--text-soft); letter-spacing: 0; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-arrow { flex: none; font-size: 20px; color: var(--text-soft); transition: transform 0.2s; }
.acc-row.open .acc-fold { transform: rotate(90deg); }
.acc-panel { padding: 10px 12px 6px; border-bottom: 1px dashed var(--line); background: rgba(0, 0, 0, 0.2); }
.acc-panel .muted { margin: 6px 0 0; }
.acc-panel .error { margin: 4px 0 0; }
.pw-form { display: flex; flex-direction: column; gap: 8px; }
.acc-sound { cursor: default; border-bottom: none; }
.acc-sound input[type="range"] { flex: 1; min-width: 0; accent-color: var(--cinnabar); }
.acc-logout { margin: 4px 0 6px; }
.acc-panel .error:empty { display: none; }
.acc-panel p { text-align: left; }
.acc-logout { display: block; width: 100%; }
.acc-since { display: flex; flex-wrap: wrap; gap: 0 10px; white-space: normal; }
.acc-since span { white-space: nowrap; }
@media (max-width: 400px) {
  .acc-card { gap: 10px; padding: 10px; }
  .acc-seal { width: 48px; height: 48px; font-size: 25px; }
  .acc-name { font-size: 21px; }
}
/* 道號完整顯示：放不下時稱號換到下一行 */
.acc-name-row { flex-wrap: wrap; row-gap: 2px; }
.acc-name { overflow: visible; text-overflow: clip; }
@media (max-width: 400px) {
  .acc-name { font-size: 19px; letter-spacing: 0.04em; }
}

/* 滑桿、勾選框不套用一般輸入框的底線與內距（否則滑桿拉到底仍留一截，看起來拉不滿） */
input[type="range"] { padding: 0; margin: 0; border: none; background: none; height: 24px; accent-color: var(--cinnabar); cursor: pointer; }
input[type="range"]:focus { border: none; }
input[type="checkbox"] { padding: 0; margin: 0; border: none; background: none; accent-color: var(--cinnabar); width: 18px; height: 18px; cursor: pointer; }

/* ── 好友分享（悟道台） ── */
.shared-strip { flex: none; margin: 6px 0 2px; padding: 6px 8px 8px; border: 1px solid rgba(216, 181, 106, 0.35); border-radius: 6px; background: linear-gradient(180deg, rgba(216, 181, 106, 0.08), rgba(0, 0, 0, 0.2)); }
.shared-title { font-size: 13px; color: #f0d48a; letter-spacing: 0.15em; margin-bottom: 6px; }
.shared-title small { margin-left: 8px; font-size: 11px; color: var(--text-soft); letter-spacing: 0; }
.shared-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.shared-chip { border-style: dashed; border-color: rgba(240, 212, 138, 0.6); }
.chip .share-by { font-size: 11px; color: var(--text-soft); white-space: nowrap; }

/* ── 道友視窗 ── */
.fr-card { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0, 0, 0, 0.18); text-align: left; }
.fr-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.fr-card-title { font-size: 15px; letter-spacing: 0.2em; color: #f0d48a; white-space: nowrap; }
.fr-card-note { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.fr-shares { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.chip.share-mini { padding: 4px 10px 4px 8px; }
.fr-list { list-style: none; margin: 0; padding: 0; }
.fr-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fr-row:last-child { border-bottom: none; }
.fr-info { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fr-name-row { display: flex; align-items: center; gap: 6px; }
.fr-name { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-online { flex: none; font-size: 11px; color: #8fc9a4; border: 1px solid rgba(143, 201, 164, 0.5); border-radius: 3px; padding: 0 4px; }
.fr-meta { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.fr-wait { font-size: 11px; color: #c9a55e; text-wrap: pretty; }
.fr-btns { flex: none; display: flex; gap: 6px; margin-left: auto; }
.fr-friend .fr-shares { flex-basis: 100%; margin: 2px 0 0; }
.fr-empty { margin: 4px 0; }
.fr-rules { font-size: 12px; color: var(--text-soft); text-align: left; margin: 4px 2px 8px; }
.fr-rules p { margin: 0 0 4px; text-wrap: pretty; }
.share-picker { margin-top: 8px; }
.share-to { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; }
.share-to-label { flex: none; padding-top: 5px; font-size: 14px; color: var(--text-soft); letter-spacing: 0.15em; }
.share-to-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.share-to-btn { background: none; border: 1px solid var(--line); border-radius: 4px; padding: 4px 12px; color: var(--text-soft); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.share-to-btn.active { border-color: var(--cinnabar); color: var(--text); }
.share-pick-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.share-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed var(--line); }
.share-pick-info { display: flex; align-items: center; gap: 6px; min-width: 0; }
.share-pick-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 通知 ── */
.notice-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.notice { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.notice.unread { background: rgba(216, 181, 106, 0.07); }
.notice.clickable { cursor: pointer; }
.notice-body { flex: 1; min-width: 0; }
.notice-text { font-size: 15px; text-wrap: pretty; }
.notice-time { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.notice .fr-btns { margin-top: 6px; }

/* ── 推薦道友 ── */
.ref-card { margin: 4px 0 12px; padding: 14px 12px; border: 1px solid rgba(216, 181, 106, 0.4); border-radius: 8px; background: linear-gradient(135deg, rgba(216, 181, 106, 0.12), rgba(0, 0, 0, 0.25) 70%); text-align: center; }
.ref-label { font-size: 13px; color: var(--text-soft); letter-spacing: 0.2em; }
.ref-code { font-size: 34px; letter-spacing: 0.25em; color: #f0d48a; font-variant-numeric: tabular-nums; margin: 4px 0 10px; text-shadow: 0 0 14px rgba(240, 212, 138, 0.25); user-select: text; -webkit-user-select: text; }
.ref-card p { margin: 8px 0 0; }
.ref-rewards { list-style: none; margin: 0; padding: 0; }
.ref-rewards li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ref-rewards li:last-child { border-bottom: none; }
.ref-k { flex: none; width: 6.5em; color: #c9a55e; font-size: 13px; white-space: nowrap; }
.ref-v { flex: 1; min-width: 0; font-size: 14px; text-wrap: pretty; }
.ref-marks { flex: none; display: flex; gap: 4px; }
.ref-mark { font-size: 11px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 3px; color: var(--text-soft); white-space: nowrap; }
.ref-mark.done { color: #f0d48a; border-color: rgba(240, 212, 138, 0.6); background: rgba(240, 212, 138, 0.1); }
.ref-by { text-align: center; margin: 0 0 6px; }
.ref-rule { text-align: center; margin: 4px 0 8px; text-wrap: pretty; }
.login-note { text-wrap: balance; }
.ref-v .nw { white-space: nowrap; }
.ref-rule { text-wrap: balance; }
.ref-mark.void { color: #c98a6a; border-color: rgba(201, 138, 106, 0.5); }

/* 規則清單：左欄項目、右欄說明 */
.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.rule-list li:last-child { border-bottom: none; }
.rule-k { flex: none; width: 4.5em; color: #c9a55e; font-size: 13px; letter-spacing: 0.05em; white-space: nowrap; padding-top: 1px; }
.rule-v { flex: 1; min-width: 0; font-size: 14px; color: var(--text); line-height: 1.6; }
.rule-v > div { text-wrap: pretty; }

/* 信匣分頁 */
.inbox-tabs { margin: 2px 0 10px; }
.inbox-tabs .subtab { letter-spacing: 0.3em; }
.rule-v .nw, .fr-wait .nw, .share-to-note .nw { white-space: nowrap; }
.share-to-note { display: flex; flex-direction: column; gap: 2px; padding-top: 5px; }
.ref-mark.skip { opacity: 0.45; text-decoration: line-through; }

/* ══ 道號顏色（越後面越絢麗）══ */
/* 清雅：帶微光的單色 */
.dye-lan { color: #62e6bb; text-shadow: 0 0 8px rgba(98, 230, 187, 0.6); }
.dye-yan { color: #cc9dff; text-shadow: 0 0 9px rgba(190, 140, 255, 0.65); }
.dye-hu { color: #ffbf5e; text-shadow: 0 0 9px rgba(255, 180, 80, 0.6); }
/* 華彩以上：漸層字 */
.dye-wanxia, .dye-bihai, .dye-cuizhu, .dye-liuxia, .dye-xinghe, .dye-bingpo, .dye-caihong, .dye-zidian, .dye-xuanhuo {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
.dye-wanxia { background-image: linear-gradient(90deg, #ffc76b, #ff8a6b 50%, #ff6fae); filter: drop-shadow(0 0 4px rgba(255, 140, 140, 0.5)); }
.dye-bihai { background-image: linear-gradient(90deg, #84f2ff, #5aa8ff 50%, #4d6bff); filter: drop-shadow(0 0 4px rgba(100, 170, 255, 0.55)); }
.dye-cuizhu { background-image: linear-gradient(90deg, #dcff8f, #7be89c 50%, #2fc28f); filter: drop-shadow(0 0 4px rgba(120, 230, 150, 0.5)); }
/* 流光：漸層在字間流動 */
.dye-liuxia { background-image: linear-gradient(90deg, #ffd66b, #ff8f5c, #ff5fae, #ffd66b); background-size: 120px 100%; animation: dyeFlow 4s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 150, 120, 0.6)); }
.dye-xinghe { background-image: linear-gradient(90deg, #93dcff, #7d6dff, #e3abff, #93dcff); background-size: 120px 100%; animation: dyeFlow 5s linear infinite; filter: drop-shadow(0 0 6px rgba(140, 140, 255, 0.65)); }
.dye-bingpo { background-image: linear-gradient(100deg, #a9e6ff 0, #a9e6ff 35%, #ffffff 50%, #a9e6ff 65%, #a9e6ff 100%); background-size: 120px 100%; animation: dyeFlow 2.6s linear infinite; filter: drop-shadow(0 0 6px rgba(180, 230, 255, 0.8)); }
/* 仙韻 */
.dye-caihong { background-image: linear-gradient(90deg, #ff6b6b, #ffb86b, #ffe96b, #6bff9e, #6bd7ff, #9d6bff, #ff6bd9, #ff6b6b); background-size: 160px 100%; animation: dyeFlow 3s linear infinite; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5)); }
.dye-zidian { background-image: linear-gradient(90deg, #b58cff, #ffffff, #7fd8ff, #b58cff); background-size: 100px 100%; animation: dyeFlow 1.8s linear infinite, dyeFlicker 3.4s linear infinite; filter: drop-shadow(0 0 7px rgba(170, 140, 255, 0.9)); }
/* 神妙：玄火騰燒 */
.dye-xuanhuo {
  background-image: linear-gradient(0deg, #ff2a00, #ff8a00 25%, #fff3b8 45%, #ff9a00 65%, #ff2a00 85%, #ff2a00);
  background-size: 100% 28px;
  animation: dyeFire 1.1s linear infinite;
  filter: drop-shadow(0 0 5px rgba(255, 120, 0, 0.95)) drop-shadow(0 0 14px rgba(255, 60, 0, 0.55));
}
@keyframes dyeFlow { from { background-position: 0 0; } to { background-position: 120px 0; } }
.dye-caihong { animation-name: dyeFlowWide; }
@keyframes dyeFlowWide { from { background-position: 0 0; } to { background-position: 160px 0; } }
.dye-zidian { animation-name: dyeFlowNarrow, dyeFlicker; }
@keyframes dyeFlowNarrow { from { background-position: 0 0; } to { background-position: 100px 0; } }
@keyframes dyeFlicker { 0%, 44%, 50%, 88%, 100% { opacity: 1; } 46% { opacity: 0.55; } 48% { opacity: 0.9; } 90% { opacity: 0.7; } }
@keyframes dyeFire { from { background-position: 0 0; } to { background-position: 0 -28px; } }

/* 色票（商城、外觀用） */
.swatch-lan { background: radial-gradient(circle at 35% 35%, #d6fff0, #62e6bb 60%, #1d8a66); box-shadow: 0 0 6px rgba(98, 230, 187, 0.6); }
.swatch-yan { background: radial-gradient(circle at 35% 35%, #f1e2ff, #cc9dff 60%, #6a3fb0); box-shadow: 0 0 6px rgba(190, 140, 255, 0.6); }
.swatch-hu { background: radial-gradient(circle at 35% 35%, #fff0cf, #ffbf5e 60%, #a8661c); box-shadow: 0 0 6px rgba(255, 180, 80, 0.6); }
.swatch-wanxia { background: linear-gradient(135deg, #ffc76b, #ff8a6b, #ff6fae); }
.swatch-bihai { background: linear-gradient(135deg, #84f2ff, #5aa8ff, #4d6bff); }
.swatch-cuizhu { background: linear-gradient(135deg, #dcff8f, #7be89c, #2fc28f); }
.swatch-liuxia, .swatch-xinghe, .swatch-bingpo, .swatch-caihong, .swatch-zidian { background-size: 40px 100%; background-repeat: repeat-x; animation: swatchFlow 3s linear infinite; }
.swatch-liuxia { background-image: linear-gradient(90deg, #ffd66b, #ff8f5c, #ff5fae, #ffd66b); box-shadow: 0 0 7px rgba(255, 150, 120, 0.7); }
.swatch-xinghe { background-image: linear-gradient(90deg, #93dcff, #7d6dff, #e3abff, #93dcff); box-shadow: 0 0 7px rgba(140, 140, 255, 0.7); }
.swatch-bingpo { background-image: linear-gradient(90deg, #a9e6ff, #ffffff, #a9e6ff); box-shadow: 0 0 8px rgba(180, 230, 255, 0.85); }
.swatch-caihong { background-image: linear-gradient(90deg, #ff6b6b, #ffe96b, #6bff9e, #6bd7ff, #ff6bd9, #ff6b6b); box-shadow: 0 0 8px rgba(255, 255, 255, 0.55); }
.swatch-zidian { background-image: linear-gradient(90deg, #b58cff, #ffffff, #7fd8ff, #b58cff); box-shadow: 0 0 9px rgba(170, 140, 255, 0.9); }
.swatch-xuanhuo { background-image: linear-gradient(0deg, #ff2a00, #ff8a00, #fff3b8, #ff8a00, #ff2a00); background-size: 100% 24px; background-repeat: repeat-y; animation: swatchFire 1.1s linear infinite; box-shadow: 0 0 8px rgba(255, 120, 0, 0.95), 0 0 16px rgba(255, 60, 0, 0.5); }
@keyframes swatchFlow { from { background-position: 0 0; } to { background-position: 40px 0; } }
@keyframes swatchFire { from { background-position: 0 0; } to { background-position: 0 -24px; } }

/* ══ 論道氣泡（越後面越絢麗）══ */
.bubble-swatch { display: inline-block; width: 26px; height: 18px; border-radius: 7px 7px 7px 2px; flex: none; }
.item-cell.shop-cell .bubble-swatch { width: 28px; height: 20px; }
/* 素雅：雲紋（沿用） */
.chat-list li.bubble-yun .chat-text, .bs-yun {
  border: 1px solid rgba(190, 220, 255, 0.55);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12px 100%, rgba(190, 220, 255, 0.16) 0 10px, transparent 11px),
    radial-gradient(circle at calc(100% - 14px) 0, rgba(190, 220, 255, 0.14) 0 12px, transparent 13px),
    var(--panel-raised);
  box-shadow: 0 0 10px rgba(170, 210, 255, 0.18);
}
/* 清雅 */
.chat-list li.bubble-zhu .chat-text, .bs-zhu {
  border: 1px solid rgba(140, 215, 140, 0.6);
  border-radius: 12px;
  background: repeating-linear-gradient(90deg, transparent 0 18px, rgba(140, 215, 140, 0.08) 18px 21px), linear-gradient(180deg, rgba(120, 200, 120, 0.1), transparent 70%), var(--panel-raised);
  box-shadow: 0 0 10px rgba(120, 200, 120, 0.18);
}
.chat-list li.bubble-mei .chat-text, .bs-mei {
  border: 1px solid rgba(235, 150, 175, 0.55);
  border-radius: 12px;
  background:
    radial-gradient(circle at calc(100% - 14px) 9px, rgba(255, 140, 175, 0.75) 0 3px, transparent 4px),
    radial-gradient(circle at calc(100% - 24px) 15px, rgba(255, 140, 175, 0.55) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 9px) 20px, rgba(255, 170, 195, 0.5) 0 2px, transparent 3px),
    linear-gradient(135deg, rgba(10, 10, 10, 0.55), rgba(40, 30, 34, 0.9));
  box-shadow: 0 0 10px rgba(235, 150, 175, 0.2);
}
/* 華彩 */
.chat-list li.bubble-shuang .chat-text, .bs-shuang {
  border: 1px solid rgba(205, 242, 255, 0.8);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(225, 247, 255, 0.2), rgba(120, 180, 220, 0.08) 60%), var(--panel-raised);
  box-shadow: inset 0 0 12px rgba(205, 242, 255, 0.2), 0 0 12px rgba(170, 220, 255, 0.35);
}
.chat-list li.bubble-jinli .chat-text, .bs-jinli {
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(60, 24, 16, 0.92), rgba(36, 24, 18, 0.95)) padding-box, linear-gradient(120deg, #ff7a45, #ffd36b, #ff4d6d) border-box;
  box-shadow: 0 0 12px rgba(255, 120, 80, 0.3);
}
/* 流光 */
.chat-list li.bubble-xinghe .chat-text, .bs-xinghe {
  border: 1px solid rgba(155, 175, 255, 0.7);
  border-radius: 12px;
  color: #eef0ff;
  background:
    radial-gradient(1.2px 1.2px at 18% 30%, #ffffff, transparent 2px),
    radial-gradient(1px 1px at 72% 62%, #cfe3ff, transparent 2px),
    radial-gradient(1.6px 1.6px at 45% 78%, #ffffff, transparent 2.5px),
    radial-gradient(1px 1px at 88% 22%, #ffffff, transparent 2px),
    radial-gradient(1.2px 1.2px at 30% 85%, #e3d6ff, transparent 2px),
    linear-gradient(135deg, #0d1640, #2b1b58 55%, #0c2a4a);
  animation: bubbleStar 3s ease-in-out infinite;
}
@keyframes bubbleStar { 0%, 100% { box-shadow: 0 0 8px rgba(130, 150, 255, 0.35); } 50% { box-shadow: 0 0 16px rgba(170, 140, 255, 0.65); } }
.chat-list li.bubble-liuguang .chat-text, .bs-liuguang {
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: linear-gradient(var(--panel-raised), var(--panel-raised)) padding-box, linear-gradient(90deg, #6bd7ff, #b58cff, #ff7ad4, #6bd7ff) border-box;
  background-size: 100% 100%, 240px 100%;
  animation: bubbleFlow 3s linear infinite;
  box-shadow: 0 0 12px rgba(180, 140, 255, 0.35);
}
/* 仙韻：鳳羽 */
.chat-list li.bubble-fengyu .chat-text, .bs-fengyu {
  border: 2px solid transparent;
  border-radius: 14px 14px 14px 4px;
  color: #fff3e0;
  background:
    radial-gradient(circle at 0 100%, rgba(255, 140, 40, 0.3), transparent 45%) padding-box,
    linear-gradient(160deg, rgba(64, 22, 10, 0.95), rgba(36, 16, 10, 0.97)) padding-box,
    linear-gradient(90deg, #ff4a1c, #ffb347, #ffe08a, #ff7a2a, #ff4a1c) border-box;
  background-size: 100% 100%, 100% 100%, 240px 100%;
  animation: bubbleFlow3 2.4s linear infinite, bubbleBlaze 2.4s ease-in-out infinite;
}
@keyframes bubbleBlaze { 0%, 100% { box-shadow: 0 0 12px rgba(255, 110, 30, 0.45), inset 0 0 10px rgba(255, 140, 60, 0.15); } 50% { box-shadow: 0 0 22px rgba(255, 140, 40, 0.7), inset 0 0 14px rgba(255, 160, 80, 0.25); } }
/* 神妙：龍紋 */
.chat-list li.bubble-longwen .chat-text, .bs-longwen {
  border: 2px solid transparent;
  border-radius: 14px;
  color: #fff6dc;
  background:
    radial-gradient(circle at 50% 100%, transparent 5px, rgba(255, 215, 120, 0.16) 6px, transparent 7.5px) padding-box,
    linear-gradient(135deg, #2c1b07, #3d2408 55%, #25160a) padding-box,
    linear-gradient(90deg, #b8862b, #fff3bf, #e3ab3e, #8a5a14, #b8862b) border-box;
  background-size: 14px 9px, 100% 100%, 240px 100%;
  animation: bubbleFlow3 2.2s linear infinite, bubbleGold 2.2s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(255, 210, 120, 0.35);
}
@keyframes bubbleGold { 0%, 100% { box-shadow: 0 0 12px rgba(240, 190, 80, 0.45); } 50% { box-shadow: 0 0 24px rgba(255, 215, 110, 0.8), 0 0 4px rgba(255, 240, 200, 0.9) inset; } }
@keyframes bubbleFlow { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 240px 0; } }
@keyframes bubbleFlow3 { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 0, 0 0, 240px 0; } }
.chat-list li[class*="bubble-"] .chat-text { position: relative; }

/* ══ 道號顏色（第二批）══ */
/* 素雅：純色加淡光 */
.dye-yanzhi { color: #ff8fb8; text-shadow: 0 0 8px rgba(255, 130, 180, 0.45); }
.dye-songlv { color: #8fdca2; text-shadow: 0 0 8px rgba(120, 210, 150, 0.45); }
.dye-ehuang { color: #ffe68a; text-shadow: 0 0 8px rgba(255, 220, 120, 0.45); }
/* 清雅：較強的光暈 */
.dye-dansha { color: #ff6a52; text-shadow: 0 0 9px rgba(255, 90, 60, 0.7); }
.dye-tianqing { color: #a4ecff; text-shadow: 0 0 9px rgba(140, 220, 255, 0.7); }
.dye-yulan { color: #fff6fb; text-shadow: 0 0 6px rgba(255, 190, 220, 0.85), 0 0 12px rgba(255, 170, 210, 0.4); }
/* 華彩以上：漸層字 */
.dye-taoyao, .dye-jinqiu, .dye-zixia, .dye-jinlin, .dye-qingming, .dye-xueyue, .dye-leiting, .dye-youming, .dye-taichu, .dye-riyue {
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
.dye-taoyao { background-image: linear-gradient(90deg, #ffb3cf, #ff8fb0 50%, #ffc79a); filter: drop-shadow(0 0 4px rgba(255, 150, 180, 0.5)); }
.dye-jinqiu { background-image: linear-gradient(90deg, #ffe07a, #ffa94d 50%, #ff6a45); filter: drop-shadow(0 0 4px rgba(255, 170, 80, 0.5)); }
.dye-zixia { background-image: linear-gradient(90deg, #e0ccff, #c78bff 50%, #ff74d2); filter: drop-shadow(0 0 4px rgba(210, 140, 255, 0.55)); }
/* 流光 */
.dye-jinlin { background-image: linear-gradient(100deg, #c8962e 0, #ffeaa6 20%, #c8962e 40%, #a87a26 60%, #ffd66b 80%, #c8962e 100%); background-size: 120px 100%; animation: dyeFlow 2.4s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 200, 90, 0.7)); }
.dye-qingming { background-image: linear-gradient(90deg, #5cf2e0, #3aa8ff, #a8fff2, #5cf2e0); background-size: 120px 100%; animation: dyeFlow 4.5s linear infinite; filter: drop-shadow(0 0 6px rgba(80, 220, 230, 0.65)); }
.dye-xueyue { background-image: linear-gradient(90deg, #ff5566, #c0182e, #ff9a9a, #ff5566); background-size: 120px 100%; animation: dyeFlow 5s linear infinite; filter: drop-shadow(0 0 6px rgba(255, 40, 60, 0.7)); }
/* 仙韻 */
.dye-leiting { background-image: linear-gradient(90deg, #e8f6ff, #7fc8ff, #ffffff, #a68cff, #e8f6ff); background-size: 100px 100%; animation: dyeFlowNarrow 1.2s linear infinite, dyeFlicker 2.2s linear infinite; filter: drop-shadow(0 0 6px rgba(150, 200, 255, 0.95)) drop-shadow(0 0 12px rgba(120, 140, 255, 0.5)); }
.dye-youming { background-image: linear-gradient(0deg, #0e7a44, #3dff9a 30%, #dcffec 48%, #3dff9a 66%, #0e7a44 90%); background-size: 100% 28px; animation: dyeFire 1.4s linear infinite; filter: drop-shadow(0 0 5px rgba(60, 255, 150, 0.9)) drop-shadow(0 0 12px rgba(0, 200, 120, 0.5)); }
/* 神妙 */
.dye-taichu { background-image: linear-gradient(90deg, #f5f0e0, #a8a8a8 18%, #ffd36b 36%, #ffffff 50%, #a8a8a8 68%, #ffd36b 84%, #f5f0e0); background-size: 160px 100%; animation: dyeFlowWide 3.2s linear infinite, dyePulse 3.2s ease-in-out infinite; filter: drop-shadow(0 0 4px rgba(255, 220, 140, 0.95)) drop-shadow(0 0 12px rgba(255, 255, 255, 0.45)); }
.dye-riyue { background-image: linear-gradient(90deg, #ffcf4a, #fff6c8 25%, #ffcf4a 40%, #cfe6ff 60%, #ffffff 75%, #cfe6ff 90%, #ffcf4a); background-size: 160px 100%; animation: dyeFlowWide 3s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 220, 120, 0.9)) drop-shadow(0 0 14px rgba(200, 225, 255, 0.6)); }
@keyframes dyePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.82; } }

/* 色票 */
.swatch-yanzhi { background: radial-gradient(circle at 35% 35%, #ffe0ec, #ff8fb8 60%, #a8405f); }
.swatch-songlv { background: radial-gradient(circle at 35% 35%, #e0ffe8, #8fdca2 60%, #2f7a48); }
.swatch-ehuang { background: radial-gradient(circle at 35% 35%, #fffbe0, #ffe68a 60%, #a8902a); }
.swatch-dansha { background: radial-gradient(circle at 35% 35%, #ffd8cf, #ff6a52 60%, #9a2414); box-shadow: 0 0 6px rgba(255, 90, 60, 0.6); }
.swatch-tianqing { background: radial-gradient(circle at 35% 35%, #ecfbff, #a4ecff 60%, #3a8aa8); box-shadow: 0 0 6px rgba(140, 220, 255, 0.6); }
.swatch-yulan { background: radial-gradient(circle at 35% 35%, #ffffff, #fbeaf3 60%, #c99aae); box-shadow: 0 0 6px rgba(255, 180, 215, 0.7); }
.swatch-taoyao { background: linear-gradient(135deg, #ffb3cf, #ff8fb0, #ffc79a); }
.swatch-jinqiu { background: linear-gradient(135deg, #ffe07a, #ffa94d, #ff6a45); }
.swatch-zixia { background: linear-gradient(135deg, #e0ccff, #c78bff, #ff74d2); }
.swatch-jinlin, .swatch-qingming, .swatch-xueyue, .swatch-leiting, .swatch-taichu, .swatch-riyue { background-size: 40px 100%; background-repeat: repeat-x; animation: swatchFlow 3s linear infinite; }
.swatch-jinlin { background-image: linear-gradient(90deg, #c8962e, #ffeaa6, #c8962e); box-shadow: 0 0 7px rgba(255, 200, 90, 0.7); animation-duration: 1.8s; }
.swatch-qingming { background-image: linear-gradient(90deg, #5cf2e0, #3aa8ff, #a8fff2, #5cf2e0); box-shadow: 0 0 7px rgba(80, 220, 230, 0.7); }
.swatch-xueyue { background-image: linear-gradient(90deg, #ff5566, #c0182e, #ff9a9a, #ff5566); box-shadow: 0 0 7px rgba(255, 40, 60, 0.7); }
.swatch-leiting { background-image: linear-gradient(90deg, #e8f6ff, #7fc8ff, #ffffff, #a68cff, #e8f6ff); box-shadow: 0 0 9px rgba(150, 200, 255, 0.95); animation-duration: 1.2s; }
.swatch-youming { background-image: linear-gradient(0deg, #0e7a44, #3dff9a, #dcffec, #3dff9a, #0e7a44); background-size: 100% 24px; background-repeat: repeat-y; animation: swatchFire 1.4s linear infinite; box-shadow: 0 0 8px rgba(60, 255, 150, 0.9), 0 0 16px rgba(0, 200, 120, 0.45); }
.swatch-taichu { background-image: linear-gradient(90deg, #f5f0e0, #a8a8a8, #ffd36b, #ffffff, #a8a8a8, #f5f0e0); box-shadow: 0 0 8px rgba(255, 220, 140, 0.95), 0 0 16px rgba(255, 255, 255, 0.4); }
.swatch-riyue { background-image: linear-gradient(90deg, #ffcf4a, #fff6c8, #cfe6ff, #ffffff, #ffcf4a); box-shadow: 0 0 8px rgba(255, 220, 120, 0.9), 0 0 16px rgba(200, 225, 255, 0.55); }

/* ══ 論道氣泡（第二批）══ */
/* 素雅 */
.chat-list li.bubble-sujian .chat-text, .bs-sujian {
  border: 1px solid rgba(230, 215, 180, 0.55);
  border-radius: 6px;
  background: repeating-linear-gradient(0deg, transparent 0 18px, rgba(230, 215, 180, 0.07) 18px 19px), linear-gradient(180deg, rgba(240, 228, 200, 0.1), rgba(240, 228, 200, 0.03)), var(--panel-raised);
  box-shadow: 0 0 8px rgba(230, 215, 180, 0.15);
}
.chat-list li.bubble-qingci .chat-text, .bs-qingci {
  border: 1px solid rgba(150, 205, 190, 0.6);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(160, 215, 200, 0.2), rgba(90, 150, 140, 0.07)), var(--panel-raised);
  box-shadow: inset 0 1px 0 rgba(220, 255, 245, 0.25), 0 0 10px rgba(140, 200, 185, 0.18);
}
/* 清雅 */
.chat-list li.bubble-lancao .chat-text, .bs-lancao {
  border: 1px solid rgba(150, 210, 170, 0.55);
  border-radius: 12px;
  background:
    linear-gradient(115deg, transparent 72%, rgba(130, 205, 150, 0.28) 72.5%, transparent 74%),
    linear-gradient(128deg, transparent 80%, rgba(130, 205, 150, 0.22) 80.5%, transparent 82%),
    linear-gradient(105deg, transparent 86%, rgba(200, 160, 230, 0.35) 86.5%, transparent 88%),
    linear-gradient(180deg, rgba(110, 180, 130, 0.08), transparent),
    var(--panel-raised);
  box-shadow: 0 0 10px rgba(130, 200, 150, 0.18);
}
.chat-list li.bubble-qiufeng .chat-text, .bs-qiufeng {
  border: 1px solid rgba(240, 140, 80, 0.6);
  border-radius: 12px;
  background:
    radial-gradient(circle at calc(100% - 12px) 10px, rgba(255, 110, 50, 0.75) 0 3.5px, transparent 4.5px),
    radial-gradient(circle at calc(100% - 26px) 18px, rgba(255, 175, 60, 0.6) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 10px calc(100% - 8px), rgba(230, 80, 40, 0.55) 0 3px, transparent 4px),
    linear-gradient(135deg, rgba(64, 30, 14, 0.75), rgba(36, 24, 18, 0.95));
  box-shadow: 0 0 10px rgba(240, 130, 60, 0.22);
}
/* 華彩 */
.chat-list li.bubble-liuli .chat-text, .bs-liuli {
  border: 1px solid rgba(175, 195, 255, 0.75);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(120, 170, 255, 0.24), rgba(190, 130, 255, 0.2) 50%, rgba(120, 220, 255, 0.18)), var(--panel-raised);
  box-shadow: inset 0 0 12px rgba(200, 210, 255, 0.2), 0 0 12px rgba(150, 160, 255, 0.32);
}
.chat-list li.bubble-shanshui .chat-text, .bs-shanshui {
  border: 1px solid rgba(205, 210, 215, 0.5);
  border-radius: 10px;
  background:
    radial-gradient(ellipse 38% 55% at 18% 125%, rgba(205, 210, 215, 0.2) 0 60%, transparent 61%),
    radial-gradient(ellipse 34% 48% at 52% 130%, rgba(205, 210, 215, 0.14) 0 60%, transparent 61%),
    radial-gradient(ellipse 30% 44% at 86% 124%, rgba(205, 210, 215, 0.18) 0 60%, transparent 61%),
    linear-gradient(180deg, rgba(205, 210, 215, 0.06), transparent 60%),
    var(--panel-raised);
  box-shadow: 0 0 10px rgba(200, 205, 210, 0.18);
}
/* 流光 */
.chat-list li.bubble-yuehua .chat-text, .bs-yuehua {
  border: 1.5px solid transparent;
  border-radius: 12px;
  color: #f2f5ff;
  background: linear-gradient(160deg, rgba(30, 36, 54, 0.96), rgba(22, 24, 34, 0.97)) padding-box, linear-gradient(90deg, #8a9bb8, #ffffff, #c9d8ff, #8a9bb8) border-box;
  background-size: 100% 100%, 240px 100%;
  animation: bubbleFlow 3.4s linear infinite;
  box-shadow: 0 0 12px rgba(200, 215, 255, 0.38);
}
.chat-list li.bubble-caiyun .chat-text, .bs-caiyun {
  border: 1.5px solid transparent;
  border-radius: 14px;
  background:
    radial-gradient(circle at 14px 100%, rgba(255, 210, 160, 0.16) 0 11px, transparent 12px) padding-box,
    linear-gradient(var(--panel-raised), var(--panel-raised)) padding-box,
    linear-gradient(90deg, #ff9a9a, #ffd36b, #9effa0, #7fd8ff, #c39bff, #ff9a9a) border-box;
  background-size: 100% 100%, 100% 100%, 240px 100%;
  animation: bubbleFlow3 4s linear infinite;
  box-shadow: 0 0 12px rgba(255, 220, 160, 0.3);
}
/* 仙韻 */
.chat-list li.bubble-leijie .chat-text, .bs-leijie {
  border: 2px solid transparent;
  border-radius: 12px;
  color: #f2ecff;
  background: linear-gradient(160deg, rgba(32, 20, 64, 0.96), rgba(16, 12, 34, 0.97)) padding-box, linear-gradient(90deg, #6a4cff, #e6dcff, #8fd0ff, #ffffff, #6a4cff) border-box;
  background-size: 100% 100%, 240px 100%;
  animation: bubbleFlow 1.6s linear infinite, bubbleThunder 3s linear infinite;
}
@keyframes bubbleThunder {
  0%, 58%, 66%, 100% { box-shadow: 0 0 12px rgba(140, 110, 255, 0.45); }
  60% { box-shadow: 0 0 26px rgba(210, 200, 255, 0.95), inset 0 0 14px rgba(200, 190, 255, 0.4); }
  63% { box-shadow: 0 0 16px rgba(170, 150, 255, 0.6); }
  64% { box-shadow: 0 0 24px rgba(220, 210, 255, 0.9); }
}
.chat-list li.bubble-binghuang .chat-text, .bs-binghuang {
  border: 2px solid transparent;
  border-radius: 14px 14px 14px 4px;
  color: #eefaff;
  background:
    radial-gradient(circle at 0 100%, rgba(140, 220, 255, 0.3), transparent 45%) padding-box,
    linear-gradient(160deg, rgba(12, 36, 58, 0.95), rgba(10, 20, 34, 0.97)) padding-box,
    linear-gradient(90deg, #4fc3ff, #e6fbff, #9fe6ff, #ffffff, #4fc3ff) border-box;
  background-size: 100% 100%, 100% 100%, 240px 100%;
  animation: bubbleFlow3 2.4s linear infinite, bubbleFrost 2.4s ease-in-out infinite;
}
@keyframes bubbleFrost { 0%, 100% { box-shadow: 0 0 12px rgba(120, 210, 255, 0.45), inset 0 0 10px rgba(180, 235, 255, 0.15); } 50% { box-shadow: 0 0 22px rgba(170, 230, 255, 0.75), inset 0 0 14px rgba(200, 240, 255, 0.25); } }
/* 神妙：太極 */
.chat-list li.bubble-taiji .chat-text, .bs-taiji {
  padding-right: 30px;
  border: 2px solid transparent;
  border-radius: 16px;
  color: #fff8e6;
  background:
    radial-gradient(circle at calc(100% - 13px) 12px, #f5efe0 0 3px, transparent 3.5px) padding-box,
    radial-gradient(circle at calc(100% - 13px) 12px, transparent 0 6px, rgba(240, 210, 140, 0.7) 6.5px 7.5px, transparent 8px) padding-box,
    linear-gradient(135deg, #15130f, #2a2418 55%, #151310) padding-box,
    linear-gradient(90deg, #111 0 25%, #f5efe0 25% 50%, #111 50% 75%, #f5efe0 75% 100%) border-box;
  background-size: 100% 100%, 100% 100%, 100% 100%, 120px 100%;
  animation: bubbleFlowTaiji 2.6s linear infinite, bubbleGold 2.6s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(255, 220, 150, 0.3);
}
@keyframes bubbleFlowTaiji { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 0 0, 0 0, 0 0, 120px 0; } }

/* 商城：外觀依等級加光 */
#shop-grid .item-cell.shop-cell.rank-1 { border-color: rgba(150, 220, 200, 0.45); }
#shop-grid .item-cell.shop-cell.rank-2 { border-color: rgba(240, 200, 120, 0.6); box-shadow: 0 0 6px rgba(240, 200, 120, 0.2); }
#shop-grid .item-cell.shop-cell.rank-3 { border-color: rgba(170, 160, 255, 0.75); box-shadow: 0 0 10px rgba(150, 140, 255, 0.35); }
#shop-grid .item-cell.shop-cell.rank-4 { border-color: rgba(255, 170, 230, 0.8); box-shadow: 0 0 12px rgba(255, 150, 220, 0.4); }
#shop-grid .item-cell.shop-cell.rank-5 { border-color: rgba(255, 190, 90, 0.95); box-shadow: 0 0 14px rgba(255, 160, 60, 0.55), inset 0 0 12px rgba(255, 190, 90, 0.2); }
#shop-grid .item-cell.shop-cell.picked { border-color: #f0d48a; box-shadow: 0 0 0 2px #f0d48a, 0 0 14px rgba(240, 212, 138, 0.65); }
.shop-tabs { margin: 2px 0 10px; }
.shop-tabs .subtab { letter-spacing: 0.05em; padding: 6px 2px; font-size: 14px; white-space: nowrap; }
.shop-preview { list-style: none; margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0, 0, 0, 0.25); max-height: none; overflow: visible; }
.shop-preview li { max-width: 100%; }
.title-chip.shop-more { border-style: dashed; color: #f0d48a; }

@media (prefers-reduced-motion: reduce) {
  [class*="dye-"], [class*="swatch-"], .chat-list li[class*="bubble-"] .chat-text, [class*="bs-"] { animation: none !important; }
}

/* ── 手機打橫時維持直向：整個畫面旋轉 90°，與手機同方向（orient.js 加上 force-portrait）── */
html.force-portrait body {
  position: fixed;
  top: 0;
  left: 0;
  /* --fp-h / --fp-w 由 orient.js 依實際可見範圍設定（行動瀏覽器的 100vh 會多算工具列高度） */
  width: var(--fp-h, 100vh);
  height: var(--fp-w, 100vw);
  overflow: hidden;
  transform-origin: top left;
  transform: translateY(var(--fp-h, 100vh)) rotate(-90deg);
}
html.force-portrait.fp-cw body { transform: translateX(var(--fp-w, 100vw)) rotate(90deg); }
html.force-portrait main { height: var(--fp-w, 100vw); }
html.force-portrait .scroll-body { max-height: calc(var(--fp-w, 100vw) - 106px); }
html.force-portrait .mountains { height: calc(var(--fp-w, 100vw) * 0.34); }
html.force-portrait .trib-bolt { height: calc(var(--fp-w, 100vw) * 0.6); }
/* 背景場景以 --vh / --vw 計算尺寸：旋轉後 body 寬是 --fp-h、高是 --fp-w */
html.force-portrait .bgx:not(.bgx-mini) { --vh: calc(var(--fp-w, 100vw) / 100); --vw: calc(var(--fp-h, 100vh) / 100); --vmax: calc(var(--fp-w, 100vw) / 100); }

/* ── 頁首文字按鈕：商城、背包、設定 ── */
.top-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #6d655a;
  border-radius: 3px;
  background: rgba(233, 223, 200, 0.04);
  color: #d8ccb4;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  flex: none;
}
.top-btn:hover { border-color: var(--text); color: var(--text); }
#shop-btn { border-color: rgba(216, 181, 106, 0.6); color: #e6c98a; background: rgba(216, 181, 106, 0.08); }
#shop-btn:hover { border-color: #f0d48a; color: #f6dfa4; }
.top-btn.has-dot::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e0453a;
  box-shadow: 0 0 6px rgba(224, 69, 58, 0.8);
}
.settings-btn svg { flex: none; }
@media (max-width: 360px) {
  .top-btn { padding: 0 6px; letter-spacing: 0.04em; }
  .brand { gap: 5px; }
}
/* 好友分享暫時不能取用：淡色、虛線，點選時說明原因 */
.chip.locked { opacity: 0.55; border-style: dashed; filter: grayscale(0.5); }
.chip.locked .share-by { color: #e0a080; }

/* ── 狀態區（太極圓盤）：左側修為圓環包住境界，右側四格數值與靈力條 ── */
.status { padding: 10px 0 10px; }
.st-main { display: flex; align-items: center; gap: 14px; }
.st-ring {
  position: relative;
  flex: none;
  width: 104px;
  height: 104px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.st-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.st-ring .ring-bg { fill: rgba(13, 12, 11, 0.6); stroke: rgba(233, 223, 200, 0.09); stroke-width: 7; }
.st-ring .ring-fg { fill: none; stroke: #d8b56a; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(216, 181, 106, 0.5)); transition: stroke-dasharray 0.5s; }
.st-ring.peak .ring-fg { stroke: #f3dc9c; animation: ring-glow 1.6s ease-in-out infinite alternate; }
@keyframes ring-glow { from { filter: drop-shadow(0 0 2px rgba(240, 212, 138, 0.4)); } to { filter: drop-shadow(0 0 7px rgba(255, 236, 180, 0.9)); } }
.st-ring .ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; pointer-events: none; }
.status .st-ring .ring-in b { font-size: 19px; font-weight: 700; color: #e6c98a; letter-spacing: 0.12em; margin-right: -0.12em; }
.st-ring .ring-in small { font-size: 12px; color: var(--text-soft); letter-spacing: 0.1em; }
.st-ring .ring-num { font-size: 11px !important; letter-spacing: 0 !important; font-variant-numeric: tabular-nums; margin-top: 1px; }
.st-ring .ring-info {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  font-size: 11px;
  line-height: 15px;
  text-align: center;
  color: var(--text-soft);
  font-style: italic;
}
.st-ring:hover .ring-info { color: var(--text); border-color: var(--text); }
.st-side { flex: 1; min-width: 0; }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 2px; margin-bottom: 8px; }
.st-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  padding: 3px 0;
  border: none;
  border-bottom: 1px dashed var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.st-cell { cursor: pointer; }
button.st-cell:hover .st-k { color: var(--text); }
.st-k { flex: none; font-size: 13px; color: var(--text-soft); letter-spacing: 0.1em; white-space: nowrap; }
.status .st-v { font-size: 17px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-stones { color: #e6c98a; }
.st-jade { color: #8fd8c8; }
.st-inv { display: inline-flex; align-items: center; overflow: visible !important; }
.status .st-inv b { font-size: 17px; font-weight: 700; }
.st-cap { font-size: 12px; font-weight: 400; color: var(--text-soft); }
.st-inv .expand-btn { margin-left: 5px; width: 18px; height: 18px; line-height: 16px; font-size: 13px; }
.st-sta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.st-sta-k { color: var(--text-soft); letter-spacing: 0.05em; white-space: nowrap; }
.status .st-sta b { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.st-sta .regen-side { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.st-bar {
  position: relative;
  height: 9px;
  border-radius: 3px;
  background: rgba(233, 223, 200, 0.07);
  overflow: hidden;
}
/* 格線：每格寬度由程式依靈力上限設定 */
.st-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--seg, 3%) - 2px), var(--bg) calc(var(--seg, 3%) - 2px) var(--seg, 3%));
  pointer-events: none;
}
.st-bar #stamina-bar { height: 100%; border-radius: 0; }
.st-bar #stamina-bar.over { background: linear-gradient(90deg, var(--jade), #b8f0dc); box-shadow: 0 0 10px rgba(143, 216, 200, 0.8); }
.status .break-btn { margin: 10px 0 0; }
.status .stamina-tip { margin-top: 8px; }
@media (max-width: 380px) {
  .st-main { gap: 10px; }
  .st-ring { width: 92px; height: 92px; }
  .status .st-ring .ring-in b { font-size: 17px; }
  .st-grid { column-gap: 10px; }
  .st-k { font-size: 12px; letter-spacing: 0.04em; }
  .status .st-v, .status .st-inv b { font-size: 15px; }
}
@media (max-height: 720px) {
  .st-ring { width: 88px; height: 88px; }
  .st-grid { margin-bottom: 5px; }
}
/* 分數型數值（道庫、靈力）：分子分母同樣大小、粗細與顏色 */
.status .st-cap { font-size: inherit; font-weight: inherit; color: inherit; }
.status .st-inv, .status .st-sta-k b, .status .st-sta-k .st-cap { font-size: 17px; font-weight: 700; color: var(--text); }
.st-sta-k { display: inline-flex; align-items: baseline; gap: 6px; }
@media (max-width: 380px) {
  .status .st-inv, .status .st-inv b, .status .st-sta-k b, .status .st-sta-k .st-cap { font-size: 15px; }
}
.st-sta-k { gap: 0; }
.status .st-sta-k b { margin-left: 6px; }

/* ── 排版修正（2026-11-27 全畫面檢查） ── */
/* 悟道台：不再出現橫向捲軸；道庫格子等寬對齊 */
#tab-forge:not([hidden]) { overflow-x: hidden; }
#tab-forge > .inventory { margin: 0; padding-left: 0; padding-right: 0; }
#inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
#inventory .chip { min-width: 0; margin: 0; justify-content: flex-start; }
#inventory .chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 矮螢幕只留一種捲動：整個悟道台一起捲 */
@media (max-height: 760px) {
  #tab-forge > .inventory { flex: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
/* 材料格：長名稱最多兩行 */
.slot-name { white-space: normal; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 結果卷軸副標：只在右邊讓出印章位置 */
.kind { padding: 0 60px 0 0; }
@media (max-width: 400px) { .kind { letter-spacing: 0.12em; } }
.quest-desc { text-wrap: balance; }
/* 段落換行優化不改變不換行的設定 */
p, li, .desc, .muted, .pack-desc, .quest-desc, .item-detail-desc { text-wrap-style: pretty; }
.trade-main .muted { white-space: nowrap; }

/* 物品格：商城列高一致，名稱最多兩行；背包窄螢幕改四欄，數量不壓圖示 */
#shop-grid { grid-auto-rows: minmax(70px, auto); }
#shop-grid .item-cell, #shop-grid .item-cell.empty { aspect-ratio: auto; min-height: 70px; }
.shop-cell .item-name:not(.price), #bag-grid .item-name { white-space: normal; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: keep-all; overflow-wrap: anywhere; text-align: center; }
@media (max-width: 420px) { #bag-grid { grid-template-columns: repeat(4, 1fr); } }
#bag-grid .item-cell { aspect-ratio: auto; min-height: 72px; padding-top: 14px; }
#bag-grid .item-corner { top: 2px; right: 3px; padding: 0 3px; border-radius: 3px; background: rgba(0, 0, 0, 0.55); line-height: 1.3; }
.shop-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
.shop-tabs .subtab { padding-left: 2px; padding-right: 2px; letter-spacing: 0; }
.nowrap { white-space: nowrap; }
#vip-gift { flex-wrap: wrap; row-gap: 6px; }

/* 視窗：內容比畫面高時可以捲動；寬度統一；關閉鈕有底色、內容不壓到它 */
.overlay { overflow-y: auto; align-items: safe center; }
.overlay > .scroll { margin: auto; }
.detail-scroll, .vip-scroll { max-width: 440px; }
.close { width: 30px; height: 30px; border-radius: 50%; background: rgba(18, 16, 14, 0.92); box-shadow: 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; padding: 0; }
.close:hover { color: var(--text); }
.scroll-body { scroll-padding-top: 40px; }
.account-scroll .scroll-body { padding-top: 34px; }
#mail .scroll-body { min-height: 360px; }

/* 寬按鈕：墨色按鈕也撐滿 */
.ink-btn.wide { display: block; width: 100%; }

/* 確認框：兩顆按鈕等寬 */
#confirm .row > button { flex: 1; }
.confirm-text { font-size: 15px; }

/* 渡劫 */
#trib-title { font-size: clamp(22px, 7vw, 30px); letter-spacing: 0.04em; }
.trib-h { text-align: center; letter-spacing: 0.2em; margin: 10px 0 0; }
.trib-note { text-align: center; margin: 2px 0 8px; }
.trib-boost { justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.boost-label { white-space: nowrap; }
#trib-outcome { font-size: 15px; }
@media (max-width: 400px) { .trib-scroll .stamp { width: 56px; height: 56px; font-size: 16px; top: -6px; left: -4px; } }

/* 造物詳情出售說明分兩行 */
.sell-note { white-space: pre-line; }

/* 天道榜：數值不撐破卡片 */
.bang { min-width: 0; overflow: hidden; }

/* 市集：圖示與名稱留空隙 */
.trade-main .em { margin-right: 4px; }

/* 典籍：階段獎勵兩顆按鈕同一列等寬 */
.book-stages { display: grid; grid-template-columns: 1fr 1fr; }
.book-stages .small-btn { padding: 5px 6px; letter-spacing: 0.04em; }

/* 論道：稱號放不下兩個字就整個不顯示 */
.chat-head .title-tag { min-width: 2.6em; }
/* 標頭放不下時稱號換到下一行，不再縮成一個字 */
.chat-head { flex-wrap: wrap; row-gap: 0; }
.chat-head .chat-name { min-width: 0; }
.chat-head .title-tag { flex: none; min-width: auto; }

/* 規則、推薦說明：段落太長時仍可換行，不凸出卡片 */
.rule-v .nw, .ref-v .nw, .share-to-note .nw, .fr-wait .nw { display: inline-block; max-width: 100%; white-space: normal; }

/* 境界一覽：渡劫數值可換行 */
.realm-stat.wide { flex-wrap: wrap; }
.realm-stat.wide .realm-v { white-space: normal; text-align: right; margin-left: auto; }
@media (max-width: 380px) { .realm-stat { font-size: 12px; } }

/* 結交道友、推薦碼表單：按鈕縮窄讓輸入框有空間 */
#fr-add-form .seal-btn, #ref-bind-form .seal-btn { letter-spacing: 0.1em; padding: 8px 12px; flex: none; }
.acc-label small { white-space: normal; }
/* 狀態區數值：五個數值同一字級、粗細與行高（只有顏色不同） */
.status .st-v, .status .st-v b, .status .st-v span {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.status .st-v { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .st-v b, .status .st-v span { color: inherit; }
.st-inv-cell .st-v, .st-sta-k .st-v { color: var(--text); }
.st-sta-k { display: inline-flex; align-items: baseline; gap: 6px; }
.st-sta-k .st-v b { margin: 0; }
/* 道庫整格可點：可擴充時標籤旁有朱紅＋ */
.st-inv-cell { cursor: default; }
.st-inv-cell.can-expand { cursor: pointer; }
.st-inv-cell:disabled { opacity: 1; color: inherit; }
.st-plus { display: none; margin-left: 2px; font-style: normal; font-size: 12px; color: var(--cinnabar); font-weight: 700; }
.st-inv-cell.can-expand .st-plus { display: inline; }
.st-inv-cell.can-expand:hover .st-k { color: var(--text); }
@media (max-width: 380px) {
  .status .st-v, .status .st-v b, .status .st-v span { font-size: 15px !important; }
}

/* ── 畫面背景選擇：背景遮罩較淡，方便看預覽 ── */
.bgpick-overlay { background: rgba(5, 4, 3, 0.2); align-items: flex-end; }
.bgpick-scroll { max-width: 440px; }
.bgpick-scroll .scroll-body { max-height: 56vh; overflow-y: auto; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.bg-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: rgba(233, 223, 200, 0.03); color: var(--text); font: inherit; cursor: pointer; min-width: 0; }
.bg-card:hover { border-color: var(--line-strong); }
.bg-card.picked { border-color: #e6c98a; box-shadow: 0 0 0 1px #e6c98a, 0 0 10px rgba(230, 201, 138, 0.35); }
.bg-thumb { position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(233, 223, 200, 0.12); overflow: hidden; }
.bg-card.locked .bg-thumb { filter: saturate(0.6) brightness(0.75); }
.bg-lock { position: absolute; right: 4px; top: 4px; padding: 0 4px; border-radius: 3px; font-size: 11px; line-height: 1.5; color: #f6ecd6; background: rgba(142, 42, 34, 0.9); }
.bg-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; letter-spacing: 0.04em; }
.bg-tag { font-size: 11px; color: var(--text-soft); white-space: nowrap; }
.bg-card.using .bg-tag { color: #7fd1c2; }
.bg-card.locked .bg-tag { color: #e6a47a; }
#bg-use:disabled { opacity: 0.6; }
.bgpick-overlay > .scroll { margin: auto auto 0; }
.bgpick-overlay { padding-bottom: 18px; }
.bgpick-scroll .scroll-body { max-height: 42vh; }
.bgpick-scroll .result-name { font-size: 22px; }
.bg-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.bg-thumb { aspect-ratio: 1 / 1.15; }
.bg-name { font-size: 12px; letter-spacing: 0; }

/* ── 信匣：公告 ── */
.announce-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.announce-item { padding: 10px 2px 12px; border-bottom: 1px dashed var(--line); }
.announce-item:first-child .announce-title { color: #e6c98a; }
.announce-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.announce-title { font-size: 16px; font-weight: 700; letter-spacing: 0.05em; min-width: 0; }
.announce-date { flex: none; font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.announce-body { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-line; color: var(--text); }

/* ── 第二輪複查修正 ── */
/* 狀態區：圓環百分比與四格、靈力同一字級；斜線用窄的半形 */
.status .st-ring .ring-num, .status .st-ring .ring-num span { font-size: 15px !important; font-weight: 700; color: var(--text); letter-spacing: 0 !important; }
.st-slash { font-style: normal; margin: 0 1px; color: var(--text-soft); }
.status .st-v .st-slash { font-weight: 400 !important; }
.st-inv-cell .st-v { overflow: visible; text-overflow: clip; }
@media (max-width: 420px) {
  .st-main { gap: 10px; }
  .st-ring { width: 88px; height: 88px; }
  .status .st-ring .ring-in b { font-size: 17px; }
  .status .st-ring .ring-num, .status .st-ring .ring-num span { font-size: 13px !important; }
  .st-grid { column-gap: 10px; }
  .st-k { font-size: 12px; letter-spacing: 0.02em; }
  .status .st-v, .status .st-v b, .status .st-v span { font-size: 15px !important; }
}
.regen-side, .regen-side .muted { white-space: nowrap; }

/* 背景選擇：使用按鈕固定在面板底部，文字不溢出 */
.bgpick-scroll { display: flex; flex-direction: column; }
.bg-foot { padding: 8px 18px 4px; }
#bg-use { font-size: 16px; letter-spacing: 0.12em; white-space: normal; padding: 11px 8px; }

/* 物品格高度一致：名稱固定留兩行高 */
#shop-grid .item-cell, #bag-grid .item-cell { height: 78px; min-height: 0; justify-content: flex-start; padding-top: 10px; }
#shop-grid .item-cell.empty, #bag-grid .item-cell.empty { height: 78px; }
.shop-cell .item-name:not(.price), #bag-grid .item-name { min-height: 2.3em; }
#bag-grid .item-cell { padding-top: 14px; }

/* 按鈕：朱印按鈕加透明框，與墨色按鈕同高 */
.seal-btn { border: 1.5px solid transparent; }

/* 市集：窄螢幕時名稱一行、價格與按鈕靠右一行 */
@media (max-width: 420px) {
  .trade-list li:not(.empty) { flex-wrap: wrap; row-gap: 6px; }
  .trade-list .trade-main { flex: 1 1 100%; }
  .trade-list .trade-side { margin-left: auto; }
}

/* 短說明避免最後只剩一兩個字 */
.item-hint, #look-dye-note, #look-bubble-note, .ref-card p.muted, .fr-empty { text-wrap: balance; }
@media (max-width: 380px) { #realm .realm-range { font-size: 12px; } }
.scroll-body { scrollbar-gutter: stable; }

/* ── 畫面背景選擇（第二版）：視窗置中；卡片是場景縮小版，名稱疊在畫面下方 ── */
.bgpick-overlay { align-items: safe center; padding-bottom: 24px; }
.bgpick-overlay > .scroll { margin: auto; }
.bgpick-scroll .scroll-body { max-height: min(58vh, 560px); }
.bg-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 10px 0 6px; }
@media (max-width: 420px) { .bg-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.bg-card {
  position: relative;
  padding: 3px;
  border: 1px solid rgba(216, 181, 106, 0.35);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(216, 181, 106, 0.16), rgba(20, 16, 12, 0.6) 45%, rgba(216, 181, 106, 0.1));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.bg-card:hover { transform: translateY(-2px); border-color: rgba(230, 201, 138, 0.7); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
.bg-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 4px;
  overflow: hidden;
  background: #0c0b0a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
  filter: none;
}
/* 內框細金線 */
.bg-thumb::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(240, 212, 138, 0.22); border-radius: 2px; pointer-events: none; z-index: 2; }
.bg-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 4px 6px;
  background: linear-gradient(180deg, transparent, rgba(6, 5, 4, 0.82) 55%);
  line-height: 1.25;
}
.bg-card .bg-name { font-size: 13px; font-weight: 700; color: #f3e6c8; letter-spacing: 0.08em; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.bg-card .bg-tag { font-size: 10.5px; color: rgba(233, 223, 200, 0.7); white-space: nowrap; letter-spacing: 0.04em; }
.bg-seal {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: #f6ecd6;
  background: rgba(192, 70, 58, 0.92);
  box-shadow: inset 0 0 0 1px rgba(246, 236, 214, 0.35), 0 1px 3px rgba(0, 0, 0, 0.5);
  transform: rotate(4deg);
}
.bg-seal:empty { display: none; }
.bg-card:not(.locked) .bg-seal { background: rgba(122, 96, 48, 0.92); }
/* 未解鎖：畫面略暗，標籤朱紅 */
.bg-card.locked .bg-thumb .bgx-mini { filter: saturate(0.7) brightness(0.7); }
.bg-card.locked .bg-tag { color: #f0a080; }
/* 使用中：玉色標籤 */
.bg-card.using .bg-tag { color: #8fe0c8; }
.bg-card.using { border-color: rgba(127, 209, 194, 0.7); }
/* 正在預覽：金框發光 */
.bg-card.picked { border-color: #f0d48a; box-shadow: 0 0 0 1px #f0d48a, 0 0 16px rgba(240, 212, 138, 0.45); }
.bg-card.picked .bg-thumb::after { border-color: rgba(240, 212, 138, 0.6); }
.bg-lock { display: none; }
/* 名牌在縮圖下方 */
.bg-thumb { aspect-ratio: 13 / 18; }
.bg-cap { position: static; padding: 5px 2px 2px; background: none; }
.bg-card .bg-name { font-size: 13px; text-shadow: none; }
.bg-card.locked .bg-thumb .bgx-mini { filter: brightness(1.15) saturate(0.85); }
/* 頁首：「仙緣閣」三個字，窄螢幕縮小間距留餘裕 */
@media (max-width: 390px) {
  .top-btn { padding: 0 6px; letter-spacing: 0.04em; }
  .brand { gap: 5px; }
  .who { gap: 5px; }
  .who .badge { font-size: 11px; padding: 0 4px; }
}
/* 靈力格線：剛好畫 N 格（每格右側 2px 間隔），最後一格的間隔落在條外，每格等寬 */
.st-bar::after {
  inset: 0 -2px 0 0;
  background-image: linear-gradient(90deg, transparent calc(100% - 2px), var(--bg) calc(100% - 2px));
  background-size: calc(100% / var(--n, 35)) 100%;
  background-repeat: round;
}

/* ── 境界一覽：周天法陣 ── */
.realm-scroll .scroll-body { text-align: left; }
.realm-scroll .result-name { text-align: center; }
.fz-wrap { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 4px auto 10px; }
.fz-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fz-arc { filter: drop-shadow(0 0 4px rgba(240, 212, 138, 0.7)); transition: stroke-dasharray 0.5s; }
.fz-now { filter: drop-shadow(0 0 6px rgba(240, 212, 138, 0.9)); }
.fz-labels { position: absolute; inset: 0; }
.fz-label {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 4px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  color: rgba(233, 223, 200, 0.5);
  cursor: pointer;
  letter-spacing: 0.04em;
}
.fz-label:hover { color: var(--text); }
.fz-label.done { color: #d8b56a; }
.fz-label.now { color: #fff0c4; font-weight: 700; font-size: 14px; text-shadow: 0 0 8px rgba(240, 212, 138, 0.8); }
.fz-label.picked:not(.now) { color: #8fe0c8; font-weight: 700; }
.fz-center { position: absolute; inset: 22%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.25; pointer-events: none; }
.fz-k { font-size: 12px; color: var(--text-soft); letter-spacing: 0.2em; }
.fz-name { font-size: 30px; font-weight: 700; color: #f0d48a; letter-spacing: 0.15em; margin-right: -0.15em; }
.fz-sub { font-size: 14px; color: var(--text); }
.fz-cult { font-size: 12px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.fz-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 12px; }
.fz-cell { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 7px 10px; border-radius: 6px; background: rgba(233, 223, 200, 0.04); border: 1px solid var(--line); font-size: 13px; min-width: 0; }
.fz-cell.wide { grid-column: 1 / -1; }
.fz-ck { color: var(--text-soft); white-space: nowrap; }
.fz-cv { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fz-perk { justify-content: center; border-style: dashed; border-color: rgba(143, 224, 200, 0.45); }
.fz-perk .fz-cv { color: #cfeee6; font-weight: 400; white-space: normal; text-align: center; text-wrap: balance; }
.fz-intro { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.fz-intro li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; background: rgba(233, 223, 200, 0.04); border: 1px solid var(--line); font-size: 13.5px; }
.fz-it { min-width: 0; }
.fz-iv { margin-left: auto; flex: none; font-weight: 700; font-size: 14px; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fz-iv.gold { color: #f0d48a; }
.fz-iv.jade { color: #8fe0c8; }
.fz-more { border-top: 1px dashed var(--line); padding-top: 8px; }
.fz-more summary { cursor: pointer; list-style: none; text-align: center; color: var(--text-soft); font-size: 13px; letter-spacing: 0.2em; padding: 4px 0; }
.fz-more summary::-webkit-details-marker { display: none; }
.fz-more summary::after { content: "　▾"; }
.fz-more[open] summary::after { content: "　▴"; }
.fz-more h4 { margin: 12px 0 4px; }
@media (max-width: 380px) {
  .fz-label { font-size: 12px; }
  .fz-name { font-size: 26px; }
}
/* 境界一覽：窄螢幕修正 */
.realm-scroll .scroll-body { overflow-x: hidden; }
.fz-label { padding: 6px 6px; }
.fz-cv { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fz-it { text-wrap: balance; }
@media (max-width: 380px) {
  .fz-label, .fz-label.now { font-size: 12px; }
  .fz-cell { padding: 6px 8px; font-size: 12px; }
  .fz-intro li { font-size: 12.5px; padding: 8px 10px; }
  .fz-name { font-size: 24px; }
  .fz-cult { font-size: 11px; }
}
/* 境界一覽標題：兩側金色細線、字距拉開 */
.fz-title { display: flex; align-items: center; justify-content: center; gap: 12px; letter-spacing: 0.35em; margin-right: -0.35em; color: #f3e6c8; }
.fz-title::before, .fz-title::after { content: ""; width: 40px; height: 1px; flex: none; background: linear-gradient(90deg, transparent, #d8b56a); }
.fz-title::after { transform: scaleX(-1); margin-left: -0.35em; }
@media (max-width: 380px) { .fz-title::before, .fz-title::after { width: 22px; } }
/* 解鎖功能：法陣上的小星與中央一行 */
.fz-label.has-unlock::after { content: "✦"; margin-left: 2px; font-size: 10px; color: #8fe0c8; vertical-align: 2px; }
.fz-tag { display: block; min-height: 1.3em; margin-top: 3px; font-size: 11.5px; color: #8fe0c8; white-space: nowrap; }
@media (max-width: 380px) { .fz-tag { font-size: 10.5px; } }
.fz-title { white-space: nowrap; }
@media (max-width: 380px) { .fz-title { font-size: 24px; letter-spacing: 0.22em; margin-right: -0.22em; gap: 8px; } }

/* ── 境界一覽：詳細規則（分區條列） ── */
.fz-rules { padding: 6px 0 4px; }
.fr-sec { margin: 0 0 16px; }
.fr-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; color: #f0d48a; letter-spacing: 0.25em; }
.fr-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(216, 181, 106, 0.45), transparent); }
.fr-rule { display: grid; grid-template-columns: 3.2em 1fr; gap: 10px; align-items: baseline; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 13.5px; line-height: 1.6; }
.fr-rule:last-child { border-bottom: none; }
.fr-k { color: #e6c98a; font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; }
.fr-v { color: var(--text); text-wrap: pretty; }
.fr-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fr-chips.five { grid-template-columns: repeat(5, 1fr); }
.fr-chip { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 6px; background: rgba(233, 223, 200, 0.04); border: 1px solid var(--line); line-height: 1.2; min-width: 0; }
.fr-cv { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fr-ck { font-size: 11.5px; color: var(--text-soft); white-space: nowrap; }
.fr-sec:nth-of-type(2) .fr-cv { color: #8fe0c8; }
.fr-formula { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 4px; padding: 10px 8px; margin-bottom: 10px; border-radius: 6px; background: rgba(216, 181, 106, 0.06); border: 1px solid rgba(216, 181, 106, 0.3); }
.fr-term { padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.fr-plus { color: #d8b56a; font-size: 12px; }
.fr-sub { margin: 10px 0 6px; font-size: 12px; color: var(--text-soft); letter-spacing: 0.15em; }
.fr-note { margin: 8px 0 0; font-size: 12px; color: var(--text-soft); line-height: 1.7; text-wrap: pretty; }
@media (max-width: 380px) {
  .fr-chips.five { grid-template-columns: repeat(4, 1fr); }
  .fr-cv { font-size: 13.5px; }
  .fr-rule { font-size: 12.5px; }
}
/* 道庫：名稱完整顯示（依名稱長短決定寬度），每排撐滿左右，最後一排靠左 */
#inventory { display: flex; flex-wrap: wrap; gap: 8px; }
#inventory .chip { flex: 1 1 auto; max-width: 100%; justify-content: flex-start; }
#inventory .chip .nm { overflow: visible; text-overflow: clip; white-space: nowrap; }
#inventory::after { content: ""; flex: 100 1 0; }
/* 道庫：右側與上方留空間，格子右上角的「創」標記不會被切掉 */
#tab-forge > .inventory { padding-right: 7px; padding-top: 14px; }
#inventory .chip.mine { margin-top: 2px; }

/* ── 悟道台（樣板⑤）：保留置入圓格與太極，太極本身就是悟道按鈕 ── */
.forge-stage { gap: 18px; margin: 2px 0 6px; }
.slot { max-width: 92px; padding: 10px; }
.taiji-act { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: none; background: none; color: var(--text); font: inherit; cursor: pointer; flex: none; }
.taiji-act:disabled { cursor: default; }
.taiji-act .taiji-stage { width: 78px; height: 78px; transition: opacity 0.3s, filter 0.3s; }
.taiji-act:disabled .taiji-stage { opacity: 0.6; }
.taiji-act.ready .taiji { filter: drop-shadow(0 0 8px rgba(240, 160, 110, 0.65)); }
.taiji-act.ready:hover .taiji-stage { transform: scale(1.04); }
.act-label { min-width: 72px; padding: 2px 12px; border-radius: 12px; font-size: 13px; letter-spacing: 0.3em; text-align: center; color: var(--text-soft); border: 1px solid var(--line); background: rgba(233, 223, 200, 0.04); white-space: nowrap; }
.taiji-act.ready .act-label { color: #f6ecd6; font-weight: 700; border-color: #e07a6c; background: radial-gradient(circle at 35% 30%, #c9503f, #8e2a20); box-shadow: 0 0 10px rgba(192, 70, 58, 0.45); }
.taiji-act.guide { outline-offset: 2px; border-radius: 14px; }
.taiji-act.busy::after { display: none; }
.taiji-act.busy .act-label { font-size: 0; }
.taiji-act.busy .act-label::after { content: "推演中…"; font-size: 13px; letter-spacing: 0.2em; }
@media (max-height: 720px) { .taiji-act .taiji-stage { width: 68px; height: 68px; } .slot { max-width: 84px; } }

/* 功課：一行顯示，說明收起 */
.tutorial.quest { padding: 6px 10px; margin-bottom: 6px; }
.tutorial.quest .quest-head { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; }
.tutorial.quest .quest-desc { display: none; }

/* 搜尋與五行篩選 */
.search-wrap .search { padding: 7px 8px; font-size: 14px; }
.inv-filter { display: flex; gap: 5px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; flex: none; }
.inv-filter::-webkit-scrollbar { display: none; }
.inv-f { flex: none; padding: 3px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(233, 223, 200, 0.03); color: var(--text-soft); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.inv-f.active { border-color: #d8b56a; color: #f0d48a; background: rgba(216, 181, 106, 0.1); }
.inv-empty { width: 100%; text-align: center; margin: 12px 0; }

/* 好友分享：一列小字 */
.shared-strip { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin: 6px 0 0; }
.shared-title { flex: none; margin: 0; font-size: 12px; }
.shared-title small { display: none; }
.shared-list { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 6px; scrollbar-width: none; }
.shared-list .chip { flex: none; font-size: 13px; padding: 2px 8px 2px 4px; }
.shared-list .chip .share-by { font-size: 10.5px; }

/* 道庫格子縮小，一眼看到更多造物 */
#inventory { gap: 6px; }
#inventory .chip { padding: 3px 8px 3px 4px; gap: 4px; font-size: 13px; line-height: 1.35; }
#inventory .chip .nm { font-size: 13px; }
#inventory .chip .el { width: 15px; height: 15px; font-size: 9.5px; }
#inventory .chip .em { font-size: 13px; }
#inventory .chip .mine-mark { top: -5px; right: -4px; font-size: 8px; padding: 1px 2px; }
/* 太極裡的兩個字：黑底白字、白底黑字 */
.tj-text { font-family: var(--font); pointer-events: none; transition: opacity 0.3s; }
.tj-c1 { fill: #ede3cc; }
.tj-c2 { fill: #0d0c0b; }
.taiji-act:disabled .tj-text { opacity: 0.55; }
.taiji-act.ready .tj-c1 { fill: #fff3e0; filter: drop-shadow(0 0 3px rgba(255, 210, 160, 0.8)); }
.taiji-act.ready .tj-c2 { fill: #8e2a20; }
.forge-stage.brewing .tj-text { opacity: 0; }
.taiji-act .taiji-stage { width: 96px; height: 96px; }
@media (max-height: 720px) { .taiji-act .taiji-stage { width: 84px; height: 84px; } }
/* 太極字改為上下：上方小圓點處白字、下方小圓點處黑字（兩顆小圓點隱藏） */
.taiji-act .taiji circle:nth-of-type(2), .taiji-act .taiji circle:nth-of-type(3) { display: none; }
.taiji-act .tj-c1, .taiji-act.ready .tj-c1 { fill: #f6ecd6; filter: none; }
.taiji-act .tj-c2, .taiji-act.ready .tj-c2 { fill: #0d0c0b; }
.taiji-act.ready .tj-text { filter: drop-shadow(0 0 2px rgba(240, 180, 120, 0.6)); }
/* 兩個字亮度平衡：白字調暗、不加光暈，黑字維持深墨色 */
.taiji-act .tj-c1, .taiji-act.ready .tj-c1 { fill: #b9ae98; }
.taiji-act .tj-c2, .taiji-act.ready .tj-c2 { fill: #1b1814; }
.taiji-act.ready .tj-text { filter: none; }

/* 悟道台複查修正 */
.taiji-act.busy .taiji-stage { opacity: 1; }
.taiji-act .taiji-stage { transition: opacity 0.3s, filter 0.3s, transform 0.2s; }
.taiji-act.ready:hover .taiji-stage { transform: none; }
@media (hover: hover) { .taiji-act.ready:hover .taiji-stage { transform: scale(1.04); } }
#tab-forge { scrollbar-width: thin; }
.inv-filter { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
.inv-f { padding: 4px 11px; }
#inventory .chip .mine-mark { font-size: 9px; }
/* 很窄的螢幕：設定只留齒輪圖示 */
@media (max-width: 340px) {
  .settings-btn { font-size: 0; gap: 0; padding: 0 6px; }
  .settings-btn svg { width: 16px; height: 16px; }
}

/* ── 太極字體：碑刻宋體 ── */
.tj-text { font-family: "Kaisei Tokumin", var(--font); font-weight: 800; font-size: 20px; }

/* ── 參悟／悟道特效：太極連同兩字旋轉、光環外擴、光點環繞、按下金光一閃 ── */
.taiji-act .taiji-stage { position: relative; z-index: 1; }
.forge-stage.brewing .tj-text { opacity: 1; transform-box: view-box; transform-origin: 60px 60px; animation: spin 1.4s linear infinite; }
.forge-stage.brewing .taiji-act .taiji { animation: spin 1.4s linear infinite; filter: drop-shadow(0 0 14px rgba(255, 210, 150, 0.85)); }
.forge-stage.brewing .taiji-act .bagua { animation: spin 5s linear infinite reverse; opacity: 0.95; color: #f0d48a; }
.tj-fx { position: absolute; left: 50%; top: 0; width: 96px; height: 96px; transform: translateX(-50%); pointer-events: none; z-index: 0; }
.tj-fx i, .tj-fx b { position: absolute; inset: 0; border-radius: 50%; opacity: 0; }
.tj-fx i { border: 2px solid rgba(240, 212, 138, 0.8); box-shadow: 0 0 12px rgba(240, 190, 120, 0.6); }
.forge-stage.brewing .tj-fx i { animation: tj-ring 1.5s ease-out infinite; }
.forge-stage.brewing .tj-fx .r2 { animation-delay: 0.5s; }
.forge-stage.brewing .tj-fx .r3 { animation-delay: 1s; }
@keyframes tj-ring { 0% { transform: scale(0.75); opacity: 0.9; } 100% { transform: scale(1.75); opacity: 0; } }
.tj-fx .orbit { inset: -14px; border: 2px dotted rgba(255, 225, 170, 0.75); }
.forge-stage.brewing .tj-fx .orbit { opacity: 1; animation: spin 3s linear infinite reverse; filter: drop-shadow(0 0 4px rgba(255, 210, 150, 0.9)); }
.tj-fx .flash { inset: -24px; background: radial-gradient(circle, rgba(255, 236, 190, 0.85), rgba(240, 180, 110, 0.35) 40%, transparent 70%); }
.taiji-act.burst .tj-fx .flash { animation: tj-flash 0.7s ease-out; }
@keyframes tj-flash { 0% { opacity: 0; transform: scale(0.5); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
.taiji-act.burst .taiji-stage { animation: tj-press 0.35s ease-out; }
@keyframes tj-press { 0% { transform: scale(1); } 40% { transform: scale(0.9); } 100% { transform: scale(1); } }
@media (max-height: 720px) { .tj-fx { width: 84px; height: 84px; } }
@media (prefers-reduced-motion: reduce) { .tj-fx i, .tj-fx b { animation: none !important; } }

/* ── 置入格樣式（設定中更換，VIP 解鎖）：.skin 為共用外框，.sk-樣式 為各款 ── */
.skin { position: relative; }
.slot.skin { background: none; border-radius: 50%; box-shadow: none; }
.skin > .sk-bg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; font-family: var(--font); }
.skin > :not(.sk-bg) { position: relative; z-index: 1; }
/* 玉璧 */
.skin.sk-jade { border-radius: 50%; background: radial-gradient(circle, transparent 0 46%, rgba(127, 209, 194, 0.10) 47%, rgba(80, 160, 140, 0.25) 62%, rgba(127, 209, 194, 0.08) 63%, transparent 64%); box-shadow: inset 0 0 0 1.5px rgba(143, 224, 200, 0.55), 0 0 0 1px rgba(143, 224, 200, 0.15); }
.skin.sk-jade.filled { background: radial-gradient(circle, rgba(127, 209, 194, 0.10) 0 46%, rgba(127, 209, 194, 0.18) 47%, rgba(80, 160, 140, 0.35) 62%, rgba(127, 209, 194, 0.12) 63%, transparent 64%); box-shadow: inset 0 0 0 1.5px rgba(160, 240, 215, 0.9), 0 0 14px rgba(127, 209, 194, 0.45); }
/* 印框 */
.skin.sk-seal { border-radius: 10px; border: 1.5px solid rgba(233, 223, 200, 0.35); background: rgba(233, 223, 200, 0.03); }
.skin.sk-seal::before, .skin.sk-seal::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2.5px solid #c0463a; z-index: 1; pointer-events: none; }
.skin.sk-seal::before { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 9px 0 0 0; }
.skin.sk-seal::after { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 9px 0; }
.skin.sk-seal.filled { border-color: rgba(240, 212, 138, 0.6); background: rgba(216, 181, 106, 0.08); box-shadow: 0 0 12px rgba(216, 181, 106, 0.25); }
/* 符籙：直式黃紙 */
.skin.sk-fu { border-radius: 3px; background: linear-gradient(180deg, #d8c48a, #c9b273); box-shadow: inset 0 0 0 3px #d8c48a, inset 0 0 0 4.5px #a8322a, 0 3px 8px rgba(0, 0, 0, 0.45); }
.skin.sk-fu .slot-hint { color: #7a2a20; }
.skin.sk-fu .slot-name { color: #3a1d14; }
.skin.sk-fu:not(.filled)::after { content: "敕"; position: absolute; top: 9%; left: 0; right: 0; text-align: center; font-size: 14px; color: rgba(168, 50, 42, 0.6); pointer-events: none; }
.skin.sk-fu.filled { background: linear-gradient(180deg, #e6d39a, #d4bd7e); }
.slot.skin.sk-fu { aspect-ratio: 0.74; max-width: 68px; padding: 8px 5px; }
/* 琉璃珠 */
.skin.sk-orb { border-radius: 50%; background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.35), transparent 22%), radial-gradient(circle at 50% 55%, rgba(120, 150, 230, 0.25), rgba(70, 60, 140, 0.35) 60%, rgba(20, 20, 40, 0.6) 100%); box-shadow: inset 0 0 0 1.5px rgba(180, 190, 255, 0.45), 0 4px 12px rgba(0, 0, 0, 0.5); }
.skin.sk-orb.filled { background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.45), transparent 22%), radial-gradient(circle at 50% 55%, rgba(150, 180, 255, 0.4), rgba(110, 80, 200, 0.45) 60%, rgba(30, 20, 60, 0.6) 100%); box-shadow: inset 0 0 0 1.5px rgba(200, 210, 255, 0.85), 0 0 16px rgba(150, 140, 255, 0.55); }
/* 符籙、印框的指引虛線跟著外框形狀 */
.slot.skin.sk-seal.guide { outline-offset: 2px; }

/* 置入格樣式選擇視窗 */
.sk-box { position: relative; width: 92px; height: 92px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px; text-align: center; box-sizing: border-box; color: var(--text); }
.sk-box.sk-fu { width: 68px; padding: 8px 5px; }
.sk-box .slot-name { font-size: 14px; font-weight: 700; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sk-preview { display: flex; justify-content: center; align-items: center; gap: 28px; min-height: 104px; margin: 4px 0 2px; padding: 6px 0; border-radius: 8px; background: radial-gradient(ellipse at 50% 50%, rgba(233, 223, 200, 0.06), transparent 70%); }
.sk-card { padding: 3px; }
.sk-thumb { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #1c1a16, #0c0b0a 75%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6); }
.sk-thumb::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(240, 212, 138, 0.22); border-radius: 2px; pointer-events: none; z-index: 2; }
.sk-thumb .sk-box { zoom: 0.72; }
.sk-cap { display: flex; flex-direction: column; align-items: center; padding: 4px 2px 3px; line-height: 1.25; }
.bg-card.locked .sk-thumb .sk-box { filter: saturate(0.7) brightness(0.7); }

/* ── 上方按鈕全部改為圖示；分頁、功課、搜尋區壓縮高度，讓道庫往上 ── */
header.top .mail-btn { width: 32px; height: 28px; border-radius: 4px; }
header.top .brand { gap: 6px; }
#shop-btn.shop-ico { border-color: rgba(216, 181, 106, 0.65); color: #e6c98a; background: rgba(216, 181, 106, 0.1); }
#shop-btn.shop-ico:hover { border-color: #f0d48a; color: #f6dfa4; }
.status { margin-bottom: 8px; }
.tabs { margin-bottom: 4px; }
.tab { padding: 2px 6px 6px; font-size: 17px; }
.tab.active::after { bottom: 1px; height: 3px; }
@media (max-width: 420px) { .tab { font-size: 15.5px; padding: 2px 2px 6px; } }
.tutorial.quest { padding: 3px 4px 3px 10px; margin: 0 0 4px; min-height: 0; }
.tutorial.quest .quest-head { font-size: 13px; }
.tutorial.quest .small-btn { padding: 3px 12px; font-size: 13px; min-height: 0; line-height: 1.4; }
.forge-stage { margin: 0 0 2px; }
.search-wrap { margin: 4px 0 2px; }
.search-wrap .search { padding: 6px 8px; }
.inv-filter { padding: 4px 24px 2px 0; }
.shared-strip { margin: 4px 0 0; padding: 3px 8px; }
#tab-forge > .inventory { padding-top: 12px; }

/* ── 功課：上方列卷軸圖示，點開顯示（不佔版面） ── */
header.top { position: relative; }
.quest-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  border: 1px solid rgba(216, 181, 106, 0.6);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(36, 31, 24, 0.98), rgba(20, 17, 13, 0.98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: banner-in 0.2s ease-out;
}
.quest-pop[hidden] { display: none; }
.quest-pop .quest-main { flex: 1; min-width: 0; }
.quest-pop .quest-head { font-size: 14px; font-weight: 700; color: var(--text); }
.quest-pop .quest-desc { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.quest-pop .small-btn { flex: none; }

/* 複查修正：公告長網址換行、圓環百分比與數值同字級、窄螢幕境界數值不截斷 */
.announce-title, .announce-body { overflow-wrap: anywhere; }
.status .st-ring .ring-num, .status .st-ring .ring-num span { font-size: 16px !important; }
@media (max-width: 420px) { .status .st-ring .ring-num, .status .st-ring .ring-num span { font-size: 15px !important; } }
@media (max-width: 380px) {
  .fz-cell { gap: 4px; padding: 6px; }
  .fz-ck { font-size: 11px; letter-spacing: -0.02em; }
  .fz-cv { overflow: visible; text-overflow: clip; }
}
@media (max-width: 340px) { .fz-detail { grid-template-columns: 1fr; } }

/* 公告：最新一則展開，舊的只列標題，點選展開或收起 */
.announce-item { padding: 0; }
button.announce-head { width: 100%; margin: 0; padding: 10px 2px; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; align-items: center; }
button.announce-head:hover .announce-title { color: #f0d48a; }
.announce-title { flex: 1; }
.announce-item:not(:first-child) .announce-title { font-size: 15px; font-weight: 400; color: var(--text); }
.announce-item.open:not(:first-child) .announce-title { font-weight: 700; }
.announce-fold { flex: none; width: 8px; height: 8px; margin: 0 4px 3px 2px; border-right: 1.5px solid var(--text-soft); border-bottom: 1.5px solid var(--text-soft); transform: rotate(45deg); transition: transform 0.2s; }
.announce-item.open .announce-fold { transform: rotate(-135deg); margin-bottom: -3px; }
.announce-body { padding: 0 2px 12px; }
.announce-body[hidden] { display: none; }
.announce-head { gap: 14px; }
button.announce-head, button.announce-head .announce-title { white-space: normal; text-wrap: wrap; }

/* ── 視窗標題統一為「修煉境界」樣式：兩側金線、字距拉開 ── */
.scroll-body > .result-name.fz-title { font-size: 30px; text-align: center; justify-content: center; letter-spacing: 0.35em; margin-right: -0.35em; padding-left: 0; color: #f3e6c8; background: none; filter: none; -webkit-background-clip: border-box; background-clip: border-box; margin-bottom: 6px; }
#vip .scroll-body > .result-name.fz-title { font-size: 30px; letter-spacing: 0.35em; padding-left: 0; color: #f3e6c8; background: none; filter: none; }
#trib-title.fz-title { letter-spacing: 0.14em; margin-right: -0.14em; }
@media (max-width: 420px) { .scroll-body > .result-name.fz-title, #vip .scroll-body > .result-name.fz-title { font-size: 26px; } }
@media (max-width: 380px) {
  .scroll-body > .result-name.fz-title, #vip .scroll-body > .result-name.fz-title { font-size: 22px; letter-spacing: 0.22em; margin-right: -0.22em; gap: 8px; }
  #trib-title.fz-title { font-size: 21px; letter-spacing: 0.06em; margin-right: -0.06em; }
}
@media (max-width: 380px) {
  .scroll-body > .result-name.fz-title::before, .scroll-body > .result-name.fz-title::after { width: 36px; }
  #trib-title.fz-title::before, #trib-title.fz-title::after { width: 20px; }
}

/* 視窗會依開啟順序往上疊，提示訊息永遠在最上層 */
.toast { z-index: 100000; }

/* ── 典籍書架：書冊直立，墨色高度＝收得進度，紅點＝有獎勵可領 ── */
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 14px 10px 0; border-radius: 8px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) calc(100% - 12px), #4a3622 calc(100% - 12px), #2e2115); box-shadow: inset 0 -2px 0 #1a120b; }
@media (max-width: 420px) { .shelf { grid-template-columns: repeat(3, 1fr); row-gap: 22px; background: none; padding: 6px 4px 0; } .shelf-book { box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06), 0 10px 0 -4px #3b2c1c, 0 6px 10px rgba(0, 0, 0, 0.5); } }
.shelf-book { position: relative; height: 158px; margin-bottom: 12px; padding: 10px 0 0 8px; border: none; border-radius: 3px 7px 7px 3px; display: flex; flex-direction: column; align-items: center; cursor: pointer; overflow: hidden; font: inherit; color: var(--text); background: linear-gradient(90deg, var(--sp) 0 9px, var(--cv) 9px); box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06), 0 4px 8px rgba(0, 0, 0, 0.5); transition: transform 0.15s, box-shadow 0.15s; }
.shelf-book::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; border-left: 1px dashed rgba(233, 223, 200, 0.3); }
.shelf-book:hover { transform: translateY(-3px); box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06), 0 8px 14px rgba(0, 0, 0, 0.6); }
.shelf-book.c0 { --sp: #182433; --cv: #22344a; }
.shelf-book.c1 { --sp: #331b19; --cv: #4a2623; }
.shelf-book.c2 { --sp: #1f2e1c; --cv: #2b4227; }
.shelf-book.c3 { --sp: #2a1d33; --cv: #3b2a4a; }
.shelf-book.c4 { --sp: #332a17; --cv: #4a3b20; }
.shelf-slip { position: relative; z-index: 1; writing-mode: vertical-rl; padding: 8px 3px; background: #e6d8b8; color: #2a2016; font-weight: 700; font-size: 15px; letter-spacing: 0.12em; box-shadow: inset 0 0 0 1px #b39b6b, 1px 2px 3px rgba(0, 0, 0, 0.4); }
.shelf-ink { position: absolute; left: 9px; right: 0; bottom: 0; background: linear-gradient(180deg, rgba(240, 212, 138, 0.38), rgba(240, 212, 138, 0.12)); border-top: 1px solid rgba(240, 212, 138, 0.75); transition: height 0.5s; }
.shelf-num { position: absolute; left: 9px; right: 0; bottom: 6px; z-index: 1; text-align: center; font-size: 12.5px; font-weight: 700; font-family: var(--font); text-shadow: 0 1px 2px #000; }
.shelf-dot { position: absolute; top: 6px; right: 6px; z-index: 2; width: 10px; height: 10px; border-radius: 50%; background: #e0453a; box-shadow: 0 0 7px rgba(224, 69, 58, 0.9); animation: guide-breathe 1.4s ease-in-out infinite alternate; }
.shelf-seal { position: absolute; right: 4px; bottom: 26px; z-index: 2; padding: 1px 3px; font-size: 10px; font-weight: 700; color: #f6ecd6; background: rgba(192, 70, 58, 0.92); border-radius: 2px; transform: rotate(-8deg); box-shadow: inset 0 0 0 1px rgba(246, 236, 214, 0.4); }
.shelf-book.complete { box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(240, 212, 138, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5); }
.shelf-tip { margin: 4px 0 10px; }

/* 典籍詳情視窗 */
.bookpop-scroll .scroll-body { max-height: min(72vh, 680px); overflow-y: auto; }
.bp-desc { margin: 0 0 10px; text-align: center; font-size: 13px; color: var(--text-soft); }
.bp-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bp-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(233, 223, 200, 0.1); overflow: hidden; }
.bp-bar div { height: 100%; background: linear-gradient(90deg, #8a6a32, #f0d48a); }
.bp-count { font-size: 15px; font-weight: 700; white-space: nowrap; }
.bp-tiles { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
.bp-tile { padding: 7px 4px; border-radius: 5px; text-align: center; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.2); color: inherit; font: inherit; }
.bp-tile small { display: block; font-size: 11.5px; color: var(--text-soft); }
.bp-tile b { font-size: 13px; color: #e6c98a; }
.bp-tile.got { border-color: rgba(127, 209, 194, 0.45); }
.bp-tile.got b { color: #8fe0c8; }
button.bp-tile.can { cursor: pointer; border-color: #e07a6c; background: radial-gradient(circle at 35% 30%, rgba(201, 80, 63, 0.95), rgba(142, 42, 32, 0.95)); box-shadow: 0 0 10px rgba(192, 70, 58, 0.45); }
button.bp-tile.can small, button.bp-tile.can b { color: #fff; }
.bp-reward { margin: 8px 0 12px; text-align: center; font-size: 12px; color: var(--text-soft); }
.bp-sub { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; font-size: 13px; color: #d8b56a; letter-spacing: 0.3em; }
.bp-sub::before, .bp-sub::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(216, 181, 106, 0.5), transparent); }
@media (max-width: 380px) { .bookpop-scroll .book-grid { grid-template-columns: repeat(4, 1fr); } }
/* 仙緣閣標題：拿掉舊的點狀裝飾，改回與其他視窗相同的兩側金線，標題置中 */
#vip .scroll-body > .result-name.fz-title::after { display: block; width: 40px; height: 1px; margin: 0 0 0 -0.35em; background: linear-gradient(90deg, transparent, #d8b56a); transform: scaleX(-1); }
@media (max-width: 380px) { #vip .scroll-body > .result-name.fz-title::after { width: 36px; margin-left: -0.22em; } }
/* 典籍十五本：每排五本（手機也是），十五種封面色 */
.shelf-book.c5 { --sp: #1a2e2e; --cv: #244242; }
.shelf-book.c6 { --sp: #33201a; --cv: #4a2f22; }
.shelf-book.c7 { --sp: #202233; --cv: #2d304a; }
.shelf-book.c8 { --sp: #2e1a26; --cv: #452638; }
.shelf-book.c9 { --sp: #262a1a; --cv: #383d24; }
@media (max-width: 420px) {
  .shelf { grid-template-columns: repeat(5, 1fr); gap: 7px; row-gap: 20px; padding: 6px 2px 0; }
  .shelf-book { height: 138px; padding-left: 7px; }
  .shelf-slip { font-size: 13px; padding: 6px 2px; letter-spacing: 0.06em; }
  .shelf-num { font-size: 11px; }
  .shelf-ink, .shelf-num { left: 7px; }
}
/* 每一排書下面各有一條木板：書高 --bh、板厚 12px、排距 14px */
.shelf { --bh: 158px; row-gap: 14px; padding: 14px 10px 0; box-shadow: none; background: repeating-linear-gradient(180deg, transparent 0 var(--bh), #4a3622 var(--bh) calc(var(--bh) + 10px), #2e2115 calc(var(--bh) + 10px) calc(var(--bh) + 12px), transparent calc(var(--bh) + 12px) calc(var(--bh) + 26px)) 0 14px / 100% calc(var(--bh) + 26px) repeat-y; }
.shelf-book { height: var(--bh); margin-bottom: 12px; box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06), 0 4px 8px rgba(0, 0, 0, 0.5); }
@media (max-width: 420px) {
  .shelf { --bh: 138px; padding: 10px 4px 0; row-gap: 14px; background-position: 0 10px; }
  .shelf-book { height: var(--bh); }
}
.shelf-book.c10 { --sp: #2f2a1c; --cv: #463e26; }
.shelf-book.c11 { --sp: #1b2a24; --cv: #263d34; }
.shelf-book.c12 { --sp: #2f1c1c; --cv: #462828; }
.shelf-book.c13 { --sp: #1c2733; --cv: #29384a; }
.shelf-book.c14 { --sp: #2a2230; --cv: #3d3046; }
/* 第 16～20 部典籍 */
.shelf-book.c15 { --sp: #31241a; --cv: #4a3626; }
.shelf-book.c16 { --sp: #1a2a30; --cv: #253e47; }
.shelf-book.c17 { --sp: #2b1f2d; --cv: #412e44; }
.shelf-book.c18 { --sp: #232b1b; --cv: #354228; }
.shelf-book.c19 { --sp: #33261c; --cv: #4d3a2a; }
/* 道庫篩選：按鈕縮窄，一般手機寬度一次放得下；放不下時可滑動或用滑鼠拖動 */
.inv-filter { gap: 4px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; }
.inv-filter.dragging { cursor: grabbing; }
.inv-filter.dragging .inv-f { pointer-events: none; }
.inv-f { padding: 4px 10px; }
@media (max-width: 480px) { .inv-f { padding: 4px 5px; font-size: 12px; } .inv-filter { gap: 3px; } }
.inv-filter { -webkit-mask-image: none; mask-image: none; padding-right: 0; }
.inv-filter.more { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
/* 好友分享：只佔一列，造物只顯示名稱，多了就左右滑動（滑鼠可拖動），標題後顯示件數 */
.shared-count { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: 4px; padding: 0 4px; border-radius: 9px; font-size: 11px; font-weight: 700; color: #1b1812; background: #d8b56a; vertical-align: 1px; }
.shared-count:empty { display: none; }
.shared-list { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-x pan-y; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
.shared-list.more { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 18px; }
.shared-list.dragging { cursor: grabbing; }
.shared-list.dragging .chip { pointer-events: none; }
.shared-list .chip { padding: 2px 9px 2px 4px; }
.shared-list .chip.locked { opacity: 0.5; }
@media (max-width: 340px) { header.top .mail-btn { width: 28px; height: 26px; } header.top .brand { gap: 4px; } }

/* 造物介紹（說明＋典故合併成一段）：左側朱紅細線框，首行縮排、兩端對齊、行距放寬 */
#detail-desc, #result-desc { margin: 12px 0 16px; padding: 12px 14px 12px 16px; border-left: 3px solid var(--cinnabar); border-radius: 0 6px 6px 0; background: linear-gradient(90deg, rgba(192, 70, 58, 0.09), rgba(233, 223, 200, 0.035) 45%); text-align: justify; text-indent: 2em; font-size: 15.5px; line-height: 1.9; letter-spacing: 0.03em; color: #e3d8c0; }
#detail-desc:empty, #result-desc:empty { display: none; }
@media (max-width: 380px) { #detail-desc, #result-desc { font-size: 14.5px; padding: 10px 12px 10px 14px; } }
/* 道友視窗：每位好友的分享只佔一列，多了左右滑動 */
.fr-friend .fr-shares { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 2px 0 0; }
.fr-friend .fr-shares::-webkit-scrollbar { display: none; }
.fr-friend .fr-shares .chip { flex: none; }

/* 太極推演特效不被切掉或蓋住：悟道台疊在搜尋列之上；外圈縮到捲動區內放得下，頂端留一點空間 */
#tab-forge { padding-top: 10px; }
.forge-stage { position: relative; z-index: 3; }
.tj-fx .orbit { inset: -8px; }
.tj-fx .flash { inset: -10px; }
@keyframes tj-ring { 0% { transform: scale(0.8); opacity: 0.9; } 100% { transform: scale(1.4); opacity: 0; } }
@keyframes tj-flash { 0% { opacity: 0; transform: scale(0.6); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.25); } }

/* ── 太極推演特效層（最上層、不被捲動區切掉）：光環外擴、光點環繞、按下金光一閃，恢復原本大小 ── */
.tj-fx-layer { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 9; pointer-events: none; }
.tj-fx-layer[hidden] { display: none; }
.tj-fx-layer .tj-fx { left: 0; top: 0; width: var(--fx, 96px); height: var(--fx, 96px); transform: translate(-50%, -50%); }
.tj-fx-layer .tj-fx .orbit { inset: -14px; }
.tj-fx-layer .tj-fx .flash { inset: -24px; }
.tj-fx-layer.brewing .tj-fx i { animation: tj-ring2 1.5s ease-out infinite; }
.tj-fx-layer.brewing .tj-fx .r2 { animation-delay: 0.5s; }
.tj-fx-layer.brewing .tj-fx .r3 { animation-delay: 1s; }
.tj-fx-layer.brewing .tj-fx .orbit { opacity: 1; animation: spin 3s linear infinite reverse; filter: drop-shadow(0 0 4px rgba(255, 210, 150, 0.9)); }
.tj-fx-layer.burst .tj-fx .flash { animation: tj-flash2 0.7s ease-out; }
@keyframes tj-ring2 { 0% { transform: scale(0.75); opacity: 0.9; } 100% { transform: scale(1.75); opacity: 0; } }
@keyframes tj-flash2 { 0% { opacity: 0; transform: scale(0.5); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .tj-fx-layer .tj-fx i, .tj-fx-layer .tj-fx b { animation: none !important; } }
/* 太極本身的光暈收小一點，頂端留的空間就夠用 */
.forge-stage.brewing .taiji-act .taiji { filter: drop-shadow(0 0 9px rgba(255, 210, 150, 0.85)); }

/* ── 結果卷軸：創世／首悟（金線大標題＋小字，圖示後旋轉光芒，創世朱紅、首悟玉青） ── */
.kind.hero { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; margin: -4px 0 2px; letter-spacing: 0; }
.kind.hero.found { --hc: #e0786b; --ray: #f0a07a; }
.kind.hero.first { --hc: #8fe0c8; --ray: #9fe6d2; }
.kind-title { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: "Kaisei Tokumin", var(--font); font-weight: 800; font-size: 26px; line-height: 1.3; letter-spacing: 0.5em; margin-right: -0.5em; color: var(--hc); text-shadow: 0 0 14px color-mix(in srgb, var(--hc) 55%, transparent); }
.kind-title::before, .kind-title::after { content: ""; width: 46px; height: 1px; flex: none; background: linear-gradient(90deg, transparent, var(--hc)); }
.kind-title::after { transform: scaleX(-1); margin-left: -0.5em; }
.kind-sub { font-size: 12.5px; letter-spacing: 0.3em; margin-right: -0.3em; color: var(--text-soft); font-weight: 400; }
@media (max-width: 380px) { .kind-title { font-size: 23px; letter-spacing: 0.4em; margin-right: -0.4em; } .kind-title::before, .kind-title::after { width: 32px; } }
.result-scroll.hero-found { --ray: #f0a07a; }
.result-scroll.hero-first { --ray: #9fe6d2; }
.result-scroll.hero-found .big-emoji, .result-scroll.hero-first .big-emoji { position: relative; isolation: isolate; margin: 10px 0 8px; }
.result-scroll.hero-found .big-emoji::before, .result-scroll.hero-first .big-emoji::before { content: ""; position: absolute; left: 50%; top: 50%; width: 230px; height: 230px; margin: -115px 0 0 -115px; z-index: -1; border-radius: 50%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--ray) 34%, transparent) 0 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 66%); mask-image: radial-gradient(circle, #000 18%, transparent 66%); animation: spin 40s linear infinite; pointer-events: none; }
.result-scroll.hero-found .big-emoji::after, .result-scroll.hero-first .big-emoji::after { content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--ray) 30%, transparent), transparent 70%); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .result-scroll .big-emoji::before { animation: none; } }

/* ── 結果卷軸外框：依品階 ── */
.result-scroll { overflow: visible; }
.tier-frame { position: absolute; inset: 6px; border-radius: 4px; pointer-events: none; z-index: 0; }
.result-scroll[data-tier="2"] { --tc: #7cc48a; }
.result-scroll[data-tier="3"] { --tc: #6fd0c4; }
.result-scroll[data-tier="4"] { --tc: #79a9e6; }
.result-scroll[data-tier="5"] { --tc: #b48ae8; }
.result-scroll[data-tier="6"] { --tc: #d9a45a; }
.result-scroll[data-tier="7"] { --tc: #f0cc5a; }
.result-scroll[data-tier="8"] { --tc: #ff9a5a; }
.result-scroll[data-tier="9"] { --tc: #a8f5dc; }
.result-scroll[data-tier="10"] { --tc: #ff8a4a; }
.result-scroll[data-tier="11"] { --tc: #f0d48a; }
/* 精品、靈品、寶品：品階色細邊 */
.result-scroll:is([data-tier="2"], [data-tier="3"], [data-tier="4"]) .tier-frame { border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent); }
/* 玄品、地品、天品：細邊＋柔光 */
.result-scroll:is([data-tier="5"], [data-tier="6"], [data-tier="7"]) .tier-frame { border: 1px solid color-mix(in srgb, var(--tc) 70%, transparent); box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 35%, transparent), inset 0 0 18px color-mix(in srgb, var(--tc) 14%, transparent); }
/* 聖品以上：細邊＋柔光＋沿著邊緣流動的光（神品、道品更亮） */
@property --tf-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.result-scroll:is([data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame { border: 1px solid color-mix(in srgb, var(--tc) 75%, transparent); box-shadow: 0 0 20px color-mix(in srgb, var(--tc) 45%, transparent), inset 0 0 22px color-mix(in srgb, var(--tc) 18%, transparent); }
.result-scroll:is([data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--tf-a), transparent 0 62%, color-mix(in srgb, var(--tc) 80%, transparent) 78%, #fff8e0 84%, color-mix(in srgb, var(--tc) 80%, transparent) 90%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: tf-spin 4s linear infinite; }
.result-scroll:is([data-tier="10"], [data-tier="11"]) .tier-frame { box-shadow: 0 0 28px color-mix(in srgb, var(--tc) 55%, transparent), inset 0 0 26px color-mix(in srgb, var(--tc) 22%, transparent); }
.result-scroll:is([data-tier="10"], [data-tier="11"]) .tier-frame::before { padding: 3px; animation-duration: 2.6s; }
@keyframes tf-spin { to { --tf-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .tier-frame::before { animation: none !important; } }
.result-scroll > .scroll-body { position: relative; z-index: 1; }
.result-scroll > .stamp { z-index: 2; }
/* 品階外框加強：細邊更清楚、柔光更明顯 */
.result-scroll:is([data-tier="2"], [data-tier="3"], [data-tier="4"]) .tier-frame { border: 1.5px solid color-mix(in srgb, var(--tc) 80%, transparent); box-shadow: inset 0 0 10px color-mix(in srgb, var(--tc) 12%, transparent); }
.result-scroll:is([data-tier="5"], [data-tier="6"], [data-tier="7"]) .tier-frame { border: 1.5px solid var(--tc); box-shadow: 0 0 22px color-mix(in srgb, var(--tc) 50%, transparent), inset 0 0 24px color-mix(in srgb, var(--tc) 20%, transparent); }
.result-scroll:is([data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame { border: 1.5px solid var(--tc); }

/* ── 結果卷軸外框：十二品階都有，品階越高越華麗（取代上面較早的外框規則） ── */
.result-scroll[data-tier="0"] { --tc: #a89e8c; }
.result-scroll[data-tier="1"] { --tc: #ffffff; }
.result-scroll[data-tier=""] .tier-frame, .result-scroll:not([data-tier]) .tier-frame { display: none; }
.result-scroll[data-tier] .tier-frame { --cs: 14px; border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); box-shadow: none; background: none; animation: none; }
.result-scroll[data-tier] .tier-frame::before, .result-scroll[data-tier] .tier-frame::after { content: none; }
/* 凡品：灰色細邊 */
/* 良品：米白細邊 */
.result-scroll[data-tier="1"] .tier-frame { border-color: color-mix(in srgb, var(--tc) 60%, transparent); }
/* 精品：加粗 */
.result-scroll[data-tier="2"] .tier-frame { border: 1.5px solid color-mix(in srgb, var(--tc) 80%, transparent); }
/* 靈品：加內光 */
.result-scroll[data-tier="3"] .tier-frame { border: 1.5px solid color-mix(in srgb, var(--tc) 85%, transparent); box-shadow: inset 0 0 14px color-mix(in srgb, var(--tc) 20%, transparent); }
/* 寶品起：雙線框 */
.result-scroll:is([data-tier="4"], [data-tier="5"], [data-tier="6"], [data-tier="7"], [data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame { border: 1.5px solid var(--tc); box-shadow: inset 0 0 16px color-mix(in srgb, var(--tc) 18%, transparent); }
.result-scroll:is([data-tier="4"], [data-tier="5"], [data-tier="6"], [data-tier="7"], [data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame::after { content: ""; position: absolute; inset: 4px; border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); border-radius: 2px; pointer-events: none; }
/* 玄品起：外光 */
.result-scroll:is([data-tier="5"], [data-tier="6"], [data-tier="7"], [data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame { box-shadow: 0 0 18px color-mix(in srgb, var(--tc) 40%, transparent), inset 0 0 18px color-mix(in srgb, var(--tc) 18%, transparent); }
/* 地品起：四角金飾 */
.result-scroll:is([data-tier="6"], [data-tier="7"], [data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame {
  background:
    linear-gradient(var(--tc), var(--tc)) 0 0 / var(--cs) 3px, linear-gradient(var(--tc), var(--tc)) 0 0 / 3px var(--cs),
    linear-gradient(var(--tc), var(--tc)) 100% 0 / var(--cs) 3px, linear-gradient(var(--tc), var(--tc)) 100% 0 / 3px var(--cs),
    linear-gradient(var(--tc), var(--tc)) 0 100% / var(--cs) 3px, linear-gradient(var(--tc), var(--tc)) 0 100% / 3px var(--cs),
    linear-gradient(var(--tc), var(--tc)) 100% 100% / var(--cs) 3px, linear-gradient(var(--tc), var(--tc)) 100% 100% / 3px var(--cs);
  background-repeat: no-repeat;
  background-origin: border-box;
}
/* 天品起：光暈呼吸 */
@keyframes tf-pulse { 0%, 100% { box-shadow: 0 0 16px color-mix(in srgb, var(--tc) 35%, transparent), inset 0 0 16px color-mix(in srgb, var(--tc) 15%, transparent); } 50% { box-shadow: 0 0 30px color-mix(in srgb, var(--tc) 60%, transparent), inset 0 0 26px color-mix(in srgb, var(--tc) 26%, transparent); } }
.result-scroll:is([data-tier="7"], [data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame { animation: tf-pulse 3s ease-in-out infinite; }
/* 聖品起：沿邊流光（用 ::before，雙線框的內線改由 box-shadow 呈現） */
.result-scroll:is([data-tier="8"], [data-tier="9"], [data-tier="10"], [data-tier="11"]) .tier-frame::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--tf-a), transparent 0 62%, color-mix(in srgb, var(--tc) 85%, transparent) 78%, #fff8e0 84%, color-mix(in srgb, var(--tc) 85%, transparent) 90%, transparent 100%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: tf-spin 4.5s linear infinite; pointer-events: none; }
/* 仙品：流光更快更亮 */
.result-scroll[data-tier="9"] .tier-frame::before { padding: 2.5px; animation-duration: 3.4s; }
/* 神品、道品：兩道流光對稱繞行、更強光暈、角飾加大 */
.result-scroll:is([data-tier="10"], [data-tier="11"]) .tier-frame { --cs: 18px; animation: tf-pulse 2.4s ease-in-out infinite; }
.result-scroll:is([data-tier="10"], [data-tier="11"]) .tier-frame::before { padding: 3px; background: conic-gradient(from var(--tf-a), transparent 0 12%, color-mix(in srgb, var(--tc) 85%, transparent) 20%, #fffbe8 25%, color-mix(in srgb, var(--tc) 85%, transparent) 30%, transparent 38% 62%, color-mix(in srgb, var(--tc) 85%, transparent) 70%, #fffbe8 75%, color-mix(in srgb, var(--tc) 85%, transparent) 80%, transparent 88%); animation-duration: 3s; }
.result-scroll[data-tier="11"] .tier-frame::before { padding: 3.5px; animation-duration: 2.4s; }
.result-scroll[data-tier="11"] .tier-frame { --cs: 22px; }
@media (prefers-reduced-motion: reduce) { .result-scroll .tier-frame, .result-scroll .tier-frame::before { animation: none !important; } }
/* 種類文字一律置中（左右各留印章寬度）；有所悟為低調的金線小標題 */
.kind:not(.hero) { padding: 0 60px; text-align: center; }
.kind.k-known { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0; margin: -2px 0 4px; font-size: 16px; letter-spacing: 0.4em; color: #cbbf9f; }
.kind.k-known::before, .kind.k-known::after { content: ""; width: 30px; height: 1px; flex: none; background: linear-gradient(90deg, transparent, rgba(216, 181, 106, 0.6)); }
.kind.k-known::after { transform: scaleX(-1); margin-left: -0.4em; }

/* 複查修正：大標題只靠 ::after 抵銷字距（不再整體右偏）；光芒在文字後面；窄螢幕失敗類文字不被擠成多行 */
.kind-title { margin-right: 0; }
@media (max-width: 380px) { .kind-title { margin-right: 0; } .kind-title::after { margin-left: -0.4em; } }
.result-scroll:is(.hero-found, .hero-first) :is(.kind, .result-name, .meta) { position: relative; z-index: 1; }
@media (max-width: 400px) { .kind:not(.hero) { padding: 0 56px 0 16px; } .kind.k-known { padding: 0; } }

/* 典籍視窗：十個階段格（五欄兩排）＋整排的收齊稱號格 */
.bp-tiles.bp-tiles-10 { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.bp-tiles-10 .bp-tile { padding: 5px 2px; }
.bp-tiles-10 .bp-tile small { font-size: 11px; }
.bp-tiles-10 .bp-tile b { font-size: 12px; white-space: nowrap; }
.bp-tiles-10 .bp-tile.wide { grid-column: 1 / -1; padding: 7px 4px; }
.bp-tiles-10 .bp-tile.wide small { font-size: 11.5px; }
.bp-tiles-10 .bp-tile.wide b { font-size: 13px; }

/* 典籍：已達門檻但條目尚待天道判定 */
.bp-tile.wait { opacity: 0.85; border-style: dashed; }
.bp-tile.wait b { color: var(--text-soft); font-weight: 600; }
.bp-note { margin: -2px 0 8px; font-size: 12px; color: var(--text-soft); text-align: center; }

/* ── 各機型排版修正 ── */
/* 觸控裝置：不用自訂的寬捲動條、也不預留捲動條空間（手機的捲動條浮在內容上），左右邊距才會對稱，關閉鈕也不會壓到捲動條 */
@media (hover: none), (pointer: coarse) {
  ::-webkit-scrollbar { width: 0; height: 0; }
  * { scrollbar-width: none; }
  .scroll-body { scrollbar-gutter: auto; }
  .chip:hover, .bg-card:hover, .shelf-book:hover { transform: none; }
}
/* 段落一般換行：Safari 的 pretty／balance 會把每行縮短，在滿版的框裡右邊空一大塊 */
p, li, .desc, .muted, .pack-desc, .quest-desc, .item-detail-desc, .notice-text, .fr-wait, .fr-rules p, .ref-v, .rule-v > div, .fr-v, .fr-note,
.creations-summary p, .item-hint, #look-dye-note, #look-bubble-note, .ref-card p.muted, .fr-empty, .lock-note { text-wrap: wrap; }
/* 登入標題圖：留在卷軸紙面框線內 */
.login-scroll .brand-logo { padding: 0 14px; box-sizing: border-box; }
/* 典籍視窗的十個階段格：跟著寬度縮小，不撐出視窗 */
.bp-tiles.bp-tiles-10 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bp-tiles-10 .bp-tile { min-width: 0; }
@media (max-width: 380px) {
  .bp-tiles-10 .bp-tile small { font-size: 10px; letter-spacing: 0; }
  .bp-tiles-10 .bp-tile b { font-size: 11px; letter-spacing: 0; }
}
/* 功課卡片：不透出底下的數字 */
.quest-pop { background: linear-gradient(180deg, #241f18, #14110d); }
/* 商城物品名稱：兩行時平均斷開 */
.shop-cell .item-name:not(.price) { text-wrap: balance; }
/* 勾選框配合主色 */
input[type="checkbox"] { accent-color: #c9a55e; }
/* 畫面背景、置入格樣式、典籍視窗：手機打橫時依旋轉後的高度計算（通用的捲動區高度規則權重較高，要另外指定） */
html.force-portrait .bgpick-scroll .scroll-body { max-height: min(calc(var(--fp-w, 100vw) - 190px), 560px); }
html.force-portrait .bookpop-scroll .scroll-body { max-height: min(calc(var(--fp-w, 100vw) * 0.72), 680px); }
/* 矮螢幕（iPhone SE 等）：畫面背景、置入格樣式的清單留更多高度，預覽縮小 */
@media (max-height: 640px) {
  .bgpick-scroll .scroll-body { max-height: calc(100vh - 190px); }
  .sk-preview { min-height: 84px; gap: 20px; margin: 0; padding: 2px 0; }
}
/* 320 寬（iPhone SE 第一代、手機打橫）：數值、篩選、分頁、禮包標題縮小，放得下一行 */
@media (max-width: 350px) {
  .status .st-v, .status .st-v b, .status .st-v span { font-size: 13.5px !important; }
  .inv-f { padding: 4px 4px; font-size: 12px; }
  .inv-filter { gap: 3px; }
  /* 篩選的「我的創世」「我的大道」縮成「創世」「大道」 */
  .inv-f .f-pre { display: none; }
  .shop-tabs .subtab { letter-spacing: 0; font-size: 12.5px; padding: 6px 1px; }
}
@media (max-width: 360px) {
  .pk-title { font-size: 18px; letter-spacing: 0.04em; right: 100px; }
  .pk-art-wrap { width: 104px; height: 80px; }
}
/* 境界一覽：✦ 標記不佔標籤寬度，境界名稱以節點位置置中，不會貼到節點圓圈 */
.fz-label.has-unlock::after { position: absolute; left: calc(100% - 3px); top: 50%; transform: translateY(-60%); margin-left: 0; vertical-align: 0; }
/* iPhone Safari 的 100vh 是收起工具列後的高度，工具列出現時視窗底部會被擋住：改用可見高度 dvh */
.scroll-body { max-height: calc(100vh - 106px); max-height: calc(100dvh - 106px); }
@supports (height: 100dvh) {
  .bgpick-scroll .scroll-body { max-height: min(58dvh, 560px); }
  .bookpop-scroll .scroll-body { max-height: min(72dvh, 680px); }
}
@media (max-height: 640px) {
  @supports (height: 100dvh) { .bgpick-scroll .scroll-body { max-height: calc(100dvh - 190px); } }
}
/* 仙緣閣：各分頁視窗同高，切換分頁時不跳動 */
#vip .scroll-body { height: min(calc(100vh - 106px), 860px); height: min(calc(100dvh - 106px), 860px); }
html.force-portrait #vip .scroll-body { height: min(calc(var(--fp-w, 100vw) - 106px), 860px); }
/* 登入標題圖：flex 項目可縮小，才會跟著紙面寬度縮 */
.login-title .brand-logo { min-width: 0; max-width: 100%; }
/* 境界一覽：左半邊的標籤把 ✦ 放在外側（左邊），不壓到節點 */
.fz-label.fz-left.has-unlock::after { left: auto; right: calc(100% - 3px); }
/* 窄螢幕：商城分頁與物品名稱 */
@media (max-width: 380px) {
  .shop-tabs .subtab { font-size: 13px; letter-spacing: 0; }
}
@media (max-width: 360px) {
  .shop-cell .item-name:not(.price) { font-size: 10.5px; }
}
@media (max-width: 350px) { .shop-tabs .subtab { font-size: 12.5px; } }
/* 結果卷軸：小標題左右等寬留白（真正置中）；矮螢幕排得緊湊，主要按鈕不必捲動就看得到 */
@media (max-width: 400px) { .kind:not(.hero) { padding: 0 52px; } .kind.k-known { padding: 0; } }
@media (max-width: 360px) { .kind:not(.hero) { padding: 0 48px; letter-spacing: 0.08em; } }
@media (max-height: 700px) {
  .result-scroll .scroll-body { padding-top: 20px; padding-bottom: 18px; }
  .result-scroll .big-emoji { font-size: 48px; margin: 0; }
  .result-scroll.hero-found .big-emoji, .result-scroll.hero-first .big-emoji { margin: 4px 0; }
  .result-scroll .result-name { font-size: 24px; line-height: 1.25; }
  .result-scroll .desc { margin-top: 8px; margin-bottom: 8px; }
}

/* 自己開創的大道：金色「道」字印；上架中的造物淡化 */
.chip .unique-mark { background: linear-gradient(135deg, #e6c98a, #b8893a); color: #1b140c; font-weight: 700; }
.chip.unique { border-color: rgba(216, 181, 106, 0.75); }
.chip.listed { opacity: 0.45; border-style: dashed; }
.unique-note { margin: 6px 0 2px; padding: 6px 10px; border: 1px solid rgba(216, 181, 106, 0.55); border-radius: 6px; background: rgba(216, 181, 106, 0.08); color: #e6c98a; font-size: 13px; line-height: 1.6; }

/* 大道：配方清單的「大道」印、收益表 */
.seal.alt-seal { background: rgba(29, 158, 117, 0.18); border-color: rgba(93, 202, 165, 0.6); color: #9fe1cb; }
.branch-earned { color: #9fe1cb; }
.grade-note { margin: 6px 0 2px; text-align: center; line-height: 1.6; }
.ticket-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 8px; font-size: 13px; color: #e6c98a; cursor: pointer; user-select: none; }
.ticket-toggle[hidden] { display: none; }
.ticket-toggle input { accent-color: #d8b56a; }
#bounty-grade { max-width: 8em; }
