:root {
  color-scheme: light;
  --ink: #20342d;
  --muted: #6e7b75;
  --paper: #fffdf7;
  --cream: #f7f2e8;
  --line: #dfded4;
  --leaf: #22745a;
  --leaf-dark: #15513f;
  --mint: #e3f1e9;
  --shadow: 0 18px 50px rgba(44, 55, 49, 0.09);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(224, 166, 58, 0.14), transparent 28rem),
    radial-gradient(circle at 100% 30%, rgba(34, 116, 90, 0.12), transparent 32rem),
    var(--cream);
}

a { color: var(--leaf-dark); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--mint);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

.portal {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
  display: grid;
  gap: 36px;
}

.portal-hero {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px 28px 8px;
}

.portal-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(44, 55, 49, 0.14));
}

.eyebrow {
  margin: 0;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.15;
  max-width: 18ch;
}
h2 { font-size: 22px; margin-bottom: 12px; }
h3 { font-size: 16px; margin: 20px 0 10px; }
.lede, .section-meta, .hint { color: var(--muted); line-height: 1.55; }
.lede { font-size: 17px; max-width: 42rem; }
.section-meta, .hint { font-size: 14px; }

.portal-section {
  padding: 24px 28px;
  border: 1px solid rgba(223, 222, 212, 0.9);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.family-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 168px;
  padding: 22px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, var(--paper));
  color: inherit;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.family-card:hover,
.family-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(34, 116, 90, 0.45);
  box-shadow: 0 14px 28px rgba(34, 116, 90, 0.12);
  outline: none;
}

.family-card-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(44, 55, 49, 0.12));
}

.family-card strong { font-size: 17px; }
.family-card > span { color: var(--muted); font-size: 13px; }
.empty-families { margin: 12px 0 0; color: var(--muted); }

.advantage-carousel {
  margin-top: 8px;
  outline: none;
}

.advantage-viewport {
  overflow: hidden;
  border-radius: 18px;
  background: var(--mint);
}

.advantage-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.advantage-slide {
  flex: 0 0 100%;
  min-height: 140px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px 22px;
  box-sizing: border-box;
}

.advantage-slide strong { font-size: 18px; }
.advantage-slide span { color: var(--muted); font-size: 15px; line-height: 1.55; }

.advantage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.advantage-nav {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.advantage-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  flex: 1;
}

.advantage-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c5d4cd;
  cursor: pointer;
}

.advantage-dot[aria-current="true"] {
  background: var(--leaf);
  transform: scale(1.15);
}

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

.download-card-wrap {
  display: grid;
  gap: 10px;
  align-content: start;
}

.download-backup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--mint);
  color: var(--leaf-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.download-card {
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, var(--paper));
  color: inherit;
  text-decoration: none;
  text-align: center;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.download-card:hover,
.download-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(34, 116, 90, 0.45);
  box-shadow: 0 14px 28px rgba(34, 116, 90, 0.12);
  outline: none;
}

.download-icon {
  width: 96px;
  height: 96px;
  color: var(--leaf);
  display: grid;
  place-items: center;
}

.download-icon svg { width: 96px; height: 96px; }
.download-card strong { font-size: 20px; }
.download-card > span:last-child { color: var(--muted); font-size: 14px; }

.portal-footer {
  padding: 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.portal-footer p { margin: 0 0 8px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.button.primary {
  background: var(--leaf);
  border-color: var(--leaf);
  color: #fff;
}

.button.ghost {
  background: transparent;
}

.portal-modal[hidden] { display: none; }

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.portal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 52, 45, 0.45);
}

.portal-modal-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 28px 24px 24px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.portal-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.portal-steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink);
  line-height: 1.55;
  display: grid;
  gap: 8px;
}

.portal-ports {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.portal-ports th,
.portal-ports td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.portal-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 12px;
}

body.portal-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .portal { padding-top: 24px; }
  .portal-hero,
  .portal-section { padding-left: 18px; padding-right: 18px; }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .family-card { min-height: 160px; padding: 18px 10px; }
  .family-card-logo { width: 76px; height: 76px; }
  .download-grid { grid-template-columns: 1fr; }
  .download-card { min-height: 200px; }
  .advantage-slide { min-height: 160px; padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .advantage-track,
  .family-card,
  .download-card {
    transition: none;
  }
}
