/* blog.css —— 前台样式。所有资源本地化，离线可用；正文最小字号 18px。 */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e3e6ee;
  --border-strong: #c9cedb;
  --text: #1c2230;
  --text-2: #3a4256;
  --muted: #7a8298;
  --primary: #3b5bdb;
  --primary-2: #2f4bc0;
  --danger: #d6336c;
  --shadow: 0 6px 24px rgba(20, 30, 60, .08);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

/* ---------- 订阅 ---------- */
.subscribe-page .page-title,
.checkout-page .page-title,
.orders-page .page-title,
.order-detail-page .page-title { font-size: 26px; margin: 8px 0 6px; }
.lead { color: var(--text-2); margin-bottom: 24px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin: 24px 0; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.plan-card .plan-label { font-size: 18px; color: var(--muted); }
.plan-card .plan-price { font-size: 30px; font-weight: 700; color: var(--primary); margin: 8px 0; }
.plan-card .plan-meta { color: var(--muted); margin-bottom: 16px; }
.subscribe-note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-top: 12px; }
.subscribe-note h3 { margin: 0 0 10px; font-size: 19px; }
.subscribe-note ul { margin: 0; padding-left: 22px; color: var(--text-2); }
.subscribe-note li { margin: 6px 0; }

.checkout-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; margin-top: 20px; align-items: start; }
@media (max-width: 820px) { .checkout-layout { grid-template-columns: 1fr; } }
.order-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; }
.order-summary .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.order-summary .row.total { border-bottom: none; font-size: 20px; }
.order-summary .price { color: var(--danger); font-weight: 700; }
.checkout-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-top: 16px; }
.checkout-form fieldset { border: none; padding: 0; margin: 0 0 18px; }
.checkout-form legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.checkout-form .radio { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; }
.checkout-form .hint { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.checkout-form textarea { width: 100%; min-height: 80px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; resize: vertical; }
.checkout-form input[type="file"] { font-size: 16px; }
.req { color: var(--danger); }
.checkout-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 16px; }
.checkout-side h3 { margin: 0 0 12px; font-size: 19px; }
.qr-box { text-align: center; margin-bottom: 16px; }
.qr-title { font-weight: 600; margin-bottom: 8px; }
.qr-img { max-width: 100%; width: 200px; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.qr-empty { color: var(--muted); background: var(--surface-2, #f0f2f8); padding: 12px; border-radius: 8px; margin-bottom: 16px; }
.account-note { color: var(--text-2); }
.pay-qr-box { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); text-align: center; }
.pay-qr-box h4 { margin: 0 0 10px; font-size: 16px; }
.pay-qr-img { width: 180px; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.pay-qr-box .muted { margin: 8px 0 0; font-size: 14px; }
.warn { color: #b8860b; background: #fff8e6; padding: 10px 12px; border-radius: 8px; font-size: 16px; }

.pay-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pay-method { display: block; border: 2px solid var(--border); border-radius: var(--radius); padding: 14px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pay-method:hover { border-color: var(--primary, #3b6cff); }
.pay-method:has(input:checked) { border-color: var(--primary, #3b6cff); box-shadow: 0 0 0 3px rgba(59,108,255,.12); }
.pay-method input[type=radio] { margin-right: 8px; }
.pay-method-head { font-weight: 600; font-size: 18px; }
.pay-method-body { display: block; text-align: center; margin-top: 10px; }
.pay-method-tip { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; }
.pay-info { display: block; white-space: pre-line; margin-top: 10px; padding: 10px 12px; background: var(--surface-2, #f0f2f8); border-radius: 8px; line-height: 1.7; }

.orders-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.orders-table th, .orders-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.orders-table th { background: var(--surface-2, #f0f2f8); font-size: 16px; }
.orders-table .price { color: var(--danger); font-weight: 600; }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; }
.status-pending { background: #fff4e0; color: #b8860b; }
.status-approved { background: #e6f7ec; color: var(--ok, #2b8a3e); }
.status-rejected { background: #fde8ef; color: var(--danger); }
.info-table { width: 100%; border-collapse: collapse; margin-top: 12px; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.info-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.info-table td:first-child { width: 120px; color: var(--muted); }
.proof-img { max-width: 280px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.badge-member { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #f59e0b, #ef4444); vertical-align: middle; margin-left: 4px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; font-size: 17px; }
.btn:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); color: #fff; }
.btn-block { width: 100%; text-align: center; margin-top: 6px; }

/* 提示条：错误 / 成功 */
.alert { padding: 11px 14px; border-radius: var(--radius); margin: 0 0 16px; font-size: 15px; line-height: 1.5; border: 1px solid transparent; }
.alert-error { background: #fdecea; border-color: #f5c2c0; color: #b42318; }
.alert-ok { background: #e7f6ec; border-color: #b6e2c6; color: #1a7f47; }


/* 表单（前台：注册 / 个人中心） */
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-narrow { max-width: 480px; margin: 0 auto; }
.form .reg-title { font-size: 24px; margin: 0 0 6px; }
.form label { display: block; font-size: 18px; color: var(--text-2); margin-bottom: 16px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form textarea, .form select {
  display: block; width: 100%; margin-top: 7px; padding: 11px 13px;
  font-size: 18px; font-family: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; outline: none;
}
.form input:focus, .form textarea:focus, .form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,91,219,.15); }
.form textarea { resize: vertical; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 22px; }
.card h2 { margin: 0 0 16px; font-size: 21px; }
.section-title { font-size: 21px; margin: 30px 0 14px; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;            /* 全局最小字号 18px */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 自适应：大屏限制舒适最大宽度并居中，不贴边；小屏占满 + 自适应边距 */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: clamp(16px, 5vw, 48px); padding-right: clamp(16px, 5vw, 48px); }

/* 头部 */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-size: 20px; font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; border-radius: 8px; display: block; }
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.nav-links a { color: var(--text-2); font-size: 18px; white-space: nowrap; }
.nav-search { display: flex; align-items: center; gap: 6px; }
.nav-search input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 15px; width: 150px; background: var(--bg); color: var(--text); }
.nav-search input:focus { outline: none; border-color: var(--primary, #2563eb); }
.nav-search button { border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 15px; background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.nav-search button:hover { color: var(--text); }

/* 搜索结果页 */
.search-form { display: flex; gap: 10px; margin: 8px 0 20px; }
.search-input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 16px; background: var(--bg); color: var(--text); }
.search-input:focus { outline: none; border-color: var(--primary, #2563eb); }
.search-count { color: var(--text-2); margin: 0 0 16px; }

/* 主体 */
.main { padding: clamp(28px, 4vw, 44px) 0 64px; min-height: 60vh; }
.page-title { font-size: clamp(24px, 4vw, 30px); margin: 0 0 24px; }

/* 文章列表（宽屏自适应多列） */
.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.post-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .15s ease;
}
.post-item:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.post-title { font-size: 23px; margin: 0 0 8px; }
.post-title a { color: var(--text); }
.post-meta { color: var(--muted); font-size: 18px; margin-bottom: 10px; }
.post-summary { color: var(--text-2); margin: 0; }
.post-summary.locked { color: var(--muted); font-style: italic; }
/* 表单中复选框行 */
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input[type="checkbox"] { width: auto; margin: 0; }

/* 付费墙（收费栏目未授权可见时） */
.locked-cover { filter: blur(8px); opacity: .55; }
.paywall { text-align: center; background: linear-gradient(135deg, #fff7ed, #fef2f2); border: 1px solid #fed7aa; border-radius: var(--radius); padding: 34px 28px; margin: 22px 0; }
.paywall-icon { font-size: 40px; line-height: 1; }
.paywall h3 { margin: 10px 0 8px; font-size: 22px; color: #b45309; }
.paywall p { color: var(--text-2); font-size: 17px; margin: 0 0 18px; }
.paywall .btn { margin: 0 6px; }

/* 栏目标签与栏目页头部 */
.cat-tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--surface-2, #eef1f8); color: var(--primary, #3b6cff); font-size: 15px; }
.cat-tag:hover { text-decoration: none; background: var(--primary, #3b6cff); color: #fff; }
.cat-head { margin-bottom: 18px; }
.cat-desc { color: var(--text-2); font-size: 18px; margin: 6px 0 0; }

/* 文章详情 */
.post-full { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 36px; box-shadow: var(--shadow); max-width: 1200px; margin: 0 auto; }
.post-cover { width: 100%; border-radius: var(--radius); margin: 18px 0; }
.post-body { font-size: 18px; line-height: 1.85; color: var(--text-2); }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; margin: 14px 0; }
.post-body pre { background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: 10px; overflow-x: auto; font-size: 18px; }
.post-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; }
.post-body :not(pre) > code { background: #eef1f8; color: #c0392b; padding: 2px 6px; border-radius: 6px; }
.post-body blockquote { border-left: 4px solid var(--primary); margin: 14px 0; padding: 6px 18px; color: var(--muted); background: #f4f6fc; border-radius: 0 8px 8px 0; }
.post-body video { max-width: 100%; border-radius: 10px; margin: 12px 0; }

.related { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 18px; }
.related h3 { font-size: 20px; margin: 0 0 12px; }
.related-list { margin: 0; padding-left: 22px; }
.related-list li { margin: 6px 0; }

.author-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; margin-bottom: 26px; box-shadow: var(--shadow); }
.author-card h1 { margin: 0 0 8px; font-size: clamp(22px, 4vw, 26px); }

.about p { font-size: 18px; color: var(--text-2); }

.back { margin-top: 28px; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 12px; margin-top: 28px; font-size: 18px; flex-wrap: wrap; justify-content: center; }
.pager a, .pager-current, .pager-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--text-1); text-decoration: none; transition: background .15s, border-color .15s; }
.pager a:hover { background: var(--surface); border-color: var(--accent); }
.pager-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; cursor: default; }
.pager-ellipsis { border: none; min-width: 18px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; font-size: 18px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 60px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; font-size: 18px; color: var(--muted); }
.footer-contact { display: inline-flex; align-items: center; gap: 8px; }
.footer-wx-img { height: 30px; width: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); cursor: pointer; }
.footer-wx-img:hover { transform: scale(1.05); }

/* ---------- 响应式断点 ---------- */
@media (max-width: 640px) {
  .orders-table, .info-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-side { position: static; }
}

@media (max-width: 600px) {
  .site-header .nav { flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 0; }
  .nav-links { gap: 16px; width: 100%; }
  .nav-search { width: 100%; }
  .nav-search input { flex: 1; width: auto; }
  .main { padding: 22px 0 48px; }
  .post-full { padding: 22px 16px; }
  .post-item { padding: 18px 18px; }
  .post-title { font-size: 21px; }
  .page-title { font-size: 24px; }
  .brand { font-size: 18px; }
}

@media (max-width: 420px) {
  .nav-links { gap: 12px; font-size: 16px; }
  .nav-links a { font-size: 16px; }
  .card, .form { padding: 18px 16px; }
  .pay-methods { grid-template-columns: 1fr; }
}

/* 超宽屏：增大留白与卡片最小宽度，避免内容过散、导航过挤 */
@media (min-width: 1600px) {
  .container { padding-left: clamp(24px, 6vw, 96px); padding-right: clamp(24px, 6vw, 96px); }
  .post-list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .nav-links { gap: 28px; }
  .nav-links a { font-size: 19px; }
}
