/* EATing 门户 — 品牌绿 #2ECC71，简约高级 */
:root {
  --brand: #2ecc71;
  --brand-dark: #27ae60;
  --text: #1a1a1a;
  --text-muted: #5c6370;
  --bg: #fafbfc;
  --bg-alt: #f0f4f2;
  --white: #ffffff;
  --header-h: 64px;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 720px;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(46, 204, 113, 0.12);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  line-height: 0;
}

.logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: min(220px, 52vw);
  object-fit: contain;
}

.site-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--brand-dark);
}

.site-nav a.nav-admin {
  color: var(--brand);
}

.site-nav a.nav-admin:hover {
  color: var(--brand-dark);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s;
}

.nav-toggle::before {
  top: 14px;
}

.nav-toggle::after {
  bottom: 14px;
}

@media (max-width: 768px) {
  .logo-img {
    height: 36px;
    max-width: min(200px, 48vw);
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

/* Hero + Carousel */
.hero {
  padding-top: var(--header-h);
}

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 420px;
  max-height: 85vh;
  overflow: hidden;
  background: #e8ece9;
}

@media (max-width: 768px) {
  .carousel {
    aspect-ratio: 4 / 5;
    min-height: 360px;
    max-height: none;
  }
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(15, 23, 42, 0.55) 0%,
    rgba(15, 23, 42, 0.2) 45%,
    rgba(46, 204, 113, 0.15) 100%
  );
  pointer-events: none;
}

.slide-caption {
  position: absolute;
  left: 6%;
  bottom: 12%;
  right: 6%;
  z-index: 2;
  color: var(--white);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.slide-caption h1,
.slide-caption h2 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.slide-caption p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.95;
}

.slide-caption .slogan {
  font-weight: 600;
  margin-top: 12px;
}

.slide-caption .slogan-secondary {
  font-size: 0.95rem;
  opacity: 0.88;
  margin-top: 4px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, transform 0.2s;
}

.carousel-btn:hover {
  background: var(--white);
  transform: translateY(-50%) scale(1.05);
}

.carousel-prev {
  left: 16px;
}

.carousel-prev::after {
  content: "‹";
  font-size: 1.75rem;
  line-height: 1;
  color: var(--brand-dark);
}

.carousel-next {
  right: 16px;
}

.carousel-next::after {
  content: "›";
  font-size: 1.75rem;
  line-height: 1;
  color: var(--brand-dark);
}

@media (max-width: 768px) {
  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 10px;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dots button.is-active {
  background: var(--white);
  transform: scale(1.15);
}

/* Sections */
.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.section-lead {
  margin: 0 0 32px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(46, 204, 113, 0.12);
}

.card h3 {
  margin: 0 0 10px;
  color: var(--brand-dark);
  font-size: 1.15rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.container.contact-wide {
  max-width: 960px;
}

#menu .section-title,
#menu .section-lead,
#about .section-title,
#contact .section-title {
  text-align: left;
}

#about .portal-about-body {
  margin: 0;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  text-align: left;
}

.contact-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px 32px;
}

.contact-text {
  flex: 1 1 280px;
  min-width: 0;
}

/* 标题与地址同列，上缘与右侧二维码对齐；缩小标题与正文间距 */
#contact .contact-text .section-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.contact-text .portal-contact-body {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.45;
  white-space: pre-line;
}

.contact-text .portal-contact-body .contact-line {
  display: block;
}

.contact-text .portal-contact-body .contact-line + .contact-line {
  margin-top: 0.35rem;
}

.contact-qrcodes {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-end;
}

.qr-block {
  margin: 0;
  text-align: center;
}

.qr-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(46, 204, 113, 0.15);
}

.qr-img {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
  vertical-align: middle;
}

.qr-caption {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-dark);
}

@media (max-width: 768px) {
  .contact-layout {
    flex-direction: column;
  }

  .contact-qrcodes {
    justify-content: center;
    width: 100%;
  }
}

.contact-hint {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 24px 0;
  background: #1e2930;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.footer-inner span {
  display: block;
}

.footer-sep {
  opacity: 0.5;
}
