/* 台灣中醫男科學會：沿用舊站的青綠色（#236666）為主色，搭配米白暖色與銅色點綴，呈現專業而溫暖的醫療風格 */
:root {
  --primary: #1a4548;
  --primary-2: #236666;
  --primary-soft: #e7f0ee;
  --accent: #c0813a;
  --accent-ink: #94591a;
  --peach: #fbe6cf;
  --cream: #faf6ef;
  --sand: #efe5d6;
  --ink: #22302f;
  --muted: #5b6968;
  --line: #e3e8e6;
  --bg: #ffffff;
  --bg-alt: var(--cream);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(26, 69, 72, .09);
  --shadow-sm: 0 2px 10px rgba(26, 69, 72, .06);
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Segoe UI", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --header-h: 72px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  font-size: 17px;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: var(--primary-2);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent-ink);
}
:focus-visible {
  outline: 3px solid rgba(192, 129, 58, .55);
  outline-offset: 2px;
}
.wrap {
  width: min(1160px, 100% - 32px);
  margin-inline: auto;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  background: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.icon {
  vertical-align: middle;
  flex: none;
}

/* ---------- 頂部聯絡列 ---------- */
.topbar {
  background: var(--primary);
  color: #d7e6e3;
  font-size: .85rem;
}
.topbar .wrap {
  display: flex;
  justify-content: flex-end;
  gap: 4px 22px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.topbar a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar a:hover {
  color: #fff;
}
.topbar .tagline {
  margin-right: auto;
  letter-spacing: .12em;
  color: var(--peach);
}
@media (max-width: 700px) {
  .topbar .tagline,
  .topbar .tb-mail {
    display: none;
  }
  .topbar .wrap {
    justify-content: center;
  }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: .08em;
  margin-right: auto;
  min-width: 0;
}
.brand span {
  white-space: nowrap;
}
.brand img {
  width: 52px;
  height: 52px;
  flex: none;
}
.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav li {
  position: relative;
}
.main-nav a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  font-weight: 500;
  white-space: nowrap;
}
.main-nav > ul > li > a {
  position: relative;
}
.main-nav > ul > li > a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .2s;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a {
  color: var(--primary-2);
}
.main-nav > ul > li > a:hover::after,
.main-nav > ul > li.active > a::after {
  transform: none;
}
.main-nav .sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary-2);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: .15s;
}
.main-nav li:hover > .sub,
.main-nav li:focus-within > .sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.main-nav .sub a {
  font-weight: 400;
  padding: 7px 12px;
}
.main-nav .sub a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-search form {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 4px 2px 14px;
  margin-left: 8px;
  background: var(--cream);
}
.nav-search input {
  border: 0;
  outline: 0;
  width: 110px;
  font: inherit;
  font-size: .9rem;
  background: transparent;
}
.nav-search button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
}
.nav-toggle,
.nav-burger {
  display: none;
}
/* 寬度介於漢堡選單與完整寬度之間時，縮小選單間距，避免擠壓學會名稱 */
@media (min-width: 1021px) and (max-width: 1240px) {
  .brand {
    font-size: 1.15rem;
    gap: 8px;
    letter-spacing: .04em;
  }
  .brand img {
    width: 46px;
    height: 46px;
  }
  .main-nav a {
    padding: 10px 9px;
  }
  .main-nav > ul > li > a::after {
    left: 9px;
    right: 9px;
  }
  .nav-search input {
    width: 72px;
  }
}

