:root {
  --ink: #14181f;
  --muted: #6b7280;
  --line: #e7e7ee;
  --bg: #f5f5f8;
  --card: #ffffff;
  --accent: #e4552d;
  --accent-dark: #c84520;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(20, 24, 31, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
p { margin: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.brand-text { font-weight: 700; font-size: 16px; letter-spacing: .2px; }

.topnav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topnav .ghost { color: var(--muted); }
.topnav .pill {
  background: var(--ink);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.flash {
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff4ef;
  color: var(--accent-dark);
  font-size: 14px;
  border: 1px solid #ffd9c9;
}

.page { max-width: 1080px; margin: 0 auto; padding: 16px; }

.notice {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 14px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.hero {
  position: relative;
  overflow: hidden;
  margin: 4px 0 18px;
  padding: 26px 20px;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(228, 85, 45, .55) 0%, rgba(228, 85, 45, 0) 55%),
    linear-gradient(135deg, #171b23 0%, #2b2f3a 100%);
  color: #fff;
}
.hero h1 { font-size: 24px; letter-spacing: .3px; }
.hero p { margin-top: 8px; color: rgba(255, 255, 255, .72); font-size: 13.5px; max-width: 30em; }

.filters { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.filters a {
  padding: 7px 15px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
}
.filters a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(231, 231, 238, .7);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease;
}
.card:active { transform: scale(.985); }

.cover { position: relative; aspect-ratio: 4 / 3; background: #ececf2; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.tag {
  position: absolute; left: 9px; top: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 24, 31, .68);
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(4px);
}
.tag.solid { position: static; display: inline-block; background: #fff1ea; color: var(--accent-dark); font-weight: 600; }
.owned {
  position: absolute; right: 9px; top: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-body h3 {
  font-size: 14.5px;
  font-weight: 650;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.card-body p {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--accent-dark); font-weight: 700; font-size: 15px; }
.price.free, .free { color: #0f9d58; }
.more { font-size: 11.5px; color: var(--muted); }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
}
.empty.small { padding: 28px 16px; font-size: 14px; }
.empty a { color: var(--accent-dark); font-weight: 600; }

.detail { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.detail-cover { aspect-ratio: 16 / 10; background: #ececf2; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-head { padding: 18px 18px 6px; }
.detail-head h1 { margin: 10px 0 6px; font-size: 23px; }
.detail-head .sub { color: var(--muted); font-size: 14px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; }
.detail-price strong { font-size: 27px; color: var(--accent-dark); }
.detail-price strong.free { color: #0f9d58; }
.detail-price span { font-size: 12.5px; color: var(--muted); }

.panel { padding: 18px; border-top: 1px solid var(--line); }
.panel h2 { margin-bottom: 10px; font-size: 16px; }
.summary { color: #3d4450; font-size: 14.5px; }
.notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; display: grid; gap: 6px; }

.buybar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.buybar-info { display: flex; flex-direction: column; gap: 1px; }
.buybar-info .price { font-size: 20px; }
.buybar-info .hint { font-size: 11.5px; color: var(--muted); }
.buybar .ok { color: #0f9d58; font-weight: 700; }
.buybar form { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.block { width: 100%; }
.btn:active { transform: scale(.98); }

.auth {
  max-width: 420px;
  margin: 16px auto;
  background: #fff;
  padding: 26px 22px;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.auth h1 { font-size: 24px; }
.auth-sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
.form { display: grid; gap: 14px; margin-top: 20px; }
.form label, .admin-form label { display: grid; gap: 6px; font-size: 13.5px; color: #3d4450; }
.form input, .admin-form input[type=text], .admin-form input[type=number], .admin-form input[type=password],
.admin-form select, .admin-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfbfd;
  color: var(--ink);
  outline: none;
}
.form input:focus, .admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus { border-color: var(--accent); background: #fff; }
.auth-link { margin-top: 16px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-link a { color: var(--accent-dark); font-weight: 600; }
.alert {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f0;
  color: #b42318;
  font-size: 13.5px;
}

.profile { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.avatar {
  width: 56px; height: 56px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.profile h1 { font-size: 20px; }
.muted { color: var(--muted); font-size: 13px; }

.mylist { display: grid; gap: 10px; }
.myrow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.myrow img { width: 62px; height: 46px; object-fit: cover; border-radius: 9px; background: #ececf2; flex: none; }
.myrow div { display: grid; gap: 3px; min-width: 0; }
.myrow strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.myrow .go { margin-left: auto; font-size: 12.5px; color: var(--accent-dark); font-weight: 600; }

.table-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.table th, .table td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th { background: #fafafc; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.ok { color: #0f9d58; font-weight: 600; }
.warn { color: #b25e09; font-weight: 600; }

.reader { background: #fff; border-radius: 20px; padding: 22px 18px 26px; box-shadow: var(--shadow); }
.reader-head h1 { margin: 10px 0 6px; font-size: 24px; }
.reader-head .sub { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.player { margin: 16px 0; background: #000; border-radius: 14px; overflow: hidden; }
.player video { width: 100%; max-height: 70vh; display: block; }
.prose { font-size: 15.5px; color: #2b313b; margin-top: 18px; }
.prose h2 { margin: 22px 0 10px; }
.prose p { margin: 0 0 14px; }
.prose img { border-radius: 12px; margin: 12px 0; }
.prose blockquote { margin: 14px 0; padding: 10px 14px; background: #fafafc; border-left: 3px solid var(--accent); color: var(--muted); border-radius: 0 10px 10px 0; }
.reader-foot { margin-top: 28px; display: flex; gap: 10px; }

.pay-jump { max-width: 460px; margin: 28px auto; background: #fff; border-radius: 20px; padding: 30px 22px; text-align: center; box-shadow: var(--shadow); }
.pay-jump h1 { font-size: 20px; margin: 16px 0 6px; }
.spinner {
  width: 38px; height: 38px; margin: 0 auto;
  border: 4px solid #f1e4de;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result { max-width: 460px; margin: 28px auto; background: #fff; border-radius: 20px; padding: 34px 22px; text-align: center; box-shadow: var(--shadow); display: grid; gap: 12px; justify-items: center; }
.result-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.result-icon.ok { background: #e8f8ef; color: #0f9d58; }
.result-icon.warn { background: #fff4e5; color: #b25e09; }
.result-icon.wait { background: #eef1ff; color: #3b5bdb; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 2px 12px; }
.tabbar a.on { color: var(--ink); font-weight: 600; }
.tabbar svg { width: 22px; height: 22px; fill: currentColor; opacity: .85; }

.footer { text-align: center; color: #9aa1ac; font-size: 11.5px; padding: 26px 16px 34px; display: grid; gap: 4px; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .page { padding: 24px 24px 60px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .hero { padding: 40px 34px; }
  .hero h1 { font-size: 32px; }
  .detail { max-width: 820px; margin: 0 auto; }
  .reader { max-width: 820px; margin: 0 auto; }
  .tabbar { display: none; }
  .buybar { position: static; max-width: 820px; margin: 16px auto 0; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
  .buybar form { margin-left: auto; }
  .pay-jump, .result { margin-top: 48px; }
}

/* 合规与供稿 */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.legal-strip {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.legal-strip > div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.legal-strip strong { color: var(--ink); font-weight: 600; }
.legal-more { color: var(--accent-dark); font-weight: 600; }

.card-author { color: #9aa1ac !important; font-size: 11.5px !important; }
.byline { margin-top: 8px; font-size: 13px; color: var(--muted); }
.byline a { color: var(--accent-dark); font-weight: 600; }
.tag-entity {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2f2f7;
  color: var(--muted);
  font-size: 11px;
}
.report-link { margin-top: 12px; font-size: 12.5px; }
.report-link a { color: var(--muted); text-decoration: underline; }

.legal {
  background: #fff;
  border-radius: 20px;
  padding: 24px 20px 28px;
  box-shadow: var(--shadow);
  max-width: 820px;
  margin: 0 auto;
  color: #2b313b;
  font-size: 14.5px;
}
.legal h1 { font-size: 23px; margin-bottom: 6px; }
.legal h2 { margin: 24px 0 10px; font-size: 16px; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 7px; }
.legal li { color: #3d4450; }
.legal a { color: var(--accent-dark); font-weight: 600; }
.legal code { background: #f5f5f8; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.legal-meta { color: #9aa1ac; font-size: 12.5px; margin-top: 6px; }
.legal-back { margin-top: 24px; }
.legal-form { margin-top: 18px; }
.legal-form select, .legal-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fbfbfd;
  color: var(--ink);
  outline: none;
}
.legal-form textarea { resize: vertical; }
.ok-box {
  margin: 16px 0;
  padding: 14px 16px;
  background: #e8f8ef;
  border: 1px solid #bfe8d2;
  border-radius: 12px;
  color: #0b6b3a;
  font-size: 13.5px;
}
.ok-box p { margin: 6px 0 0; }

.agree {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.agree input { margin-top: 3px; flex: none; }
.agree a { color: var(--accent-dark); font-weight: 600; }

.checkout {
  background: #fff;
  border-radius: 20px;
  padding: 20px 18px 24px;
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.checkout h1 { font-size: 21px; }
.checkout-item { display: flex; gap: 12px; align-items: center; }
.checkout-item img { width: 84px; height: 64px; object-fit: cover; border-radius: 10px; background: #ececf2; flex: none; }
.checkout-item h2 { font-size: 15px; }
.checkout-item .price { margin-top: 4px; }
.checkout-rows { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13.5px; }
.checkout-rows > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.checkout-rows > div span:last-child { color: var(--ink); text-align: right; }
.checkout-rows .total span:first-child { color: var(--ink); font-weight: 600; }
.checkout-rows .total strong { color: var(--accent-dark); font-size: 20px; }
.checkout-notice h3 { font-size: 13.5px; margin: 0 0 8px; }
.checkout-notice ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 5px; }
.checkout-form { display: grid; gap: 14px; }
.checkout-foot { font-size: 12px; text-align: center; }
.checkout-agree {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.checkout-agree input { margin-top: 3px; flex: none; }
.checkout-agree a { color: var(--accent-dark); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.author-head { display: flex; align-items: center; gap: 14px; padding: 6px 2px 14px; }
.author-head h1 { font-size: 20px; }
.author-intro { background: #fff; border-radius: 16px; margin-bottom: 12px; }
.author-note { font-size: 12px; color: #9aa1ac; margin-bottom: 14px; }

.footer-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: #6b7280; }
.footer-legal { color: #9aa1ac; font-size: 11px; line-height: 1.7; }
.footer-legal a { color: #9aa1ac; text-decoration: underline; }

@media (min-width: 760px) {
  .legal { padding: 34px 40px 40px; }
  .checkout { max-width: 640px; padding: 28px 30px 32px; }
}

.mall-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(120deg, #111827, #374151);
  color: #fff;
  text-decoration: none;
}

.mall-entry-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e11d48, #fb7185);
  font-size: 13px;
  font-weight: 700;
}

.mall-entry-text {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.mall-entry-text strong {
  font-size: 15px;
}

.mall-entry-text small {
  color: #cbd5e1;
  font-size: 12px;
}

.mall-entry-go {
  flex: none;
  font-size: 13px;
  color: #f9fafb;
  opacity: .85;
}
