:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d7dde5;
  --green: #16a34a;
  --green-dark: #15803d;
  --green-soft: #ecfdf3;
  --soft: #f8fafc;
  --radius: 8px;
  --width: 1120px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page {
  width: min(var(--width), calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 42px;
}

.hero {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark,
.system-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #bbf7d0;
  background: var(--green-soft);
  color: var(--green-dark);
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 11px;
}

.brand h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 900;
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
}

.status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

.portal-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  color: #344054;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 900;
}

.ai-head {
  margin-top: 22px;
}

.system-list,
.system-grid {
  display: grid;
  gap: 10px;
}

.system-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-row {
  min-height: 78px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .16s ease, background .16s ease;
}

.system-row:hover {
  border-color: #bbf7d0;
  background: #fbfefc;
}

.system-row.compact {
  min-height: 74px;
}

.system-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.system-icon.muted {
  border-color: var(--line);
  background: var(--soft);
  color: #64748b;
}

.system-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.system-copy strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-copy small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-action,
.split-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.system-action {
  min-width: 58px;
  padding: 0 13px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.split-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.split-actions a {
  min-width: 52px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #374151;
}

.more-systems {
  margin: 8px 0 0;
}

.more-systems summary {
  width: fit-content;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px auto 0;
  padding: 0 10px;
  border-radius: 999px;
  color: #7c8797;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.more-systems summary::-webkit-details-marker {
  display: none;
}

.more-systems summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.more-systems summary:hover {
  background: var(--soft);
  color: var(--green-dark);
}

.more-close {
  display: none;
}

.more-systems[open] .more-open {
  display: none;
}

.more-systems[open] .more-close {
  display: inline;
}

.more-systems[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.hidden-list {
  margin-top: 8px;
}

.hidden-row {
  min-height: 72px;
  background: #fbfcfd;
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 22px, 430px);
    padding: 22px 0 30px;
  }

  .hero {
    display: grid;
    justify-content: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }

  .brand h1 {
    font-size: 23px;
  }

  .brand p {
    font-size: 13px;
  }

  .status {
    width: fit-content;
  }

  .portal-panel {
    padding: 12px;
  }

  .system-grid {
    grid-template-columns: 1fr;
  }

  .system-row,
  .system-row.compact {
    min-height: 68px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 10px;
  }

  .system-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .system-icon svg {
    width: 19px;
    height: 19px;
  }

  .system-copy strong {
    font-size: 15px;
  }

  .system-copy small {
    font-size: 12px;
  }

  .system-action {
    grid-column: 2;
    justify-self: start;
    min-width: 50px;
    min-height: 32px;
    margin-top: 2px;
    padding: 0 10px;
  }

  .hidden-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .hidden-row .split-actions {
    grid-column: 2;
    justify-self: start;
  }

  .split-actions a {
    min-height: 31px;
    min-width: 50px;
    padding: 0 10px;
  }
}

@media (max-width: 640px) {
  .system-copy small {
    white-space: normal;
  }
}

a.system-row {
  -webkit-user-drag: none;
}

.system-row .system-copy {
  -webkit-user-select: text;
  user-select: text;
}