@media (max-width: 1020px) {
  :root {
    --header-h: 64px;
  }
  .nav-burger {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    flex: none;
  }
  .nav-burger:hover {
    background: var(--primary-soft);
  }
  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--primary);
    position: relative;
    transition: .2s;
  }
  .nav-burger span::before,
  .nav-burger span::after {
    content: "";
    position: absolute;
  }
  .nav-burger span::before {
    top: -7px;
  }
  .nav-burger span::after {
    top: 7px;
  }
  .nav-toggle:checked + .nav-burger span {
    background: transparent;
  }
  .nav-toggle:checked + .nav-burger span::before {
    top: 0;
    transform: rotate(45deg);
  }
  .nav-toggle:checked + .nav-burger span::after {
    top: 0;
    transform: rotate(-45deg);
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 3px solid var(--primary-2);
    box-shadow: var(--shadow);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow: auto;
    overscroll-behavior: contain;
    padding: 8px 16px 20px;
  }
  .nav-toggle:checked ~ .main-nav {
    display: block;
  }
  .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav > ul > li {
    border-bottom: 1px solid var(--line);
  }
  .main-nav > ul > li > a {
    padding: 13px 4px;
    font-size: 1.05rem;
  }
  .main-nav > ul > li > a::after {
    display: none;
  }
  .main-nav .sub {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 10px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .main-nav .sub a {
    padding: 8px;
    white-space: normal;
    line-height: 1.5;
  }
  .nav-search {
    border-bottom: 0 !important;
  }
  .nav-search form {
    margin: 14px 0 0;
    padding: 6px 6px 6px 16px;
  }
  .nav-search input {
    width: 100%;
    font-size: 1rem;
  }
  .brand {
    font-size: 1.15rem;
    letter-spacing: .04em;
  }
  .brand img {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 360px) {
  .brand {
    font-size: 1rem;
    gap: 8px;
  }
  .brand img {
    width: 38px;
    height: 38px;
  }
}

/* ---------- Hero ---------- */
.hero {
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: clamp(84px, 13vw, 168px) 0 clamp(96px, 14vw, 180px);
  position: relative;
}
.hero::after {
  /* 底部弧形過渡到下一區塊 */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: clamp(24px, 4vw, 48px);
  background: var(--bg);
  clip-path: ellipse(70% 100% at 50% 100%);
}
.hero .wrap {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  margin: 0;
  letter-spacing: .14em;
  line-height: 1.25;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}
.hero .eyebrow {
  margin: 0 0 10px;
  opacity: .88;
  letter-spacing: .1em;
  font-size: .9rem;
}
.hero .lead {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.5vw, 1.55rem);
  margin: 14px 0 30px;
  letter-spacing: .24em;
  color: var(--peach);
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  background: var(--primary-2);
  color: #fff;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.5;
  transition: background .15s, box-shadow .15s;
}
.btn:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.hero .btn {
  background: var(--accent);
}
.hero .btn:hover {
  background: #a96d2b;
}
.hero .btn-ghost,
.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: #fff;
}
.hero .btn-ghost:hover {
  background: rgba(255, 255, 255, .15);
}
@media (max-width: 600px) {
  .hero h1 {
    letter-spacing: .06em;
  }
  .hero .lead {
    letter-spacing: .12em;
  }
  .hero-actions .btn {
    flex: 1 1 140px;
    text-align: center;
  }
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(48px, 7vw, 88px) 0;
}
.section.alt {
  background: var(--cream);
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--primary);
  margin: 0 0 30px;
  letter-spacing: .12em;
  line-height: 1.4;
}
.section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent);
  margin-top: 12px;
  border-radius: 2px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.more {
  color: var(--primary-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.feature {
  display: block;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: .2s;
  background: #fff;
  border-top: 4px solid var(--primary-2);
}
.feature:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  color: var(--ink);
}
.feature-icon {
  display: inline-flex;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--peach);
  color: var(--primary);
}
.feature h3 {
  margin: 16px 0 4px;
  color: var(--primary);
  font-size: 1.25rem;
}
.feature p {
  margin: 0 0 14px;
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 24px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: .2s;
}
.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.card-thumb {
  display: block;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: .3s;
}
.card:hover .card-thumb img {
  transform: scale(1.03);
}
.thumb-ph {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .9);
  font-family: var(--serif);
  font-size: 2.4rem;
  letter-spacing: .15em;
  font-weight: 700;
}
.card-body {
  padding: 18px 22px 24px;
}
.card h3 {
  font-size: 1.12rem;
  margin: 6px 0 8px;
  line-height: 1.55;
}
.card h3 a {
  color: var(--ink);
  text-decoration: none;
}
.card h3 a:hover {
  color: var(--primary-2);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta,
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: .85rem;
  color: var(--muted);
}
.tag {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-2);
  text-decoration: none;
  font-size: .8rem;
}
.tag:hover {
  background: var(--peach);
  color: var(--accent-ink);
}

