/* msoradar.com — styles. Mobile-first, dependency-free.
   Visual language mirrors sfcradar.com: light mint canvas, teal accent,
   white rounded cards, Raleway headings + Lato body. */

:root {
  --bg-dark: #eef3f2;        /* page canvas */
  --bg-card: #ffffff;
  --surface: #e9f9f8;        /* tinted panels */
  --accent: #007a72;         /* primary teal */
  --accent-secondary: #17b4a5;
  --accent-blue: #2d669d;
  --accent-ink: #0f6b63;     /* darker teal for text on tints */
  --ink: #262626;            /* text-main */
  --navy: #262626;           /* legacy alias -> dark ink */
  --navy-2: #1f4f4a;
  --muted: #5f6e6c;          /* text-muted */
  --line: rgba(15, 23, 42, .08);  /* border-muted */
  --bg: var(--bg-dark);
  --bg-soft: #f3faf9;
  --bg-tint: var(--surface);
  --ok: #16a34a;
  --warn: #b45309;
  --danger: #dc2626;
  --radius: 12px;
  --radius-lg: 16px;
  --maxw: 1040px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-lg: 0 6px 24px rgba(15, 23, 42, .08);
  --head: 'Raleway', -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang HK", "Microsoft JhengHei", sans-serif;
  --font: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
    "PingFang HK", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(0, 122, 114, .06) 0%, transparent 42%),
    radial-gradient(circle at 92% 88%, rgba(23, 180, 165, .06) 0%, transparent 46%);
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 16.5px;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html[lang^="zh"] body { line-height: 1.8; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

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

h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); line-height: 1.25; font-weight: 800; }
h1 { font-size: 2rem; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 {
  font-size: 1.4rem; font-weight: 700; margin: 1.8em 0 .7em;
  display: flex; align-items: center; gap: .55rem;
}
h2::before {
  content: ""; width: 4px; height: 1.05em; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(var(--accent), var(--accent-secondary));
}
h3 { font-size: 1.12rem; font-weight: 700; margin: 1.5em 0 .4em; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav (sticky white top bar) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--bg-card);
  border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; min-height: 66px;
}
.brand {
  display: flex; align-items: center; gap: .7rem; margin-right: auto;
  color: var(--ink); text-decoration: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff; font-weight: 800; font-size: 1.35rem; box-shadow: 0 2px 8px rgba(0, 122, 114, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--head); font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.brand-text small { font-size: .7rem; color: var(--muted); font-weight: 400; }

/* Disclaimer strip under the header */
.disclaimer-bar {
  background: #fff8ed; border-bottom: 1px solid rgba(245, 158, 11, .4); color: #6b4a00;
  font-size: .82rem; line-height: 1.5; padding: .5rem 0;
}
.disclaimer-bar .db-icon { color: #d97706; margin-right: .35rem; font-weight: 700; }
.disclaimer-bar strong { color: var(--danger); }
.disclaimer-bar a { color: var(--accent); font-weight: 700; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.site-nav ul { display: flex; gap: .45rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600;
  padding: .4rem .85rem; border: 1px solid var(--line); border-radius: 18px;
  white-space: nowrap; background: var(--bg-card);
}
.site-nav a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.site-nav a.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.lang-switch {
  border: 1px solid var(--accent) !important; border-radius: 999px; padding: .4rem 1rem !important;
  font-weight: 700; color: var(--accent) !important; background: var(--bg-card);
}
.lang-switch:hover { background: var(--accent) !important; color: #fff !important; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 4px 0; transition: .2s; }

/* ---------- Content ---------- */
.content { padding: 22px 20px 60px; }
.content p, .content li { color: var(--ink); }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin: .35em 0; }

/* Tables — card-like, sfcradar styling */
.content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92rem; }
.content th {
  text-align: left; padding: .6rem .8rem; border-bottom: 2px solid var(--line);
  color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
}
.content td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid rgba(15, 23, 42, .05); vertical-align: top; }
.content tbody tr:nth-child(even) td { background: rgba(0, 122, 114, .022); }
.content tbody tr:hover td { background: rgba(0, 122, 114, .06); }

.content blockquote {
  margin: 1.4em 0; padding: .85rem 1.1rem; background: var(--surface);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; color: var(--muted);
}
.content blockquote p { color: var(--muted); margin: .4em 0; }
.content code { background: var(--surface); padding: 1px 6px; border-radius: 5px; font-size: .9em; color: var(--accent-ink); }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Hero (home) — white card with teal top accent */
.hero {
  position: relative; background: var(--bg-card); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: var(--radius-lg);
  padding: 2rem 1.9rem; margin: 0 0 1.4rem; box-shadow: var(--shadow);
}
.hero h1 { color: var(--ink); font-size: clamp(1.5rem, 4.4vw, 2.2rem); }
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.hero .btn-row { margin-top: 1.3rem; }

/* Hero with imagery: text + two figures side by side */
.hero-media { display: grid; grid-template-columns: 1.08fr .92fr; gap: 2rem; align-items: center; }
.hero-figs { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.hero-fig { margin: 0; }
.hero-fig img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.hero-fig figcaption {
  text-align: center; margin-top: .45rem; font-size: .82rem; font-weight: 700;
  color: var(--accent); font-family: var(--head);
}
@media (max-width: 760px) {
  .hero-media { grid-template-columns: 1fr; gap: 1.3rem; }
}

/* Buttons (map to sfcradar .cta) */
.btn, a.btn {
  display: inline-flex; align-items: center; gap: .5rem; background: var(--accent);
  color: #fff !important; text-decoration: none; padding: .65rem 1.2rem; border-radius: 10px;
  font-weight: 700; font-size: .92rem; margin: 4px 8px 4px 0; border: 1px solid transparent;
}
.btn:hover { background: #016d66; text-decoration: none; }
.btn.ghost { background: var(--bg-card); color: var(--accent) !important; border-color: rgba(0, 122, 114, .4); }
.btn.ghost:hover { background: var(--surface); }
.btn.secondary { background: var(--bg-card); color: var(--ink) !important; border-color: var(--line); }
.btn.secondary:hover { background: var(--surface); }

/* Stat figures */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 1.4rem 0; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  border-radius: var(--radius); padding: 18px 20px; text-align: center; box-shadow: var(--shadow);
}
.stat .num { font-family: var(--head); font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-top: 6px; }

/* Card grid */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 1.4rem 0; }
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3 { margin-top: 0; color: var(--ink); }
.card p { color: var(--muted); font-size: .94rem; }

/* Callouts */
.callout { padding: .95rem 1.2rem; border-radius: var(--radius); margin: 1.4em 0; border: 1px solid var(--line); font-size: .95rem; }
.callout.info { background: var(--surface); border-color: rgba(0, 122, 114, .25); color: var(--accent-ink); }
.callout.info a { color: var(--accent); }
.callout.warn { background: #fff8ed; border-color: rgba(245, 158, 11, .4); color: #7c2d12; }
.callout.warn a { color: var(--warn); }
.callout strong { color: inherit; }

/* Step list */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.4em 0; }
.steps > li {
  position: relative; padding: 4px 0 18px 52px; margin: 0; border-left: 2px solid var(--line); margin-left: 16px;
}
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -17px; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary)); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}
.steps > li:last-child { border-left-color: transparent; }
.steps h3 { margin: 0 0 .2em; }

