/* ==========================================================================
   成大夢之大地 BBS 班版時光典藏 - 樣式表 (CSS)
   支援三大主題：
   1. theme-bbs: 經典黑底終端機 (Classic BBS)
   2. theme-amber: 復古琥珀色 (Amber CRT)
   3. theme-paper: 現代紙感閱讀 (Modern Paper)
   ========================================================================== */

:root {
  /* 預設: 經典 BBS 色彩 (Classic BBS Theme) */
  --bg-primary: #000000;
  --bg-secondary: #0d0d0d;
  --bg-card: #141414;
  --bg-hover: #222222;
  --border-color: #333333;
  --text-primary: #ffffff;
  --text-secondary: #bbbbbb;
  --text-muted: #666666;
  --accent-color: #00ff00;
  --accent-secondary: #ffff00;
  --header-bg: #000080;
  --header-text: #ffffff;
  --cursor-color: #00ff00;
  
  /* ANSI BBS 16 Colors */
  --ansi-black: #000000;
  --ansi-red: #c00000;
  --ansi-green: #00c000;
  --ansi-yellow: #c0c000;
  --ansi-blue: #0000c0;
  --ansi-magenta: #c000c0;
  --ansi-cyan: #00c0c0;
  --ansi-white: #c0c0c0;

  --ansi-bright-black: #808080;
  --ansi-bright-red: #ff5555;
  --ansi-bright-green: #55ff55;
  --ansi-bright-yellow: #ffff55;
  --ansi-bright-blue: #5555ff;
  --ansi-bright-magenta: #ff55ff;
  --ansi-bright-cyan: #55ffff;
  --ansi-bright-white: #ffffff;

  --font-mono: "MingLiU", "PMingLiU", "Courier New", "Cascadia Code", Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 復古琥珀 CRT 主題 */
body.theme-amber {
  --bg-primary: #120a00;
  --bg-secondary: #1a0f00;
  --bg-card: #241400;
  --bg-hover: #382000;
  --border-color: #613800;
  --text-primary: #ffb000;
  --text-secondary: #d48e00;
  --text-muted: #8a5a00;
  --accent-color: #ffc433;
  --accent-secondary: #ffdf80;
  --header-bg: #4a2800;
  --header-text: #ffe099;
  --cursor-color: #ffb000;
}

/* 現代紙感閱讀主題 */
body.theme-paper {
  --bg-primary: #fcfbf9;
  --bg-secondary: #f3f0e8;
  --bg-card: #ffffff;
  --bg-hover: #ece7db;
  --border-color: #dcd6c8;
  --text-primary: #2c302e;
  --text-secondary: #5a605c;
  --text-muted: #8e9590;
  --accent-color: #0b7044;
  --accent-secondary: #9e4a00;
  --header-bg: #2c3e50;
  --header-text: #ffffff;
  --cursor-color: #0b7044;
}

body.theme-paper .ansi-bright-yellow { color: #b87a00 !important; font-weight: bold; }
body.theme-paper .ansi-bright-green { color: #0f8a3c !important; font-weight: bold; }
body.theme-paper .ansi-bright-cyan { color: #0277bd !important; font-weight: bold; }
body.theme-paper .ansi-bright-red { color: #d32f2f !important; font-weight: bold; }
body.theme-paper .ansi-bright-white { color: #222222 !important; font-weight: bold; }

/* 基礎設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 終端頂部導覽列 */
.bbs-topbar {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 8px 16px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent-color);
  user-select: none;
}

.bbs-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: bold;
}

.bbs-logo-badge {
  background-color: #d32f2f;
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 2px;
  letter-spacing: 1px;
}

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

.btn-terminal {
  background: transparent;
  color: var(--header-text);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-terminal:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
}

/* 看板快速切換器 (Board Switcher) */
.board-switcher-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.board-switcher-btn {
  background: rgba(255, 255, 255, 0.15);
  color: var(--ansi-bright-yellow);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.board-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--ansi-bright-yellow);
}

.board-switcher-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  min-width: 250px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.board-switcher-dropdown.active {
  display: block;
}

.board-option {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s ease;
}

.board-option:last-child {
  border-bottom: none;
}

.board-option:hover {
  background: var(--bg-hover);
}

.board-option.active {
  background: rgba(0, 255, 0, 0.12);
  border-left: 3px solid var(--accent-color);
}

.board-option-tag {
  background: #d32f2f;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

.board-option-title {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: bold;
}

/* 主容器 */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 班版看板資訊卡 */
.board-header-banner {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.board-info h1 {
  font-size: 20px;
  color: var(--accent-color);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.quick-stats {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.stat-pill {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 3px;
}

.stat-pill strong {
  color: var(--accent-secondary);
}

/* 控制列：搜尋與過濾 */
.control-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
  border-radius: 4px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  border-radius: 3px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 6px rgba(0, 255, 0, 0.2);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.filter-label {
  color: var(--text-muted);
  font-weight: bold;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--accent-color);
  color: #000000;
  font-weight: bold;
  border-color: var(--accent-color);
}

/* 文章表格清單 */
.articles-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.bbs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.bbs-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
}

.bbs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.bbs-row {
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.bbs-row:hover,
.bbs-row.selected {
  background-color: var(--bg-hover);
}

.col-cursor {
  width: 24px;
  text-align: center;
  color: var(--cursor-color);
  font-weight: bold;
}

.col-num {
  width: 50px;
  color: var(--text-muted);
}

.col-push {
  width: 60px;
  text-align: center;
  font-weight: bold;
}

.push-hot {
  color: var(--ansi-bright-red);
}

.push-warm {
  color: var(--ansi-bright-yellow);
}

.push-normal {
  color: var(--ansi-bright-green);
}

.col-cat {
  width: 70px;
  color: var(--ansi-bright-cyan);
}

.col-title {
  color: var(--text-primary);
}

.col-title .highlight {
  background-color: #c0c000;
  color: #000000;
  padding: 0 2px;
}

.col-author {
  width: 160px;
  color: var(--ansi-bright-yellow);
}

.col-date {
  width: 150px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 閱讀器模態視窗 / 文章檢視 */
.reader-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
}

.reader-modal.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.reader-container {
  background-color: var(--bg-primary);
  border: 2px solid var(--accent-color);
  max-width: 960px;
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  margin: 20px auto;
  display: flex;
  flex-direction: column;
}

.reader-top-bar {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}

.reader-actions {
  display: flex;
  gap: 8px;
}

.reader-header-block {
  background-color: var(--bg-secondary);
  padding: 14px 18px;
  border-bottom: 1px dashed var(--border-color);
  font-size: 14px;
  line-height: 1.7;
}

.reader-header-line {
  display: flex;
  margin-bottom: 4px;
}

.reader-header-label {
  color: var(--ansi-bright-blue);
  width: 60px;
  flex-shrink: 0;
  font-weight: bold;
}

.reader-header-val {
  color: var(--text-primary);
}

.reader-body {
  padding: 24px 20px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-primary);
  min-height: 200px;
}

/* 推文區 */
.reader-pushes-section {
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  padding: 18px 20px;
}

.pushes-title {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 10px;
  font-weight: bold;
}

.push-line {
  padding: 4px 0;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push-tag {
  font-weight: bold;
  width: 20px;
}

.push-tag.push-tag-推 { color: var(--ansi-bright-red); }
.push-tag.push-tag-噓 { color: var(--ansi-bright-green); }
.push-tag.push-tag-→ { color: var(--ansi-bright-cyan); }

.push-user {
  color: var(--ansi-bright-yellow);
  font-weight: bold;
}

.push-content {
  color: var(--text-primary);
  flex: 1;
}

.push-time {
  color: var(--text-muted);
  font-size: 12px;
}

/* ANSI 樣式設定 */
.ansi-bright { font-weight: bold; }
.ansi-black { color: var(--ansi-black); }
.ansi-red { color: var(--ansi-red); }
.ansi-green { color: var(--ansi-green); }
.ansi-yellow { color: var(--ansi-yellow); }
.ansi-blue { color: var(--ansi-blue); }
.ansi-magenta { color: var(--ansi-magenta); }
.ansi-cyan { color: var(--ansi-cyan); }
.ansi-white { color: var(--ansi-white); }

.ansi-bright.ansi-black { color: var(--ansi-bright-black); }
.ansi-bright.ansi-red { color: var(--ansi-bright-red); }
.ansi-bright.ansi-green { color: var(--ansi-bright-green); }
.ansi-bright.ansi-yellow { color: var(--ansi-bright-yellow); }
.ansi-bright.ansi-blue { color: var(--ansi-bright-blue); }
.ansi-bright.ansi-magenta { color: var(--ansi-bright-magenta); }
.ansi-bright.ansi-cyan { color: var(--ansi-bright-cyan); }
.ansi-bright.ansi-white { color: var(--ansi-bright-white); }

.ansi-bg-black { background-color: var(--ansi-black); }
.ansi-bg-red { background-color: var(--ansi-red); }
.ansi-bg-green { background-color: var(--ansi-green); }
.ansi-bg-yellow { background-color: var(--ansi-yellow); }
.ansi-bg-blue { background-color: var(--ansi-blue); }
.ansi-bg-magenta { background-color: var(--ansi-magenta); }
.ansi-bg-cyan { background-color: var(--ansi-cyan); }
.ansi-bg-white { background-color: var(--ansi-white); }

/* 統計資料模態視窗 */
.stats-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.stats-modal.active {
  display: flex;
}

.stats-content {
  background-color: var(--bg-card);
  border: 2px solid var(--accent-color);
  max-width: 720px;
  width: 100%;
  padding: 26px;
  border-radius: 4px;
  color: var(--text-primary);
  max-height: 90vh;
  overflow-y: auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.stat-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 3px;
}

.stat-card h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.stat-card .val {
  font-size: 26px;
  color: var(--accent-color);
  font-weight: bold;
}

/* 底部宣告 */
.bbs-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.bbs-footer a {
  color: var(--accent-color);
}

.bbs-mobile-title {
  display: none;
}

.mobile-top-actions {
  display: none;
}

.btn-mobile-icon {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 16px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}

.btn-mobile-icon:active {
  background: var(--accent-color);
  color: #000000;
}

.row-meta-mobile {
  display: none;
}

.mobile-reader-bar {
  display: none;
}

.mobile-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.menu-item-btn {
  padding: 12px 10px;
  font-size: 13.5px;
  font-weight: bold;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  justify-content: center;
  text-align: center;
  color: var(--text-primary);
  touch-action: manipulation;
}

.menu-item-btn:active {
  background: var(--accent-color);
  color: #000000;
}

/* ==========================================================================
   響應式適配 (BePTT 極簡手機閱讀器體驗 - 48px 單行頂部)
   ========================================================================== */

@media (max-width: 768px) {
  /* 基礎排版與容器 */
  body {
    font-size: 14px;
  }

  .app-container {
    padding: 0 4px 60px 4px;
    gap: 4px;
  }

  /* 終端頂部導覽列：超精簡單行 (48px) */
  .bbs-topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top);
    position: sticky;
    top: 0;
    z-index: 90;
    background-color: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .bbs-title-box {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .bbs-logo-badge {
    font-size: 10px;
    padding: 2px 5px;
  }

  .bbs-title-text {
    display: none; /* 隱藏長標題，釋放空間 */
  }

  .bbs-mobile-title {
    display: inline-block;
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
  }

  .board-switcher-btn {
    font-size: 12.5px;
    padding: 3px 7px;
    background: rgba(255, 255, 255, 0.2);
  }

  .topbar-actions {
    display: none !important; /* 桌面四顆大按鈕隱藏，收納進 ⋯ 選單 */
  }

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

  /* 移除佔據畫面的原班版介紹橫幅 (釋放 120px 空間！) */
  .board-header-banner {
    display: none !important;
  }

  /* 控制區：搜尋列與超薄橫向分類頁籤 */
  .control-bar {
    padding: 4px 8px;
    background-color: transparent;
    border: none;
    gap: 4px;
  }

  .search-row {
    display: none; /* 預設收合，點擊 🔍 按鈕時展開 */
    margin-bottom: 6px;
    gap: 6px;
  }

  .search-row.active {
    display: flex;
  }

  .search-input {
    font-size: 14px;
    padding: 8px 10px 8px 34px;
    background-color: var(--bg-card);
  }

  .filters-row {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .filter-label {
    display: none; /* 隱藏「類別篩選：」文字 */
  }

  /* 隱藏第二行年份標籤 (已移至 ⋯ 選單內) */
  .filters-row:last-child {
    display: none !important;
  }

  #categoryFilters {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    display: flex !important;
    gap: 6px;
    padding: 2px 0 6px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  #categoryFilters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 13px;
    border-radius: 16px;
    touch-action: manipulation;
  }

  /* JPTT / Pitt 式極致手機文章列表排版 */
  .articles-wrapper {
    background-color: transparent;
    border: none;
  }

  .bbs-table thead {
    display: none;
  }

  .bbs-table tbody {
    display: block;
    width: 100%;
  }

  .bbs-row {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 52px;
    gap: 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.1s ease;
    background-color: var(--bg-card);
    margin-bottom: 2px;
    border-radius: 4px;
  }

  .bbs-row:active,
  .bbs-row.selected {
    background-color: rgba(255, 255, 255, 0.12);
  }

  .col-cursor,
  .col-num,
  .col-cat,
  .col-author,
  .col-date {
    display: none !important;
  }

  /* 左側推文徽章 (JPTT Style) */
  .col-push {
    display: flex !important;
    width: 36px;
    height: 22px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0;
    padding: 0 !important;
    border: none !important;
  }

  .col-push.push-hot {
    background-color: #d32f2f;
    color: #ffffff !important;
    border-radius: 3px;
    padding: 1px 4px !important;
  }

  .col-push.push-warm {
    color: #ffff00 !important;
  }

  .col-push.push-normal {
    color: #00ff00 !important;
  }

  /* 標題與次層資訊 */
  .col-title {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
    padding: 0 !important;
    border: none !important;
  }

  .row-title-text {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: break-word;
  }

  .row-meta-mobile {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .meta-mobile-cat {
    color: var(--ansi-bright-cyan);
    font-weight: bold;
  }

  .meta-mobile-author {
    color: var(--ansi-bright-yellow);
  }

  .meta-mobile-date {
    color: var(--text-muted);
    margin-left: auto;
  }

  /* 文章閱讀器 Modal 手機全螢幕沉浸式 */
  .reader-modal {
    padding: 0;
    background-color: var(--bg-primary);
  }

  .reader-container {
    margin: 0;
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 80px;
  }

  .reader-top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background-color: var(--header-bg);
  }

  .reader-actions {
    display: none;
  }

  .mobile-reader-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 10px 8px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 1000;
    gap: 6px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.6);
  }

  .mobile-reader-bar .btn-terminal {
    flex: 1;
    justify-content: center;
    padding: 9px 4px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    touch-action: manipulation;
  }

  .reader-header-block {
    padding: 12px 14px;
    font-size: 13px;
    background-color: rgba(0, 0, 128, 0.35);
  }

  .reader-header-label {
    width: 44px;
  }

  .reader-body {
    padding: 16px 14px;
    font-size: 15px;
    line-height: 1.65;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .reader-pushes-section {
    padding: 14px 12px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
  }

  .push-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13.5px;
    padding: 6px 0;
    line-height: 1.45;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .push-tag {
    font-weight: bold;
    width: 18px;
    flex-shrink: 0;
  }

  .push-user {
    color: var(--ansi-bright-yellow);
    font-weight: bold;
    flex-shrink: 0;
  }

  .push-content {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
  }

  .push-time {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 6px;
  }

  /* 統計與精華區彈窗手機優化 (Bottom Sheet) */
  .stats-modal {
    padding: 0;
    align-items: flex-end;
  }

  .stats-content {
    max-height: 85vh;
    padding: 20px 16px;
    border-radius: 16px 16px 0 0;
    margin-bottom: max(0px, env(safe-area-inset-bottom));
    width: 100%;
    box-sizing: border-box;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-card .val {
    font-size: 20px;
  }
}

