@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('style.css');
:root {
  --color-primary: #1d4ed8;
  --color-primary-hover: #1e40af;
  --color-accent-soft: #eff6ff;
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-muted: #94a3b8;
  --sidebar-active: #0f172a;
  --sidebar-hover: #f1f5f9;
  --card-bg: #ffffff;
  --bg-secondary: #f1f5f9;
  --border-color: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --tag-red: #ef4444;
  --tag-green: #10b981;
  --tag-blue: #3b82f6;
  --tag-yellow: #f59e0b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
* { transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.app { display: flex; min-height: 100vh; }
.side {
  width: 248px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.02);
}
.side-header { padding: 22px 20px 8px; }
.side-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.3;
}
.side-brand { font-size: 17px; font-weight: 600; color: #0f172a; letter-spacing: -0.02em; margin-top: 4px; }
.nav { list-style: none; padding: 6px 10px; flex: 1; }
.nav a,
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  margin: 1px 0;
  cursor: pointer;
  font-weight: 450;
}
.nav-ic { display: inline-flex; color: #94a3b8; flex-shrink: 0; }
.nav a:hover .nav-ic,
.nav-item:hover .nav-ic,
.nav a.active .nav-ic,
.nav-item.active .nav-ic { color: var(--color-primary); }
.nav .nav-svg { width: 18px; height: 18px; }
.nav a:hover,
.nav-item:hover { background: var(--sidebar-hover); color: #0f172a; }
.nav a.active,
.nav-item.active {
  border-left-color: var(--color-primary);
  background: var(--color-accent-soft);
  color: #0f172a;
  font-weight: 600;
}
.nav-sep { height: 1px; background: var(--border-color); margin: 10px 14px; }
.side-foot { padding: 12px 16px 20px; border-top: 1px solid var(--border-color); background: #fafbfc; }
.side-user { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.45; }
.btn-out {
  width: 100%;
  padding: 8px 12px;
  background: #fff;
  color: #475569;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.btn-out:hover { border-color: #cbd5e1; color: #0f172a; background: #f8fafc; }
.main { flex: 1; min-width: 0; padding: 28px 32px; }
.page-title {
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-color);
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card.card-hot-elev { border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
/* 语言：胶囊分段，侧栏 + 登录页共用 .lang-pill* */
.lang-tabs { display: inline-flex; width: 100%; padding: 3px; background: #e2e8f0; border-radius: 9px; gap: 0; }
.lang-tabs.lang-tabs--loose { width: auto; padding: 3px; background: #e2e8f0; border-radius: 9px; gap: 0; }
.lang-tab {
  cursor: pointer;
  padding: 7px 0;
  flex: 1;
  text-align: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  user-select: none;
  border: none;
  background: transparent;
}
.lang-tab.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.lang-tabs.lang-tabs--loose .lang-tab { flex: none; min-width: 64px; padding: 6px 12px; }
.lang-tabs.lang-tabs--loose .lang-tab.active { background: #fff; }
.btn { height: 34px; padding: 0 16px; background: var(--color-primary); color: #fff; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.btn:hover { background: var(--color-primary-hover); }
.btn-ghost, .btn-sec { background: #fff; color: #374151; border: 1px solid #d1d5db; }
.btn-ghost:hover, .btn-sec:hover { background: #f9fafb; border-color: #9ca3af; }
.btn.btn-danger { background: #dc2626; }
.btn.btn-danger:hover { background: #b91c1c; }
.btn-sm { height: 28px; font-size: 12px; padding: 0 10px; }
.inp, input.inp, select.inp, textarea.inp, .sel { height: 34px; padding: 0 10px; background: #f9fafb; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.search-bar, .filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.superonly { display: none; }
.app.is-superadmin .superonly { display: list-item; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 10px 12px; }
table.data th { background: #f9fafb; color: #6b7280; font-size: 11px; font-weight: 600; text-transform: uppercase; border-bottom: 2px solid #e5e7eb; }
table.data td { font-size: 13px; color: #374151; border-bottom: 1px solid #f3f4f6; }
table.data tbody tr:nth-child(even) td { background: #fafbfc; }
table.data tr:hover td { background: #f0f4ff; }
input.inp[type="search"] {
  padding-left: 32px;
  background: #f9fafb
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2394a3b8' viewBox='0 0 24 24'%3E%3Cpath stroke-width='2' d='M21 21l-4.35-4.35'/%3E%3Ccircle cx='10.5' cy='10.5' r='7' stroke-width='2'/%3E%3C/svg%3E")
    10px center / 14px 14px no-repeat;
}
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag { font-size: 11px; background: #f3f4f6; color: #6b7280; }
.tag.blue, .tag.pill { background: #eff6ff; color: #2563eb; }
.tag.green { background: #ecfdf5; color: #059669; }
.tag.red { background: #fef2f2; color: #dc2626; }
.tag.yellow { background: #fffbeb; color: #b45309; }
.muted { color: #9ca3af; font-size: 12px; }
.row-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.w-full { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { text-align: left; padding: 16px 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.stat .label { display: block; font-size: 12px; color: #6b7280; margin-top: 0; }
.stat .num { display: block; font-size: 28px; font-weight: 700; color: #2563eb; margin-top: 4px; }
.stat-item { text-align: left; padding: 16px 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.stat-label { font-size: 12px; color: #6b7280; }
.stat-value { font-size: 28px; font-weight: 700; color: #2563eb; margin-top: 4px; }
.ph { color: #9ca3af; font-size: 14px; text-align: center; padding: 24px; }
.section-t { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #0f172a; letter-spacing: -0.01em; }
.h-chart { min-height: 300px; }
.h-table { min-height: 180px; }
.h-bot { min-height: 160px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.form-grid label { display: block; font-size: 13px; color: #374151; margin-bottom: 4px; }
.form-grid .inp { width: 100%; }
.layout-chat { display: flex; min-height: calc(100vh - 140px); background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.conv-list { width: 280px; flex-shrink: 0; background: #fafbfc; border-right: 1px solid #e2e8f0; overflow-y: auto; }
.conv-item { padding: 12px 14px; border-bottom: 1px solid #e2e8f0; cursor: pointer; }
.conv-item:hover { background: #f3f4f6; }
.conv-item.active { background: #eff6ff; border-left: 3px solid #2563eb; padding-left: 11px; }
.conv-item .t1 { font-size: 14px; font-weight: 600; color: #1f2937; }
.conv-item .t2 { font-size: 12px; color: #6b7280; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .t3 { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.conv-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #e8eaed; position: relative; }
.conv-head { padding: 12px 16px; background: #fff; border-bottom: 1px solid #e2e8f0; font-weight: 600; font-size: 15px; }
.conv-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 500px; }
.msg-row { display: flex; }
.msg-row.out { justify-content: flex-end; }
.msg-bubble { max-width: 72%; padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg-bubble.in { background: #fff; border: 1px solid #e2e8f0; }
.msg-bubble.out { background: #2563eb; color: #fff; }
.msg-bubble.out .msg-time { color: rgba(255,255,255,0.85); }
.msg-img { max-width: 220px; max-height: 200px; border-radius: 8px; display: block; }
.msg-link { color: inherit; text-decoration: underline; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.btn-pin { font-size: 11px; padding: 2px 6px; border: 1px solid #e2e8f0; background: #fff; color: #2563eb; border-radius: 4px; cursor: pointer; }
.btn-pin:hover { background: #eff6ff; }
.emoji-pop { position: absolute; bottom: 48px; right: 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; z-index: 20; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.emo-cell { border: none; background: #f3f4f6; font-size: 20px; cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 4px; }
.emo-cell:hover { background: #e0f2fe; }
.upload-preview { font-size: 12px; color: #6b7280; padding: 0 12px 6px; background: #fff; }
.inv-add-row { background: #f9fafb; }
.inv-add-row .inv-cell { width: 100%; min-width: 0; }
.msg-time { font-size: 10px; color: #9ca3af; margin-top: 4px; }
.conv-composer { padding: 10px 12px; background: #fff; border-top: 1px solid #e2e8f0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: relative; }
.conv-composer .inp { flex: 1; min-width: 120px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 2000; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px 28px; width: 90%; max-width: 520px; min-width: 380px; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
.modal-h, .modal-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; color: #1f2937; }
.form-stack label, .form-grid label { display: block; font-size: 13px; color: #374151; margin: 0 0 4px; }
.form-stack { margin-bottom: 12px; }
.form-stack .inp { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.wx-verify-prompt {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  max-width: 320px;
}
.wx-verify-prompt-line { font-size: 13px; color: #1f2937; margin: 0 0 6px; }
.wx-verify-hint { font-size: 12px; margin: 0 0 8px; line-height: 1.5; }
.wx-verify-a { color: var(--color-primary); font-weight: 500; }
.wx-verify-a:hover { text-decoration: underline; }
#wx-verify-modal { z-index: 3000; }
#wx-verify-modal .modal-box { min-width: unset; }
tr.amount-high { background: #fffbeb; }
tr.amount-high td { font-weight: 600; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.badge.s-pend { background: #fef3c7; color: #92400e; }
.badge.s-prog { background: #dbeafe; color: #1e40af; }
.badge.s-won { background: #d1fae5; color: #065f46; }
.badge.s-lost { background: #f3f4f6; color: #4b5563; }
.badge.s-rep { background: #e0e7ff; color: #3730a3; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #e2e8f0; margin-bottom: 16px; flex-wrap: wrap; }
.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: #6b7280; font-size: 14px; }
.tab:hover { color: #2563eb; }
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.rank-1 { background: linear-gradient(90deg, #fffbeb 0%, #fff 100%); }
.rank-2 { background: linear-gradient(90deg, #f3f4f6 0%, #fff 100%); }
.rank-3 { background: linear-gradient(90deg, #fff7ed 0%, #fff 100%); }
.rank-medal { font-size: 1.1em; }
.st-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 4px; }
.st-tag.active { background: #d1fae5; color: #065f46; }
.st-tag.sold { background: #f3f4f6; color: #4b5563; }
.st-tag.archived { background: #fef3c7; color: #92400e; }
.lv-warn { background: #fef3c7; color: #92400e; }
.lv-block { background: #fee2e2; color: #991b1b; }
.lv-mon { background: #f3f4f6; color: #4b5563; }
.ac-alert { background: #dbeafe; color: #1e40af; }
.ac-block { background: #fee2e2; color: #991b1b; }
.ac-log { background: #e5e7eb; color: #374151; }
.dot-online { color: #10b981; }
.dot-offline { color: #9ca3af; }
.dot-pending, .dot-connecting { color: #f59e0b; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pager .btn { padding: 6px 12px; font-size: 13px; }
.stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .stats-3 { grid-template-columns: 1fr; } }
