:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #eaf2fe;
  --text: #222;
  --muted: #888;
  --bg: #f4f6f5;
  --card: #fff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-y: scroll;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
}

.hidden {
  display: none !important;
}

/* 顶部栏 */
.topbar {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}
.logo-fallback {
  font-size: 30px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 5px;
}
.site-title {
  font-size: 19px;
  font-weight: 700;
}
.site-slogan {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

/* 视图 */
.view {
  padding-bottom: 70px;
}

/* 轮播 */
.banner-swiper {
  position: relative;
  overflow: hidden;
  max-height: 260px;
  background: #ddd;
}
.swiper-track {
  display: flex;
  transition: transform 0.4s ease;
}
.swiper-track .slide {
  min-width: 100%;
}
.swiper-track .slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.swiper-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.swiper-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}
.swiper-dots .dot.active {
  background: #fff;
  width: 18px;
  border-radius: 4px;
}

/* 搜索 */
.search-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
}
.search-bar input {
  flex: 1;
  border: 1px solid #e2e2e2;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.search-bar input:focus {
  border-color: var(--primary);
}
.search-bar button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 0 20px;
  font-size: 14px;
  cursor: pointer;
}

/* 联系方式入口（首页） */
.contact-entry {
  margin: 0 16px 14px;
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.contact-entry-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.contact-entry-title {
  font-size: 15px;
  font-weight: 700;
}
.contact-entry-sub {
  font-size: 12px;
  color: var(--muted);
}
.contact-entry-form {
  display: flex;
  gap: 8px;
}
.contact-entry-form input {
  flex: 1;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
}
.contact-entry-form input:focus {
  border-color: var(--primary);
}
.contact-entry-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 0 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

/* 文章列表 */
.article-list {
  padding: 0 16px;
}
.article-list.loading {
  min-height: 50vh;
}
.list-loading {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 32px 0;
}
.article-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}
.article-card .cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #eee;
}
.article-card .body {
  padding: 12px 14px;
}
.article-card .title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .summary {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .footer {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.list-tip {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
}
.load-more {
  display: block;
  margin: 0 auto 20px;
  border: 1px solid var(--primary);
  color: var(--primary);
  background: #fff;
  border-radius: 20px;
  padding: 8px 28px;
  font-size: 14px;
  cursor: pointer;
}

/* 详情 */
.back-btn {
  display: block;
  margin: 12px 16px 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 0;
}
.detail-body {
  background: #fff;
  margin: 12px 16px;
  padding: 18px 16px;
  border-radius: 12px;
}
.detail-title {
  font-size: 20px;
  line-height: 1.4;
}
.detail-meta {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.detail-content {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.8;
  word-break: break-word;
}
.detail-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}
.detail-content p {
  margin-bottom: 10px;
}

.action-bar {
  display: flex;
  justify-content: center;
  margin: 16px;
}
.like-btn {
  border: 1px solid #f0a0a0;
  background: #fff;
  color: #d9534f;
  border-radius: 24px;
  padding: 9px 30px;
  font-size: 15px;
  cursor: pointer;
}
.like-btn.liked {
  background: #d9534f;
  color: #fff;
}

/* 评论 */
.comment-section {
  margin: 0 16px 20px;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}
.comment-section h3 {
  font-size: 15px;
  margin-bottom: 12px;
}
.comment-total {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}
.comment-form input,
.comment-form textarea,
.contact-form-section input,
.contact-form-section textarea {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  margin-bottom: 10px;
  outline: none;
  resize: none;
  font-family: inherit;
}
.comment-form input:focus,
.comment-form textarea:focus,
.contact-form-section input:focus,
.contact-form-section textarea:focus {
  border-color: var(--primary);
}
.comment-form button,
.contact-form-section button {
  width: 100%;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
  cursor: pointer;
}
.comment-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child {
  border-bottom: none;
}
.comment-item .head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.comment-item .nickname {
  font-weight: 600;
}
.comment-item .time {
  color: var(--muted);
  font-size: 12px;
}
.comment-item .content {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
}
.comment-empty {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  padding: 16px 0;
}

/* 联系我们 */
.card {
  background: #fff;
  border-radius: 12px;
  margin: 12px 16px;
  padding: 18px 16px;
}
.card h3 {
  font-size: 16px;
  margin-bottom: 12px;
}
.qrcode-img-wrap {
  text-align: center;
}
.qrcode-img-wrap img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}
.qrcode-placeholder {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border: 1px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}
.wechat-name {
  text-align: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.form-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

/* 底部 tab */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  z-index: 30;
}
.tabbar .tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.tabbar .tab.active {
  color: var(--primary);
  font-weight: 600;
}

/* toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99;
  max-width: 80%;
  text-align: center;
}

/* 添加微信号入口 */
.wx-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f7faff;
  border: 1px solid #e3edfd;
  border-radius: 8px;
  cursor: pointer;
}
.wx-icon { font-size: 16px; }
.wx-text { font-size: 14px; color: var(--primary); font-weight: 600; }
.wx-arrow { margin-left: auto; color: #b0c4e0; font-size: 18px; }

/* 提供联系方式入口（点击弹窗） */
.contact-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #f7faff;
  border: 1px solid #e3edfd;
  border-radius: 8px;
  cursor: pointer;
}

