/* 门户主页样式：清新浅色，与 mc/ 子页风格统一 */
:root {
  --bg-1: #e9f7f0;
  --bg-2: #eaf2ff;
  --accent: #0aa6b8;
  --accent-2: #2e90e0;
  --card: rgba(255, 255, 255, 0.78);
  --text: #15313a;
  --muted: #5b7785;
  --border: rgba(255, 255, 255, 0.7);
  --shadow: 0 10px 30px rgba(10, 166, 184, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow-x: hidden;
}

/* 漂浮方块 */
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.cube {
  position: absolute; width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.16; border-radius: 9px;
  animation: float 9s ease-in-out infinite;
}
.cube.c1 { left: 8%;  top: 16%; animation-delay: 0s; }
.cube.c2 { left: 22%; top: 70%; animation-delay: 1.1s; }
.cube.c3 { left: 40%; top: 30%; animation-delay: 2.2s; }
.cube.c4 { left: 58%; top: 78%; animation-delay: 0.6s; }
.cube.c5 { left: 72%; top: 22%; animation-delay: 1.7s; }
.cube.c6 { left: 85%; top: 60%; animation-delay: 2.6s; }
.cube.c7 { left: 14%; top: 44%; animation-delay: 3.1s; }
.cube.c8 { left: 64%; top: 46%; animation-delay: 0.9s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(12deg); }
}

.bg-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.45), transparent 60%);
}

/* 容器 */
.portal {
  position: relative; z-index: 2;
  width: 100%; max-width: 760px;
  text-align: center;
}
.portal-hero { margin-bottom: 28px; }
.portal-mark {
  font-size: 52px; line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(10, 166, 184, 0.25));
}
.portal-hero h1 {
  font-size: 30px; margin: 14px 0 8px;
  letter-spacing: 0.5px;
}
.portal-tagline { color: var(--muted); margin: 0; font-size: 15px; }

/* 操作条：重新检测按钮 + 上次检测时间 */
.portal-actions {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
}
.refresh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}
.refresh-btn:hover { transform: translateY(-2px); background: #fff; }
.refresh-btn:active { transform: translateY(0); }
.refresh-btn:disabled { cursor: default; opacity: 0.7; transform: none; }
.rf-ico { display: inline-block; }
.refresh-btn.is-spinning .rf-ico { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.last-check { color: var(--muted); font-size: 12px; }

/* 服务器卡片网格 */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.server-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.server-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(10, 166, 184, 0.22);
}
.sc-icon { font-size: 34px; line-height: 1; }
.sc-icon svg { display: block; width: 40px; height: 40px; }
.sc-body { flex: 1; min-width: 0; text-align: left; }
.sc-name {
  font-weight: 700; font-size: 17px;
  display: flex; align-items: center; gap: 8px;
}
.sc-tag {
  font-size: 11px; font-weight: 600;
  background: var(--accent); color: #fff;
  padding: 2px 9px; border-radius: 999px;
}
.sc-desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sc-desc--motd {
  font-style: italic;
  padding-left: 8px;
  border-left: 2px solid var(--accent);
  color: var(--text);
}
.sc-go { color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* 实时状态标签（检测驱动：检测中 / 开放中 / 离线） */
.sc-status {
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent;
}
.sc-status--loading {
  color: var(--accent-2);
  background: rgba(46, 144, 224, 0.12);
  border-color: rgba(46, 144, 224, 0.3);
}
.sc-status--online {
  color: #0a8a4a;
  background: rgba(10, 166, 100, 0.14);
  border-color: rgba(10, 166, 100, 0.35);
}
.sc-status--offline {
  color: #8a6d0a;
  background: rgba(138, 109, 10, 0.12);
  border-color: rgba(138, 109, 10, 0.3);
}
/* 离线卡片整体弱化 */
.server-card.is-offline { opacity: 0.62; }
.server-card.is-offline .sc-go { color: var(--muted); }

.portal-foot {
  margin-top: 30px; color: var(--muted); font-size: 12px;
}
/* 社群入口：底部统一位置，与 mc/ 子页一致 */
.portal-community {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 12px;
}
.portal-community a {
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.15s ease;
}
.portal-community a:hover { transform: translateY(-2px); background: #fff; }

@media (max-width: 480px) {
  .portal-hero h1 { font-size: 24px; }
  .portal-grid { grid-template-columns: 1fr; }
}
