/* ============================================================
   香港靜脈曲張治療中心 — Shared Layout CSS
   Modern, professional medical aesthetic · low color noise
   ============================================================ */

:root {
  --primary: #03639f;
  --primary-dark: #024b79;
  --primary-light: #e3eff7;
  --accent-whatsapp: #25d366;
  --accent-whatsapp-dark: #128c7e;
  --text: #263238;
  --text-muted: #5b6f7c;
  --border: #cdd8e0;
  --border-light: #e8eef3;
  --bg: #ffffff;
  --bg-alt: #f5f8fb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
  --max-w: 1100px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft JhengHei", "PingFang TC", "PingFang HK", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============ Sticky Header + Nav Wrapper ============ */
.sticky-header-group {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.site-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.header-logo {
  display: block;
  width: 300px;
  height: 78px;
  background: url("../images/logo.png") no-repeat left center / contain;
  background: url("../images/logo.webp") no-repeat left center / contain;
  text-indent: -9999px;
  flex-shrink: 0;
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .header-logo {
    background-image: url("../images/logo@2x.webp");
  }
}

.header-contacts {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 14px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  white-space: nowrap;
  transition: color var(--transition);
}
.contact-item svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
  transition: fill var(--transition);
  flex-shrink: 0;
}
.contact-item:hover { color: var(--primary); }
.contact-item:hover svg { fill: var(--primary); }
.contact-item.whatsapp-item svg { fill: var(--accent-whatsapp); }
.contact-item.whatsapp-item:hover svg { fill: var(--accent-whatsapp-dark); }

.contact-item.location-item { cursor: default; color: var(--text-muted); }
.contact-item.location-item:hover { color: var(--text-muted); }
.contact-item.location-item svg { fill: var(--text-muted); }

.cta-link {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--primary) !important;
  background: transparent;
  padding: 8px 18px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.cta-link:hover,
.cta-link.active {
  color: #fff !important;
  background: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}
.cta-link:active { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ============ Nav ============ */
#topmenu {
  display: flex;
  justify-content: flex-start;
  max-width: var(--max-w);
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  gap: 6px;
}
#topmenu a {
  display: block;
  padding: 9px 20px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  cursor: pointer;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}
#topmenu a:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
#topmenu a:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
#topmenu a.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

/* ============ Hero Carousel ============ */
.hero {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  overflow: hidden;
  background: #eceff1;
}
.hero-slides { position: relative; }
.hero-slide {
  display: none;
  width: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-slide.active { display: block; opacity: 1; }
.hero-slide img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.hero-arrow:hover { background: #fff; }
.hero-arrow.prev { left: 18px; }
.hero-arrow.next { right: 18px; }

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), transform var(--transition);
}
.hero-dot.active { background: #fff; transform: scale(1.2); }
.hero-dot:hover { background: #fff; }

/* ============ Breadcrumbs ============ */
.breadcrumbs {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 8px 24px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs a::after { content: " › "; color: var(--text-muted); margin: 0 2px; }

/* ============ Main Content ============ */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.content-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  margin-bottom: 24px;
  transition: box-shadow var(--transition);
}
.content-card:hover { box-shadow: var(--shadow-md); }

.content-card h1 {
  font-size: 26px;
  color: var(--primary-dark);
  margin: 0 0 18px;
  line-height: 1.35;
}
.content-card h2 {
  font-size: 20px;
  color: var(--primary-dark);
  margin: 32px 0 18px;
  line-height: 1.4;
}
.content-card h2:first-child { margin-top: 0; }
.content-card p { margin: 0 0 14px; }
.content-card p:last-child { margin-bottom: 0; }

.lead {
  font-size: 17px;
  color: var(--primary-dark);
}

.section-alt { background: var(--bg-alt); }

/* Highlight strip (replaces old "no knife" image header) */
.highlight-strip {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.highlight-strip h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--primary-dark);
}
.highlight-strip p { margin: 0; color: var(--text); }

/* Feature grid (home quick links) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}
.feature-item {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.feature-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.feature-item h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--primary-dark);
}
.feature-item p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

/* Contact CTA band */
.contact-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 32px;
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 8px 0 24px;
  font-size: 16px;
}
.contact-band .contact-item { font-size: 17px; font-weight: 600; }
.contact-band .contact-item svg { width: 20px; height: 20px; }

