/* ═══════════════════════════════════════
   雅礼团委-通办 · Material 3 Expressive
   雅礼深蓝 · M3 Design System
   ═══════════════════════════════════════ */

/* ── M3 Design Tokens ── */
:root {
  /* Primary */
  --md-primary: #0D2137;
  --md-on-primary: #FFFFFF;
  --md-primary-container: #D6E3FF;
  --md-on-primary-container: #001D36;
  --md-primary-dim: #1A3C5E;
  --md-primary-light: #3B6B9E;

  /* Secondary */
  --md-secondary: #535F70;
  --md-secondary-container: #D7E3F7;
  --md-on-secondary-container: #101C2B;

  /* Tertiary */
  --md-tertiary: #6E5676;
  --md-tertiary-container: #F8D9FF;

  /* Surface */
  --md-surface: #FAFCFF;
  --md-surface-dim: #DDE3EB;
  --md-surface-container: #EEF2F8;
  --md-surface-container-high: #E8ECF4;
  --md-surface-container-highest: #E2E6EF;
  --md-on-surface: #191C20;
  --md-on-surface-variant: #43474E;

  /* Outline */
  --md-outline: #C4C6D0;
  --md-outline-variant: #DEE3EB;

  /* Error */
  --md-error: #BA1A1A;
  --md-error-container: #FFDAD6;
  --md-on-error-container: #410002;

  /* Custom semantic (keeping original names for compatibility) */
  --accent: #C62828;
  --success: #1B7D4A;
  --success-light: #D4F5E2;
  --warning: #E67E22;
  --warning-light: #FDEBD0;
  --info: var(--md-primary-light);
  --info-light: var(--md-primary-container);

  /* Elevation */
  --md-elevation-0: none;
  --md-elevation-1: 0 1px 3px rgba(13,33,55,.08), 0 1px 2px rgba(13,33,55,.06);
  --md-elevation-2: 0 2px 8px rgba(13,33,55,.1), 0 1px 3px rgba(13,33,55,.06);
  --md-elevation-3: 0 4px 16px rgba(13,33,55,.12), 0 2px 6px rgba(13,33,55,.08);
  --md-elevation-4: 0 8px 30px rgba(13,33,55,.14), 0 3px 10px rgba(13,33,55,.1);
  --md-elevation-5: 0 12px 40px rgba(13,33,55,.18);

  /* Shape */
  --md-shape-xs: 4px;
  --md-shape-sm: 8px;
  --md-shape-md: 12px;
  --md-shape-lg: 16px;
  --md-shape-xl: 24px;
  --md-shape-full: 56px;

  /* Typography - M3 expressive scale */
  --md-font-display: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
  --md-font-body: 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;

  /* Legacy vars (maps to M3) */
  --primary: var(--md-primary);
  --primary-light: var(--md-primary-light);
  --primary-lighter: var(--md-primary-container);
  --primary-dark: var(--md-primary);
  --bg: var(--md-surface);
  --bg-card: var(--md-surface-container);
  --text: var(--md-on-surface);
  --text-secondary: var(--md-on-surface-variant);
  --text-light: var(--md-outline);
  --border: var(--md-outline-variant);
  --shadow: var(--md-elevation-1);
  --shadow-lg: var(--md-elevation-3);
  --radius: var(--md-shape-sm);
  --radius-sm: var(--md-shape-xs);
  --radius-lg: var(--md-shape-md);
  --nav-height: 64px;
  --max-width: 1100px;
  --font: var(--md-font-body);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--md-font-body);
  background:
    radial-gradient(ellipse 80% 40% at 20% 0%, rgba(13,33,55,.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 30% at 80% 100%, rgba(13,33,55,.03) 0%, transparent 60%),
    var(--md-surface);
  color: var(--md-on-surface);
  line-height: 1.65;
  padding-top: var(--nav-height);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}
/* geometric dot pattern overlay */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image: radial-gradient(circle, var(--md-outline-variant) .6px, transparent .6px);
  background-size: 28px 28px;
  opacity: .35;
  pointer-events: none;
}
a { color: var(--md-primary-light); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-outline); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-on-surface-variant); }

/* ── INLINE SVG ICONS ── */
svg { display: inline; vertical-align: middle; }
.btn svg, .nav-link svg, .badge svg, .task-meta svg, .announce-banner-title svg { margin-right: 2px; }

