:root {
  /* 綠色科技感 soft-UI:深綠黑漸層 + 近黑柔光卡片 + 科技綠漸層(保留 soft-UI 質感) */
  --card: #0e1714;         /* 近黑綠卡片 */
  --card-2: #16231d;       /* hover 表面 */
  --ink: #e7efe9;          /* 近白字 */
  --muted: #8aa298;        /* 淡綠灰 */
  --line: #213029;         /* 分隔線 */
  --brand: #1fe080;        /* 科技綠主色 */
  --brand-2: #15c9a8;      /* 漸層另一端(青綠) */
  --brand-strong: #34eb96; /* hover / 連結用亮綠 */
  --brand-ink: #04150d;    /* 綠色按鈕上的深字 */
  --glow: rgba(31,224,128,.30);
  --accent-pink: #e07cd0;
  --accent-orange: #f2994a;
  --accent-green: #36d399;
  --link: #36e6a0;
  --push-up: #35d27a;
  --push-down: #ff6b6b;
  --push-arrow: #7f8a82;
  --hot: #ff7a3d;
  --radius: 16px;
  --radius-lg: 22px;
  --mono: "Menlo", "Consolas", "Noto Sans Mono CJK TC", "Microsoft JhengHei", monospace;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink);
  font-family: var(--sans); line-height: 1.6; font-size: 16px;
  background:
    url("/static/img/bg-lines.svg") center top / cover no-repeat fixed,
    radial-gradient(1200px 800px at 70% -10%, #134b3f 0%, transparent 60%),
    linear-gradient(160deg, #102a23 0%, #0c211b 45%, #08130f 100%) fixed;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* ── 頂欄 ── */
.topbar { background: rgba(10,18,15,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(31,224,128,.18);
  box-shadow: 0 4px 24px var(--glow); position: sticky; top: 0; z-index: 10; }
.topbar::after { content: ""; display: block; height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 60%, transparent 100%); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: .3px;
  background: linear-gradient(90deg, var(--brand-strong), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand:hover { text-decoration: none; filter: brightness(1.15); }
.topnav a { color: var(--muted); margin-left: 16px; font-weight: 600; }
.topnav a:hover { color: var(--brand-strong); text-decoration: none; }

/* ── 麵包屑 ── */
.breadcrumb { font-size: 14px; color: var(--muted); margin: 16px 0 8px; }
.breadcrumb a { color: var(--muted); }

/* ── Hero / 標題 ── */
.hero { padding: 24px 0 8px; }
.hero h1, .board-head h1 { border-left: 5px solid var(--brand); padding-left: 12px; }
.hero h1 { margin: 0 0 6px; font-size: 26px; }
.board-head { padding: 16px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.board-head h1 { margin: 0 0 4px; font-size: 24px; }
.board-code { font-family: var(--mono); font-size: .72em; color: var(--brand-strong); background: rgba(31,224,128,.14); border: 1px solid rgba(31,224,128,.28); padding: 1px 6px; border-radius: 6px; vertical-align: middle; }

/* ── 看板列表(首頁卡片)── */
.board-grid { list-style: none; padding: 0; margin: 16px 0 40px;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.board-card a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(0,0,0,.30);
  padding: 14px 16px; color: var(--ink); transition: .12s; height: 100%; }
.board-card a:hover { text-decoration: none; border-color: var(--brand); background: var(--card-2); box-shadow: 0 4px 16px var(--glow); transform: translateY(-1px); }
.board-card .board-name { font-weight: 700; font-size: 17px; }
.board-card .board-code { display: inline-block; margin-top: 2px; }
.board-card .board-stats { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.tag-warn { color: #ffce85; background: rgba(255,180,60,.13); padding: 0 6px; border-radius: 4px; }

/* ── 文章列表(r-ent,仿 PTT)── */
.article-list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.32); }
.r-ent { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--line); }
.r-ent:last-child { border-bottom: 0; }
.r-ent:hover { background: var(--card-2); }
.r-ent .nrec { font-family: var(--mono); font-weight: 700; text-align: center; color: var(--push-up); }
.r-ent .nrec.hot { color: var(--hot); }
.r-ent .title a { font-size: 16px; }
.r-ent .title .no-link { color: var(--muted); }
.r-ent .meta { text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; }
.r-ent .meta .author { font-family: var(--mono); margin-right: 10px; }
.r-ent.pinned { background: rgba(255, 209, 102, .05); }
.r-ent.pinned:hover { background: rgba(255, 209, 102, .10); }
.pin-badge { font-size: .72em; font-weight: 700; color: #ffd166; background: rgba(255,209,102,.14); border: 1px solid rgba(255,209,102,.32); padding: 1px 6px; border-radius: 6px; margin-right: 6px; vertical-align: middle; white-space: nowrap; }
.empty { padding: 20px; text-align: center; color: var(--muted); }

/* ── 分頁器 ── */
.pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pager-mid { color: var(--muted); font-size: 14px; }
.btn { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px; color: var(--ink); font-size: 14px; }
.btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand-strong); background: var(--card-2); box-shadow: 0 0 12px var(--glow); }
.btn-primary { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%); border: none;
  color: var(--brand-ink); font-weight: 700; box-shadow: 0 6px 18px var(--glow); }
.btn-primary:hover { color: var(--brand-ink); filter: brightness(1.08); box-shadow: 0 8px 26px var(--glow); }
.btn.disabled { color: #46544c; cursor: default; }
.btn.disabled:hover { border-color: var(--line); color: #46544c; background: var(--card); box-shadow: none; }

/* ── 文章內頁 ── */
.article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; margin-bottom: 16px; overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.32); }
.article-metabar { background: linear-gradient(90deg, rgba(31,224,128,.12), rgba(21,201,168,.03)); border-bottom: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 12px 18px; }
.meta-row { font-size: 14px; padding: 2px 0; }
.meta-tag { display: inline-block; width: 48px; color: var(--muted); font-weight: 600; }
.meta-val { font-family: var(--mono); }
/* 內文區做成「終端機螢幕」深底,讓 PTT 的 ANSI 顏色/ASCII 彩圖正確呈現 */
.article-content { padding: 18px; font-family: var(--mono); font-size: 15px;
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.5;
  background: #0a0f0c; color: #c8c8c8; }
.article-content img { max-width: 100%; height: auto; }
.article-content a { color: #6fb3ff; word-break: break-all; }

/* PTT ANSI 配色:f0~f7 前景、b0~b7 背景、hl 高亮(亮色) */
.article-content .f0 { color: #000000; }
.article-content .f1 { color: #c00000; }
.article-content .f2 { color: #00c000; }
.article-content .f3 { color: #c0c000; }
.article-content .f4 { color: #2424c0; }
.article-content .f5 { color: #c000c0; }
.article-content .f6 { color: #00c0c0; }
.article-content .f7 { color: #c0c0c0; }
/* hl(高亮)單獨出現 = 亮白;與前景色併用 = 該色的亮版 */
.article-content .hl    { color: #ffffff; }
.article-content .hl.f0 { color: #808080; }
.article-content .hl.f1 { color: #ff5555; }
.article-content .hl.f2 { color: #55ff55; }
.article-content .hl.f3 { color: #ffff55; }
.article-content .hl.f4 { color: #5c8cff; }
.article-content .hl.f5 { color: #ff55ff; }
.article-content .hl.f6 { color: #55ffff; }
.article-content .hl.f7 { color: #ffffff; }
/* 背景色 */
.article-content .b0 { background: #000000; }
.article-content .b1 { background: #c00000; }
.article-content .b2 { background: #00c000; }
.article-content .b3 { background: #c0c000; }
.article-content .b4 { background: #0000c0; }
.article-content .b5 { background: #c000c0; }
.article-content .b6 { background: #00c0c0; }
.article-content .b7 { background: #c0c0c0; }

/* ── 推文 ── */
.pushes { border-top: 1px solid var(--line); padding: 8px 0 4px; }
.pushes-head { font-size: 16px; margin: 8px 18px; }
.push { display: grid; grid-template-columns: 28px 110px 1fr auto; gap: 8px; align-items: baseline;
  padding: 4px 18px; font-family: var(--mono); font-size: 14px; border-top: 1px solid #182019; }
.push .push-tag { font-weight: 700; text-align: center; }
.push.push-up .push-tag { color: var(--push-up); }
.push.push-down .push-tag { color: var(--push-down); }
.push.push-arrow .push-tag { color: var(--push-arrow); }
.push .push-user { font-weight: 600; }
.push .push-content { word-break: break-all; }
.push .push-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── 頁尾 ── */
.footer { margin-top: 32px; padding: 18px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }

/* ── RWD ── */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .r-ent { grid-template-columns: 44px 1fr; grid-template-areas: "nrec title" "nrec meta"; row-gap: 2px; }
  .r-ent .nrec { grid-area: nrec; align-self: start; }
  .r-ent .title { grid-area: title; }
  .r-ent .meta { grid-area: meta; text-align: left; }
  .push { grid-template-columns: 24px 1fr; grid-template-areas: "tag user" "tag content" "tag time"; row-gap: 1px; }
  .push .push-tag { grid-area: tag; }
  .push .push-user { grid-area: user; }
  .push .push-content { grid-area: content; }
  .push .push-time { grid-area: time; }
  .board-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