/* Figure / inline image */
.figure-right {
  float: right;
  margin: 0 0 16px 24px;
  max-width: 45%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.disclaimer {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  margin-top: 24px;
  line-height: 1.7;
}

/* Section label bar (replaces old colored table bars) */
.section-label {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 16px;
  font-size: 17px;
}

/* Symptom list */
.symptom-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.symptom-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 15px;
}
.symptom-list li .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Centered content image */
.figure-center {
  display: block;
  margin: 20px auto;
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Clinical stage grid (等級分類) */
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}
.stage-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stage-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.stage-item .stage-body strong {
  display: block;
  color: var(--primary-dark);
  font-size: 15px;
  margin-bottom: 2px;
}
.stage-item .stage-body span { font-size: 14px; color: var(--text-muted); }

/* Media row: image left, text right */
.media-row {
  display: flex;
  gap: 28px;
  align-items: stretch;
  margin: 6px 0 8px;
}
.media-row .media-img {
  flex: 0 0 220px;
}
.media-row .media-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: block;
}
.media-row .media-body { flex: 1; min-width: 0; }
.media-row .media-body h2:first-child { margin-top: 0; }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.contact-info-list { list-style: none; margin: 18px 0; padding: 0; }
.contact-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.contact-info-list li:last-child { border-bottom: none; }
.contact-info-list svg {
  width: 22px; height: 22px;
  fill: var(--primary);
  flex-shrink: 0;
  margin-top: 3px;
}
.contact-info-list .ci-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.contact-info-list .ci-value { font-size: 16px; color: var(--text); }
.contact-info-list .ci-value a { color: var(--primary); font-weight: 600; }
.map-wrap {
  margin-top: 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.map-wrap iframe { display: block; width: 100%; height: 280px; border: 0; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { height: 130px; resize: vertical; }
.btn-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px 36px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn-submit:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }

/* Form status message */
.form-msg { display: none; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; line-height: 1.5; }
.form-msg.show { display: block; }
.form-msg.success { background: var(--primary-light); border-left: 4px solid var(--primary); color: var(--primary-dark); }
.form-msg.error { background: #fdecea; border-left: 4px solid #c62828; color: #b71c1c; }
.form-group input.invalid, .form-group textarea.invalid { border-color: #c62828; }

/* Sent confirmation panel */
.sent-panel { display: none; text-align: center; padding: 36px 24px; }
.sent-panel.show { display: block; }
.sent-panel .sent-icon {
  width: 72px; height: 72px; margin: 0 auto 18px;
  background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.sent-panel .sent-icon svg { width: 38px; height: 38px; fill: #fff; }
.sent-panel h2 { margin: 0 0 10px; font-size: 24px; color: var(--primary-dark); }
.sent-panel p { margin: 0 0 8px; font-size: 16px; color: var(--text); }
.sent-panel .sent-note { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.sent-panel .sent-contacts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; font-size: 15px; }
.sent-panel .sent-contacts .contact-item { font-weight: 600; }

/* FAQ accordion */
.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
}
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: none;
  border: none;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--bg-alt); }
.faq-q .q-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.faq-q .q-chevron {
  margin-left: auto;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}
.faq-q .q-chevron path { fill: var(--text-muted); }
.faq-item.open .faq-q .q-chevron { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-a .faq-a-inner {
  padding: 0 18px 18px 56px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
}
.faq-a .faq-a-inner p { margin: 0 0 10px; }
.faq-a .faq-a-inner p:last-child { margin-bottom: 0; }
.faq-a .faq-a-inner a { font-weight: 600; }

/* Symptom chips (診斷方法) */
.chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
  list-style: none;
  padding: 0;
}
.chip-grid li {
  background: var(--primary-light);
  border: 1px solid rgba(3, 99, 159, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--primary-dark);
  text-align: center;
  line-height: 1.5;
}

/* Numbered diagnostic criteria */
.criteria-list { margin: 14px 0; padding-left: 0; list-style: none; counter-reset: crit; }
.criteria-list li {
  counter-increment: crit;
  position: relative;
  padding: 10px 0 10px 40px;
  font-size: 15px;
  border-bottom: 1px solid var(--border-light);
}
.criteria-list li:last-child { border-bottom: none; }
.criteria-list li::before {
  content: counter(crit);
  position: absolute;
  left: 0;
  top: 10px;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 26px;
}

/* Treatment cards */
.treatment-card {
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 18px 22px;
  margin-bottom: 16px;
  transition: box-shadow var(--transition);
}
.treatment-card:hover { box-shadow: var(--shadow-sm); }
.treatment-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--primary-dark);
}
.treatment-card p { margin: 0; font-size: 15px; }