/* ── NAVIGATION (M3 Top App Bar) ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-height);
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.nav-inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 2px;
}
.nav-brand {
  font-family: var(--md-font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-right: auto;
  white-space: nowrap;
  letter-spacing: .02em;
  color: var(--md-on-primary);
}
.nav-brand small { font-weight: 400; opacity: .7; font-size: .85rem; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  color: rgba(255,255,255,.82);
  padding: 6px 16px;
  border-radius: var(--md-shape-full);
  font-size: .88rem;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  line-height: 1.4;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.nav-link.active { font-weight: 600; }
.nav-user { font-size: .82rem; opacity: .7; margin-left: 12px; white-space: nowrap; font-weight: 400; }
.nav-logout { color: rgba(255,255,255,.65); cursor: pointer; font-size: .82rem; padding: 6px 12px; border-radius: var(--md-shape-full); background: none; border: 1px solid rgba(255,255,255,.2); margin-left: 8px; font-family: inherit; transition: all .2s; }
.nav-logout:hover { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.08); }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; padding: 6px; border-radius: 50%; line-height: 1; }
.nav-toggle svg { width: 1.25em; height: 1.25em; display: block; }

/* ── LAYOUT ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 28px 24px; animation: pageIn .45s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.page-header {
  margin-bottom: 36px;
  position: relative;
  padding-bottom: 16px;
}
.page-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 72px; height: 3px;
  background: linear-gradient(90deg, var(--md-primary), var(--md-primary-light), transparent);
  border-radius: 2px;
}
.page-header h1 {
  font-family: var(--md-font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--md-primary);
  margin-bottom: 4px;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.page-header p { color: var(--md-on-surface-variant); font-size: .92rem; margin-top: 6px; }
.section { margin-bottom: 40px; }
.section {
  margin-bottom: 40px;
  position: relative;
}
.section-title {
  font-family: var(--md-font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--md-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--md-primary-container);
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: .01em;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 48px; height: 2px;
  background: var(--md-primary);
  border-radius: 1px;
}

/* ── CARDS (M3 Elevated Card) ── */
.card {
  background: var(--md-surface-container);
  border-radius: var(--md-shape-md);
  box-shadow: var(--md-elevation-1);
  padding: 24px;
  margin-bottom: 16px;
  transition: box-shadow .25s, transform .2s;
  border: 1px solid var(--md-outline-variant);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--md-primary-light), transparent 80%);
  opacity: 0;
  transition: opacity .25s;
}
.card:hover { box-shadow: var(--md-elevation-3); transform: translateY(-1px); }
.card:hover::before { opacity: 1; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.card-body { color: var(--md-on-surface); font-size: .95rem; line-height: 1.75; }
.card-footer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--md-outline-variant); display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--md-on-surface-variant); }

