:root {
  color-scheme: light;
  --sage: #8eb7a0;
  --sage-dark: #557a65;
  --mint: #dceee5;
  --shell: #f8f5ef;
  --pearl: #fffdf8;
  --ink: #21312b;
  --muted: #697a72;
  --rose: #e7b7ad;
  --sky: #c9dfea;
  --gold: #d8b96a;
  --line: rgba(33, 49, 43, 0.12);
  --shadow: 0 24px 70px rgba(67, 93, 78, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(220, 238, 229, 0.92), transparent 30%),
    linear-gradient(135deg, #fbfaf6 0%, #eef6f1 52%, #f8f0ea 100%);
  min-height: 100vh;
}

body[data-theme="editorial"] {
  --sage: #a7b9c8;
  --sage-dark: #536f82;
  --mint: #e5edf2;
  --rose: #e2c5bd;
}

body[data-theme="compact"] {
  --sage: #91b8a6;
  --sage-dark: #365f4c;
  --mint: #d8eee3;
}

body[data-theme="compact"] .hero-panel {
  min-height: 440px;
}

body[data-theme="compact"] .revenue-card {
  min-height: 210px;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
.product-card,
.revenue-card,
.account-card,
.admin-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

button:hover,
.product-card:hover,
.revenue-card:hover,
.account-card:hover,
.admin-card:hover {
  transform: translateY(-2px);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 30px 22px;
  background: rgba(255, 253, 248, 0.78);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: linear-gradient(135deg, var(--sage-dark), var(--sage), var(--rose));
  box-shadow: 0 14px 34px rgba(85, 122, 101, 0.28);
}

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

.brand strong {
  font-size: 1.08rem;
}

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

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
  background: rgba(220, 238, 229, 0.68);
  border-color: rgba(142, 183, 160, 0.28);
}

.pet-switch {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: rgba(33, 49, 43, 0.05);
  border-radius: 12px;
}

.pet-chip,
.language-toggle {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
}

.pet-chip.active {
  color: var(--ink);
  background: var(--pearl);
  box-shadow: 0 10px 20px rgba(67, 93, 78, 0.1);
}

.language-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--pearl);
  color: var(--ink);
}

main {
  padding: 28px clamp(20px, 4vw, 54px) 64px;
}

