/* =========================================================
   LITEMAX eSCM 樣式表
   色調：深藍黑底 + 青色 / 靛紫光暈，營造科技感
   ========================================================= */

/* ---------- 1. 顏色變數（要換色只改這裡） ---------- */
:root {
  --bg: #070d1a;          /* 最底層背景 */
  --panel: #0e1729;       /* 卡片背景 */
  --panel-2: #14213b;     /* 卡片內較亮區塊 */
  --line: #1f2f4f;        /* 邊框線 */
  --text: #e6edf7;        /* 主要文字 */
  --muted: #8ea0bd;       /* 次要文字 */
  --accent: #22d3ee;      /* 主色：青色 */
  --accent-2: #818cf8;    /* 輔色：靛紫 */
  --sales: #60a5fa;       /* 首頁圖表的業績線：藍色 */
  --ok: #34d399;          /* 綠＝正常 */
  --warn: #fbbf24;        /* 橙＝即將到期 */
  --bad: #f87171;         /* 紅＝逾期／不合格 */
  --radius: 14px;
  /* 半透明的背景、光暈、表格線（亮色主題會換掉） */
  --glow-1: rgba(34, 211, 238, 0.12);
  --glow-2: rgba(129, 140, 248, 0.12);
  --topbar-bg: rgba(7, 13, 26, 0.85);
  --sidebar-bg: rgba(14, 23, 41, 0.9);
  --active-bg: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(129, 140, 248, 0.08));
  --kpi-glow: rgba(34, 211, 238, 0.25);
  --row-line: rgba(31, 47, 79, 0.6);
  --row-hover: rgba(34, 211, 238, 0.04);
  --backdrop: rgba(2, 6, 15, 0.7);
  --modal-glow: rgba(34, 211, 238, 0.2);
  --btn-text: #04101f;    /* 主要按鈕上的文字 */
  color-scheme: dark;     /* 日期選擇器等瀏覽器元件跟著用暗色 */
}

/* 亮色主題：淺橘色為主（右上角按鈕切換，存在瀏覽器） */
:root[data-theme="light"] {
  --bg: #fff6ee;
  --panel: #ffffff;
  --panel-2: #ffeedd;
  --line: #f5d6b8;
  --text: #3a2614;
  --muted: #8a6a50;
  --accent: #ea7a1a;      /* 主色：橘色 */
  --accent-2: #f5a65b;    /* 輔色：淺橘 */
  --sales: #2563eb;       /* 首頁圖表的業績線：藍色 */
  --ok: #059669;
  --warn: #c27803;
  --bad: #dc2626;
  --glow-1: rgba(253, 186, 116, 0.35);
  --glow-2: rgba(254, 215, 170, 0.45);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --sidebar-bg: rgba(255, 249, 243, 0.95);
  --active-bg: linear-gradient(90deg, rgba(234, 122, 26, 0.15), rgba(245, 166, 91, 0.06));
  --kpi-glow: rgba(234, 122, 26, 0.15);
  --row-line: #fbe3cc;
  --row-hover: rgba(234, 122, 26, 0.05);
  --backdrop: rgba(58, 38, 20, 0.35);
  --modal-glow: rgba(234, 122, 26, 0.15);
  --btn-text: #ffffff;
  color-scheme: light;
}

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

