/* 门户首页：小清新、高对比、响应式 */
:root {
  --portal-bg-top: #f0f9ff;
  --portal-bg-mid: #ecfeff;
  --portal-bg-bottom: #f0fdf4;
  --portal-text: #0f172a;
  --portal-text-soft: #334155;
  --portal-muted: #64748b;
  --portal-card: #ffffff;
  --portal-border: rgba(15, 23, 42, 0.08);
  --portal-accent: #0284c7;
  --portal-accent-hover: #0369a1;
  --portal-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --portal-shadow-hover: 0 12px 40px rgba(2, 132, 199, 0.15);
  --portal-radius: 16px;
  --portal-safe: max(20px, env(safe-area-inset-bottom));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.portal {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--portal-text);
  background: linear-gradient(
    165deg,
    var(--portal-bg-top) 0%,
    var(--portal-bg-mid) 45%,
    var(--portal-bg-bottom) 100%
  );
  line-height: 1.5;
}

.portal-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(56, 189, 248, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(52, 211, 153, 0.12), transparent),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(125, 211, 252, 0.15), transparent);
}

.portal-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 32px) 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.portal-header {
  text-align: center;
  margin-bottom: clamp(28px, 6vw, 48px);
}

.portal-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--portal-text);
}

.portal-tagline {
  margin: 0;
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: var(--portal-text-soft);
  font-weight: 500;
}

.portal-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 24px);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .portal-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .portal-cards {
    grid-template-columns: repeat(3, 1fr);
    align-items: stretch;
  }
}

.portal-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  padding: clamp(22px, 4vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--portal-shadow-hover);
  border-color: rgba(2, 132, 199, 0.25);
}

.portal-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.portal-card-icon--admin {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.portal-card-icon--proxy {
  background: linear-gradient(135deg, #0d9488, #0f766e);
}

.portal-card-icon--shop {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.portal-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--portal-text);
}

.portal-card p {
  margin: 0 0 20px;
  font-size: 0.875rem;
  color: var(--portal-muted);
  flex: 1;
}

.portal-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff !important;
  background: var(--portal-accent);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.portal-card a:hover {
  background: var(--portal-accent-hover);
}

.portal-card a:active {
  transform: scale(0.98);
}

.portal-card--proxy a {
  background: #0d9488;
}

.portal-card--proxy a:hover {
  background: #0f766e;
}

.portal-card--shop a {
  background: #7c3aed;
}

.portal-card--shop a:hover {
  background: #6d28d9;
}

.portal-footer {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 24px 16px var(--portal-safe);
  text-align: center;
}

.portal-footer a {
  color: var(--portal-text-soft);
  font-size: 0.8125rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(51, 65, 85, 0.35);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.portal-footer a:hover {
  color: var(--portal-accent);
  border-bottom-color: var(--portal-accent);
}
