:root {
  --bg: #f3f6f3;
  --panel: #ffffff;
  --ink: #0c1712;
  --muted: #617168;
  --line: #d7dfd9;
  --brand: #087a50;
  --brand-dark: #0d1a14;
  --brand-soft: #e8f5ee;
  --amber: #d99519;
  --red: #bc3b32;
  --blue: #2667ff;
  --shadow: 0 16px 40px rgba(9, 25, 17, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
}

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  background: rgba(12, 23, 18, 0.96);
  color: #fff;
  border-bottom: 1px solid rgba(83, 210, 150, 0.5);
}

.nav {
  width: min(1180px, calc(100% - 40px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a.active,
.nav-links a:hover {
  color: #fff;
  border-bottom-color: #43d899;
}

.nav-cta {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  color: #fff;
  font-weight: 700;
}

.link-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  color: #fff;
  border-bottom-color: #43d899;
}

.hero {
  min-height: calc(100vh - 74px);
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(7, 14, 10, 0.9) 0%, rgba(7, 14, 10, 0.72) 42%, rgba(7, 14, 10, 0.88) 100%),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=2200&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 74px 0 116px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #d7fff0;
  font-weight: 700;
  font-size: 14px;
}

.status-pill::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #42e6a6;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(66, 230, 166, 0.12);
}

.hero h1 {
  margin: 28px 0 18px;
  font-size: clamp(56px, 9vw, 118px);
  line-height: 0.95;
  font-weight: 900;
}

