/* ═══════════════════════════════════════════════════════════════
   nycu-shared.css  —  國立陽明交通大學 招生資訊網
   ▸ 每頁 <head> 已透過 <link> 載入：
       <link rel="stylesheet" href="nycu-shared.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS 變數 ─────────────────────────────────────────────── */
:root {
  --ink:        #1a2744;
  --ink-mid:    #2c4a82;
  --ink-light:  #e8eef6;
  --gold:       #b8901e;
  --gold-pale:  #fdf5e2;
  --line:       #d8dde8;
  --text:       #222;
  --muted:      #5a6070;
  --white:      #fff;
  --bg:         #f7f8fb;
  --r:          4px;
  --radius:     4px;
  --shadow:     0 2px 12px rgba(26,39,68,.08);
  --shadow-md:  0 6px 24px rgba(26,39,68,.13);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Noto Sans TC', sans-serif; background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.7; }
a { text-decoration: none; color: inherit; transition: all .2s; }
img { max-width: 100%; display: block; }

/* ── Utility bar（頂部深色條）─────────────────────────────── */
/* 內頁用 .ub / .ui / .us */
.ub { background: var(--ink); font-size: 0.8333rem; color: rgba(255,255,255,.65); padding: 0; }
.ui { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; height: 38px; }
.us { font-family: 'Noto Serif TC', serif; font-size: 0.8667rem; letter-spacing: .06em; }
/* 首頁用 .util-bar / .util-inner / .util-site */
.util-bar { background: var(--ink); font-size: 0.8333rem; color: rgba(255,255,255,.65); padding: 0; }
.util-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; height: 38px; }
.util-site { font-family: 'Noto Serif TC', serif; font-size: 0.8667rem; letter-spacing: .06em; }
/* 共用連結樣式 */
.ui a, .util-inner a { color: rgba(255,255,255,.65); margin-left: 16px; display: inline-flex; align-items: center; gap: 5px; }
.ui a:hover, .util-inner a:hover { color: #f5d98a; }
.ui a i, .util-inner a i { font-size: 0.8rem; }

/* ── Header ───────────────────────────────────────────────── */
header { background: var(--white); border-bottom: 3px solid var(--ink); position: sticky; top: 0; z-index: 200; box-shadow: var(--shadow); }
/* 首頁 .header-inner */
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: stretch; padding: 0 28px; min-height: 66px; }
/* 內頁 .hi */
.hi { max-width: 1280px; margin: 0 auto; display: flex; align-items: stretch; padding: 0 28px; min-height: 66px; }

/* ── Logo 區塊（首頁 .logo-block / 內頁 .lb）──────────────── */
.logo-block, .lb {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; margin-right: 36px; flex-shrink: 0;
}
/* 校徽圖片（透明背景，依比例縮放）*/
.logo-mark, .lm { background: transparent; flex-shrink: 0; overflow: visible; display: block; }
.logo-mark img, .lm img { height: 40px; width: auto; display: block; transition: transform 0.3s ease; }
.logo-block:hover .logo-mark img, .lb:hover .lm img { transform: scale(1.1); }
/* Logo 文字（首頁 .logo-text / 內頁 .lt）*/
.logo-text, .lt { line-height: 1.4; }
.logo-text .en, .lt .en {
  font-size: 0.6667rem; color: var(--muted); letter-spacing: .12em;
  text-transform: uppercase; display: block; margin-bottom: 2px;
}
.logo-text .zh, .lt .zh {
  font-size: 1.0333rem; font-weight: 700; color: var(--ink);
  letter-spacing: .05em; font-family: 'Noto Serif TC', serif; display: block;
}