body {
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, var(--glow-1), transparent 40%),
    radial-gradient(circle at 90% 10%, var(--glow-2), transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 3. 上方標題列 ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);           /* 毛玻璃效果 */
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;                     /* 漸層文字 */
}
.logo span { font-weight: 400; }
a.logo:hover { text-decoration: none; opacity: 0.85; }
@media (max-width: 600px) { .logo { font-size: 16px; letter-spacing: 1px; } }
/* 晶達 Logo 圖片：白底圖片，加白色圓角底，暗色模式也看得清楚 */
.logo { display: flex; align-items: center; gap: 8px; }
.logo-img { height: 48px; background: #fff; border-radius: 8px; padding: 2px 8px; }
@media (max-width: 600px) { .logo-img { height: 34px; } .logo span { display: none; } }

.topbar-right { margin-left: auto; }

.role-box { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

.menu-btn {
  display: none;                          /* 桌機隱藏，手機才顯示 */
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  border-radius: 8px;
  width: 40px; height: 40px;
  cursor: pointer;
}

/* ---------- 4. 左側選單 ---------- */
.sidebar {
  position: fixed;
  top: 60px; left: 0; bottom: 0;
  width: 220px;
  padding: 20px 12px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
  transition: transform 0.25s;
}

.sidebar a {
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
}
.sidebar a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.sidebar a.active {
  background: var(--active-bg);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);   /* 左側亮條 */
}

.sidebar-note { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px; }

.overlay { display: none; }

/* ---------- 5. 主要內容區 ---------- */
.main {
  margin-left: 220px;
  padding: 84px 28px 40px;
  max-width: 1400px;
}

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }

/* 卡片 */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}
.card h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* 自動排列的格子：寬度不夠會自動換行，手機不會擠壓變形 */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* ---------- 6. KPI 卡片 ---------- */
.kpi {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--accent); }
.kpi::after {                              /* 右上角光暈裝飾 */
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, var(--kpi-glow), transparent 70%);
}
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 700; margin: 4px 0; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 400; }
.kpi-trend { font-size: 13px; }
.up { color: var(--ok); }
.down { color: var(--bad); }

