:root {
  --bg: #eef4ee;
  --bg-strong: #dfeadf;
  --panel: rgba(255, 255, 248, 0.86);
  --panel-solid: #fffdf5;
  --ink: #17251f;
  --muted: #66746d;
  --line: rgba(23, 37, 31, 0.13);
  --green: #1f6f51;
  --green-dark: #134733;
  --cyan: #277b8f;
  --gold: #d8a441;
  --orange: #c06a2b;
  --red: #a4382f;
  --shadow: 0 24px 80px rgba(22, 51, 38, 0.14);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "LXGW WenKai", "Microsoft YaHei", "Noto Serif SC", "Songti SC", serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(216, 164, 65, 0.26), transparent 28rem),
    radial-gradient(circle at 84% 10%, rgba(39, 123, 143, 0.18), transparent 26rem),
    radial-gradient(circle at 72% 86%, rgba(31, 111, 81, 0.16), transparent 30rem),
    linear-gradient(135deg, #f7f1df 0%, #e7eee8 54%, #dbe8db 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(23, 37, 31, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 37, 31, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
}

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

a:hover {
  text-decoration: none;
}

button,
input {
  font: inherit;
}

textarea {
  width: 100%;
  border: 1px solid rgba(23, 37, 31, 0.16);
  border-radius: 18px;
  outline: 0;
  padding: 14px 16px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea:focus {
  border-color: rgba(31, 111, 81, 0.55);
  background: white;
  box-shadow: 0 0 0 5px rgba(31, 111, 81, 0.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: min(1180px, calc(100% - 32px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px auto 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 10px 12px 10px 14px;
  background: rgba(255, 255, 248, 0.72);
  box-shadow: 0 16px 46px rgba(22, 51, 38, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 900;
  letter-spacing: -0.04em;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 14px 30px rgba(31, 111, 81, 0.24);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: -0.03em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav a,
.ghost-button,
.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
}

.topnav a {
  color: var(--muted);
  transition: color 160ms ease, background 160ms ease;
}

.topnav a:hover {
  color: var(--ink);
  background: rgba(31, 111, 81, 0.08);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.ghost-button {
  border: 1px solid rgba(31, 111, 81, 0.2);
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.54);
}

.solid-button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 18px 36px rgba(31, 111, 81, 0.24);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.solid-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.solid-button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.solid-button.small {
  min-height: 42px;
}

.solid-button.wide {
  width: 100%;
  min-height: 56px;
  font-size: 18px;
}

.hero {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 26px;
  align-items: stretch;
  margin: 34px auto 0;
}

.hero-copy,
.login-card,
.feature-card,
.home-panel,
.metric-card,
.panel-card,
.plan-card,
.loading-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  padding: clamp(32px, 5vw, 62px);
}

.hero-copy::after {
  position: absolute;
  right: -110px;
  bottom: -130px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(31, 111, 81, 0.16);
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle, rgba(31, 111, 81, 0.18), transparent 58%),
    conic-gradient(from 210deg, rgba(216, 164, 65, 0.18), rgba(39, 123, 143, 0.14), transparent);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.eyebrow span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(31, 111, 81, 0.12);
}

.eyebrow.compact {
  margin: 0 0 8px;
}

.hero h1 {
  max-width: 720px;
  margin: 34px 0 18px;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-lead {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.9;
}

.hero-tags,
.hero-actions,
.login-links,
.header-actions,
.quick-actions,
.plan-actions,
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags {
  margin-top: 30px;
}

.hero-tags span,
.status-chip,
.user-chip,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
  background: rgba(31, 111, 81, 0.1);
}

.hero-actions {
  margin-top: 34px;
}

.login-card {
  align-self: stretch;
  padding: 30px;
}

.card-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.card-icon {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}

.card-icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.card-heading h2 {
  font-size: 30px;
  letter-spacing: -0.04em;
}

.card-heading p,
.feature-card p,
.home-panel p,
.panel-muted,
#page-subtitle {
  color: var(--muted);
  line-height: 1.7;
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(23, 37, 31, 0.16);
  border-radius: 18px;
  outline: 0;
  padding: 0 16px;
  color: var(--ink);
  font-size: 17px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
  border-color: rgba(31, 111, 81, 0.55);
  background: white;
  box-shadow: 0 0 0 5px rgba(31, 111, 81, 0.12);
}

.password-row {
  position: relative;
}

.password-row button {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 38px;
  border: 0;
  border-radius: 13px;
  padding: 0 12px;
  color: var(--green-dark);
  background: rgba(31, 111, 81, 0.1);
  transform: translateY(-50%);
  cursor: pointer;
}

.password-row input {
  padding-right: 76px;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.message.error,
.error-text {
  color: var(--red);
}

.message.success,
.success-text {
  color: var(--green-dark);
}

.login-links {
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.login-links a {
  color: var(--green-dark);
  font-weight: 900;
}

.section-grid {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 22px auto 0;
}

.feature-card {
  padding: 24px;
}

.feature-card span {
  display: inline-flex;
  margin-bottom: 24px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  background: rgba(216, 164, 65, 0.18);
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.home-panel {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr) auto;
  gap: 22px;
  align-items: center;
  margin: 22px auto 48px;
  padding: 28px;
}

.home-panel h2 {
  max-width: 580px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.05em;
}

.mini-plans {
  display: grid;
  gap: 10px;
}

.mini-plans article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.5);
}

.mini-plans strong {
  font-size: 16px;
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid rgba(23, 37, 31, 0.1);
  padding: 22px;
  background: rgba(255, 255, 248, 0.68);
  backdrop-filter: blur(20px);
}

.side-brand {
  margin-bottom: 24px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a {
  display: flex;
  min-height: 48px;
  align-items: center;
  border-radius: 16px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 900;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav a:hover,
.side-nav a.active {
  color: var(--green-dark);
  background: rgba(31, 111, 81, 0.1);
  transform: translateX(2px);
}

.sidebar-note {
  display: grid;
  gap: 6px;
  margin-top: auto;
  border: 1px solid rgba(216, 164, 65, 0.32);
  border-radius: 20px;
  padding: 16px;
  color: #5b4a24;
  background: rgba(255, 247, 224, 0.78);
}

.sidebar-note strong {
  color: var(--ink);
}

.sidebar-note span {
  font-size: 14px;
  line-height: 1.6;
}

.portal-main {
  width: min(1180px, calc(100% - 34px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.portal-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.portal-header h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.header-actions {
  justify-content: flex-end;
}

.status-chip {
  color: var(--cyan);
  background: rgba(39, 123, 143, 0.12);
}

.user-chip {
  color: var(--green-dark);
}

.portal-content {
  display: grid;
  gap: 18px;
}

.metrics-grid,
.cards-grid,
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.metric-card,
.panel-card,
.plan-card,
.loading-card {
  padding: 22px;
}

.metric-label {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.metric-value {
  margin-top: 10px;
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.metric-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.panel-card h2,
.plan-card h2 {
  margin-bottom: 8px;
  font-size: 26px;
  letter-spacing: -0.04em;
}

.panel-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.quick-actions {
  margin-top: 16px;
}

.quick-actions .ghost-button,
.quick-actions .solid-button,
.plan-actions .ghost-button,
.plan-actions .solid-button {
  min-height: 44px;
}

.notice-card {
  border: 1px solid rgba(216, 164, 65, 0.34);
  border-radius: 22px;
  padding: 18px 20px;
  color: #4f3f20;
  background: rgba(255, 247, 224, 0.84);
}

.notice-card strong {
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.42);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(23, 37, 31, 0.09);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

td {
  font-size: 15px;
}

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

.pill.error {
  color: var(--red);
  background: rgba(164, 56, 47, 0.1);
}

.empty {
  padding: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.plan-card {
  position: relative;
  overflow: hidden;
}

.plan-card.featured {
  border-color: rgba(31, 111, 81, 0.28);
  background:
    linear-gradient(145deg, rgba(31, 111, 81, 0.12), rgba(255, 255, 248, 0.9) 38%),
    var(--panel-solid);
}

.plan-card .badge {
  display: inline-flex;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 900;
  background: rgba(216, 164, 65, 0.18);
}

.plan-price {
  margin: 18px 0 8px;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.plan-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.plan-list li {
  color: var(--muted);
  line-height: 1.6;
}

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

.redeem-form {
  display: grid;
  max-width: 620px;
  gap: 14px;
}

.code-box {
  margin: 18px 0 14px;
  border: 1px dashed rgba(31, 111, 81, 0.38);
  border-radius: 18px;
  padding: 16px;
  color: var(--green-dark);
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 900;
  letter-spacing: 0.05em;
  overflow-wrap: anywhere;
  background: rgba(31, 111, 81, 0.08);
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.studio-page {
  width: min(1360px, calc(100% - 34px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.studio-form,
.studio-preview,
.studio-fields,
.stack-editor {
  display: grid;
  gap: 16px;
}

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

.image-picker {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.image-picker strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.image-preview {
  display: grid;
  min-height: 120px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(31, 111, 81, 0.3);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.image-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.file-button {
  position: relative;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.studio-preview {
  position: sticky;
  top: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.editor-row {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.42);
}

.danger-button {
  color: var(--red);
  border-color: rgba(164, 56, 47, 0.24);
  justify-self: start;
}

.check-row {
  align-items: center;
}

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

.check-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.studio-mini-hero {
  min-height: auto;
  padding: 28px;
}

.studio-mini-hero h1 {
  margin: 24px 0 14px;
  font-size: clamp(34px, 5vw, 54px);
}

.preview-brand {
  margin-bottom: 22px;
}

.studio-preview-plans {
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.preview-tabs .ghost-button {
  min-height: 38px;
}

.preview-tabs .ghost-button.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.studio-preview-stage {
  display: grid;
  gap: 16px;
}

.studio-preview-cards {
  width: 100%;
  grid-template-columns: 1fr;
  margin: 16px 0 0;
}

.studio-preview-cards .feature-card {
  box-shadow: none;
}

.preview-shell-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.preview-shell-card h1 {
  margin: 12px 0 10px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.06em;
  line-height: 1;
}

.studio-preview-metrics {
  grid-template-columns: 1fr;
}

.studio-preview-metrics .metric-card {
  box-shadow: none;
}

.studio-preview-notice {
  margin-top: 16px;
}

.step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.step span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.step strong {
  display: block;
  margin-bottom: 4px;
}

.step p {
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 980px) {
  .topnav {
    display: none;
  }

  .hero,
  .section-grid,
  .home-panel,
  .metrics-grid,
  .cards-grid,
  .plans-grid,
  .studio-grid,
  .image-tools {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: auto;
  }

  .home-panel {
    align-items: stretch;
  }

  .portal-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 37, 31, 0.1);
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav a {
    flex: 0 0 auto;
  }

  .sidebar-note {
    display: none;
  }

  .portal-header {
    flex-direction: column;
  }

  .studio-preview {
    position: relative;
    top: auto;
  }
}

@media (max-width: 560px) {
  .topbar {
    border-radius: 26px;
  }

  .top-actions .ghost-button {
    display: none;
  }

  .hero,
  .section-grid,
  .home-panel,
  .portal-main {
    width: min(100% - 22px, 1180px);
  }

  .hero-copy,
  .login-card,
  .feature-card,
  .home-panel,
  .metric-card,
  .panel-card,
  .plan-card {
    border-radius: 22px;
    padding: 22px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero-lead {
    font-size: 18px;
  }
}
