/* ========== 全局基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1e6fd9;
  --primary-dark: #1559b3;
  --success: #23a26d;
  --warning: #e8840c;
  --danger: #dc4444;
  --text: #1f2d3d;
  --text-sub: #7a8a9d;
  --border: #e3e9f0;
  --bg: #f2f5f9;
  --card: #ffffff;
  --sidebar: #16233a;
}
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input.error, select.error { border-color: var(--danger); }

/* ========== 按钮 ========== */
.btn {
  border: none; border-radius: 6px; padding: 8px 18px; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-plain { background: #eef2f7; color: var(--text); }
.btn-plain:hover { background: #e2e8f0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }

/* ========== 登录页 ========== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #12325e 0%, #1e6fd9 55%, #37a0d8 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-wrap { width: 420px; max-width: 92vw; }
.login-brand { text-align: center; color: #fff; margin-bottom: 24px; }
.brand-logo {
  width: 84px; height: 84px; margin: 0 auto 12px; border-radius: 20px;
  background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.login-brand h1 { font-size: 26px; letter-spacing: 2px; }
.login-brand p { font-size: 12px; opacity: .75; margin-top: 6px; letter-spacing: 1px; }
.login-panel {
  background: var(--card); border-radius: 14px; padding: 26px 28px;
  box-shadow: 0 18px 50px rgba(8, 30, 70, .35);
}
.login-panel h2 { font-size: 16px; margin-bottom: 14px; color: var(--text); }
.ver-select { display: flex; gap: 12px; margin-bottom: 18px; }
.ver-card {
  flex: 1; border: 2px solid var(--border); border-radius: 10px; padding: 14px 8px;
  text-align: center; cursor: pointer; color: var(--text-sub); transition: all .18s;
}
.ver-card svg { margin-bottom: 6px; }
.ver-card b { display: block; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.ver-card span { font-size: 11px; }
.ver-card.selected { border-color: var(--primary); background: #eef5ff; color: var(--primary); }
.ver-card.selected b { color: var(--primary); }
.input-item { margin-bottom: 14px; }
.input-item label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.login-tip { text-align: center; color: var(--text-sub); font-size: 12px; margin-top: 12px; }
.copyright { text-align: center; color: rgba(255,255,255,.65); font-size: 12px; margin-top: 18px; }

/* ========== 电脑版布局 ========== */
.desk-layout { display: flex; min-height: 100vh; }
.desk-sidebar {
  width: 216px; background: var(--sidebar); color: #b8c6da;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.desk-logo {
  height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; color: #fff; font-size: 16px; font-weight: bold;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.desk-menu { flex: 1; padding: 12px 0; overflow-y: auto; }
.desk-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  cursor: pointer; font-size: 14px; border-left: 3px solid transparent;
}
.desk-menu-item svg { flex-shrink: 0; opacity: .8; }
.desk-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.desk-menu-item.active { background: rgba(30,111,217,.28); color: #fff; border-left-color: var(--primary); }
.desk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.desk-topbar {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
}
.desk-topbar h3 { font-size: 17px; }
.topbar-user { display: flex; align-items: center; gap: 12px; color: var(--text-sub); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.desk-content { flex: 1; padding: 20px; overflow-y: auto; }

/* ========== 卡片/统计 ========== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(20,40,80,.06); display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-num { font-size: 24px; font-weight: bold; line-height: 1.2; }
.stat-label { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.c-blue { background: #e7f0fd; color: var(--primary); }
.c-green { background: #e5f6ef; color: var(--success); }
.c-orange { background: #fdf0e0; color: var(--warning); }
.c-red { background: #fbe7e7; color: var(--danger); }

.panel { background: var(--card); border-radius: 10px; box-shadow: 0 1px 3px rgba(20,40,80,.06); margin-bottom: 18px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h4 { font-size: 15px; }
.panel-body { padding: 16px 18px; }
.panel-body.no-pad { padding: 0; }

/* ========== 表格 ========== */
.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data-table th, table.data-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table th { background: #f7fafc; color: var(--text-sub); font-weight: normal; }
table.data-table tbody tr:hover { background: #f5f9ff; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px;
}
.tag-green { background: #e5f6ef; color: var(--success); }
.tag-blue { background: #e7f0fd; color: var(--primary); }
.tag-orange { background: #fdf0e0; color: var(--warning); }
.tag-red { background: #fbe7e7; color: var(--danger); }
.tag-gray { background: #eef2f7; color: var(--text-sub); }
.row-ops .btn { margin-right: 6px; }
.empty-tip { text-align: center; color: var(--text-sub); padding: 40px 0; }

/* ========== 图表(纯CSS柱状) ========== */
.chart { display: flex; align-items: flex-end; gap: 22px; height: 180px; padding: 10px 6px 0; }
.chart-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart-bar { width: 46%; max-width: 52px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #57a0ec, #1e6fd9); min-height: 4px; transition: height .4s; }
.chart-val { font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }
.chart-label { font-size: 12px; color: var(--text-sub); margin-top: 8px; }
.chart-pair { display: flex; gap: 5px; width: 100%; justify-content: center; align-items: flex-end; height: 100%; }
.chart-pair .chart-bar { width: 20px; }
.chart-pair .bar-in { background: linear-gradient(180deg, #57a0ec, #1e6fd9); }
.chart-pair .bar-out { background: linear-gradient(180deg, #5ecf9a, #23a26d); }
.legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-sub); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* ========== 模态框/提示 ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 30, 55, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #fff; border-radius: 12px; width: 480px; max-width: 92vw;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(10,25,55,.3);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: bold;
}
.modal-close { border: none; background: none; font-size: 22px; color: var(--text-sub); line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); text-align: right; display: flex; justify-content: flex-end; gap: 10px; }
.form-item { display: flex; align-items: center; margin-bottom: 13px; }
.form-item label { width: 92px; flex-shrink: 0; font-size: 13px; color: var(--text-sub); }
.form-item label i { color: var(--danger); font-style: normal; margin-right: 3px; }
.confirm-text { padding: 12px 4px; color: var(--text); font-size: 14px; }

#toast-box { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; }
.toast {
  background: rgba(30, 45, 70, .92); color: #fff; padding: 10px 22px; border-radius: 8px;
  font-size: 13px; margin-bottom: 8px; opacity: 0; transform: translateY(-8px); transition: all .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ========== 手机版布局 ========== */
.mob-layout { min-height: 100vh; background: var(--bg); padding-bottom: 62px; }
.mob-topbar {
  position: sticky; top: 0; z-index: 50; height: 52px;
  background: linear-gradient(135deg, #1559b3, #1e6fd9); color: #fff;
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px;
  font-size: 16px; font-weight: bold;
}
.mob-topbar .logout-btn {
  border: 1px solid rgba(255,255,255,.5); background: none; color: #fff;
  font-size: 12px; padding: 4px 12px; border-radius: 20px;
}
.mob-content { padding: 12px; }
.mob-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 58px; z-index: 50;
  background: #fff; border-top: 1px solid var(--border);
  display: flex; box-shadow: 0 -2px 10px rgba(20,40,80,.05);
}
.mob-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-sub); font-size: 11px; cursor: pointer;
}
.mob-tab.active { color: var(--primary); }
.mob-tab svg { width: 22px; height: 22px; }
.mob-cards { display: flex; flex-direction: column; gap: 10px; }
.mob-card {
  background: #fff; border-radius: 10px; padding: 14px;
  box-shadow: 0 1px 3px rgba(20,40,80,.06);
}
.mob-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mob-card-head b { font-size: 15px; }
.mob-card .sub { color: var(--text-sub); font-size: 12px; margin-top: 4px; }
.mob-kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.mob-kv span:last-child { color: var(--text); }
.mob-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mob-stat {
  background: #fff; border-radius: 10px; padding: 14px;
  box-shadow: 0 1px 3px rgba(20,40,80,.06);
}
.mob-stat .num { font-size: 22px; font-weight: bold; }
.mob-stat .lab { font-size: 12px; color: var(--text-sub); margin-top: 3px; }
.mob-section-title { font-size: 14px; color: var(--text-sub); margin: 14px 2px 8px; }
.mob-menu-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mob-menu-item {
  background: #fff; border-radius: 10px; padding: 14px 6px; text-align: center;
  box-shadow: 0 1px 3px rgba(20,40,80,.06); cursor: pointer; font-size: 12px; color: var(--text);
}
.mob-menu-item svg { width: 26px; height: 26px; color: var(--primary); margin-bottom: 6px; }
.mob-actions { display: flex; gap: 8px; margin-top: 10px; }
.mob-actions .btn { flex: 1; justify-content: center; padding: 7px 0; font-size: 13px; }
.mob-filter { display: flex; gap: 8px; margin-bottom: 10px; }
.mob-filter input, .mob-filter select { flex: 1; }

/* 进度条 */
.progress { width: 100%; height: 8px; background: #edf1f6; border-radius: 5px; overflow: hidden; }
.progress-inner { height: 100%; border-radius: 5px; background: var(--success); transition: width .4s; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8d3e0; border-radius: 4px; }

@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
