/* ============================================================
   PoE Stash Pro — 暗色主題樣式
   靈感取自 PoE 遊戲 UI 風格
   ============================================================ */

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font-numeric: "Roboto", "Segoe UI", sans-serif;
  --bg-dark: #1a1a1a;
  --bg-card: #242424;
  --bg-input: #1e1e1e;
  --border: #3a3a3a;
  --border-gold: #888;
  --text: #e8e8e8;
  --text-muted: #999;
  --gold: #e8e8e8;
  --gold-hover: #fff;
  --red: #e05555;
  --green: #55c855;
  --accent: #7c8aff;

  /* PoE 稀有度顏色 */
  --rarity-normal: #ccc;
  --rarity-magic: #8888ff;
  --rarity-rare: #ffff77;
  --rarity-unique: #af6025;
  --rarity-gem: #1ba29b;
  --rarity-currency: #ccc;
  --rarity-divcard: #0ebaff;
  --rarity-quest: #4ae63a;
}

body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 1rem; /* 跟隨 html.font-large 的縮放 */
  background-color: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   公告列
   ============================================================ */
#announcement-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: #3a2a00;
  border-bottom: 1px solid #7c6000;
  color: #ffd966;
  font-size: 0.9rem;
  text-align: center;
}

#announcement-bar #btn-announcement-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #ffd966;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.7;
  padding: 0 4px;
  line-height: 1;
}

#announcement-bar #btn-announcement-dismiss:hover {
  opacity: 1;
}

/* ============================================================
   頂部導覽列
   ============================================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Logo 區塊 */
.top-bar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.top-bar-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.top-bar-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

/* 導覽連結 */
.top-bar-nav {
  display: flex;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 1.125rem;
  font-weight: 500;
  padding: 6px 18px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.04em;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* 帳號區塊 */
.top-bar-account {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* 遊戲版本切換器（segmented control，置於經濟頁 header 右側） */
.game-switcher {
  display: inline-flex;
  align-items: stretch;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.game-switcher-btn {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 0 14px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-family: inherit;
}

.game-switcher-btn:hover {
  color: var(--text);
}

.game-switcher-btn[data-game="poe1"].active {
  background: linear-gradient(135deg, #15703a 0%, #34c178 50%, #15703a 100%);
  color: #fff;
  font-weight: 700;
}

.game-switcher-btn[data-game="poe2"].active {
  background: linear-gradient(135deg, #c9a34f 0%, #e8c97a 50%, #c9a34f 100%);
  color: #1a1410;
  font-weight: 700;
}

.btn-login {
  background: #333;
  color: var(--text);
  border: 1px solid #555;
  padding: 6px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-login:hover {
  background: #444;
  color: #fff;
  border-color: #777;
}

.account-name {
  color: var(--text);
  font-family: var(--font-numeric);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.account-name:hover {
  border-color: #666;
}

/* ============================================================
   頁面內容區
   ============================================================ */
.page-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.page {
  display: none;
  width: 100%;
  max-width: 520px;
}

.page.active {
  display: block;
}

/* 倉庫頁 & 經濟頁需要全寬，且靠頂部對齊 */
#page-stash,
#page-economy {
  max-width: 100%;
  align-self: flex-start;
}

/* 回饋頁靠頂部對齊 */
#page-feedback {
  max-width: 100%;
  align-self: flex-start;
}

/* 贊助頁需要較寬版面 */
#page-sponsor {
  max-width: 1000px;
}

/* ============================================================
   倉庫頁面
   ============================================================ */
.stash-layout {
  width: 100%;
  max-width: 1016px; /* 280px 快照 + 16px gap + 720px 主體 */
  margin: 0 auto;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.stash-main {
  flex: 1;
  min-width: 0;
}

/* ----- 左側欄（即時倉庫按鈕 + 快照面板） ----- */
.snapshot-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  flex-shrink: 0;
}

/* ----- 快照面板（左側） ----- */
.snapshot-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
}

.snapshot-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.snapshot-panel-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.btn-snapshot-add {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-snapshot-add:hover {
  background: rgba(124, 138, 255, 0.1);
  border-color: var(--accent);
}

.btn-snapshot-add:disabled,
.btn-snapshot-add[aria-disabled="true"] {
  color: var(--text-muted);
  border-color: var(--border);
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-snapshot-add:disabled:hover,
.btn-snapshot-add[aria-disabled="true"]:hover {
  background: none;
  border-color: var(--border);
}

.snapshot-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}

.snapshot-count.is-full {
  color: #f0a040;
}

/* 快照滿提示圖示 */
.snapshot-full-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border-radius: 50%;
  border: 1px solid #f0a040;
  color: #f0a040;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  position: relative;
  vertical-align: middle;
}

.snapshot-full-icon.visible {
  display: inline-flex;
}

.snapshot-full-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
}

.snapshot-full-icon:hover::after {
  opacity: 1;
}

.snapshot-list {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
}

.snapshot-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 24px 12px;
}

/* 快照項目 */
.snapshot-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.snapshot-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.snapshot-item.active {
  background: rgba(124, 138, 255, 0.08);
  border-color: rgba(124, 138, 255, 0.2);
}

.snapshot-chart {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.snapshot-chart-stats {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 2px;
}
.chart-stat-pos {
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chart-stat-neg {
  color: var(--red);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.chart-stat-sep { color: var(--border); font-size: 0.8rem; }

.snapshot-live-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
  user-select: none;
}

.snapshot-live-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.snapshot-live-btn.active {
  background: rgba(124, 138, 255, 0.08);
  border-color: rgba(124, 138, 255, 0.35);
  color: var(--text);
}

.snapshot-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}

.btn-snapshot-delete {
  background: none;
  border: none;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--red);
  border-radius: 4px;
  opacity: 0.45;
  transition: opacity 0.12s, background 0.12s;
  flex-shrink: 0;
}

.snapshot-item:hover .btn-snapshot-delete {
  opacity: 1;
}

.btn-snapshot-delete:hover {
  background: rgba(224, 85, 85, 0.12);
}

/* 快照已滿提示列 */
.snapshot-item-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}