.lecturers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 28px;
}
.lecturer {
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
}
.section.alt .lecturer {
  border-color: var(--sand);
}
.lecturer img,
.avatar-ph {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 4px solid var(--peach);
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--sand);
}
.avatar-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-2);
  color: #fff;
  font-family: var(--serif);
  font-size: 3rem;
}
.lecturer h3 {
  margin: 16px 0 6px;
  color: var(--primary);
  letter-spacing: .2em;
}
.lecturer p {
  color: var(--muted);
  margin: 0;
  font-size: .95rem;
  text-align: left;
}

.info-box dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 28px;
  margin: 0;
  font-size: 1.05rem;
}
.info-box dt {
  color: var(--muted);
}
.info-box dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .info-box dl {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-box dd {
    margin-bottom: 12px;
  }
}

/* ---------- Inner pages ---------- */
.page-header {
  background:
    radial-gradient(circle at 92% 20%, rgba(192, 129, 58, .14), transparent 40%),
    linear-gradient(180deg, var(--cream), #f4ede2);
  color: var(--primary);
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--sand);
}
.page-header h1 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: .08em;
  line-height: 1.4;
}
.page-header h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}
.crumbs {
  font-size: .85rem;
  color: var(--muted);
}
.crumbs a {
  color: var(--primary-2);
}
.crumbs span {
  margin: 0 4px;
}
.content-wrap {
  padding: 40px 0 72px;
}
.content-wrap.narrow {
  max-width: 820px;
}
.post-meta {
  margin-bottom: 20px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.chip {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.chip:hover {
  border-color: var(--primary-2);
  color: var(--primary-2);
  background: var(--primary-soft);
}
.empty {
  color: var(--muted);
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 40px;
}
.pagination a,
.pagination span {
  min-width: 42px;
  text-align: center;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.pagination a:hover {
  border-color: var(--primary-2);
  color: var(--primary-2);
}
.pagination .current {
  background: var(--primary-2);
  color: #fff;
  border-color: var(--primary-2);
}
.pagination .dots {
  border: 0;
}
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.post-nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.post-nav a:hover {
  border-color: var(--primary-2);
  box-shadow: var(--shadow-sm);
}
.post-nav small {
  display: block;
  color: var(--muted);
}
.post-nav .older {
  text-align: right;
}
@media (max-width: 600px) {
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav .older {
    text-align: left;
  }
  .post-nav span:empty {
    display: none;
  }
}

/* ---------- 內文（含舊 WordPress 區塊相容樣式） ---------- */
.entry {
  overflow-wrap: anywhere;
  font-size: 1.04rem;
}
.entry p,
.entry li {
  line-height: 1.9;
}
.entry > :first-child {
  margin-top: 0;
}
.entry h2,
.entry h3,
.entry h4 {
  color: var(--primary);
  line-height: 1.45;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.entry h4 {
  font-size: 1.3rem;
}
.entry figure {
  margin: 1.5em 0;
}
.entry img {
  border-radius: var(--radius-sm);
}
.entry iframe {
  max-width: 100%;
  border: 0;
}
.entry table {
  border-collapse: collapse;
  width: 100%;
}
.entry td,
.entry th {
  border: 1px solid var(--line);
  padding: 8px 10px;
}
.entry blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5em 0;
  padding: 8px 22px;
  color: var(--muted);
  background: var(--cream);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.entry ul,
.entry ol {
  padding-left: 1.4em;
}
.has-text-align-center,
.aligncenter {
  text-align: center;
}
.aligncenter img,
figure.aligncenter {
  margin-inline: auto;
  display: block;
}
.has-large-font-size {
  font-size: 1.6rem !important;
  line-height: 1.4;
}
.has-x-large-font-size {
  font-size: clamp(1.75rem, 3vw, 2.25rem) !important;
  line-height: 1.3;
}
.has-vivid-red-color {
  color: #cf2e2e !important;
}
.wp-element-caption,
figcaption {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  margin-top: .5em;
}
.wp-block-columns {
  display: flex;
  gap: 2em;
  align-items: flex-start;
  margin: 1.5em 0;
}
.wp-block-columns.are-vertically-aligned-center,
.is-vertically-aligned-center {
  align-items: center;
  align-self: center;
}
.wp-block-column {
  flex: 1 1 0;
  min-width: 0;
}
.wp-block-column > :first-child {
  margin-top: 0;
}
@media (max-width: 781px) {
  .wp-block-columns {
    flex-direction: column;
  }
  .wp-block-column {
    flex-basis: 100% !important;
    width: 100%;
  }
}
.wp-block-group.is-layout-flex {
  display: flex;
  flex-wrap: wrap;
  gap: .5em 1em;
}
.wp-block-group.is-vertical {
  flex-direction: column;
  align-items: flex-start;
}
.is-content-justification-center {
  justify-content: center;
  align-items: center !important;
}
.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
  margin: 1em 0;
}
.wp-block-button__link {
  display: inline-block;
  background: var(--primary-2);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 999px;
  text-decoration: none;
}
.wp-block-button__link:hover {
  background: var(--primary);
}
.wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 45%), 1fr));
  gap: 1em;
}
.wp-block-gallery figure {
  margin: 0;
}
.wp-block-cover {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 2em;
}
.wp-block-cover__image-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.wp-block-cover__background {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: .1;
}
.wp-block-cover__inner-container {
  position: relative;
}
.wp-block-spacer {
  height: 24px !important;
}
.alignwide,
.alignfull {
  max-width: 100%;
}