/* Check list (prevention tips) */
.check-list {
  list-style: none;
  margin: 14px 0;
  padding: 0;
}
.check-list li {
  position: relative;
  padding: 8px 0 8px 34px;
  font-size: 15px;
  border-bottom: 1px solid var(--border-light);
}
.check-list li:last-child { border-bottom: none; }
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 20px;
  height: 20px;
  background: var(--primary-light);
  border-radius: 50%;
}
.check-list li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 15px;
  width: 5px;
  height: 9px;
  border: solid var(--primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ============ Footer ============ */
#bottommenu {
  background: var(--bg-alt);
  border-top: 1px solid var(--border-light);
  padding: 24px;
  font-size: 14px;
}
#bottommenu .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 32px;
}
#bottommenu h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--primary-dark);
}
#bottommenu ul { list-style: none; margin: 0; padding: 0; }
#bottommenu li { margin-bottom: 4px; }
#bottommenu a { color: var(--text-muted); }
#bottommenu a:hover { color: var(--primary); }

.site-footer {
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.75);
  padding: 28px 24px;
  font-size: 13px;
  line-height: 2;
  text-align: center;
}
.site-footer .health-links { margin-bottom: 12px; }
.site-footer .health-links a {
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 6px;
}
.site-footer .health-links a:hover { border-bottom-color: #fff; }
.site-footer .copyright { color: rgba(255, 255, 255, 0.5); }

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .site-header { padding: 8px 20px; }
  .header-logo { width: 220px; height: 70px; }
  .header-contacts { font-size: 13px; gap: 4px 14px; }

  #topmenu {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }
  #topmenu a {
    text-align: center;
    padding: 10px 8px;
    font-size: 14px;
  }

  main { padding: 20px 20px 40px; }
  .content-card { padding: 22px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .symptom-list { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; }
  .media-row { flex-direction: column; }
  .media-row .media-img { flex: none; max-width: 260px; }
  .media-row .media-img img { height: auto; }
  .chip-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .figure-right { float: none; display: block; margin: 0 auto 16px; max-width: 100%; }
  #bottommenu .inner { grid-template-columns: 1fr 1fr; }
  .hero-arrow { width: 36px; height: 36px; font-size: 18px; }
  .hero-arrow.prev { left: 10px; }
  .hero-arrow.next { right: 10px; }
}

@media (max-width: 576px) {
  .site-header { padding: 6px 16px; gap: 4px 12px; }
  .header-logo { width: 180px; height: 58px; }
  .header-contacts { width: 100%; margin-left: 0; font-size: 12px; gap: 4px 12px; }
  .contact-item svg { width: 14px; height: 14px; }
  .cta-link { font-size: 12px; padding: 7px 14px; }
  .hero-dots { bottom: 10px; }
  .content-card h1 { font-size: 22px; }
  .content-card h2 { font-size: 18px; }
  .contact-band { font-size: 14px; gap: 8px 18px; }
  #bottommenu .inner { grid-template-columns: 1fr 1fr; }
}