.snapshot-item-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-numeric);
  font-size: 0.8125rem;
  color: #f0c050;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.snapshot-diff-time {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 400;
}

.snapshot-diff-positive {
  color: var(--green);
  font-family: var(--font-numeric);
  font-size: 0.75rem;
  font-weight: 600;
}

.snapshot-diff-negative {
  color: var(--red);
  font-family: var(--font-numeric);
  font-size: 0.75rem;
  font-weight: 600;
}

.snapshot-item-tabs {
  margin-top: 3px;
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-diff-positive {
  color: var(--green);
  font-family: var(--font-numeric);
  font-size: 0.85em;
  font-weight: 600;
}

.stat-diff-negative {
  color: var(--red);
  font-family: var(--font-numeric);
  font-size: 0.85em;
  font-weight: 600;
}

/* 快照物品差異（可折疊） */
.snapshot-item-changes {
  margin-top: 6px;
}

.snapshot-changes-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 2px 0;
  font-family: inherit;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.snapshot-changes-toggle:hover {
  color: var(--text);
}

.snapshot-changes-toggle .arrow {
  display: inline-block;
  font-size: 0.6rem;
  transition: transform 0.15s;
}

.snapshot-changes-toggle.open .arrow {
  transform: rotate(90deg);
}

.snapshot-changes-list {
  display: none;
  margin-top: 4px;
  padding-left: 4px;
  font-size: 0.68rem;
  max-height: 150px;
  overflow-y: auto;
  line-height: 1.7;
}

.snapshot-changes-list.open {
  display: block;
}

.change-added {
  color: var(--green);
}

.change-removed {
  color: var(--red);
}

/* ----- 倉庫主體 ----- */
.stash-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  min-height: 400px;
  overflow-x: auto;
}