/* 量表問卷 */
.entry .qn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 14px 0;
  background: #fff;
}
.entry .qn h5 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: var(--primary);
}
.entry .qa label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  cursor: pointer;
}
.entry [style*="width:66%"] {
  width: min(100%, 760px) !important;
  margin-inline: auto;
}
.entry #result {
  font-size: 1.2rem !important;
  background: var(--peach);
  padding: 16px 20px;
  border-radius: var(--radius);
}
.entry #result:empty {
  display: none;
}
.entry #button,
.entry #button-copy {
  background: var(--primary-2) !important;
  font-size: 1.1rem !important;
  height: 52px !important;
  width: 200px !important;
}

/* 聯絡表單 */
.contact-form {
  max-width: 720px;
  margin-top: 32px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  background: var(--cream);
}
.contact-form h2 {
  margin-top: 0;
  color: var(--primary);
  border: 0;
  padding: 0;
}
.contact-form h2::after {
  display: none;
}
.contact-form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 500;
}
.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #cdd6d6;
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(35, 102, 102, .3);
  border-color: var(--primary-2);
}
.contact-form .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 600px) {
  .contact-form .grid2 {
    grid-template-columns: 1fr;
  }
}
.contact-form .hp {
  position: absolute;
  left: -9999px;
}
.notice {
  padding: 12px 16px;
  border-radius: 8px;
}
.notice.ok {
  background: #e3f4ea;
  color: #1d6b3d;
}
.notice.err {
  background: #fde8e8;
  color: #9b1c1c;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: #cfdeda;
  padding: 56px 0 0;
  font-size: .95rem;
  border-top: 4px solid var(--accent);
}
.site-footer a {
  color: #cfdcdb;
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--peach);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  margin-bottom: 14px;
}
.site-footer h3 {
  font-size: 1.02rem;
  color: var(--peach);
  margin: 0 0 10px;
  letter-spacing: .08em;
}
.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer li {
  margin: 6px 0;
}
.contact-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.contact-list .icon {
  margin-top: 4px;
  color: var(--peach);
}
.copyright {
  text-align: center;
  padding: 20px 16px;
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .85rem;
  color: #9fb7b4;
  background: rgba(0, 0, 0, .12);
}

