:root {
  --ink: #182027;
  --muted: #5e6872;
  --line: #e2e5e8;
  --paper: #f7f4ef;
  --white: #ffffff;
  --red: #8f1f2b;
  --red-dark: #64141d;
  --green: #47735d;
  --gold: #c69234;
  --shadow: 0 18px 48px rgba(24, 32, 39, 0.12);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", "Noto Sans TC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--red);
}

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

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

pre {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101828;
  color: #f8fafc;
  padding: 14px;
  line-height: 1.55;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid rgba(226, 229, 232, 0.82);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.site-container {
  width: min(100% - 32px, 1500px);
  margin-inline: auto;
}

.site-header__inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  min-width: 240px;
}

.site-brand img {
  width: clamp(220px, 20vw, 320px);
  height: auto;
}

.site-brand-badge {
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(143, 31, 43, 0.18);
  border-radius: 8px;
  color: var(--red-dark);
  background: rgba(143, 31, 43, 0.05);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.site-nav__list,
.site-nav__sublist,
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav__item {
  position: relative;
}

.tabs a,
.button {
  min-height: 42px;
  border-radius: 8px;
}

.site-nav__item > a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.site-nav__item > a:hover,
.site-nav__item > a:focus-visible,
.tabs a.active {
  color: var(--red-dark);
  background: rgba(143, 31, 43, 0.08);
}

.site-nav__sublist {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.site-nav__item:hover > .site-nav__sublist,
.site-nav__item:focus-within > .site-nav__sublist {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.nav-toggle span:not(.screen-reader-text) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 99px;
  background: var(--red-dark);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(100% - 32px, 1500px);
  margin-inline: auto;
  padding: 28px 0 56px;
}

.home-hero,
.event-hero,
.person-hero,
.photo-detail,
.empty-state,
.notice,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.home-hero {
  padding: clamp(28px, 6vw, 74px);
  background:
    linear-gradient(135deg, rgba(143, 31, 43, 0.96), rgba(100, 20, 29, 0.92)),
    linear-gradient(45deg, #8f1f2b, #c69234);
  color: var(--white);
}

.home-hero h1,
.event-hero h1,
.person-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1.08;
}

.home-hero p,
.event-hero p,
.person-hero p {
  max-width: 760px;
  color: inherit;
  line-height: 1.75;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero .eyebrow,
.event-hero .eyebrow {
  color: #ffd78a;
}

.event-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.event-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.event-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.event-card-body {
  padding: 18px;
}

.event-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.25;
}

.event-card p {
  color: var(--muted);
  line-height: 1.7;
}

.event-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-stats,
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.mini-stats div,
.stats-row div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.mini-stats dt,
.stats-row dt,
.mini-stats span,
.stats-row span {
  color: var(--muted);
  font-size: 12px;
}

.mini-stats dd,
.stats-row dd,
.stats-row strong {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--red);
  background: var(--red);
  color: var(--white);
  padding: 10px 15px;
  font-weight: 750;
  cursor: pointer;
}

.button.secondary {
  border-color: rgba(143, 31, 43, 0.22);
  background: var(--white);
  color: var(--red-dark);
}

.button:hover {
  background: var(--red-dark);
  color: var(--white);
}

.event-hero {
  display: grid;
  grid-template-columns: minmax(220px, 420px) 1fr;
  gap: 24px;
  align-items: center;
  padding: 18px;
}

.event-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.event-hero h2 {
  margin: 12px 0 0;
  color: var(--red);
  font-size: clamp(22px, 3vw, 34px);
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  white-space: nowrap;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.filters label {
  display: grid;
  gap: 6px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filters select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 8px 10px;
  color: var(--ink);
  font: inherit;
}

.photo-grid {
  column-count: 4;
  column-gap: 14px;
}

.photo-card {
  break-inside: avoid;
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.photo-card-image {
  display: block;
}

.photo-card-image img {
  display: block;
  width: 100%;
  min-height: 140px;
  object-fit: cover;
  background: #e9eef3;
}

.photo-card-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.photo-card-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.photo-card-meta:hover {
  color: var(--red);
}

.photo-people {
  min-width: 0;
}

.photo-people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.photo-person-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 8px 4px 4px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.photo-person-chip:hover {
  border-color: rgba(143, 31, 43, 0.34);
  color: var(--red);
}

.photo-person-chip img {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  min-height: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #e9eef3;
}

.photo-people--card .photo-people-list {
  gap: 5px;
}

.photo-people--card .photo-person-chip {
  max-width: 100%;
}

.photo-people--card .photo-person-chip span {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-people-more {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px dashed rgba(143, 31, 43, 0.34);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.image-placeholder {
  display: grid;
  min-height: 180px;
  place-items: center;
  background: #e9eef3;
  color: var(--muted);
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.person-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: center;
}

.person-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.person-card span {
  display: block;
  padding: 10px 8px 2px;
  font-weight: 800;
}

.person-card small {
  display: block;
  padding: 0 8px 10px;
  color: var(--muted);
}

.person-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  align-items: center;
  padding: 18px;
  margin-bottom: 20px;
}

.name-request-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.name-request-panel h2 {
  margin: 0 0 8px;
}

.name-request-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.name-request-panel form {
  display: grid;
  gap: 12px;
}

.name-request-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.name-request-panel input,
.name-request-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.form-status {
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 750;
}

.form-status.success {
  background: rgba(71, 115, 93, 0.12);
  color: #315842;
}

.form-status.warning {
  background: rgba(143, 31, 43, 0.1);
  color: var(--red-dark);
}

.person-hero img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.hero-actions,
.load-more {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.load-more {
  justify-content: center;
}

.photo-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 18px;
}

.photo-stage {
  display: grid;
  place-items: center;
  min-height: 50vh;
  border-radius: 8px;
  background: #111827;
}

.photo-stage img {
  max-height: 78vh;
  width: auto;
  object-fit: contain;
}

.photo-info {
  display: grid;
  align-content: start;
  gap: 12px;
}

.photo-info h1 {
  margin: 0;
  font-size: 28px;
}

.photo-info dl {
  display: grid;
  gap: 10px;
}

.photo-info dt {
  color: var(--muted);
  font-size: 12px;
}

.photo-info dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.photo-people--detail {
  margin: 2px 0;
  border: 1px solid rgba(143, 31, 43, 0.14);
  border-radius: 8px;
  background: #fff7f5;
  padding: 12px;
}

.photo-people--detail h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.photo-people--detail .photo-person-chip {
  min-height: 44px;
  padding: 4px 12px 4px 4px;
  font-size: 13px;
}

.photo-people--detail .photo-person-chip img {
  width: 36px;
  height: 36px;
}

.empty-state,
.notice,
.admin-panel {
  margin-top: 18px;
  padding: 20px;
}

.empty-state h1,
.empty-state h2,
.notice h1,
.notice h2,
.admin-panel h2 {
  margin-top: 0;
}

.site-footer {
  background: #11171d;
  color: rgba(255, 255, 255, 0.82);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 1fr;
  gap: 36px;
  padding: 56px 0;
}

.site-footer h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 18px;
}

.site-footer__brand img {
  display: block;
  width: min(280px, 100%);
  height: auto;
  margin-bottom: 18px;
  object-fit: contain;
}

.site-footer__brand p,
.site-footer address {
  margin: 0;
  line-height: 1.8;
}

.footer-links li + li {
  margin-top: 8px;
}

.site-footer address {
  font-style: normal;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__bottom .site-container {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.admin-body {
  background: #eef3f7;
}

.admin-shell {
  width: min(100% - 32px, 1300px);
  margin: 0 auto;
  padding: 28px 0 56px;
}

.admin-header,
.admin-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.admin-header h1,
.admin-panel h2 {
  margin: 0;
}

.notice.info {
  border-left: 5px solid var(--red);
}

.notice.warning {
  border-left: 5px solid var(--gold);
}

.steps {
  display: grid;
  gap: 10px;
  padding-left: 24px;
  line-height: 1.7;
}

.admin-subpanel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-subpanel h3 {
  margin: 0 0 12px;
}

.admin-request-list {
  display: grid;
  gap: 12px;
}

.admin-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-request small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.admin-request p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.admin-request form {
  display: flex;
  gap: 8px;
  align-items: start;
}

.admin-request input[type="text"] {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

@media (max-width: 1100px) {
  .nav-toggle {
    display: block;
  }

  .site-brand-badge {
    display: none;
  }

  .site-nav {
    position: fixed;
    inset: 82px 0 auto 0;
    max-height: calc(100vh - 82px);
    overflow: auto;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(24, 32, 39, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  body.nav-open .site-nav {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto;
  }

  .site-nav__list {
    display: block;
  }

  .site-nav__item > a {
    justify-content: space-between;
    min-height: 46px;
    padding: 10px 12px;
  }

  .site-nav__sublist {
    position: static;
    min-width: 0;
    padding: 0 0 8px 12px;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .photo-grid {
    column-count: 3;
  }

  .photo-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    min-height: 72px;
  }

  .site-brand {
    min-width: 0;
    max-width: calc(100vw - 96px);
  }

  .site-brand img {
    width: min(230px, calc(100vw - 96px));
  }

  .site-nav {
    inset: 72px 0 auto 0;
    max-height: calc(100vh - 72px);
  }

  .site-shell,
  .admin-shell {
    width: min(100% - 24px, 1500px);
  }

  .event-hero,
  .person-hero,
  .name-request-panel,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    column-count: 2;
  }

  .home-hero h1,
  .event-hero h1,
  .person-hero h1 {
    font-size: 34px;
  }

  .admin-header,
  .admin-panel-head,
  .admin-request,
  .site-footer__bottom .site-container {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-request {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-card {
    margin-bottom: 0;
  }

  .photo-card-image img {
    min-height: 118px;
  }

  .photo-card-body {
    gap: 6px;
    padding: 7px;
  }

  .photo-card-meta {
    font-size: 11px;
  }

  .photo-people--card .photo-people-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .photo-people--card .photo-person-chip {
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    border: 0;
    background: transparent;
    padding: 0;
  }

  .photo-people--card .photo-person-chip img {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  }

  .photo-people--card .photo-person-chip span {
    display: none;
  }

  .photo-people-more {
    display: inline-flex;
    width: 30px;
    height: 30px;
    min-height: 0;
    align-items: center;
    justify-content: center;
    justify-self: center;
    border-style: solid;
    border-radius: 50%;
    background: #fff7f3;
    padding: 0;
    font-size: 10px;
  }

  .person-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 8px;
  }

  .person-card {
    overflow: visible;
    border: 0;
    background: transparent;
    padding: 2px 0 4px;
  }

  .person-card img {
    display: block;
    width: 56px;
    max-width: 100%;
    height: 56px;
    margin: 0 auto;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.1);
  }

  .person-card span {
    overflow: hidden;
    padding: 6px 1px 0;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .person-card small {
    padding: 1px 1px 0;
    font-size: 10px;
    line-height: 1.25;
  }

  .filters label,
  .filters .button {
    width: 100%;
  }
}
