/* ===== 春景智能 · 温湿度监控系统 · 管理后台样式 ===== */
/* 已整理：重复选择器合并、媒体查询归并、废弃布局类删除 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; }
.header-title { font-size: 18px; font-weight: 600; }
.login-card { max-width: 380px; margin: 120px auto; background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.1); text-align: center; }
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-subtitle { color: #999; font-size: 13px; margin-bottom: 24px; }
.tab-content { padding: 16px 24px; max-width: 1400px; margin: 0 auto; overflow-y: auto; max-height: calc(100vh - 120px); }
.stat-num { display: block; font-size: 32px; font-weight: 700; margin-top: 4px; }
.stat-total .stat-num { color: #2196f3; }
.stat-online .stat-num { color: #34a853; }
.stat-alarm .stat-num { color: #ea4335; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; max-height: 420px; overflow-y: auto; }
.device-grid::-webkit-scrollbar { width: 4px; }
.device-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }
.device-card.card-alarm { border-left-color: #ea4335; }
.device-card.card-offline { border-left-color: #999; opacity: .7; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-name { font-weight: 600; font-size: 14px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-input { padding: 8px 12px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 13px; width: 200px; outline: none; }
.search-input:focus { outline: none; border-color: #2196f3; }
.toolbar select { padding: 8px 10px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 13px; background: #fff; outline: none; }
.toolbar select:focus { border-color: #2196f3; }
.table { width: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.table th { background: #f8f9fa; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; color: #666; white-space: nowrap; }
.table td { padding: 10px 12px; font-size: 13px; border-top: 1px solid #f0f0f0; }
.table tr:hover { background: #f4f6fb; }
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; background: #e8e8e8; color: #333; }
.btn:hover { opacity: .85; }
.btn-primary { background: #2196f3; color: #fff; }
.btn-danger { background: #ea4335; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 14px; background: #fff; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2196f3; }
.form-row { display: flex; gap: 12px; }
.form-row .half { flex: 1; }
.form-error { color: #ea4335; font-size: 13px; margin-bottom: 12px; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-bottom: 4px; }
.form-col { display: flex; flex-direction: column; }
.form-col .form-group:last-child { margin-bottom: 0; }
.form-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0; }
.form-actions .btn { min-width: 100px; padding: 10px 24px; font-size: 14px; }
.btn-secondary { background: #f0f0f0; color: #555; border: 1px solid #ddd; }
.btn-secondary:hover { background: #e0e0e0; }
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-content { background: #fff; border-radius: 12px; padding: 28px; width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-lg { max-width: 680px; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 24px; cursor: pointer; color: #999; }
.modal-content h3 { margin-bottom: 16px; font-size: 17px; }
.detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-header h3 { font-size: 18px; margin-bottom: 0; }
.detail-header .sn-text { font-size: 13px; color: #999; }
.detail-big { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.big-item { text-align: center; padding: 10px; background: #fff; border-radius: 8px; border: 1px solid #eee; transition: transform .15s; }
.big-item:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.big-val { display: block; font-size: 22px; font-weight: 700; line-height: 1.3; }
.big-lbl { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.detail-stat-temp .big-val { color: #ea4335; }
.detail-stat-hum .big-val { color: #2196f3; }
.detail-stat-bat .big-val { color: #34a853; }
.detail-stat-rssi .big-val { color: #f9ab00; }
.detail-section { margin-bottom: 16px; padding: 14px; background: #f8f9fa; border-radius: 8px; }
.detail-section h4 { font-size: 13px; color: #666; margin-bottom: 12px; font-weight: 600; }
.detail-info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-info-item { background: #fff; border: 1px solid #eee; border-radius: 6px; padding: 8px 10px; }
.detail-info-item .info-label { display: block; font-size: 11px; color: #999; margin-bottom: 2px; }
.detail-info-item .info-value { display: block; font-size: 13px; color: #333; font-weight: 500; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 0; }
.pagination button { padding: 5px 14px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; transition: all .15s; }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination button:hover:not(:disabled) { background: #f0f2f5; border-color: #ccc; }
.page-numbers { display: flex; gap: 4px; align-items: center; }
.page-num { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #333; font-size: 13px; cursor: pointer; transition: all .15s; font-weight: 500; }
.page-num:hover { border-color: #2196f3; color: #2196f3; background: #f0f6ff; }
.page-num.active { background: #2196f3; border-color: #2196f3; color: #fff; font-weight: 600; box-shadow: 0 1px 4px rgba(26,115,232,.3); }
.page-info { font-size: 13px; color: #999; margin-left: 4px; }
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-online { background: #e6f4ea; color: #34a853; }
.status-alarm { background: #fce8e6; color: #ea4335; }
.status-offline { background: #f0f0f0; color: #999; }
.level-tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.level-info { background: #e8f0fe; color: #2196f3; }
.alarm-list h3 { font-size: 14px; margin-bottom: 12px; }
.alarm-icon { font-size: 12px; }
.level-critical { background: #fff5f5; color: #ea4335; }
.level-warning { background: #fffbe6; color: #f9ab00; }
.data-table-card { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.data-table-card .table { box-shadow: none; border-radius: 0; }
.data-table-card .pagination { background: #f8f9fa; border-top: 1px solid #eee; padding: 10px 16px; margin: 0; }
.cell-temp { color: #ea4335; font-weight: 600; }
.cell-hum { color: #2196f3; font-weight: 600; }
.cell-bat { color: #34a853; font-weight: 500; }
.cell-num { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 12px; }
.sn-text { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 12px; color: #666; }
.time-text { font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace; font-size: 12px; color: #888; white-space: nowrap; }
.empty-state { text-align: center; padding: 40px 20px; color: #999; font-size: 15px; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.app-layout { display: flex; height: 100vh; background: #f0f2f5; }
.app-sidebar { width: 200px; flex-shrink: 0; background: #031527; display: flex; flex-direction: column; box-shadow: 2px 0 6px rgba(0,21,41,.15); }
.app-logo { height: 64px; display: flex; align-items: center; gap: 8px; padding: 0 18px; background: #101938; color: rgba(255,255,255,.92); font-size: 17px; font-weight: 600; flex-shrink: 0; letter-spacing: .5px; }
.app-logo .logo-icon { font-size: 20px; }
.app-menu { flex: 1; overflow-y: auto; padding: 6px 0 20px; }
.app-menu::-webkit-scrollbar { width: 4px; }
.app-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }
.menu-group { padding: 14px 18px 6px; font-size: 11px; color: rgba(255,255,255,.32); letter-spacing: 1px; text-transform: uppercase; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; margin: 0 6px; border-radius: 6px; color: rgba(255,255,255,.72); font-size: 14px; cursor: pointer; transition: background .2s, color .2s; }
.menu-item:hover { background: rgba(33,150,243,.14); color: #fff; }
.menu-item.active { background: #2196f3; color: #fff; font-weight: 500; box-shadow: 0 2px 6px rgba(33,150,243,.35); }
.menu-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.menu-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-badge { margin-left: auto; background: #ff4760; color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 9px; font-weight: 600; }
.app-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.app-topbar { height: 56px; flex-shrink: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); z-index: 10; }
.breadcrumb { font-size: 15px; color: #303133; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #606266; }
.top-time { color: #909399; font-variant-numeric: tabular-nums; }
.top-link { color: #606266; cursor: pointer; transition: color .2s; text-decoration: none; }
.top-link:hover { color: #2196f3; }
.top-user { color: #303133; font-weight: 500; }
.top-logout { color: #ff4760; }
.top-logout:hover { color: #d92d42; }
.app-view { flex: 1; overflow-y: auto; padding: 16px; }
.app-view .tab-content { padding: 0; max-width: none; max-height: none; overflow: visible; }
.card, .stat-card, .settings-form, .chart-container, .data-table-card { background: #fff; border-radius: 6px; border: 1px solid #ebeef5; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.settings-form { max-width: 500px; background: #fff; padding: 20px 24px; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.chart-container { background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stats-row { display: grid; gap: 14px; margin-bottom: 14px; grid-template-columns: repeat(4, 1fr); }
.stat-card { background: #fff; padding: 16px 20px; border-radius: 10px; text-align: left; font-size: 13px; color: #666; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: relative; overflow: hidden; }
.stat-card .stat-label { font-size: 13px; color: #909399; margin-bottom: 6px; }
.stat-card .stat-num { font-size: 30px; font-weight: 600; line-height: 1.2; color: #303133; font-variant-numeric: tabular-nums; }
.stat-card.stat-total .stat-num { color: #2196f3; }
.stat-card.stat-online .stat-num { color: #2ebe95; }
.stat-card.stat-alarm .stat-num { color: #ff4760; }
.panel { background: #fff; border-radius: 6px; border: 1px solid #ebeef5; box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 14px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f2f5; }
.panel-title { font-size: 15px; font-weight: 600; color: #303133; }
.panel-sub { font-size: 12px; color: #909399; }
.panel > .stats-row { padding: 16px 18px; margin: 0; }
.panel > .device-grid { padding: 16px 18px; }
.stat-foot { font-size: 12px; color: #c0c4cc; margin-top: 2px; }
.stat-card .stat-num .unit { font-size: 16px; margin-left: 2px; font-weight: 400; }
.stat-card.stat-rate .stat-num { color: #e6a23c; }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px; border-radius: 50%; background: rgba(33,150,243,.05); }
.stat-card.stat-online::after { background: rgba(46,190,149,.06); }
.stat-card.stat-alarm::after { background: rgba(255,71,96,.06); }
.stat-card.stat-rate::after { background: rgba(230,162,60,.06); }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; }
.chart-box { padding: 12px 16px 16px; }
.chart-box canvas { max-height: 240px; }
.alarm-list { background: #fff; border-radius: 10px; padding: 6px 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); max-height: 260px; overflow-y: auto; }
.alarm-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; border-bottom: 1px solid #f5f7fa; font-size: 13px; transition: background .15s; }
.alarm-item:last-child { border: none; border-bottom: none; }
.alarm-item:hover { background: #fafbfc; }
.alarm-body { flex: 1; min-width: 0; }
.alarm-msg { flex: 1; font-size: 13px; color: #303133; line-height: 1.5; word-break: break-all; }
.alarm-time { color: #c0c4cc; font-size: 11px; margin-top: 2px; }
.alarm-item.level-critical { background: rgba(255,71,96,.04); }
.alarm-item.level-warning { background: rgba(230,162,60,.04); }
.empty-hint { padding: 30px 18px; text-align: center; color: #909399; font-size: 13px; }
.device-card { background: #fff; border-radius: 6px; padding: 14px; cursor: pointer; border-left: 4px solid #34a853; box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: box-shadow .2s, transform .2s; border: 1px solid #ebeef5; }
.device-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.card-status { font-size: 11px; padding: 1px 8px; border-radius: 9px; font-weight: 500; }
.card-status.status-online { background: rgba(46,190,149,.12); color: #2ebe95; }
.card-status.status-alarm { background: rgba(255,71,96,.12); color: #ff4760; }
.card-status.status-offline { background: rgba(144,147,153,.12); color: #909399; }
.card-temp { font-size: 26px; font-weight: 600; color: #303133; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.card-temp .u { font-size: 13px; font-weight: 400; color: #909399; margin-left: 2px; }
.card-hum { font-size: 15px; color: #2ebe95; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card-hum .u { font-size: 12px; color: #909399; margin-left: 2px; }
.card-floor { font-size: 12px; color: #909399; margin-top: 6px; }

@media (max-width: 768px) {
  .device-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { flex-direction: column; }
  .tab-content { padding: 12px; }
  .detail-big { grid-template-columns: repeat(2, 1fr); }
  .detail-info-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row.two-col { grid-template-columns: 1fr; }
  .modal-content { padding: 20px; }
  .modal-content.modal-lg { max-width: 95%; }
  .pagination { flex-wrap: wrap; gap: 6px; }
  .page-num { min-width: 24px; height: 24px; font-size: 12px; }
  .pagination button { padding: 3px 10px; font-size: 12px; }
  .detail-section { padding: 8px; }
  .header-right .btn { padding: 4px 8px; font-size: 12px; }
}

@media (max-width: 900px) {
  .header-title { font-size: 16px; }
  .header-right { margin-left: auto; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .search-input { width: 100%; }
  .table-wrap { overflow-x: auto; }
  .table { min-width: 700px; }
  .data-table-card { overflow-x: auto; }
  .data-table-card .table { min-width: 480px; }
  .app-sidebar { width: 60px; }
  .app-logo { padding: 0 12px; justify-content: center; }
  .app-logo .logo-text { display: none; }
  .menu-group { display: none; }
  .menu-item { padding: 0; justify-content: center; margin: 0 6px; }
  .menu-text, .menu-badge { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .topbar-right { gap: 10px; }
  .top-time, .top-user { display: none; }
}

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}
