/* ========================================
   棠的文章圖譜 — 深色主題 + 毛玻璃效果
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@400;700&display=swap');

/* ---------- CSS 變數 ---------- */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-glass: rgba(17, 24, 39, 0.72);
  --bg-glass-hover: rgba(17, 24, 39, 0.88);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-active: rgba(255, 255, 255, 0.18);

  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #67e8f9;

  --accent-cyan: #22d3ee;
  --accent-teal: #2dd4bf;
  --accent-indigo: #818cf8;
  --accent-rose: #fb7185;
  --accent-amber: #fbbf24;
  --accent-emerald: #34d399;

  --shadow-glow: 0 0 40px rgba(34, 211, 238, 0.08);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --font-sans: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Noto Serif TC', serif;

  /* 日本傳統色系 — 文集配色 */
  --color-詩去的美好: #A0D8EF;
  /* 空色 */
  --color-名豈文章蛀: #6C9BD2;
  /* 御空色 */
  --color-盈昃: #2CA9E1;
  /* 天色 */
  --color-紅摹仿的妓女: #8491C3;
  /* 紅掛空色 */
  --color-追伊: #C1E4E9;
  /* 冰色 */
  --color-沙: #E8ECEF;
  /* 雪色 */
  --color-小小說書人的呢喃: #7DB9DE;
  /* 薄花色 */
  --color-多多說很棒: #B4C8D8;
  /* 白群 */
  --color-圖戰不是我的風格: #698AAB;
  /* 縹色 */

  --accent-sky: #A0D8EF;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ---------- 3D 圖譜容器 ---------- */
#graph-container {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 1;
}

#graph-container canvas {
  outline: none;
}

/* ---------- 頂部控制列 ---------- */
.control-bar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  max-width: 75vw;
  flex-wrap: wrap;
  justify-content: flex-end;
  transition: background 0.3s ease;
}

.control-bar:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-active);
}

/* 搜尋框 */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper svg {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 7px 12px 7px 32px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  width: 200px;
  outline: none;
  transition: all 0.25s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

/* 下拉選單 */
.filter-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-select:focus {
  border-color: var(--accent-cyan);
}

/* 核取方塊群組 */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 1.5px;
  font-size: 11px;
  color: var(--bg-primary);
  font-weight: 700;
}

/* 控制按鈕 */
.ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: var(--border-glass-active);
}

