* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  color: #1f2733;
  background: #eef1f6;
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: #8a93a3; font-size: 12px; }

/* ============ 登录 ============ */
.view-login { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; background: #0d1424; }
.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(37, 99, 235, .35), transparent 60%),
    radial-gradient(800px 500px at 85% 90%, rgba(59, 130, 246, .28), transparent 60%),
    radial-gradient(500px 400px at 80% 15%, rgba(14, 165, 233, .18), transparent 60%);
}
.login-card {
  position: relative; z-index: 2;
  width: 420px; background: #fff; border-radius: 14px;
  padding: 40px 44px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(212, 175, 55, .35);
  overflow: hidden;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-title { text-align: center; font-size: 22px; color: #111827; letter-spacing: 1px; }
.login-sub { text-align: center; font-size: 12px; color: #8a93a3; margin: 6px 0 26px; }
.login-form .login-label { display: block; font-size: 13px; color: #374151; margin: 14px 0 6px; }
.login-input {
  width: 100%; height: 42px; border: 1px solid #d7dce5; border-radius: 8px;
  padding: 0 12px; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.login-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.login-error { min-height: 20px; margin-top: 8px; font-size: 13px; color: #dc2626; }
.login-btn {
  width: 100%; height: 44px; margin-top: 10px;
  border: none; border-radius: 8px; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff; font-size: 16px; letter-spacing: 6px; font-weight: 600;
  transition: opacity .15s, transform .05s;
}
.login-btn:hover { opacity: .92; }
.login-btn:active { transform: scale(.99); }
.login-btn.disabled { opacity: .6; cursor: not-allowed; }
.login-foot { text-align: center; font-size: 11px; color: #9aa3b2; margin-top: 22px; }

/* ============ 主框架 ============ */
.view-main { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 54px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; background: #151b2c; color: #fff;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.topbar-logo img { width: 100%; height: 100%; object-fit: cover; }
.topbar-title { font-size: 16px; letter-spacing: 1px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.conn-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #9ca8bc; }
.conn-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 6px #34d399; }
.conn-status.offline .dot { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
/* 数据加载状态条（登录新账号后显示加载倒计时） */
.load-status {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  z-index: 150; padding: 7px 18px; border-radius: 8px;
  background: #1d2b4a; color: #7dd3fc; font-size: 13px; font-weight: 600;
  border: 1px solid #2d4a7a; box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  white-space: nowrap; letter-spacing: .3px;
}
.load-status.ok { color: #6ee7b7; border-color: #2d6a4f; background: #123524; }
.load-status.warn { color: #fbbf24; border-color: #7a5a2d; background: #3a2d12; }
.topbar-account { font-size: 13px; color: #dbe3f0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-ghost {
  border: 1px solid #3a445c; background: transparent; color: #b6c0d4;
  padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.btn-ghost:hover { border-color: #64748b; color: #fff; }

.main-body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 200px; flex: none; background: #1a2133;
  display: flex; flex-direction: column;
}
.menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; color: #a7b1c6; cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent; transition: background .12s, color .12s;
}
.menu-item:hover { background: #232c44; color: #e6ecf7; }
.menu-item.active { background: #2563eb; color: #fff; border-left-color: #93c5fd; }
.mi-icon { width: 18px; text-align: center; font-size: 13px; opacity: .9; }
.sidebar-foot { padding: 12px 16px; font-size: 11px; color: #5b6478; border-top: 1px solid #252e45; }

/* ============ 内容区 ============ */
.content { flex: 1; overflow: auto; padding: 18px 20px 64px; }
.page { max-width: 1500px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.page-title { display: flex; align-items: baseline; gap: 10px; }
.page-title h2 { font-size: 20px; color: #111827; }
.page-sub { font-size: 12px; color: #8a93a3; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.range-group, .tab-group { display: inline-flex; background: #e3e8f0; border-radius: 8px; padding: 3px; }
.range-group button, .tab-group button {
  border: none; background: transparent; padding: 6px 14px; border-radius: 6px;
  font-size: 13px; color: #4b5563; cursor: pointer; transition: all .12s;
}
.range-group button.active, .tab-group button.active { background: #fff; color: #2563eb; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.btn-primary {
  border: none; border-radius: 7px; cursor: pointer; padding: 7px 16px;
  background: #2563eb; color: #fff; font-size: 13px; transition: opacity .15s;
}
.btn-primary:hover { opacity: .9; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-plain {
  border: 1px solid #d7dce5; background: #fff; border-radius: 7px; cursor: pointer;
  padding: 6px 14px; font-size: 13px; color: #374151; transition: border-color .15s;
}
.btn-plain:hover { border-color: #2563eb; color: #2563eb; }
/* 设置面板：弹窗检测按钮 */
.set-testbtns { display: flex; gap: 10px; flex-wrap: wrap; }
.set-testbtns button { flex: 1; min-width: 110px; padding: 9px 14px; font-size: 13px; }
.refresh-info { font-size: 12px; color: #8a93a3; }

/* ============ 数据卡片 ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cards.mini { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 14px 0; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
  border-top: 3px solid #2563eb; position: relative; overflow: hidden;
}
.stat-card .c-label { font-size: 13px; color: #6b7280; }
.stat-card .c-value { font-size: 26px; font-weight: 700; color: #111827; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .c-sub { font-size: 11px; color: #9aa3b2; margin-top: 6px; }
.stat-card.c2 { border-top-color: #06b6d4; }
.stat-card.c3 { border-top-color: #8b5cf6; }
.stat-card.c4 { border-top-color: #f59e0b; }
.stat-card.c5 { border-top-color: #10b981; }
.stat-card.c6 { border-top-color: #ec4899; }

/* ============ 面板 / 表格 ============ */
.panel { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(16,24,40,.06); padding: 16px; margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 600; color: #111827; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid #eef1f6; }
.filter-bar select, .filter-bar input {
  height: 34px; border: 1px solid #d7dce5; border-radius: 7px; padding: 0 10px;
  font-size: 13px; outline: none; background: #fff; color: #1f2733;
}
.filter-bar select:focus, .filter-bar input:focus { border-color: #2563eb; }
.filter-bar .f-label { font-size: 13px; color: #6b7280; }

.table-wrap { overflow: auto; margin-top: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  position: sticky; top: 0; background: #f6f8fb; color: #4b5563; font-weight: 600;
  padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e5e9f0;
  z-index: 1;
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid #f0f2f7; white-space: nowrap; color: #1f2733; font-variant-numeric: tabular-nums; }
.data-table tbody tr:hover { background: #f7faff; }
.data-table .num { text-align: right; }
.data-table th.num { text-align: right; }
.data-table .total-row td { background: #f0f6ff; font-weight: 700; color: #1e40af; }
.empty-tip { text-align: center; color: #9aa3b2; padding: 46px 0; font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px; font-size: 13px; color: #4b5563; }
.pager button {
  border: 1px solid #d7dce5; background: #fff; border-radius: 6px; cursor: pointer;
  padding: 5px 12px; font-size: 13px; color: #374151;
}
.pager button:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .page-info { margin: 0 4px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.tag-blue { background: #e0edff; color: #1d4ed8; }
.tag-green { background: #dff7ea; color: #047857; }
.tag-gray { background: #eef1f5; color: #64748b; }
.tag-amber { background: #fdf0d9; color: #b45309; }
.tag-purple { background: #f0e8ff; color: #6d28d9; }

/* ============ 趋势图 ============ */
.trend { padding: 6px 4px 4px; }
.trend-empty { text-align: center; color: #9aa3b2; padding: 30px 0; font-size: 13px; }
.trend-chart { display: flex; align-items: flex-end; gap: 14px; height: 230px; padding: 10px 6px 0; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.trend-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.trend-bar { width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .4s; }
.trend-bar.b-pay { background: linear-gradient(180deg, #2563eb, #60a5fa); }
.trend-bar.b-reg { background: linear-gradient(180deg, #0ea5e9, #7dd3fc); }
.trend-val { font-size: 11px; color: #374151; font-variant-numeric: tabular-nums; }
.trend-day { font-size: 12px; color: #6b7280; }
.trend-legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; font-size: 12px; color: #6b7280; }
.trend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.trend-legend .l-pay i { background: #2563eb; }
.trend-legend .l-reg i { background: #0ea5e9; }

/* ============ 我的信息 ============ */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px 26px; padding: 8px 0; }
.info-item { display: flex; align-items: center; min-height: 34px; }
.info-item .label { width: 150px; flex: none; color: #6b7280; text-align: right; margin-right: 12px; }
.info-item .value { flex: 1; color: #111827; font-weight: 500; word-break: break-all; }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal { width: 380px; background: #fff; border-radius: 12px; padding: 22px 24px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-title { font-size: 16px; font-weight: 600; color: #111827; margin-bottom: 12px; }
.modal-body { font-size: 14px; color: #374151; line-height: 1.7; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c3cad6; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #9aa5b5; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 双后台版（追加） ============ */
/* 登录：双卡片布局 */
.login-wrap { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.login-hero { text-align: center; margin-bottom: 8px; }
.login-hero .login-logo { margin-bottom: 12px; }
.login-hero .login-title { color: #fff; }
.login-hero .login-sub { color: #8fa0c0; margin-bottom: 18px; }
.login-cards { display: flex; gap: 22px; }
.login-card {
  position: relative; z-index: 2;
  width: 360px; background: #fff; border-radius: 14px;
  padding: 26px 30px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.lc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.lc-badge {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
}
.lc-badge.b1 { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.lc-badge.b2 { background: linear-gradient(135deg, #059669, #10b981); }
.lc-name { font-size: 16px; font-weight: 600; color: #111827; }
.lc-desc { font-size: 11px; color: #8a93a3; margin-top: 2px; }
.login-card .login-label { display: block; font-size: 13px; color: #374151; margin: 12px 0 5px; }
.cap-row { display: flex; gap: 10px; margin-top: 12px; }
.cap-row .login-input { margin-top: 0; }
.cap-input { flex: 1; }
.cap-img {
  width: 116px; height: 42px; flex: none; border: 1px solid #d7dce5; border-radius: 8px;
  cursor: pointer; object-fit: cover; background: #f3f5f9;
}
.login-btn.yx { background: linear-gradient(135deg, #059669, #10b981); }
.login-foot { text-align: center; font-size: 11px; color: #7d8db0; margin-top: 22px; }

/* 顶栏后台切换 */
.backend-switch { display: flex; gap: 6px; margin-left: 18px; }
.backend-switch button {
  border: 1px solid #33405c; background: transparent; color: #9fb0cd;
  padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 12px;
  transition: all .12s;
}
.backend-switch button:hover { border-color: #64748b; color: #e6ecf7; }
.backend-switch button.active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* 游昕页面：金额列 / 汇总 */
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-cell { text-align: center; color: #8a93a3; padding: 24px 0; }

/* ============ 主题系统（v2.7） ============ */
:root {
  --bg: #eef1f6; --topbar: #151b2c; --sidebar: #1a2133; --menu-hover: #232c44;
  --accent: #2563eb; --accent2: #06b6d4; --panel: #ffffff; --text: #111827;
}
body[data-theme="purple"] { --bg:#efeaf7; --topbar:#1c1330; --sidebar:#241a3d; --menu-hover:#33285a; --accent:#7c3aed; --accent2:#a78bfa; --panel:#ffffff; --text:#1a102e; }
body[data-theme="green"]  { --bg:#ebf4f0; --topbar:#0e1f1a; --sidebar:#142b22; --menu-hover:#1d3a2f; --accent:#059669; --accent2:#34d399; --panel:#ffffff; --text:#0c1f18; }
body[data-theme="gold"]   { --bg:#f5f0e3; --topbar:#17130a; --sidebar:#221c10; --menu-hover:#3a301a; --accent:#b8860b; --accent2:#eab308; --panel:#ffffff; --text:#201a08; }

body { background: var(--bg); }
.topbar { background: var(--topbar); }
.sidebar { background: var(--sidebar); }
.menu-item:hover { background: var(--menu-hover); }
.menu-item.active { background: var(--accent); }
.btn-primary { background: var(--accent); }
.btn-plain:hover { border-color: var(--accent); color: var(--accent); }
.login-btn { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.range-group button.active, .tab-group button.active { color: var(--accent); }
.range-group button.active, .tab-group button.active { background: #fff; }
.btn-primary:focus-visible { outline: 2px solid var(--accent); }
.stat-card { border-top-color: var(--accent); }
.page-title h2, .panel-title { color: var(--text); }

/* ============ 设置面板 ============ */
.modal-mask { position: fixed; inset: 0; background: rgba(10,15,30,.55); z-index: 900; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 14px; padding: 22px 24px; width: 460px; max-width: 92vw; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.modal-title { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.set-group { margin-bottom: 18px; }
.set-label { font-size: 13px; color: #374151; font-weight: 600; margin-bottom: 8px; }
.set-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.set-opts label {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #4b5563;
  border: 1px solid #d7dce5; border-radius: 7px; padding: 6px 12px; cursor: pointer; background: #fafbfd;
}
.set-opts label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: rgba(37,99,235,.06); }
.set-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #4b5563;
  border: 1px solid #d7dce5; border-radius: 8px; padding: 7px 12px; cursor: pointer; background: #fafbfd;
}
.sw i { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--sw1), var(--sw2)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.sw.sel { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ============ 登录记住账号密码 ============ */
.remember-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px; font-size: 13px; color: #6b7280; cursor: pointer; user-select: none;
}
.remember-row input { accent-color: var(--accent, #2563eb); cursor: pointer; }

/* 数据更新时间条（底部固定，显示最近一次刷新时间 + 版本号） */
#data-stamp {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 9500;
  max-width: 94%;
  background: rgba(15, 23, 42, .72);
  color: #c7d2fe;
  font-size: 10.5px; line-height: 1;
  padding: 6px 14px; border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .35s;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}
#data-stamp.show { opacity: 1; }