/* ---------- 分組下拉選單 ---------- */
.main-nav .sub.mega {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 4px 8px;
  min-width: 440px;
}
.main-nav .mega-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav .sub-group {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--accent-ink);
  padding: 8px 12px 2px;
  letter-spacing: .08em;
}
.main-nav li:last-child > .sub,
.main-nav li:nth-last-child(2) > .sub,
.main-nav li:nth-last-child(3) > .sub {
  left: auto;
  right: 0;
}
@media (max-width: 1020px) {
  .main-nav .sub.mega {
    display: block;
    min-width: 0;
  }
  .main-nav .sub-group {
    padding: 8px 8px 2px;
  }
  /* 分組內的項目也排成兩欄，縮短手機選單長度 */
  .main-nav .mega-col ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ---------- 衛教文章元件 ---------- */
.entry h2 {
  font-size: 1.55rem;
  margin: 2.2em 0 .7em;
  padding-bottom: .35em;
  border-bottom: 2px solid var(--sand);
  position: relative;
}
.entry h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 2px;
  background: var(--accent);
}
.entry h3 {
  font-size: 1.25rem;
  margin: 1.6em 0 .5em;
}
.entry .lead {
  font-size: 1.1rem;
  color: var(--muted);
}
.callout {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 1.6em 0;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary-2);
}
.callout > :first-child {
  margin-top: 0;
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout.warn {
  background: #fff4ec;
  border-left-color: #d9622b;
}
.callout.tcm {
  background: #fbf6ee;
  border-left-color: var(--accent);
}
.callout.disclaimer {
  background: #f3f4f4;
  border-left-color: #9aa5a5;
  font-size: .9rem;
  color: var(--muted);
}
.callout-title {
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
}
.callout.warn .callout-title {
  color: #b2481a;
}
.table-wrap {
  overflow-x: auto;
  margin: 1.2em 0;
  -webkit-overflow-scrolling: touch;
}
.entry table.data {
  min-width: 560px;
  font-size: .95rem;
}
.entry table.data th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  font-weight: 600;
}
.entry table.data tr:nth-child(even) td {
  background: var(--cream);
}
.entry table.data td:first-child {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .entry table.data {
    min-width: 480px;
    font-size: .9rem;
  }
  .entry table.data td:first-child {
    white-space: normal;
    min-width: 5em;
  }
}
.quick-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 1.2em 0 1.8em;
  padding: 0;
  list-style: none;
}
.quick-facts li {
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .95rem;
}
.quick-facts b {
  display: block;
  color: var(--primary);
  font-size: .85rem;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 1em 0 2em;
}
.card-grid a.card-link {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: .15s;
}
.card-grid a.card-link:hover {
  border-color: var(--primary-2);
  box-shadow: var(--shadow);
}
.card-grid a.card-link strong {
  display: block;
  color: var(--primary);
  font-size: 1.08rem;
  margin-bottom: 4px;
}
.card-grid a.card-link span {
  display: block;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.6;
}
.card-grid a.card-link em {
  display: inline-block;
  font-style: normal;
  font-size: .75rem;
  background: var(--peach);
  color: var(--primary);
  border-radius: 999px;
  padding: 0 8px;
  margin-top: 8px;
}
.refs {
  font-size: .85rem;
  color: var(--muted);
}
.refs li {
  margin: 4px 0;
}

