* { box-sizing: border-box; }
:root { --bg: #f4f6f8; --card: #fff; --text: #1a2332; --muted: #667085; --line: #e3e8ee; --accent: #2563eb; --up: #16a34a; --down: #dc2626; --warn: #b45309; }
body { margin: 0; font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; background: var(--bg); color: var(--text); }
.topbar { position: sticky; top: 0; z-index: 10; background: #101828; color: #fff; display: flex; gap: 12px; align-items: center; padding: 10px 16px; flex-wrap: wrap; }
.brand { display: flex; gap: 8px; align-items: center; }
.brand .logo { font-size: 26px; color: #60a5fa; }
.brand strong { display: block; font-size: 18px; line-height: 1.1; }
.brand small { color: #cbd5e1; }
.search-box { flex: 1; min-width: 200px; display: flex; background: #1e293b; border-radius: 8px; overflow: hidden; }
.search-box input { flex: 1; background: transparent; border: 0; color: #fff; padding: 9px 12px; font-size: 14px; outline: none; }
.search-box input::placeholder { color: #94a3b8; }
.search-box button { background: transparent; border: 0; color: #94a3b8; cursor: pointer; padding: 0 10px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.controls select, .controls button { border: 0; border-radius: 8px; padding: 8px 10px; font-size: 13px; cursor: pointer; }
.controls button { background: #2563eb; color: #fff; }
.controls button.off { background: #475569; }
.status { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #cbd5e1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; display: inline-block; }
.dot.bad { background: #ef4444; }
.dot.warn { background: #f59e0b; }
.tabs { display: none; gap: 0; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 57px; z-index: 9; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 12px; font-size: 15px; cursor: pointer; }
.tabs button.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.layout { display: grid; grid-template-columns: 300px 1fr 320px; gap: 14px; padding: 14px; max-width: 1500px; margin: 0 auto; align-items: start; }
.col { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.card h2, .feed-head h2 { margin: 0 0 10px; font-size: 16px; }
.card h3 { margin: 14px 0 8px; font-size: 14px; }
.ago { font-size: 12px; color: var(--muted); font-weight: normal; }
.muted { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 10px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; align-items: baseline; }
.predict-item { display: flex; flex-direction: column; gap: 7px; padding: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; }
.board h3 { margin: 10px 0 6px; font-size: 14px; }
.board:first-child h3 { margin-top: 0; }
.trans-slot:empty { display: none; }
.predict-original { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.predict-original a { color: var(--text); text-decoration: none; }
.predict-original a:hover { color: var(--accent); }
.predict-zh { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.6; color: #1e3a5f; background: #eff6ff; border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 10px; }
.predict-odds { font-size: 12px; color: var(--muted); }
.lbl { flex: none; font-size: 11px; line-height: 1; border-radius: 5px; padding: 4px 6px; margin-top: 1px; }
.lbl-en { background: #e2e8f0; color: #475569; }
.lbl-zh { background: #2563eb; color: #fff; }
.tok { display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
.token-icon { width: 20px; height: 20px; border-radius: 50%; flex: none; }
.row a { color: var(--text); text-decoration: none; }
.row a:hover { color: var(--accent); }
.row .sub { color: var(--muted); font-size: 12px; }
/* 熱搜排名：大號數字 + 金銀銅前三名 + 分隔線，順序一眼分清 */
.hot-row { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hot-row:last-child { border-bottom: 0; }
.hot-rank { flex: none; width: 30px; text-align: center; font-size: 19px; font-weight: 800; color: #94a3b8; line-height: 1.2; }
.hot-rank.rank-1 { color: #d97706; }
.hot-rank.rank-2 { color: #64748b; }
.hot-rank.rank-3 { color: #b45309; }
.hot-title { flex: 1; min-width: 0; line-height: 1.45; }
.hot-title a { color: var(--text); text-decoration: none; }
.hot-title a:hover { color: var(--accent); }
/* 板塊拖拽：手柄 + ↑↓ 按鈕 + 拖放指示線 */
.block-tools { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin: -4px 0 6px; flex-wrap: wrap; }
.drag-handle { cursor: grab; font-size: 12px; color: var(--muted); background: #f1f5f9; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.block-move { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 7px; font-size: 12px; cursor: pointer; color: var(--muted); }
.block-move:hover { color: var(--accent); border-color: var(--accent); }
[data-block].dragging { opacity: 0.45; }
[data-block].drop-before { box-shadow: 0 -3px 0 0 var(--accent); }
[data-block].drop-after { box-shadow: 0 3px 0 0 var(--accent); }
.up { color: var(--up); } .down { color: var(--down); }
.toggles { display: flex; flex-direction: column; gap: 6px; }
.toggles label { display: flex; gap: 8px; align-items: center; font-size: 13px; cursor: pointer; }
.toggles .lat { margin-left: auto; color: var(--muted); font-size: 11px; }
.toggles .dead { color: var(--down); }
.feed-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.item:hover { border-color: var(--accent); }
.item .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 8px; align-items: center; }
.item .meta .src { color: var(--accent); font-weight: 600; }
.item h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.5; }
.item p { margin: 0; font-size: 13px; color: #344054; line-height: 1.65; }
/* 中文翻譯在前（藍底框）、英文原文在後（小灰字） */
.feed-summary-zh { color: #1e3a5f; background: #eff6ff; border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px !important; display: flex; gap: 8px; align-items: flex-start; }
.feed-summary-zh.hidden { display: none; }
.feed-orig { font-size: 12px !important; color: var(--muted) !important; margin: 0 0 8px !important; display: flex; gap: 8px; align-items: flex-start; line-height: 1.5 !important; }
.feed-orig.hidden { display: none; }
.feed-orig .lbl { margin-top: 0; }
/* 信息流時間軸：左側豎線 + 日期節點 + 每條圓點 */
.timeline { position: relative; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl-date { position: relative; font-weight: 700; font-size: 14px; margin: 6px 0 0; }
.tl-date::before { content: ''; position: absolute; left: -17px; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); transform: translateY(-50%); }
.tl-item { position: relative; }
.tl-item::before { content: ''; position: absolute; left: -16px; top: 20px; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; border: 2px solid var(--card); }
/* BSC / 池子：名稱 + 報價/市值分行，數字對齊 */
.pool-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.pool-row:last-child { border-bottom: 0; }
.pool-row .sub { margin-top: 3px; }
/* 每日日報：分段小標題 + 分隔 */
.daily-sec { margin-top: 12px; }
.daily-sec:first-child { margin-top: 0; }
.daily-sec .sub { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.tag { background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 1px 7px; }
.tag.hot { background: #fef3c7; color: var(--warn); }
.tag.warn { background: #fee2e2; color: #991b1b; }
mark { background: #fde68a; padding: 0 1px; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 10px; font-size: 13px; margin-bottom: 10px; }
.hidden { display: none !important; }
footer { max-width: 1500px; margin: 0 auto; padding: 10px 16px 40px; color: var(--muted); font-size: 13px; line-height: 1.7; }
footer h3 { color: var(--text); font-size: 14px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; padding: 20px; position: relative; max-height: 85vh; overflow: auto; }
#modal-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.modal-box h2 { margin-top: 0; padding-right: 28px; }
.modal-box p { line-height: 1.7; font-size: 14px; }
.modal-box a { color: var(--accent); }
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .tabs { display: flex; }
  .col { display: none; }
  body[data-tab="feed"] .col-mid, body[data-tab="hot"] .col-left, body[data-tab="markets"] .col-right { display: block; }
  .topbar { position: static; }
  .tabs { top: 0; }
  .search-box { order: 3; flex-basis: 100%; }
}
