/* ==========================================================================
   臺中市清水區西寧國小 — 推動台灣母語日專網 Design System
   Warm Taiwanese Heritage × Contemporary School Editorial
   ========================================================================== */

:root {
  --bg-paper: #FAF7F2;
  --bg-warm: #F3EDE2;
  --surface: #FFFFFF;
  --surface-tint: #FDFBF7;

  --primary: #B33A2B;       /* 磚瓦紅 */
  --primary-dark: #8C271B;
  --primary-soft: #F9EAE7;

  --secondary: #2F5D50;     /* 欒樹綠 */
  --secondary-dark: #1E4036;
  --secondary-soft: #E8F1EE;

  --accent: #D99B26;        /* 暖陽金 */
  --accent-soft: #FDF5E4;

  --ink: #222629;
  --ink-body: #383E44;
  --ink-muted: #5C6570;

  --border: #E6DFD3;
  --border-strong: #D2C7B5;

  --shadow-sm: 0 2px 8px rgba(34, 38, 41, 0.05);
  --shadow-md: 0 8px 24px rgba(34, 38, 41, 0.08);
  --shadow-lg: 0 18px 42px rgba(34, 38, 41, 0.12);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --font-serif: "Noto Serif TC", "PMingLiU", Georgia, serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;

  --container-max: 1200px;
  --header-height: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-body);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  color: var(--ink);
  line-height: 1.35;
}

h1, h2, .font-serif {
  font-family: var(--font-serif);
}

p {
  margin: 0 0 1rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Subtle Taiwanese Window Lattice Pattern Strip */
.lattice-divider {
  height: 12px;
  width: 100%;
  background-color: var(--primary-soft);
  background-image: url("data:image/svg+xml,%3Csvg width='36' height='12' viewBox='0 0 36 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 6h12l6-5 6 5h12M18 1v10' fill='none' stroke='%23B33A2B' stroke-opacity='0.24' stroke-width='1.2'/%3E%3C/svg%3E");
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ==========================================================================
   Skip Link & Top Header Navigation
   ========================================================================== */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
  color: #fff;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(34, 38, 41, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  flex-shrink: 0;
}

.brand:hover {
  color: var(--ink);
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #8E2A1E 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(179, 58, 43, 0.25);
  position: relative;
  overflow: hidden;
}

.brand-emblem::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 9px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-school {
  font-size: 0.78rem;
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink-body);
  white-space: nowrap;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--primary);
}

.nav-toggle {
  display: none;
  background: var(--bg-paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  align-items: center;
  gap: 6px;
}

/* Mobile Drawer */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(250, 247, 242, 0.98);
  backdrop-filter: blur(8px);
  z-index: 890;
  padding: 24px;
  overflow-y: auto;
}