/* ---------- 量表元件 ---------- */
.quiz {
  max-width: 760px;
  margin: 1.5em auto;
}
.quiz-progress {
  position: sticky;
  top: var(--header-h);
  z-index: 5;
  background: rgba(255,255,255,.95);
  padding: 8px 0;
  font-size: .9rem;
  color: var(--muted);
}
.quiz-progress .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 4px;
}
.quiz-progress .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--primary-2);
  transition: width .2s;
}
.quiz fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px 12px;
  margin: 0 0 14px;
  background: #fff;
  transition: border-color .2s;
}
.quiz fieldset.missing {
  border-color: #d9622b;
  background: #fff8f3;
}
.quiz legend {
  font-weight: 600;
  color: var(--primary);
  padding: 0 4px;
  line-height: 1.5;
}
.quiz .q-num {
  color: var(--accent);
  margin-right: 4px;
}
.quiz .q-group {
  margin: 22px 0 10px;
  font-weight: 700;
  color: var(--primary);
}
.quiz .q-hint {
  font-size: .85rem;
  color: var(--muted);
  margin: -4px 0 8px;
}
.quiz .opts {
  display: grid;
  gap: 6px;
}
.quiz .opts.inline {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
.quiz .opts.scale {
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
}
.quiz .opts label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: .97rem;
  line-height: 1.5;
}
.quiz .opts.scale label {
  justify-content: center;
  padding: 8px 0;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.quiz .opts label:hover {
  border-color: var(--primary-2);
}
.quiz .opts input {
  margin-top: 5px;
  accent-color: var(--primary-2);
}
.quiz .opts.scale input {
  margin: 0;
}
.quiz .opts label:has(input:checked) {
  border-color: var(--primary-2);
  background: #eef6f5;
}
.quiz .scale-ends {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
}
@media (max-width: 560px) {
  .quiz .opts.scale {
    grid-template-columns: repeat(6, 1fr);
  }
}
.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 20px 0;
}
.quiz-actions .btn.secondary {
  background: #fff;
  color: var(--primary-2);
  border-color: var(--primary-2);
}
.quiz-result {
  border-radius: var(--radius);
  padding: clamp(16px, 4vw, 24px);
  margin-top: 10px;
  border: 2px solid var(--primary-2);
  background: #fff;
  scroll-margin-top: 100px;
}
.quiz-result[hidden] {
  display: none;
}
.quiz-result .score {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.quiz-result .score small {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 400;
}
.quiz-result .level {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  font-weight: 700;
  margin: 8px 0;
  color: #fff;
  background: var(--primary-2);
}
.quiz-result .level.ok {
  background: #2f8a57;
}
.quiz-result .level.mild {
  background: #c8973a;
}
.quiz-result .level.mod {
  background: #d9622b;
}
.quiz-result .level.severe {
  background: #b42318;
}
.quiz-result .meter {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #2f8a57, #c8973a 45%, #d9622b 70%, #b42318);
  position: relative;
  margin: 14px 0 4px;
}
.quiz-result .meter i {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 20px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-2px);
}
.quiz-result .meter.reverse {
  background: linear-gradient(90deg, #b42318, #d9622b 30%, #c8973a 55%, #2f8a57);
}
.quiz-result dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 12px 0;
  font-size: .95rem;
}
.quiz-result dt {
  color: var(--muted);
}
.quiz-result dd {
  margin: 0;
  font-weight: 600;
}
.quiz-result .advice {
  margin: 10px 0 0;
}
.quiz-result .related {
  margin-top: 12px;
  font-size: .95rem;
}
.quiz-note {
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}
@media print {
  .site-header,
  .site-footer,
  .quiz-actions,
  .quiz-progress,
  .page-header .crumbs {
    display: none !important;
  }
}

/* ---------- 頁面元件（學會簡介、理監事、聯絡資訊等） ---------- */
.entry .eyebrow {
  margin: 0 0 4px;
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: .12em;
  font-size: .9rem;
}
.entry .muted {
  color: var(--muted);
}

/* 圖文並排 */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  margin: 0 0 2em;
}
.split-media {
  margin: 0;
}
.split-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.split-body > :last-child {
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* 數字重點 */
.entry .stats {
  list-style: none;
  padding: 0;
  margin: 1.5em 0 2.2em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 45%), 1fr));
  gap: 14px;
}
.stats li {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary-2);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  line-height: 1.4;
}
.stats b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--primary);
}
.stats span {
  color: var(--muted);
  font-size: .9rem;
}

/* 編號清單 */
.entry ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1em 0 1.6em;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 14px 10px 54px;
  margin: 8px 0;
  background: var(--cream);
  border-radius: var(--radius-sm);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-2);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  line-height: 1;
}

/* 時間軸 */
.entry ol.timeline {
  list-style: none;
  padding: 0;
  margin: 1.2em 0 2em;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7.5em;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--sand);
}
.timeline li {
  display: grid;
  grid-template-columns: 6.5em 1fr;
  gap: 2em;
  position: relative;
  padding: 0 0 1.4em;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(7.5em - 6px);
  top: 9px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
}
.timeline time {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent-ink);
  text-align: right;
  line-height: 1.6;
}
.entry .timeline h3 {
  margin: 0 0 .3em;
  font-size: 1.15rem;
}
.timeline p {
  margin: 0;
}
@media (max-width: 600px) {
  .timeline::before {
    left: 6px;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 28px;
  }
  .timeline li::before {
    left: 0;
  }
  .timeline time {
    text-align: left;
  }
}

/* 理事長的話 */
.letter-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2em;
}
.letter-head img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}
.letter-head > div {
  padding: 20px clamp(20px, 4vw, 36px);
}
.entry .letter-head h2 {
  margin: 0 0 .2em;
  border: 0;
  padding: 0;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  letter-spacing: .1em;
}
.entry .letter-head h2::after {
  display: none;
}
@media (max-width: 700px) {
  .letter-head {
    grid-template-columns: 1fr;
  }
  .letter-head img {
    aspect-ratio: 4/3;
  }
}
.letter p {
  text-indent: 2em;
}
.letter p.signature {
  text-indent: 0;
  text-align: right;
  margin-top: 2em;
  color: var(--muted);
}
.signature strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: .3em;
  color: var(--primary);
}
.letter::after {
  content: "";
  display: table;
  clear: both;
}
.entry figure.float-right {
  float: right;
  width: min(42%, 420px);
  margin: .4em 0 1em 1.6em;
}
@media (max-width: 600px) {
  .entry figure.float-right {
    float: none;
    width: 100%;
    margin: 1em 0;
  }
}

