:root {
  color-scheme: light;
  --paper: #eef2ef;
  --paper-deep: #e5ebe7;
  --surface: #fbfcfa;
  --surface-raised: #ffffff;
  --ink: #10252b;
  --ink-soft: #1b373e;
  --text: #17272b;
  --muted: #637176;
  --line: #d3dcd7;
  --line-strong: #aebbb5;
  --jade: #167564;
  --jade-dark: #0f5d50;
  --jade-soft: #d8ebe5;
  --cinnabar: #bf5335;
  --cinnabar-soft: #f5e1da;
  --amber: #9b752e;
  --sky: #456b7d;
  --shadow: 0 18px 50px rgba(16, 37, 43, .09);
  --header-bg: #10252b;
  --header-text: #edf6f2;
  --button-bg: #10252b;
  --button-text: #f5faf7;
  --button-hover: #0f5d50;
  --core-bg: #10252b;
  --core-text: #e7f4ef;
  --display: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "Aptos", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #0e1a1f;
    --paper-deep: #122228;
    --surface: #14262c;
    --surface-raised: #192d34;
    --ink: #eef4f1;
    --ink-soft: #d6e2dd;
    --text: #e8efec;
    --muted: #9aacaa;
    --line: rgba(211, 226, 219, .16);
    --line-strong: rgba(211, 226, 219, .32);
    --jade: #61bea9;
    --jade-dark: #8ad1c0;
    --jade-soft: rgba(97, 190, 169, .13);
    --cinnabar: #ed8b6c;
    --cinnabar-soft: rgba(237, 139, 108, .14);
    --amber: #d8b36f;
    --sky: #8fb6c8;
    --shadow: 0 22px 60px rgba(0, 0, 0, .24);
    --header-bg: #09151a;
    --header-text: #edf6f2;
    --button-bg: #d8ebe5;
    --button-text: #10252b;
    --button-hover: #bfe1d6;
    --core-bg: #d8ebe5;
    --core-text: #10252b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-family: var(--sans); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  color: var(--text);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
::selection { color: var(--surface); background: var(--jade); }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 3px; }

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 9px 5px 10px 5px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.brand-copy { display: flex; flex-direction: column; gap: 1px; }
.brand-copy strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
}
.brand-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  line-height: 1.25;
}
.brand-lockup--light { color: #f4f8f5; }
.brand-lockup--light .brand-copy small { color: rgba(228, 240, 235, .62); }

/* ---------- Login ---------- */
.auth-page {
  min-height: 100vh;
  background: var(--paper);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}
.auth-story {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 64px);
  color: #f4f8f5;
  background: var(--header-bg);
}
.auth-story::before {
  content: "";
  position: absolute;
  z-index: -2;
  width: min(72vw, 920px);
  aspect-ratio: 1;
  left: -30%;
  top: 12%;
  border-radius: 50%;
  border: 1px solid rgba(141, 190, 176, .17);
  box-shadow:
    0 0 0 68px rgba(141, 190, 176, .035),
    0 0 0 136px rgba(141, 190, 176, .026),
    0 0 0 204px rgba(141, 190, 176, .018);
}
.auth-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: .45;
  background-image:
    linear-gradient(rgba(231, 243, 238, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(231, 243, 238, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.4), transparent 82%);
}
.auth-story-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.environment-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(226, 240, 234, .2);
  border-radius: 999px;
  color: rgba(235, 244, 240, .76);
  font-size: 11px;
  letter-spacing: .08em;
}
.environment-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #73d2b8;
  box-shadow: 0 0 0 4px rgba(115, 210, 184, .12);
}
.auth-statement {
  width: min(760px, 100%);
  margin: auto 0;
  padding: 56px 0 20px;
}
.auth-kicker {
  margin: 0 0 22px;
  color: #84c8b6;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
}
.auth-statement h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(46px, 6vw, 92px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.05;
}
.auth-statement h1 span {
  display: block;
  max-width: 11em;
  color: rgba(236, 245, 241, .7);
  font-size: .55em;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -.01em;
  margin-top: .62em;
}
.auth-lede {
  max-width: 34em;
  margin: 26px 0 0;
  color: rgba(226, 240, 234, .64);
  font-size: 14px;
  line-height: 1.85;
}
.auth-constellation {
  position: relative;
  width: min(430px, 65%);
  aspect-ratio: 1;
  margin: -30px 0 -28px auto;
}
.constellation-ring {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(135, 190, 174, .2);
  border-radius: 50%;
}
.constellation-ring::after {
  content: "";
  position: absolute;
  inset: 21%;
  border: 1px dashed rgba(135, 190, 174, .16);
  border-radius: 50%;
}
.constellation-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(-3deg);
  border: 1px solid rgba(203, 234, 224, .48);
  border-radius: 18px 8px 18px 8px;
  color: #dff4ec;
  background: rgba(20, 58, 55, .82);
  font-family: var(--display);
  font-size: 35px;
  box-shadow: 0 0 0 10px rgba(116, 198, 175, .05);
}
.constellation-node {
  position: absolute;
  padding: 5px 9px;
  border: 1px solid rgba(211, 235, 228, .17);
  border-radius: 999px;
  color: rgba(226, 241, 235, .7);
  background: rgba(16, 37, 43, .82);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.constellation-node--files { left: 4%; top: 28%; }
.constellation-node--jobs { right: 1%; top: 42%; }
.constellation-node--sso { left: 28%; bottom: 5%; }
.auth-story-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(225, 239, 233, .42);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
}
.auth-entry {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 88px);
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 117, 100, .08), transparent 34%),
    var(--surface);
}
.auth-entry::before {
  content: "FUYAO";
  position: absolute;
  right: -16px;
  bottom: 12px;
  color: var(--line);
  font-family: var(--mono);
  font-size: clamp(74px, 11vw, 154px);
  font-weight: 700;
  letter-spacing: -.09em;
  line-height: .8;
  opacity: .38;
  pointer-events: none;
}
.auth-entry-inner {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  margin: 0 auto;
}
.entry-index {
  margin: 0 0 44px;
  color: var(--jade);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.auth-entry h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -.04em;
}
.auth-entry-intro {
  margin: 9px 0 34px;
  color: var(--muted);
  font-size: 13px;
}
.login-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.login-card label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  height: 50px;
  padding: 0 1px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.login-card input:focus {
  border-color: var(--jade);
  box-shadow: 0 2px 0 var(--jade);
}
.btn-primary {
  position: relative;
  width: 100%;
  min-height: 52px;
  margin-top: 8px;
  padding: 0 66px 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--button-text);
  background: var(--button-bg);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease;
}
.btn-primary::after {
  content: "↗";
  position: absolute;
  right: 0;
  top: 0;
  width: 54px;
  height: 100%;
  display: grid;
  place-items: center;
  border-left: 1px solid rgba(255,255,255,.14);
  color: #91d1c0;
  font-size: 20px;
}
.btn-primary:hover { background: var(--button-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.error {
  margin: 0;
  padding: 11px 13px;
  border-left: 3px solid var(--cinnabar);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
  font-size: 12px;
}
.foot {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  margin: 44px auto 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-align: center;
}

/* ---------- Portal ---------- */
.portal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 11% 2%, rgba(22, 117, 100, .1), transparent 27%),
    radial-gradient(circle at 88% 25%, rgba(69, 107, 125, .09), transparent 25%),
    var(--paper);
}
.portal-grid {
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  opacity: .52;
  background-image:
    linear-gradient(rgba(16, 37, 43, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 37, 43, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
.topbar {
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.topbar .brand-lockup { color: var(--ink); }
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: 12px;
}
.user-capsule::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-soft);
}
.logout-form { margin: 0; }
.btn-ghost {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.btn-ghost:hover { color: var(--jade); border-color: var(--jade); background: var(--jade-soft); }
.nav-main {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(58px, 8vw, 108px) 0 30px;
}
.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
  align-items: center;
  gap: clamp(40px, 8vw, 112px);
}
.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--jade);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
}
.hero-kicker::before {
  content: "";
  width: 30px;
  height: 1px;
  background: currentColor;
}
.portal-hero h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(70px, 10vw, 138px);
  font-weight: 600;
  letter-spacing: -.07em;
  line-height: .86;
}
.portal-hero h1 span {
  display: block;
  margin-top: .16em;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .2em;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
}
.hero-lede {
  max-width: 31em;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.hero-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}
