*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text: #1a2b4a;
  --text-secondary: #6b7c93;
  --card-bg: #ffffff;
  --shadow: 0 4px 20px rgba(26, 80, 180, 0.08);
  --radius: 16px;
  --blue: #409eff;
  --blue-bg: #ecf5ff;
  --green: #67c23a;
  --green-bg: #f0f9eb;
  --purple: #9b59f5;
  --purple-bg: #f3ecff;
  --orange: #e6a23c;
  --orange-bg: #fdf6ec;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #e8f4ff 0%, #f5f8fc 40%, #eef2f8 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.portal {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

.portal-header {
  text-align: center;
  margin-bottom: 32px;
}

.portal-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.portal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.service-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 16px 20px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(26, 80, 180, 0.12);
}

.service-card:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.theme-blue .card-badge { background: var(--blue); }
.theme-green .card-badge { background: var(--green); }
.theme-purple .card-badge { background: var(--purple); }
.theme-orange .card-badge { background: var(--orange); }

.card-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-left: 28px;
}

.theme-blue .card-icon { color: var(--blue); background: var(--blue-bg); }
.theme-green .card-icon { color: var(--green); background: var(--green-bg); }
.theme-purple .card-icon { color: var(--purple); background: var(--purple-bg); }
.theme-orange .card-icon { color: var(--orange); background: var(--orange-bg); }

.card-body {
  flex: 1;
  min-width: 0;
  padding-right: 36px;
}

.card-body h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.card-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tag svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.7;
}

.card-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.theme-blue .card-arrow { background: var(--blue); }
.theme-green .card-arrow { background: var(--green); }
.theme-purple .card-arrow { background: var(--purple); }
.theme-orange .card-arrow { background: var(--orange); }

.portal-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.footer-icon {
  font-size: 16px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
}

.modal-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal-btn {
  width: 100%;
  padding: 10px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .portal {
    padding: 24px 16px 32px;
  }

  .portal-header h1 {
    font-size: 22px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card-icon {
    margin-left: 24px;
    width: 48px;
    height: 48px;
  }

  .card-body h2 {
    font-size: 15px;
  }
}