.nav-mobile.open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-mobile .nav-link {
  font-size: 1.08rem;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.nav-mobile .nav-link.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(179, 58, 43, 0.24);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(47, 93, 80, 0.2);
}
.btn-secondary:hover {
  background: var(--secondary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.badge-secondary {
  background: var(--secondary-soft);
  color: var(--secondary-dark);
}

.badge-accent {
  background: var(--accent-soft);
  color: #8F610C;
}

.badge-neutral {
  background: var(--bg-warm);
  color: var(--ink-body);
}

/* ==========================================================================
   Hero & Page Headers
   ========================================================================== */
.hero {
  position: relative;
  padding: 56px 0 48px;
  background:
    radial-gradient(circle at 8% 12%, rgba(217, 155, 38, 0.14), transparent 36%),
    radial-gradient(circle at 92% 85%, rgba(47, 93, 80, 0.12), transparent 40%),
    linear-gradient(180deg, #FDFBF7 0%, var(--bg-paper) 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 40px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero-lead {
  font-size: 1.08rem;
  color: var(--ink-body);
  max-width: 54ch;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-visual {
  position: relative;
}

.hero-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: var(--shadow-lg);
  background: var(--bg-warm);
  position: relative;
}

.hero-frame img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-caption-card {
  position: absolute;
  left: -18px;
  bottom: -18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  max-width: 280px;
}

.hero-caption-card strong {
  display: block;
  color: var(--primary);
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.hero-caption-card span {
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.4;
  display: block;
}

/* Subpage Banner */
.page-banner {
  background:
    linear-gradient(125deg, rgba(179, 58, 43, 0.94) 0%, rgba(140, 39, 27, 0.95) 55%, rgba(47, 93, 80, 0.92) 100%);
  color: #fff;
  padding: 44px 0 38px;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='18' fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='1.5'/%3E%3Cpath d='M0 30h60M30 0v60' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

.page-banner .container {
  position: relative;
  z-index: 1;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-banner h1 {
  color: #fff;
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  margin-bottom: 10px;
}

.page-banner p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 65ch;
  margin-bottom: 0;
  font-size: 1.02rem;
}

/* Anchor Quick Nav Strip */
.quick-toc {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.quick-toc-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quick-toc-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-right: 4px;
}

.quick-toc a {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  background: var(--bg-paper);
  color: var(--ink-body);
  border: 1px solid var(--border);
}

.quick-toc a:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: var(--primary);
}

/* ==========================================================================
   Stats Strip & Section Layout
   ========================================================================== */
.stats-strip {
  margin-top: -20px;
  position: relative;
  z-index: 10;
  padding-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
}

.stat-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.96rem;
}

.stat-desc {
  font-size: 0.83rem;
  color: var(--ink-muted);
}

.section {
  padding: 56px 0;
}

.section-alt {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.section-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 6px;
  display: block;
}

.section-title {
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  margin-bottom: 6px;
}

.section-subtitle {
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0;
}

/* ==========================================================================
   Cards & Grids
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-media {
  margin: -24px -24px 18px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--bg-warm);
}

.card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.card-text {
  color: var(--ink-body);
  font-size: 0.94rem;
  margin-bottom: 14px;
  flex: 1;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Language Cards */
.lang-card {
  border-top: 4px solid var(--primary);
}
.lang-card[data-theme="green"] {
  border-top-color: var(--secondary);
}
.lang-card[data-theme="gold"] {
  border-top-color: var(--accent);
}

.lang-greeting {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.lang-card[data-theme="green"] .lang-greeting {
  color: var(--secondary);
}
.lang-card[data-theme="gold"] .lang-greeting {
  color: #9A6B0C;
}

/* Feature Split Card */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.feature-split img {
  border-radius: var(--radius-md);
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ==========================================================================
   Filter Bar & Tabs & Search
   ========================================================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  background: var(--surface);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-paper);
  color: var(--ink-body);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.search-input-wrap {
  position: relative;
  min-width: 240px;
  flex: 1;
  max-width: 340px;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--bg-paper);
  color: var(--ink);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

/* Tabs */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--ink-body);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-panel[hidden] {
  display: none;
}

/* ==========================================================================
   Tables & Committee List & Awards Timeline
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

table.data-table th,
table.data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  background: var(--bg-warm);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

table.data-table tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: var(--surface-tint);
}

/* Honor Card */
.honor-banner {
  background: linear-gradient(135deg, #FFFBF2 0%, #FDF2DA 100%);
  border: 1px solid #EBD39D;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.honor-year {
  font-size: 0.82rem;
  font-weight: 700;
  color: #8F610C;
  margin-bottom: 4px;
}

.honor-students {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.student-chip {
  background: #fff;
  border: 1px solid #E6D2A2;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

/* Video Card */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1B1E21;
  margin-bottom: 14px;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Photo Album Placeholder Card */
.album-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.album-tile {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--bg-warm) 0%, #EAE1D3 100%);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.album-tile svg {
  opacity: 0.65;
  margin-bottom: 4px;
}

.album-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.album-thumb-btn {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-warm);
  cursor: pointer;
}

.album-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.album-thumb-btn:hover img {
  transform: scale(1.05);
}

.album-thumb-more {
  position: absolute;
  inset: 0;
  background: rgba(24, 27, 30, 0.58);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ==========================================================================
   Lightbox Gallery Modal
   ========================================================================== */
.lightbox-dialog {
  width: 100%;
  max-width: 1060px;
  max-height: 90vh;
  background: #171A1C;
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #202427;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #fff;
}

.lightbox-counter {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.72);
  margin-left: 10px;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 360px;
  max-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 56px;
  background: #111315;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.lightbox-nav:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-strip {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  background: #1C2023;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-strip-item {
  width: 68px;
  height: 50px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #2A2F33;
  opacity: 0.65;
}

.lightbox-strip-item.active {
  border-color: var(--accent);
  opacity: 1;
}

.lightbox-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-caption {
  padding: 10px 20px;
  background: #171A1C;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Evaluation Photo Evidence Wall (評鑑佐證相片牆)
   ========================================================================== */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.evidence-card {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.evidence-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.evidence-btn {
  position: relative;
  border: 0;
  padding: 0;
  background: var(--bg-warm);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
  width: 100%;
}

.evidence-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.evidence-card:hover .evidence-btn img {
  transform: scale(1.04);
}

.evidence-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(23, 26, 28, 0.72);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.evidence-caption {
  padding: 11px 13px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-body);
  font-weight: 500;
}

.evidence-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 3px;
}

@media (max-width: 1080px) {
  .evidence-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Modal (Google Drive Preview & Notices)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 27, 30, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 980px;
  height: 86vh;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-notice {
  background: var(--accent-soft);
  color: #704B08;
  font-size: 0.85rem;
  padding: 8px 22px;
  border-bottom: 1px solid #EBD39D;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-body {
  flex: 1;
  background: #F0ECE4;
  position: relative;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #1F2624;
  color: rgba(255, 255, 255, 0.86);
  padding: 52px 0 28px;
  border-top: 4px solid var(--primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.footer-title {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.footer-heading {
  color: #fff;
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .nav-desktop {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-caption-card {
    position: static;
    margin-top: 12px;
    max-width: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .stats-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .brand-title {
    font-size: 0.96rem;
  }
  .section {
    padding: 40px 0;
  }
  .modal-dialog {
    height: 92vh;
  }
}
