/* ============================================================
   聚合付微信支付宝投诉AI处理系统 全局样式
   H5 自适应，纯本地CSS
   ============================================================ */

:root {
  --primary: #4a6cf7;
  --primary-dark: #3a5bd9;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #888;
  --border: #e5e7eb;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ============ 顶部导航 ============ */
.navbar {
  background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky; top: 0; z-index: 100;
}
.navbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; height: 56px; gap: 24px; }
.navbar .logo { font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.navbar .logo span { color: var(--primary); }
.nav-links { display: flex; gap: 18px; flex: 1; }
.nav-links a { color: #444; font-size: 14px; padding: 6px 4px; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-user { display: flex; align-items: center; gap: 12px; }
.nav-user .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* ============ 布局 ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.sidebar-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }

/* ============ 卡片 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.05); padding: 20px; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ============ 侧边栏（会员/推广员） ============ */
.sidebar { background: #fff; border-radius: var(--radius); padding: 12px 8px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.sidebar .side-title { font-size: 12px; color: var(--muted); padding: 8px 12px; text-transform: uppercase; letter-spacing: .5px; }
.sidebar a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #555; border-radius: 8px; font-size: 14px; }
.sidebar a:hover { background: #f5f7ff; color: var(--primary); }
.sidebar a.active { background: var(--primary); color: #fff; }

/* ============ 统计卡片 ============ */
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); display: flex; align-items: center; gap: 14px; }
.stat-card .icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; }
.stat-card .num { font-size: 22px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--muted); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f8fafc; color: #666; font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbff; }

/* ============ 按钮 ============ */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; border: 1px solid transparent; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; border: 1px solid #d1d5db; color: #555; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="tel"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(74,108,247,.12); }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; } .form-row > * { flex: 1; }

/* ============ 徽章 ============ */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* ============ 分页 ============ */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page-btn { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 6px; color: #555; font-size: 13px; background: #fff; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.disabled { color: #bbb; cursor: not-allowed; }

/* ============ 弹窗 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 480px; max-width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ============ 提示消息 ============ */
#toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-80px); background: #333; color: #fff; padding: 10px 20px; border-radius: 6px; z-index: 300; font-size: 14px; transition: transform .3s; opacity: 0; }
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.success { background: #16a34a; }
#toast.error { background: #dc2626; }

/* ============ 价格卡片 ============ */
.price-card { text-align: center; padding: 28px 20px; border: 2px solid transparent; transition: .2s; }
.price-card:hover, .price-card.popular { border-color: var(--primary); }
.price-card .p-name { font-size: 16px; font-weight: 600; }
.price-card .p-price { font-size: 32px; font-weight: 700; color: var(--primary); margin: 10px 0; }
.price-card .p-price small { font-size: 14px; color: var(--muted); }
.price-card .p-features { color: #666; font-size: 13px; line-height: 2; margin-bottom: 16px; }

/* ============ 首页 hero ============ */
.hero { background: linear-gradient(135deg, #4a6cf7 0%, #6d5df6 100%); color: #fff; border-radius: 16px; padding: 48px 32px; text-align: center; margin-bottom: 24px; }
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: .9; margin-bottom: 24px; }

/* ============ 站内信 ============ */
.notice-item { padding: 14px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fafbff; }
.notice-item .t { font-weight: 600; font-size: 14px; }
.notice-item .meta { font-size: 12px; color: var(--muted); margin: 4px 0; }
.notice-item .c { font-size: 13px; color: #555; }

/* ============ 概览/数字 ============ */
.big-num { font-size: 28px; font-weight: 700; color: var(--primary); }

/* ============ 404/空状态 ============ */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .icon { font-size: 48px; margin-bottom: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-5 { grid-template-columns: 1fr 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .sidebar { display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .sidebar a { white-space: nowrap; }
  .sidebar .side-title { display: none; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
  .hero { padding: 32px 20px; }
  .form-row { flex-direction: column; }
  .container { padding: 12px; }
}

/* ============ 登录/注册 ============ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #4a6cf7, #6d5df6); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; width: 420px; max-width: 100%; padding: 32px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
.auth-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tabs a { flex: 1; text-align: center; padding: 10px; color: #666; border-bottom: 2px solid transparent; }
.auth-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }


/* ===== 站点底部（版权+联系方式） ===== */
.site-footer {
  margin-top: 48px;
  background: #0f1420;
  color: #aab3c5;
  padding: 32px 0 28px;
  width: 100%;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand { flex: 1 1 300px; max-width: 460px; }
.footer-logo { color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.footer-desc { margin-top: 10px; font-size: 13px; color: #7d8798; line-height: 1.7; }
.footer-col { flex: 0 1 200px; }
.footer-title {
  color: #fff; font-weight: 600; font-size: 14px; margin-bottom: 12px;
  padding-bottom: 8px; position: relative;
}
.footer-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 24px; height: 2px; background: var(--primary); border-radius: 2px;
}
.footer-contact p { font-size: 13px; margin: 7px 0; }
.footer-contact p a { color: #aab3c5; }
.footer-contact p a:hover { color: #fff; }
.footer-copy { font-size: 13px; }
.footer-copy p { margin: 7px 0; }
.footer-icp a { color: #7d8798; text-decoration: none; }
.footer-icp a:hover { color: #fff; }
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; gap: 22px; }
  .footer-brand, .footer-col { max-width: 100%; flex-basis: auto; }
}


/* ===== 功能与限额设置 ===== */
.ftable { width: 100%; border-collapse: collapse; max-width: 680px; }
.ftable th, .ftable td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border, #e5e7eb); font-size: 14px; }
.ftable th { background: rgba(0,0,0,.03); font-weight: 600; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.switch .slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.switch input:checked + .slider { background: var(--primary, #2563eb); }
.switch input:checked + .slider:before { transform: translateX(20px); }
