/* ============================================================
   layout-v2.css — 版面重設計 v2.1（2026-07-05）
   風格依 ui-ux-pro-max 技能庫查詢結果對齊：
   Fintech/Crypto → Glassmorphism + OLED 深黑 + Modern Dark tokens
   （accent #5E6AD2、髮絲邊框 rgba(255,255,255,.08)、radius 16、
     表格行高 36、側欄 240、頂欄 56 — 皆為技能庫建議值）
   v2.1 跑版修正：modal 層級、grid 溢出、hero 卡、側欄品牌字
   ============================================================ */

/* ---------- 0. 版面骨架 ---------- */
.main {
  padding: 0 28px 48px;
  max-width: 1440px;
}

/* 頂欄 → sticky 指揮列（高度 ~56px，技能庫 --header-height） */
.topbar {
  position: sticky; top: 0; z-index: 10;      /* v2.1: 20→10，讓 modal(50) 永遠在上 */
  margin: 0 -28px 20px;
  padding: 12px 28px;
  min-height: 56px;
  background: rgba(8, 9, 12, .84);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  animation: none;
}
.topbar h2 { font-size: 21px; letter-spacing: -.01em; }
.topbar .eyebrow { font-size: 10.5px; opacity: .8; }

/* v2.1: 彈窗永遠壓過 sticky 頂欄 */
.modal-backdrop { z-index: 50; }

/* v2.1: 防寬表格把 grid 撐爆（grid 子項預設 min-width:auto 的經典跑版） */
.content-grid > *, .stats-grid > * { min-width: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- 1. 側欄：240px（技能庫 --sidebar-width）扁平深面板 ---------- */
.sidebar {
  width: 240px;
  padding: 20px 14px;
  background: #0a0a0c;                        /* 技能庫 --bg-elevated */
  backdrop-filter: none;
  border-right: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0;
  box-shadow: none;
  animation: none;
}
.sidebar .brand { margin-bottom: 18px; padding: 0 8px; gap: 10px; }
.sidebar .brand h1 { font-size: 17px; }        /* v2.1: 22px 在窄欄會擠 */
.sidebar .brand p { font-size: 11.5px; }
.nav button {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
}
.nav button.active {
  background: rgba(94, 106, 210, .16);
  color: #c5cbff;
}
.nav button.active::before { display: none; }
.nav-divider { margin: 10px 8px; opacity: .6; }

/* ---------- 2. 卡片：radius 16（技能庫 --radius）+ 髮絲邊框 ---------- */
.panel {
  border-radius: 16px;
  border-color: rgba(255, 255, 255, .08);
  animation: none;
  transition: border-color .18s ease;
}
.panel:hover { transform: none; border-color: rgba(94, 106, 210, .38); }
.panel-head {
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.panel h3 { font-size: 15px; }
.eyebrow { font-size: 10.5px; letter-spacing: .12em; }

/* v2.1: hero 卡對齊新語彙（原 28px 圓角突兀） */
.hero-card { border-radius: 16px; padding: 22px 24px; }

/* ---------- 3. KPI 數據條 ---------- */
.stats-grid { gap: 12px; margin: 18px 0 16px; }
.stat-card {
  border-radius: 12px;
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, .08);
}
.stat-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #5E6AD2, rgba(94, 106, 210, 0));
  opacity: .9;
}
.stat-card span { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; }
.stat-card strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat-card small { font-size: 11px; }

/* ---------- 4. 內容網格 ---------- */
.content-grid { gap: 14px; }
.page > .content-grid { margin-top: 4px; }

/* ---------- 5. 表格：行高 36px（技能庫 --table-row-height） ---------- */
th, td { padding: 8.5px 10px; font-size: 13px; }
th { font-size: 11px; }
.table-wrap { border-radius: 10px; border: 1px solid rgba(255, 255, 255, .07); }
.table-wrap table { margin: 0; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- 6. 按鈕層級（accent #5E6AD2 + 光暈 = 技能庫 accent-glow） ---------- */
.primary {
  background: #5E6AD2;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 6px 20px rgba(94, 106, 210, .28);
}
.primary:hover:not(:disabled) { background: #6E7BE6; }
.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 9px;
}
.ghost:hover:not(:disabled) { border-color: rgba(94, 106, 210, .45); background: rgba(94, 106, 210, .08); }
.small-btn { border-radius: 8px; font-size: 12.5px; }

/* ---------- 7. Modal ---------- */
.modal { border-radius: 16px; padding: 20px 22px; }
.modal h3 { padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.modal-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }

/* ---------- 8. 表單 ---------- */
input, select, textarea { border-radius: 9px; font-size: 13.5px; }
.bot-form label { font-size: 12px; letter-spacing: .04em; }

/* ---------- 9. 登入畫面 ---------- */
.auth-card { border-radius: 18px; }

/* ---------- 10. 手機 ---------- */
@media (max-width: 860px) {
  .main { padding: 0 14px 32px; }
  .topbar { margin: 0 -14px 14px; padding: 10px 14px; min-height: 52px; }
  .topbar h2 { font-size: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { width: 100%; }
}