.hero-status b {
  color: var(--text);
  font-weight: 600;
}
.status-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--jade);
}
.status-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 4px var(--jade-soft);
}
.network-map {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  justify-self: end;
}
.network-ring {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.network-ring--one { inset: 4%; }
.network-ring--two { inset: 18%; border-style: dashed; opacity: .7; }
.network-ring--three { inset: 32%; opacity: .55; }
.network-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 108%;
  height: 1px;
  transform: translate(-50%, -50%) rotate(-18deg);
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}
.network-axis--two { transform: translate(-50%, -50%) rotate(58deg); }
.network-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%) rotate(-4deg);
  border-radius: 24px 10px 24px 10px;
  color: var(--core-text);
  background: var(--core-bg);
  box-shadow: 0 20px 54px rgba(16, 37, 43, .2), 0 0 0 14px rgba(22, 117, 100, .07);
  font-family: var(--display);
  font-size: 44px;
}
.network-node {
  position: absolute;
  min-width: 94px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 10px 28px rgba(16, 37, 43, .07);
  backdrop-filter: blur(8px);
}
.network-node small {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .08em;
}
.network-node b { color: var(--ink); font-size: 12px; font-weight: 650; }
.network-node::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 1px var(--jade);
}
.network-node--files { left: 40%; top: 5%; }
.network-node--files::before { left: 50%; bottom: -5px; transform: translateX(-50%); }
.network-node--jobs { left: 78%; top: 32.5%; }
.network-node--jobs::before { left: -5px; top: 50%; transform: translateY(-50%); background: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar); }
.network-node--video { left: 63.5%; top: 77.5%; }
.network-node--video::before { left: 50%; top: -5px; transform: translateX(-50%); background: var(--cinnabar); box-shadow: 0 0 0 1px var(--cinnabar); }
.network-node--sso { left: 16.5%; top: 77.5%; }
.network-node--sso::before { left: 50%; top: -5px; transform: translateX(-50%); background: var(--sky); box-shadow: 0 0 0 1px var(--sky); }
.network-node--chat { left: 2%; top: 32.5%; }
.network-node--chat::before { right: -5px; top: 50%; transform: translateY(-50%); }
.gateway-section { margin-top: clamp(70px, 9vw, 126px); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 22px;
}
.section-heading p {
  margin: 0 0 5px;
  color: var(--jade);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
}
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: -.035em;
}
.section-note {
  max-width: 27em;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: right;
}
.cards {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 18px;
}
.site-card {
  position: relative;
  isolation: isolate;
  min-height: 252px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 50px;
  gap: 22px;
  align-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px 6px 18px 6px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 10px 34px rgba(16, 37, 43, .055);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.site-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  background: linear-gradient(112deg, transparent 25%, rgba(22, 117, 100, .08));
  transition: opacity .2s ease;
}
.site-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 26px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--jade);
}
.site-card:nth-child(2)::after { background: var(--cinnabar); }
.site-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.site-card:hover::before { opacity: 1; }
.site-icon {
  width: 68px;
  height: 88px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 34px 8px 34px 8px;
  color: var(--jade);
  background: var(--surface);
}
.site-card:nth-child(2) .site-icon { color: var(--cinnabar); }
.site-icon svg { width: 28px; height: 28px; }
.site-body { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.site-type {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.site-name {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.12;
}
.site-desc {
  max-width: 26em;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.site-open {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px dashed var(--line-strong);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 16px;
  transition: color .18s ease, transform .18s ease;
}
.site-card:hover .site-open { color: var(--jade); transform: translateX(3px); }
.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 84px;
  padding: 22px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .04em;
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 56vh; padding: 28px; }
  .auth-statement { padding: 44px 0 18px; }
  .auth-statement h1 { font-size: clamp(44px, 8vw, 70px); }
  .auth-constellation { display: none; }
  .auth-entry { min-height: 44vh; padding: 52px 28px; }
  .auth-entry-inner { margin-left: 0; }
  .entry-index { margin-bottom: 24px; }
  .portal-hero { grid-template-columns: 1fr; }
  .network-map { display: none; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .section-note { text-align: left; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar, .nav-main { width: min(100% - 28px, 1240px); }
  .topbar { padding: 16px 0; }
  .brand-seal { width: 38px; height: 38px; font-size: 20px; }
  .brand-copy small { display: none; }
  .user-capsule { display: none; }
  .nav-main { padding-top: 48px; }
  .portal-hero h1 { font-size: clamp(64px, 23vw, 92px); }
  .site-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    padding: 24px 20px;
  }
  .site-icon { width: 54px; height: 72px; border-radius: 27px 7px 27px 7px; }
  .site-open { display: none; }
  .portal-footer { flex-direction: column; gap: 8px; margin-top: 58px; }
  .auth-story-foot span:last-child { display: none; }
  .auth-entry::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