/* 本頁目錄 */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 1.4em 0 .5em;
}
.toc a {
  padding: 5px 14px;
  border: 1px solid var(--sand);
  border-radius: 999px;
  background: var(--cream);
  text-decoration: none;
  font-size: .92rem;
  color: var(--primary);
}
.toc a:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* 理監事個人卡片 */
.profile {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.profile.featured {
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: clamp(18px, 3vw, 32px);
  padding: clamp(18px, 3vw, 28px);
  background: var(--cream);
  border-color: var(--sand);
}
.entry .profile-photo,
.profile-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}
.profile-photo.ph {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.6rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.profile-body {
  min-width: 0;
}
.entry .profile-role {
  margin: 0;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent-ink);
}
.entry .profile h3 {
  margin: 0 0 .3em;
  font-size: 1.3rem;
  letter-spacing: .12em;
}
.profile.featured h3 {
  font-size: 1.7rem;
}
.profile h3 a {
  color: var(--primary);
  text-decoration: none;
}
.profile h3 a:hover {
  color: var(--accent-ink);
}
.entry .profile-org {
  margin: 0 0 .6em;
  color: var(--muted);
}
.entry .profile p {
  margin: 0 0 .6em;
}
.entry .profile ul {
  margin: 0;
  padding-left: 1.1em;
  font-size: .92rem;
  color: #3d4b4a;
}
.entry .profile li {
  line-height: 1.7;
  margin: 2px 0;
}
.entry .profile h4 {
  margin: .9em 0 .3em;
  font-size: .95rem;
  color: var(--primary-2);
}
.profile-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 0 28px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
  gap: 16px;
  margin: 1em 0;
}
@media (max-width: 480px) {
  .profile {
    grid-template-columns: 92px 1fr;
    gap: 14px;
    padding: 14px;
  }
  .profile.featured {
    grid-template-columns: 1fr;
  }
  .profile.featured .profile-photo {
    max-width: 220px;
  }
}

/* 只有姓名的名單 */
.entry ul.name-grid {
  list-style: none;
  padding: 0;
  margin: 1em 0 1.6em;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5em, 1fr));
  gap: 8px;
}
.name-grid li {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary-2);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  letter-spacing: .12em;
  line-height: 1.5;
}
.entry ul.name-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(6em, 1fr));
  gap: 6px;
}
.name-grid.compact li {
  border-left-width: 1px;
  text-align: center;
  padding: 6px 4px;
  background: var(--cream);
  border-color: var(--sand);
  letter-spacing: .08em;
}

/* 友會團體 */
.entry ul.partners {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 12px;
}
.partners a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  background: #fff;
}
.partners a:hover {
  border-color: var(--primary-2);
  box-shadow: var(--shadow-sm);
}
.partners img {
  width: 120px;
  border-radius: 0;
}