/* ── 水平主導覽（首頁 .main-nav / 內頁 .mn）──────────────── */
.main-nav, .mn { flex: 1; display: flex; }
/* 首頁 nav-list */
.nav-list { display: flex; list-style: none; height: 100%; }
.nav-list > li { position: relative; height: 100%; }
.nav-list > li > a, .nav-list > li > button {
  display: flex; align-items: center; gap: 5px;
  padding: 0 16px; height: 100%;
  font-size: 0.9333rem; font-weight: 500; color: var(--ink);
  background: none; border: none; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -3px;
  transition: color .2s, border-color .2s; white-space: nowrap;
  font-family: 'Noto Sans TC', sans-serif;
}
.nav-list > li > a:hover,
.nav-list > li > button:hover { color: var(--gold); border-bottom-color: var(--gold); }
.nav-list > li > button::after { content: '▾'; font-size: 0.6667rem; opacity: .5; }
/* 內頁 .nl */
.nl { display: flex; list-style: none; height: 100%; }
.nl > li { position: relative; height: 100%; }
.nl > li > a, .nl > li > button {
  display: flex; align-items: center; gap: 5px;
  padding: 0 16px; height: 100%;
  font-size: 0.9333rem; font-weight: 500; color: var(--ink);
  background: none; border: none; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -3px;
  transition: color .2s, border-color .2s; white-space: nowrap;
  font-family: 'Noto Sans TC', sans-serif;
}
.nl > li > a:hover,
.nl > li > button:hover { color: var(--gold); border-bottom-color: var(--gold); }
.nl > li > button::after { content: '▾'; font-size: 0.6667rem; opacity: .5; }

/* ── Dropdown（首頁 .dropdown / 內頁 .dd）────────────────── */
.dropdown, .dd {
  display: none; position: absolute; top: calc(100% + 3px); left: 0;
  background: var(--white); border: 1px solid var(--line);
  border-top: 2px solid var(--ink); min-width: 215px;
  box-shadow: var(--shadow-md); z-index: 300;
  border-radius: 0 0 4px 4px; padding: 6px 0;
  animation: dropAnim .15s ease;
}
@keyframes dropAnim { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.nav-list > li:hover .dropdown,
.nl > li:hover .dd { display: block; }
.dropdown a, .dd a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 18px; font-size: 0.9rem; color: var(--text);
  border-left: 2px solid transparent;
}
.dropdown a:hover, .dd a:hover { background: var(--ink-light); color: var(--ink); border-left-color: var(--gold); }
.dropdown .sep, .dd .sp { height: 1px; background: var(--line); margin: 4px 0; }

