/* 星匹克后台 */
:root {
  --primary: #0F1B2D;
  --accent: #FF6B35;
  --accent-2: #FFB72B;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --border: #EEF0F4;
  --text: #1A1A2E;
  --text-2: #5C6275;
  --text-3: #9AA3B2;
}

* { box-sizing: border-box; }
html, body, #app {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ============ 登录 ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F1B2D 0%, #1F3B6B 50%, #FF6B35 100%);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.97);
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: 0 24px 64px rgba(0,0,0,.18);
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: linear-gradient(135deg, #FF6B35, #FFB72B);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -3px;
  margin: 0 auto 16px;
  box-shadow: 0 12px 32px rgba(255,107,53,.4);
}
.login-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--primary);
}
.login-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
  letter-spacing: 2px;
}

/* ============ 主框架 ============ */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0F1B2D 0%, #1F3B6B 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.sb-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF6B35, #FFB72B);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -2px;
  box-shadow: 0 6px 14px rgba(255,107,53,.3);
}
.sb-name { font-size: 20px; font-weight: 700; letter-spacing: 3px; }
.sb-sub { font-size: 11px; opacity: .55; margin-top: 2px; letter-spacing: 1px; }
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}
.sb-section {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin: 16px 12px 8px;
  letter-spacing: 2px;
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  margin-bottom: 4px;
  border-radius: 10px;
  font-size: 14px;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  transition: all .15s;
}
.sb-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.sb-item.active {
  background: linear-gradient(135deg, rgba(255,107,53,.2), rgba(255,183,43,.18));
  color: #fff;
  font-weight: 500;
}
.sb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
}
.sb-item.active .sb-dot { opacity: 1; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}
.sb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6B35, #FFB72B);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.sb-username { font-size: 14px; font-weight: 500; }
.sb-role { font-size: 11px; opacity: .55; }

/* ============ 内容区 ============ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.page-title small {
  font-size: 13px;
  color: var(--text-3);
  font-weight: normal;
  margin-left: 12px;
  letter-spacing: 1px;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ============ 看板 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(15,27,45,.04);
  border: 1px solid var(--border);
}
.stat-label {
  font-size: 13px;
  color: var(--text-3);
  letter-spacing: 1px;
}
.stat-num {
  font-size: 32px;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -1px;
}
.stat-card.accent .stat-num {
  background: linear-gradient(135deg, #FF6B35, #FFB72B);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(15,27,45,.04);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar .grow { flex: 1; }

/* Element Plus 主题色微调 */
.el-button--primary {
  background: linear-gradient(135deg, #FF6B35, #FFB72B);
  border: none;
}
.el-button--primary:hover {
  background: linear-gradient(135deg, #FF8158, #FFC555);
  border: none;
}
.el-tag { letter-spacing: 1px; }

.empty-cell {
  color: var(--text-3);
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sb-name, .sb-sub, .sb-username, .sb-role, .sb-section { display: none; }
  .sb-item { justify-content: center; padding: 12px; }
  .sb-item .label { display: none; }
  .login-card { padding: 32px 24px; }
}

/* ============================================================
   ★ 数据大屏样式 ★
============================================================ */
.dash-screen {
  margin: -24px;
  padding: 24px;
  min-height: calc(100vh - 64px);
  background:
    radial-gradient(ellipse at top left, rgba(255,107,53,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(67,97,238,0.18) 0%, transparent 55%),
    linear-gradient(135deg, #050A18 0%, #0A1628 50%, #0F1B2D 100%);
  color: #E0E6F0;
  position: relative;
  overflow: hidden;
}
.dash-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.dash-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 24px;
  z-index: 2;
}
.dash-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(135deg, #00E5FF 0%, #FF6B35 50%, #FFB72B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}
.dash-deco {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}
.dash-deco-line {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, #00E5FF, transparent);
}
.dash-deco-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E5FF;
  box-shadow: 0 0 12px #00E5FF;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.dash-time {
  text-align: right;
  font-family: 'SF Mono', Menlo, monospace;
}
.dash-time .clock {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #00E5FF;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}
.dash-time .date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 2px;
  margin-top: 2px;
}

/* === KPI 卡片 === */
.kpi-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  position: relative;
  background: linear-gradient(135deg, rgba(15, 27, 45, 0.85) 0%, rgba(31, 59, 107, 0.5) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  padding: 22px 24px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.04);
  transition: all 0.3s;
}
.kpi-card:hover {
  border-color: rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.15);
  transform: translateY(-2px);
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 30px; height: 30px;
  border-top: 2px solid #00E5FF;
  border-left: 2px solid #00E5FF;
}
.kpi-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 30px; height: 30px;
  border-bottom: 2px solid #FF6B35;
  border-right: 2px solid #FF6B35;
}
.kpi-card .label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 3px;
  text-transform: uppercase;
}
.kpi-card .value {
  font-size: 38px;
  font-weight: 800;
  margin-top: 8px;
  background: linear-gradient(135deg, #00E5FF 0%, #FFB72B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
  font-family: 'SF Mono', Menlo, monospace;
}
.kpi-card.accent .value {
  background: linear-gradient(135deg, #FF6B35 0%, #FFB72B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card .delta {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.15);
  color: #00E5FF;
  letter-spacing: 1px;
}

/* === 图表面板 === */
.dash-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-grid.row-2 {
  grid-template-columns: 1fr 1fr 1fr;
}
.dash-grid.row-3 {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.dash-card {
  background: linear-gradient(135deg, rgba(15, 27, 45, 0.85) 0%, rgba(15, 27, 45, 0.6) 100%);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 12px;
  padding: 18px;
  position: relative;
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, #00E5FF 0%, transparent 100%);
}
.dash-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 3px;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}
.dash-card-title .bar {
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, #00E5FF, #FF6B35);
  border-radius: 2px;
}
.dash-card-title .en {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 2px;
  margin-left: auto;
  font-weight: 400;
}

.chart-box {
  width: 100%;
  height: 280px;
}
.chart-box.lg { height: 360px; }
.chart-box.sm { height: 220px; }

/* === 实时订单流水 === */
.live-feed {
  height: 280px;
  overflow: hidden;
  position: relative;
}
.live-feed-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feed-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid rgba(0, 229, 255, 0.4);
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.2s;
}
.feed-row:hover {
  background: rgba(0, 229, 255, 0.1);
}
.feed-time {
  font-family: 'SF Mono', Menlo, monospace;
  color: #00E5FF;
  font-size: 11px;
  white-space: nowrap;
}
.feed-user {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  flex-shrink: 0;
}
.feed-action {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}
.feed-title {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-amount {
  color: #FFB72B;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, monospace;
  white-space: nowrap;
}

/* 大屏页内的 button 覆盖 */
.dash-screen .el-button {
  background: rgba(0, 229, 255, 0.1);
  color: #00E5FF;
  border-color: rgba(0, 229, 255, 0.4);
}
.dash-screen .el-button:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: rgba(0, 229, 255, 0.7);
  color: #00E5FF;
}

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-grid, .dash-grid.row-2, .dash-grid.row-3 { grid-template-columns: 1fr; }
}