/* ---------- 7. 待辦與警示 ---------- */
.alert-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.alert-row:last-child { border-bottom: none; }
.alert-text { flex: 1; min-width: 180px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.bad { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dot.warn { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* ---------- 8. 標籤（狀態顏色） ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.tag.ok { color: var(--ok); background: rgba(52, 211, 153, 0.1); }
.tag.warn { color: var(--warn); background: rgba(251, 191, 36, 0.1); }
.tag.bad { color: var(--bad); background: rgba(248, 113, 113, 0.1); }
.tag.info { color: var(--accent); background: var(--row-hover); }
.tag.gray { color: var(--muted); }

/* ---------- 9. 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  color: var(--muted);
  font-weight: 500;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 10px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
tr:hover td { background: var(--row-hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 10. 按鈕與表單 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
}
.btn:hover { border-color: var(--accent); }
.btn.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--btn-text);
  border: none;
  font-weight: 700;
}
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: var(--bad); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form .row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
/* 勾選框、單選鈕和文字排在同一行 */
.form label:has(> input[type="checkbox"]),
.form label:has(> input[type="radio"]) { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.required::after { content: " *"; color: var(--bad); }
.hint { font-size: 12px; color: var(--muted); }
.error { color: var(--bad); font-size: 13px; min-height: 18px; }

/* 評鑑題目 */
.q-item {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.q-item .q-text { flex: 1; min-width: 200px; color: var(--text); }
.q-options { display: flex; gap: 10px; }
.q-options label { display: flex; align-items: center; gap: 4px; color: var(--text); }
.score-box { font-size: 20px; font-weight: 700; color: var(--accent); }

/* 分頁籤 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tabs button {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  font-family: inherit;
}
.tabs button.active { color: var(--accent); border-color: var(--accent); }

.info-grid { display: grid; gap: 8px 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); font-size: 14px; }
.info-grid b { color: var(--muted); font-weight: 400; margin-right: 6px; }

.demo-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--warn);
  border: 1px dashed var(--warn);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.chart-box { position: relative; height: 260px; }

/* ---------- 11. 對話框 ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  z-index: 50;
  padding: 20px;
  overflow-y: auto;
}
.modal.show { display: flex; align-items: flex-start; justify-content: center; }
.modal-box {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin-top: 40px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 0 40px var(--modal-glow);
}
.modal-box h2 { font-size: 20px; margin-bottom: 14px; }
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
}

/* 提示訊息 */
.toast {
  position: fixed;
  right: 20px; bottom: 20px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  padding: 12px 18px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 60;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* 角色權限：沒權限的元素直接隱藏 */
body.role-user .maintainer-only,
body.role-user .admin-only,
body.role-maintainer .admin-only { display: none !important; }

/* 展示模式／正式模式各自才顯示的元素 */
body:not(.online) .online-only,
body.online .demo-only { display: none !important; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-box { color: var(--muted); font-size: 13px; }

/* 登入畫面 */
.login-card { max-width: 380px; margin: 60px auto; }
.login-card .page-title { margin-bottom: 16px; text-align: center; }

/* 按鈕送出中 */
.btn:disabled { opacity: 0.5; cursor: wait; }

/* =========================================================
   12. 手機版（螢幕寬度 820px 以下）
   ========================================================= */
@media screen and (max-width: 820px) { /* 只管螢幕；列印（匯出 PDF）不套用手機版排法 */
  .menu-btn { display: block; }
  .role-box > span { display: none; }
  .user-box { display: none; }

  /* 選單平常藏在左邊，按下 ☰ 才滑出來 */
  .sidebar { transform: translateX(-100%); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; position: fixed; inset: 60px 0 0 0; background: rgba(0, 0, 0, 0.5); z-index: 15; }

  .main { margin-left: 0; padding: 76px 16px 30px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }

  /* 表格在手機改成「一列一張小卡片」，避免畫面被擠壓 */
  table.responsive thead { display: none; }
  table.responsive tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 6px 10px;
  }
  table.responsive td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed var(--row-line);
    padding: 6px 0;
    text-align: right;
  }
  table.responsive td:last-child { border-bottom: none; }
  table.responsive td::before {          /* 把欄位名稱顯示在左邊 */
    content: attr(data-label);
    color: var(--muted);
    text-align: left;
    flex-shrink: 0;
  }
  .modal { padding: 0; }
  .modal-box { margin-top: 0; min-height: 100vh; border-radius: 0; }
}

/* 實地評鑑：尚未評鑑名單（可收合） */
.never-list { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.never-list summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.never-list[open] summary { margin-bottom: 10px; }
.never-list .table-wrap { max-height: 50vh; overflow: auto; }

/* 只顯示、不能點的 KPI 卡片 */
.kpi.static { cursor: default; }
.kpi.static:hover { transform: none; border-color: var(--line); }

/* 供應商登入：不顯示左側選單與內部功能，內容置中 */
body.role-supplier .sidebar,
body.role-supplier .menu-btn,
body.role-supplier .maintainer-only,
body.role-supplier .admin-only { display: none !important; }
body.role-supplier .main { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* 主題切換按鈕 */
.theme-btn { min-width: 36px; justify-content: center; }

/* ---------- 使用說明 ---------- */
.guide-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.guide-toc a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text);
}
.guide-toc a:hover { border-color: var(--accent); text-decoration: none; }
.guide-toc span { font-size: 20px; }
.guide-sec { scroll-margin-top: 80px; }           /* 跳過去時不會被上方標題列擋住 */
.guide-sec h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-steps { counter-reset: step; list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.guide-steps li { counter-increment: step; position: relative; padding-left: 38px; }
.guide-steps li::before {                          /* 圓形步驟編號 */
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--btn-text); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.guide-tip { margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--row-hover); border-radius: 6px; font-size: 14px; }
.fake-btn { pointer-events: none; padding: 1px 8px; vertical-align: baseline; }

/* 主要產品複選：一格一個勾選框 */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 6px;
  max-height: 180px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

/* ===== 閃燈：有待回覆的問題反映 ===== */
@keyframes blink { 50% { opacity: 0.2; } }
.blink { animation: blink 1s ease-in-out infinite; }
.nav-badge:empty { display: none; }
.nav-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  border-radius: 10px; background: var(--warn); color: #111; font-size: 12px; text-align: center;
}

/* ===== 問題反映 ===== */
.issue { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.issue-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.issue-text { white-space: pre-wrap; margin: 6px 0; }              /* 保留換行 */
.issue-reply { margin: 8px 0 0 16px; padding: 8px 10px; border-left: 3px solid var(--line); }
.issue-reply.staff { border-left-color: var(--accent); }            /* 晶達的回覆用藍色線 */
.issue-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.issue-imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.issue-form { margin-top: 10px; }

/* ===== 上傳證書時勾選料號 ===== */
.item-pick { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.item-pick label { padding: 3px 0; color: var(--text); }
.item-pick label[hidden] { display: none !important; } /* 要蓋過表單勾選列的 display:flex，篩選才藏得起來 */

/* ===== 證書按鈕：顏色跟著狀態 ===== */
.btn.cert.ok { color: var(--ok); }
.btn.cert.warn { color: var(--warn); }
.btn.cert.bad { color: var(--bad); }

/* 左側「證書與文件」的燈：灰燈＝沒有待審核；紅燈閃＝有待審核 */
.nav-dot { display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--muted); opacity: 0.5; vertical-align: middle; }
.nav-dot.red { background: var(--bad); opacity: 1; box-shadow: 0 0 8px var(--bad); }

/* 系統管理：帳號表格裡的輸入框、下拉縮小一點 */
label.inline { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#userList input, #userList select { padding: 4px 6px; font-size: 13px; }
.user-new input, .user-new select { padding: 6px 8px; }

/* 標題旁的版本號 */
.ver-btn {
  margin-left: 10px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.ver-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 供應商戰情室 */
.sup-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sup-kpi { flex: 1 1 140px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.sup-kpi span { display: block; color: var(--muted); font-size: 13px; }
.sup-kpi b { font-size: 22px; }
.sup-kpi.bad b { color: var(--bad); }
.sup-kpi.warn b { color: var(--warn); }
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin: 12px 0; }
.sup-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.sup-card.alert { border-color: var(--bad); }
.sup-card-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sup-news { display: flex; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--row-line); }
.pay-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 160px; }
.pay-bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--muted); }
.pay-bar.bad { background: var(--bad); }
.pay-bar.ok { background: var(--ok); }
.rel-group { margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.rel-svg { width: 100%; max-width: 620px; height: auto; display: block; margin: 6px auto 0; }

/* 進度條（供應商戰情室：AI 查關係、抓登記資料） */
.prog { margin: 8px 0; }
.prog-track { height: 10px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; margin-top: 4px; }
.prog-fill { height: 100%; background: var(--accent); transition: width .5s; }

/* ---------- 採購報告 ---------- */
.rp-slide { margin-top: 16px; }
.rp-title { margin: 0 0 14px; padding: 10px 16px; border-radius: 10px; background: linear-gradient(90deg, #b00000, #e0101a); color: #fff; font-size: 20px; }
.rp-chart { position: relative; height: 320px; margin-bottom: 12px; }
.rp-arrow { font-size: 22px; }
.rp-arrow.rise { color: #e5484d; }   /* 上升＝紅 */
.rp-arrow.flat { color: #4472c4; }   /* 持平＝藍 */
.rp-arrow.fall { color: #22a06b; }   /* 下降＝綠 */
.rp-sum { margin: 12px 0 0; font-weight: 700; }

/* 列印（匯出 PDF）：只留內容，報告一張一頁；紙張設成 16:9 的寬版，和投影片一樣 */
@page { size: 380mm 214mm; margin: 10mm; }
@media print {
  .topbar, .sidebar, .overlay, .toast, .modal, .no-print { display: none !important; }
  body { background: #fff !important; }
  .main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; }
  .rp-slide { break-after: page; break-inside: avoid; margin-top: 0; border: none; }
  .rp-slide:last-child { break-after: auto; }
  .rp-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