/* 聯絡資訊 + 地圖 */
.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  margin: 1em 0 1.6em;
}
.entry dl.info-list {
  margin: 0;
  padding: clamp(18px, 4vw, 30px);
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 20px;
  align-content: center;
}
.info-list dt {
  color: var(--muted);
  font-size: .92rem;
}
.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.map-embed {
  min-height: 300px;
  position: relative;
}
.entry .map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 760px) {
  .contact-card {
    grid-template-columns: 1fr;
  }
  .map-embed {
    min-height: 0;
    aspect-ratio: 4/3;
  }
}
@media (max-width: 420px) {
  .entry dl.info-list {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .info-list dd {
    margin-bottom: 10px;
  }
}

/* 嵌入的 Google 表單 */
.form-embed {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  margin: 1.2em 0;
}
.entry .form-embed iframe {
  display: block;
  width: 100%;
  height: 3300px;
  border: 0;
}

/* ---------- 線上補課 ---------- */
.small {
  font-size: .88rem;
}
.muted {
  color: var(--muted);
}
.ok {
  color: #1d6b3d;
}
.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--primary-2);
  cursor: pointer;
  text-decoration: underline;
}
.btn.small {
  padding: 6px 16px;
  font-size: .9rem;
}
.learn-login {
  margin-inline: auto;
  max-width: 460px;
}
.learn-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 10px 16px;
  margin-bottom: 28px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  font-size: .92rem;
}
.learn-bar span {
  margin-right: auto;
  font-weight: 600;
  color: var(--primary);
}
.learn-bar form {
  margin: 0;
}
.course-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.course-card {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}
.course-card:hover {
  color: inherit;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.course-card h3 {
  margin: 6px 0 4px;
  color: var(--primary);
  line-height: 1.45;
}
.course-card p {
  margin: 6px 0;
}
.cc-top {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: var(--muted);
}
.cc-credit {
  background: var(--peach);
  color: #8a4f12;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 600;
}
.badge {
  display: inline-block;
  font-size: .8rem;
  padding: 1px 10px;
  border-radius: 999px;
  background: #e6f0ef;
  color: var(--primary-2);
}
.badge.wait {
  background: #fff1d6;
  color: #8a5a00;
}
.badge.end {
  background: #eef0f0;
  color: #666;
}
.pbar {
  height: 8px;
  background: #e6ecec;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 4px;
}
.pbar span {
  display: block;
  height: 100%;
  background: var(--primary-2);
  border-radius: inherit;
  transition: width .4s;
}
.pbar.done span {
  background: #2e8b57;
}
.course-head {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  margin-bottom: 24px;
}
.course-head p {
  margin: 6px 0;
}
.course-sum {
  padding: 16px 18px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  align-self: start;
}
@media (max-width: 760px) {
  .course-head {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
.lesson-list {
  list-style: none;
  counter-reset: lesson;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.lesson-list li {
  counter-increment: lesson;
  display: flex;
  align-items: center;
  gap: 12px 16px;
  padding: 14px clamp(12px, 3vw, 18px);
  border-bottom: 1px solid var(--line);
}
.lesson-list li:last-child {
  border-bottom: 0;
}
.lesson-list li::before {
  content: counter(lesson);
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6f0ef;
  color: var(--primary-2);
  font-weight: 700;
  font-size: .9rem;
}
.lesson-list li.done::before {
  content: "✔";
  background: #2e8b57;
  color: #fff;
}
.ll-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ll-files {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: .88rem;
}
.ll-status {
  flex: none;
  text-align: right;
}
.player-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.player {
  display: block;
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 16 / 9;
}
audio.player {
  aspect-ratio: auto;
  padding: 24px;
}
.player-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .75);
  color: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .9rem;
  pointer-events: none;
}
.player-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin: 8px 0 24px;
}
.player-info > div {
  flex: 1 1 280px;
}
.player-info p {
  margin: 4px 0;
}
.row-links {
  display: flex;
  gap: 18px;
  align-items: center;
}
.h-small {
  font-size: 1.15rem;
  color: var(--primary);
}
.attach-list {
  padding-left: 0;
  list-style: none;
}
.attach-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

/* 完成證明 */
.cert-body {
  background: var(--bg-alt);
}
.cert {
  max-width: 680px;
  margin: 40px auto;
  padding: clamp(28px, 7vw, 48px) clamp(18px, 7vw, 56px);
  background: #fff;
  border: 6px double var(--primary);
  text-align: center;
}
.cert h1 {
  margin: 8px 0 0;
  color: var(--primary);
  letter-spacing: .12em;
}
.cert h2 {
  margin: 4px 0 28px;
  font-weight: 500;
  letter-spacing: .3em;
}
.cert dl {
  display: grid;
  grid-template-columns: minmax(5.5em, 8em) 1fr;
  gap: 10px 16px;
  text-align: left;
  margin: 0 auto 28px;
  max-width: 460px;
}
.cert dt {
  color: var(--muted);
}
.cert dd {
  margin: 0;
  font-weight: 600;
}
@media print {
  .cert-body {
    background: #fff;
  }
  .cert {
    margin: 0 auto;
  }
  .no-print {
    display: none;
  }
}
