:root {
  --ink: #142238;
  --muted: #6b7890;
  --line: #dfe6ef;
  --soft: #f5f8fc;
  --panel: #ffffff;
  --blue: #2f61d5;
  --blue-dark: #2147aa;
  --blue-soft: #eaf0ff;
  --teal: #0e8f84;
  --teal-soft: #e7f7f4;
  --amber: #a56600;
  --amber-soft: #fff4d8;
  --red: #b43c42;
  --red-soft: #fff0f0;
  --shadow: 0 12px 36px rgba(25, 49, 82, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: #f7f9fc;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #f7f9fc;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 97, 213, 0.2);
  outline-offset: 1px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  font-size: 16px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav button,
.account-button,
.text-button {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.nav button:hover,
.nav button.is-active,
.account-button:hover,
.text-button:hover {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 38px;
  padding: 0 15px;
  border-radius: 6px;
  transition: 160ms ease;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
}

.primary-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary-button:hover {
  border-color: #aebbd0;
  background: var(--soft);
}

.danger-button {
  color: var(--red);
  background: #fff;
  border: 1px solid #efc8ca;
}

.danger-button:hover {
  background: var(--red-soft);
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.icon-button:hover {
  color: var(--blue);
  border-color: #aebbd0;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: end;
  padding: 18px 0 42px;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero p {
  max-width: 640px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-side {
  padding: 18px 0 0;
}

.hero-side strong {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}

.hero-side p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.plan-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  padding: 23px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(25, 49, 82, 0.035);
}

.plan-card.is-featured {
  border-color: #9eb5ee;
  box-shadow: 0 11px 30px rgba(47, 97, 213, 0.13);
}

.plan-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-topline h3 {
  margin: 0;
  font-size: 20px;
}

.tag,
.status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.tag {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.status.success {
  color: var(--teal);
  background: var(--teal-soft);
}

.status.warning {
  color: var(--amber);
  background: var(--amber-soft);
}

.status.neutral {
  color: var(--muted);
  background: #edf1f5;
}

.status.danger {
  color: var(--red);
  background: var(--red-soft);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 25px 0 8px;
}

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

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

.plan-description {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 24px;
  padding: 0;
  color: #40516c;
  font-size: 13px;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.feature-list li::before {
  content: "✓";
  color: var(--teal);
  font-weight: 800;
}

.plan-card .primary-button,
.plan-card .secondary-button {
  width: 100%;
  margin-top: auto;
}

.stock-note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.info-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
  padding: 18px 20px;
  background: #eef5fb;
  border-top: 1px solid #d5e5f2;
  border-bottom: 1px solid #d5e5f2;
}

.info-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.info-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d4e2ef;
  border-radius: 6px;
  font-weight: 800;
}

.info-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 13px;
}

.info-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.page-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.page-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

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

.page-panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.orders-list {
  display: grid;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 110px 110px;
  gap: 14px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.order-row:last-child {
  border-bottom: 0;
}

.order-title {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 800;
}

.order-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.order-price {
  font-weight: 800;
}

.empty-state {
  padding: 60px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

.admin-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 95px;
  display: grid;
  gap: 5px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-sidebar button {
  padding: 11px 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}

.admin-sidebar button:hover,
.admin-sidebar button.is-active {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: #d9e4ff;
}

.admin-content {
  min-width: 0;
}

.admin-sessionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 15px;
  color: #36516b;
  background: #eef5fb;
  border: 1px solid #d5e5f2;
  border-radius: 6px;
  font-size: 12px;
}

.admin-sessionbar span {
  display: grid;
  gap: 3px;
}

.admin-sessionbar strong {
  color: var(--ink);
  font-size: 13px;
}

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

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

.metric {
  min-height: 120px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.metric-value {
  display: block;
  margin-top: 13px;
  font-size: 28px;
}

.metric-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.admin-section {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-section + .admin-section {
  margin-top: 16px;
}

.admin-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.admin-section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.editable-items {
  display: grid;
  gap: 10px;
}

.editable-item {
  display: grid;
  grid-template-columns: 32px minmax(150px, 0.75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.editable-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d4e2ef;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.table-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

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

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

.data-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

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

.data-table code,
.link-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

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

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 14px;
  color: #36536b;
  background: #f0f7fb;
  border: 1px solid #d7e8f2;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
}

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

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #43536c;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfd8e4;
  border-radius: 6px;
}

.field textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(20, 34, 56, 0.38);
}

.modal {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal.wide {
  width: min(700px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-header h2 {
  margin: 0;
  font-size: 21px;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.auth-switch {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.link-box {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.link-box code {
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.6;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 7px;
}

.payment-method {
  padding: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
}

.payment-method strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

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

.payment-method.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 97, 213, 0.12);
}

.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 28px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100% - 36px));
}

.toast {
  padding: 13px 15px;
  color: #fff;
  background: #1f2d43;
  border-radius: 6px;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.5;
}

.toast.success {
  background: var(--teal);
}

.toast.error {
  background: var(--red);
}

@media (max-width: 920px) {
  .topbar {
    padding: 0 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-side {
    padding-top: 0;
  }

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

  .plan-card {
    min-height: 0;
  }

  .info-band,
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(4, 1fr);
  }

  .admin-sidebar button {
    text-align: center;
  }
}

@media (max-width: 650px) {
  .topbar {
    min-height: 64px;
  }

  .nav {
    display: none;
  }

  .main {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

  .hero {
    padding-bottom: 28px;
  }

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

  .section-heading,
  .page-panel-header,
  .admin-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-band,
  .metric-grid,
  .form-grid,
  .payment-methods {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .order-row {
    grid-template-columns: 1fr 1fr;
  }

  .order-row > :first-child {
    grid-column: 1 / -1;
  }

  .admin-sidebar {
    grid-template-columns: repeat(2, 1fr);
  }

  .editable-item {
    grid-template-columns: 28px 1fr;
  }

  .editable-item .field {
    grid-column: 2;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
