* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f6f9;
  color: #1f2329;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: #ffffff;
  border-bottom: 1px solid #eceff3;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.brand { font-size: 17px; font-weight: 700; color: #1f6feb; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 12px; border-radius: 8px; font-size: 15px; color: #555b66;
}
.nav a.active { color: #1f6feb; background: #eef4ff; font-weight: 600; }
.nav a.admin { color: #8a6d3b; background: #fbf3e3; margin-left: 6px; }

.app { max-width: 960px; margin: 0 auto; padding: 16px; min-height: calc(100vh - 56px - 48px); }
.foot { text-align: center; color: #aab0b8; font-size: 13px; padding: 16px; }

/* 通用卡片 */
.card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.05); margin-bottom: 14px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: #8a9099; font-size: 13px; }

/* 搜索 */
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input {
  flex: 1; padding: 11px 14px; border: 1px solid #dfe3e8; border-radius: 10px; font-size: 15px;
}
.btn {
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 15px; cursor: pointer;
  background: #1f6feb; color: #fff; white-space: nowrap;
}
.btn:disabled { background: #a9c4f5; cursor: not-allowed; }
.btn.ghost { background: #eef1f5; color: #1f2329; }
.btn.block { width: 100%; margin-top: 10px; }

/* 分类筛选 */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  background: #eef1f5; color: #555b66; border: 1px solid transparent;
}
.chip.active { background: #1f6feb; color: #fff; }

/* 文章列表 */
.article {
  display: block; padding: 14px 16px; background: #fff; border-radius: 12px;
  margin-bottom: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.04);
  border: 1px solid #f0f2f5; transition: .15s;
}
.article:hover { border-color: #cfe0ff; }
.article .t { font-size: 16px; font-weight: 600; }
.article .s { font-size: 13px; color: #8a9099; margin-top: 6px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article .m { font-size: 12px; color: #aab0b8; margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }

/* 详情 */
.detail .title { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.detail .meta { color: #8a9099; font-size: 13px; margin-bottom: 16px; }
.detail .summary { white-space: pre-wrap; line-height: 1.7; font-size: 15px; }
.pan { background: #fff7e6; border: 1px solid #ffe0a3; border-radius: 10px; padding: 12px 14px; margin-top: 14px; }
.pan code { background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid #f0d9a8; font-size: 14px; }
.section-title { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }

/* 会员套餐 */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.plan { background: #fff; border: 1px solid #eceff3; border-radius: 14px; padding: 18px; text-align: center; }
.plan .name { font-size: 17px; font-weight: 700; }
.plan .days { color: #1f6feb; font-weight: 600; margin: 8px 0; }
.plan .price { font-size: 24px; font-weight: 800; }
.plan .price small { font-size: 14px; font-weight: 500; }
.plan .btn { margin-top: 14px; width: 100%; }

/* 订单 */
.order { padding: 12px 14px; border: 1px solid #f0f2f5; border-radius: 10px; margin-bottom: 10px; }
.order .row { display: flex; justify-content: space-between; font-size: 14px; }
.order .st { font-weight: 700; }
.st.pending, .st.submitted { color: #d48806; }
.st.approved { color: #18a058; }
.st.rejected { color: #d03050; }

/* 智能体 */
.chat { display: flex; flex-direction: column; height: calc(100vh - 56px - 48px - 32px); }
.chat .box { flex: 1; overflow-y: auto; padding: 6px 2px; }
.msg { margin: 10px 0; display: flex; }
.msg .bubble { max-width: 80%; padding: 10px 14px; border-radius: 12px; line-height: 1.7; font-size: 15px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: #1f6feb; color: #fff; }
.msg.bot .bubble { background: #fff; border: 1px solid #eceff3; }
.msg.bot .bubble h3, .msg.bot .bubble h4 { margin: .4em 0; }
.msg.bot .bubble pre { background: #f4f6f9; padding: 10px; border-radius: 8px; overflow-x: auto; }
.msg.bot .bubble code { background: #f4f6f9; padding: 1px 5px; border-radius: 4px; }
.msg.bot .bubble ul, .msg.bot .bubble ol { padding-left: 20px; }
.chat .typing { color: #8a9099; font-size: 13px; padding: 4px 2px; }
.chat .input { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid #eceff3; }
.chat .input textarea {
  flex: 1; resize: none; height: 46px; padding: 10px 12px; border: 1px solid #dfe3e8;
  border-radius: 10px; font-size: 15px; font-family: inherit;
}

/* 登录 */
.login .field { margin-bottom: 12px; }
.login label { font-size: 14px; color: #555b66; display: block; margin-bottom: 6px; }
.login input {
  width: 100%; padding: 11px 14px; border: 1px solid #dfe3e8; border-radius: 10px; font-size: 15px;
}
.login .row { display: flex; gap: 10px; }
.login .row input { flex: 1; }
.login .tip { font-size: 13px; color: #d48806; margin-top: 8px; min-height: 18px; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: #fff; border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 14px; }
.modal img.qr { width: 200px; height: 200px; object-fit: contain; display: block; margin: 0 auto 10px; border: 1px solid #eee; border-radius: 10px; }
.modal .close { float: right; cursor: pointer; color: #aab0b8; font-size: 20px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: .2s; z-index: 200; pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: #aab0b8; padding: 40px 0; font-size: 14px; }
.center { text-align: center; }
.spin { text-align: center; color: #8a9099; padding: 30px 0; }

/* ===== 静态 SEO 页面 ===== */
.crumb { font-size: 13px; color: #8a9099; margin-bottom: 12px; }
.crumb a { color: #1f6feb; }
.crumb span { color: #555b66; }
.artlist, .catlist, .rel { list-style: none; margin: 0; padding: 0; }
.artlist li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 10px 2px; border-bottom: 1px solid #f2f4f7; }
.artlist li a { color: #1f2329; font-size: 15px; }
.artlist li a:hover { color: #1f6feb; }
.artlist li .muted { white-space: nowrap; font-size: 12px; }
.rel li { padding: 7px 0; border-bottom: 1px dashed #eef1f5; font-size: 14px; }
.rel li a { color: #1f6feb; }
.catlist li { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid #f2f4f7; font-size: 15px; }
.catlist li a { color: #1f2329; font-weight: 600; }
.catlist li.sub { padding-left: 18px; }
.catlist li.sub a { font-weight: 400; color: #555b66; }
.catlist li .muted { font-size: 13px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pager a, .pager .pcur { min-width: 34px; text-align: center; padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.pager a { background: #eef1f5; color: #555b66; }
.pager a:hover { background: #e0e7f2; }
.pager .pcur { background: #1f6feb; color: #fff; }
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 8px; }
.foot-links a { color: #8a9099; font-size: 13px; }
.foot-links a:hover { color: #1f6feb; }
.foot-copy { color: #aab0b8; font-size: 12px; }