.stash-body-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stash-body-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.stash-item-count {
  font-family: var(--font-numeric);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ----- 未登入 CTA ----- */
.empty-state-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.empty-state-cta .empty-state-btn {
  font-size: 1.05rem;
  padding: 14px 36px;
  background: linear-gradient(135deg, #c9a34f 0%, #e8c97a 50%, #c9a34f 100%);
  color: #1a1500;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(201, 163, 79, 0.35), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.2s, transform 0.15s;
}

.empty-state-cta .empty-state-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #c9a34f 0%, #e8c97a 50%, #c9a34f 100%);
  box-shadow: 0 0 32px rgba(201, 163, 79, 0.6), 0 6px 18px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

/* ----- 通貨表格 ----- */
.currency-table-wrap {
  overflow-x: auto;
}

.currency-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.currency-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.currency-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.currency-table tbody tr {
  transition: background 0.12s;
}

.currency-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.col-icon {
  width: 36px;
}

.col-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.col-name {
  min-width: 140px;
}

.col-name-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.col-name-inner > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.col-qty,
.col-price,
.col-total {
  text-align: right;
  white-space: nowrap;
  min-width: 80px;
}

.col-qty {
  color: var(--text);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.col-price {
  color: #f0c050;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.col-total {
  color: var(--text);
  font-family: var(--font-numeric);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.currency-total-row td {
  border-top: 1px solid var(--border);
  border-bottom: none;
  padding-top: 12px;
  background: rgba(240, 192, 80, 0.04);
}

.currency-total-label {
  text-align: right;
  font-family: var(--font-numeric);
  font-weight: 600;
  color: #fff;
  font-size: 0.92rem;
}

.currency-total-row .col-total {
  color: #f0c050;
  font-family: var(--font-numeric);
  font-size: 0.95rem;
}

.price-na {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.875rem;
}

.price-unit {
  font-size: 0.75em;
  color: var(--text-muted);
  margin-left: 1px;
}

.price-warn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a07830;
  font-size: 0.75rem;
  cursor: default;
  position: relative;
  vertical-align: middle;
  margin-left: 6px;
}

.price-warn-icon::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #2a2a2a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
}

.price-warn-icon:hover::after {
  opacity: 1;
}

.price-divine {
  color: #a8c4ff;
  cursor: default;
  position: relative;
}

.price-divine::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #2a2a2a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
}

.price-divine:hover::after {
  opacity: 1;
}

.economy-row-stale td {
  opacity: 0.85;
}

.row-low-volume td {
  background: rgba(0, 0, 0, 0.25);
}

.stale-badge {
  display: inline-block;
  font-size: 0.68em;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1.7;
  white-space: nowrap;
  position: relative;
  cursor: default;
}

.stale-badge::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
}

.stale-badge:hover::after {
  opacity: 1;
}

.price-warn-excluded {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ----- Sortable 表頭 ----- */
.currency-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.currency-table th.sortable:hover {
  color: #fff;
}

.currency-table th .sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7rem;
  opacity: 0.3;
}

.currency-table th.sort-active .sort-arrow {
  opacity: 1;
  color: #7c8aff;
}

/* ----- 標籤 (Tag) ----- */
.item-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s;
  vertical-align: middle;
  flex-shrink: 0;
  white-space: nowrap;
}

.item-tag:hover {
  opacity: 0.8;
}

.tag-currency {
  background: rgba(240, 192, 80, 0.15);
  color: #f0c050;
  border: 1px solid rgba(240, 192, 80, 0.25);
}

.tag-divcard {
  background: rgba(14, 186, 255, 0.12);
  color: #0ebaff;
  border: 1px solid rgba(14, 186, 255, 0.25);
}

.tag-fragment {
  background: rgba(160, 120, 255, 0.12);
  color: #a078ff;
  border: 1px solid rgba(160, 120, 255, 0.25);
}

.tag-other {
  background: rgba(255, 255, 255, 0.06);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* ----- 聯盟選擇列 ----- */
.league-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* 倉庫頁載入進度條（固定於視窗底部） */
.stash-load-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.5);
}

.stash-load-progress-inner {
  padding: 8px 24px;
  text-align: center;
}

.stash-load-progress-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  overflow: hidden;
}

.stash-load-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.stash-load-progress-text {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 600;
}

