/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; background: #f6f6f6; color: #1a1a1a; font-size: 14px; }
a { color: #1772F6; cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
textarea { resize: vertical; }

/* ===== 导航栏 ===== */
.navbar { background: #fff; border-bottom: 1px solid #ebebeb; position: sticky; top: 0; z-index: 100; }
.navbar-inner { max-width: 1100px; margin: 0 auto; height: 52px; display: flex; align-items: center; gap: 24px; padding: 0 16px; }
.logo { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 700; font-size: 16px; color: #1a1a1a; white-space: nowrap; }
.logo-icon { font-size: 20px; }
.logo-text { color: #1772F6; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 6px 12px; border-radius: 4px; color: #444; font-size: 14px; transition: background 0.15s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { background: #f0f5ff; color: #1772F6; text-decoration: none; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; align-items: center; background: #f6f6f6; border-radius: 20px; padding: 4px 12px; border: 1px solid #ebebeb; }
.search-box input { background: none; border: none; outline: none; width: 160px; font-size: 13px; }
.search-icon { color: #aaa; font-size: 14px; }

/* 用户头像菜单 */
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.user-info-mini { font-size: 12px; line-height: 1.4; }
.user-info-mini .uname { font-weight: 600; color: #1a1a1a; }
.user-info-mini .ustat { color: #8590a6; }
.btn-login { padding: 6px 16px; border-radius: 4px; background: #1772F6; color: #fff; border: none; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn-login:hover { background: #1264d9; }
.btn-logout { padding: 5px 10px; border-radius: 4px; border: 1px solid #ebebeb; background: #fff; cursor: pointer; font-size: 12px; color: #666; margin-left: 4px; }

/* ===== 主容器 ===== */
.main-container { max-width: 1100px; margin: 20px auto; padding: 0 16px; }
.page { display: none; }
.page.active { display: block; }

/* ===== 首页布局 ===== */
.home-layout { display: flex; gap: 16px; }
.feed-area { flex: 1; min-width: 0; }
.sidebar { width: 260px; flex-shrink: 0; }

/* ===== Feed 头部 ===== */
.feed-header { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
.tab-btn { background: none; border: none; cursor: pointer; padding: 4px 10px; border-radius: 4px; color: #444; font-size: 13px; transition: background 0.15s; }
.tab-btn.active, .tab-btn:hover { background: #f0f5ff; color: #1772F6; }
.ask-btn { margin-left: auto; background: #1772F6; color: #fff; border: none; border-radius: 4px; padding: 6px 16px; cursor: pointer; font-size: 13px; }
.ask-btn:hover { background: #1264d9; }

/* ===== 问题卡片 ===== */
.q-card { background: #fff; border-radius: 6px; padding: 16px; margin-bottom: 10px; cursor: pointer; transition: box-shadow 0.15s; border: 1px solid transparent; }
.q-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #e0e8ff; }
.q-card-title { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 6px; }
.q-card-body { font-size: 13px; color: #8590a6; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.q-card-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8590a6; }
.q-card-footer .asker { display: flex; align-items: center; gap: 4px; }
.q-card-footer .av-sm { width: 20px; height: 20px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.tag { background: #f0f5ff; color: #1772F6; padding: 2px 8px; border-radius: 10px; font-size: 11px; }
.dot { color: #ccc; }
.solved-badge { background: #e6f7f2; color: #00a870; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.unsolved-badge { background: #fff3e0; color: #f59000; padding: 2px 8px; border-radius: 10px; font-size: 11px; }

/* ===== 侧边栏 ===== */
.sidebar-card { background: #fff; border-radius: 6px; padding: 14px; margin-bottom: 12px; }
.sidebar-title { font-size: 13px; font-weight: 600; color: #444; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0; }
.hot-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f6f6f6; cursor: pointer; }
.hot-item:last-child { border-bottom: none; }
.hot-num { font-size: 12px; font-weight: 700; color: #aaa; width: 16px; }
.hot-num.top3 { color: #1772F6; }
.hot-text { font-size: 13px; color: #444; flex: 1; line-height: 1.4; }
.hot-text:hover { color: #1772F6; }
.active-user-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.active-user-item .av { width: 28px; height: 28px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.user-meta { font-size: 12px; }
.user-meta .un { font-weight: 600; color: #1a1a1a; }
.user-meta .ux { color: #8590a6; }
.lv-badge { font-size: 11px; background: #fff3cd; color: #856404; padding: 1px 5px; border-radius: 3px; }

/* 侧边栏用户卡片 */
.side-user-box { text-align: center; }
.side-user-box .big-av { width: 48px; height: 48px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; margin: 0 auto 8px; }
.side-user-box .uname-big { font-weight: 700; font-size: 15px; }
.stat-row { display: flex; justify-content: space-around; margin-top: 10px; }
.stat-item { text-align: center; }
.stat-item .val { font-size: 16px; font-weight: 700; color: #1772F6; }
.stat-item .lab { font-size: 11px; color: #8590a6; }
.exp-bar-wrap { margin-top: 10px; }
.exp-bar-wrap .exp-label { font-size: 11px; color: #8590a6; margin-bottom: 3px; display: flex; justify-content: space-between; }
.exp-bar { height: 4px; background: #ebebeb; border-radius: 2px; overflow: hidden; }
.exp-bar-inner { height: 100%; background: linear-gradient(90deg,#1772F6,#5ba4fa); border-radius: 2px; transition: width 0.4s; }

/* ===== 问题详情页 ===== */
.detail-q-box { background: #fff; border-radius: 6px; padding: 20px; margin-bottom: 12px; }
.detail-q-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.detail-q-meta { font-size: 12px; color: #8590a6; margin-bottom: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail-q-body { font-size: 14px; color: #444; line-height: 1.8; }
.answer-section-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 0 8px; }
.answer-count { font-weight: 600; font-size: 15px; }
.answer-btn { background: #1772F6; color: #fff; border: none; border-radius: 4px; padding: 7px 18px; cursor: pointer; font-size: 13px; }
.answer-btn:hover { background: #1264d9; }

/* 回答卡片 */
.ans-card { background: #fff; border-radius: 6px; padding: 16px; margin-bottom: 10px; border: 1px solid #ebebeb; }
.ans-card.accepted { border-color: #1772F6; }
.accepted-badge { background: #1772F6; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; display: inline-block; margin-bottom: 8px; }
.ans-author { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ans-author .av { width: 32px; height: 32px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; }
.ans-author-info .name { font-weight: 600; font-size: 13px; }
.ans-author-info .lvx { font-size: 11px; color: #8590a6; }

/* 引用价格条目卡片 */
.price-ref-card { border: 1px solid #1772F6; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; background: #f0f5ff; }
.price-ref-card .mat-name { font-weight: 700; font-size: 14px; color: #1772F6; }
.price-ref-card .price-row { display: flex; gap: 16px; margin-top: 4px; font-size: 12px; color: #444; flex-wrap: wrap; }
.price-ref-card .price-big { font-size: 18px; font-weight: 700; color: #e0342b; }

.ans-text { font-size: 14px; color: #1a1a1a; line-height: 1.8; margin-bottom: 12px; }
.ans-actions { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #8590a6; }
.action-btn { background: none; border: 1px solid #ebebeb; border-radius: 20px; padding: 4px 12px; cursor: pointer; display: flex; align-items: center; gap: 4px; color: #666; transition: all 0.15s; }
.action-btn:hover { border-color: #1772F6; color: #1772F6; }
.action-btn.liked { border-color: #1772F6; color: #1772F6; background: #f0f5ff; }
.action-btn.disliked { border-color: #e0342b; color: #e0342b; }
.adopt-btn { background: #e6f7f2; color: #00a870; border: none; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-size: 12px; }
.adopt-btn.done { background: #00a870; color: #fff; }
.adopt-btn:hover { opacity: 0.85; }

/* 评论区 */
.comment-section { margin-top: 10px; border-top: 1px solid #f6f6f6; padding-top: 8px; }
.comment-item { display: flex; gap: 8px; padding: 6px 0; font-size: 13px; color: #444; }
.comment-item .cav { width: 24px; height: 24px; border-radius: 50%; background: #8590a6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.comment-item .ctxt .cname { font-weight: 600; color: #1a1a1a; margin-right: 4px; }
.comment-item .ctxt .clike { margin-left: 8px; color: #aaa; cursor: pointer; font-size: 12px; }
.comment-item .ctxt .clike:hover { color: #1772F6; }
.comment-input-row { display: flex; gap: 8px; margin-top: 8px; }
.comment-input-row input { flex: 1; border: 1px solid #ebebeb; border-radius: 4px; padding: 6px 10px; font-size: 13px; outline: none; }
.comment-input-row input:focus { border-color: #1772F6; }
.comment-input-row button { background: #1772F6; color: #fff; border: none; border-radius: 4px; padding: 6px 14px; cursor: pointer; font-size: 13px; }

/* ===== 政府信息价 ===== */
.gov-container { max-width: 860px; margin: 0 auto; }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 700; }
.page-header .sub { color: #8590a6; font-size: 13px; margin-top: 4px; }
.gov-filters { display: flex; gap: 12px; margin-bottom: 16px; }
.gov-filters select { border: 1px solid #ebebeb; border-radius: 4px; padding: 6px 12px; font-size: 13px; color: #444; background: #fff; outline: none; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; }
.data-table th { background: #f6f6f6; font-size: 13px; color: #8590a6; font-weight: 600; padding: 10px 14px; text-align: left; border-bottom: 1px solid #ebebeb; }
.data-table td { padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f6f6f6; color: #1a1a1a; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fbff; }
.lock-tip { text-align: center; padding: 32px 0; color: #8590a6; }
.lock-tip .lock-icon { font-size: 40px; margin-bottom: 8px; }
.pager { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pager button { border: 1px solid #ebebeb; background: #fff; border-radius: 4px; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.pager button.cur { background: #1772F6; color: #fff; border-color: #1772F6; }

/* ===== 积分商城 ===== */
.points-bar { background: linear-gradient(135deg,#1772F6,#5ba4fa); border-radius: 8px; padding: 16px 20px; color: #fff; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.points-bar .pts { font-size: 28px; font-weight: 700; }
.points-bar .pts-lab { font-size: 13px; opacity: 0.85; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 16px; }
.shop-item { background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #ebebeb; cursor: pointer; transition: box-shadow 0.15s; }
.shop-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.shop-item .shop-img { width: 100%; height: 140px; background: #f0f5ff; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.shop-item .shop-info { padding: 12px; }
.shop-item .shop-name { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.shop-item .shop-pts { color: #e0342b; font-weight: 700; font-size: 15px; }
.shop-item .exchange-btn { width: 100%; margin-top: 8px; background: #1772F6; color: #fff; border: none; border-radius: 4px; padding: 7px 0; cursor: pointer; font-size: 13px; }
.shop-item .exchange-btn:hover { background: #1264d9; }

/* ===== 排行榜 ===== */
.rank-list { background: #fff; border-radius: 6px; overflow: hidden; }
.rank-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #f6f6f6; }
.rank-item:last-child { border-bottom: none; }
.rank-no { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: #f6f6f6; color: #8590a6; flex-shrink: 0; }
.rank-no.n1 { background: #FFD700; color: #fff; }
.rank-no.n2 { background: #C0C0C0; color: #fff; }
.rank-no.n3 { background: #CD7F32; color: #fff; }
.rank-av { width: 36px; height: 36px; border-radius: 50%; background: #1772F6; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.rank-info { flex: 1; }
.rank-info .rn { font-weight: 600; font-size: 14px; }
.rank-info .rx { font-size: 12px; color: #8590a6; }
.rank-exp { font-size: 15px; font-weight: 700; color: #1772F6; }

/* ===== 认证页 ===== */
.auth-box { max-width: 380px; margin: 40px auto; background: #fff; border-radius: 8px; padding: 32px 36px; border: 1px solid #ebebeb; }
.auth-box h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; text-align: center; }
.auth-switch { text-align: center; font-size: 13px; color: #8590a6; margin-top: 12px; }
.err-msg { color: #e0342b; font-size: 12px; margin-top: 8px; min-height: 16px; }

/* ===== 表单元素 ===== */
.inp { width: 100%; border: 1px solid #ebebeb; border-radius: 4px; padding: 8px 12px; font-size: 14px; outline: none; margin-bottom: 12px; transition: border-color 0.15s; }
.inp:focus { border-color: #1772F6; }
.btn-primary { background: #1772F6; color: #fff; border: none; border-radius: 4px; padding: 8px 20px; cursor: pointer; font-size: 14px; }
.btn-primary:hover { background: #1264d9; }
.btn-primary.full { width: 100%; padding: 10px; }
.btn-secondary { background: #f6f6f6; color: #444; border: none; border-radius: 4px; padding: 8px 20px; cursor: pointer; font-size: 14px; }
.btn-secondary:hover { background: #ebebeb; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-box { background: #fff; border-radius: 8px; padding: 24px 28px; width: 540px; max-width: 95vw; max-height: 80vh; overflow-y: auto; }
.modal-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: #8590a6; margin-bottom: 12px; }
.tag-row label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.price-picker { max-height: 200px; overflow-y: auto; border: 1px solid #ebebeb; border-radius: 4px; padding: 8px; margin-bottom: 10px; }
.picker-title { font-size: 13px; color: #8590a6; margin-bottom: 8px; }
.picker-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; font-size: 13px; }
.picker-item:hover { background: #f0f5ff; }
.picker-item.sel { border-color: #1772F6; background: #f0f5ff; }
.selected-price-card { border: 1px solid #1772F6; border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; background: #f0f5ff; font-size: 13px; }
.selected-price-card .mat { font-weight: 700; color: #1772F6; }
.selected-price-card .details { color: #444; margin-top: 4px; }

/* 价格条目侧边栏 */
#priceItemPanel .pi-item { border: 1px solid #ebebeb; border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
#priceItemPanel .pi-item .pm { font-weight: 600; color: #1a1a1a; }
#priceItemPanel .pi-item .pp { color: #e0342b; font-weight: 700; font-size: 14px; }
#priceItemPanel .pi-item .pd { color: #8590a6; }

/* ===== Toast 通知 ===== */
.toast { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); background: #1a1a1a; color: #fff; padding: 9px 22px; border-radius: 20px; font-size: 13px; z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.toast.show { opacity: 1; }

/* ===== 相关问题 ===== */
#relatedQuestions .rq-item { font-size: 13px; color: #1772F6; padding: 5px 0; border-bottom: 1px solid #f6f6f6; cursor: pointer; line-height: 1.4; }
#relatedQuestions .rq-item:last-child { border-bottom: none; }
#relatedQuestions .rq-item:hover { text-decoration: underline; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .home-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .nav-links { display: none; }
  .search-box input { width: 100px; }
  .rank-item .rank-info .rx { display: none; }
  .shop-grid { grid-template-columns: repeat(2,1fr); }
}
