:root {
  --paper: #FDFBF4;
  --ink: #18181B;
  --ink-muted: #52525B;
  --yellow: #FDE047;
  --sky: #7DD3FC;
  --mint: #86EFAC;
  --coral: #FDA4AF;
  --white: #FFFFFF;
  --shadow: 4px 4px 0px #18181B;
  --shadow-sm: 2.5px 2.5px 0px #18181B;
  --shadow-lg: 6px 6px 0px #18181B;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(24, 24, 27, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 24, 27, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.serif {
  font-family: Georgia, "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.box {
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  background: var(--white);
}

.box-sm {
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow-sm);
}

.hover-lift {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.hover-lift:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 251, 244, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.domain-badge {
  background: var(--yellow);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  padding: 5px 12px;
  border: 2px solid var(--ink);
  background: var(--white);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.pill-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.pill-link.primary {
  background: var(--ink);
  color: var(--yellow);
}

.pill-link.sky {
  background: var(--sky);
}

/* Main */
main {
  flex: 1;
  padding: 36px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Hero Split */
.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.hero-intro {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.role-chip {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  background: var(--sky);
  border: 2px solid var(--ink);
}

.hero-title {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.25;
  text-wrap: balance;
}

.hero-desc {
  margin: 0;
  font-size: 15px;
  color: #27272A;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
}

/* Featured Portal Card */
.featured-card {
  background: var(--yellow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: var(--ink);
}

.featured-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

.featured-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.featured-sub {
  margin: 0;
  font-size: 14px;
  color: #27272A;
}

.featured-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.featured-badge {
  font-size: 12px;
  font-weight: 700;
  background: var(--white);
  border: 1.5px solid var(--ink);
  padding: 3px 8px;
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--yellow);
  font-size: 14px;
  font-weight: 900;
  border: 2px solid var(--ink);
}

/* Directory Section */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
}

.section-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.section-title {
  margin: 4px 0 0;
  font-size: clamp(22px, 2.8vw, 28px);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portal-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
}

.portal-card.disabled {
  cursor: default;
  opacity: 0.9;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-tag {
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.card-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.card-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #27272A;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1.5px solid rgba(24, 24, 27, 0.22);
  font-size: 12.5px;
  font-weight: 800;
}

/* Footer */
.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--white);
  padding: 22px 0;
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-inner a {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 820px) {
  .hero-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }
}
