/*
 * 全站共用樣式（116學年度技高生統測及參採升學查詢網站）
 * ------------------------------------------------------------
 * 配色沿用屏科大招生簡報：奶油黃底、鼠尾草青綠、海軍藍標題、金黃點綴。
 * 各子頁先載入本檔，再載入自己的樣式檔（例如 pr/styles.css、subjects/subjects.css）。
 *
 * 1. :root                     色彩與陰影變數
 * 2. body                      全站基本
 * 3. .site-nav                 全站導覽列（由 site.js 產生）
 * 4. .hero                     頁首（.hero 的 data-mark 屬性決定右上浮水印文字）
 * 5. main / 卡片 / 區塊標題    共用版面元件
 * 6. 表單、按鈕               共用控制項
 * 7. 摘要卡、表格、提示文字
 * 8. .notes-card              資料說明
 * 9. footer.site-footer       全站頁尾（由 site.js 產生）
 * 10. @media                   平板與手機
 */

/* 1. 色彩變數 */
:root {
  --ink: #1f2d3a; --muted: #6b7480; --paper: #f8f7ef; --white: #fff;
  --blue: #3f7a74; --blue2: #6aa9a2; --navy: #0d4580; --sky: #1677c8; --rank: #1f6fb2;
  --s1: #1f6fb2; --s2: #e3a500; --s3: #3f7a74; --orange: #e3a500; --line: #e2e2d6;
  --good: #138a4c; --bad: #c55742;
  --shadow: 0 18px 50px rgba(40, 60, 70, .09);
}

