:root {
  --ink: #2b2b2b; --muted: #6b7280; --navy: #1b3a5c; --navy-2: #24507d;
  --line: #e3e7ec; --bg: #f4f6f8; --card: #ffffff; --accent: #2e8b57;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif; font-size: 16px; color: var(--ink); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--navy); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 700; color: var(--navy); text-decoration: none; letter-spacing: .3px; display: flex; align-items: center; }
.brand-icon { height: 30px; width: auto; margin-right: 10px; }
.pipeline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: stretch; margin: 4px 0 8px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.step .badge { width: 48px; height: 48px; border-radius: 12px; background: var(--navy); display: flex; align-items: center; justify-content: center; margin: 0 0 14px; }
.step .badge svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.step h3 { margin: 0 0 6px; font-size: 17px; color: var(--navy); line-height: 1.3; }
.step p { margin: 0; font-size: 15px; color: #4b5563; }
.pipeline .arrow { display: flex; align-items: center; color: var(--accent); }
.pipeline .arrow svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.home-figure { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px 10px; margin: 4px 0 8px; text-align: center; }
.home-figure img { max-width: 100%; height: auto; }
.home-figure figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 14px; }
.topnav a { color: var(--navy); text-decoration: none; font-size: 14px; margin-left: 20px; }
.topnav a:hover { text-decoration: underline; }

.hero { position: relative; color: #fff; padding: 40px 0 32px; background-color: var(--navy);
  background-image: linear-gradient(100deg, rgba(27,58,92,.97) 0%, rgba(27,58,92,.88) 42%, rgba(27,58,92,.62) 100%), url("hero-ncku.jpg");
  background-size: cover; background-position: center 58%; background-repeat: no-repeat; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--accent) 0%, #4fb286 55%, rgba(79,178,134,0) 100%); }
.hero h1, .hero .subtitle { text-shadow: 0 1px 2px rgba(0,0,0,.28); }
.hero h1 { font-size: 28px; line-height: 1.3; margin: 0 0 8px; font-weight: 700; letter-spacing: -.1px; }
.hero .subtitle { font-size: 18px; line-height: 1.5; opacity: .92; margin: 0; }
.hero.home { padding: 60px 0 52px; } .hero.home h1 { font-size: 34px; }
/* A page can bring its own hero picture (manifest "hero"; the page sets --hero-img inline). The picture is
   meant to be seen, so the overlay is lighter than the default and the text gets a stronger shadow. */
.hero.hero-custom { padding: 56px 0 48px;
  background-image: linear-gradient(100deg, rgba(27,58,92,.84) 0%, rgba(27,58,92,.6) 48%, rgba(27,58,92,.34) 100%), var(--hero-img);
  background-position: center 40%; }
.hero.hero-custom h1, .hero.hero-custom .subtitle { text-shadow: 0 1px 3px rgba(0,0,0,.55), 0 0 14px rgba(0,0,0,.35); }

/* ---- page theme "fall-original": the banner, intro box and footer of the fall Shiny app, reproduced with the
   app's own values (宋醫師final/fall_2026_app/app.R, 2026-05-06). ---- */
body.theme-fall-original { background: #fff; }
.fo-banner { background-color: #1a1a1a; background-size: cover; background-position: center; border-radius: 10px; min-height: 300px;
  padding: 60px 30px; margin: 20px 0; box-shadow: 0 4px 8px rgba(0,0,0,.1); text-align: center; color: #fff;
  display: flex; flex-direction: column; justify-content: center; align-items: center; box-sizing: border-box; }
.fo-banner .panel { background: rgba(0,0,0,.52); padding: 22px 28px; border-radius: 12px; width: min(1120px, 98vw); max-width: 100%; box-sizing: border-box;
  box-shadow: 0 6px 24px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08); }
.fo-banner h1 { font-size: 30px; margin: 0 0 14px; font-weight: 600; color: #ff2222; line-height: 1.25; letter-spacing: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,.85), 0 0 18px rgba(0,0,0,.55), 1px 1px 0 rgba(0,0,0,.4); }
.fo-banner .subtitle { font-size: 18px; color: #f8f9fa; font-weight: 700; margin: 0; line-height: 1.5; opacity: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 10px rgba(0,0,0,.5); }
.fo-intro { background-color: #0a2342; border-radius: 10px; padding: 20px 30px; margin: 20px 0; box-shadow: 0 4px 8px rgba(0,0,0,.2); color: #fff; }
.fo-intro ul { margin: 0; padding-left: 22px; } .fo-intro li, .fo-intro p { color: #fff; font-size: 16px; line-height: 1.6; } .fo-intro p { margin: 0; }
.theme-fall-original .content { padding-top: 0; }
.fo-footer { display: flex; flex-direction: column; align-items: flex-start; width: 100%; margin-top: 8px; padding: 28px 16px 20px;
  background: #fff; border-top: 1px solid #dee2e6; box-sizing: border-box; }
.fo-footer .block { width: 100%; max-width: min(960px, 94vw); margin: 0 auto; align-self: center; box-sizing: border-box; }
.fo-footer .contact-row { display: flex; flex-wrap: wrap; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 28px; width: 100%; margin: 0 0 20px; }
.fo-footer .head-icon { width: 120px; height: auto; flex-shrink: 0; object-fit: contain; }
.fo-footer .contact { font-size: 15px; line-height: 1.55; color: #333; text-align: left; flex: 1; min-width: 200px; }
.fo-footer .contact p { margin: 2px 0; } .fo-footer .contact .name { margin: 0 0 10px; font-size: 17px; } .fo-footer .contact .mail { margin: 10px 0 0; }
.fo-footer .contact a { color: #0969da; text-decoration: none; }
.fo-footer .campus { width: 100%; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.fo-footer .copyright { align-self: stretch; width: 100%; text-align: center; font-size: 12px; color: #777; margin: 16px 0 0; }
/* phones: same picture, panel and red title, but about half the height so the calculator is reached sooner
   (the app itself has no phone rule; desktop keeps the app's values exactly) */
@media (max-width: 767px) {
  .fo-banner { min-height: 0; padding: 32px 14px; margin: 12px 0; }
  .fo-banner .panel { padding: 16px; width: 100%; }
  .fo-banner h1 { font-size: 22px; margin-bottom: 10px; }
  .fo-banner .subtitle { font-size: 15px; }
  .fo-intro { padding: 14px 16px; margin: 12px 0; } .fo-intro li { font-size: 15px; }
}

.intro { background: #fff; border-bottom: 1px solid var(--line); padding: 20px 0; }
.intro p { margin: 0 0 8px; } .intro p:last-child { margin-bottom: 0; }

.content { padding: 24px 0 8px; }
.calc-frame { width: 100%; border: 0; display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.frame-wrap { position: relative; }
.frame-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); text-align: center; padding: 24px; }
.frame-loading.hide { display: none; }
.frame-loading .spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .9s linear infinite; }
.frame-loading p { margin: 0; } .frame-loading small { display: block; font-size: 14px; margin-top: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
.calc-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }

/* The nomogram lightbox (assets/site.js) injects its own styles, so a cached old stylesheet can never leave it unstyled. */
.calc-note a { white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 8px 0 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; text-decoration: none; color: var(--ink);
        display: flex; align-items: center; gap: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
        transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(27,58,92,.14); border-color: #c9d3df; }
.card .card-text { flex: 1; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 17px; color: var(--navy); line-height: 1.35; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.45; }
.card .arrow { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: #eef3f8; color: var(--navy);
               display: flex; align-items: center; justify-content: center; font-size: 18px; transition: background .15s ease, color .15s ease; }
.card:hover .arrow { background: var(--navy); color: #fff; }
h2.section { font-size: 15px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 8px 0 12px; }
.cards + h2.section { margin-top: 28px; }
.archive { font-size: 14px; color: var(--muted); }
.archive a { margin-right: 14px; }

.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 24px 0 28px; margin-top: 24px; }
.notice { padding: 8px 0 0; }
.disclaimer { background: #fff8e6; border-left: 4px solid #e0a800; padding: 12px 16px; margin: 0; color: #5c4a00; }
.author { margin: 0; } .author strong { font-weight: 700; color: var(--navy); }
.copyright { color: var(--muted); font-size: 14px; margin: 12px 0 0; text-align: center; }
.footer-art { display: block; width: 100%; max-width: 1166px; height: auto; margin: 16px auto 0; }

@media (max-width: 640px) {
  .pipeline { grid-template-columns: 1fr; }
  .pipeline .arrow { justify-content: center; } .pipeline .arrow svg { transform: rotate(90deg); }
  .hero h1 { font-size: 22px; } .hero .subtitle { font-size: 16px; } .hero.home h1 { font-size: 26px; }
  .topnav a { margin-left: 14px; white-space: nowrap; }
  .brand { font-size: 15px; white-space: nowrap; }
  .brand span { display: none; }
}
