/* HKISP v2 — Common CSS (shared by ALL pages)
   Created: 2026-05-31
   Edit this ONE file to update ALL pages' base styles
*/

/* Scrollbar fix — prevents layout shift between pages */
html { overflow-y: scroll; }

/* Force light mode — prevents Huawei browser dark mode inversion */
:root { color-scheme: light only; }
html, body { forced-color-adjust: none; -webkit-color-scheme: light; }

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif; background:#44444E; background-image: radial-gradient(#3d3d47 1px, transparent 1px); background-size: 16px 16px; color:#1a1a1a; }

/* Colors */
:root {
  --blue: #1a3a8a;
  --blue-light: #2a5cc7;
  --blue-bg: #eef2fb;
  --red: #c62828;
  --red-light: #ef5350;
  --orange: #d4760a;
  --orange-bg: #fff3e0;
  --red-bg: #fbe9e7;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-light: #444;
  --dark-bg: #0a0a1a;
  --card-bg: #ffffff;
  --side-blue-bg: #0d1b3e;
  --side-red-bg: #3b0a0a;
  --light-text: #cde0ff;
  --light-text-red: #ffd0d0;
}

/* Top Bar */
.topbar { background:#ffffff; border-bottom:2px solid var(--blue); padding:10px 24px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:100; }
.topbar-logo { display:flex; align-items:center; gap:12px; cursor:pointer; }
.topbar-logo .shield { background:transparent; width:44px; height:44px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:22px; color:#fff; }
.topbar-logo h1 { font-size:17px; font-weight:700; color:#1a3a8a; }
.topbar-logo small { font-size:11px; color:#555; display:block; font-weight:700; }
.topbar-nav { display:flex; gap:2px; }
.topbar-nav a { color:#1a1a1a; text-decoration:none; padding:8px 14px; border-radius:6px; font-size:13px; font-weight:500; transition:all 0.2s; }
.topbar-nav a:hover { background:var(--blue-bg); color:var(--blue); }
.topbar-nav a.active { background:var(--blue); color:#fff; }
.topbar::after { content:""; position:absolute; bottom:0; left:0; right:0; height:3px; background:#2a5cc7; }

/* Main Layout - 3 columns */
.main { max-width:1200px; margin:20px auto; display:grid; grid-template-columns:200px 1fr 260px; gap:20px; padding:0 16px; }

/* Page Title */
.page-title { font-size:28px; font-weight:700; color:#ffffff; margin-bottom:6px; }
.page-subtitle { font-size:16px; color:#7b8aaa; margin-bottom:20px; }

/* Content Card (shared by inner pages) */
.content-card { background:#fffef0; border:10px solid #a8c4f0; border-radius:10px; padding:28px; margin-bottom:20px; }
.content-card h2 { font-size:18px; color:#7eb3ff; margin-bottom:12px; padding-bottom:8px; border-bottom:2px solid #2a3050; }
.content-card h3 { font-size:15px; color:var(--red); margin:16px 0 8px; }
.content-card p { line-height:1.8; font-size:14px; color:#222; margin-bottom:10px; }
.content-card strong { color:#1a1a1a; }
.highlight { background:var(--blue-bg); padding:16px 20px; border-radius:8px; border-left:3px solid #7eb3ff; margin:16px 0; }
.highlight p { color:#333; margin-bottom:4px; }
.center-col { min-width:0; }

/* Left Sidebar */
.sidebar-left { position:sticky; top:66px; height:fit-content; max-height:calc(100vh - 80px); overflow-y:auto; }
.side-card { background:#0d1b3e; border:10px solid #a8c4f0; border-radius:10px; padding:14px; margin-bottom:14px; }
.side-card h3 { font-size:11px; color:#ffd700; margin-bottom:10px; text-transform:uppercase; letter-spacing:1px; font-weight:600; }
.side-btn { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:6px; cursor:pointer; transition:all 0.2s; text-decoration:none; color:#ffd700; font-size:13px; }
.side-btn:hover { background:#d4a017; color:#fff; }
.side-btn:active { background:#d4a017; color:#fff; }
.side-btn .icon { width:32px; height:32px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:16px; }

/* Right Sidebar */
.sidebar-right { position:sticky; top:66px; height:fit-content; max-height:calc(100vh - 80px); overflow-y:auto; }
.quick-card { background:#3b1a0a; border:10px solid #f0c8a8; border-radius:10px; padding:14px; margin-bottom:14px; }
.quick-card h3 { font-size:11px; color:var(--orange); margin-bottom:10px; font-weight:600; }
.quick-link { display:block; padding:8px 10px; border-radius:6px; background:rgba(255,255,255,0.1); margin-bottom:6px; text-decoration:none; color:#ffd8b0; font-size:12px; transition:all 0.2s; border:1px solid transparent; }
.quick-link:hover { background:var(--orange); color:#fff; border-color:var(--orange); }
.quick-link .emoji { margin-right:6px; }

/* AI Card */
.ai-card { background:var(--blue); border-radius:10px; padding:18px; color:#fff; margin-bottom:14px; }
.ai-card h3 { font-size:15px; margin-bottom:3px; }
.ai-card p { font-size:11px; opacity:0.85; margin-bottom:10px; }
.ai-card a { display:inline-block; background:rgba(255,255,255,0.2); color:#fff; padding:6px 14px; border-radius:16px; text-decoration:none; font-size:12px; transition:background 0.2s; }
.ai-card a:hover { background:rgba(255,255,255,0.35); }

/* Alert Card */
.alert-card { background:var(--red); border-radius:10px; padding:16px; color:#fff; margin-bottom:14px; }
.alert-card h3 { font-size:14px; margin-bottom:3px; }
.alert-card p { font-size:11px; opacity:0.9; margin-bottom:8px; }
.alert-card a { display:inline-block; background:rgba(255,255,255,0.2); color:#fff; padding:6px 14px; border-radius:16px; text-decoration:none; font-size:12px; }
.alert-card a:hover { background:rgba(255,255,255,0.35); }

/* Stats */
.stat-row { display:flex; justify-content:space-between; align-items:center; padding:5px 0; font-size:12px; color:#e8c8c8; border-bottom:1px solid rgba(255,255,255,0.15); }
.stat-row:last-child { border-bottom:none; }
.stat-num { font-weight:700; color:#ffffff; }
.stat-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin:20px 0; }
.stat-box { text-align:center; padding:18px 10px; background:#ffffff; border:10px solid #a8c4f0; border-radius:10px; }
.stat-box .num { font-size:28px; font-weight:700; color:var(--blue); }
.stat-box .num.red { color:var(--red); }
.stat-box .label { font-size:12px; color:var(--text-light); margin-top:4px; }

/* Contact */
.contact-bar { background:#3b1a0a; border:10px solid #f0c8a8; border-radius:10px; padding:12px 14px; margin-bottom:14px; }
.contact-bar .contact-item { font-size:11px; color:#ffd8b0; margin-bottom:3px; line-height:1.35; display:flex; align-items:center; gap:5px; }

/* Timeline */
.timeline { position:relative; padding-left:24px; border-left:2px solid #2a3050; margin:20px 0; }
.timeline-item { position:relative; margin-bottom:20px; }
.timeline-item::before { content:''; position:absolute; left:-29px; top:4px; width:10px; height:10px; border-radius:50%; background:#7eb3ff; }
.timeline-item .year { font-size:13px; color:var(--red); font-weight:600; }
.timeline-item p { font-size:14px; color:#333; line-height:1.6; }

/* Mobile Nav */
.mobile-nav { display:none; background:#fff; border-bottom:1px solid var(--border); padding:8px 16px; gap:4px; overflow-x:auto; }
.mobile-nav a { white-space:nowrap; padding:6px 12px; border-radius:16px; font-size:12px; text-decoration:none; color:var(--text); background:#f5f5f5; }
.mobile-nav a.active { background:var(--blue); color:#fff; }

/* Responsive */
@media (max-width:900px) {
  .main { grid-template-columns:1fr; }
  .sidebar-left, .sidebar-right { display:none; }
  .topbar-nav { display:none; }
  .mobile-nav { display:flex !important; }
}