/* ── STATUS BADGES (M3 Badge) ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 12px;
  border-radius: var(--md-shape-full);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .01em;
  height: 22px;
}
.badge-pending { background: var(--warning-light); color: #7B5A00; }
.badge-processing { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.badge-done { background: var(--success-light); color: #0D5E3A; }
.badge-review { background: #F0E6F6; color: #5B3A70; }
.badge-pass { background: var(--success-light); color: #0D5E3A; }
.badge-reject { background: var(--md-error-container); color: var(--md-on-error-container); }
.badge-expiring { background: #FFF0E0; color: #A35000; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* ── BUTTONS (M3) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--md-shape-full);
  font-size: .88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--md-primary); color: var(--md-on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--md-primary-dim); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15653E; }
.btn-danger { background: var(--md-error); color: var(--md-on-error); }
.btn-danger:hover:not(:disabled) { background: #8F1313; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #C96B14; }
.btn-outline {
  background: transparent;
  color: var(--md-primary);
  border: 1.5px solid var(--md-primary);
}
.btn-outline:hover:not(:disabled) { background: var(--md-primary-container); }
.btn-sm { padding: 6px 16px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── FORMS (M3 Outlined Text Field) ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: 6px; color: var(--md-on-surface); }
.form-label .required { color: var(--md-error); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--md-outline);
  border-radius: var(--md-shape-sm);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  background: var(--md-surface);
  color: var(--md-on-surface);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(13,33,55,.12);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: .8rem; color: var(--md-on-surface-variant); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-card {
  background: var(--md-surface-container);
  border-radius: var(--md-shape-md);
  box-shadow: var(--md-elevation-1);
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--md-outline-variant);
  position: relative;
  overflow: hidden;
}
.form-card::before {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--md-primary-light), var(--md-primary));
  border-radius: 0 2px 2px 0;
}

/* ── MODAL (M3 Dialog) ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(13,33,55,.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s;
  backdrop-filter: blur(6px);
}
.modal {
  background: var(--md-surface);
  border-radius: var(--md-shape-lg);
  box-shadow: var(--md-elevation-5);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  animation: slideUp .3s;
}
.modal-title { font-family: var(--md-font-display); font-size: 1.25rem; font-weight: 600; margin-bottom: 20px; color: var(--md-primary); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px 56px; color: var(--md-on-surface-variant); position: relative; }
.empty-state::before {
  content: '';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100px; height: 100px;
  background: radial-gradient(circle, var(--md-primary-container) 0%, transparent 70%);
  opacity: .4;
  border-radius: 50%;
}
.empty-state-icon { font-size: 3.2rem; margin-bottom: 16px; opacity: .3; line-height: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.empty-state-icon svg { width: 1em; height: 1em; }
.empty-state p { font-size: .95rem; position: relative; }

/* ── LOADING ── */
.loading { text-align: center; padding: 48px; color: var(--md-on-surface-variant); }
.spinner {
  display: inline-block;
  width: 36px; height: 36px;
  border: 3px solid var(--md-outline-variant);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 24px;
  border-radius: var(--md-shape-sm);
  color: #fff;
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--md-elevation-3);
  animation: slideIn .3s;
  max-width: 380px;
  backdrop-filter: blur(8px);
}
.toast-success { background: var(--success); }
.toast-error { background: var(--md-error); }
.toast-info { background: var(--md-primary-dim); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ── ISSUES LIST ── */
.issue-item { padding: 20px 0; border-bottom: 1px solid var(--md-outline-variant); }
.issue-item:last-child { border-bottom: none; }
.issue-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .8rem; color: var(--md-on-surface-variant); margin-top: 10px; }
.issue-actions { margin-top: 12px; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 18px;
  border: 1.5px solid var(--md-outline);
  border-radius: var(--md-shape-full);
  font-size: .85rem;
  cursor: pointer;
  transition: all .2s;
  background: var(--md-surface);
  color: var(--md-on-surface-variant);
  font-family: inherit;
  font-weight: 500;
}
.filter-tab:hover { border-color: var(--md-primary); color: var(--md-primary); }
.filter-tab.active { background: var(--md-primary); color: var(--md-on-primary); border-color: var(--md-primary); }

/* ── TASKS ── */
.task-card { border-left: 4px solid var(--md-primary-light); }
.task-card.urgent { border-left-color: var(--warning); background: #FFF9F2; }
.task-card.urgent .task-deadline { color: var(--warning); font-weight: 600; }
.task-card.done { border-left-color: var(--success); opacity: .8; }
.task-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--md-on-surface-variant); margin-top: 12px; }
.task-deadline { font-weight: 500; }

/* ── IMAGE GRID ── */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.img-card {
  border-radius: var(--md-shape-md);
  overflow: hidden;
  background: var(--md-surface-container);
  box-shadow: var(--md-elevation-1);
  transition: box-shadow .25s, transform .2s;
  border: 1px solid var(--md-outline-variant);
  position: relative;
}
.img-card:hover { box-shadow: var(--md-elevation-3); transform: translateY(-3px); }
.img-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; z-index: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--md-primary-light), transparent 60%);
  opacity: 0;
  transition: opacity .25s;
}
.img-card:hover::before { opacity: 1; }
.img-card img { width: 100%; height: 200px; object-fit: cover; }
.img-card-body { padding: 16px 20px; }
.img-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--md-shape-full);
  font-size: .75rem;
  font-weight: 500;
  background: var(--md-primary-container);
  color: var(--md-on-primary-container);
}
.img-card-notes { font-size: .9rem; color: var(--md-on-surface); margin-bottom: 10px; line-height: 1.6; }
.img-card-footer { font-size: .8rem; color: var(--md-on-surface-variant); display: flex; justify-content: space-between; align-items: center; }

