:root {
  color-scheme: light;
  --ink: #171a1f;
  --muted: #656d78;
  --line: #e6e8ec;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --accent: #2f78ff;
  --accent-2: #ff7a1a;
  --gold: #bd7b14;
  --shadow: 0 14px 40px rgba(24, 29, 38, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: #eef4ff;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.notice {
  background: #e8efff;
  color: #4d68a8;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
}
.notice {
  border-bottom: 1px solid #d9e5ff;
}
.nav {
  max-width: 1180px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  overflow: hidden;
}
.brand-mark.has-image { background: #fff; border: 1px solid var(--line); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-links, .nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: #333b45;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
}
.nav-links a:hover { border-color: #ccd6e4; background: #f7f9fc; }
.user-pill {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fff;
  color: #2f3845;
  font-size: 13px;
}
.ghost, .solid {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
}
.solid {
  color: #fff;
  border-color: #111827;
  background: #111827;
}
.nav-actions .solid {
  color: #343b45;
  border-color: var(--line);
  background: #fff;
}

main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 52px; }
.hero {
  min-height: 390px;
  display: grid;
  align-items: center;
  gap: 34px;
}
.image-hero {
  border-radius: 8px;
  padding: 44px;
  background-position: center;
  background-size: cover;
  box-shadow: 0 18px 40px rgba(39, 88, 163, .14);
  color: #fff;
  overflow: hidden;
}
.image-hero .eyebrow,
.image-hero .lead {
  color: rgba(255,255,255,.86);
}
.image-hero .search-panel {
  box-shadow: 0 20px 50px rgba(0,0,0,.16);
}
.image-hero .hotwords button {
  background: rgba(255,255,255,.92);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0;
  font-size: 13px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 42px; line-height: 1.08; max-width: 680px; }
h2 { font-size: 28px; line-height: 1.2; }
.lead { max-width: 640px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.search-panel {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  max-width: 650px;
  margin-top: 28px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.compact-search {
  width: min(260px, 100%);
  grid-template-columns: minmax(110px, 1fr) 62px;
  margin-top: 0;
  padding: 4px;
  box-shadow: none;
}
.compact-search button { padding: 7px 9px; font-size: 13px; }
.search-panel input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 10px;
  background: transparent;
}
.search-panel button, .primary {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  padding: 12px 18px;
}
.hotwords { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.hotwords button, .sort, .category-tabs button, .category-more {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  color: #343b45;
  font-size: 13px;
}
.hotwords button, .sort, .category-tabs button, .category-more, .nav-actions button {
  position: relative;
  box-shadow: 0 3px 0 #cfd8e3;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.hotwords button:hover, .sort:hover, .category-tabs button:hover, .category-more:hover, .nav-actions button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #c1ccd9;
  border-color: #9aa9ba;
  background: #f9fbff;
}
.hotwords button:active, .sort:active, .category-tabs button:active, .nav-actions button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #cfd8e3;
}
.compact-strip {
  margin: 14px 0 30px;
}

.quick-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 42px;
}
.quick-strip a, .membership, .flow {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.quick-strip a { padding: 18px; display: grid; gap: 6px; }
.quick-strip span { color: var(--muted); font-size: 14px; }

.membership, .flow {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 24px;
  padding: 26px;
  margin-bottom: 42px;
}
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plans article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #fbfcfe;
}
.plans .accent { border-color: rgba(232,69,69,.35); background: #fff8f8; }
.plans span, .card-meta span { color: var(--muted); font-size: 13px; }
.plans strong { display: block; margin: 10px 0; font-size: 26px; }
.plans p, .flow span { margin: 0; color: var(--muted); line-height: 1.6; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}
.sorts, .category-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.sort.active, .category-tabs .active { border-color: #223047; background: #223047; color: #fff; box-shadow: 0 3px 0 #111827; }
.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(220px, 300px);
  gap: 8px;
  align-items: center;
  margin: 18px 0;
}
.category-area {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.category-tabs {
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-bottom: 0;
}
.category-tabs button { white-space: nowrap; }
.category-more {
  width: 104px;
  height: 31px;
  flex: 0 0 auto;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.product-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,0) 42%);
  opacity: 0;
  transition: opacity .24s ease;
}
.product-card:hover {
  transform: translateY(-8px);
  border-color: rgba(232,69,69,.24);
  box-shadow: 0 22px 56px rgba(24, 29, 38, .18);
}
.product-card:hover::after { opacity: 1; }
.media-wrap {
  position: relative;
  overflow: hidden;
  background: #dde3ea;
}
.product-card img,
.product-card video {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transition: transform .28s ease, opacity .2s ease;
}
.product-card video {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.product-card:hover img { transform: scale(1.055); }
.product-card:hover video { opacity: 1; transform: scale(1.055); }
.product-card:hover .product-title { color: var(--accent); }
.product-card:hover .card-actions .buy {
  transform: translateY(-2px);
  background: #0b111d;
  box-shadow: 0 10px 18px rgba(17,24,39,.18);
}
.product-body { padding: 12px; display: grid; gap: 10px; flex: 1; }
.product-title { font-size: 15px; line-height: 1.42; font-weight: 800; }
.product-summary { color: var(--muted); line-height: 1.65; font-size: 14px; min-height: 46px; }
.card-meta { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.price { color: var(--accent); font-size: 20px; font-weight: 900; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  color: #394150;
  background: var(--soft);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.card-actions.single { grid-template-columns: 1fr; }
.card-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
}
.card-actions .buy { background: #111827; border-color: #111827; color: #fff; }
.price-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.price-row span { color: var(--muted); font-size: 13px; }

.flow ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.flow li {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.dialog {
  width: min(980px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
.dialog::backdrop { background: rgba(17,24,39,.56); }
.dialog-inner { padding: 24px; display: grid; gap: 16px; }
.detail-dialog { width: min(980px, calc(100vw - 32px)); }
.auth-dialog { width: min(430px, calc(100vw - 32px)); }
.auth-dialog .dialog-inner { padding: 20px; }
.auth-dialog h2 { font-size: 22px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.detail-grid { display: grid; grid-template-columns: 450px minmax(0, 1fr); gap: 18px; }
.detail-grid img,
.detail-grid video { width: 100%; border-radius: 8px; background: #111827; }
.form-grid { display: grid; gap: 12px; }
.form-grid input, .form-grid textarea, .form-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}
.message { color: var(--accent-2); min-height: 20px; }
.option-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.option-tabs label {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.stepper {
  display: grid;
  grid-template-columns: 42px 80px 42px auto;
  gap: 8px;
  align-items: center;
}
.stepper button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
}
.stepper input { text-align: center; }
.pay-total {
  border: 1px solid #dce7ff;
  background: #f5f8ff;
  border-radius: 8px;
  padding: 12px;
  color: #174ea6;
  font-weight: 800;
}
.detail-extra {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.detail-extra h3 { margin: 0 0 10px; }
.rich-text { color: #394150; line-height: 1.8; }
.rich-text img {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.detail-images { display: grid; gap: 12px; margin-top: 12px; }
.detail-images img {
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pay-layout {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  align-items: start;
}
.pay-qr {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #fff;
}
.pay-qr.empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.pay-box {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfe;
}
.pay-box div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  align-items: center;
}
.pay-box span { color: var(--muted); font-size: 13px; }
.pay-box code {
  overflow-wrap: anywhere;
  color: #111827;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.address-row { grid-template-columns: 118px 1fr auto !important; }

.buyer-dialog { width: min(860px, calc(100vw - 32px)); }
.membership-dialog { width: min(1080px, calc(100vw - 32px)); }
.membership-dialog .dialog-inner { gap: 20px; }
.membership-catalog { display: grid; gap: 18px; }
.membership-login-note,
.membership-policy,
.empty-state {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: #f8fafc;
}
.membership-policy { font-size: 13px; line-height: 1.7; }
.membership-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.membership-plan-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.membership-plan-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 29, 38, .06);
}
.membership-plan-card.current { border-color: #8db5ff; box-shadow: 0 8px 24px rgba(47, 120, 255, .12); }
.membership-plan-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.membership-plan-head h3 { margin: 3px 0 0; font-size: 20px; }
.level-number { color: #526173; font-size: 12px; font-weight: 700; }
.membership-price { display: grid; min-width: max-content; text-align: right; }
.membership-price strong { color: #174ea6; font-size: 17px; }
.membership-price span { color: var(--muted); font-size: 12px; }
.level-description { margin: 0; color: #3e4856; line-height: 1.6; }
.membership-benefits { margin: 0; padding-left: 19px; color: #46515f; line-height: 1.7; font-size: 13px; }
.membership-benefits li + li { margin-top: 5px; }
.plan-description { margin: 0; padding-top: 10px; border-top: 1px solid var(--line); color: #4a5563; font-size: 13px; line-height: 1.6; }
.plan-description span { display: block; color: var(--muted); font-size: 12px; }
.membership-plan-card button { width: 100%; min-height: 40px; }
.membership-plan-card button:disabled { cursor: not-allowed; color: #7a8490; border-color: #d8dde4; background: #eef1f5; }
.buyer-membership { display: grid; gap: 14px; margin-bottom: 22px; }
.buyer-membership h3 { margin: 6px 0 0; font-size: 17px; }
.membership-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--line); }
.membership-summary > div { display: grid; gap: 5px; padding: 13px; background: #fff; }
.membership-summary span, .membership-plan span { color: var(--muted); font-size: 12px; }
.membership-plans, .member-entitlements { display: grid; gap: 9px; }
.membership-plan, .member-entitlement { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.membership-plan p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.membership-plan > div:nth-child(2) { display: grid; text-align: right; }
.member-free-box { padding: 14px; border: 1px solid #acd8c0; border-radius: 8px; background: #eefaf3; }
.member-free-box p { margin: 6px 0 0; color: var(--muted); }
.buyer-orders { display: grid; gap: 12px; }
.buyer-order {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfe;
}
.buyer-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.buyer-status-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}
.compact-pay { padding: 7px 10px; font-size: 13px; }
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.status.paid { color: #096b3d; background: #dff8eb; }
.status.pending { color: #a14705; background: #fff0d8; }
.download-link {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
}
.content-page {
  max-width: 960px;
  margin: 24px auto 44px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 28px 20px 42px;
  background: #fff;
}
.footer-custom {
  width: min(980px, 100%);
  text-align: center;
  line-height: 1.75;
}
.subscribe-form {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.subscribe-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
}
.subscribe-form button {
  min-width: 92px;
  box-shadow: 0 4px 0 #172033;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.subscribe-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #172033;
}
.subscribe-form button:disabled {
  opacity: .9;
  cursor: wait;
}
.subscribe-form .message { grid-column: 1 / -1; text-align: center; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
}
.footer-links a { color: #344b78; }

@media (min-width: 1081px) {
  .detail-dialog {
    width: calc(100vw - 100px);
    max-width: none;
  }
}

@media (max-width: 860px) {
  .nav { height: auto; padding: 14px 16px; flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .hero, .membership, .flow, .pay-layout { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  .product-grid, .quick-strip, .plans, .flow ol { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .search-panel { grid-template-columns: 1fr; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .compact-search { width: 100%; grid-template-columns: 1fr 76px; }
  .category-tabs { overflow-x: auto; }
  .subscribe-form { grid-template-columns: 1fr; }
  .membership-summary { grid-template-columns: 1fr; }
  .membership-plan-grid,
  .membership-plan-grid.compact { grid-template-columns: 1fr; }
  .membership-plan, .member-entitlement { grid-template-columns: 1fr; align-items: start; }
  .membership-plan > div:nth-child(2) { text-align: left; }
}
