/* =====================================================
   HealthBeijing — Expats' Health Companion in Beijing
   Design system: International medical teal + China-red accents
   ===================================================== */

:root {
  --teal: #0E7C7B;          /* primary medical teal */
  --teal-dark: #0A5F5E;
  --teal-soft: #E6F2F2;     /* soft tint bg */
  --navy: #1D3557;          /* headings / footer */
  --navy-deep: #14263F;
  --red: #C8102E;           /* China red accent */
  --red-soft: #FBECEE;
  --gold: #C9A45C;
  --bg: #F8FAF9;            /* cloud white */
  --card: #FFFFFF;
  --text: #243B4A;
  --muted: #61707C;
  --border: #E3EAE8;
  --amber: #B7791F; --amber-soft: #FBF3E4;
  --green: #2F855A; --green-soft: #E8F5EE;
  --blue: #2B6CB0; --blue-soft: #E8F1FB;
  --purple: #6B46C1; --purple-soft: #F0EAFB;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(29,53,87,.08);
  --shadow-lg: 0 12px 30px rgba(29,53,87,.14);
  --font: "Inter", "Segoe UI", -apple-system, "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.35; font-weight: 700; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 44px 0 8px; }

/* ---------- Header ---------- */

.site-header { position: sticky; top: 0; z-index: 100; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 1px 8px rgba(29,53,87,.05); }
.red-strip { height: 4px; background: linear-gradient(90deg, var(--red) 0%, #E2453F 50%, var(--red) 100%); }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .seal {
  width: 40px; height: 40px; flex: none; border-radius: 9px;
  background: var(--red); color: #fff; font-family: "STKaiti","KaiTi","SimSun",serif;
  font-size: 23px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55);
}
.brand-text b { display: block; font-size: 18px; color: var(--navy); letter-spacing: .3px; }
.brand-text i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); letter-spacing: .4px; }
.main-nav { display: flex; flex-wrap: wrap; }
.main-nav a { color: #3D5162; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 8px; border-bottom: 2px solid transparent; }
.main-nav a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.main-nav a.active { color: var(--teal-dark); background: var(--teal-soft); }
.lang-switch { display: inline-flex; border: 1.5px solid var(--teal); border-radius: 999px; overflow: hidden; font-size: 13px; font-weight: 600; }
.lang-switch a { padding: 5px 14px; color: var(--teal-dark); }
.lang-switch a.on { background: var(--teal); color: #fff; }

/* ---------- Hero ---------- */

.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(140deg, var(--navy-deep) 0%, var(--navy) 45%, #16556B 100%); padding: 74px 20px 128px; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.hero-badge { display: inline-block; font-size: 12.5px; letter-spacing: 2.5px; text-transform: uppercase; color: #9FD6D5; border: 1px solid rgba(159,214,213,.45); border-radius: 999px; padding: 4px 16px; margin-bottom: 18px; }
.hero h1 { color: #fff; font-size: 40px; letter-spacing: .5px; max-width: 780px; margin: 0 auto; }
.hero .sub { margin: 14px auto 0; max-width: 680px; font-size: 16.5px; color: rgba(255,255,255,.86); }
.hero .sub-zh { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.62); font-family: "STKaiti","KaiTi",serif; letter-spacing: 2px; }
.hero-actions { margin-top: 26px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-deco { position: absolute; left: 0; right: 0; bottom: -3px; width: 100%; height: 110px; pointer-events: none; }

/* emergency strip inside hero */
.hero-er {
  position: relative; margin: 30px auto 0; max-width: 860px;
  background: rgba(200,16,46,.18); border: 1px solid rgba(255,255,255,.22); border-radius: 12px;
  padding: 14px 18px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
}
.hero-er .er-item { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.hero-er .er-item b { font-size: 23px; color: #fff; }
.hero-er .er-item span { font-size: 11.5px; letter-spacing: 1px; color: rgba(255,255,255,.75); text-transform: uppercase; }
.hero-er .er-label { align-self: center; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: #FFD7DD; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero { position: relative; color: #fff; background: linear-gradient(120deg, var(--navy-deep), #16556B); padding: 52px 20px 44px; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.page-hero-inner { position: relative; max-width: 1100px; margin: 0 auto; }
.crumb { font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: #9FD6D5; margin-bottom: 8px; }
.page-hero h1 { color: #fff; font-size: 32px; }
.page-hero p { max-width: 760px; margin-top: 10px; color: rgba(255,255,255,.85); font-size: 15.5px; }

/* ---------- Section titles ---------- */

.sec-head { text-align: center; margin-bottom: 26px; }
.sec-tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 3px 14px; }
.sec-head h2 { font-size: 26px; margin-top: 10px; }
.sec-head p { max-width: 720px; margin: 8px auto 0; color: var(--muted); font-size: 15px; }

h3.block-title { font-size: 19px; margin: 24px 0 12px; padding-left: 12px; border-left: 4px solid var(--red); }

/* ---------- Cards ---------- */

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.module-card { display: block; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 22px; color: var(--text); transition: transform .22s ease, box-shadow .22s ease; }
.module-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: var(--text); }
.module-card .mc-icon { font-size: 30px; }
.module-card h3 { font-size: 17.5px; margin: 10px 0 6px; }
.module-card p { font-size: 13.5px; color: var(--muted); line-height: 1.65; }

/* ---------- Chips / badges ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 9px; margin: 6px 0 10px; }
.chip { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; font-size: 13px; color: var(--muted); }
.chip b { color: var(--navy); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; padding: 2px 10px; border-radius: 999px; }
.badge.teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }

/* ---------- Buttons ---------- */

.btn { display: inline-block; cursor: pointer; border: 1px solid var(--teal-dark); background: var(--teal); color: #fff; font-size: 15px; font-weight: 600; padding: 10px 24px; border-radius: 10px; transition: background .18s ease; }
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--teal-dark); border: 1.5px solid var(--teal); }
.btn-outline:hover { background: var(--teal-soft); color: var(--teal-dark); }
.btn-red { background: var(--red); border-color: #A30C26; }
.btn-red:hover { background: #A30C26; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Info lists ---------- */

.point-list { list-style: none; margin: 10px 0; }
.point-list li { position: relative; padding: 7px 0 7px 24px; font-size: 14.5px; border-bottom: 1px dashed var(--border); }
.point-list li:last-child { border-bottom: none; }
.point-list li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); }
.point-list li b { color: var(--navy); }

.callout { border-radius: 12px; padding: 16px 18px; font-size: 14.5px; margin: 14px 0; }
.callout.teal { background: var(--teal-soft); border-left: 4px solid var(--teal); }
.callout.red { background: var(--red-soft); border-left: 4px solid var(--red); }
.callout b { color: var(--navy); }

.src-note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.src-note a { color: var(--muted); text-decoration: underline; }

/* ---------- Steps ---------- */

.steps { counter-reset: step; display: grid; gap: 14px; margin: 14px 0; }
.step { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 16px 64px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 16px; top: 16px; width: 32px; height: 32px;
  background: var(--teal); color: #fff; font-weight: 700; font-size: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.step h4 { font-size: 16px; }
.step p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.step .zh-show { margin-top: 8px; }

/* ---------- Show-card (Chinese phrases) ---------- */

.show-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; }
.show-card .ph-en { font-size: 14px; color: var(--muted); }
.show-card .ph-zh { font-size: 18px; font-weight: 700; color: var(--navy); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; }
.copy-btn { flex: none; border: 1.5px solid var(--teal); color: var(--teal-dark); background: var(--teal-soft); font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.copy-btn:hover { background: var(--teal); color: #fff; }
.copy-btn.copied { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Hospital cards ---------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; }
.filter-bar label { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.filter-bar select { font-family: var(--font); font-size: 14px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--bg); }
.hosp-count { margin-left: auto; font-size: 13px; color: var(--muted); }

.hosp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.hosp-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.hosp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hosp-card .hc-img { height: 150px; background: linear-gradient(135deg, var(--navy), #16556B); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-size: 44px; font-weight: 700; overflow: hidden; }
.hosp-card .hc-img img { width: 100%; height: 100%; object-fit: cover; }
.hosp-card .hc-body { padding: 16px 18px 18px; }
.hosp-card h3 { font-size: 16.5px; }
.hosp-card .hc-en { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hosp-card .hc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hosp-card .hc-meta { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.no-result { text-align: center; color: var(--muted); padding: 34px 0; display: none; }

/* ---------- Modal ---------- */

.modal-mask { position: fixed; inset: 0; background: rgba(20,38,63,.55); display: none; align-items: flex-start; justify-content: center; z-index: 200; padding: 40px 16px; overflow-y: auto; }
.modal-mask.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 780px; width: 100%; padding: 28px 30px; position: relative; box-shadow: var(--shadow-lg); }
.modal .close-x { position: absolute; right: 16px; top: 12px; font-size: 22px; color: var(--muted); background: none; border: none; cursor: pointer; }
.modal .close-x:hover { color: var(--red); }
.modal h3 { font-size: 21px; padding-right: 30px; }
.modal .m-en { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.modal .m-badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 14px; }
.modal .m-row { display: flex; gap: 10px; font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.modal .m-row b { flex: none; width: 148px; color: var(--navy); font-size: 13px; }
.modal .m-row span { color: var(--text); }
.modal .m-desc { font-size: 14.5px; color: var(--text); margin: 12px 0; }
.modal .m-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.modal .m-links a { font-size: 13.5px; font-weight: 600; }

/* ---------- Season cards ---------- */

.season-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.season-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.season-card .sc-head { padding: 14px 20px; color: #fff; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; }
.season-card.spring .sc-head { background: linear-gradient(120deg, #2F855A, #68B08C); }
.season-card.summer .sc-head { background: linear-gradient(120deg, #B7791F, #DFA43C); }
.season-card.autumn .sc-head { background: linear-gradient(120deg, #9C4221, #C97B4A); }
.season-card.winter .sc-head { background: linear-gradient(120deg, #2B6CB0, #5A8FC4); }
.season-card .sc-body { padding: 16px 20px 18px; font-size: 14px; color: var(--text); }
.season-card .sc-body li { margin: 6px 0 6px 18px; }

/* ---------- TCM glossary ---------- */

.tcm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tcm-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; border-top: 3px solid var(--red); }
.tcm-card h4 { font-size: 16.5px; }
.tcm-card .tc-zh { font-size: 13px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.tcm-card p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Triage wizard ---------- */

.triage { background: #fff; border: 1.5px solid var(--teal); border-radius: var(--radius); padding: 24px 26px; max-width: 720px; margin: 0 auto; }
.triage-q { font-size: 16.5px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.triage-opts { display: grid; gap: 9px; }
.triage-opt { text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 11px 15px; font-size: 14.5px; cursor: pointer; }
.triage-opt:hover { border-color: var(--teal); background: var(--teal-soft); }
.triage-result { margin-top: 8px; }
.triage-result .tr-box { border-radius: 12px; padding: 18px 20px; font-size: 14.5px; }
.tr-box.lvl-er { background: var(--red-soft); border-left: 4px solid var(--red); }
.tr-box.lvl-clinic { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.tr-box.lvl-self { background: var(--green-soft); border-left: 4px solid var(--green); }
.tr-box b { display: block; font-size: 16px; color: var(--navy); margin-bottom: 5px; }

/* ---------- Resource directory (wellness) ---------- */

.res-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.res-card h4 { font-size: 16px; }
.res-card .r-zh { font-size: 12.5px; color: var(--muted); }
.res-card p { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.res-card .r-link { font-size: 12.5px; color: var(--teal-dark); font-weight: 600; }

/* ---------- FAQ accordion ---------- */

.faq-item { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.faq-item .faq-q { width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 16px 20px; font-size: 15.5px; font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; gap: 12px; }
.faq-item .faq-q::after { content: "+"; color: var(--teal); font-size: 20px; flex: none; }
.faq-item.open .faq-q::after { content: "–"; }
.faq-a { display: none; padding: 0 20px 16px; font-size: 14.5px; color: var(--text); }
.faq-item.open .faq-a { display: block; }

/* ---------- Tables ---------- */

.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 14px; }
.tbl th { background: var(--teal); color: #fff; text-align: left; padding: 11px 14px; font-size: 13.5px; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:nth-child(even) td { background: #FBFDFC; }

/* ---------- Footer ---------- */

.site-footer { margin-top: 64px; background: var(--navy-deep); color: rgba(255,255,255,.78); padding: 40px 0 20px; }
.foot-cols { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 34px; }
.foot-cols h4 { color: #9FD6D5; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 12px; }
.foot-cols p, .foot-cols li { font-size: 13px; line-height: 1.85; color: rgba(255,255,255,.72); }
.foot-cols ul { list-style: none; }
.foot-cols li { padding: 3px 0; }
.foot-cols a { color: rgba(255,255,255,.85); }
.foot-cols a:hover { color: #9FD6D5; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.foot-brand b { color: #fff; font-size: 17px; }
.foot-er { background: rgba(200,16,46,.22); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.foot-er b { color: #FFD7DD; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.14); margin-top: 26px; padding-top: 14px; text-align: center; font-size: 12px; color: rgba(255,255,255,.5); }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .tcm-grid { grid-template-columns: repeat(2, 1fr); }
  .hosp-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2, .hosp-grid, .season-grid, .tcm-grid { grid-template-columns: 1fr; }
  .hero { padding: 54px 16px 120px; }
  .hero h1 { font-size: 27px; }
  .page-hero h1 { font-size: 25px; }
  .header-inner { justify-content: center; }
  .foot-cols { grid-template-columns: 1fr; gap: 18px; }
  .modal { padding: 22px 18px; }
  .modal .m-row b { width: 118px; }
}
