
/* ===== 全站基本設定 ===== */
:root {
  --navy: #142643;
  --navy-deep: #0d1d35;
  --pink: #f2678d;
  --blue: #376db7;
  --ink: #203252;
  --muted: #61708a;
  --line: #e8edf6;
  --shadow: 0 14px 38px rgba(35,59,92,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei",
               system-ui, sans-serif;
  background: #f6f8fd;
  color: var(--ink);
  line-height: 1.9;
}

a { color: inherit; text-decoration: none; }

.container {
  width: min(1160px, calc(100% - 40px));
  margin: auto;
}

/* ===== 導覽列 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 3px 16px #08132726;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
}

.brand-icon { color: var(--pink); font-size: 28px; }

.nav {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.nav > a,
.dropdown > a {
  display: block;
  padding: 11px 17px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  transition: background .2s;
}

.nav > a:hover,
.dropdown > a:hover,
.nav .active { background: var(--pink); }

.dropdown { position: relative; }

.submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 185px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.submenu a {
  display: block;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 14px;
}

.submenu a:hover,
.submenu a:focus-visible {
  background: #fff0f5;
  color: #b83f68;
}

.dropdown:hover .submenu,
.dropdown:focus-within .submenu { display: block; }

.menu-toggle {
  display: none;
  background: transparent;
  color: #fff;
  border: 1px solid #ffffff77;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 23px;
  cursor: pointer;
}

/* ===== 首頁封面 ===== */
.hero {
  position: relative;
  min-height: 470px;
  color: white;
  display: flex;
  align-items: center;
  background-image: linear-gradient(
    100deg,
    rgba(9,28,55,.85) 0%,
    rgba(19,54,90,.58) 57%,
    rgba(19,54,90,.28) 100%
  );
  background-color: #32669b;
  background-position: center;
  background-size: cover;
}

.hero-inner { padding: 60px 0 105px; }

.eyebrow {
  font-size: 14px;
  letter-spacing: .23em;
  color: #d7e9ff;
}

h1 {
  font-size: clamp(35px,5.4vw,68px);
  line-height: 1.35;
  letter-spacing: .03em;
  margin: 18px 0 16px;
  font-weight: 900;
}

.hero p {
  max-width: 700px;
  font-size: clamp(16px,1.7vw,21px);
  margin: 0;
}

.accent-line {
  display: block;
  width: 80px;
  height: 5px;
  margin-top: 20px;
  background: var(--pink);
  border-radius: 4px;
}

/* ===== 首頁團隊卡：舊版相容 ===== */
.team-panel {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  position: relative;
  z-index: 2;
  margin-top: -62px;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 28px 34px;
}

.team-item {
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 5px 14px;
}

.team-item + .team-item {
  border-left: 2px solid var(--line);
  padding-left: 34px;
}

.team-icon {
  flex: 0 0 68px;
  height: 68px;
  display: grid;
  place-items: center;
  background: #fcecf2;
  color: #e85983;
  border-radius: 50%;
  font-size: 27px;
}

.team-item:nth-child(2) .team-icon {
  background: #eaf2ff;
  color: var(--blue);
}

.team-label {
  color: #1e578b;
  font-size: 17px;
  font-weight: 900;
}

.team-details {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.team-details strong {
  color: var(--ink);
  font-size: 18px;
}

/* ===== 研究摘要 ===== */
.abstract-section { padding: 42px 0 90px; }

.abstract-card {
  background: white;
  border-radius: 20px;
  padding: 38px 42px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 21px;
}

.section-heading::before {
  content: "";
  width: 7px;
  height: 39px;
  background: var(--pink);
  border-radius: 6px;
}

.section-heading h2 {
  font-size: 31px;
  margin: 0;
  color: var(--navy);
}

.abstract-card p {
  font-size: 17px;
  margin: 0 0 20px;
  text-align: justify;
}

.abstract-card p:last-child { margin-bottom: 0; }

/* ===== 共用頁尾 ===== */
footer {
  background: var(--navy-deep);
  color: #c9d6e8;
  padding: 27px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
}

footer a { text-decoration: underline; }

/* ===== 基本響應式 ===== */
@media (max-width: 900px) {
  .brand { font-size: 17px; }
  .menu-toggle { display: inline-block; }
  .header-inner { flex-wrap: wrap; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-bottom: 14px;
  }
  .nav.open { display: flex; }
  .nav > a,
  .dropdown > a { padding: 10px 12px; }
  .submenu {
    position: static;
    display: block;
    box-shadow: none;
    border-radius: 8px;
    background: #213957;
    color: #fff;
    margin: 3px 10px 8px;
  }
  .submenu a:hover,
  .submenu a:focus-visible {
    background: #385477;
    color: #fff;
  }
  .team-panel {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .team-item + .team-item {
    border-left: 0;
    border-top: 2px solid var(--line);
    padding: 20px 14px 5px;
    margin-top: 16px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 26px,1160px);
  }
  .hero { min-height: 390px; }
  .hero-inner { padding: 40px 0 90px; }
  .team-panel {
    margin-top: -46px;
    padding: 20px 12px;
  }
  .team-icon {
    flex-basis: 52px;
    height: 52px;
    font-size: 22px;
  }
  .team-item { gap: 12px; }
  .team-details strong { font-size: 16px; }
  .abstract-card { padding: 26px 21px; }
  .abstract-card p { font-size: 15px; }
  .section-heading h2 { font-size: 26px; }
}

/* ===== 其他頁面共用 ===== */
.page-top {
  background: linear-gradient(120deg,#142643,#315e99);
  color: white;
  padding: 54px 0 45px;
}

.page-top h1 {
  font-size: clamp(30px,4vw,46px);
  margin: 4px 0;
}

.page-top p { margin: 0; color: #e0eafa; }

.content-wrap { padding: 38px 0 80px; }

.content-card {
  background: white;
  padding: 32px 38px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  scroll-margin-top: 100px;
}

.content-card h2 {
  font-size: 25px;
  color: #142643;
  margin: 0 0 16px;
  border-left: 6px solid var(--pink);
  padding-left: 14px;
}

.content-card h3 {
  font-size: 19px;
  margin: 22px 0 7px;
}

.content-card p { margin: 10px 0; }

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip {
  background: #edf3ff;
  border-radius: 24px;
  padding: 6px 14px;
  color: #245b9c;
  font-weight: 700;
}

.placeholder {
  padding: 35px 22px;
  text-align: center;
  background: #f5f8fd;
  border: 1px dashed #b3c4df;
  border-radius: 12px;
  color: #6c7d94;
  margin: 16px 0;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
}

.subnav a {
  background: white;
  border: 1px solid var(--line);
  padding: 8px 18px;
  border-radius: 9px;
  color: #245b9c;
  font-weight: 700;
}

.subnav a:hover { background: #eaf2ff; }
.muted { color: var(--muted); }

@media(max-width:560px) {
  .content-card { padding: 23px 20px; }
}

/* ===== 舊版研究流程圖 ===== */
.research-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 22px auto 32px;
  max-width: 640px;
}

.flow-step {
  width: 100%;
  background: linear-gradient(110deg,#f1f6ff,#fff);
  border: 1px solid #dce7f8;
  border-left: 6px solid #4576bf;
  border-radius: 13px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 14px;
  align-items: center;
  box-shadow: 0 5px 15px rgba(23,55,95,.05);
}

.step-no {
  grid-row: span 2;
  background: #e0ebfb;
  color: #305caa;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}

.flow-step strong { color: #172c4b; font-size: 18px; }

.flow-step small {
  color: #61708a;
  font-size: 14px;
  line-height: 1.6;
}

.flow-arrow {
  color: #668dbf;
  font-size: 25px;
  font-weight: bold;
  line-height: 1.3;
}

.final-step {
  border-left-color: #f2678d;
  background: linear-gradient(110deg,#fff1f6,#fff);
}

.final-step .step-no {
  background: #ffe2ea;
  color: #b83e69;
}

@media(max-width:560px) {
  .flow-step {
    padding: 12px 11px;
    grid-template-columns: 34px 1fr;
    column-gap: 10px;
  }
  .step-no {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .flow-step strong { font-size: 16px; }
  .flow-step small { font-size: 12px; }
}

/* ===== 新版首頁團隊資訊卡 ===== */
.team-panel {
  grid-template-columns:
    minmax(0,1fr) 1px minmax(0,1.2fr);
  align-items: center;
  gap: clamp(20px,3vw,38px);
  margin-top: -62px;
  padding: 34px clamp(24px,4vw,46px);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23,45,78,.10);
}

.team-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.team-badge {
  display: inline-block;
  padding: 5px 14px;
  margin-bottom: 12px;
  background: #fff0f5;
  color: #bb4168;
  border-radius: 999px;
  font-weight: 750;
  font-size: 14px;
}

.team-badge--members {
  background: #eef4ff;
  color: #2d5b96;
}

.team-name {
  margin: 0 0 8px;
  font-size: clamp(22px,2.5vw,30px);
  color: #1d2f4f;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.team-meta {
  margin: 0;
  font-size: 16px;
  color: #5f6f88;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.team-role {
  margin: 3px 0;
  font-size: clamp(16px,1.7vw,20px);
  color: #203252;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.team-role strong { color: #2b4f82; }

.team-divider {
  width: 1px;
  height: 115px;
  background: linear-gradient(
    transparent,#cbd8ea,transparent
  );
}

@media(max-width:900px) {
  .team-panel {
    grid-template-columns: minmax(0,1fr);
    gap: 18px;
    padding: 28px 24px;
  }
  .team-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(
      to right,transparent,#cbd8ea,transparent
    );
  }
}

@media(max-width:560px) {
  .team-panel {
    margin-top: -42px;
    padding: 23px 20px;
    border-radius: 18px;
  }
  .team-meta { font-size: 14px; }
  .team-role { font-size: 16px; }
}

/* ===== 研究方法與動機 ===== */
.research-feature {
  scroll-margin-top: 100px;
  background: #fff;
  border-radius: 22px;
  padding: clamp(26px,4vw,54px);
  margin: 0 0 28px;
  box-shadow: var(--shadow);
}

.research-kicker {
  font-size: 12px;
  letter-spacing: .16em;
  font-weight: 800;
  color: #6d83a6;
  margin-bottom: 7px;
}

.research-feature h2 {
  font-size: clamp(27px,3vw,38px);
  margin: 0;
  color: var(--navy);
  letter-spacing: .04em;
}

.research-accent {
  width: 55px;
  height: 4px;
  border-radius: 4px;
  background: var(--pink);
  margin: 14px 0 26px;
}

.research-feature > p {
  font-size: 17px;
  line-height: 2.05;
  color: #374a68;
  margin: 0 0 20px;
  text-align: justify;
}

.research-feature > p:last-child { margin-bottom: 0; }
.research-lead { color: var(--muted) !important; }

/* ===== 研究流程時間軸 ===== */
.process-timeline {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  position: relative;
}

.process-timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 35px;
  left: 27px;
  width: 2px;
  background: linear-gradient(#96b2df,#ee91b1);
}

.process-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0,1fr);
  gap: 24px;
  padding: 0 0 24px;
  align-items: start;
}

.process-timeline li:last-child { padding-bottom: 0; }

.timeline-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eaf2ff;
  color: #2c5c9e;
  font-size: 17px;
  font-weight: 800;
  border: 4px solid white;
  box-shadow: 0 2px 12px #20325212;
}

.process-timeline li:last-child .timeline-number {
  background: #ffe4ec;
  color: #b83e69;
}

.timeline-body {
  border: 1px solid #e5edf8;
  border-radius: 14px;
  padding: 18px 22px;
  background: #f8faff;
}

.timeline-body h3 {
  margin: 0 0 5px;
  color: #19375e;
  font-size: 20px;
}

.timeline-body p {
  margin: 0;
  color: #526682;
  font-size: 15px;
  line-height: 1.85;
}

@media(max-width:600px) {
  .research-feature { padding: 26px 20px; }
  .research-feature > p { font-size: 15px; }
  .process-timeline::before { left: 21px; }
  .process-timeline li {
    grid-template-columns: 44px minmax(0,1fr);
    gap: 10px;
  }
  .timeline-number {
    width: 44px;
    height: 44px;
    font-size: 13px;
  }
  .timeline-body { padding: 14px; }
  .timeline-body h3 { font-size: 17px; }
  .timeline-body p { font-size: 14px; }
}

/* ===== 研究成果：R Markdown 與 R Shiny ===== */
.results-showcase { padding-top: 38px; }

.results-intro,
.results-stages {
  background: #fff;
  border-radius: 22px;
  padding: clamp(25px,4vw,45px);
  margin-bottom: 26px;
  box-shadow: var(--shadow);
  scroll-margin-top: 105px;
}

.results-intro h2,
.results-stages h2 {
  margin: 5px 0 12px;
  color: var(--navy);
  font-size: clamp(25px,3vw,34px);
  line-height: 1.4;
}

.results-intro p,
.results-stages > p {
  margin: 0;
  color: #50617b;
  font-size: 16px;
  line-height: 1.95;
  max-width: 850px;
}

.results-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.results-quicklinks a {
  border: 1px solid #d8e5f5;
  background: #f2f7ff;
  color: #285a96;
  font-weight: 700;
  padding: 9px 17px;
  border-radius: 999px;
}

.results-quicklinks a:hover { background: #dfeafa; }

.showcase-panel {
  scroll-margin-top: 105px;
  display: grid;
  grid-template-columns:
    minmax(0,.95fr) minmax(0,1.1fr);
  gap: clamp(20px,3vw,38px);
  align-items: center;
  background: #fff;
  border-radius: 22px;
  padding: clamp(24px,3.5vw,43px);
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}

.showcase-panel:nth-of-type(3) {
  border-top: 4px solid #f2678d;
}

.showcase-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 13px;
  background: #eaf2ff;
  color: #2c5d9e;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .03em;
}

.showcase-tag--pink {
  background: #fff0f5;
  color: #b43d68;
}

.showcase-copy h2 {
  font-size: clamp(28px,3vw,38px);
  line-height: 1.3;
  margin: 14px 0;
  color: var(--navy);
}

.showcase-copy p {
  margin: 0 0 16px;
  color: #536780;
  font-size: 15px;
  line-height: 1.95;
}

.showcase-copy .showcase-lead {
  color: #273d5e;
  font-weight: 600;
  font-size: 16px;
}

.showcase-link-area {
  margin-top: 20px;
  padding: 15px 18px;
  border-radius: 12px;
  background: #f5f8fd;
  border: 1px solid #e3eaf5;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 15px;
  align-items: center;
}

.link-label {
  font-size: 13px;
  font-weight: 800;
  color: #315b92;
  white-space: nowrap;
}

.pending-link { font-size: 14px; color: #77869d; }

.showcase-external-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--navy);
  color: white;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.showcase-external-link:hover { background: #315e99; }

.showcase-figure { margin: 0; min-width: 0; }

.showcase-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  border: 1px solid #e1e7f1;
  border-radius: 13px;
  box-shadow: 0 12px 26px #182f4d16;
}

.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(150deg,#eef3fc,#dfe9f7);
  border: 2px dashed #b7cbe3;
  border-radius: 13px;
  color: #476184;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  padding: 18px;
}

.screenshot-placeholder .placeholder-icon {
  font-size: 45px;
  line-height: 1;
  color: #7392bd;
}

.screenshot-placeholder strong {
  font-size: 19px;
  color: #254d7f;
}

.screenshot-placeholder small {
  font-size: 13px;
  line-height: 1.7;
  max-width: 290px;
}

.showcase-figure figcaption {
  font-size: 13px;
  color: #7a88a0;
  margin-top: 12px;
  text-align: center;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
  margin-top: 25px;
}

.stage-card {
  scroll-margin-top: 105px;
  border: 1px solid #e0e9f6;
  border-radius: 14px;
  background: #f8faff;
  padding: 21px 20px;
}

.stage-card span {
  color: #e26b92;
  font-size: 24px;
  font-weight: 900;
}

.stage-card h3 {
  font-size: 18px;
  color: #203d61;
  margin: 6px 0;
}

.stage-card p {
  font-size: 14px;
  color: #61728c;
  line-height: 1.75;
  margin: 0;
}

@media(max-width:800px) {
  .showcase-panel { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; }
}

@media(max-width:560px) {
  .showcase-panel,
  .results-intro,
  .results-stages {
    border-radius: 16px;
    padding: 22px 19px;
  }
  .screenshot-placeholder { aspect-ratio: 4/3; }
}

/* ===== R Shiny iframe 舊版相容 ===== */
.showcase-panel:has(.shiny-embed) {
  grid-template-columns:
    minmax(0,.7fr) minmax(0,1.5fr);
  align-items: start;
}

.shiny-embed {
  display: block;
  width: 100%;
  height: 620px;
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #fff;
}

@media(max-width:800px) {
  .showcase-panel:has(.shiny-embed) {
    grid-template-columns: 1fr;
  }
  .shiny-embed { height: 540px; }
}

@media(max-width:560px) {
  .shiny-embed { height: 500px; }
}

/* ===== 舊版圖片 Logo 相容 ===== */
.brand.brand-image {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
}

.brand-image img {
  display: block;
  width: auto;
  height: 50px;
  max-width: min(100%,285px);
  object-fit: contain;
}

@media(max-width:560px) {
  .brand-image img {
    height: 38px;
    max-width: 230px;
  }
}

/* ===== 資料介紹 ===== */
.data-section { padding: clamp(24px,4vw,46px); }
.data-section-heading { margin-bottom: 16px; }

.data-section-index {
  display: block;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .15em;
  color: #7085a4;
  margin-bottom: 6px;
}

.data-section .data-section-heading h2 {
  border: 0;
  padding: 0;
  margin: 0;
  font-size: clamp(27px,3vw,36px);
}

.data-section .data-section-heading::after {
  content: "";
  display: block;
  width: 55px;
  height: 4px;
  margin-top: 13px;
  border-radius: 5px;
  background: var(--pink);
}

.data-section > p {
  color: #475b77;
  font-size: 16px;
  line-height: 1.95;
}

.data-overview {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 15px;
  margin: 26px 0 30px;
}

.data-overview-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 21px 19px;
  border: 1px solid #e1eaf7;
  border-radius: 16px;
  background: linear-gradient(145deg,#f1f6ff,#fff);
}

.data-overview-kicker {
  color: #5c7292;
  font-size: 13px;
  font-weight: 750;
}

.data-overview-card strong {
  color: var(--navy);
  font-size: clamp(25px,3vw,36px);
  line-height: 1.3;
}

.data-overview-card > span:last-child {
  color: #60718a;
  font-size: 13px;
}

.data-section .data-hint {
  font-size: 14px;
  color: #718199;
}

/* ===== 資料表 ===== */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid #e1e8f4;
  border-radius: 13px;
}

.data-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid #e8edf6;
}

.data-table thead {
  background: #edf3ff;
  color: #264b78;
}

.data-table tbody th { font-weight: 700; }

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table tbody tr:nth-child(even) {
  background: #fafcff;
}

.data-pending {
  display: inline-block;
  background: #f2f5fa;
  color: #75849a;
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
}

.data-note {
  background: #f6f8fc;
  border-left: 4px solid #7398c9;
  border-radius: 0 10px 10px 0;
  color: #5a6b84;
  padding: 14px 17px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.85;
}

/* ===== 問卷分類 ===== */
.questionnaire-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.question-group {
  border: 1px solid #e0e9f6;
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.question-group[open] {
  background: #fafcff;
  border-color: #cbdaf0;
}

.question-group summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
}

.question-group summary::-webkit-details-marker {
  display: none;
}

.question-group summary:focus-visible {
  outline: 3px solid #f2678d;
  outline-offset: -3px;
}

.question-num {
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: #e9f1ff;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 14px;
  font-weight: 800;
  color: #315e99;
}

.question-heading {
  font-weight: 800;
  font-size: 17px;
  color: var(--navy);
  white-space: nowrap;
}

.question-desc {
  font-size: 13px;
  color: #7b8aa0;
  margin-left: auto;
  text-align: right;
}

.question-chevron {
  margin-left: 8px;
  color: #6280a5;
  font-size: 22px;
  transition: transform .2s;
}

.question-group[open] .question-chevron {
  transform: rotate(180deg);
}

.question-content {
  padding: 0 20px 18px 70px;
  color: #526680;
}

.question-content ul {
  margin: 0;
  padding-left: 20px;
}

.question-content li { padding: 3px 0; }

.data-attachment {
  margin-top: 23px;
  padding: 20px;
  border: 1px dashed #bdcde2;
  border-radius: 12px;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.data-attachment strong { color: var(--navy); }

.data-attachment p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #72829a;
}

@media(max-width:700px) {
  .data-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .data-overview-card { padding: 15px 17px; }
  .question-group summary {
    flex-wrap: wrap;
    gap: 10px;
  }
  .question-desc {
    flex: 1 1 100%;
    order: 3;
    margin: 0 0 0 49px;
    text-align: left;
  }
  .question-chevron { margin-left: auto; }
  .question-content { padding-left: 24px; }
  .data-attachment {
    align-items: start;
    flex-direction: column;
  }
}

/* ===== 114學年度三份問卷 ===== */
.survey-stage-list {
  display: grid;
  gap: 15px;
  margin-top: 25px;
}

.survey-stage {
  border: 1px solid #dae5f3;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.survey-stage[open] {
  border-color: #b5cce9;
  box-shadow: 0 9px 25px rgba(26,58,104,.06);
}

.survey-stage > summary {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
  background: #f7faff;
}

.survey-stage > summary::-webkit-details-marker {
  display: none;
}

.survey-stage > summary:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: -3px;
}

.survey-stage-index {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #e3edfc;
  color: #315e99;
  font-weight: 800;
}

.survey-stage-heading {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.survey-stage-heading strong {
  font-size: 19px;
  color: var(--navy);
}

.survey-stage-heading small {
  font-size: 13px;
  color: #687c98;
}

.survey-stage-arrow {
  font-size: 24px;
  color: #6483aa;
  transition: transform .2s;
}

.survey-stage[open] .survey-stage-arrow {
  transform: rotate(180deg);
}

.survey-stage-content { padding: 9px 25px 24px; }

.survey-topic {
  padding: 14px 0;
  border-bottom: 1px solid #ebf0f8;
}

.survey-topic:last-child { border-bottom: 0; }

.survey-topic h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #285486;
}

.survey-topic ul {
  margin: 0;
  padding-left: 22px;
  color: #50637d;
  font-size: 15px;
  line-height: 1.9;
}

.survey-topic li { padding: 2px 0; }

@media(max-width:600px) {
  .survey-stage > summary {
    padding: 15px 13px;
    gap: 10px;
  }
  .survey-stage-content { padding: 8px 17px 18px; }
  .survey-stage-heading strong { font-size: 17px; }
  .survey-stage-index {
    width: 39px;
    height: 39px;
  }
  .survey-topic ul { font-size: 14px; }
}

/* ===== 最終版 Header：系徽與網站標題 ===== */
.site-header { background: #142643; }

.site-header .header-inner {
  width: min(1480px,calc(100% - 48px));
  max-width: none;
  min-height: 76px;
  gap: 24px;
}

.site-header .brand.brand-image {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: #fff;
  text-decoration: none;
}

.site-header .brand-image .brand-logo {
  width: 52px;
  height: 52px;
  max-width: none;
  flex: 0 0 52px;
  object-fit: contain;
  background: transparent;
}

.site-header .brand-image .brand-title {
  font-size: clamp(17px,1.7vw,23px);
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  color: #fff;
  letter-spacing: .03em;
}

.site-header .nav {
  flex: 0 0 auto;
  align-items: center;
}

.site-header .nav > a,
.site-header .dropdown > a { color: #fff; }

.site-header .submenu a { color: var(--ink); }
.site-header .submenu a:hover { color: #b83f68; }

@media(max-width:1100px) {
  .site-header .menu-toggle {
    display: inline-block;
    margin-left: auto;
  }
  .site-header .header-inner { flex-wrap: wrap; }
  .site-header .nav {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 14px;
  }
  .site-header .nav.open { display: flex; }
  .site-header .submenu {
    position: static;
    display: block;
    box-shadow: none;
    background: #213957;
    color: #fff;
    margin: 3px 10px 8px;
  }
  .site-header .submenu a { color: #fff; }
  .site-header .submenu a:hover {
    color: #fff;
    background: #385477;
  }
}

@media(max-width:560px) {
  .site-header .header-inner {
    width: calc(100% - 28px);
    min-height: 68px;
    gap: 10px;
  }
  .site-header .brand.brand-image { gap: 8px; }
  .site-header .brand-image .brand-logo {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .site-header .brand-image .brand-title {
    font-size: 16px;
    letter-spacing: 0;
  }
}

/* ===== 研究成果 JPG 截圖 ===== */
.showcase-figure a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

.showcase-figure .showcase-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  border: 1px solid #d9e1ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(28,58,109,.08);
  transition: transform .3s ease;
}

.showcase-figure a:hover .showcase-image {
  transform: scale(1.025);
}

.showcase-figure a:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

@media(prefers-reduced-motion:reduce) {
  .showcase-figure .showcase-image {
    transition: none;
  }
}

@media(max-width:600px) {
  .showcase-figure .showcase-image {
    aspect-ratio: 4/3;
  }
}

/* ======================================
   結論與未來擴充（新增）
====================================== */

.conclusion-page .subnav {
  margin-bottom: 24px;
}

.conclusion-card {
  scroll-margin-top: 105px;
  background: #fff;
  padding: clamp(28px,4vw,52px);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.conclusion-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
  color: #7185a3;
}

.conclusion-card h2 {
  color: var(--navy);
  font-size: clamp(30px,3.3vw,40px);
  margin: 4px 0 0;
  line-height: 1.4;
}

.conclusion-accent {
  width: 58px;
  height: 4px;
  background: var(--pink);
  border-radius: 8px;
  margin: 14px 0 26px;
}

.conclusion-card > p {
  color: #4b5f7b;
  font-size: 16px;
  line-height: 2;
  margin: 0 0 18px;
}

.conclusion-card .conclusion-lead {
  color: #23466c;
  font-size: 18px;
  font-weight: 600;
}

.conclusion-highlights {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 16px;
  margin: 28px 0 24px;
}

.conclusion-highlight {
  background: linear-gradient(150deg,#f3f7ff,#fff);
  border: 1px solid #e2eaf6;
  border-radius: 16px;
  padding: 22px;
}

.conclusion-number {
  color: #3b6da7;
  font-weight: 850;
  letter-spacing: .08em;
  font-size: 14px;
}

.conclusion-highlight h3 {
  color: var(--navy);
  font-size: 18px;
  margin: 9px 0;
}

.conclusion-highlight p {
  color: #5b6b81;
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.conclusion-card .conclusion-caveat {
  margin: 20px 0 0;
  background: #f6f8fc;
  border-left: 4px solid #8aaad2;
  border-radius: 0 10px 10px 0;
  padding: 15px 18px;
  font-size: 14px;
  color: #526781;
}

/* ===== 未來擴充三個項目 ===== */
.future-list {
  display: grid;
  gap: 18px;
  margin: 24px 0;
}

.future-item {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr);
  gap: 20px;
  border: 1px solid #e3eaf6;
  border-radius: 16px;
  padding: 22px;
  background: #f9fbff;
}

.future-index {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #e7f0ff;
  color: #285b98;
  font-weight: 800;
}

.future-item:nth-child(2) .future-index {
  background: #fff0f5;
  color: #ba4c74;
}

.future-item h3 {
  font-size: 20px;
  color: var(--navy);
  margin: 0 0 5px;
}

.future-item p {
  font-size: 15px;
  color: #566a83;
  margin: 0;
  line-height: 1.9;
}

/* ===== 結論頁手機版 ===== */
@media(max-width:750px) {
  .conclusion-highlights {
    grid-template-columns: 1fr;
  }

  .future-item {
    grid-template-columns: 42px minmax(0,1fr);
    gap: 13px;
    padding: 16px;
  }

  .future-index {
    width: 40px;
    height: 40px;
  }

  .future-item h3 {
    font-size: 18px;
  }
}
