/* nbaio 首頁：未登入的介紹、登入後的牌桌 / 常用服務 / 7 天行程 / 最新動態。顏色一律用 base.css 的 token。
   上半部的卡片、問候、小卡也給 apps/invest 用（建置時複製），改名或刪掉前先看 invest。 */

/* ---------- 介紹（未登入）---------- */
.landing {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 85% -10%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--glow-2) 0%, transparent 60%),
    var(--bg);
}
.landing-card {
  width: min(480px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px;
  box-shadow: 0 1px 2px rgb(var(--shadow-rgb) / 5%), 0 16px 40px rgb(var(--shadow-rgb) / 9%);
}
.landing-logo img { width: 220px; height: auto; }
.landing-logo .logo-dark { display: none; }
:root[data-theme="dark"] .landing-logo .logo-dark { display: inline; }
:root[data-theme="dark"] .landing-logo .logo-light { display: none; }
.landing-card .lead { color: var(--text-2); line-height: 1.7; margin: 0; }
.landing-actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.landing-actions .btn { flex: 1; }
.btn.big { padding: 11px 18px; font-size: 15px; border-radius: 11px; }

/* ---------- 停機公告（data-until 之後由 home.js 拿掉）---------- */
.hm-notice {
  margin: 0; padding: 10px 14px; border: 1px solid var(--warn-line); border-radius: 12px;
  background: var(--warn-soft); color: var(--warn-ink); font-size: 14px; line-height: 1.6; text-align: left;
}
.hm-notice strong { margin-right: 8px; }
.landing-card .hm-notice { width: 100%; }

/* ---------- 版面 ---------- */
.content.hm { display: flex; flex-direction: column; gap: 20px; }
.hm-card {
  min-width: 0; padding: 18px 20px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.hm-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-width: 0; }
.hm-card-head h2 { margin: 0; font-size: 17px; white-space: nowrap; }
.hm-card-title { display: flex; flex-direction: column; min-width: 0; }
.hm-card-title small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-more { flex: none; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.hm-more:hover { text-decoration: underline; }
.hm-add { padding: 5px 12px; border: 1px solid var(--accent-line); border-radius: 10px; }
.hm-add:hover { background: var(--accent-soft); text-decoration: none; }
.hm-badge { padding: 1px 9px; border-radius: 999px; background: var(--sunken); color: var(--text-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.hm-none, .hm-wait { margin: 6px 0 2px; font-size: 13.5px; }
/* 卡片標題前面的圖示 */
.hm-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.hm-ico svg { width: 20px; height: 20px; fill: currentColor; }
.hm-ico.feed { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-line); }
.hm-ico.cal { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent-line); }
.hm-ico.voice { color: var(--good-ink); background: var(--good-soft); border-color: var(--good-line); }
.hm-ico.show { color: var(--warn-ink); background: var(--warn-soft); border-color: var(--warn-line); }

/* ---------- 上方一列 ---------- */
.hm-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.hm-top-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hm-cash { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--warn-soft); }
.hm-cash-amt { display: inline-flex; align-items: baseline; gap: 4px; color: var(--warn-ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.hm-cash-amt svg { width: 17px; height: 17px; fill: currentColor; align-self: center; }
.hm-cash-amt strong { font-size: 15px; }
.hm-cash-amt small { font-size: 11.5px; font-weight: 700; opacity: .8; }
.hm-cash:not(:has(.hm-refill:not(.hidden))) { padding-right: 12px; }
.hm-refill { margin-left: 6px; padding: 4px 10px; border: 0; border-radius: 8px; background: var(--warn); color: #3d2a00; font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.hm-refill:hover { filter: brightness(1.06); }
.hm-refill:disabled { opacity: .6; cursor: default; }
.hm-post-btn { display: inline-flex; align-items: center; gap: 6px; }
.hm-post-btn svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- 問候 ---------- */
.hm-hero {
  display: flex; align-items: center; gap: 24px; padding: 26px 28px; border: 1px solid var(--line); border-radius: 24px;
  background:
    radial-gradient(700px 260px at 0% 0%, var(--glow-1) 0%, transparent 70%),
    radial-gradient(600px 260px at 100% 100%, var(--glow-2) 0%, transparent 70%),
    var(--panel);
  box-shadow: var(--shadow);
}
.hm-hero-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hm-chip { padding: 3px 12px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.hm-hero h1 { margin: 2px 0 0; font-size: 30px; text-wrap: balance; }
.hm-summary { margin: 0; color: var(--text-2); line-height: 1.7; max-width: 62ch; }
.hm-summary b { color: var(--accent-strong); }
.hm-summary .ann { color: var(--good-ink); }
.hm-summary a { color: inherit; }
.hm-stats { flex: none; display: grid; grid-template-columns: repeat(3, minmax(150px, 190px)); gap: 12px; }
.hm-stat {
  display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--panel-2); color: var(--text); text-decoration: none;
}
a.hm-stat:hover { border-color: var(--accent-line); }
.hm-stat .hm-ico { width: 40px; height: 40px; }
.hm-stat-text { display: flex; flex-direction: column; min-width: 0; }
.hm-stat-text small { font-size: 12px; color: var(--muted); }
.hm-stat-text strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 主要區塊（invest 也用這組版面與卡片：apps/invest 建置時複製這個檔案）---------- */
.hm-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.hm-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- 窄螢幕 ---------- */
@media (max-width: 1320px) {
  .hm-hero { flex-direction: column; align-items: stretch; }
  .hm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .hm-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .content.hm { padding: 18px 16px 40px; gap: 16px; }
  .hm-hero { padding: 20px 18px; gap: 16px; }
  .hm-hero h1 { font-size: 24px; }
  .hm-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hm-stat { padding: 10px 12px; }
  .hm-card { padding: 16px; }
  /* 手機：現金 + 發布動態一行 */
  .hm-top-right { width: 100%; flex-wrap: nowrap; justify-content: space-between; }
  .hm-wide { display: none; }
  .hm-card-title small { white-space: normal; }
}

/* ---------- 動態 ---------- */
/* 卡片 hover 時框線慢慢亮起；領補給按下去有回饋（共用 token 在 base.css） */
.hm-stat, .hm-add { transition: border-color var(--dur) ease, background-color var(--dur) ease; }
.hm-refill { transition: filter var(--dur) ease, transform var(--dur-fast) var(--ease-out); }
.hm-refill:active:not(:disabled) { transform: scale(var(--pop)); }

/* 介面風格 Glass（base.css）：卡片換成白色細邊；未登入的介紹頁不蓋底色，露出背景的房間 */
:root[data-style="glass"] :is(.hm-card, .hm-hero, .hm-stat, .hm-table, .hm-app) { border-color: var(--glass-edge); }
:root[data-style="glass"] .hm-stat { box-shadow: var(--shadow); }
:root[data-style="glass"] .landing { background: none; }

/* ======================================================================
   首頁（2026-11-02 改版）：簡單、沒有圖示；左邊牌桌 + 常用服務，右邊 7 天行程 + 最新動態
   ====================================================================== */
.hm-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.hm-head h1 { margin: 0; font-size: 26px; }
.hm-head p { margin: 0; font-variant-numeric: tabular-nums; }
.hm .hm-layout { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); }
.hm-card-head small { white-space: nowrap; }

/* 進場：依序往上浮、淡入（--i = 第幾個）。只在第一次畫和換分頁時播，自動更新只有新出現的列用 .nb-enter */
@keyframes hm-rise { from { opacity: 0; transform: translateY(calc(var(--rise) * 1.6)); } }
.rise { animation: hm-rise .6s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
.hm-col > .rise:nth-child(2) { --i: 2; }
.hm-col > .rise:nth-child(3) { --i: 4; }
.hm-col + .hm-col > .rise:nth-child(1) { --i: 1; }
.hm-col + .hm-col > .rise:nth-child(2) { --i: 3; }
.hm-card .rise { animation-duration: .45s; animation-delay: calc(200ms + var(--i, 0) * 45ms); }

/* 可以點的列：hover 時輕輕往右推、框線變亮 */
.hm-table, .hm-app, .hm-post, .hm-event, .hm-lobby, .hm-game {
  transition: border-color var(--dur) ease, background-color var(--dur) ease, transform var(--dur-slow) var(--ease-out), color var(--dur) ease;
}

/* ---------- 牌桌 ---------- */
.hm-games { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.hm-game {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hm-game:hover { border-color: var(--line-strong); color: var(--text); }
.hm-game.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.hm-count { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--sunken); font-size: 11.5px; text-align: center; font-variant-numeric: tabular-nums; }
.hm-game.active .hm-count { background: var(--panel); }
.hm-tables { display: grid; gap: 8px; }
.hm-table {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--text); text-decoration: none;
}
.hm-table:hover { border-color: var(--accent-line); transform: translateX(3px); }
.hm-table.live { border-left: 3px solid var(--good); }
.hm-table-main { display: flex; flex-direction: column; min-width: 0; }
.hm-table-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-table-who { min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-table-side { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.hm-status { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.hm-status.on { color: var(--good-ink); }
.hm-go { font-size: 13px; font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.hm-lobbies { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hm-lobby { font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.hm-lobby:hover { color: var(--accent-strong); }

/* ---------- 常用服務：純文字的連結格 ---------- */
.hm-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.hm-app {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); color: var(--text); text-decoration: none;
}
.hm-app:hover { border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-2px); }
.hm-app small { font-size: 12px; }

/* ---------- 接下來 7 天：每天一列 ---------- */
.hm-week { list-style: none; margin: 0; padding: 0; display: grid; }
.hm-day { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.hm-day:first-child { border-top: 0; padding-top: 2px; }
.hm-day-label { display: flex; flex-direction: column; }
.hm-day-label strong { font-size: 14px; }
.hm-day-label small { font-variant-numeric: tabular-nums; }
.hm-day.today .hm-day-label strong { color: var(--accent-strong); }
.hm-day.free .hm-day-label strong { color: var(--text-2); font-weight: 600; }
.hm-free { align-self: center; }
.hm-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hm-event { display: flex; gap: 12px; align-items: baseline; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.hm-event:hover { background: var(--hover); transform: translateX(3px); }
.hm-event-time { flex: none; width: 92px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.hm-day.today .hm-event-time { color: var(--accent-strong); font-weight: 600; }
.hm-event-main { display: flex; flex-direction: column; min-width: 0; }
.hm-event-main strong { font-weight: 650; overflow-wrap: anywhere; }
.hm-cal-rest { display: inline-block; margin-top: 10px; }

/* ---------- 最新動態：精簡列表 ---------- */
.hm-posts { display: grid; }
.hm-post {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px;
  color: var(--text); text-decoration: none;
}
.hm-posts { gap: 2px; }
.hm-post:hover { background: var(--hover); transform: translateX(3px); }
.hm-post-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hm-post-top { display: flex; align-items: baseline; gap: 8px; }
.hm-post-top strong { font-size: 14px; }
.hm-post-text {
  font-size: 13.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hm-post-img { flex: none; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--sunken); }
.hm-post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 1100px) {
  .hm .hm-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hm-head h1 { font-size: 22px; }
  .hm-table { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .hm-table-who { grid-column: 1; grid-row: 2; }
  .hm-go { grid-column: 2; grid-row: 2; justify-self: end; }
  .hm-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .hm-table:hover, .hm-app:hover, .hm-post:hover, .hm-event:hover { transform: none; }
}
