:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: #f5f6f8;
  color: #1e2430;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 14px 28px;
  background: #151922;
  color: white;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
}

.admin-nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.wrap {
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  background: white;
  border: 1px solid #e2e6ef;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 34px rgba(24, 31, 43, .08);
}

.narrow {
  width: min(420px, 100%);
}

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

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.brand-chip {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.brand-chip.active {
  border-color: #246bfe;
  box-shadow: 0 0 0 2px rgba(36, 107, 254, .12);
}

.brand-chip span {
  color: #667085;
  font-size: 13px;
}

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

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  margin: 34px 0 12px;
  font-size: 21px;
}

.muted {
  color: #667085;
}

.error {
  color: #c0362c;
  min-height: 20px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
  color: #303848;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #cdd5e1;
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: #1e2430;
  background: white;
}

textarea {
  resize: vertical;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: #246bfe;
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  background: #edf1f7;
  color: #1e2430;
}

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

.form-grid h1,
.form-grid .wide,
.form-grid .actions {
  grid-column: 1 / -1;
}

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

.check input {
  width: auto;
}

.actions {
  display: flex;
  gap: 12px;
}

.upload-box {
  border: 1px dashed #b8c4d6;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.upload-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 13px 10px;
  border-bottom: 1px solid #e7ebf2;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #667085;
  font-size: 13px;
}

code {
  background: #f0f3f8;
  padding: 3px 6px;
  border-radius: 5px;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

.asset-list {
  line-height: 2;
}

.public {
  --brand: #246bfe;
  background: #f4f7fb;
  min-height: 100vh;
}

.mobile-hero {
  padding: 20px max(18px, calc((100vw - 1040px) / 2)) 28px;
  color: white;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand), #111 25%), var(--brand));
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.mobile-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 14px;
}

.mobile-topbar strong {
  font-size: 18px;
}

.mobile-topbar span {
  opacity: .82;
}

.mobile-hero h1 {
  max-width: 760px;
  font-size: clamp(30px, 7vw, 52px);
  line-height: 1.15;
  margin-bottom: 12px;
}

.mobile-hero p {
  max-width: 760px;
  font-size: 16px;
  line-height: 1.65;
  opacity: .95;
}

.pill-action,
.quick-actions a,
.mail-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .16);
  color: white;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .25);
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.mobile-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.mobile-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.mobile-section h2 {
  margin-top: 0;
}

.step-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.step-list span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand), white 84%);
  color: var(--brand);
  font-weight: 900;
}

.step-list p {
  margin: 4px 0 0;
}

.contact-card {
  border-color: color-mix(in srgb, var(--brand), white 55%);
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form button {
  width: 100%;
}

.contact-form .mail-link {
  background: #eef2f7;
  color: #1e2430;
  border-color: #d9e0ea;
}

.success {
  border-radius: 8px;
  padding: 10px 12px;
  background: #ecfdf3;
  color: #067647;
  font-weight: 800;
}

.chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
}

.chat-bubble {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .24);
  background: var(--brand);
}

.chat-panel {
  width: min(360px, calc(100vw - 28px));
  max-height: 78vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  border-radius: 18px;
  padding: 14px;
  background: white;
  border: 1px solid #d8e0ec;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  animation: rise .18s ease-out;
}

.chat-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-close {
  width: 32px;
  min-height: 32px;
  border-radius: 50%;
  padding: 0;
  background: #eef2f7;
  color: #1e2430;
}

.chat-intro {
  color: #667085;
  font-size: 14px;
  line-height: 1.45;
}

.chat-messages {
  display: grid;
  gap: 8px;
  min-height: 120px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border-radius: 12px;
  background: #f6f8fb;
}

.buyer-chat {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e3e8f0;
}

.buyer-chat.admin {
  justify-self: end;
  color: white;
  background: var(--brand);
  border-color: var(--brand);
}

.buyer-chat span,
.chat-msg span {
  display: block;
  font-size: 11px;
  font-weight: 900;
  opacity: .7;
  text-transform: uppercase;
}

.buyer-chat p,
.chat-msg p {
  margin: 3px 0 0;
}

.chat-profile,
.chat-send,
.reply-form {
  display: grid;
  gap: 8px;
}

.chat-send {
  grid-template-columns: 1fr auto;
}

.chat-admin-grid {
  display: grid;
  gap: 16px;
}

.chat-admin-card {
  display: grid;
  gap: 12px;
  border: 1px solid #dfe6f0;
  border-radius: 12px;
  padding: 16px;
  background: white;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .06);
}

.chat-admin-card header {
  display: grid;
  gap: 3px;
}

.chat-admin-card header span,
.chat-admin-card header small {
  color: #667085;
}

.chat-log {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  border-radius: 10px;
  background: #f7f9fc;
}

.chat-msg {
  width: fit-content;
  max-width: min(680px, 92%);
  padding: 9px 11px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e3e8f0;
}

.chat-msg.admin {
  justify-self: end;
  color: white;
  background: #246bfe;
}

.chat-msg small {
  color: inherit;
  opacity: .72;
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 10px;
  background: white;
  border: 1px solid #dfe6f0;
}

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

.hero {
  padding: 44px max(24px, calc((100vw - 1040px) / 2)) 38px;
  color: white;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand), #111 18%), var(--brand));
}

.brandmark {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 26px;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(34px, 6vw, 58px);
  margin-bottom: 12px;
}

.hero p {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.7;
}

.public-list,
.content {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 58px;
}

.product-card {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid #e4e8f0;
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 14px;
  background: white;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.product-card strong {
  font-size: 20px;
}

.product-card span {
  color: #667085;
}

.cover {
  width: min(580px, 100%);
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 20px;
  border: 1px solid rgba(255, 255, 255, .35);
}

.content {
  font-size: 17px;
  line-height: 1.75;
}

.content ol {
  padding-left: 24px;
}

.video-grid, .image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.video-grid iframe,
.video-grid video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #111;
}

.image-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e4e8f0;
}

details {
  border: 1px solid #e4e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

summary {
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 720px) {
  .admin-nav {
    overflow-x: auto;
    padding: 12px 16px;
  }

  .page-head,
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .public-list,
  .content {
    width: min(100%, calc(100vw - 24px));
    padding-top: 14px;
  }

  .cover {
    width: 100%;
    max-height: 280px;
  }

  .video-grid,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .mobile-section {
    padding: 16px;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .chat-panel {
    width: calc(100vw - 24px);
  }
}
