* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: #f0f2f5; color: #333; }

/* 登录页 */
.login-page { height: 100vh; background: linear-gradient(135deg, #1a1a3e, #0f0f23); display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; padding: 40px; border-radius: 16px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.login-logo-img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 16px; }
.login-box h1 { font-size: 22px; color: #1a1a3e; margin-bottom: 4px; }
.login-sub { color: #999; font-size: 13px; margin-bottom: 28px; }
.form-group { text-align: left; margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.form-group input { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; transition: border .2s; }
.form-group input:focus { border-color: #6366f1; }
.btn-login { width: 100%; padding: 12px; background: linear-gradient(135deg, #6366f1, #8b9cf7); color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; margin-top: 8px; }
.btn-login:hover { opacity: .9; }
.login-tip { margin-top: 16px; font-size: 12px; color: #bbb; }

/* 主界面 */
.main-page { display: flex; height: 100vh; }
.sidebar { width: 220px; background: #1a1a3e; color: #fff; display: flex; flex-direction: column; }
.sidebar-logo { padding: 20px; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-logo-img { width: 32px; height: 32px; border-radius: 8px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group { padding: 12px 20px 6px; font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: 1px; }
.nav-item { padding: 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.7); transition: all .2s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(99,102,241,.3), transparent); color: #fff; border-left: 3px solid #6366f1; }
.nav-icon { font-size: 16px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }

/* 主内容 */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.top-bar { height: 56px; background: #fff; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.page-title { font-size: 18px; font-weight: 600; color: #1a1a3e; }
.top-bar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #666; }
.online-dot { width: 8px; height: 8px; background: #34d399; border-radius: 50%; display: inline-block; }
.admin-name { color: #1a1a3e; font-weight: 500; }
.page-content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-cards-small { grid-template-columns: repeat(6, 1fr); }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat-card.small { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-value { font-size: 24px; font-weight: 700; color: #1a1a3e; }
.stat-card.small .stat-value { font-size: 20px; }
.stat-label { font-size: 13px; color: #999; }
.stat-trend { font-size: 12px; color: #34d399; margin-top: 2px; }
.stat-trend.up { color: #34d399; }

/* 图表区 */
.chart-section { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.chart-card.wide { grid-column: span 1; }
.chart-card h3 { font-size: 15px; color: #1a1a3e; margin-bottom: 16px; }
.chart-area { min-height: 180px; display: flex; align-items: flex-end; }

/* 柱状图 */
.bar-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 160px; width: 100%; gap: 8px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar { width: 100%; max-width: 40px; background: linear-gradient(180deg, #6366f1, #8b9cf7); border-radius: 4px 4px 0 0; display: flex; align-items: flex-start; justify-content: center; min-height: 4px; position: relative; }
.bar span { position: absolute; top: -20px; font-size: 11px; color: #666; }
.bar-label { font-size: 11px; color: #999; margin-top: 6px; }

/* 饼图图例 */
.pie-legend { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.pie-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #333; }
.pie-dot { width: 12px; height: 12px; border-radius: 3px; }

/* 指标列表 */
.metric-list { display: flex; flex-direction: column; gap: 10px; }
.metric-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.metric-row span:last-child { font-weight: 600; color: #6366f1; }

/* 工具栏 */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.search-input { padding: 8px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; width: 200px; outline: none; }
.search-input:focus { border-color: #6366f1; }
.filter-select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; background: #fff; }
.btn-primary { padding: 8px 18px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-primary:hover { background: #5558e3; }
.btn-secondary { padding: 8px 18px; background: #f0f0f0; color: #333; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-link { background: none; border: none; color: #6366f1; cursor: pointer; font-size: 13px; padding: 2px 6px; }
.btn-link.danger { color: #ef4444; }

/* 表格 */
.table-card { background: #fff; border-radius: 12px; overflow-x: auto; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 800px; }
.data-table th { background: #f8f9fc; padding: 12px 14px; text-align: left; color: #666; font-weight: 500; border-bottom: 1px solid #eee; white-space: nowrap; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f5f5f5; color: #333; }
.data-table tr:hover { background: #fafbff; }
.td-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.tag-vip { background: #fef3c7; color: #d97706; }
.tag-free { background: #f3f4f6; color: #6b7280; }
.tag-blue { background: #dbeafe; color: #2563eb; }
.tag-success { background: #d1fae5; color: #059669; }
.tag-warning { background: #fef3c7; color: #d97706; }
.tag-danger { background: #fee2e2; color: #dc2626; }
.tag-online { background: #d1fae5; color: #059669; }
.tag-offline { background: #f3f4f6; color: #6b7280; }

/* 得分 */
.score { font-weight: 600; }
.score-good { color: #059669; }
.score-mid { color: #d97706; }
.score-low { color: #dc2626; }
.text-danger { color: #dc2626; font-weight: 600; }

/* 电量 */
.battery { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.battery-fill { height: 6px; background: #34d399; border-radius: 3px; width: 30px; }

/* 告警列表 */
.alert-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.alert-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; font-size: 12px; }
.alert-item.high { background: #fee2e2; }
.alert-item.medium { background: #fef3c7; }
.alert-type { font-weight: 600; }
.alert-val { font-weight: 700; }

/* 热点问题 */
.hot-list { display: flex; flex-direction: column; gap: 8px; }
.hot-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px; }
.hot-rank { width: 20px; height: 20px; border-radius: 4px; background: #f3f4f6; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.hot-rank.hot-top { background: #6366f1; color: #fff; }
.hot-text { flex: 1; }
.hot-count { color: #999; font-size: 12px; }

/* 折线图 */
.line-svg { width: 100%; height: 140px; }
.chart-labels { display: flex; justify-content: space-between; font-size: 11px; color: #999; margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #eee; }
.tab { padding: 10px 20px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 500; }

/* 表单卡片 */
.form-card { background: #fff; border-radius: 12px; padding: 24px; }
.form-row { display: flex; flex-direction: column; margin-bottom: 14px; }
.form-row label { font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-row input, .form-row select { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; box-sizing: border-box; }
.form-row input:focus, .form-row select:focus { border-color: #6366f1; }
.form-row textarea { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none; box-sizing: border-box; resize: vertical; }

/* Switch开关样式 */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 26px; }
.switch .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
.switch input:checked + .slider { background-color: #6366f1; }
.switch input:checked + .slider:before { transform: translateX(22px); }

/* 会员套餐 */
.plan-card { background: #f8f9fc; border-radius: 12px; padding: 20px; margin-bottom: 12px; position: relative; border: 2px solid transparent; flex: 1; min-width: 200px; }
.plans-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.plan-recommend { border-color: #6366f1; background: #f5f3ff; }
.plan-tag { position: absolute; top: -10px; right: 16px; background: #6366f1; color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 11px; }
.plan-name { font-size: 16px; font-weight: 600; color: #1a1a3e; margin-bottom: 8px; }
.plan-price { font-size: 28px; font-weight: 700; color: #6366f1; margin-bottom: 12px; }
.plan-price span { font-size: 13px; color: #999; font-weight: 400; }
.plan-benefits { list-style: none; }
.plan-benefits li { font-size: 13px; color: #555; padding: 4px 0; }

/* 优惠券 */
.coupon-card { display: flex; background: linear-gradient(135deg, #fff5f5, #fff); border-radius: 12px; overflow: hidden; margin-bottom: 12px; border: 1px solid #fee2e2; }
.coupon-left { background: #ef4444; color: #fff; padding: 16px 20px; text-align: center; min-width: 100px; display: flex; flex-direction: column; justify-content: center; }
.coupon-value { font-size: 24px; font-weight: 700; }
.coupon-condition { font-size: 11px; opacity: .8; }
.coupon-right { flex: 1; padding: 12px 16px; }
.coupon-name { font-size: 14px; font-weight: 600; color: #1a1a3e; margin-bottom: 4px; }
.coupon-meta { font-size: 11px; color: #999; margin-bottom: 4px; }
.coupon-status { font-size: 11px; color: #059669; }

/* 空状态 */
.empty { text-align: center; color: #ccc; padding: 40px 0; font-size: 13px; }

/* AI总结分析 */
.ai-summary { display: flex; flex-direction: column; gap: 12px; }
.ai-summary-section { padding: 12px 16px; background: #f8f9fc; border-radius: 8px; font-size: 13px; line-height: 1.7; color: #444; border-left: 3px solid #6366f1; }
.ai-summary-section strong { color: #1a1a3e; margin-right: 6px; }

/* 弹窗 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #fff; border-radius: 12px; width: 500px; max-height: 80vh; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; color: #999; font-size: 18px; }
.modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }

/* 响应式 */
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .stat-cards:has(.small) { grid-template-columns: repeat(3, 1fr); }
  .chart-section { grid-template-columns: 1fr; }
}