/* 分享小球 */
.share-fab {
  position: fixed;
  left: 16px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  cursor: pointer;
  z-index: 40;
}

/* 分享菜单 */
.share-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.share-menu {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px;
  box-sizing: border-box;
}
.share-item {
  padding: 16px;
  text-align: center;
  font-size: 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.share-cancel {
  padding: 14px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  margin-top: 6px;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.modal-card h3 {
  font-size: 17px;
  margin-bottom: 16px;
}
.modal-qrcode img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}
.modal-qrcode .qrcode-placeholder {
  margin: 0 auto;
}
.modal-wxname {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
.modal-tip {
  margin-top: 10px;
  color: #b0b0b0;
  font-size: 12px;
}
.modal-input {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  text-align: center;
  margin-bottom: 14px;
}
.modal-input:focus { border-color: var(--primary); }
.modal-submit {
  width: 100%;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 11px;
  font-size: 15px;
  cursor: pointer;
}
.poster-img {
  width: 100%;
  max-width: 280px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

/* 分类入口栏 */
.cat-bar {
  display: flex;
  justify-content: space-around;
  padding: 12px 8px;
  background: var(--bg);
}
.cat-bar.sticky {
  position: sticky;
  top: 0;
  z-index: 15;
  background: var(--bg);
}
.cat-item {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #555;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid #e5e7eb;
}
.cat-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 文章分类标签 */
.cat-tag {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
}

/* 我的 - 登录注册 */
.auth-panel {
  padding: 40px 28px;
  text-align: center;
}
.auth-avatar {
  width: 72px;
  height: 72px;
  line-height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 34px;
}
.auth-panel h3 {
  font-size: 20px;
  margin-bottom: 20px;
}
.auth-input {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  margin-bottom: 12px;
}
.auth-input:focus { border-color: var(--primary); }
.auth-submit {
  width: 100%;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 4px;
}
.auth-toggle {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.auth-toggle a { color: var(--primary); cursor: pointer; }

/* 我的 - 已登录 */
.user-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px;
  padding: 18px 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.user-avatar {
  width: 52px;
  height: 52px;
  line-height: 52px;
  text-align: center;
  border-radius: 50%;
  background: var(--primary-light);
  font-size: 26px;
  flex-shrink: 0;
}
.user-info { flex: 1; }
.user-name { font-size: 17px; font-weight: 700; }
.user-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.logout-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #666;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

/* 我的 - 功能入口 */
.mine-menu {
  margin: 0 16px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.mine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.mine-item:last-child { border-bottom: none; }
.mine-ico { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.mine-ico svg { width: 100%; height: 100%; display: block; }
.mine-label { flex: 1; font-size: 15px; }
.mine-arrow { color: #c4c4c4; font-size: 20px; }

/* 客服在线时间 */
.service-time {
  margin: 16px;
  padding: 18px 16px;
  background: var(--primary-light);
  border-radius: 12px;
  text-align: center;
}
.service-time-title { font-size: 13px; color: var(--muted); }
.service-time-range { font-size: 20px; font-weight: 700; color: var(--primary); margin: 6px 0; }
.service-time-tip { font-size: 13px; color: #888; }

/* 通用列表弹窗 */
.panel-card {
  max-width: 92%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.panel-card h3 { text-align: center; }
.panel-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.panel-row {
  padding: 12px 4px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.panel-row:last-child { border-bottom: none; }
.panel-row-title { font-size: 15px; font-weight: 600; line-height: 1.4; }
.panel-row-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.panel-row-time { font-size: 12px; color: #b5b5b5; margin-top: 4px; }
.panel-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 28px 0; }

/* 客服咨询 */
.consult-form { margin-bottom: 8px; }
.consult-form textarea {
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  margin-bottom: 8px;
}
.consult-form textarea:focus { border-color: var(--primary); }
.consult-form button {
  width: 100%;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
}
.consult-list { margin-top: 8px; }
.consult-item {
  padding: 12px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.consult-item:last-child { border-bottom: none; }
.consult-q { font-size: 14px; line-height: 1.5; }
.consult-reply {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f6f9ff;
  border-radius: 8px;
  font-size: 13px;
  color: #444;
}
.consult-waiting { margin-top: 6px; font-size: 12px; color: #bbb; }