:root {
  color-scheme: light;
  --paper: #f2efe7;
  --surface: #fbfaf5;
  --surface-2: #e7ebe3;
  --ink: #14231e;
  --ink-soft: #41504a;
  --muted: #748079;
  --line: #d4d0c5;
  --forest: #143b32;
  --forest-2: #214c41;
  --lime: #cbea68;
  --lime-soft: #e7f3bd;
  --orange: #ef6a3d;
  --red: #bd493e;
  --blue: #cfdff1;
  --shadow: 0 22px 70px rgba(20, 35, 30, 0.11);
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Iowan Old Style", "Baskerville", "Songti SC", "STSong", serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(203, 234, 104, 0.19), transparent 31rem),
    radial-gradient(circle at 95% 12%, rgba(239, 106, 61, 0.09), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  z-index: 1000;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/%3E%3C/svg%3E");
}

.boot {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 16px;
  text-align: center;
  color: var(--ink-soft);
}

.boot-mark,
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px 12px 12px 3px;
  background: var(--forest);
  color: var(--lime);
  font-size: 22px;
  font-weight: 800;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.2fr) minmax(400px, 0.8fr);
}

.auth-hero {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 76px);
  background:
    linear-gradient(145deg, rgba(203, 234, 104, 0.1), transparent 48%),
    var(--forest);
  color: #f8f6ed;
  position: relative;
}

.auth-hero::after {
  position: absolute;
  right: -12rem;
  bottom: -18rem;
  width: 42rem;
  height: 42rem;
  border: 1px solid rgba(203, 234, 104, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 80px rgba(203, 234, 104, 0.025),
    0 0 0 160px rgba(203, 234, 104, 0.018);
  content: "";
}

.brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-row strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand-row span {
  display: block;
  color: rgba(248, 246, 237, 0.55);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 80px 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker::before {
  width: 26px;
  height: 2px;
  background: var(--orange);
  content: "";
}

.auth-copy h1 {
  max-width: 710px;
  margin-bottom: 26px;
  font-size: clamp(3rem, 6.1vw, 6.9rem);
  font-weight: 650;
  letter-spacing: -0.075em;
  line-height: 1.02;
}

.auth-copy h1 em {
  color: var(--lime);
  font-family: var(--serif);
  font-weight: 400;
}

.auth-copy > p {
  max-width: 620px;
  color: rgba(248, 246, 237, 0.66);
  font-size: clamp(15px, 1.5vw, 18px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.hero-points span {
  padding: 8px 12px;
  border: 1px solid rgba(248, 246, 237, 0.18);
  border-radius: 999px;
  color: rgba(248, 246, 237, 0.76);
  font-size: 12px;
}

.auth-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  color: rgba(248, 246, 237, 0.38);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(28px, 5vw, 70px);
  background: rgba(251, 250, 245, 0.88);
}

.auth-card {
  width: min(100%, 460px);
  margin: 0 auto;
}

.auth-card h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.055em;
}

.auth-card > p {
  margin-bottom: 28px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.auth-tabs button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(20, 35, 30, 0.08);
}

.form-grid {
  display: grid;
  gap: 15px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
}

.field small,
.hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.check-field input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 0;
  accent-color: var(--forest);
}

.check-field a {
  color: var(--forest-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  padding: 12px 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(33, 76, 65, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--forest);
  border-radius: 9px;
  background: var(--forest);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.button:hover {
  background: var(--forest-2);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none;
}

.button.lime {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.button.ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button.danger {
  border-color: rgba(189, 73, 62, 0.26);
  background: rgba(189, 73, 62, 0.08);
  color: var(--red);
}

.button.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.form-note {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11px;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  padding: 24px 18px;
  background: var(--forest);
  color: #f8f6ed;
}

.sidebar .brand-row {
  margin-bottom: 34px;
  padding: 0 6px;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 9px;
  background: transparent;
  color: rgba(248, 246, 237, 0.62);
  text-align: left;
  font-size: 13px;
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(248, 246, 237, 0.13);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(248, 246, 237, 0.08);
  color: #fff;
}

.nav-item.active .nav-icon {
  border-color: var(--lime);
  color: var(--lime);
}

.sidebar-foot {
  margin-top: auto;
  padding: 17px 14px;
  border: 1px solid rgba(248, 246, 237, 0.11);
  border-radius: 12px;
  background: rgba(248, 246, 237, 0.04);
}

.sidebar-foot span {
  display: block;
  color: rgba(248, 246, 237, 0.5);
  font-size: 10px;
}

.sidebar-foot strong {
  display: block;
  margin: 3px 0 11px;
  font-size: 21px;
}

.sidebar-foot a {
  color: var(--lime);
  font-size: 11px;
}

.main-area {
  min-width: 0;
}

.topbar {
  display: flex;
  position: sticky;
  z-index: 20;
  top: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 13px clamp(18px, 3.5vw, 48px);
  border-bottom: 1px solid rgba(20, 35, 30, 0.08);
  background: rgba(242, 239, 231, 0.88);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.workspace-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 250, 245, 0.7);
  color: var(--ink-soft);
  font-size: 11px;
}

.workspace-pill::before,
.status-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  content: "";
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.credit-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 9px;
  background: var(--lime-soft);
}

.credit-chip strong {
  font-size: 16px;
}

.credit-chip span {
  color: var(--ink-soft);
  font-size: 10px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  font-weight: 800;
}

.page {
  padding: clamp(24px, 4vw, 52px);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.page-head h1 {
  margin-bottom: 7px;
  font-size: clamp(2.2rem, 4.2vw, 4.2rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 1.05;
}

.page-head h1 em {
  font-family: var(--serif);
  font-weight: 400;
}

.page-head p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 250, 245, 0.88);
  box-shadow: 0 8px 30px rgba(20, 35, 30, 0.04);
}

.card.dark {
  border-color: var(--forest);
  background: var(--forest);
  color: #f8f6ed;
}

.card.accent {
  border-color: rgba(203, 234, 104, 0.52);
  background: linear-gradient(140deg, var(--lime-soft), var(--surface));
}

.card h2,
.card h3 {
  letter-spacing: -0.035em;
}

.card h3 {
  margin-bottom: 11px;
  font-size: 17px;
}

.card p {
  color: var(--ink-soft);
}

.card.dark p {
  color: rgba(248, 246, 237, 0.62);
}

.metric {
  display: flex;
  min-height: 130px;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong {
  display: block;
  font-size: clamp(2.1rem, 3.4vw, 3.8rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.card.dark .metric span {
  color: rgba(248, 246, 237, 0.54);
}

.score-ring {
  display: grid;
  width: 90px;
  height: 90px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime) calc(var(--score) * 1%), rgba(255, 255, 255, 0.12) 0);
  position: relative;
}

.score-ring::before {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--forest);
  content: "";
}

.score-ring strong {
  position: relative;
  font-size: 24px;
}

.project-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(251, 250, 245, 0.68);
  color: var(--ink-soft);
  font-size: 12px;
}

.project-chip.active {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
}

.project-chip span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.project-chip.active span {
  color: rgba(255, 255, 255, 0.56);
}

.empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  text-align: center;
}