/* Source list */
.sources { font-size: .9rem; color: var(--muted); }

/* ---------- Directory app ---------- */
.dir-controls { display: grid; gap: 12px; margin: 18px 0; }
.dir-search {
  width: 100%; padding: .8rem 1rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-family: inherit; background: var(--bg-card);
}
.dir-search:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.dir-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dir-filters select {
  padding: .55rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); font-family: inherit;
  font-size: .92rem; background: var(--bg-card);
}
.dir-meta { color: var(--muted); font-size: .9rem; margin: 6px 0 14px; }
.dir-results { display: grid; gap: 12px; }
.op {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  background: var(--bg-card); box-shadow: var(--shadow);
}
.op summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.op summary::-webkit-details-marker { display: none; }
.op .op-name { font-family: var(--head); font-weight: 700; color: var(--ink); }
.op .op-zh { color: var(--muted); font-weight: 400; font-size: .95em; }
.op .op-count { color: var(--accent); font-size: .82rem; white-space: nowrap; font-weight: 700; }
.op .op-premises { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.op .op-premises li { padding: 10px 0; border-bottom: 1px solid var(--surface); font-size: .92rem; }
.op .op-premises li:last-child { border-bottom: 0; }
.badge {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px;
  margin-left: 6px; background: rgba(0, 122, 114, .1); color: var(--accent-ink);
  border: 1px solid rgba(0, 122, 114, .25); vertical-align: middle;
}
.badge.corr { background: rgba(245, 158, 11, .12); color: var(--warn); border-color: rgba(245, 158, 11, .35); }
.dir-empty, .dir-loading { padding: 30px; text-align: center; color: var(--muted); }
.dir-more { text-align: center; margin: 18px 0; }
.changes-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 18px 0; }
.changes-box .added { color: var(--ok); }
.changes-box .removed { color: var(--warn); }

/* ---------- Operator / office detail pages ---------- */
.crumbs { font-size: .86rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--accent); }
.alt-name { color: var(--muted); margin-top: -.4em; font-size: 1.05rem; }
.op-lead { color: var(--muted); font-size: 1.05rem; }

.map {
  width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); margin: 12px 0; position: relative; z-index: 0;
}
.map.map-loading::after, .map.map-empty::after {
  content: attr(data-msg); position: absolute; inset: 0; display: grid; place-items: center;
  text-align: center; padding: 20px; color: var(--muted); background: var(--surface);
  border-radius: var(--radius); z-index: 500;
}
.map-note { font-size: .82rem; color: var(--muted); margin-top: -2px; }

