/* React 改寫版：公告管理（列表、檢視、新增、修改）與後台登入頁的樣式 */

/* 公告列表：狀態標籤不換行（表格欄寬較窄時「公告中」不會被拆成兩行） */
.dataTable .status-badge { white-space: nowrap; }

/* 後台登入：單位選單（可搜尋，取代 Select2） */
.dep-select { position: relative; width: 100%; }
.dep-select-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: left; background: #fff; cursor: pointer; }
.dep-select-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-select-pop { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; padding: .5rem; background: #fff; border: 1px solid #cfd8e3; border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 39, 66, .15); }
.dep-select-pop ul { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.dep-select-pop li { padding: .4rem .55rem; border-radius: 6px; cursor: pointer; font-size: .92rem; white-space: pre; }
.dep-select-pop li.is-hi { background: #eef4fb; }
.dep-select-pop li.is-sel { font-weight: 700; color: #1d4e89; }
.dep-select-pop li.is-empty { color: #64748b; cursor: default; }
/* ---------- 後台登入頁（Pages/Admin/Login.jsx）----------
   版面來自登入頁樣板包 D:\xampp\htdocs\_templates\nsysu-login 的 v10：深藍漸層底、左下角校徽（正向）、
   右上角校園地圖與光暈、細點紋理；桌機左側系統介紹與校訓、右側登入框，992px 以下只顯示登入框。
   class 一律以 nl- 開頭；body 由 Login.jsx 換成 nl-page（不再使用 AdminLTE 的 login-page）。
   body 的 min-height 加 !important：AdminLTE 的 Layout 外掛可能在 React 畫出登入框前把 body 高度寫成行內樣式 */
:root {
  --nl-brand: #1d4e89;
  --nl-brand-2: #2f6fbd;
  --nl-brand-dark: #153a66;
  --nl-brand-soft: #e8f0fa;
  --nl-deep: #0f2742;
  --nl-accent: #7fb6ff;
  --nl-text: #1f2937;
  --nl-muted: #64748b;
  --nl-line: #d5deea;
  --nl-field: #f5f8fc;
}

/* ---------- 頁面底色與浮水印 ---------- */
body.nl-page {
  margin: 0; min-height: 100vh !important; height: auto; display: flex; flex-direction: column;
  background: linear-gradient(135deg, var(--nl-deep) 0%, var(--nl-brand) 100%) fixed;
  color: var(--nl-text); font-size: 15px; line-height: 1.5; letter-spacing: .01em;
  font-family: "Noto Sans TC", -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.nl-page *, .nl-page *::before, .nl-page *::after { box-sizing: border-box; }

/* 左下角校徽：正向（不旋轉）、白色半透明 */
.nl-page::before {
  --wm: clamp(200px, 30vw, 420px);
  content: ""; position: fixed; z-index: 0; pointer-events: none;
  left: clamp(16px, 3vw, 44px); bottom: clamp(16px, 3vw, 40px);
  width: var(--wm); aspect-ratio: 565.22 / 388.15;
  background: url(../img/nsysu-emblem.svg) no-repeat center / contain;
  filter: brightness(0) invert(1); opacity: .13;
}
/* 右上角光暈＋整頁細點紋理（往左下淡出） */
.nl-page::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; inset: 0;
  background:
    radial-gradient(circle at 88% 8%, rgba(120, 180, 255, .30) 0, rgba(120, 180, 255, .12) 22%, transparent 48%),
    radial-gradient(circle at 70% 0%, rgba(255, 255, 255, .08) 0, transparent 35%),
    radial-gradient(circle at 12% 92%, rgba(127, 182, 255, .10) 0, transparent 40%),
    radial-gradient(rgba(255, 255, 255, .10) 1px, transparent 1.5px) 0 0 / 26px 26px;
}
/* 右上角校園地圖：正向、白色半透明，四周淡出 */
.nl-split::before {
  --map: clamp(480px, 54vw, 980px);
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  right: -4%; top: -6%; width: var(--map); aspect-ratio: 1500 / 1061;
  background: url(../img/nsysu-campus-map.webp) no-repeat center / contain;
  opacity: .16;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at center, #000 45%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at center, #000 45%, transparent 100%);
}

/* ---------- 左文右框 ---------- */
.nl-split {
  position: relative; z-index: 1; flex: 1 0 auto; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: clamp(2.5rem, 7vw, 7rem);
  width: 100%; max-width: 1180px; padding: 48px 16px 24px;
}
.nl-hero { display: none; flex: 0 1 500px; color: #fff; }
/* 校名徽章：小校徽＋校名 */
.nl-hero-org {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1.4rem; padding: .4rem 1rem .4rem .75rem;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; background: rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: .88rem; font-weight: 600; letter-spacing: .22em; color: rgba(255, 255, 255, .9);
}
.nl-hero-org img { height: 20px; width: auto; filter: brightness(0) invert(1); }
.nl-hero h1 {
  margin: 0 0 1.2rem; font-size: clamp(2.6rem, 4.4vw, 3.8rem); font-weight: 800; letter-spacing: .06em; line-height: 1.2;
  background: linear-gradient(180deg, #fff 35%, #bcd9ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .28));
}
.nl-hero h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 1.2rem; border-radius: 2px; background: linear-gradient(90deg, var(--nl-accent), rgba(127, 182, 255, .15)); }
.nl-hero-desc { margin: 0 0 2rem; font-size: 1.08rem; line-height: 1.9; color: rgba(255, 255, 255, .86); }
/* 功能卡片：三格玻璃質感 */
.nl-hero-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.nl-hero-points li {
  display: flex; flex-direction: column; gap: .7rem; padding: .95rem 1rem;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .92rem; font-weight: 600; color: rgba(255, 255, 255, .94);
  transition: transform .25s ease, border-color .25s ease;
}
.nl-hero-points li:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .34); }
.nl-hero-points span { width: 36px; height: 36px; border-radius: 10px; background: rgba(127, 182, 255, .2); color: #b9d8ff; display: inline-flex; align-items: center; justify-content: center; }
.nl-hero-points svg { width: 18px; height: 18px; }

/* ---------- 登入框 ---------- */
.nl-box { flex: none; width: 420px; max-width: 100%; padding-top: 32px; }
.nl-card {
  position: relative; background: #fff; border-radius: 20px;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .07), 0 28px 70px rgba(4, 18, 38, .45);
}
.nl-card-head { padding: 0 1.5rem .5rem; text-align: center; }
/* 圖示浮在登入框上緣 */
.nl-icon {
  width: 68px; height: 68px; margin: -34px 0 .9rem; border-radius: 20px; border: 4px solid #fff;
  background: linear-gradient(135deg, var(--nl-brand) 0%, var(--nl-brand-2) 100%); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 24px rgba(29, 78, 137, .4);
}
.nl-icon svg { width: 28px; height: 28px; }
.nl-title { margin: 0; font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: .04em; color: var(--nl-text); }
.nl-title small { display: block; margin-top: .25rem; font-size: .85rem; font-weight: 400; letter-spacing: .01em; color: var(--nl-muted); }
.nl-only-desktop { display: none; }
.nl-card-body { padding: .5rem 2.25rem 2rem; }
.nl-msg { margin: 0 0 1.4rem; text-align: center; font-size: .9rem; color: var(--nl-muted); }

/* 欄位：上方標籤、左側圖示、右側（選用）顯示密碼按鈕 */
.nl-label { display: block; margin: 0 0 .35rem; font-size: .82rem; font-weight: 600; color: #475569; }
.nl-field { position: relative; margin-bottom: 1.1rem; }
.nl-field.is-tight { margin-bottom: .4rem; }
.nl-field > svg { position: absolute; left: .9rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: #94a3b8; pointer-events: none; transition: color .2s; }
.nl-field input, .nl-field select {
  display: block; width: 100%; height: 46px; padding: 0 2.9rem 0 2.7rem;
  border: 1px solid var(--nl-line); border-radius: 12px; background: var(--nl-field);
  color: var(--nl-text); font: inherit; transition: border-color .2s, box-shadow .2s, background .2s;
}
.nl-field input::placeholder { color: #a3aebd; }
.nl-field input:hover, .nl-field select:hover { border-color: #b6c4d6; }
.nl-field input:focus, .nl-field select:focus { outline: 0; background: #fff; border-color: var(--nl-brand-2); box-shadow: 0 0 0 4px rgba(47, 111, 189, .16); }
.nl-field:focus-within > svg { color: var(--nl-brand-2); }
.nl-pw-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: none; color: #94a3b8; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.nl-pw-toggle svg { width: 18px; height: 18px; }
.nl-pw-toggle:hover, .nl-pw-toggle[aria-pressed="true"] { color: var(--nl-brand); background: var(--nl-brand-soft); }
.nl-pw-toggle:focus-visible { outline: 2px solid var(--nl-brand-2); outline-offset: 1px; }
.nl-pw-toggle .nl-eye-off, .nl-pw-toggle[aria-pressed="true"] .nl-eye { display: none; }
.nl-pw-toggle[aria-pressed="true"] .nl-eye-off { display: inline; }

.nl-help { margin: 0 0 1.1rem; text-align: right; line-height: 1.2; }
.nl-link { padding: 0; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--nl-brand); cursor: pointer; text-decoration: none; }
.nl-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.nl-submit {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; height: 48px;
  padding: 0 1.5rem; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--nl-brand) 0%, var(--nl-brand-2) 100%);
  color: #fff; font: inherit; font-size: 1rem; font-weight: 700; letter-spacing: .2em; cursor: pointer;
  box-shadow: 0 10px 22px rgba(29, 78, 137, .32); transition: transform .2s, box-shadow .2s, filter .2s;
}
.nl-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(29, 78, 137, .4); filter: brightness(1.06); }
.nl-submit:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(29, 78, 137, .3); }
.nl-submit:focus-visible { outline: 3px solid rgba(47, 111, 189, .45); outline-offset: 2px; }
.nl-submit:disabled { opacity: .7; cursor: default; transform: none; }
.nl-submit svg { width: 18px; height: 18px; transition: transform .2s; }
.nl-submit:hover svg { transform: translateX(3px); }

.nl-alert { display: flex; gap: .5rem; align-items: flex-start; margin: 0 0 1.1rem; padding: .7rem .9rem; border: 1px solid #f5c6c0; border-radius: 12px; background: #fdecea; color: #b03a2e; font-size: .88rem; }
.nl-back { margin: 1.25rem 0 0; padding-top: 1.1rem; border-top: 1px solid #eef2f7; text-align: center; font-size: .84rem; }
.nl-back a { color: var(--nl-muted); text-decoration: none; transition: color .2s; }
.nl-back a:hover { color: var(--nl-brand); }

/* ---------- 頁尾 ---------- */
.nl-foot { position: relative; z-index: 1; margin: 0; padding: 0 16px 20px; text-align: center; font-size: .78rem; letter-spacing: .08em; color: rgba(255, 255, 255, .55); }

/* ---------- 進場動畫（使用者設定「減少動態效果」時不播放） ---------- */
@keyframes nl-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .nl-box { animation: nl-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .nl-hero > * { animation: nl-rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .nl-hero > :nth-child(2) { animation-delay: .08s; }
  .nl-hero > :nth-child(3) { animation-delay: .16s; }
  .nl-hero > :nth-child(4) { animation-delay: .24s; }
}

@media (min-width: 992px) {
  .nl-hero { display: block; }
  .nl-only-desktop { display: inline; }
  .nl-only-mobile { display: none; }
}
@media (max-width: 420px) {
  .nl-card-body { padding: .5rem 1.4rem 1.6rem; }
}

/* ---------- 校訓（取代三張功能卡片）：上方細橫線、「校訓」小膠囊、五個詞橫排（深色底配色） ---------- */
.nl-hero-motto {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.3rem; margin: 0; padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, .2);
  font-size: 1.15rem; font-weight: 500; letter-spacing: .45em; color: #d6e8ff;
}
.nl-hero-motto small {
  padding: .2rem .35rem .2rem .75rem; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .1);
  font-size: .72rem; font-weight: 600; letter-spacing: .4em; color: rgba(255, 255, 255, .8);
}

/* ---------- 公告系統專用的調整 ---------- */
/* #app 夾在 body 與 .nl-split 之間：撐滿高度，讓登入框垂直置中、頁尾貼底 */
.nl-page > #app { flex: 1 0 auto; display: flex; flex-direction: column; }
.nl-icon i { font-size: 1.6rem; }
.nl-title a { color: inherit; text-decoration: none; }
.nl-box .readonly-bar { margin-bottom: 2.6rem; }
/* 單位選單：外觀與其他欄位一致（圖示在左、箭頭在右） */
.nl-field .dep-select-btn {
  height: 46px; padding: 0 .95rem 0 2.7rem; border: 1px solid var(--nl-line); border-radius: 12px;
  background: var(--nl-field); color: var(--nl-text); font-size: inherit; box-shadow: none;
}
.nl-field .dep-select-btn:hover { border-color: #b6c4d6; }
.nl-field .dep-select-btn:focus { outline: 0; background: #fff; border-color: var(--nl-brand-2); box-shadow: 0 0 0 4px rgba(47, 111, 189, .16); }
.nl-field .dep-select-btn > i { color: #94a3b8; }
/* 下拉清單裡的搜尋框：不套用登入欄位的高度與左側圖示留白 */
.nl-field .dep-select-pop input { height: 36px; padding: 0 .7rem; border-radius: 8px; background: #fff; }
.nl-field { margin-bottom: .95rem; }
.nl-msg { margin-bottom: 1.2rem; }
.nl-submit i { font-size: 1rem; }
/* 視窗較矮（例如 1366x768 的筆電）時縮小上下留白與欄位高度，盡量不必捲動 */
@media (max-height: 800px) {
  .nl-split { padding-top: 28px; padding-bottom: 12px; }
  .nl-field input, .nl-field .dep-select-btn { height: 42px; }
  .nl-field { margin-bottom: .75rem; }
  .nl-msg { margin-bottom: .9rem; }
  .nl-card-body { padding-bottom: 1.4rem; }
  .nl-back { margin-top: .9rem; padding-top: .8rem; }
  .nl-foot { padding-bottom: 12px; }
}
