:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #e8e5dd;
  color: #1f2823;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

.portal-home {
  width: min(1480px, calc(100% - 64px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 24px;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(31, 40, 35, 0.18);
}

.portal-brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; font-size: 15px; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; }
.portal-brand img { display: block; width: 29px; height: 29px; border-radius: 7px; object-fit: cover; }
.portal-account { position: relative; display: flex; align-items: center; min-height: 30px; }
.portal-account__trigger { border: 1px solid rgba(31, 40, 35, 0.6); border-radius: 999px; background: transparent; color: #1f2823; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; line-height: 1; padding: 9px 14px; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.portal-account__trigger:hover, .portal-account__trigger[aria-expanded="true"] { border-color: #1f2823; background: #1f2823; color: #f2f0e9; }
.portal-account__menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 10; display: grid; min-width: 174px; overflow: hidden; border: 1px solid rgba(31, 40, 35, 0.24); border-radius: 12px; background: #f2f0e9; box-shadow: 0 18px 36px rgba(31, 40, 35, 0.15); }
.portal-account__signed-out, .portal-account__signed-in { display: grid; padding: 6px; }
.portal-account__menu[hidden], .portal-account__signed-out[hidden], .portal-account__signed-in[hidden] { display: none !important; }
.portal-account__signed-in { gap: 3px; }
.portal-account__menu-item { width: 100%; border: 0; border-radius: 7px; background: transparent; color: #1f2823; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; line-height: 1; padding: 10px 9px; text-align: left; transition: background 160ms ease, color 160ms ease; }
.portal-account__menu-item:hover { background: #1f2823; color: #f2f0e9; }
.portal-account__menu-item--quiet { color: #81514c; }
.portal-account__menu-item--quiet:hover { background: #583632; }
.portal-card__eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; }

.account-dialog { width: min(410px, calc(100vw - 32px)); margin: auto; border: 0; padding: 0; background: transparent; color: #f6f4ed; }
.account-dialog::backdrop { background: rgba(19, 25, 22, 0.45); backdrop-filter: blur(3px); }
.account-dialog__panel { display: grid; gap: 16px; margin: 0; padding: 27px; border: 1px solid rgba(255, 255, 255, 0.17); border-radius: 17px; background: #171b19; box-shadow: 0 26px 80px rgba(15, 18, 16, 0.35); }
.account-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.account-dialog__header h2 { margin: 5px 0 0; color: #fff; font-size: 25px; letter-spacing: -0.05em; }
.account-dialog__eyebrow { color: #b6c2b9; font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }
.account-dialog__close { width: 29px; height: 29px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; font-size: 21px; line-height: 1; }
.account-dialog label { display: grid; gap: 8px; color: #d8ddd7; font-size: 12px; font-weight: 700; }
.account-dialog input { width: 100%; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 9px; outline: none; background: #0e1110; color: #fff; font: inherit; padding: 12px; }
.account-dialog input:focus { border-color: #dce9df; box-shadow: 0 0 0 3px rgba(220, 233, 223, 0.12); }
.account-dialog__hint, .account-dialog__message { min-height: 18px; margin: -6px 0 0; color: #aeb9b1; font-size: 12px; line-height: 1.5; }
.account-dialog__message[data-tone="error"] { color: #ffafa8; }
.account-dialog__message[data-tone="success"] { color: #aee3bd; }
.account-dialog__submit { border: 0; border-radius: 9px; background: #f3f1e9; color: #18201b; cursor: pointer; font: inherit; font-weight: 800; padding: 13px 16px; }
.account-dialog__submit:hover { background: #fff; }
.account-dialog__notice { min-width: min(360px, calc(100vw - 32px)); }
.account-dialog__notice-text { margin: 0; color: #e8ece6; font-size: 15px; line-height: 1.7; }

.portal-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: clamp(54px, 8vw, 112px); }
.portal-card {
  position: relative;
  display: flex;
  min-height: min(560px, 48vw);
  overflow: hidden;
  border-radius: 15px;
  background: #2a302c;
  color: #fff;
  isolation: isolate;
  text-decoration: none;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.portal-card:hover { transform: translateY(-7px); box-shadow: 0 18px 30px rgba(26, 31, 28, 0.22); }
.portal-card:focus-visible { outline: 3px solid #1f2823; outline-offset: 4px; }
.portal-card img { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.portal-card:hover img { transform: scale(1.04); }
.portal-card__shade { position: absolute; inset: 0; z-index: 1; background: rgba(6, 10, 8, 0.34); }
.portal-card--local .portal-card__shade { background: rgba(5, 12, 8, 0.43); }
.portal-card--cloud .portal-card__shade { background: rgba(8, 12, 24, 0.33); }
.portal-card--runninghub .portal-card__shade { background: rgba(9, 8, 18, 0.37); }
.portal-card--showcase .portal-card__shade { background: rgba(18, 12, 8, 0.29); }
.portal-card__content { z-index: 2; display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 20px; }
.portal-card__eyebrow { opacity: 0.85; }
.portal-card strong { margin-top: auto; font-size: clamp(25px, 2.25vw, 38px); line-height: 1.08; letter-spacing: -0.055em; }
.portal-card__description { min-height: 58px; margin-top: 15px; font-size: 13px; line-height: 1.55; opacity: 0.9; }
.portal-card__action { margin-top: 16px; border-bottom: 1px solid currentColor; padding-bottom: 3px; font-size: 12px; font-weight: 700; }
@media (max-width: 980px) {
  .portal-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-card { min-height: 480px; }
}
@media (max-width: 620px) {
  .portal-home { width: min(100% - 32px, 560px); padding-top: 20px; }
  .portal-header { align-items: flex-start; gap: 14px; }
  .portal-account__menu { min-width: 164px; }
  .portal-card-grid { grid-template-columns: 1fr; }
  .portal-card { min-height: 420px; }
}