/* ── Header 右側按鈕區 ───────────────────────────────────── */
.header-actions, .ha { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* 報名/報到系統（金色主按鈕）*/
.btn-reg, .br {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--r);
  font-size: 0.9rem; font-weight: 700;
  background: var(--gold); color: var(--white);
  border: none; cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .15s; text-decoration: none;
}
.btn-reg:hover, .br:hover { background: #9a7518; transform: translateY(-1px); }

/* ── 頂部 nav 最後項（新生入學指引）────────────────────── */
.nav-last-link { color: var(--ink); font-weight: 500; font-size: 0.9rem; }
.nav-last-link:hover { color: var(--gold); }

/* ── Page Banner ─────────────────────────────────────────── */
.pb { background: var(--ink); padding: 48px 28px 62px; position: relative; overflow: hidden; color: var(--white); }
.pb-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; }
/* ▸ 遮罩已調亮，讓招生照片更有活力，參見 nycu-banners.js */
.pb-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    108deg,
    rgba(26, 39, 68, 0.60) 0%,
    rgba(26, 39, 68, 0.38) 50%,
    rgba(44, 74, 130, 0.12) 100%
  );
}
.pb-wave { position: absolute; bottom: 0; left: 0; right: 0; height: 50px; background: var(--bg); clip-path: polygon(0 100%, 100% 0, 100% 100%); z-index: 2; }
.pi { max-width: 1280px; margin: 0 auto; position: relative; z-index: 3; }
.pe { font-size: 0.7333rem; letter-spacing: .2em; text-transform: uppercase; color: #f5d98a; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pe::before { content: ''; width: 20px; height: 1px; background: #f5d98a; display: block; }
.pi h1 { font-family: 'Noto Serif TC', serif; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.pi p { color: rgba(255,255,255,.82); font-size: 1rem; }

/* ── Breadcrumb ──────────────────────────────────────────── */
.brc { max-width: 1280px; margin: 0 auto; padding: 13px 28px; font-size: 0.8667rem; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.brc a { color: var(--ink-mid); }
.brc a:hover { text-decoration: underline; }
.brc i { font-size: 0.6rem; color: var(--line); }

/* ── Page layout ─────────────────────────────────────────── */
.pg { max-width: 1280px; margin: 0 auto; padding: 32px 28px 80px; display: grid; grid-template-columns: 224px 1fr; gap: 40px; align-items: start; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sn { position: sticky; top: 80px; }
.sg { margin-bottom: 6px; }
.sg-h { background: var(--ink); color: var(--white); font-size: 0.8333rem; font-weight: 700; padding: 10px 16px; display: flex; align-items: center; gap: 8px; letter-spacing: .04em; }
.sg-h i { font-size: 0.8667rem; opacity: .8; color: #f5d98a; }
.sl { list-style: none; background: var(--white); border: 1px solid var(--line); border-top: none; }
.sl li a { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; font-size: 0.8667rem; color: var(--text); border-bottom: 1px solid #f0f2f6; border-left: 3px solid transparent; transition: all .18s; }
.sl li:last-child a { border-bottom: none; }
.sl li a:hover, .sl li a.active { background: var(--ink-light); color: var(--ink); border-left-color: var(--gold); }
.sl li a.active { font-weight: 700; }
.sl li a .cv { font-size: 0.6rem; color: var(--muted); }
/* 快速工具列（.su / .lnav-util 共用）*/
.su, .lnav-util { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.su a, .lnav-util a {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: var(--r);
  font-size: 0.8667rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--white);
  transition: all .2s; color: var(--text); text-decoration: none;
}
.su a i, .lnav-util a i { color: var(--ink); font-size: 0.9333rem; }
.su a:hover, .lnav-util a:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.su a:hover i, .lnav-util a:hover i { color: #f5d98a; }

/* ── Main card ───────────────────────────────────────────── */
.mc { min-width: 0; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 36px 40px; box-shadow: var(--shadow); }
.card h2 { font-family: 'Noto Serif TC', serif; font-size: 1.4667rem; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--gold); padding-bottom: 14px; margin-bottom: 22px; display: flex; align-items: center; gap: 10px; }
.card h3 { font-size: 1.1333rem; font-weight: 700; color: var(--ink); margin: 28px 0 12px; display: flex; align-items: center; gap: 8px; }
.card h3 i { font-size: 0.9333rem; opacity: .7; }
.card p { color: var(--muted); font-size: 0.9667rem; line-height: 1.9; margin-bottom: 14px; }

/* ── Info table ──────────────────────────────────────────── */
.it {
  width: 100%; border-collapse: collapse; margin: 12px 0 24px;
  font-size: 0.9333rem; table-layout: fixed;
}
.it th {
  background: var(--ink); color: var(--white);
  padding: 11px 16px; text-align: left;
  font-weight: 500; font-size: 0.8667rem; vertical-align: top;
  word-wrap: break-word; overflow-wrap: break-word;
}
.it td {
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  vertical-align: top; word-wrap: break-word;
  overflow-wrap: break-word; white-space: normal;
}
/* 左欄（項目/日期）：桌面版固定寬度，格線切齊 */
.it td.lb {
  color: var(--muted); font-size: 0.8667rem; font-weight: 500;
  white-space: normal; vertical-align: top; width: 28%;
  min-width: 0;
}
/* 重要日程表格左欄（日期）桌面版稍寬 */
.it.schedule td:first-child { width: 32%; min-width: 0; }

/* ── 手機版：表格自動換行，左欄不固定 ── */
@media (max-width: 640px) {
  .it { table-layout: auto; font-size: 0.8667rem; }
  .it th, .it td {
    padding: 9px 12px;
    font-size: 0.8rem;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  /* 基本資料表：左欄（項目）改百分比，跟著螢幕縮 */
  .it td.lb { width: 34%; min-width: 0; font-size: 0.8rem; }
  /* 重要日程表：日期欄改百分比 */
  .it.schedule td:first-child { width: 38%; min-width: 0; }
  /* 極窄螢幕（< 400px）：改直向排列 */
  @media (max-width: 400px) {
    .it, .it thead, .it tbody, .it th, .it td, .it tr {
      display: block;
    }
    .it thead { display: none; } /* 隱藏 th 表頭 */
    .it td {
      border-bottom: none;
      padding: 6px 12px;
    }
    .it td.lb {
      width: 100%;
      background: var(--ink-light);
      color: var(--ink);
      font-weight: 700;
      padding: 8px 12px 4px;
      border-top: 1px solid var(--line);
      margin-top: 4px;
    }
    .it tr { border-bottom: 2px solid var(--line); }
    .it tr:last-child { border-bottom: none; }
    .it td:last-child { padding-bottom: 10px; }
  }
}

.it tr:last-child td { border-bottom: none; }
.it tr:hover td { background: #f8fafd; }

/* ── Step list ───────────────────────────────────────────── */
.st { counter-reset: s; list-style: none; margin: 0 0 24px; }
.st li { counter-increment: s; display: flex; gap: 14px; margin-bottom: 16px; align-items: flex-start; }
.st li::before { content: counter(s); display: flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; background: var(--ink); color: #fff; border-radius: 50%; font-size: 0.8667rem; font-weight: 700; flex-shrink: 0; margin-top: 3px; }
.st li .sb { flex: 1; }
.st li .t { font-weight: 700; color: var(--ink); font-size: 0.9667rem; margin-bottom: 3px; }
.st li .d { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

/* ── Note box ────────────────────────────────────────────── */
.nb { background: var(--gold-pale); border: 1px solid #e8d49a; border-left: 4px solid var(--gold); border-radius: 4px; padding: 14px 18px; margin: 14px 0 22px; font-size: 0.9rem; color: #5a4200; line-height: 1.8; }
.nb i { color: var(--gold); margin-right: 5px; }

/* ── Doc list ────────────────────────────────────────────── */
.dl { list-style: none; margin: 0 0 24px; }
.dl li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.9333rem; }
.dl li:last-child { border-bottom: none; }
.dl li i { color: var(--ink); font-size: 1.1333rem; width: 22px; text-align: center; }
.dl li a { color: var(--ink-mid); font-weight: 500; }
.dl li a:hover { text-decoration: underline; }

/* ── Action buttons ──────────────────────────────────────── */
.ba { display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px; background: var(--gold); color: #fff; border-radius: 4px; font-weight: 700; font-size: 0.9667rem; margin-top: 6px; transition: background .2s, transform .15s; margin-right: 10px; margin-bottom: 10px; }
.ba:hover { background: #9a7518; transform: translateY(-1px); }
.ba.bl { background: var(--ink); }
.ba.bl:hover { background: var(--ink-mid); }

/* ── Contact grid ────────────────────────────────────────── */
.cg { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.cc { background: #f8f9fb; border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.cc h4 { color: var(--ink); font-size: 1rem; font-weight: 700; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cc p, .cc a { font-size: 0.9rem; color: var(--muted); line-height: 1.9; }
.cc a { color: var(--ink-mid); }

/* ── Year tabs + Announce ────────────────────────────────── */
.yt { display: flex; gap: 0; margin: 18px 0 0; }
.ytb { padding: 8px 20px; border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; font-size: 0.9rem; font-weight: 500; cursor: pointer; font-family: 'Noto Sans TC', sans-serif; background: #eef0f4; color: var(--muted); transition: all .15s; }
.ytb + .ytb { margin-left: 4px; }
.ytb.active { background: var(--white); color: var(--ink); font-weight: 700; border-color: var(--line); border-bottom: 1px solid var(--white); position: relative; z-index: 1; margin-bottom: -1px; }
.ytb:not(.active):hover { background: var(--ink-light); color: var(--ink); }
.aw { border: 1px solid var(--line); border-radius: 0 4px 4px 4px; background: var(--white); overflow: hidden; }
.ai { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid #f0f2f6; transition: background .15s; }
.ai:last-child { border-bottom: none; }
.ai:hover { background: var(--ink-light); }
.ad { font-size: 0.8rem; color: var(--muted); min-width: 82px; flex-shrink: 0; font-weight: 500; }
.ak { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ak i { color: var(--ink); font-size: 0.8rem; }
.at { flex: 1; font-size: 0.9333rem; color: var(--text); }
.at:hover { color: var(--ink); text-decoration: underline; }
.ax { font-size: 0.6667rem; color: var(--muted); flex-shrink: 0; }
.al { padding: 26px; text-align: center; color: var(--muted); font-size: 0.9333rem; }
.al i { font-size: 1.3333rem; color: var(--ink); display: block; margin-bottom: 10px; }
.lv { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px; font-size: 0.7333rem; font-weight: 500; background: #e8f5e9; color: #2e7d32; vertical-align: middle; margin-left: 8px; }
.ca { background: var(--gold-pale); color: #7a5000; }

/* ── Footer ──────────────────────────────────────────────── */
footer { background: var(--ink); border-top: 3px solid var(--gold); color: rgba(255,255,255,.65); padding: 44px 28px 28px; }
.fi { max-width: 1280px; margin: 0 auto; }
.ft { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.fc h5 { font-size: 0.8rem; letter-spacing: .12em; text-transform: uppercase; color: #f5d98a; margin-bottom: 14px; font-weight: 700; }
.fc p, .fc a { font-size: 0.8667rem; line-height: 1.9; color: rgba(255,255,255,.6); }
.fc a:hover { color: #f5d98a; }
.fb { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; flex-wrap: wrap; gap: 8px; }
.fb a { color: rgba(255,255,255,.4); margin-left: 16px; }
.fb a:hover { color: #f5d98a; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .pg { grid-template-columns: 1fr; }
  .sn { position: static; }
}
@media (max-width: 640px) {
  .header-inner, .hi { flex-wrap: wrap; padding: 10px 16px; }
  .main-nav, .mn { display: none; }
  .card { padding: 22px 18px; }
  .cg { grid-template-columns: 1fr; }
  .ft { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .ft { grid-template-columns: 1fr; }
}


 /* ── NEWS ── */
    .news-wrap { margin-bottom: 44px; }
    .news-list { 
      /*background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; */
       background: transparent; border: none; border-radius: 0; overflow: hidden;
    }
    .news-item {
      display: flex; align-items: center; gap: 16px;
      padding: 14px 20px; border-bottom: 1px solid #f0f2f6; transition: background .15s;
    }
    .news-item:last-child { border-bottom: none; }
    .news-item:hover { background: var(--ink-light); }
    .news-date { font-size: 0.8333rem; color: var(--muted); min-width: 88px; flex-shrink: 0; font-weight: 500; }
    .news-badge { flex-shrink: 0; font-size: 0.7333rem; font-weight: 700; padding: 2px 9px; border-radius: 3px; white-space: nowrap; }
    .nb-ug   { background: #e8f5e9; color: #2e7d32; }
    .nb-ma   { background: var(--ink-light); color: var(--ink-mid); }
    .nb-dr   { background: #f3e5f5; color: #6a1b9a; }
    .nb-emba { background: #fff3e0; color: #e65100; }
    .nb-gen  { background: #f5f5f5; color: #555; }
    .news-title { font-size: 0.9333rem; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .news-item:hover .news-title { color: var(--ink); }
  /*  year  */
    .year-tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 0;
    }
    .year-tab {
        padding: 8px 22px;
         border: 1px solid var(--line);
        border-bottom: none;
        border-radius: 4px 4px 0 0;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        background: #eef0f4;
        color: var(--muted);
        font-family: inherit;
    }
    .year-tab.active {
        background: var(--ink);
        color: #fff;
        font-weight: 700;
    }
    .year-panel {
         border: 1px solid var(--line);
        border-radius: 0 4px 4px 4px;
        background: var(--white);
        padding: 20px 22px;
        margin-bottom: 24px;
    }