.stash-load-slowdown {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.league-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.league-input {
  flex: 1;
  max-width: 240px;
  padding: 6px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.league-input:focus {
  border-color: var(--accent);
}

.league-input option {
  background: #1e1e2e;
  color: #d4c8a8;
}

.btn-load-stash {
  padding: 6px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.btn-load-stash:hover:not(:disabled) {
  background: var(--accent-hover, #c8a44e);
}

.btn-load-stash:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 更新倉庫頁按鈕（低調） */
.btn-refresh-tabs {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn-refresh-tabs:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--text-dim);
}
.btn-refresh-tabs:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 儲存為快照按鈕（次要樣式） */
.btn-save-snapshot {
  padding: 6px 14px;
  background: transparent;
  color: #c9a34f;
  border: 1px solid #c9a34f;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn-save-snapshot:hover:not(:disabled) {
  background: rgba(201, 163, 79, 0.12);
  box-shadow: 0 0 8px rgba(201, 163, 79, 0.35);
}
.btn-save-snapshot:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 倉庫頁選擇面板 */
.stash-tab-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.stash-tab-select-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.stash-tab-select-count {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-left: auto;
}
.stash-tab-select-warn {
  font-size: 0.8rem;
  padding: 0 2px;
  margin-bottom: 6px;
  min-height: 0;
  line-height: 1.4;
}
.stash-tab-select-warn:empty {
  display: none;
}
.stash-tab-select-warn.warn-info {
  color: #ffb347;
  font-weight: 600;
  background: rgba(255, 179, 71, 0.12);
  border: 1px solid rgba(255, 179, 71, 0.4);
  border-radius: 4px;
  padding: 4px 8px;
}
.stash-tab-select-warn.warn-danger {
  color: #e57373;
  font-weight: 600;
  background: rgba(229, 115, 115, 0.12);
  border: 1px solid rgba(229, 115, 115, 0.4);
  border-radius: 4px;
  padding: 4px 8px;
}
/* ---- API 體力條 ---- */
.stamina-wrap {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 0 0 8px;
  transition: border-color 0.2s;
}
.stamina-wrap.stamina-green  { border-color: #4caf50; }
.stamina-wrap.stamina-orange { border-color: #ffb347; }
.stamina-wrap.stamina-red    { border-color: #e57373; animation: stamina-pulse 1s ease-in-out infinite; }
@keyframes stamina-pulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 0 8px 2px rgba(229,115,115,0.45); }
}
.stamina-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.8rem;
}
.stamina-label { color: var(--text-dim); }
.stamina-count { font-weight: 600; color: var(--text); }
.stamina-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}
.stamina-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.25s ease, background 0.25s ease;
}
.stamina-green  .stamina-bar { background: #4caf50; }
.stamina-orange .stamina-bar { background: #ffb347; }
.stamina-red    .stamina-bar { background: #e57373; }
.stamina-status {
  font-size: 0.76rem;
  margin-top: 5px;
  line-height: 1.3;
}
.stamina-green  .stamina-status { color: #4caf50; }
.stamina-orange .stamina-status { color: #ffb347; }
.stamina-red    .stamina-status { color: #e57373; font-weight: 600; }

.stash-tab-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.stash-tab-section-header {
  width: 100%;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 2px 0;
  margin-top: 2px;
}
.stash-tab-section-header--dim {
  color: var(--text-dim);
  margin-top: 6px;
}
.stash-tab-check {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  user-select: none;
}
.stash-tab-check:hover { border-color: var(--accent); }
.stash-tab-check--recommended {
  border-color: rgba(201,163,79,0.5);
  background: rgba(201,163,79,0.06);
}
.stash-tab-check--recommended:hover { border-color: var(--accent); }
.stash-tab-check input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
}

/* ----- 資產摘要列 ----- */
.stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  min-width: 130px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-numeric);
  font-size: 1.05rem;
  font-weight: 600;
  color: #f0c050;
  font-variant-numeric: tabular-nums;
}

.stat-value-sm {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}


.snapshot-tabs-bar {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.snapshot-tabs-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

/* ----- 篩選標籤列 ----- */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-tab {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.filter-tab:hover {
  color: var(--text);
  border-color: #555;
}

.filter-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: #555;
}

.filter-tab[data-tag="通貨"].active {
  color: #f0c050;
  background: rgba(240, 192, 80, 0.1);
  border-color: rgba(240, 192, 80, 0.3);
}

.filter-tab[data-tag="命運卡"].active {
  color: #0ebaff;
  background: rgba(14, 186, 255, 0.08);
  border-color: rgba(14, 186, 255, 0.25);
}

.filter-tab[data-tag="碎片"].active {
  color: #a078ff;
  background: rgba(160, 120, 255, 0.1);
  border-color: rgba(160, 120, 255, 0.25);
}

.filter-tab[data-tag="其他"].active {
  color: #aaa;
  background: rgba(255, 255, 255, 0.06);
  border-color: #555;
}

/* PoE 稀有度顏色 */
.rarity-normal  { color: #ddd; }
.rarity-magic   { color: #8888ff; }
.rarity-rare    { color: #ffff77; }
.rarity-unique  { color: #af6025; }
.rarity-gem     { color: #1ba29b; }
.rarity-currency { color: #ddd; }
.rarity-divcard { color: #0ebaff; }
.rarity-quest   { color: #4ae63a; }

/* ============================================================
   回饋頁
   ============================================================ */
.feedback-page {
  max-width: 520px;
  margin: 120px auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.feedback-header {
  text-align: center;
}

.feedback-icon {
  color: #5865f2;
  margin-bottom: 16px;
  line-height: 1;
}

.feedback-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: 0.05em;
}

.feedback-subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

.feedback-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  text-align: center;
  width: 100%;
}

.feedback-desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0 0 28px;
}

.feedback-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865f2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}

.feedback-discord-btn:hover {
  background: #4752c4;
  transform: translateY(-1px);
}

/* ============================================================
   帳號設定卡片
   ============================================================ */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px 40px 40px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 100%;
}

.settings-header {
  text-align: center;
  margin-bottom: 32px;
}

.settings-header .cs-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1;
}

.settings-header h2 {
  font-family: "Montserrat", "Cinzel", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 4px;
}

.settings-header .cs-subtitle {
  font-family: "Montserrat", sans-serif;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.settings-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.settings-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.settings-label-text {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.settings-label-desc {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.btn-option {
  padding: 7px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-input);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-option:not(:last-child) {
  border-right: 1px solid var(--border);
}

.btn-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-option.active {
  background: rgba(124, 138, 255, 0.15);
  color: #7c8aff;
  font-weight: 600;
}

/* ============================================================
   字體大小：大
   ============================================================ */
html.font-large {
  font-size: 120%;
}

/* ============================================================
   Coming Soon 卡片
   ============================================================ */
.coming-soon-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 52px 40px 44px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cs-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  line-height: 1;
}

.coming-soon-card h2 {
  font-family: "Montserrat", "Cinzel", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 4px;
}

.cs-subtitle {
  font-family: "Montserrat", sans-serif;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.cs-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
}

.cs-divider::before,
.cs-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cs-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #a1a1aa;
  margin-bottom: 28px;
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.cs-tag {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: #a1a1aa;
}

/* ============================================================
   Toast 訊息
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 22px;
  border-radius: 8px;
  font-size: 1rem;
  animation: slideUp 0.3s ease;
  max-width: 380px;
  word-break: break-word;
}

.toast.error {
  background: #3a1515;
  border: 1px solid #d44444;
  color: #ff8888;
}

.toast.success {
  background: #153a15;
  border: 1px solid #44d444;
  color: #88ff88;
}

.toast.info {
  background: #15253a;
  border: 1px solid #4488dd;
  color: #88bbff;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- Utility ----- */
.hidden {
  display: none !important;
}

/* ============================================================
   贊助頁 — 定價卡片
   ============================================================ */
.sponsor-page {
  max-width: 960px;
  margin: 0 auto;
}

.sponsor-header {
  text-align: center;
  margin-bottom: 36px;
}

.sponsor-header h2 {
  font-family: "Montserrat", "Cinzel", serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 8px;
}

.sponsor-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* 三欄網格 */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

/* 定價卡片 — 基底 */
.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.pricing-card:hover {
  border-color: #555;
}

/* 推薦標記 */
.pricing-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 8px 32px rgba(212, 170, 68, 0.12);
}

.pricing-card-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #0c0c0e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 16px;
  border-radius: 20px;
}

/* 卡片標頭 */
.pricing-card-header {
  text-align: center;
  margin-bottom: 24px;
}

.tier-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
  line-height: 1;
}

.tier-name {
  font-family: "Montserrat", "Noto Sans TC", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 4px;
}

.tier-price {
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* 功能列表 */
.tier-features {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.tier-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tier-features li .feature-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

.tier-features li.feature-highlight {
  color: var(--text);
}

.tier-features li.feature-neutral {
  color: var(--text-muted);
  opacity: 0.75;
}

.tier-features li.feature-locked {
  color: var(--text-muted);
  opacity: 0.5;
}

.feature-divine-only {
  font-size: 0.72rem;
  font-weight: 600;
  color: #b89aff;
  background: rgba(184, 154, 255, 0.12);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

.feature-extra {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212, 170, 68, 0.12);
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 卡片底部 */
.pricing-card-footer {
  text-align: center;
  margin-top: auto;
}

.tier-badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 20px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.btn-tier {
  width: 100%;
  padding: 10px 0;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.btn-tier:disabled {
  cursor: default;
  opacity: 0.55;
}

/* ============================================================
   差異模式 (Diff Mode)
   ============================================================ */

/* 標題列右側按鈕區 */
.stash-body-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.display-mode-select {
  appearance: none;
  background: var(--bg-input);
  border: 1px solid #555;
  border-radius: 5px;
  color: var(--text);
  font-size: 0.8rem;
  font-family: inherit;
  font-weight: 500;
  padding: 4px 22px 4px 9px;
  min-width: 88px;
  text-align: center;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23aaa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: border-color 0.15s;
}

.display-mode-select:hover,
.display-mode-select:focus {
  border-color: #888;
  outline: none;
}

.display-mode-select option {
  background: #2a2a2a;
  color: var(--text);
  text-align: center;
}

.btn-diff-mode {
  background: rgba(200, 169, 110, 0.1);
  border: 1px solid #c8a96e;
  color: #c8a96e;
  font-size: 0.75rem;
  padding: 4px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-diff-mode:hover {
  border-color: #c8a96e;
  color: var(--text);
}

.btn-diff-mode.active {
  background: rgba(200, 169, 110, 0.12);
  border-color: #c8a96e;
  color: #c8a96e;
  font-weight: 600;
}

/* 快照比較說明列 */
.diff-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  flex-wrap: wrap;
}

.diff-snap-dim {
  color: var(--text-muted);
  opacity: 0.6;
}

.diff-arrow {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.9rem;
}

.diff-sep {
  color: var(--border);
}

.diff-changed-count {
  color: var(--text-muted);
  font-style: italic;
}

/* 神聖石換算值 */
.value-divine {
  color: var(--text-muted);
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.75;
}

.diff-snap-time-diff {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* 差異表格欄位 */
.diff-table-wrap {
  overflow-x: auto;
}

.diff-table .diff-col-prev {
  color: var(--text-muted);
  opacity: 0.75;
}

.diff-table .diff-col-curr {
  color: var(--text);
}

.col-diff {
  text-align: right;
  min-width: 70px;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

/* 差異行顏色 */
.diff-row-added {
  background: rgba(84, 200, 108, 0.07) !important;
}

.diff-row-added:hover {
  background: rgba(84, 200, 108, 0.13) !important;
}

.diff-row-removed {
  background: rgba(232, 74, 79, 0.07) !important;
}

.diff-row-removed:hover {
  background: rgba(232, 74, 79, 0.13) !important;
}

.diff-row-unchanged {
  opacity: 0.35;
}

.diff-row-unchanged:hover {
  opacity: 0.65;
}

/* 差異數字顏色 */
.diff-positive {
  color: #54c86c;
  font-weight: 700;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.diff-negative {
  color: #e84a4f;
  font-weight: 700;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

/* 顯示全部 / 只顯示變動 */
.diff-show-all-wrap {
  margin-top: 10px;
  text-align: center;
}

.diff-show-all-wrap button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.diff-show-all-wrap button:hover {
  color: var(--text);
}


.btn-tier-exalted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: #555;
}

.btn-tier-exalted:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #777;
}

.btn-tier-divine {
  background: linear-gradient(135deg, rgba(212, 170, 68, 0.15), rgba(212, 170, 68, 0.05));
  color: var(--gold);
  border-color: var(--gold);
}

.btn-tier-divine:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(212, 170, 68, 0.25), rgba(212, 170, 68, 0.1));
}

/* 各級別左邊框色帶 */
.tier-exile {
  border-top: 3px solid #71717a;
}

.tier-exalted {
  border-top: 3px solid #c9b458;
}

.tier-divine {
  border-top: 3px solid var(--gold);
}

/* ============================================================
   贊助頁 — 功能比較表
   ============================================================ */
.comparison-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table thead th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 14px;
}

.comparison-table thead th.col-divine {
  color: var(--gold);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table td {
  color: var(--text-muted);
}

.comparison-table .val-positive {
  color: #4ade80;
  font-weight: 600;
}

.comparison-table .val-negative {
  color: #f87171;
  opacity: 0.7;
}

.comparison-table .val-highlight {
  color: var(--gold);
  font-weight: 600;
}

/* ============================================================
   贊助頁 — Coming Soon
   ============================================================ */
.sponsor-coming-soon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  text-align: center;
  max-width: 440px;
  margin: 80px auto;
  padding: 56px 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sponsor-coming-soon::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 2px;
  background: #c9a34f;
  border-radius: 0 0 2px 2px;
}

.coming-soon-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  margin: 0;
}

.coming-soon-divider {
  width: 28px;
  height: 1px;
  background: var(--border);
}

.coming-soon-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .snapshot-col {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .top-bar {
    padding: 0 12px;
    height: 52px;
  }

  .top-bar-title {
    display: none;
  }

  .top-bar-nav {
    position: static;
    transform: none;
    gap: 2px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  .game-switcher-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  .account-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .league-bar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .league-label {
    display: none;
  }

  .stash-layout {
    flex-direction: column;
    max-width: 100%;
  }

  .stash-main {
    width: 100%;
  }

  .snapshot-col {
    width: 100%;
  }

  .snapshot-panel {
    max-height: none;
  }

  .snapshot-list {
    max-height: 200px;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .sponsor-header h2 {
    font-size: 1.4rem;
  }

  #page-sponsor {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .coming-soon-card {
    padding: 36px 20px 32px;
  }

  .coming-soon-card h2 {
    font-size: 1.35rem;
  }

  .settings-card {
    padding: 32px 20px 28px;
  }

  .settings-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-content {
    padding: 24px 12px;
  }

  .stash-body {
    padding: 14px;
  }

  .currency-table {
    font-size: 0.82rem;
    min-width: 360px;
  }

  .col-icon img {
    width: 24px;
    height: 24px;
  }

  .pricing-card {
    padding: 24px 18px 20px;
  }

  .comparison-table-wrap {
    padding: 16px 12px;
  }
}

/* ============================================================
   Snapshot Job 進度 & Tab 選擇 Modal
   ============================================================ */

/* --- Job Progress --- */
.snapshot-job-progress {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(124, 138, 255, 0.06);
}

.job-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.job-progress-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.btn-job-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-job-cancel:hover { color: var(--red); background: rgba(224, 85, 85, 0.1); }

.job-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.job-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.job-progress-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.job-progress-text.job-paused { color: #e0a855; }
.job-progress-text.job-failed { color: var(--red); }
.job-progress-text.job-done   { color: var(--green); }

.job-failed-info {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 6px;
  line-height: 1.4;
}

.btn-job-resume {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 0;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}
.btn-job-resume:hover { background: rgba(124, 138, 255, 0.1); }

/* --- Snapshot Cooldown --- */
.snapshot-cooldown {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}

.cooldown-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Confirm Modal --- */
.confirm-card {
  width: 360px;
}
.confirm-body {
  padding: 20px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-line;
}
.confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* --- Modal Overlay --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}
.modal-overlay.hidden { display: none; }

.modal-card {
  width: 460px;
  max-width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
}
.btn-sm:hover { border-color: var(--text-muted); }

#btn-stash-tab-best {
  border-color: rgba(201, 163, 79, 0.35);
  color: #c9a34f;
}
#btn-stash-tab-best:hover {
  background: rgba(201, 163, 79, 0.1);
  border-color: #c9a34f;
  color: #e8c97a;
}

.tab-select-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tab-select-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 45vh;
  overflow-y: auto;
}

.tab-select-folder {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 4px 2px;
  margin-top: 4px;
}

.tab-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.tab-select-item:hover { background: rgba(255, 255, 255, 0.04); }

.tab-select-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tab-select-item .tab-type-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
}

.tab-select-estimate {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.tab-select-warning {
  margin-top: 6px;
  font-size: 0.78rem;
  color: #e0a855;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.btn-secondary {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-primary {
  padding: 8px 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   Economy Page
   ============================================================ */
.economy-layout {
  padding: 20px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.economy-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.economy-divine-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 6px 14px;
}

.economy-divine-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.economy-search-input {
  flex: 1;
  max-width: 320px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}
.economy-search-input:focus {
  border-color: var(--accent);
}
/* 自訂清除鈕：取代瀏覽器預設在深色底下不明顯、樣式突兀的叉叉 */
.economy-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  cursor: pointer;
  background-color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6L6 18' stroke='%23000' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background-color 0.15s;
}
.economy-search-input::-webkit-search-cancel-button:hover {
  background-color: var(--text);
}

.economy-divine-value {
  font-family: var(--font-numeric);
  font-size: 1rem;
  font-weight: 600;
  color: #f0c050;
  font-variant-numeric: tabular-nums;
}

.economy-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.economy-cat-tab {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.economy-cat-tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.economy-cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 600;
}

.economy-table-wrap {
  /* overflow 不可用 auto：overflow-x:auto 會讓 overflow-y 一併計算成 auto，
     使 .col-hint::after 提示框（位於表頭下方）在搜尋無結果、表格僅剩表頭時
     撐出多餘的垂直捲軸。欄寬已固定且能容納，毋需橫向捲軸。 */
  overflow: visible;
}

/* 固定欄寬：避免追蹤區塊收合/展開時欄寬飄移，並對齊主表 */
.economy-table {
  table-layout: fixed;
}
.economy-table .col-icon { width: 40px; }
.economy-table .col-price { width: 96px; }
/* col-name 不設 width，自動填滿剩餘空間 */

.economy-table .col-volume,
.economy-table .col-change,
.economy-table .col-sparkline {
  text-align: right;
  white-space: nowrap;
}

.economy-table .col-volume {
  width: 80px;
  color: var(--text-muted);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.economy-table .col-change {
  width: 84px;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.economy-table .col-sparkline {
  width: 86px;
}

.economy-table td.col-sparkline {
  vertical-align: middle;
}

.economy-table .col-sparkline-1h {
  width: 104px;
  padding-right: 12px;
  text-align: right;
  white-space: nowrap;
}

.economy-table td.col-sparkline-1h {
  vertical-align: middle;
}

.economy-sortable {
  cursor: pointer;
  user-select: none;
}

.economy-sortable:hover {
  color: var(--gold-hover);
}

.economy-sortable.active-sort {
  color: var(--accent);
}

.economy-table .sort-arrow {
  font-size: 0.7em;
  margin-left: 2px;
}

/* 沒有歷史資料時（如 PoE2）隱藏變化與走勢欄 */
.economy-table.no-history th.col-change,
.economy-table.no-history th.col-sparkline-1h,
.economy-table.no-history th.col-sparkline,
.economy-table.no-history td.col-change,
.economy-table.no-history td.col-sparkline-1h,
.economy-table.no-history td.col-sparkline {
  display: none;
}

/* --- 追蹤通貨區塊 --- */
.economy-tracked-wrap {
  margin-bottom: 18px;
  padding: 12px 14px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold, #c9a34f);
  border-radius: 8px;
}
.economy-tracked-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.economy-tracked-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #c9a34f;
  letter-spacing: 0.5px;
}
.economy-tracked-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 8px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.economy-tracked-table {
  margin: 0;
}

.economy-tracked-wrap table {
    table-layout: fixed !important;
    width: 100% !important;
}

.economy-tracked-wrap td {
    overflow: hidden;
    text-overflow: ellipsis; 
}

/* 走勢圖 SVG 安全網：窄螢幕時不溢出儲存格（追蹤區塊 + 主表共用；欄寬已足夠容下原尺寸） */
.economy-table td svg,
.economy-table td canvas {
    max-width: 100%;
    height: auto;
}

/* 「顯示全部 / 收合」底部按鈕 */
.economy-tracked-more-btn {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 7px 0;
  background: transparent;
  border: none;
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 0 0 6px 6px;
  transition: color 0.15s, background 0.15s;
}
.economy-tracked-more-btn:hover {
  color: #c9a34f;
  background: rgba(201, 163, 79, 0.06);
}

/* 追蹤動作欄（最左側） */
.economy-table .col-track {
  width: 32px;
  min-width: 32px;
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

/* 星號追蹤按鈕 */
.economy-track-btn {
  background: none;
  border: none;
  color: var(--text-dim, #888);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s, transform 0.1s, background 0.15s;
}
.economy-track-btn:hover {
  color: #c9a34f;
  background: rgba(201, 163, 79, 0.1);
  transform: scale(1.15);
}
.economy-track-btn.tracked {
  color: #c9a34f;
}

.change-up   { color: var(--green); }
.change-down { color: var(--red); }
.change-flat { color: var(--text-muted); }

.col-hint {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  opacity: 0.6;
  cursor: default;
  position: relative;
  margin-left: 3px;
  vertical-align: middle;
  transition: opacity 0.15s;
}
.col-hint:hover {
  opacity: 1;
}
.col-hint::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: normal;
  white-space: pre-line;
  padding: 6px 10px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 500;
  width: max-content;
  max-width: 260px;
  line-height: 1.5;
}
.col-hint:hover::after {
  opacity: 1;
}

/* --- Economy Chart Modal --- */
.economy-chart-card {
  width: 720px;
  max-width: 96vw;
}

.economy-chart-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.economy-chart-body {
  padding: 20px 24px;
}

#economy-chart-container {
  width: 100%;
}

.economy-chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.economy-chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.economy-chart-grid {
  stroke: var(--border);
  stroke-width: 0.5;
  stroke-dasharray: 3 4;
  opacity: 0.5;
}

.economy-chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.economy-chart-area {
  opacity: 0.12;
}

.economy-chart-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.economy-chart-dot {
  fill: var(--bg-card);
  stroke-width: 2;
}

td.col-sparkline:has(svg),
td.col-sparkline-1h:has(svg) {
  cursor: pointer;
}

td.col-sparkline:has(svg):hover svg,
td.col-sparkline-1h:has(svg):hover svg {
  opacity: 0.75;
}

.echart-point {
  transition: opacity 0.1s;
  pointer-events: none;
}

.echart-point rect[fill="transparent"] {
  pointer-events: all;
}