.empty h3 {
  margin-bottom: 0;
}

.empty p {
  max-width: 480px;
  margin: 0 auto;
  color: var(--muted);
}

.issues {
  display: grid;
  gap: 10px;
}

.issue {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.severity {
  align-self: start;
  padding: 5px 8px;
  border-radius: 7px;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.severity.critical,
.severity.high {
  background: rgba(189, 73, 62, 0.1);
  color: var(--red);
}

.severity.medium {
  background: rgba(239, 106, 61, 0.12);
  color: #98442d;
}

.severity.low {
  background: var(--surface-2);
  color: var(--ink-soft);
}

.issue h4 {
  margin-bottom: 4px;
  font-size: 14px;
}

.issue p {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 12px;
}

.issue small {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.notice {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
}

.notice.warning {
  border-color: rgba(239, 106, 61, 0.28);
  background: rgba(239, 106, 61, 0.07);
}

.notice.success {
  border-color: rgba(33, 76, 65, 0.22);
  background: rgba(203, 234, 104, 0.18);
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 14px;
}

.section-title-row h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.mono {
  font-family: var(--mono);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 11px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 10px;
}

.module-lock {
  padding: 17px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(212, 208, 197, 0.16) 0 8px,
      transparent 8px 16px
    );
}

.preview-code {
  max-height: 340px;
  overflow: auto;
  margin: 13px 0 0;
  padding: 14px;
  border-radius: 10px;
  background: #101c18;
  color: #d9e9df;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.plan-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.plan-card.featured {
  border-color: var(--forest);
  box-shadow: var(--shadow);
}

.plan-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.plan-price {
  margin: 18px 0;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.055em;
}

.plan-price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.plan-list {
  display: grid;
  gap: 9px;
  margin: 0 0 20px;
  padding: 0;
  color: var(--ink-soft);
  font-size: 12px;
  list-style: none;
}

.plan-list li::before {
  margin-right: 8px;
  color: var(--forest-2);
  content: "＋";
}

.plan-card footer {
  margin-top: auto;
}

.toast-root {
  display: grid;
  position: fixed;
  z-index: 2000;
  right: 22px;
  bottom: 22px;
  gap: 9px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 13px 15px;
  border: 1px solid rgba(248, 246, 237, 0.12);
  border-radius: 11px;
  background: var(--forest);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}

.toast.error {
  background: #672d28;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

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

.loader::before {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .sidebar {
    padding: 20px 10px;
  }

  .sidebar .brand-row {
    justify-content: center;
  }

  .sidebar .brand-row > div,
  .nav-item > span:last-child,
  .sidebar-foot {
    display: none;
  }

  .nav-item {
    justify-content: center;
    padding: 13px;
  }

  .nav-icon {
    width: 27px;
    height: 27px;
  }

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

@media (max-width: 900px) {
  .auth-page {
    display: block;
  }

  .auth-hero {
    min-height: auto;
    padding: 28px 22px 52px;
  }

  .auth-copy {
    padding: 58px 0 20px;
  }

  .auth-copy h1 {
    font-size: clamp(2.8rem, 12vw, 5rem);
  }

  .auth-foot {
    display: none;
  }

  .auth-panel {
    padding: 34px 20px 58px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    inset: auto 0 0;
    width: 100%;
    height: 66px;
    padding: 7px 10px;
    border-top: 1px solid rgba(248, 246, 237, 0.13);
  }

  .sidebar .brand-row {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    justify-content: space-between;
    overflow-x: auto;
  }

  .nav-item {
    min-width: 54px;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    font-size: 9px;
  }

  .nav-item > span:last-child {
    display: block;
  }

  .nav-icon {
    width: 23px;
    height: 23px;
  }

  .main-area {
    padding-bottom: 78px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
  }

  .topbar-left .workspace-pill,
  .user-menu > span {
    display: none;
  }

  .topbar {
    min-height: 62px;
    padding: 10px 16px;
  }

  .page {
    padding: 24px 16px;
  }

  .page-head {
    display: block;
  }

  .page-actions {
    justify-content: flex-start;
    margin-top: 16px;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .credit-chip span {
    display: none;
  }

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

  .severity {
    width: max-content;
  }
}