/* ── ANNOUNCEMENT BANNER ── */
.announce-banner {
  background: linear-gradient(135deg, var(--md-primary) 0%, var(--md-primary-dim) 100%);
  color: var(--md-on-primary);
  border-radius: var(--md-shape-md);
  padding: 20px 24px;
  margin-bottom: 28px;
  animation: slideUp .35s;
  position: relative;
  overflow: hidden;
}
.announce-banner::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 30% 50%, rgba(255,255,255,.06) 0%, transparent 50%);
  pointer-events: none;
}
.announce-banner::after {
  content: '';
  position: absolute; top: -50%; right: -20%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.announce-banner-title { font-family: var(--md-font-display); font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.announce-banner-content { font-size: .9rem; opacity: .88; line-height: 1.6; }
.announce-banner-time { font-size: .78rem; opacity: .65; margin-top: 10px; }

/* ── SITE CLOSED OVERLAY ── */
.site-closed-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: var(--md-primary);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  color: var(--md-on-primary);
  text-align: center;
  padding: 24px;
}
.site-closed-overlay h1 { font-family: var(--md-font-display); font-size: 2.5rem; margin-bottom: 16px; }
.site-closed-overlay p { font-size: 1.1rem; opacity: .8; }

/* ── ADMIN ── */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-card {
  background: var(--md-surface-container);
  border-radius: var(--md-shape-md);
  box-shadow: var(--md-elevation-1);
  padding: 24px;
  border: 1px solid var(--md-outline-variant);
  transition: box-shadow .25s, transform .2s;
  position: relative;
  overflow: hidden;
}
.admin-card:hover { box-shadow: var(--md-elevation-3); transform: translateY(-2px); }
.admin-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(13,33,55,.02) 0%, transparent 50%);
  pointer-events: none;
}
.admin-card[onclick] { cursor: pointer; }
.admin-card[onclick]::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, var(--md-primary-light), transparent 80%);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity .25s;
}
.admin-card[onclick]:hover::after { opacity: 1; }
.admin-card-title { font-family: var(--md-font-display); font-size: 1rem; font-weight: 600; color: var(--md-primary); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--md-primary-container); }
.admin-user-item, .admin-reg-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--md-outline-variant); gap: 12px; }
.admin-user-item:last-child, .admin-reg-item:last-child { border-bottom: none; }
.admin-status { display: flex; align-items: center; gap: 8px; }
.admin-toggle { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.admin-toggle input { opacity: 0; width: 0; height: 0; }
.admin-toggle-slider {
  position: absolute; inset: 0;
  background: var(--md-outline);
  border-radius: 28px;
  cursor: pointer;
  transition: .3s;
}
.admin-toggle-slider::before {
  content: '';
  position: absolute; height: 22px; width: 22px; left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.admin-toggle input:checked + .admin-toggle-slider { background: var(--md-primary); }
.admin-toggle input:checked + .admin-toggle-slider::before { transform: translateX(24px); }

/* ── LOGIN ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - var(--nav-height)); padding: 24px; }
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--md-surface);
  border-radius: var(--md-shape-lg);
  box-shadow: var(--md-elevation-4);
  padding: 40px 36px;
  border: 1px solid var(--md-outline-variant);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--md-primary), var(--md-primary-light), var(--md-primary));
}
.login-card h1 { font-family: var(--md-font-display); font-size: 1.5rem; color: var(--md-primary); text-align: center; margin-bottom: 2px; }
.login-card .subtitle { text-align: center; color: var(--md-on-surface-variant); font-size: .9rem; margin-bottom: 32px; }
.login-tabs { display: flex; margin-bottom: 28px; border-radius: var(--md-shape-full); background: var(--md-surface-container); padding: 3px; }
.login-tab {
  flex: 1;
  text-align: center;
  padding: 8px 16px;
  font-size: .9rem;
  cursor: pointer;
  color: var(--md-on-surface-variant);
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--md-shape-full);
  transition: all .25s;
}
.login-tab.active { background: var(--md-primary); color: var(--md-on-primary); box-shadow: var(--md-elevation-1); }

/* ── MISC ── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ── FILE UPLOAD (M3 Outlined) ── */
.upload-zone {
  border: 2px dashed var(--md-outline);
  border-radius: var(--md-shape-sm);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  background: var(--md-surface-container);
  position: relative;
  overflow: hidden;
}
.upload-zone::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(13,33,55,.03) 0%, transparent 60%);
  pointer-events: none;
}
.upload-zone:hover { border-color: var(--md-primary); background: var(--md-primary-container); transform: translateY(-1px); }
.upload-zone.has-file { border-color: var(--success); background: var(--success-light); }
.upload-preview { max-width: 200px; margin: 14px auto; border-radius: var(--md-shape-sm); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  body { padding-top: 56px; }
  :root { --nav-height: 56px; --max-width: 100%; }
  body::before { background-size: 20px 20px; opacity: .25; }
  .container { padding: 20px 16px; }
  .nav { padding: 0 16px; }
  .nav-link { font-size: .85rem; padding: 6px 14px; }
  .nav-brand { font-size: 1.05rem; }
  .nav-brand small { display: none; }
  .nav-links {
    display: none;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    background: var(--md-primary);
    flex-direction: column;
    padding: 12px 16px 20px;
    border-radius: 0 0 var(--md-shape-md) var(--md-shape-md);
    box-shadow: var(--md-elevation-4);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-user { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .img-card img { height: 150px; }
  .modal { padding: 24px 20px; }
  .login-card { padding: 32px 24px; }
  .login-card::before { height: 3px; }
  .page-header { margin-bottom: 24px; padding-bottom: 14px; }
  .page-header::after { width: 56px; height: 2px; }
  .page-header h1 { font-size: 1.6rem; }
  .section-title { font-size: 1.1rem; }
  .form-card { padding: 22px 20px; }
  .card { padding: 20px; }
  .empty-state { padding: 40px 16px; }
  .empty-state::before { width: 80px; height: 80px; }
  .empty-state-icon { font-size: 2.6rem; }
}

@media (max-width: 480px) {
  .nav-brand { font-size: .92rem; }
  .filter-tabs { gap: 6px; }
  .filter-tab { font-size: .8rem; padding: 5px 14px; }
  .btn { font-size: .85rem; padding: 8px 18px; }
  .img-grid { grid-template-columns: 1fr 1fr; }
  .img-card img { height: 120px; }
  .lightbox-img { max-width: 100% !important; max-height: 90vh !important; }
  .container { padding: 16px 12px; }
  .login-card { padding: 28px 20px; }
  .page-header h1 { font-size: 1.4rem; }
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s;
  cursor: zoom-out;
}
.lightbox-img {
  max-width: 95vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--md-shape-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: lightboxIn .3s;
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 2rem; cursor: pointer;
  opacity: .7; transition: opacity .2s;
  background: none; border: none;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-close svg { width: 1em; height: 1em; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 2.5rem; cursor: pointer;
  opacity: .6; transition: opacity .2s;
  padding: 12px;
  background: none; border: none;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
}
.lightbox-nav svg { width: 1em; height: 1em; }
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: .9rem;
}
.img-clickable { cursor: pointer; transition: transform .2s; }
.img-clickable:hover { transform: scale(1.03); }

@keyframes lightboxIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ── FAB (M3 FAB) ── */
.fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  width: 56px;
  height: 56px;
  border-radius: var(--md-shape-lg);
  background: var(--md-primary);
  color: var(--md-on-primary);
  border: none;
  font-size: 28px;
  box-shadow: var(--md-elevation-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
  line-height: 1;
}
.fab:hover { transform: scale(1.08); background: var(--md-primary-dim); box-shadow: var(--md-elevation-5); }
.fab:active { transform: scale(.95); }

/* ── ANNOUNCE CARD ── */
.announce-card { cursor: pointer; transition: box-shadow .25s, transform .2s; }
.announce-card:hover { box-shadow: var(--md-elevation-3); transform: translateY(-3px); }

/* ── MOBILE TAB BAR ── */
@keyframes tabBarIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.tab-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 998;
  background: var(--md-surface);
  border-top: 1px solid var(--md-outline-variant);
  height: 64px; padding: 0 4px;
  align-items: stretch;
  animation: tabBarIn .35s ease-out;
  box-shadow: 0 -2px 12px rgba(13,33,55,.08);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px 4px;
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: .65rem; font-weight: 500;
  color: var(--md-on-surface-variant);
  text-decoration: none;
  transition: color .2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.tab-item svg { width: 22px; height: 22px; transition: transform .2s; }
.tab-item:active svg { transform: scale(.85); }
.tab-item.active { color: var(--md-primary); }
.tab-item.active svg { transform: scale(1.1); }
.tab-item span { line-height: 1; font-size: .62rem; }
.tab-indicator {
  position: absolute; bottom: 0;
  height: 3px;
  background: var(--md-primary);
  border-radius: 3px 3px 0 0;
  transition: left .3s cubic-bezier(.4,0,.2,1), width .3s cubic-bezier(.4,0,.2,1);
}

@media (max-width: 768px) {
  .fab { bottom: 80px; right: 16px; width: 50px; height: 50px; font-size: 24px; }
  .tab-bar { display: flex; }
  body { padding-bottom: 64px; }
}
