:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --ink: #111214;
  --muted: #6f7379;
  --line: #e8e9eb;
  --accent: #ff3158;
  --accent-dark: #e91943;
  --app-width: 540px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #eceef0;
  color: var(--ink);
  letter-spacing: 0;
  overscroll-behavior: none;
}

button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

body.modal-open { overflow: hidden; }

.app-shell {
  width: min(100%, var(--app-width));
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 32px rgb(17 18 20 / 8%);
  padding: calc(56px + env(safe-area-inset-top)) 0 calc(66px + env(safe-area-inset-bottom));
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  width: min(100%, var(--app-width));
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  transform: translateX(-50%);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgb(17 18 20 / 7%);
}

.brand {
  border: 0;
  background: transparent;
  padding: 0;
  justify-self: start;
  font-size: 21px;
  font-weight: 900;
}
.top-title { justify-self: center; font-size: 16px; }

.top-tabs { display: flex; gap: 25px; align-self: stretch; }
.top-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: #8a8d92;
  padding: 0;
  font-size: 16px;
  font-weight: 650;
}
.top-tab.active { color: var(--ink); }
.top-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 20px;
  height: 3px;
  transform: translateX(-50%);
  background: var(--accent);
  border-radius: 2px;
}

.icon-button, .viewer-icon, .modal-close {
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}
.icon-button { justify-self: end; }
.icon-button svg, .viewer-icon svg, .modal-close svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  background: #fff;
}

