:root {
  --bg: #0b1221;
  --bg-elevated: #111b31;
  --surface: #ffffff;
  --text: #1f2430;
  --text-muted: #4d5562;
  --accent: #346dff;
  --accent-strong: #2554cf;
  --border: #d9e1ee;
  --shadow: 0 10px 24px rgba(7, 19, 45, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans TC", "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #f4f7fb;
}

.hero {
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-elevated) 100%);
  color: #fff;
  padding: 3rem 1rem 2rem;
}

.hero-content {
  max-width: 1080px;
  margin: 0 auto 1.5rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  line-height: 1.25;
  font-size: clamp(1.75rem, 4vw, 2.7rem);
}

.hero p {
  margin: 0;
  color: #d6dcef;
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-banner-wrap {
  max-width: 1080px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
}

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
}

.about,
.portal,
.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.about h2,
.section-head h2,
.site-footer h2 {
  margin: 0 0 0.6rem;
}

.about h3 {
  margin: 0.4rem 0;
  font-size: 1.1rem;
}

.about p {
  margin: 0;
  color: var(--text-muted);
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.portal-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.portal-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #eaf0fb;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem;
}

.card-type {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card-body h3 {
  margin: 0 0 0.45rem;
  font-size: 1.18rem;
}

.card-body p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-action {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.62rem 0.85rem;
  font-weight: 700;
}

.card-action:hover {
  background: var(--accent-strong);
}

.card-action:focus-visible {
  outline: 2px solid #13338e;
  outline-offset: 2px;
}

.card-action:active {
  transform: translateY(1px);
}

.portal-error {
  margin-top: 0.8rem;
  color: #b81f3f;
  font-weight: 600;
}

.site-footer {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer-block + .footer-block {
  margin-top: 1.25rem;
}

.site-footer h2 {
  color: var(--text);
  font-size: 1rem;
}

.site-footer p {
  margin: 0.3rem 0;
}

.site-footer a {
  color: var(--accent-strong);
}

@media (max-width: 768px) {
  .hero {
    padding-top: 2.1rem;
  }

  .about,
  .portal,
  .site-footer {
    padding: 1.35rem 0.9rem;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }
}
