:root {
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1f2329;
  --muted: #8a9099;
  --line: #e8eaed;
  --primary: #1f2329;
  --accent: #1677ff;
  --paid: #e8730c;
  --ok: #18a058;
  --danger: #d03050;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-weight: 600; font-size: 17px; color: var(--text); }
.topnav a { color: var(--text); margin-left: 18px; font-size: 14px; }

.main { padding-top: 16px; padding-bottom: 32px; min-height: calc(100vh - 200px); }

.hero { padding: 16px 0 8px; }
.hero h1 { margin: 0; font-size: 22px; }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 4px 14px; border-radius: 16px; background: var(--card); color: var(--text); font-size: 13px; border: 1px solid var(--line); }
.tabs a.on { background: var(--primary); color: #fff; border-color: var(--primary); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { background: var(--card); border-radius: var(--radius); margin-bottom: 12px; }
.post-link { display: flex; gap: 12px; padding: 16px; color: inherit; }
.post-body { flex: 1; min-width: 0; }
.post-title { margin: 0 0 6px; font-size: 17px; line-height: 1.45; }
.post-summary { margin: 0 0 8px; color: #555b63; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-cover { width: 108px; height: 76px; object-fit: cover; border-radius: 6px; flex: none; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 12px; }

.tag { padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 20px; }
.tag-paid { color: var(--paid); background: #fff3e6; }
.tag-free { color: var(--ok); background: #e9f7ef; }
.tag-draft { color: var(--muted); background: #f0f1f3; }

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 12px 0 0; font-size: 14px; }
.pager-btn { min-width: 36px; height: 36px; line-height: 34px; padding: 0 6px; text-align: center; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.pager-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.disabled { color: #c9cdd4; }
.pager-gap { color: var(--muted); padding: 0 2px; }
.pager-info { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.article { background: var(--card); border-radius: var(--radius); padding: 20px 18px 28px; }
.article-title { margin: 0 0 8px; font-size: 22px; line-height: 1.4; }
.article-cover { display: block; width: 100%; border-radius: 8px; margin: 16px 0 0; }

.md { word-wrap: break-word; }
.md h1, .md h2, .md h3 { line-height: 1.4; margin: 1.4em 0 .6em; }
.md h1 { font-size: 20px; } .md h2 { font-size: 18px; } .md h3 { font-size: 16px; }
.md p { margin: .8em 0; }
.md blockquote { margin: 1em 0; padding: 4px 14px; color: #555b63; border-left: 3px solid var(--line); background: #fafafa; }
.md pre { background: #f6f8fa; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.md :not(pre) > code { background: #f2f3f5; padding: 1px 5px; border-radius: 4px; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; }
.md img { border-radius: 6px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 24px 0 8px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }

.paywall { position: relative; margin-top: 8px; }
.paywall-fade { position: absolute; left: 0; right: 0; top: -80px; height: 80px; background: linear-gradient(rgba(255,255,255,0), #fff); pointer-events: none; }
.paywall-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; text-align: center; background: #fcfcfd; }
.paywall-title { margin: 0; font-weight: 600; }
.paywall-price { margin: 4px 0 14px; color: var(--paid); }
.paywall-price strong { font-size: 28px; }
.paywall-tip { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

.btn {
  display: inline-block; padding: 0 18px; height: 42px; line-height: 42px; border: 0; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 15px; cursor: pointer; text-align: center; -webkit-appearance: none;
}
.btn:disabled { background: #c9cdd4; cursor: not-allowed; }
.btn-alipay { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); line-height: 40px; }
.btn-block { display: block; width: 100%; margin-top: 10px; }

.check { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 8px 0; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.form-card { max-width: 420px; margin: 16px auto; }
.form-title { margin: 0 0 16px; font-size: 20px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; outline: none; background: #fff;
}
.field input:focus { border-color: var(--accent); }
.form-switch { text-align: center; font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.alert { background: #fff1f0; color: var(--danger); padding: 8px 12px; border-radius: 6px; font-size: 14px; }

.me-head { display: flex; justify-content: space-between; align-items: center; }
.me-head .btn { height: 34px; line-height: 32px; font-size: 13px; padding: 0 12px; }
.me-actions { display: flex; gap: 8px; }
.me-actions form { margin: 0; }
.me-name { margin: 0; font-size: 18px; font-weight: 600; }
.me-head p { margin: 0; }
.section-title { font-size: 16px; margin: 20px 0 10px; }
.order-list { list-style: none; padding: 0; margin: 0; }
.order-item { margin-bottom: 10px; padding: 14px 16px; }
.order-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.order-row + .order-row { margin-top: 4px; }
.order-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { flex: none; font-size: 13px; }
.status-paid { color: var(--ok); }
.status-pending { color: var(--paid); }
.status-refunded, .status-closed { color: var(--muted); }

.result { text-align: center; max-width: 420px; margin: 24px auto; padding: 28px 20px; }
.result h1 { font-size: 20px; margin: 8px 0; }
.result-icon { width: 56px; height: 56px; line-height: 56px; border-radius: 50%; margin: 0 auto; font-size: 28px; color: #fff; }
.result-icon.ok { background: var(--ok); }
.result-icon.wait { background: var(--paid); }
.result-icon.fail { background: #c9cdd4; }

.footer { border-top: 1px solid var(--line); background: var(--card); padding: 20px 0 28px; color: var(--muted); font-size: 12px; text-align: center; }
.footer p { margin: 4px 0; }
.footer a { color: var(--muted); }
.footer-links { margin-bottom: 8px; }
.footer-links a { margin: 0 8px; font-size: 13px; }

@media (min-width: 640px) {
  .post-cover { width: 150px; height: 100px; }
  .article { padding: 28px 32px 36px; }
  .article-title { font-size: 26px; }
}
.alert-ok { background: #e9f7ef; color: var(--ok); }
