:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --ink: #111321;
  --ink-soft: #4b4e61;
  --line: #d5d5cc;
  --brand: #0f8f83;
  --brand-deep: #0a6b62;
  --accent: #ed6a3c;
  --affiliate: #2656d8;
  --dropship: #12715a;
  --warn: #a23b00;
  --ok: #0f7b3b;
  --shadow-soft: 0 6px 18px rgba(15, 19, 33, 0.08);
  --shadow: 0 12px 28px rgba(15, 19, 33, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #fff6df 0, var(--bg) 40%),
    radial-gradient(circle at 90% 10%, #e8fbff 0, var(--bg) 38%), var(--bg);
  position: relative;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  filter: blur(12px);
  opacity: 0.35;
  animation: drift 10s ease-in-out infinite;
}

.bg-shape-a {
  width: 240px;
  height: 240px;
  background: #ffd57d;
  border-radius: 60% 40% 45% 55%;
  left: -40px;
  top: 120px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: #96efdd;
  border-radius: 55% 45% 52% 48%;
  right: -60px;
  bottom: 90px;
  animation-delay: -4s;
}

.topbar,
.nav-shell,
.app,
.footer {
  width: min(1120px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-top: 20px;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  text-decoration: none;
  color: var(--ink);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-sub {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-shell {
  margin-top: 16px;
  background: color-mix(in srgb, var(--surface), #f2efe3 48%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.nav-mobile-bar {
  display: none;
}

.nav-mobile-title {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 14px;
}

.nav-toggle {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  min-width: 92px;
  padding: 8px 12px;
  font-weight: 700;
}

.main-nav {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  min-height: 40px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-color: #ddd8ca;
}

.nav-btn.active {
  background: #fff;
  color: var(--ink);
  border-color: #d7d2c3;
  box-shadow: 0 2px 8px rgba(17, 19, 33, 0.07);
}

.app {
  margin-top: 18px;
  margin-bottom: 28px;
  animation: appear 0.34s ease;
}

.hero {
  background: linear-gradient(115deg, #0f8f83 0%, #0f8f83 30%, #ed6a3c 100%);
  color: #fff;
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.08;
  font-family: "Space Grotesk", sans-serif;
}

.hero p {
  margin: 0;
  opacity: 0.95;
  max-width: 800px;
}

.kpis {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.kpi {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  padding: 10px 12px;
}

.kpi strong {
  font-size: 24px;
  display: block;
}

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

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

.card,
.panel,
.feed-item,
.review-card,
.comment,
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 5px 20px rgba(17, 19, 33, 0.04);
}

.product-cover,
.detail-cover {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.product-cover {
  height: 180px;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
}

.product-card .type-tag {
  margin-bottom: 0;
}

.product-title,
.card-desc,
.card-audience,
.card-meta {
  margin: 0;
}

.product-title {
  line-height: 1.25;
}

.card-desc {
  font-size: 15px;
  line-height: 1.45;
  min-height: 44px;
}

.card-audience {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
  min-height: 38px;
}

.card-meta {
  color: var(--ink-soft);
  font-size: 13px;
}

.product-card .price {
  margin: 0;
}

.card-actions {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.card-actions button {
  flex: 1;
  min-height: 40px;
}

.detail-cover {
  max-height: 360px;
}

.type-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 8px;
  margin-bottom: 8px;
}

.type-tag.affiliate {
  color: #fff;
  background: var(--affiliate);
}

.type-tag.dropship {
  color: #fff;
  background: var(--dropship);
}

.price {
  color: var(--ok);
  font-weight: 800;
  margin: 6px 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

button,
.btn {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 12px;
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.primary,
.btn.primary {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

button.primary:hover,
.btn.primary:hover {
  background: var(--brand-deep);
}

button.warn,
.btn.warn {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

button.ghost,
.btn.ghost {
  background: transparent;
}

button.link-btn {
  background: transparent;
  border: none;
  color: var(--affiliate);
  padding: 2px;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
}

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

.section-head {
  margin: 22px 0 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-end;
}

h2,
h3,
h4,
h5 {
  margin: 0;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}

.warn-txt {
  color: var(--warn);
  font-size: 13px;
  margin: 0;
}

.ok-txt {
  color: var(--ok);
  font-size: 13px;
}

.inline-list {
  margin: 0;
  padding-left: 18px;
}

.split {
  display: grid;
  gap: 16px;
  grid-template-columns: 1.5fr 1fr;
}

.media-preview img,
.media-preview video,
.review-media img,
.review-media video {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.review-media img,
.review-media video {
  max-height: 300px;
  object-fit: cover;
}

.review-head,
.comment-head,
.feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.meta {
  color: var(--ink-soft);
  font-size: 12px;
}

.comment-thread {
  margin-top: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}

.comment.reply {
  margin-left: 18px;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f0f4f7;
  color: var(--ink-soft);
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ecefe9;
  overflow: hidden;
}

.progress-value {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 999px;
}

.coupon-code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f7fb;
  border: 1px dashed var(--line);
}

.coupon-code-blur {
  filter: blur(3px);
  user-select: none;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.modal {
  width: min(560px, calc(100% - 20px));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.modal::backdrop {
  background: rgba(13, 16, 25, 0.46);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.form-block.hidden,
.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 9;
  background: #111321;
  color: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.footer {
  color: var(--ink-soft);
  font-size: 12px;
  padding-bottom: 30px;
}

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

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(6deg);
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-direction: column;
  }

  .nav-shell {
    margin-top: 12px;
    background: color-mix(in srgb, var(--surface), #f2efe3 42%);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 8px;
  }

  .nav-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .nav-toggle[aria-expanded="true"] {
    background: #111321;
    color: #fff;
    border-color: #111321;
  }

  .main-nav {
    margin-top: 8px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .main-nav.expanded {
    display: grid;
  }

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

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

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

  .hero {
    padding: 24px;
  }
}

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

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