.video-card {
  position: relative;
  aspect-ratio: 3 / 4.4;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: #202124;
  color: white;
  text-align: left;
}
.video-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 320ms ease;
}
.video-card.locked img {
  filter: blur(7px) saturate(.62) brightness(.68);
  transform: scale(1.08);
}
.video-card::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(transparent, rgb(0 0 0 / 62%));
  pointer-events: none;
}
.video-card:active img { transform: scale(1.035); }
.card-meta {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 6px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: clamp(11px, 3.2vw, 14px);
  font-weight: 700;
  text-shadow: 0 1px 3px rgb(0 0 0 / 60%);
}
.card-meta svg { width: 15px; height: 15px; fill: white; }
.video-card.locked::before {
  content: "\9501\5b9a";
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  padding: 3px 6px;
  background: rgb(8 8 10 / 72%);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.feed-end {
  min-height: 76px;
  padding: 25px 32px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #a1a4aa;
  font-size: 12px;
}
.feed-end-center { display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 0 0 auto; }
.feed-end p { margin: 0; white-space: nowrap; }
.more-button {
  min-height: 32px;
  padding: 0 15px;
  border: 1px solid #d9dadd;
  border-radius: 5px;
  background: white;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.more-button:active { transform: scale(.97); }
.feed-end span { width: 100%; height: 1px; background: var(--line); }
.feed-end.paywall-trigger { cursor: pointer; color: var(--accent-dark); }

.account-summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-summary strong { font-size: 18px; }
.account-summary span, .account-content .muted { color: var(--muted); font-size: 13px; }
.account-tabs { display: flex; gap: 18px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px -24px 0; padding: 0 24px; }
.account-tab { border: 0; background: transparent; padding: 12px 0 10px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.account-tab.active { color: var(--ink); border-bottom: 2px solid var(--accent); }
.account-content { padding-top: 16px; min-height: 150px; }
.account-content p { line-height: 1.6; }
.expiry-reminder { color: var(--accent-dark); font-size: 13px; }
.account-content .text-button { display: block; margin: 16px auto 0; }
.account-video-list { display: grid; gap: 8px; max-height: 300px; overflow-y: auto; }
.account-video { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 7px 0; background: transparent; text-align: left; }
.account-video img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; }
.account-video span { font-size: 13px; line-height: 1.4; }
.account-content textarea { width: 100%; min-height: 120px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: inherit; margin: 8px 0 12px; }
.renew-option { display: flex; align-items: center; gap: 8px; padding: 12px 0; color: var(--muted); font-size: 13px; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, var(--app-width));
  height: calc(66px + env(safe-area-inset-bottom));
  padding: 5px 8px env(safe-area-inset-bottom);
  transform: translateX(-50%);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}
.nav-item {
  min-width: 0;
  height: 55px;
  padding: 5px 0 2px;
  border: 0;
  background: transparent;
  color: #74777c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10px;
}
.nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: #111214; font-weight: 700; }
.nav-icon-wrap { position: relative; line-height: 0; }
.nav-icon-wrap i { position: absolute; right: -4px; top: -2px; width: 7px; height: 7px; background: var(--accent); border: 1.5px solid white; border-radius: 50%; }
.create-button {
  width: 47px;
  height: 32px;
  justify-self: center;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(90deg, #20d7d0 0 18%, #151619 18% 82%, #ff3158 82%);
  box-shadow: inset 0 0 0 2px white;
}
.create-button svg { width: 20px; height: 20px; fill: none; stroke: white; stroke-width: 2.3; }

.retry-button {
  position: fixed;
  z-index: 30;
  left: calc(50% + min(50vw, var(--app-width) / 2) - 78px);
  bottom: calc(78px + env(safe-area-inset-bottom));
  min-width: 66px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 6px;
  background: rgb(17 18 20 / 86%);
  backdrop-filter: blur(10px);
  color: white;
  box-shadow: 0 5px 18px rgb(0 0 0 / 18%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}
.retry-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.retry-button:active { transform: scale(.97); }

.viewer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: none;
  background: #000;
}
.viewer.open { display: block; }
.viewer-stage {
  position: relative;
  width: min(100%, var(--app-width));
  height: 100dvh;
  margin: auto;
  overflow: hidden;
  background: #060606;
  touch-action: none;
}
#activeVideo { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer-stage.switching #activeVideo { animation: videoSwitch 180ms ease; }
@keyframes videoSwitch {
  0% { opacity: .48; transform: scale(.985); }
  100% { opacity: 1; transform: scale(1); }
}
.video-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgb(0 0 0 / 28%), transparent 20%, transparent 56%, rgb(0 0 0 / 72%)); }
.viewer-header {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  min-height: calc(60px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  color: white;
}
.viewer-header .viewer-icon:last-child { justify-self: end; }
.viewer-tabs { display: flex; align-items: center; gap: 22px; color: rgb(255 255 255 / 65%); font-size: 16px; }
.viewer-tabs strong { color: white; position: relative; }
.viewer-tabs strong::after { content: ""; position: absolute; width: 18px; height: 3px; border-radius: 2px; background: white; left: 50%; bottom: -8px; transform: translateX(-50%); }
.play-indicator {
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  width: 72px;
  height: 72px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 35%);
  opacity: 0;
  transition: opacity 160ms ease;
}
.play-indicator.visible { opacity: 1; }
.play-indicator svg { width: 34px; fill: white; }
.social-rail { position: absolute; z-index: 4; right: 10px; bottom: calc(105px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 17px; align-items: center; }
.avatar-button { width: 48px; height: 48px; padding: 0; border: 2px solid white; border-radius: 50%; background: #333; position: relative; }
.avatar-button img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-button i { position: absolute; left: 50%; bottom: -8px; width: 19px; height: 19px; transform: translateX(-50%); border-radius: 50%; background: var(--accent); color: white; font-style: normal; font-size: 17px; line-height: 17px; }
.social-button { width: 54px; min-height: 51px; padding: 0; border: 0; background: transparent; color: white; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-shadow: 0 1px 2px #000; }
.social-button svg { width: 34px; height: 34px; fill: rgb(255 255 255 / 96%); stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 30%)); }
.social-button.liked svg { fill: var(--accent); stroke: var(--accent); transform: scale(1.08); }
.video-copy { position: absolute; z-index: 4; left: 14px; right: 76px; bottom: calc(28px + env(safe-area-inset-bottom)); color: white; text-shadow: 0 1px 3px #000; }
.video-copy strong { font-size: 16px; }
.video-copy p { margin: 8px 0; font-size: 14px; line-height: 1.55; }
.sound-line { display: flex; align-items: center; gap: 6px; font-size: 12px; overflow: hidden; }
.sound-line svg { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: white; stroke-width: 2; }
.sound-line span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viewer-progress { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 2px; background: rgb(255 255 255 / 20%); }
.viewer-progress span { display: block; height: 100%; width: 0; background: white; }
.swipe-tip { position: absolute; z-index: 5; left: 50%; top: 72%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; color: white; font-size: 12px; text-shadow: 0 1px 3px #000; animation: tipFloat 1.25s ease-in-out infinite; }
.swipe-tip.visible { display: flex; }
.swipe-tip svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; }
@keyframes tipFloat { 50% { transform: translate(-50%, -8px); } }

.modal-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgb(14 15 18 / 68%);
  backdrop-filter: blur(9px);
}
.modal-layer.visible { display: grid; }
.modal-card {
  position: relative;
  width: min(100%, 410px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  padding: 30px 24px 22px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}
.login-card { padding-top: 34px; }
.logo-mark { position: relative; width: 43px; height: 43px; margin-bottom: 25px; background: #111214; border-radius: 7px; overflow: hidden; }
.logo-mark span { position: absolute; width: 22px; height: 7px; border-radius: 1px; transform: rotate(-43deg); }
.logo-mark span:first-child { left: 4px; top: 13px; background: #27d8cf; }
.logo-mark span:last-child { right: 4px; bottom: 12px; background: var(--accent); }
.logo-mark.small { width: 48px; height: 48px; margin: 0 auto; }
.eyebrow { margin: 0 0 4px; color: #8a8d92; font-size: 13px; }
.modal-card h1 { margin: 0; font-size: 31px; line-height: 1.18; }
.modal-intro { margin: 12px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }
form label { display: block; margin: 15px 0 7px; font-size: 13px; font-weight: 700; }
.phone-field, .code-field { height: 50px; display: flex; align-items: center; border: 1px solid #dfe1e4; border-radius: 6px; background: #fafafa; overflow: hidden; }
.phone-field:focus-within, .code-field:focus-within { border-color: #555b63; box-shadow: 0 0 0 3px rgb(17 18 20 / 6%); }
.phone-field span { padding: 0 13px; border-right: 1px solid #dedfe2; font-weight: 700; font-size: 14px; }
.phone-field input, .code-field input { min-width: 0; width: 100%; height: 100%; padding: 0 13px; border: 0; outline: 0; background: transparent; font-size: 15px; }
.code-field button { flex: 0 0 auto; height: 32px; margin-right: 8px; border: 0; background: transparent; color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.code-field button:disabled { color: #a8aaae; }
.form-message { min-height: 19px; margin: 8px 0 0; color: var(--accent-dark); font-size: 12px; }
.form-message.success { color: #168765; }
.primary-button { width: 100%; min-height: 50px; border: 0; border-radius: 6px; background: var(--ink); color: white; font-weight: 750; transition: transform 100ms ease, background 150ms ease; }
.primary-button:active { transform: scale(.985); }
.primary-button:disabled { background: #a7a9ad; cursor: default; }
.terms { margin: 17px 0 0; text-align: center; color: #999ca1; font-size: 10px; line-height: 1.5; }
.modal-close { position: absolute; right: 11px; top: 11px; color: #555960; }
.paywall-card { padding-top: 36px; text-align: center; }
.limit-badge { display: inline-flex; height: 34px; padding: 0 12px; align-items: center; border-radius: 17px; background: #fff0f3; color: var(--accent-dark); font-size: 13px; font-weight: 800; }
.paywall-card h2 { margin: 14px 0 7px; font-size: 24px; }
.paywall-card > p { margin: 0 auto 21px; color: var(--muted); font-size: 14px; }
.price-row { min-height: 72px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; background: #f5f6f7; border: 1px solid #e4e5e7; border-radius: 7px; text-align: left; }
.price-row span { font-size: 14px; font-weight: 700; }
.price-row strong { color: var(--accent-dark); font-size: 29px; }
.price-row small { margin-right: 2px; font-size: 15px; }
.benefit-list { margin: 20px 0; padding: 0; list-style: none; text-align: left; display: grid; gap: 11px; color: #42454a; font-size: 13px; }
.benefit-list li { display: flex; gap: 9px; align-items: center; }
.benefit-list i { width: 17px; height: 17px; border-radius: 50%; background: #e8f7f3; position: relative; }
.benefit-list i::after { content: ""; position: absolute; width: 6px; height: 3px; border-left: 2px solid #159675; border-bottom: 2px solid #159675; transform: rotate(-45deg); left: 5px; top: 5px; }
.pay-button { display: flex; justify-content: center; align-items: center; gap: 6px; background: var(--accent); }
.pay-button svg { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 2; }
.text-button { min-height: 40px; margin-top: 5px; border: 0; background: transparent; color: #85888e; font-size: 13px; }
.catalog-card { padding-top: 36px; text-align: center; }
.catalog-card h2 { margin: 14px 0 7px; font-size: 24px; }
.catalog-card > p { margin: 0 auto 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.catalog-link { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 14px; color: white; background: var(--accent); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; text-decoration: none; }

.payment-page { padding: 0; background: #f4f5f6; backdrop-filter: none; }
.payment-sheet { width: min(100%, var(--app-width)); height: 100dvh; margin: auto; padding-bottom: calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; background: #f4f5f6; }
.payment-sheet > header { height: calc(58px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: white; border-bottom: 1px solid var(--line); }
.payment-sheet header h2 { margin: 0; font-size: 17px; }
.viewer-icon.dark { color: #202226; }
.merchant { padding: 35px 20px 27px; background: white; text-align: center; }
.merchant p { margin: 12px 0 4px; color: #666a70; font-size: 13px; }
.merchant strong { font-size: 38px; }
.merchant small { margin-right: 3px; font-size: 19px; }
.order-block, .payment-methods { margin-top: 10px; padding: 5px 18px; background: white; }
.order-block div { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #eff0f1; font-size: 13px; }
.order-block div:last-child { border-bottom: 0; }
.order-block span { color: #85888d; }
.order-block strong { font-weight: 600; text-align: right; }
.payment-methods > p { margin: 13px 0 5px; color: #85888d; font-size: 12px; }
.payment-methods label { min-height: 57px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #eff0f1; }
.payment-methods label:last-child { border-bottom: 0; }
.pay-icon { width: 31px; height: 31px; display: grid; place-items: center; color: white; border-radius: 7px; font-weight: 900; }
.pay-icon.wechat { background: #19bd72; }
.pay-icon.alipay { background: #1677ff; }
.payment-methods strong { flex: 1; font-size: 14px; }
.payment-methods input { position: absolute; opacity: 0; }
.payment-methods i { width: 19px; height: 19px; border: 1.5px solid #babdc1; border-radius: 50%; }
.payment-methods input:checked + i { border: 5px solid #20ad72; }
.demo-note { margin: 15px 20px; color: #999ca1; text-align: center; font-size: 11px; }
.confirm-pay { width: calc(100% - 36px); margin: 0 18px; background: #16aa68; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: calc(100% - 40px); padding: 10px 14px; transform: translate(-50%, 16px); border-radius: 5px; background: rgb(17 18 20 / 90%); color: white; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .modal-layer { padding: 28px; }
  .payment-page { background: rgb(14 15 18 / 68%); backdrop-filter: blur(9px); }
  .payment-sheet { height: min(760px, calc(100dvh - 56px)); border-radius: 8px; overflow: hidden auto; box-shadow: 0 24px 70px rgb(0 0 0 / 28%); }
}

@media (max-width: 360px) {
  .brand { font-size: 18px; }
  .top-tabs { gap: 18px; }
  .modal-card { padding-left: 19px; padding-right: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
