:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --cream: #fcfaf3;
  --ink: #1c1c2b;
  --muted: #5f5a69;
  --line: #d9d3c8;
  --purple: #5741b3;
  --night: #211939;
  --lime: #d9f687;
  --mono: "IBM Plex Mono", "DejaVu Sans Mono", "Courier New", monospace;
  --body: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  background-color: var(--paper);
  background-image: radial-gradient(#ddd7cd 0.65px, transparent 0.65px);
  background-size: 12px 12px;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }

.site-header,
.site-footer {
  width: min(1280px, calc(100% - 100px));
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 78px;
  gap: 16px;
}

.site-header { border-bottom: 1px solid var(--line); }

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font: 800 18px/1 var(--mono);
  letter-spacing: -0.05em;
}

.brand img { image-rendering: pixelated; }
.brand-dot { color: var(--purple); }
.brand:hover, .auth-tabs a:hover, .connect:hover, .workspace-tile:hover { text-decoration: none; }

.site-link, .signout, .site-footer { font-size: 13px; }
.site-link span, .signout span { margin-left: 4px; color: var(--purple); font-family: var(--mono); }

.site-footer {
  min-height: 70px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer nav { display: flex; gap: 22px; }

.entry-main,
.error-main {
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 45px 46px 52px;
}

.entry-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
  width: min(1010px, 100%);
  min-height: 550px;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 #ccc3e4;
  background: var(--cream);
}

.art-panel {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-right: 2px solid var(--ink);
  background: var(--night);
}

.art-panel img { position: absolute; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }

.auth-panel {
  align-self: center;
  padding: 35px clamp(30px, 5.2vw, 62px) 40px;
}

.auth-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  width: fit-content;
  border: 1px solid #d0c9d8;
  background: #ebe6ef;
}

.auth-tabs a {
  display: block;
  min-width: 72px;
  padding: 7px 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}

.auth-tabs a[aria-current] { background: var(--night); color: var(--cream); }
.auth-tabs a:not([aria-current]):hover { background: #ddd4e9; }

.auth-heading { margin: 23px 0 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(31px, 4.1vw, 48px); line-height: 1.25; letter-spacing: -0.045em; font-weight: 800; }
.auth-heading p, .error-panel p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.title-cursor {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 10px;
  background: var(--purple);
  box-shadow: 3px 3px 0 #c1b5e0;
}

.connect {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 11px;
  min-height: 49px;
  width: 100%;
  padding: 9px 13px;
  border: 1px solid #bbb4c3;
  background: var(--cream);
  text-align: left;
  font-weight: 650;
  font-size: 14px;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.connect:hover { background: #eee9f5; box-shadow: 2px 2px 0 #bbb4c3; transform: translate(-1px, -1px); }
.connect:active { box-shadow: none; transform: none; }

.connect-primary {
  min-height: 52px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  background: var(--lime);
  color: var(--ink);
}

.connect-primary:hover { background: #e9ffa6; box-shadow: 4px 4px 0 var(--ink); }
.connect-arrow { color: var(--purple); font: 700 20px/1 var(--mono); }
.connect-primary .connect-arrow { color: var(--ink); }
.provider-list { display: grid; gap: 8px; }

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 11px;
  margin: 19px 0 13px;
  color: var(--muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after { content: ""; height: 1px; background: var(--line); }

.method-icon {
  width: 19px;
  height: 19px;
  background-image: url("methods.png");
  background-size: 76px 19px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.method-wechat { background-position: -19px 0; }
.method-google { background-position: -38px 0; }
.method-apple { background-position: -57px 0; }

.signout { background: var(--cream); border: 1px solid #bdb4cc; padding: 8px 11px; }
.signout:hover { background: #eae3f4; }

.workspace-main {
  margin: 0 auto;
  width: min(1010px, calc(100% - 92px));
  padding-block: 52px 60px;
}

.workspace-welcome {
  display: grid;
  grid-template-columns: 1fr 32%;
  min-height: 238px;
  border: 2px solid var(--ink);
  background: var(--cream);
  box-shadow: 6px 6px 0 #ccc3e4;
}

.workspace-intro { padding: 34px clamp(26px, 5vw, 65px); align-self: center; min-width: 0; }
.profile-handle { margin-top: 15px; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.profile-email { margin-top: 4px; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }

.workspace-art {
  border-left: 2px solid var(--ink);
  background: var(--night) url("relay.png") center 44% / cover no-repeat;
  image-rendering: pixelated;
}

.workspace-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-top: 32px; }
.workspace-tile {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid #bdb4cc;
  background: var(--cream);
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.workspace-tile:hover { background: #eee9f5; box-shadow: 3px 3px 0 #bbb4c3; transform: translate(-1px, -1px); }
.billing-tile { background: #e9f6cc; border-color: #88945c; }
.billing-tile:hover { background: var(--lime); }
.workspace-tile h2 { margin-top: 14px; font-size: 23px; }
.workspace-tile p { margin: 9px 0 25px; color: var(--muted); line-height: 1.65; font-size: 14px; }
.tile-action { margin-top: auto; color: #4d3b97; font-weight: 700; }

.tile-icon {
  width: 26px;
  height: 26px;
  background-image: url("workbench.png");
  background-size: 78px 26px;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}
.tile-model { background-position: -26px 0; }
.tile-account { background-position: -52px 0; }

.error-panel {
  width: min(530px, 100%);
  padding: 36px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 #ccc3e4;
  background: var(--cream);
}

.error-panel .connect { grid-template-columns: 1fr auto; margin-top: 24px; width: fit-content; min-width: 140px; }

@media (min-width: 751px) and (max-width: 940px) {
  .workspace-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 750px) {
  .site-header, .site-footer { width: calc(100% - 48px); min-height: 60px; }
  .entry-main, .error-main { padding: 26px 24px 32px; }
  .entry-shell { grid-template-columns: minmax(0, 1fr); width: min(470px, 100%); min-height: 0; box-shadow: 5px 5px 0 #ccc3e4; }
  .art-panel { border-right: 0; border-bottom: 2px solid var(--ink); height: clamp(150px, 31vw, 210px); }
  .art-panel img { object-position: center 42%; }
  .auth-panel { padding: 26px clamp(20px, 5vw, 36px); }
  .auth-heading { margin: 20px 0; }
  .workspace-main { width: calc(100% - 48px); padding-block: 29px 37px; }
  .workspace-links { grid-template-columns: 1fr; gap: 13px; margin-top: 23px; }
  .workspace-welcome { grid-template-columns: 1fr 25%; min-height: 185px; }
  .workspace-tile p { margin-bottom: 13px; }
}

@media (max-width: 385px) {
  .site-header, .site-footer, .workspace-main { width: calc(100% - 36px); }
  .site-footer { font-size: 11px; gap: 8px; }
  .site-footer nav { gap: 12px; }
  .entry-main, .error-main { padding-inline: 18px; }
  .auth-panel { padding-inline: 17px; }
  .workspace-welcome { grid-template-columns: 1fr; }
  .workspace-art { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
