:root {
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --canvas: #edf3f0;
  --panel: #ffffff;
  --soft: #f1f6f3;
  --ink: #192f2a;
  --muted: #526761;
  --line: #dbe6e0;
  --green: #12614f;
  --green-strong: #0c4d3d;
  --green-soft: #e4f2e9;
  --red: #8c2f34;
  --red-soft: #fceff0;
  --shadow: 0 13px 35px rgb(24 54 44 / 7%);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; background: var(--canvas); color: var(--ink); }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #479c77; outline-offset: 3px; }

.wrap { width: min(1112px, 100%); margin-inline: auto; padding-inline: 24px; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar-inner, .brand, .session-tools { display: flex; align-items: center; }
.topbar-inner { justify-content: space-between; gap: 10px; min-height: 72px; }
.brand { flex: 0 0 auto; gap: 10px; color: #164b3f; font-weight: 760; line-height: 1.25; text-decoration: none; }
.brand-mark {
  position: relative;
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #1b6957;
}
.brand-mark::before, .brand-mark::after {
  position: absolute;
  top: 9px;
  width: 10px;
  height: 19px;
  border-radius: 15px 0 15px 0;
  background: #c7e4b7;
  content: "";
}
.brand-mark::before { left: 11px; transform: rotate(-39deg); background: #9fd8af; }
.brand-mark::after { right: 11px; transform: rotate(39deg); }
.session-tools { gap: 10px; min-width: 0; }
.user-avatar {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 14px;
  font-weight: 720;
}
.user-name {
  min-width: 0;
  max-width: 20ch;
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--green);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.btn:not(:disabled):hover { border-color: #abc4b8; background: var(--soft); }
.btn-small { flex: none; min-height: 42px; padding-inline: 12px; }
.btn-primary { border-color: var(--green); background: var(--green); color: #fff; }
.btn-primary:not(:disabled):hover { border-color: var(--green-strong); background: var(--green-strong); }
.btn-wide { width: 100%; }
.initial-state { display: grid; min-height: min(45vh, 400px); align-content: center; justify-items: center; gap: 14px; color: var(--muted); }

.entry {
  display: grid;
  width: min(930px, 100%);
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 10px;
  align-items: stretch;
  margin: clamp(28px, 8vh, 84px) auto 36px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.entry-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 480px;
  align-items: flex-end;
  overflow: hidden;
  padding: clamp(27px, 4.2vw, 55px);
  border-radius: 20px;
  background: #124938;
  color: #fff;
}
.entry-art { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.entry-art::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 22%, #6eb38e 0%, #286b58 23%, transparent 55%), linear-gradient(155deg, #215f4d, #0e3b32 84%);
  content: "";
}
.entry-art::after {
  position: absolute;
  inset: auto 0 0;
  height: 64%;
  background: linear-gradient(transparent, rgb(5 41 33 / 85%));
  content: "";
}
.entry-art i {
  position: absolute;
  top: 25%;
  left: 4%;
  width: 120%;
  height: 67%;
  transform: rotate(-21deg);
  transform-origin: center;
  border: 1px solid rgb(232 255 219 / 31%);
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse at 45% 51%, transparent 0 14px, rgb(227 253 219 / 14%) 15px 16px, transparent 17px 23px);
}
.entry-art i:nth-child(2) { top: 49%; left: -60%; transform: rotate(21deg); }
.entry-art i:nth-child(3) { top: 40%; left: 67%; transform: rotate(-28deg); }
.entry-copy h1 { font-size: clamp(33px, 5vw, 60px); font-weight: 760; letter-spacing: -.045em; line-height: 1.2; }
.entry-copy p { max-width: 25em; margin-top: 16px; color: #d0ebe0; font-size: clamp(14px, 1.7vw, 17px); line-height: 1.75; }
.entry-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(20px, 3.2vw, 35px); }
.segmented {
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
}
.auth-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented button {
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--green); box-shadow: 0 2px 7px rgb(24 54 44 / 11%); }
.auth-heading { margin: 24px 0 16px; }
.auth-heading h2 { font-size: clamp(23px, 3vw, 32px); line-height: 1.3; }
.auth-heading p, .subheading { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 1.55; }
form { display: grid; gap: 13px; }
.field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 650; }
.field input {
  width: 100%;
  min-height: 47px;
  padding: 10px 12px;
  border: 1px solid #bed2c7;
  border-radius: 10px;
  background: #f9fcfa;
  color: var(--ink);
  font-size: 16px;
  font-weight: 450;
}
.field input::placeholder { color: #63756d; }
.field input:read-only { background: var(--soft); }
.notice { padding: 10px 12px; border: 1px solid #c4ddce; border-radius: 10px; background: #edf7ef; color: #245842; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.notice.is-error { border-color: #eed0d0; background: var(--red-soft); color: var(--red); }
.alt-login { margin-top: 16px; }
.alt-login p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }

.workspace { padding-block: 28px 40px; }
.workspace-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 158px;
  gap: 22px;
  overflow: hidden;
  padding: 31px 35px;
  border: 1px solid #1a5d4b;
  border-radius: 24px;
  background: linear-gradient(119deg, #144b3c, #236d55);
  color: #fff;
}
.workspace-banner::after {
  position: absolute;
  z-index: -1;
  top: -71px;
  right: -94px;
  width: 60%;
  height: 330px;
  transform: rotate(-14deg);
  border-radius: 50%;
  background: repeating-radial-gradient(ellipse, transparent 0 16px, rgb(220 255 220 / 13%) 17px 18px, transparent 19px 23px);
  content: "";
}
.workspace-copy h1 { font-size: clamp(28px, 4.3vw, 44px); letter-spacing: -.037em; line-height: 1.2; }
.workspace-copy p { margin-top: 8px; color: #d4ebe2; font-size: 14px; line-height: 1.55; }
.space-switch {
  width: clamp(185px, 28vw, 250px);
  flex: 0 0 auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-color: #cfdfd2;
  background: #f1f7f1;
}
.switch-icon { margin-inline-end: 5px; font-size: 16px; color: var(--green); }
.workspace-notice { margin-top: 14px; }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
.panel { min-width: 0; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.panel-top { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel h2, .dialog h2 { font-size: 20px; line-height: 1.3; }
.panel h3 { font-size: 15px; }
.chip { display: inline-flex; flex: none; align-items: center; min-height: 26px; padding: 4px 9px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 690; }
.chip-positive { background: var(--green-soft); color: #12614f; }
.empty-state {
  display: grid;
  min-height: 200px;
  gap: 8px;
  place-items: center;
  align-content: center;
  padding: 16px;
  margin-top: 18px;
  border: 1px dashed #bfd0c6;
  border-radius: 14px;
  background: var(--soft);
  text-align: center;
}
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 21px; }
.empty-state p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 20px; }
.metric-grid > div { min-width: 0; padding: 14px; border-radius: 14px; background: var(--soft); }
.metric-grid dt, .subscription dt, .detail-list dt, .linked-account p { color: var(--muted); font-size: 13px; }
.metric-grid dd { margin-top: 6px; font-size: clamp(18px, 2.7vw, 27px); font-weight: 750; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.detail-section { display: grid; gap: 11px; margin-top: 21px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 8px;
}
.detail-list > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.detail-list dd { margin-top: 4px; font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.action-list { display: flex; flex-wrap: wrap; gap: 8px; }
.subscription { display: grid; gap: 12px; margin: 18px 0; padding: 15px; border-radius: 13px; background: var(--soft); }
.subscription > div { display: grid; gap: 4px; }
.subscription dd { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.linked-account { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.linked-account p { margin-top: 4px; }

.dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgb(14 39 31 / 58%); }
.dialog .panel-top { align-items: center; }
.dialog form { margin-top: 15px; }

@media (max-width: 760px) {
  .wrap { padding-inline: 14px; }
  .topbar-inner { min-height: 60px; }
  .entry { width: min(500px, 100%); grid-template-columns: 1fr; margin-top: 18px; border-radius: 22px; }
  .entry-banner { min-height: 155px; padding: 23px; border-radius: 15px; }
  .entry-copy p { margin-top: 9px; }
  .entry-card { padding: 9px 12px 14px; }
  .auth-heading { margin-block: 17px 13px; }
  .workspace { padding-block: 16px 34px; }
  .workspace-banner { min-height: auto; padding: 22px; border-radius: 19px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .panel { border-radius: 18px; }
}

@media (max-width: 480px) {
  .user-avatar { display: none; }
  .user-name { max-width: 10ch; }
  .workspace-banner { display: grid; gap: 14px; padding: 19px; }
  .space-switch { width: 100%; }
  .metric-grid { gap: 6px; }
  .metric-grid > div { padding: 10px 8px; }
  .action-list .btn { flex: 1 1 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
.detail-section h4 { margin: 3px 0 0; font-size: 14px; }
.space-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.space-items li {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.space-items li span { color: var(--muted); font-size: 13px; line-height: 1.4; }