/* Embedded Google Map (office detail page) */
.gmap {
  width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius);
  margin: 12px 0; display: block; background: var(--surface);
}
@media (max-width: 600px) { .gmap { height: 320px; } }

.office-list { list-style: none; padding: 0; margin: 14px 0; }
.office-item {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
  background: var(--bg-card); box-shadow: var(--shadow);
}
.office-link { display: block; color: var(--ink); text-decoration: none; font-size: .96rem; font-weight: 600; }
.office-link:hover { color: var(--accent); }
.office-tags { margin-top: 6px; }
.office-a { color: var(--ink); text-decoration: none; }
.office-a:hover { color: var(--accent); text-decoration: underline; }
.op-actions { margin-top: 12px; }

.office-table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.office-table th, .office-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.office-table th { width: 130px; color: var(--muted); background: var(--surface); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }

/* Leaflet popup links */
.leaflet-popup-content a { color: var(--accent); font-weight: 600; }

/* ---------- Footer (rich: services + about + disclaimer + contact) ---------- */
.site-footer { background: var(--bg-card); border-top: 3px solid var(--accent); margin-top: 2.5rem; }
.site-footer * { box-sizing: border-box; }
.site-footer .fwrap { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 20px; }
.site-footer .help-title { font-family: var(--head); font-size: 1.3rem; font-weight: 800; color: var(--ink); margin: 0; }
.site-footer .help-sub { color: var(--muted); font-size: .9rem; margin: .3rem 0 1.2rem; }
.site-footer .help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); gap: 1rem; }
.site-footer .help-card { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.15rem; background: rgba(0,122,114,.03); display: flex; flex-direction: column; }
.site-footer .help-card h4 { font-family: var(--head); font-size: 1rem; font-weight: 700; color: var(--ink); margin: 0 0 .4rem; }
.site-footer .help-card p { color: var(--muted); font-size: .85rem; line-height: 1.6; flex: 1; margin: 0; }
.site-footer .wa-btn { align-self: flex-start; margin-top: .9rem; background: #25d366; color: #fff !important; font-weight: 700; font-size: .84rem; padding: .55rem .95rem; border-radius: 8px; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
.site-footer .wa-btn:hover { background: #1ebe5a; text-decoration: none; }
.site-footer .foot-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.2rem; margin-top: 2.2rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.site-footer h3.fh { font-family: var(--head); font-size: 1.05rem; font-weight: 800; color: var(--ink); margin: 0 0 .5rem; }
.site-footer .about > p { color: var(--ink); font-size: .92rem; line-height: 1.65; margin: 0 0 .2rem; }
.site-footer .about h5 { font-family: var(--head); font-size: .88rem; font-weight: 700; color: var(--accent); margin: .9rem 0 .15rem; }
.site-footer .about h5 + p { color: var(--muted); font-size: .87rem; line-height: 1.65; margin: 0; }
.site-footer .foot-disclaimer { margin-top: 1rem; padding: .9rem 1.1rem; background: #fff8ed; border: 1px solid rgba(245,158,11,.4); border-radius: 10px; }
.site-footer .foot-disclaimer h5 { color: #7c2d12 !important; margin-top: 0 !important; }
.site-footer .foot-disclaimer p { color: #7c2d12 !important; }
.site-footer .op .op-name { color: var(--ink); font-weight: 700; }
.site-footer .op { color: var(--muted); font-size: .88rem; line-height: 1.95; }
.site-footer .op a { color: var(--accent); text-decoration: none; }
.site-footer .op a:hover { text-decoration: underline; }
.site-footer .foot-legal { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.65; }
@media (max-width: 700px) {
  .site-footer .foot-cols { grid-template-columns: 1fr; gap: 1.4rem; }
  .site-footer .fwrap { padding: 2rem 16px; }
  .site-footer .wa-btn { align-self: stretch; justify-content: center; }
}

/* ---------- Splash / 404 ---------- */
body.splash {
  display: grid; place-items: center; min-height: 100vh;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(0, 122, 114, .1) 0%, transparent 45%),
    radial-gradient(circle at 92% 88%, rgba(23, 180, 165, .1) 0%, transparent 48%);
}
.splash-card {
  background: var(--bg-card); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg); padding: 44px; max-width: 560px; text-align: center;
  box-shadow: var(--shadow-lg); margin: 20px;
}
.splash-card h1 { font-size: 1.9rem; }
.splash-links { margin-top: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 66px; left: 0; right: 0; background: var(--bg-card);
    flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px 16px;
    display: none; box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--line); z-index: 50;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 6px; }
  .site-nav a { padding: 12px 12px; border-radius: 8px; }
  .lang-switch { margin-top: 10px; text-align: center; }
  .hero { padding: 1.4rem 1.2rem; }
  h1 { font-size: 1.7rem; }
}
