/* =============================================================================
   aboutrisks.com — 设计系统
   定位：香港金融资讯 / 合规查询，专业、克制、可信
   配色：深海军蓝（权威）+ 金色（金融）+ 中性灰阶；语义色仅用于牌照状态
   ============================================================================= */

:root {
  --navy: #0b2a4a;
  --navy-700: #123a60;
  --navy-100: #e7eef6;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --gold: #b8893b;
  --gold-soft: #f6efe1;

  --ok: #047857;
  --ok-bg: #e7f6ef;
  --warn: #b45309;
  --warn-bg: #fdf3e3;
  --danger: #b3261e;
  --danger-bg: #fdeceb;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 4px 16px rgba(15, 23, 42, .08);
  --container: 1180px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang HK",
    "PingFang SC", "Microsoft JhengHei", "Hiragino Sans GB", "Noto Sans HK", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; letter-spacing: -.01em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; }
p { margin: 0 0 .75rem; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.mono { font-family: var(--font-mono); }

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  height: 60px;
}
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; letter-spacing: -.02em; font-size: 1.125rem; color: var(--navy); }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); display: inline-block; }
.brand small { font-weight: 500; font-size: .6875rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: var(--radius-sm); font-size: .9375rem; color: var(--ink-soft); }
.nav a:hover { background: var(--bg-soft); text-decoration: none; }
.nav a.is-active { color: var(--navy); font-weight: 600; background: var(--navy-100); }

.lang-toggle {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  font-size: .75rem; font-weight: 600;
}
.lang-toggle button {
  border: 0; background: #fff; color: var(--muted); padding: 4px 12px; cursor: pointer; font: inherit;
}
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ------------------------------ Hero ------------------------------ */
.hero { padding: 40px 0 28px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%); }
.hero .eyebrow { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.hero h1 { margin: 10px 0 12px; max-width: 720px; }
.hero p.lede { color: var(--ink-soft); max-width: 640px; font-size: 1.0625rem; }

/* ------------------------------ Cards ------------------------------ */
.card {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.card-hover { transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.card-hover:hover { box-shadow: var(--shadow); border-color: #cfdae8; text-decoration: none; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ------------------------------ Badges ------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.tone-ok { color: var(--ok); background: var(--ok-bg); border-color: #cfe9dc; }
.badge.tone-warn { color: var(--warn); background: var(--warn-bg); border-color: #f2ddba; }
.badge.tone-danger { color: var(--danger); background: var(--danger-bg); border-color: #f3cdca; }
.badge.tone-muted { color: var(--muted); background: var(--bg-soft); border-color: var(--line); }
.badge.tone-navy { color: var(--navy); background: var(--navy-100); border-color: #cfdcec; }

.risk-pill { font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; }
.risk-Low { color: var(--ok); background: var(--ok-bg); }
.risk-Medium { color: var(--warn); background: var(--warn-bg); }
.risk-High { color: var(--danger); background: var(--danger-bg); }

/* ------------------------------ Form controls ------------------------------ */
input[type="text"], input[type="search"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 42, 74, .1); }
textarea { min-height: 120px; resize: vertical; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .9375rem; cursor: pointer;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--navy);
  background: var(--navy); color: #fff; transition: background .15s ease, opacity .15s ease;
}
.btn:hover { background: var(--navy-700); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--navy); }
.btn-ghost:hover { background: var(--navy-100); }
.btn-sm { padding: 5px 10px; font-size: .8125rem; }

/* ------------------------------ Search ------------------------------ */
.searchbar { display: flex; gap: 10px; }
.searchbar input { flex: 1; font-size: 1rem; padding: 12px 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .filter { min-width: 150px; }
.filters label.field { margin-bottom: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: .8125rem; cursor: pointer; color: var(--ink-soft); font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------ Institution card ------------------------------ */
.inst-card { display: flex; flex-direction: column; gap: 10px; }
.inst-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.inst-name { font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.inst-name-en { font-size: .8125rem; color: var(--muted); margin-top: 2px; }
.inst-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.inst-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: .75rem; color: var(--muted);
}
.inst-foot a { font-weight: 600; }

/* ------------------------------ Ad ------------------------------ */
.ad {
  border: 1px solid var(--line); background: var(--bg-soft);
  border-radius: var(--radius); padding: 12px; margin: 16px 0;
}
.ad-label {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: .625rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 700; margin-bottom: 8px;
}
.ad-creative {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; border-radius: var(--radius-sm); overflow: hidden;
  background: linear-gradient(120deg, #e8eef7 0%, #f4f7fb 100%);
  border: 1px solid var(--line-soft); color: var(--navy);
  font-weight: 700; letter-spacing: -.01em; text-align: center; padding: 14px;
}
.ad-creative img { width: 100%; height: auto; }
.ad-note {
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line);
  font-size: .6875rem; line-height: 1.5; color: var(--muted);
}

/* ------------------------------ Article ------------------------------ */
.article-card { display: flex; flex-direction: column; gap: 8px; }
.article-card .kicker { font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--gold); }
.article-card h3 { color: var(--ink); }
.article-card .summary { color: var(--ink-soft); font-size: .9375rem; }
.article-card .meta { font-size: .75rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }

.prose { max-width: 720px; font-size: 1.0625rem; color: var(--ink-soft); }
.prose h2 { margin: 28px 0 10px; font-size: 1.25rem; color: var(--ink); }
.prose h3 { margin: 22px 0 8px; color: var(--ink); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

.disclosure {
  border-left: 3px solid var(--gold); background: var(--gold-soft);
  padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .8125rem; color: #6b4e1c; margin: 16px 0;
}

/* ------------------------------ Newsletter ------------------------------ */
.newsletter { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 26px; }
.newsletter h2 { color: #fff; }
.newsletter p { color: #cfdcec; }
.newsletter .form-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.newsletter input[type="email"] { flex: 1; min-width: 220px; border-color: transparent; }
.newsletter .btn { background: var(--gold); border-color: var(--gold); color: #241a08; }
.newsletter .btn:hover { background: #a97a30; }
.newsletter .legal { font-size: .75rem; color: #9fb3ca; margin-top: 10px; }

.notice { border-radius: var(--radius-sm); padding: 10px 14px; font-size: .875rem; margin: 12px 0; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cfe9dc; }
.notice-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f2ddba; }
.notice-err { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3cdca; }

/* ------------------------------ Demo banner ------------------------------ */
.demo-banner {
  background: var(--warn-bg); color: var(--warn); border: 1px solid #f2ddba;
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: .8125rem; font-weight: 600;
  display: none;
}
.demo-banner.is-shown { display: block; }

/* ------------------------------ Table (admin) ------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .875rem; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: var(--bg-soft); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
td .btn { margin-right: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; font: inherit; font-weight: 600; font-size: .9375rem;
  padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--gold); }

.panel[hidden] { display: none; }

/* ------------------------------ Modal ------------------------------ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%;
  max-height: 85vh; overflow: auto; padding: 24px; box-shadow: var(--shadow);
}
.modal header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.modal .close { border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; font-size: .875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ------------------------------ Footer ------------------------------ */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--bg-soft); padding: 28px 0; font-size: .8125rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer strong { color: var(--ink-soft); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------ Responsive ------------------------------ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 10px; }
  .nav { width: 100%; margin-left: 0; }
  .kv { grid-template-columns: 1fr; }
}