.hero-copy {
  max-width: 650px;
  margin: 0 0 36px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  line-height: 1.8;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.button {
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.dark {
  border-color: #11231a;
  background: #11231a;
  color: #fff;
}

.button.ghost {
  background: transparent;
  color: inherit;
  border-color: rgba(255, 255, 255, 0.45);
}

.button.warning {
  border-color: var(--amber);
  background: #fff7e8;
  color: #6c4300;
}

.button.danger {
  border-color: var(--red);
  background: #fff0ee;
  color: #7b1d17;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hero-metrics {
  width: min(520px, 100%);
  margin-top: 96px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.hero-metrics div {
  padding: 18px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-metrics div:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 18px;
  font-weight: 800;
}

.feature-strip {
  width: 100%;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.feature {
  min-height: 118px;
  padding: 28px 32px;
  border-right: 1px solid var(--line);
}

.feature:first-child {
  border-left: 1px solid var(--line);
}

.feature small {
  display: block;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.feature strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 80px;
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: 22px;
}

.sidebar {
  background: #fff;
  border: 1px solid var(--line);
}

.profile {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #0f5138;
  color: #fff;
  border-radius: 50%;
  font-weight: 900;
}

.profile strong {
  display: block;
  margin-top: 14px;
  font-size: 17px;
}

.profile span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  word-break: break-all;
}

.side-nav {
  display: grid;
  padding: 10px;
}

.side-nav a {
  padding: 13px 14px;
  border-left: 3px solid transparent;
  color: #27352e;
}

.side-nav a.active,
.side-nav a:hover {
  background: var(--brand-soft);
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 800;
}

.main-stack {
  display: grid;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-card,
.panel,
.plan-card,
.form-panel,
.session-panel {
  background: #fff;
  border: 1px solid var(--line);
}

.stat-card {
  padding: 18px;
  border-top: 3px solid var(--brand);
}

.stat-card.amber {
  border-top-color: var(--amber);
}

.stat-card.red {
  border-top-color: var(--red);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
  font-size: 13px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stat-card small {
  display: block;
  color: var(--muted);
  margin-top: 12px;
}

.panel-header {
  min-height: 54px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 17px;
}

.panel-body {
  padding: 18px;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}

.policy-grid div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.policy-grid div:last-child {
  border-right: 0;
}

.policy-grid strong {
  display: block;
  margin-bottom: 8px;
}

.policy-grid span {
  color: var(--muted);
  font-size: 13px;
}

.empty {
  min-height: 112px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.form-panel {
  width: min(760px, 100%);
  margin: 26px auto 70px;
}

.form-head {
  padding: 24px;
  background: var(--brand-dark);
  color: #fff;
  border-bottom: 2px solid #35cf91;
}

.form-head h1 {
  margin: 0 0 8px;
  font-size: 23px;
}

.form-head p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
}

.form-body {
  padding: 24px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 16px;
  align-items: center;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bfcac3;
  padding: 10px 12px;
  background: #fff;
  outline: none;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 122, 80, 0.1);
}

.permission-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
}

.permission-grid label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.permission-grid label:nth-child(3n) {
  border-right: 0;
}

.permission-grid label:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #f0a38c;
  background: #fff4f1;
  color: #8a2419;
  line-height: 1.65;
  font-size: 13px;
}

.notice.neutral {
  border-color: #bdd8c9;
  background: #f3fbf7;
  color: #194b35;
}

.code-box {
  display: grid;
  gap: 12px;
  padding: 20px;
  background: #f8fbf9;
  border: 1px dashed #8ebba5;
}

.code {
  font-size: clamp(38px, 8vw, 64px);
  font-weight: 900;
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.session-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

.video-stage {
  position: relative;
  min-height: 430px;
  background: #0a0f0d;
  border: 1px solid #1b2a22;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.video-stage video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #0a0f0d;
}

.video-placeholder {
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
  padding: 20px;
}

.event-log {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.event-item {
  padding: 10px 12px;
  background: #f8faf8;
  border: 1px solid var(--line);
  color: #304139;
  font-size: 13px;
}

.event-item.error {
  border-color: #efb2a8;
  background: #fff4f1;
  color: #7b1d17;
}

.event-item pre,
.code-block {
  margin: 8px 0 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0d1a14;
  color: #e9fff5;
  font: 12px ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.code-block {
  margin: 0;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.command-form {
  display: grid;
  gap: 10px;
}

.command-form label {
  font-weight: 800;
  color: #27352e;
}

.command-form input,
.command-form textarea,
.command-form select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #bfcac3;
  padding: 9px 10px;
  background: #fff;
  outline: none;
}

.command-form textarea {
  min-height: 78px;
  resize: vertical;
}

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

.inline-check input {
  width: auto;
  min-height: auto;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.permission-tags span {
  padding: 7px 10px;
  border: 1px solid #bdd8c9;
  background: var(--brand-soft);
  color: #194b35;
  font-weight: 800;
  font-size: 13px;
}

.result-log {
  max-height: 520px;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

.plan-card {
  padding: 24px;
  display: grid;
  gap: 18px;
}

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

.plan-card h2 {
  margin: 0;
  font-size: 22px;
}

.price {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.price strong {
  font-size: 42px;
  line-height: 1;
}

.price span {
  color: var(--muted);
  margin-bottom: 6px;
}

.plan-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  color: #33443c;
}

.plan-card li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 900;
  margin-right: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(6, 12, 9, 0.45);
  z-index: 60;
}

.modal.open {
  display: flex;
}

.modal-box {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-box header,
.modal-box footer {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-box footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-box h2 {
  margin: 0;
}

.modal-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  font-size: 14px;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  padding: 13px 15px;
  background: #11231a;
  color: #fff;
  box-shadow: var(--shadow);
  display: none;
  z-index: 80;
}

.toast.show {
  display: block;
}

.login-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.login-line input {
  min-height: 40px;
  min-width: 250px;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.auth-page {
  min-height: calc(100vh - 74px);
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 40px 20px;
  background:
    linear-gradient(90deg, rgba(7, 14, 10, 0.88), rgba(7, 14, 10, 0.72)),
    url("https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
}

.auth-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.auth-tabs button {
  min-height: 52px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  background: var(--brand-soft);
}

.auth-body {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #27352e;
  font-weight: 700;
}

.auth-form input {
  min-height: 44px;
  border: 1px solid #bfcac3;
  padding: 10px 12px;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(8, 122, 80, 0.1);
}

@media (max-width: 920px) {
  .nav {
    width: min(100% - 28px, 1180px);
    min-height: auto;
    padding: 14px 0;
    align-items: flex-start;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
  }

  .hero {
    min-height: 760px;
  }

  .hero-metrics,
  .feature-grid,
  .stats,
  .policy-grid,
  .plans,
  .command-grid,
  .session-grid,
  .shell {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature:first-child,
  .policy-grid div {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .hero-metrics div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .field {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .permission-grid {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .permission-grid label,
  .permission-grid label:nth-child(3n),
  .permission-grid label:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .permission-grid label:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .page,
  .hero-inner,
  .feature-grid {
    width: min(100% - 24px, 1180px);
  }

  .nav {
    display: grid;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .page-title {
    display: grid;
  }

  .form-body,
  .form-head,
  .panel-body,
  .panel-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .video-stage {
    min-height: 260px;
  }
}
