* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0d12;
  --card: #141a22;
  --border: #232b36;
  --text: #e6edf3;
  --muted: #8b98a8;
  --accent: #4f8cff;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ---------- 首页：一屏固定 ---------- */
body.portal {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% -10%, #1b2f4d 0%, #0d131b 55%, #0a0d12 100%);
}

/* 顶部标题区（位置不变） */
.hero {
  flex: 0 0 auto;
  color: #fff;
  padding: clamp(26px, 5.5vh, 60px) 24px clamp(18px, 3.6vh, 40px);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.hero h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: clamp(1px, .4vw, 4px);
  font-weight: 700;
  color: #fff;
}

.verse {
  margin-top: clamp(8px, 1.4vh, 16px);
  color: var(--muted);
  letter-spacing: clamp(1px, .3vw, 3px);
  font-size: clamp(.74rem, 1.2vw, .92rem);
  font-weight: 300;
}

/* 横线下方：四张正方形卡片，2×2 居中 */
.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-template-rows: repeat(2, auto);
  place-content: center;
  gap: clamp(12px, 2vmin, 24px);
  padding: 16px;
  width: 100%;
}

.card {
  --tint: #4f8cff;
  --tint-soft: rgba(79, 140, 255, .13);
  --tint-border: rgba(79, 140, 255, .32);
  position: relative;
  width: clamp(170px, 28vmin, 330px);
  aspect-ratio: 1 / 1;
  padding: clamp(14px, 2.4vmin, 24px);
  background:
    radial-gradient(circle at 100% 0%, var(--tint-soft), transparent 62%),
    var(--card);
  border: 1px solid var(--tint-border);
  border-radius: clamp(10px, 1.4vmin, 16px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .32);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
}

/* 微软四色：左上红、右上绿、左下蓝、右下黄 */
.card:nth-child(1) {
  --tint: #f25022;
  --tint-soft: rgba(242, 80, 34, .14);
  --tint-border: rgba(242, 80, 34, .36);
}

.card:nth-child(2) {
  --tint: #7fba00;
  --tint-soft: rgba(127, 186, 0, .14);
  --tint-border: rgba(127, 186, 0, .36);
}

.card:nth-child(3) {
  --tint: #00a4ef;
  --tint-soft: rgba(0, 164, 239, .14);
  --tint-border: rgba(0, 164, 239, .36);
}

.card:nth-child(4) {
  --tint: #ffb900;
  --tint-soft: rgba(255, 185, 0, .14);
  --tint-border: rgba(255, 185, 0, .36);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .5), 0 0 34px var(--tint-soft);
  border-color: var(--tint);
}

.icon {
  font-size: clamp(1.4rem, 3.2vmin, 2.2rem);
  line-height: 1;
}

.card h2 {
  margin-top: clamp(6px, 1.2vmin, 12px);
  font-size: clamp(.85rem, 1.6vmin, 1.1rem);
  color: var(--text);
  line-height: 1.3;
}

.card p {
  margin-top: clamp(4px, .9vmin, 9px);
  color: var(--muted);
  font-size: clamp(.64rem, 1.05vmin, .82rem);
  line-height: 1.55;
}

/* 进入按钮：右下角 */
.go {
  position: absolute;
  right: clamp(12px, 2vmin, 20px);
  bottom: clamp(12px, 2vmin, 20px);
  color: var(--tint);
  font-weight: 600;
  font-size: clamp(.64rem, 1.05vmin, .8rem);
  white-space: nowrap;
}

footer {
  flex: 0 0 auto;
  text-align: center;
  padding: clamp(4px, 1.2vh, 12px) 16px;
  color: #5c6878;
  font-size: clamp(.62rem, .85vw, .74rem);
  line-height: 1.6;
}

footer a {
  color: #5c6878;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ---------- 子页通用 ---------- */
.page-head {
  background: linear-gradient(135deg, #0d141d, #141d2b);
  color: #fff;
  padding: 26px 24px 30px;
  border-bottom: 1px solid var(--border);
}

.page-head a.back {
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: .88rem;
}

.page-head a.back:hover {
  color: #fff;
}

.page-head h1 {
  margin-top: 10px;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #fff;
}

/* ---------- 移动端：四叶草 2×2 ---------- */
@media (max-width: 720px) {
  body.portal {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .grid {
    flex: 0 0 auto;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 10px 20px;
    align-content: start;
  }

  .card {
    width: auto;
    aspect-ratio: 1 / 1;
    padding: 12px;
  }

  .icon {
    font-size: 1.3rem;
  }

  .card h2 {
    font-size: .8rem;
    margin-top: 5px;
  }

  .card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .56rem;
    margin-top: 4px;
    line-height: 1.35;
  }

  .go {
    right: 10px;
    bottom: 10px;
    font-size: .58rem;
  }
}