/* 2. 全站基本 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Microsoft JhengHei", "Noto Sans TC", "PingFang TC", sans-serif; }
a { color: var(--sky); }

/* 3. 全站導覽列 */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(253, 252, 245, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-nav__inner { width: min(1180px, calc(100% - 40px)); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 62px; }
.site-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--navy); min-width: 0; }
.site-brand__mark { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--blue); color: #fff; display: grid; place-items: center; font: 800 13px/1 Arial, sans-serif; letter-spacing: .02em; box-shadow: 0 6px 14px rgba(63, 122, 116, .28); }
.site-brand__text { font-weight: 800; font-size: 15px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-brand__text small { display: block; font: 700 10px/1.2 Arial, sans-serif; letter-spacing: .18em; color: var(--blue); }
.site-links { display: flex; gap: 4px; flex: none; }
.site-links a { text-decoration: none; color: #4c5866; font-size: 14px; font-weight: 700; padding: 9px 13px; border-radius: 10px; white-space: nowrap; }
.site-links a:hover { background: #eef5f3; color: var(--ink); }
.site-links a[aria-current="page"] { background: var(--blue); color: #fff; }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 60; }
.skip-link:focus { left: 12px; }

/* 4. 頁首 */
.hero { min-height: 340px; color: var(--ink); position: relative; overflow: hidden;
  background: radial-gradient(circle at 6% 0%, rgba(246,226,140,.55), transparent 36%),
              radial-gradient(circle at 100% 100%, rgba(140,189,186,.45), transparent 42%),
              linear-gradient(160deg, #fdfbef 0%, #ffffff 48%, #e8f0ed 100%); }
.hero:before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 74px; background: #8cbdba; }
.hero:after { content: attr(data-mark); position: absolute; right: 4%; top: -30px; font: 700 300px/1 Arial, "Microsoft JhengHei", sans-serif; color: rgba(63,122,116,.07); white-space: nowrap; pointer-events: none; }
.hero__dots { position: absolute; right: 40px; top: 34px; width: 120px; height: 100px; z-index: 1;
  background-image: radial-gradient(circle, #cfdedb 3px, transparent 3.5px); background-size: 24px 24px; }
.hero__inner { width: min(1180px, calc(100% - 40px)); margin: auto; padding: 56px 0 104px; position: relative; z-index: 1; }
.eyebrow { font: 700 12px/1.2 Arial; letter-spacing: .25em; color: var(--blue); margin: 0 0 18px; }
.hero h1 { font-size: 40px; line-height: 1.25; letter-spacing: .04em; margin: 0; color: var(--navy); }
.hero h1 span { color: var(--sky); }
.hero__copy { color: #4c5866; margin: 17px 0 25px; max-width: 680px; line-height: 1.75; }
.hero__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #6b7480; }
.hero__meta strong { color: var(--navy); }
.hero__meta i { height: 13px; border-left: 1px solid #c9c3a0; margin: 0 8px; }

/* 5. 版面元件 */
main { width: min(1180px, calc(100% - 40px)); margin: -38px auto 60px; position: relative; z-index: 2; }
.control-card, .chart-card, .table-card, .notes-card { background: var(--white); border-radius: 18px; box-shadow: var(--shadow); padding: 28px; margin-bottom: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-heading > div:first-child { display: flex; align-items: center; gap: 13px; }
.section-heading > div:first-child > span { font: 800 12px Arial; color: #fff; background: var(--blue); width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.section-heading p, .section-heading h2 { font-size: 19px; font-weight: 800; margin: 0; color: var(--navy); }
.section-heading small { color: var(--muted); }

/* 6. 表單與按鈕 */
label { font-size: 13px; font-weight: 700; color: #4c5866; }
select, input[type="search"], input[type="text"], input[type="number"] { display: block; width: 100%; margin-top: 9px; border: 1px solid var(--line); border-radius: 10px; background: #fdfdf8; padding: 12px 14px; color: var(--ink); font: 600 15px/1.3 inherit; font-family: inherit; outline: none; }
select:focus, input:focus { border-color: var(--blue2); box-shadow: 0 0 0 3px rgba(106,169,162,.22); }
button { border: 0; border-radius: 9px; background: #e4f1ef; color: #2f6b65; padding: 9px 13px; font: 700 14px inherit; font-family: inherit; cursor: pointer; }
button:hover { background: #d3e8e5; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue2); outline-offset: 2px; }
.primary-btn { background: var(--blue); color: #fff; padding: 13px 22px; font-size: 16px; border-radius: 10px; }
.primary-btn:hover { background: #33665f; }
.primary-btn:disabled { background: #c3c9c9; cursor: not-allowed; }
.ghost-btn { background: #fff; border: 1px solid var(--line); color: #4c5866; }
.ghost-btn:hover { background: #f4f4ec; }
.hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); min-height: 1.2em; line-height: 1.6; }
.hint.warn { color: var(--bad); }

/* 7. 摘要卡、表格、提示 */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 22px; }
.summary { background: #fff; border-radius: 15px; padding: 20px 22px; box-shadow: 0 8px 30px rgba(40,60,70,.06); border-top: 3px solid transparent; min-width: 0; }
.summary p { margin: 0; color: var(--muted); font-size: 13px; }
.summary strong { display: block; font: 800 30px/1.2 Arial, sans-serif; margin: 8px 0 6px; overflow-wrap: anywhere; }
.summary strong small { font-size: 15px; font-weight: 700; color: var(--muted); }
.summary > small { color: #747f8a; font-size: 12px; line-height: 1.5; display: block; }
.tag { display: inline-block; font: 700 10px/1 sans-serif; padding: 3px 5px; border-radius: 5px; background: #fff5dc; color: #94640a; vertical-align: middle; margin-left: 4px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { background: #f5f2df; color: #5c4a1f; text-align: right; font-size: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
td { padding: 13px 15px; border-bottom: 1px solid #eeeee6; text-align: right; font-size: 13px; }
th.text, td.text { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
.footnote { color: #78828d; font-size: 12px; margin: 13px 2px 0; line-height: 1.6; }
.empty-state { background: #fff; border-radius: 16px; padding: 50px; text-align: center; box-shadow: var(--shadow); margin-bottom: 22px; color: var(--muted); }
.notice { display: flex; gap: 12px; align-items: flex-start; background: #fff8e1; border: 1px solid #f1dc9c; color: #6d5410; border-radius: 14px; padding: 14px 18px; font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
.notice b { color: #5a4407; }

/* 8. 資料說明 */
.notes-card h2 { font-size: 17px; margin: 0 0 12px; color: var(--navy); }
.notes-card ul { margin: 0; padding-left: 20px; color: #4c5866; font-size: 13px; line-height: 1.8; }

/* 主頁：子頁卡片（由 site.js 依 SITE.pages 產生） */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border-radius: 18px; padding: 24px 24px 22px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid transparent; transition: transform .15s, border-color .15s; }
a.tool-card:hover { transform: translateY(-3px); border-color: #b9d8d3; }
.tool-card__top { display: flex; align-items: center; justify-content: space-between; }
.tool-card__no { font: 800 13px Arial; color: #fff; background: var(--blue); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.tool-card__top em { font: 800 11px/1 Arial, sans-serif; font-style: normal; letter-spacing: .08em; color: #94640a; background: #fff1c9; padding: 5px 8px; border-radius: 6px; }
.tool-card h3 { margin: 6px 0 0; font-size: 18px; line-height: 1.45; color: var(--navy); }
.tool-card p { margin: 0; font-size: 14px; line-height: 1.75; color: #4c5866; flex: 1; }
.tool-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-card__tags span { font-size: 12px; color: #2f6b65; background: #e9f3f1; border-radius: 20px; padding: 4px 10px; }
.tool-card__go { margin-top: 6px; font-weight: 800; color: var(--blue); font-size: 15px; }
.tool-card.is-planned { background: transparent; box-shadow: none; border: 2px dashed #d6d3bf; grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 14px 20px; }
.tool-card.is-planned .tool-card__top { gap: 10px; }
.tool-card.is-planned h3 { margin: 0; font-size: 15px; }
.tool-card.is-planned p { flex: 0 1 auto; }
.tool-card.is-planned .tool-card__no { background: #c9c6b2; }
.tool-card.is-planned .tool-card__top em { background: #eeece0; color: #6b7480; }
.tool-card.is-planned h3 { color: #6b7480; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
.steps li { position: relative; padding: 18px 18px 18px 62px; background: #fbfaf3; border: 1px solid #eeebd8; border-radius: 14px; font-size: 14px; line-height: 1.7; color: #4c5866; }
.steps li:before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; font: 800 14px/30px Arial; text-align: center; }
.steps li b { display: block; color: var(--navy); font-size: 15px; margin-bottom: 2px; }

/* 精簡頁首（子頁用）：標題＋一句話，讓操作區在第一個畫面就看得到 */
.hero--compact { min-height: 0; }
.hero--compact:before { height: 60px; }
.hero--compact:after { font-size: 220px; top: -20px; }
.hero--compact .hero__inner { padding: 38px 0 88px; }
.hero--compact h1 { font-size: 34px; }
.hero--compact .hero__copy { margin: 12px 0 14px; font-size: 16px; }
.hero--compact .hero__dots { top: 24px; }

/* 可收合的說明（資料來源與說明） */
details.notes-fold { padding: 0; }
details.notes-fold > summary { cursor: pointer; list-style: none; padding: 18px 28px; font-weight: 800; color: var(--navy); font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
details.notes-fold > summary::-webkit-details-marker { display: none; }
details.notes-fold > summary:after { content: "展開 ▾"; font-size: 12px; font-weight: 700; color: var(--muted); }
details.notes-fold[open] > summary:after { content: "收合 ▴"; }
details.notes-fold > ul { padding: 0 28px 22px 48px; }

/* 步驟式查詢（子頁共用）：①②③ 逐步出現、執行列、圖例、「怎麼看？」收合說明 */
.picker { padding: 24px 28px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.step + .step { margin-top: 20px; padding-top: 20px; border-top: 1px dashed #e6e3d0; }
.step__no { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; font: 800 15px/34px Arial; text-align: center; }
.step__body { min-width: 0; }
.step__title { display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 800; color: var(--navy); margin-top: 6px; }
.step__title small { font-size: 12px; font-weight: 700; color: var(--muted); }
.step select { max-width: 560px; }
.step .run-row { margin-top: 14px; }
.run-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.run-row .primary-btn { min-width: 160px; }
.run-row .hint { margin: 0; flex: 1 1 260px; }
.link-btn { background: transparent; color: var(--sky); padding: 8px 0 0; font-size: 13px; font-weight: 700; }
.link-btn:hover { background: transparent; text-decoration: underline; }
.picker .hint:empty { display: none; }
.picker .hint { margin: 14px 0 0 48px; }
.picker .run-row .hint { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
details.explain { margin-top: 12px; font-size: 13px; color: #5b6672; }
details.explain > summary { cursor: pointer; display: inline-block; color: var(--sky); font-weight: 700; list-style: none; padding: 4px 0; }
details.explain > summary::-webkit-details-marker { display: none; }
details.explain > summary:before { content: "ⓘ "; }
details.explain p { margin: 6px 0 0; line-height: 1.75; background: #fbfaf3; border-radius: 10px; padding: 10px 14px; }

/* 9. 全站頁尾 */
footer.site-footer { border-top: 1px solid var(--line); background: #f3f1e4; color: #6b7480; font-size: 12px; line-height: 1.8; text-align: left; padding: 26px 20px 34px; }
.site-footer__inner { width: min(1180px, calc(100% - 40px)); margin: auto; display: flex; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; }
.site-footer strong { color: var(--navy); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: #4c5866; text-decoration: none; }
.site-footer a:hover { color: var(--blue); text-decoration: underline; }
.site-footer__brand a[href^="mailto:"] { color: var(--sky); }
/* 頁尾 Logo：在網站名稱上方，連到屏科大招生資訊網 */
.site-footer__logo { display: block; width: fit-content; margin-bottom: 10px; }
.site-footer__logo img { display: block; width: 240px; max-width: 100%; height: auto; }

/* 10. 響應式 */
@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid, .steps { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .site-brand__text { font-size: 14px; }
}
@media (max-width: 760px) {
  .site-nav { position: static; }
  .site-nav__inner { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0; }
  .site-links { overflow-x: auto; scrollbar-width: none; }
  .site-links a { padding: 8px 11px; font-size: 13px; }
}
@media (max-width: 560px) {
  main, .hero__inner, .site-nav__inner, .site-footer__inner { width: calc(100% - 32px); }
  .hero--compact .hero__inner { padding: 26px 0 80px; }
  .hero--compact h1 { font-size: 24px; }
  .hero--compact .hero__copy { font-size: 14px; margin: 8px 0 10px; }
  .hero--compact:after { font-size: 120px; }
  details.notes-fold > summary { padding: 16px 18px; }
  .site-footer__logo img { width: 200px; }
  .picker { padding: 18px 16px; }
  .step { grid-template-columns: 28px 1fr; gap: 10px; }
  .step__no { width: 28px; height: 28px; font-size: 13px; line-height: 28px; }
  .step__title { font-size: 15px; margin-top: 3px; }
  .picker .hint { margin-left: 38px; }
  details.notes-fold > ul { padding: 0 18px 18px 36px; }
  .hero { min-height: 0; }
  .hero h1 { font-size: 26px; }
  .hero:after { font-size: 160px; }
  .hero__dots { display: none; }
  .hero__inner { padding: 40px 0 96px; }
  .control-card, .chart-card, .table-card, .notes-card { padding: 18px; border-radius: 14px; }
  .summary-grid { gap: 10px; }
  .summary { padding: 14px; }
  .summary strong { font-size: 22px; }
  .section-heading small { display: none; }
  .section-heading { flex-wrap: wrap; }
}
@media print {
  .site-nav, footer.site-footer, .no-print, details.explain { display: none !important; }
  body { background: #fff; }
}
