/* ====== 牛牛聊聊 样式 ====== */
:root {
  --primary: #1f9d61;
  --primary-dark: #177a4c;
  --primary-light: #e8f7ef;
  --gold: #e6a817;
  --gold-dark: #c98f0a;
  --gold-light: #fdf3dc;
  --text: #22303a;
  --text-light: #6b7a86;
  --bg: #f5f9f6;
  --card: #ffffff;
  --border: #e3ebe6;
  --danger: #d9534f;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(31, 60, 45, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ====== 顶栏 ====== */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #2fb473, #177a4c);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  box-shadow: 0 3px 10px rgba(31, 157, 97, 0.3);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 1px; }
.brand-slogan { font-size: 12px; color: var(--text-light); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.stats-chip {
  font-size: 12px; color: var(--text-light);
  background: var(--primary-light); border-radius: 999px; padding: 5px 12px;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary-light); border-radius: 999px; padding: 5px 8px 5px 5px;
  font-size: 14px; font-weight: 600;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.avatar.member-avatar { background: var(--gold); }
.badge-member {
  background: linear-gradient(135deg, #f5c14b, var(--gold));
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.link-btn { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 12px; }
.link-btn:hover { color: var(--danger); }

/* ====== 按钮 ====== */
.btn {
  border: none; cursor: pointer; border-radius: 10px;
  font-size: 14px; font-weight: 600; padding: 10px 18px;
  transition: all .15s ease; font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-gold {
  background: linear-gradient(135deg, #f5c14b, var(--gold)); color: #fff;
  box-shadow: 0 3px 10px rgba(230, 168, 23, 0.35);
}
.btn-gold:hover:not(:disabled) { background: var(--gold-dark); transform: translateY(-1px); }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ====== 落地页 ====== */
.landing { flex: 1; }
.hero {
  max-width: 1100px; margin: 0 auto; padding: 48px 20px 60px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: start;
}
.hero-copy h1 { font-size: 40px; line-height: 1.25; margin-bottom: 16px; }
.hero-sub { color: var(--text-light); font-size: 16px; line-height: 1.7; margin-bottom: 22px; }
.feature-list { list-style: none; margin-bottom: 28px; }
.feature-list li {
  padding: 9px 0; font-size: 15px; color: var(--text); line-height: 1.6;
}
.feature-list b { color: var(--primary-dark); }

.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 15px; font-weight: 600;
  color: var(--text-light); font-family: inherit;
}
.tab.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 157, 97, .12); }
.form-note { font-size: 12px; color: var(--text-light); margin-bottom: 14px; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }

/* ====== 聊天区 ====== */
.chat-wrap { flex: 1; display: flex; }
.chat-card {
  flex: 1; max-width: 900px; margin: 18px auto; width: calc(100% - 32px);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  height: calc(100vh - 150px); min-height: 480px; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: #fbfdfc;
}
.chat-title { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.chat-sub { font-size: 12px; color: var(--text-light); font-weight: 400; }
.online-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #2fb473;
  box-shadow: 0 0 0 3px rgba(47, 180, 115, .2);
}
.chat-head-right { display: flex; align-items: center; gap: 10px; }
.quota-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary-dark); font-weight: 600;
}
.quota-chip.warn { background: #fdeceb; color: var(--danger); }
.quota-chip.member { background: var(--gold-light); color: var(--gold-dark); }

.messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}

/* ====== 非会员历史记录提示条（仅显示最近 N 条） ====== */
.history-notice {
  align-self: center; text-align: center;
  font-size: 12.5px; color: var(--text-light);
  background: #fff8ea; border: 1px dashed var(--gold);
  border-radius: 10px; padding: 8px 14px; margin-bottom: 4px;
}
.history-notice b { color: var(--gold-dark); }
.gold-link { color: var(--gold-dark); font-weight: 600; }
.gold-link:hover { text-decoration: underline; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.own { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.msg.own .msg-avatar { background: var(--primary-dark); }
.msg.member-msg .msg-avatar { background: linear-gradient(135deg, #f5c14b, var(--gold)); }
.msg-body { display: flex; flex-direction: column; gap: 4px; }
.msg-meta { font-size: 11px; color: var(--text-light); padding: 0 4px; }
.msg.own .msg-meta { text-align: right; }
.msg-name { font-weight: 600; }
.msg.member-msg .msg-name { color: var(--gold-dark); }
.msg-bubble {
  padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.6;
  background: #f1f5f2; word-break: break-word; white-space: pre-wrap;
}
.msg.own .msg-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg:not(.own) .msg-bubble { border-bottom-left-radius: 4px; }
.msg.system-msg { align-self: center; max-width: 90%; }
.msg.system-msg .msg-bubble {
  background: var(--gold-light); color: #8a6d1a; font-size: 13px; text-align: center;
  border-radius: 10px; padding: 8px 16px;
}
.member-tag {
  font-size: 10px; font-weight: 700; color: #fff; background: var(--gold);
  border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px;
}

/* ====== 输入区 ====== */
.composer { border-top: 1px solid var(--border); padding: 12px 16px; background: #fbfdfc; }
.limit-banner {
  background: #fdeceb; color: var(--danger); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.composer-row { display: flex; gap: 10px; align-items: flex-end; }
#msgInput {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 13px; font-size: 14.5px; font-family: inherit; outline: none;
  max-height: 120px; line-height: 1.5; background: #fff;
}
#msgInput:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 157, 97, .12); }
#msgInput:disabled { background: #f2f4f3; color: #a8b3ad; }
.composer-tip { font-size: 11.5px; color: var(--text-light); margin-top: 6px; text-align: right; }

/* ====== 弹窗 ====== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 35, 27, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 18px; padding: 32px; width: 400px; max-width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: pop .2s ease; position: relative;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; border: none; background: #f1f4f2;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--text-light);
}
.modal-crown { font-size: 48px; margin-bottom: 6px; }
.modal h2 { font-size: 22px; margin-bottom: 4px; }
.modal-sub { color: var(--text-light); font-size: 14px; margin-bottom: 20px; }
.price-card {
  background: linear-gradient(160deg, #fffaf0, var(--gold-light));
  border: 1px solid #f2dfa8; border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.price { font-size: 18px; color: var(--gold-dark); margin-bottom: 14px; }
.price b { font-size: 40px; }
.price span { font-size: 14px; }
.price-features { list-style: none; text-align: left; font-size: 13.5px; color: var(--text); }
.price-features li { padding: 5px 0; }
.price-features b { color: var(--gold-dark); }
.pay-note { font-size: 12px; color: var(--text-light); margin-bottom: 16px; }
.pay-note b { color: var(--gold-dark); }

/* ====== Toast ====== */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: #22303a; color: #fff; padding: 10px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--primary-dark); }

/* ====== 页脚 ====== */
.footer {
  text-align: center; padding: 18px; font-size: 12px; color: var(--text-light);
}

/* ====== 截图/图片 ====== */
.btn-icon {
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  width: 44px; height: 44px; font-size: 19px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.btn-icon:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.btn-icon:disabled { opacity: .5; cursor: not-allowed; }
.img-preview {
  display: flex; align-items: center; gap: 10px;
  background: var(--primary-light); border: 1px dashed var(--primary);
  border-radius: 10px; padding: 8px 10px; margin-bottom: 10px;
}
.img-preview img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.img-preview-info {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--primary-dark); word-break: break-all;
}
.img-preview-cancel {
  border: none; background: #fff; color: var(--danger); width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer; font-size: 12px; flex-shrink: 0;
}
.msg-img-wrap { margin-top: 4px; }
.msg-img {
  max-width: 260px; max-height: 220px; border-radius: 12px; cursor: zoom-in;
  display: block; border: 1px solid rgba(0, 0, 0, .06);
}
.msg.own .msg-img { border: none; }
.lightbox { cursor: zoom-out; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; }

/* ====== 博主禁言 ====== */
.limit-banner.mute-banner { background: #fff4e5; color: #b06a00; }
.mini-btn {
  border: 1px solid var(--border); background: #fff; color: var(--text-light);
  font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer; margin-left: 6px;
  font-family: inherit;
}
.mini-btn:hover { color: var(--danger); border-color: var(--danger); }
.mini-btn.del-btn { color: #c0453f; border-color: #f3c7c4; padding: 1px 6px; }
.mini-btn.del-btn:hover { background: #fdecea; }
.system-msg .mini-btn.del-btn { vertical-align: middle; margin-left: 6px; }
.muted-tag {
  font-size: 10px; color: #b06a00; background: #fff4e5;
  padding: 1px 6px; border-radius: 4px; margin-left: 6px;
}
.member-tag.admin-tag { background: linear-gradient(135deg, #6ec3ff, #2b8fe6); }
.modal-sm { width: 360px; }
.mute-target { color: var(--gold-dark); }
.mute-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mute-options .btn { background: #f1f5f2; }
.mute-options .btn:hover { background: #e3ebe6; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0453f; color: #fff; }

/* ====== 会员列表（博主） ====== */
.members-list { max-height: 340px; overflow-y: auto; text-align: left; }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #eef2ef; }
.member-row:last-child { border-bottom: none; }
.member-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-info b { display: block; }
.member-info small { display: block; color: #8a9a91; font-size: 12px; }
.nick-annot { color: #2f9e6f; font-weight: 500; font-size: 13px; }
.member-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.member-actions .status-tag { margin-right: 2px; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f1f5f2; color: #5a6b62; white-space: nowrap; }
.status-tag.ok-tag { background: #e8f5ee; color: #2f9e63; }
.status-tag.banned-tag { background: #fdecea; color: #c0453f; }
.status-tag.muted-flag { background: #fff4e0; color: #b07a1e; }
.mini-btn.ban-btn { color: #c0453f; border-color: #f3c7c4; }
.mini-btn.ban-btn:hover { background: #fdecea; }
.empty-tip { color: #8a9a91; text-align: center; padding: 24px 0; }

/* ====== 用户管理（订单 / 会员 / 非会员） ====== */
.order-badge {
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  background: var(--danger); color: #fff; border-radius: 9px;
  font-size: 11px; font-weight: 700; margin-left: 4px; padding: 0 5px;
}
.sub-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.sub-tab {
  flex: 1; padding: 8px 4px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--text-light); font-family: inherit; white-space: nowrap;
}
.sub-tab.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.tab-count { color: var(--danger); font-weight: 700; }
.member-row.order-row { background: #fffdf5; border-radius: 10px; padding: 10px; border: 1px dashed #f2dfa8; }
.member-row.order-row.claimed { background: #f2fbf6; border-color: #bfe8d1; }
.member-row.dim-row { opacity: .65; }
.claimed-flag { color: #2f9e63; }
.mini-btn.ok-btn { color: #2f9e63; border-color: #bfe8d1; }
.mini-btn.ok-btn:hover { background: #e8f5ee; }
.list-section-title {
  font-size: 12px; color: var(--text-light); margin: 14px 0 4px; font-weight: 600;
}

/* ====== 会员套餐卡片 ====== */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 14px; }
.plan-card {
  position: relative; border: 2px solid var(--border); border-radius: 14px;
  padding: 16px 10px; cursor: pointer; transition: all .15s ease; background: #fff;
}
.plan-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(230,168,23,.18); }
.plan-card.plan-hot { border-color: #f2dfa8; background: linear-gradient(160deg, #fffaf0, var(--gold-light)); }
.plan-badge {
  position: absolute; top: -10px; right: 10px; background: linear-gradient(135deg, #f5c14b, var(--gold));
  color: #fff; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px;
}
.plan-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.plan-price { font-size: 15px; color: var(--gold-dark); }
.plan-price b { font-size: 32px; }
.plan-price span { font-size: 12.5px; }
.plan-desc { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ====== 支付宝付款 ====== */
.pay-amount { font-size: 15px; color: var(--text); margin: 6px 0 14px; }
.pay-amount b { font-size: 26px; color: var(--gold-dark); }
.pay-amount small { color: var(--text-light); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 12px; }
.qr-box img {
  width: 200px; height: 200px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 8px;
}
.qr-tip { font-size: 13px; color: var(--text); }
.qr-tip b { color: #1677ff; }
.wait-icon { font-size: 52px; margin-bottom: 8px; }

/* ====== 会员设置（博主） ====== */
.qr-upload {
  border: 1px dashed var(--border); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.qr-preview {
  width: 160px; height: 160px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 6px;
}
.qr-actions { display: flex; gap: 10px; }

/* ====== 响应式 ====== */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 28px; }
  .hero-copy h1 { font-size: 30px; }
  .stats-chip { display: none; }
  .msg { max-width: 88%; }
}

/* ====== 置顶消息区 ====== */
.pinned-box {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px; padding: 10px 12px;
  background: linear-gradient(180deg, #fff8e6, #fffdf6);
  border: 1px solid #f0dca0; border-radius: 12px;
}
.pinned-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; background: #fff; border: 1px solid #f0e2b8; border-radius: 10px;
}
.pinned-flag {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--gold-dark);
  background: var(--gold-light); border: 1px solid #f0dca0; border-radius: 8px;
  padding: 2px 8px; margin-top: 2px; white-space: nowrap;
}
.pinned-item .msg-body { flex: 1; min-width: 0; }
.pinned-item .msg-bubble { font-size: 14px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.pinned-item .msg-img { max-width: 160px; border-radius: 8px; margin-top: 4px; }

/* 置顶按钮 */
.pin-btn { background: var(--gold-light); color: var(--gold-dark); border: 1px solid #f0dca0; }
.pin-btn:hover { background: #fbeecb; }

/* ====== 我的（改昵称 + 改密码） ====== */
.form-section { text-align: left; }
.form-section-title { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.form-divider { border: none; border-top: 1px dashed var(--border); margin: 16px 0; }
#profileModal .field { margin-bottom: 10px; }
#profileModal .field label { font-size: 13px; }
#profileModal .field input { margin-top: 4px; }

