/* 会员中心 + 管理后台 样式 */
.mb-hint { font-size: 13px; color: #9ca3af; padding: 20px; text-align: center; }
.mb-status { padding: 18px 20px; border-radius: 14px; margin-bottom: 18px; }
.mb-status.pro { background: linear-gradient(135deg,#fef3c7,#fde68a); border: 1px solid #fcd34d; }
.mb-status.free { background: #f8faff; border: 1px solid #dbeafe; }
.mb-status-badge { font-size: 16px; font-weight: 700; color: #92400e; }
.mb-status.free .mb-status-badge { color: #1d4ed8; }
.mb-status-desc { font-size: 13px; color: #6b7280; margin-top: 6px; line-height: 1.6; }

.mb-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .mb-plans { grid-template-columns: 1fr; } }
.mb-plan { position: relative; padding: 20px; background: #fff; border: 2px solid #e6e8eb; border-radius: 16px; }
.mb-plan.best { border-color: #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,.12); }
.mb-plan-tag { position: absolute; top: -10px; right: 16px; font-size: 11px; color: #fff; background: #f59e0b; padding: 3px 10px; border-radius: 6px; }
.mb-plan-name { font-size: 16px; font-weight: 700; color: #1f2937; }
.mb-plan-price { font-size: 30px; font-weight: 800; color: #2563eb; margin: 8px 0; }
.mb-plan-price span { font-size: 14px; font-weight: 400; color: #9ca3af; }
.mb-plan-desc { font-size: 12.5px; color: #6b7280; margin-bottom: 12px; }
.mb-plan-feats { list-style: none; margin: 0 0 16px; padding: 0; }
.mb-plan-feats li { font-size: 13px; color: #374151; line-height: 1.9; padding-left: 20px; position: relative; }
.mb-plan-feats li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 700; }
.mb-buy { width: 100%; }
.mb-actions { margin: 16px 0; }
.mb-note { font-size: 12px; color: #9ca3af; margin-top: 16px; padding: 10px 14px; background: #fffbeb; border-radius: 10px; line-height: 1.6; }

/* 管理后台 */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.ad-card { padding: 20px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; text-align: center; }
.ad-num { font-size: 32px; font-weight: 800; color: #2563eb; line-height: 1; }
.ad-label { font-size: 13px; color: #6b7280; margin-top: 8px; }
.ad-search { width: 100%; padding: 10px 14px; font-size: 14px; border: 1.5px solid #d7dbe0; border-radius: 10px; outline: none; margin-bottom: 14px; box-sizing: border-box; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th { text-align: left; padding: 10px 8px; color: #6b7280; font-weight: 600; border-bottom: 2px solid #eef0f2; }
.ad-table td { padding: 10px 8px; border-bottom: 1px solid #f4f6f8; color: #374151; }
.ad-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #64748b; }
.ad-badge.pro { background: #fef3c7; color: #92400e; }
.ad-badge.admin { background: #ede9fe; color: #6d28d9; }
.ad-badge.role { background: #e0f2fe; color: #0369a1; }
.ad-badge.ok { background: #dcfce7; color: #166534; }
.ad-badge.ban { background: #fee2e2; color: #991b1b; }
.ad-btn { font-size: 12px; padding: 4px 12px; border: 1px solid #c7d7fb; border-radius: 6px; background: #eff6ff; color: #2563eb; cursor: pointer; margin-right: 6px; }
.ad-btn:hover { background: #dbeafe; }
.ad-btn:disabled { opacity: .45; cursor: default; }
.ad-ops { white-space: nowrap; }
.ad-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.ad-page { font-size: 12.5px; color: #6b7280; padding: 0 10px; }

/* ---------- 编辑用户弹窗 ---------- */
.ad-modal-mask { position: fixed; inset: 0; z-index: 9999; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: adFade .15s ease; overflow-y: auto; }
@keyframes adFade { from { opacity: 0; } to { opacity: 1; } }
.ad-modal { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.22); animation: adPop .18s cubic-bezier(.2,.9,.3,1.2); margin: auto; }
.ad-modal-wide { max-width: 620px; }
@keyframes adPop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
.ad-modal-title { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: #1f2937; }
.ad-modal-user { font-size: 13px; color: #6b7280; margin-bottom: 18px; word-break: break-all; }
.ad-field { display: block; margin-bottom: 16px; }
.ad-field-label { display: block; font-size: 12.5px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.ad-select { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px; color: #1f2937; border: 1.5px solid #d7dbe0; border-radius: 10px; background: #fff; outline: none; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2394a3b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input.ad-select { cursor: text; background-image: none; padding-right: 12px; }
.ad-select:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ad-modal-btns { display: flex; gap: 10px; margin-top: 22px; }
.ad-modal-btn { flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: background .15s, opacity .15s; }
.ad-modal-btn.cancel { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.ad-modal-btn.cancel:hover { background: #e2e8f0; }
.ad-modal-btn.save { background: #2563eb; color: #fff; }
.ad-modal-btn.save:hover { background: #1d4ed8; }
.ad-modal-btn:disabled { opacity: .6; cursor: default; }

/* 详情网格 */
.ad-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 8px; }
.ad-detail-grid > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed #eef0f2; font-size: 13px; }
.ad-k { color: #9ca3af; flex: 0 0 auto; }
.ad-v { color: #374151; text-align: right; word-break: break-all; }
.ad-sub-h { font-size: 13.5px; font-weight: 700; color: #1f2937; margin: 18px 0 8px; }

/* 危险操作区 */
.ad-danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px solid #eef0f2; display: flex; gap: 8px; flex-wrap: wrap; }
.ad-danger-btn { flex: 1; min-width: 100px; padding: 9px 10px; font-size: 12.5px; font-weight: 600; border-radius: 9px; cursor: pointer; border: 1px solid #fecaca; background: #fff5f5; color: #b91c1c; }
.ad-danger-btn:hover { background: #fee2e2; }
.ad-danger-btn.del { border-color: #ef4444; background: #ef4444; color: #fff; }
.ad-danger-btn.del:hover { background: #dc2626; }

/* 轻提示 toast */
.ad-toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 10000; background: #16a34a; color: #fff; font-size: 13.5px; padding: 10px 20px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: adToast .2s ease; }
.ad-toast.err { background: #dc2626; }
@keyframes adToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

[data-theme="dark"] .mb-plan, [data-theme="dark"] .ad-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .mb-plan-name, [data-theme="dark"] .mb-plan-feats li { color: #e2e8f0; }
[data-theme="dark"] .mb-status.free { background: #0f172a; border-color: #1e40af; }
[data-theme="dark"] .ad-search { background: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .ad-table td { color: #cbd5e1; border-bottom-color: #334155; }
[data-theme="dark"] .ad-table th { border-bottom-color: #334155; }
[data-theme="dark"] .ad-modal { background: #1e293b; }
[data-theme="dark"] .ad-modal-title, [data-theme="dark"] .ad-sub-h { color: #f1f5f9; }
[data-theme="dark"] .ad-field-label { color: #cbd5e1; }
[data-theme="dark"] .ad-select { background-color: #0f172a; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .ad-modal-btn.cancel { background: #334155; color: #cbd5e1; border-color: #475569; }
[data-theme="dark"] .ad-detail-grid > div { border-bottom-color: #334155; }
[data-theme="dark"] .ad-v { color: #cbd5e1; }
[data-theme="dark"] .ad-danger-zone { border-top-color: #334155; }

/* ---------- 管理后台：趋势图表 ---------- */
.ad-range { display: inline-flex; gap: 4px; margin-bottom: 14px; background: #f1f5f9; padding: 3px; border-radius: 10px; }
.ad-range button { font-size: 12.5px; padding: 6px 14px; border: none; background: transparent; color: #64748b; border-radius: 8px; cursor: pointer; font-weight: 500; }
.ad-range button.on { background: #fff; color: #2563eb; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ad-kpi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ad-kpi-card { padding: 16px; background: #fff; border: 1px solid #e6e8eb; border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.ad-kpi-num { font-size: 22px; font-weight: 800; color: #2563eb; line-height: 1.1; }
.ad-kpi-label { font-size: 12px; color: #6b7280; }
.ad-charts { display: flex; flex-direction: column; gap: 14px; }
.ad-chart-card { padding: 18px; background: #fff; border: 1px solid #e6e8eb; border-radius: 14px; }
.ad-chart-title { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 12px; }
.ad-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .ad-chart-row { grid-template-columns: 1fr; } }
.ad-chart { width: 100%; height: auto; display: block; }
.ad-hbars { display: flex; flex-direction: column; gap: 10px; }
.ad-hbar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ad-hbar-label { flex: 0 0 88px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-hbar-track { flex: 1; height: 10px; background: #eef0f2; border-radius: 5px; overflow: hidden; }
.ad-hbar-track i { display: block; height: 100%; border-radius: 5px; transition: width .3s; }
.ad-hbar-val { flex: 0 0 46px; text-align: right; font-weight: 600; color: #2563eb; font-variant-numeric: tabular-nums; }
.ad-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ad-donut { width: 140px; height: 140px; flex: 0 0 auto; }
.ad-donut-legend { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #374151; }
.ad-donut-item { display: flex; align-items: center; gap: 8px; }
.ad-donut-item b { color: #1f2937; }
.ad-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

[data-theme="dark"] .ad-range { background: #0f172a; }
[data-theme="dark"] .ad-range button.on { background: #1e293b; }
[data-theme="dark"] .ad-kpi-card, [data-theme="dark"] .ad-chart-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .ad-chart-title, [data-theme="dark"] .ad-donut-item b { color: #e2e8f0; }
[data-theme="dark"] .ad-hbar-label, [data-theme="dark"] .ad-donut-legend { color: #cbd5e1; }
[data-theme="dark"] .ad-hbar-track { background: #334155; }
/* ---------- 用户端公告横幅 ---------- */
.ann-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin: 0 0 8px; background: linear-gradient(90deg,#eff6ff,#f0f9ff); border-bottom: 1px solid #bfdbfe; font-size: 13.5px; color: #1e40af; position: relative; }
.ann-icon { font-size: 16px; flex: 0 0 auto; }
.ann-body { flex: 1; min-width: 0; }
.ann-title { margin-right: 8px; }
.ann-text { color: #475569; }
.ann-count { font-size: 11px; background: #2563eb; color: #fff; padding: 1px 7px; border-radius: 8px; }
.ann-close { flex: 0 0 auto; border: none; background: transparent; font-size: 20px; line-height: 1; color: #64748b; cursor: pointer; padding: 0 4px; }
.ann-close:hover { color: #1e293b; }
[data-theme="dark"] .ann-banner { background: linear-gradient(90deg,#0f172a,#1e293b); border-bottom-color: #334155; color: #93c5fd; }
[data-theme="dark"] .ann-text { color: #94a3b8; }

/* ---------- 管理后台：公告管理 ---------- */
.ad-ann-item { padding: 14px 16px; border: 1px solid #e6e8eb; border-radius: 12px; margin-bottom: 10px; background: #fff; }
.ad-ann-item.off { opacity: .55; background: #f8fafc; }
.ad-ann-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.ad-ann-head b { font-size: 14px; color: #1f2937; }
.ad-ann-date { font-size: 11.5px; color: #9ca3af; flex: 0 0 auto; }
.ad-ann-body { font-size: 13px; color: #4b5563; line-height: 1.6; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.ad-ann-ops { display: flex; gap: 8px; }

/* ---------- 管理后台：兑换码 ---------- */
.ad-code-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ad-code-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #6b7280; }
.ad-code-form .ad-select { min-width: 110px; }
.ad-code-out { margin-top: 14px; padding: 12px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; }
.ad-hint-sm { font-size: 12px; color: #16a34a; margin-bottom: 6px; }
.ad-code-out textarea { width: 100%; box-sizing: border-box; margin: 0; }

[data-theme="dark"] .ad-ann-item { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .ad-ann-item.off { background: #0f172a; }
[data-theme="dark"] .ad-ann-head b { color: #e2e8f0; }
[data-theme="dark"] .ad-ann-body { color: #cbd5e1; }
[data-theme="dark"] .ad-code-out { background: #0f172a; border-color: #166534; }
/* ===== 管理后台第五批：通知/批量/分析 ===== */
.ad-batch-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e6e8eb; border-radius: 10px; }
.ad-batch-bar .ad-select { min-width: 140px; }
.ad-funnel-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.ad-funnel-label { flex: 0 0 72px; font-size: 13px; color: #374151; }
.ad-funnel-track { flex: 1; height: 22px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.ad-funnel-track i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 6px; transition: width .5s; }
.ad-funnel-num { flex: 0 0 48px; text-align: right; font-weight: 600; color: #2563eb; font-size: 14px; }
.ad-ret-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ad-ret-card { text-align: center; padding: 14px; border: 1px solid #e6e8eb; border-radius: 10px; }
.ad-ret-num { font-size: 24px; font-weight: 700; color: #16a34a; }
.ad-ret-label { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.ad-ret-card .pp-hint { font-size: 11px; margin-top: 2px; }
.batch-ck, #batchAll { width: 15px; height: 15px; cursor: pointer; }
@media (max-width: 700px) { .ad-ret-grid { grid-template-columns: 1fr; } }
[data-theme="dark"] .ad-batch-bar { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .ad-funnel-track { background: #1e293b; }
[data-theme="dark"] .ad-funnel-label { color: #e2e8f0; }
[data-theme="dark"] .ad-ret-card { border-color: #334155; }

/* ===== 顶栏通知铃铛 ===== */
.notif-bell { position: relative; }
.notif-dot { position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px; background: #ef4444; color: #fff; font-size: 10px; line-height: 15px; border-radius: 8px; text-align: center; font-weight: 700; box-shadow: 0 0 0 2px #fff; }
[data-theme="dark"] .notif-dot { box-shadow: 0 0 0 2px #1e293b; }
.notif-panel { position: fixed; z-index: 9998; width: 320px; max-width: calc(100vw - 20px); max-height: 70vh; background: #fff; border: 1px solid #e6e8eb; border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.14); overflow: hidden; display: flex; flex-direction: column; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #eef0f2; font-size: 14px; }
.notif-close { border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: #9ca3af; }
.notif-close:hover { color: #374151; }
.notif-list { overflow-y: auto; }
.notif-empty { padding: 28px; text-align: center; color: #9ca3af; font-size: 13px; }
.notif-item { padding: 12px 14px; border-bottom: 1px solid #f4f6f8; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f0f7ff; }
.notif-item-title { font-size: 13.5px; font-weight: 600; color: #1f2937; margin-bottom: 4px; }
.notif-tag { display: inline-block; background: #ef4444; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-right: 5px; vertical-align: 1px; font-weight: 700; }
.notif-item-body { font-size: 12.5px; color: #4b5563; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.notif-item-time { font-size: 11px; color: #9ca3af; margin-top: 6px; }
[data-theme="dark"] .notif-panel { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .notif-head { border-bottom-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .notif-item { border-bottom-color: #334155; }
[data-theme="dark"] .notif-item.unread { background: #1e3a5f; }
[data-theme="dark"] .notif-item-title { color: #e2e8f0; }
[data-theme="dark"] .notif-item-body { color: #cbd5e1; }