.ctrl-btn.active {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

/* 分隔線 */
.separator {
  width: 1px;
  height: 22px;
  background: var(--border-glass);
  flex-shrink: 0;
}

/* 節點統計 */
.node-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.node-count .count-num {
  color: var(--accent-cyan);
  font-weight: 500;
}

/* ---------- 操作提示 ---------- */
.hint-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 8px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ---------- 右側資訊面板 ---------- */
.info-panel {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 100;
  width: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  padding: 24px;
  transform: translateX(360px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
}

.info-panel.visible {
  transform: translateX(0);
  opacity: 1;
}

.info-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.info-panel-close:hover {
  color: var(--text-primary);
}

.info-panel h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  padding-right: 24px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-panel .info-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.info-type.type-collection {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.info-type.type-genre {
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-indigo);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.info-type.type-article {
  background: rgba(251, 113, 133, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.info-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
}

.info-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.info-meta-row .label {
  color: var(--text-muted);
}

.info-meta-row .value {
  color: var(--text-secondary);
}

.info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(45, 212, 191, 0.10));
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  width: 100%;
  justify-content: center;
}

.info-link:hover {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(45, 212, 191, 0.18));
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

/* 相關文章列表 */
.related-list {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
}

.related-list h4 {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.related-item {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  cursor: pointer;
}

.related-item:hover {
  color: var(--accent-cyan);
}

.related-item::before {
  content: '·';
  margin-right: 6px;
  color: var(--text-muted);
}

/* ---------- 列表模式 ---------- */
.list-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 100px 40px 40px;
  display: none;
}

.list-view.visible {
  display: block;
}

.list-view h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.list-group {
  margin-bottom: 32px;
}

.list-group-title {
  font-size: 16px;
  font-weight: 500;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-group-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.list-article {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.2s ease;
}

.list-article:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.list-article .hits {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.list-article .genre-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- 頁面標題 ---------- */
.page-title {
  position: fixed;
  top: 18px;
  left: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title h1 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Loading 動畫 ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.6s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* ---------- 響應式 ---------- */
@media (max-width: 768px) {
  .control-bar {
    top: 10px;
    right: 8px;
    padding: 8px 12px;
    gap: 6px;
    max-width: 80vw;
  }

  .search-input {
    width: 140px;
    font-size: 12px;
  }

  .info-panel {
    width: 280px;
    right: 10px;
    top: 70px;
  }

  .page-title {
    display: none;
  }

  .list-view {
    padding: 100px 16px 24px;
  }

  .separator {
    display: none;
  }

  /* 手機停用 backdrop-filter（效能優化）*/
  .control-bar,
  .info-panel,
  .legend-panel,
  .tooltip,
  .search-suggestions {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(17, 24, 39, 0.95) !important;
  }

  /* 列表模式下，control-bar 收合為小按鈕 */
  .control-bar.collapsed > *:not(.control-bar-toggle) {
    display: none;
  }

  .control-bar.collapsed {
    padding: 0;
    background: transparent !important;
    border: none;
    box-shadow: none;
  }
}

/* ---------- 控制列收合按鈕 ---------- */
.control-bar-toggle {
  display: none;
}

@media (max-width: 768px) {
  .control-bar-toggle {
    display: none;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.25s ease;
  }

  .control-bar-toggle:hover {
    color: var(--text-primary);
    border-color: var(--border-glass-active);
  }

  /* 收合時才顯示 toggle 按鈕 */
  .control-bar.collapsed .control-bar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- 捲軸樣式 ---------- */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- 圖例面板 ---------- */
.legend-panel {
  position: fixed;
  bottom: 60px;
  left: 20px;
  z-index: 100;
  width: 240px;
  max-height: 50vh;
  overflow-y: auto;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  padding: 16px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.25s ease;
}

.legend-panel.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.legend-panel h4 {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 12px;
  text-transform: uppercase;
}

.legend-panel h4:first-child {
  margin-top: 0;
}

.legend-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-shape {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background: var(--text-muted);
}

.legend-shape[data-shape="sphere"] {
  border-radius: 50%;
}

.legend-shape[data-shape="octahedron"] {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.legend-shape[data-shape="tetrahedron"] {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.legend-shape[data-shape="box"] {
  border-radius: 1px;
}

.legend-shape[data-shape="dodecahedron"] {
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.legend-shape[data-shape="torus"] {
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--text-muted);
  width: 12px;
  height: 12px;
}

.legend-shape[data-shape="cylinder"] {
  border-radius: 2px 2px 0 0;
  height: 12px;
}

.legend-shape[data-shape="cone"] {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.legend-shape[data-shape="icosahedron"] {
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.legend-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
}

@media (max-width: 768px) {
  .legend-panel {
    width: 200px;
    left: 10px;
    bottom: 50px;
  }
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 200;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-primary);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  max-width: 240px;
  line-height: 1.6;
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip .tt-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.tooltip .tt-hits {
  color: var(--text-secondary);
  font-size: 11px;
}

/* ---------- 搜尋建議 ---------- */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-suggestions.visible {
  display: block;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sug-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sug-title {
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sug-meta {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
}

/* ---------- 列表排序列 ---------- */
.list-sort-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-glass);
}

.sort-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.sort-btn.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.3);
}

.list-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.theme-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- 鍵盤快捷鍵提示 ---------- */
.hint-bar kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 10px;
  font-family: var(--font-sans);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Theme Correction Dropdown ---------- */
.theme-correction-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  max-width: 180px;
}
.theme-correction-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.15);
}
.theme-correction-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.info-original-theme {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
  width: 100%;
}
.info-theme-row {
  flex-wrap: wrap;
}

/* ---------- Correction Toast ---------- */
.correction-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 300;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.correction-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.correction-toast.success {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(45, 212, 191, 0.3);
}
.correction-toast.error {
  background: rgba(251, 113, 133, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

/* ---------- Correction Badge ---------- */
.correction-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent-teal);
  color: var(--bg-primary);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  padding: 0 4px;
}

/* ---------- Corrections Summary View ---------- */
.corrections-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 100px 40px 40px;
  display: none;
}
.corrections-view.visible { display: block; }
.corrections-view h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.correction-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.correction-row:hover { background: rgba(255, 255, 255, 0.04); }
.correction-title {
  color: var(--text-secondary);
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.correction-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.correction-undo-btn {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--accent-rose);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.correction-undo-btn:hover {
  background: rgba(251, 113, 133, 0.2);
}
.corrections-empty {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 0;
}
.correction-apply-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
}
.correction-apply-btn {
  background: rgba(103, 232, 249, 0.12);
  border: 1px solid rgba(103, 232, 249, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  color: var(--text-accent);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.correction-apply-btn:hover { background: rgba(103, 232, 249, 0.22); }
.correction-apply-btn:disabled { opacity: 0.5; cursor: default; }
.apply-status { font-size: 12px; color: var(--text-secondary); }
.apply-status.success { color: #51cf66; }
.apply-status.error { color: var(--accent-rose); }

/* ---------- Exclusion Badge ---------- */
.exclusion-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--accent-rose);
  color: var(--bg-primary);
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  padding: 0 4px;
}

/* ---------- Exclusions View ---------- */
.exclusions-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 100px 40px 40px;
  display: none;
}
.exclusions-view.visible { display: block; }
.exclusions-view h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}
.exclusion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.exclusion-row:hover { background: rgba(255, 255, 255, 0.04); }
.exclusion-title {
  color: var(--text-secondary);
  font-size: 14px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exclusion-reason {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}
.exclusion-restore-btn {
  background: rgba(103, 232, 249, 0.1);
  border: 1px solid rgba(103, 232, 249, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--text-accent);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.exclusion-restore-btn:hover { background: rgba(103, 232, 249, 0.2); }

/* ---------- Info Panel Hide Button ---------- */
.info-hide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
  margin-top: 6px;
  background: rgba(251, 113, 133, 0.08);
  border: 1px solid rgba(251, 113, 133, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-rose);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}
.info-hide-btn:hover { background: rgba(251, 113, 133, 0.18); }