.topbar,
.section-head.inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.topbar {
  margin-bottom: 28px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow,
.pill {
  margin: 0 0 8px;
  color: var(--sage-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 0.74rem;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.85rem, 3vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  font-size: 1.12rem;
}

p {
  color: var(--muted);
  line-height: 1.7;
}

.primary-action,
.ghost-action {
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.primary-action {
  color: white;
  background: var(--sage-dark);
  box-shadow: 0 18px 36px rgba(85, 122, 101, 0.24);
}

.primary-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action.dark {
  background: var(--ink);
}

.ghost-action {
  color: var(--ink);
  background: rgba(255, 253, 248, 0.74);
  border: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
}

.hero-panel {
  min-height: 560px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(320px, 1.15fr);
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: clamp(26px, 5vw, 56px);
  align-self: center;
}

.hero-copy h2 {
  font-size: clamp(1.75rem, 2.7vw, 2.9rem);
  margin-bottom: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero-photo {
  margin: 0;
  min-height: 100%;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.insight-panel,
.care-console,
.revenue-card,
.product-card {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(67, 93, 78, 0.12);
}

.insight-panel {
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 20px;
}

.pet-card {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pet-card img {
  width: 78px;
  height: 78px;
  border-radius: 8px;
  object-fit: cover;
}

.pet-card p,
.pet-card h3 {
  margin-bottom: 3px;
}

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

.score-ring {
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle at center, var(--pearl) 0 58%, transparent 59%),
    conic-gradient(var(--sage) 0 92%, rgba(33, 49, 43, 0.08) 92% 100%);
  animation: pulseRing 3s ease-in-out infinite;
}

.score-ring span {
  font-size: 4rem;
  font-weight: 800;
}

.score-ring small {
  color: var(--muted);
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mini-stats div {
  padding: 16px;
  border-radius: 8px;
  background: rgba(220, 238, 229, 0.6);
}

.mini-stats strong,
.mini-stats span {
  display: block;
}

.mini-stats strong {
  font-size: 1.7rem;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  margin: 54px 0 18px;
}

.section-head h2 {
  margin-bottom: 0;
}

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

.revenue-card {
  padding: 22px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.revenue-card.featured {
  background: linear-gradient(145deg, var(--ink), #3e5f4f);
  color: white;
}

.revenue-card.featured p,
.revenue-card.featured .card-icon {
  color: rgba(255, 255, 255, 0.72);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--sage-dark);
  background: rgba(220, 238, 229, 0.78);
  font-weight: 800;
  font-size: 0.76rem;
  margin-bottom: 24px;
}

.revenue-card strong {
  margin-top: auto;
  font-size: 1.45rem;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 5px;
  background: rgba(33, 49, 43, 0.06);
  border-radius: 12px;
}

.segmented button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
}

.segmented button.active {
  color: var(--ink);
  background: var(--pearl);
}

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

.product-card {
  overflow: hidden;
}

.product-card img,
.product-fallback {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
}

.product-card img {
  object-fit: cover;
}

.product-fallback {
  display: grid;
  place-items: center;
  color: var(--sage-dark);
  font-weight: 800;
  background: linear-gradient(135deg, var(--mint), var(--sky), #f4ded8);
}

.product-body {
  padding: 18px;
}

.product-meta,
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-meta span {
  color: var(--sage-dark);
  background: var(--mint);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.product-bottom {
  margin-top: 18px;
}

.product-bottom strong {
  font-size: 1.25rem;
}

.product-bottom button {
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 1.15rem;
}

.cyber-section {
  margin-top: 56px;
}

.cyber-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 16px;
}

.cyber-stage,
.cyber-panel {
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(67, 93, 78, 0.12);
}

.cyber-stage {
  min-height: 430px;
  padding: 26px;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
  position: relative;
}

.cyber-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(85, 122, 101, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.cyber-orbit {
  width: min(260px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 253, 248, 0.96) 0 44%, transparent 45%),
    conic-gradient(from 120deg, rgba(142, 183, 160, 0.12), rgba(201, 223, 234, 0.9), rgba(231, 183, 173, 0.72), rgba(142, 183, 160, 0.12));
  animation: orbitSpin 10s linear infinite;
}

.cyber-pet {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  color: white;
  font-size: 4.2rem;
  box-shadow: 0 24px 70px rgba(33, 49, 43, 0.24);
  animation: cyberFloat 3.4s ease-in-out infinite;
}

.cyber-pet[data-skin="aurora"],
.cyber-dot[data-pet="aurora"] {
  background: linear-gradient(135deg, #6fa88c, #b7d7c5, #e6b7c2);
}

.cyber-pet[data-skin="pixel"],
.cyber-dot[data-pet="pixel"] {
  background: linear-gradient(135deg, #536f82, #b4d3e0, #d8b96a);
}

.cyber-pet[data-skin="moon"],
.cyber-dot[data-pet="moon"] {
  background: linear-gradient(135deg, #8490c8, #c9dfea, #fffdf8);
}

.cyber-pet[data-skin="neon"],
.cyber-dot[data-skin="neon"] {
  background: linear-gradient(135deg, #23372f, #42d6a4, #93b7ff);
}

.cyber-pet[data-skin="pearl"],
.cyber-dot[data-skin="pearl"] {
  background: linear-gradient(135deg, #f7ece7, #dceee5, #c9dfea);
  color: var(--sage-dark);
}

.cyber-dot[data-skin="food"] {
  background: linear-gradient(135deg, var(--gold), var(--rose));
}

.cyber-stage h3 {
  margin-bottom: 6px;
  font-size: 2rem;
}

.cyber-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.cyber-stats span {
  padding: 12px;
  border-radius: 8px;
  background: rgba(220, 238, 229, 0.55);
}

.cyber-stats b,
.cyber-stats small {
  display: block;
}

.cyber-stats b {
  font-size: 1.35rem;
}

.cyber-stats small {
  color: var(--muted);
}

.cyber-panel {
  padding: 20px;
}

.cyber-list {
  display: grid;
  gap: 10px;
}

.cyber-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: rgba(220, 238, 229, 0.35);
  border: 1px solid transparent;
}

.cyber-row.active {
  border-color: rgba(85, 122, 101, 0.34);
  background: rgba(220, 238, 229, 0.72);
}

.cyber-dot {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 800;
}

.cyber-row strong,
.cyber-row small {
  display: block;
}

.cyber-row small {
  color: var(--muted);
  margin-top: 4px;
}

.cyber-row button {
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  padding: 9px 12px;
}

.commerce-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.commerce-strip article,
.account-card,
.admin-metrics article,
.admin-card {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(67, 93, 78, 0.1);
}

.commerce-strip article {
  padding: 20px;
}

.commerce-strip span,
.account-card span,
.admin-metrics span,
.admin-row span,
.admin-row em {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: normal;
}

.commerce-strip strong {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.care-section {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1fr);
  align-items: center;
  gap: 30px;
  padding: clamp(24px, 5vw, 50px);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(220, 238, 229, 0.8), rgba(255, 253, 248, 0.72)),
    url("https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?auto=format&fit=crop&w=1300&q=75") center right / 45% auto no-repeat;
}

.account-section {
  margin-top: 56px;
}

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

.account-card {
  min-height: 190px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-card strong {
  font-size: 1.6rem;
}

.account-card .ghost-action {
  margin-top: auto;
}

.admin-section {
  margin-top: 60px;
  padding: 26px;
  border-radius: 8px;
  background: rgba(33, 49, 43, 0.05);
  border: 1px solid var(--line);
}

.admin-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.admin-metrics article {
  padding: 18px;
}

.admin-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.2fr);
  gap: 16px;
}

.admin-card {
  padding: 20px;
}

.admin-card.wide {
  grid-row: span 2;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.86);
  outline: 0;
}

input:focus,
select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(142, 183, 160, 0.18);
}

.admin-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: rgba(220, 238, 229, 0.38);
}

.admin-row input {
  margin: 0;
}

.care-copy {
  max-width: 560px;
}

.care-console {
  padding: 22px;
  backdrop-filter: blur(18px);
}

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

.console-head span {
  font-weight: 800;
}

.console-head button {
  border: 1px solid var(--line);
  background: var(--pearl);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
}

.progress-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.progress-list label {
  display: grid;
  gap: 8px;
}

meter {
  width: 100%;
  height: 12px;
}

.checkout-modal {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--pearl);
  box-shadow: 0 30px 90px rgba(33, 49, 43, 0.25);
}

.checkout-modal::backdrop {
  background: rgba(33, 49, 43, 0.34);
  backdrop-filter: blur(6px);
}

.checkout-modal form {
  padding: 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(33, 49, 43, 0.06);
}

.modal-price {
  display: flex;
  align-items: end;
  gap: 8px;
  margin: 22px 0;
}

.modal-price strong {
  font-size: 3.5rem;
}

.payment-note {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--sage-dark);
  background: rgba(220, 238, 229, 0.62);
}

.full {
  width: 100%;
}

.tracking-timeline {
  display: grid;
  gap: 12px;
}

.tracking-timeline strong,
.tracking-timeline small {
  display: block;
}

.tracking-timeline small {
  color: var(--muted);
  margin-bottom: 10px;
}

.tracking-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(33, 49, 43, 0.05);
}

.tracking-step span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(33, 49, 43, 0.08);
}

.tracking-step.done span {
  color: white;
  background: var(--sage-dark);
}

.tracking-step p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px 16px;
  border-radius: 8px;
  color: white;
  background: var(--ink);
  box-shadow: 0 24px 60px rgba(33, 49, 43, 0.26);
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hero-panel,
.insight-panel,
.revenue-card,
.product-card,
.cyber-stage,
.cyber-panel,
.care-section,
.account-card {
  animation: riseIn 520ms ease both;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseRing {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(142, 183, 160, 0));
  }
  50% {
    filter: drop-shadow(0 16px 30px rgba(142, 183, 160, 0.26));
  }
}

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

@keyframes cyberFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-10px) rotate(2deg);
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
  }

  .pet-switch {
    margin-top: 0;
  }

  .hero-grid,
  .hero-panel,
  .care-section {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    min-height: 360px;
  }

  .revenue-grid,
  .product-grid,
  .cyber-grid,
  .commerce-strip,
  .account-grid,
  .admin-metrics,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .care-section {
    background: linear-gradient(120deg, rgba(220, 238, 229, 0.8), rgba(255, 253, 248, 0.72));
  }
}

@media (max-width: 680px) {
  main {
    padding: 20px 14px 42px;
  }

  .topbar,
  .section-head.inline {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }

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

  .revenue-grid,
  .product-grid,
  .cyber-grid,
  .mini-stats,
  .commerce-strip,
  .account-grid,
  .admin-metrics,
  .admin-grid,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .nav-links a {
    padding: 10px;
  }
}
