/* ===== 换电平台后台 · 若依风格主题 =====
 * 复刻 ruoyi-vue 经典视觉：暗色侧边栏 + tags-view + 紧凑 element-ui
 */

html, body, #app { height: 100%; margin: 0; padding: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: 14px;
  color: #303133;
  background: #f0f2f5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 整体布局 ---------- */
.ry-layout { display: flex; height: 100%; min-height: 100vh; }

/* ---------- 左侧暗色侧边栏 ---------- */
.ry-sidebar {
  width: 210px; flex-shrink: 0;
  background: #304156;
  display: flex; flex-direction: column;
  transition: width .28s;
  overflow: hidden;
}
.ry-sidebar.collapsed { width: 54px; }
.ry-sidebar-logo {
  height: 50px; line-height: 50px;
  background: #2b2f3a;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  overflow: hidden;
}
.ry-sidebar-logo svg { flex: 0 0 auto; width: 22px; height: 22px; color: #409EFF; }
.ry-sidebar-logo .ry-logo-title {
  font-size: 14px; font-weight: 600; white-space: nowrap;
  letter-spacing: 0.5px;
}
.ry-sidebar.collapsed .ry-logo-title { display: none; }

.ry-sidebar-menu { flex: 1; overflow-y: auto; }
.ry-sidebar-menu::-webkit-scrollbar { width: 6px; }
.ry-sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }

/* element-ui el-menu 暗色覆写 */
.ry-sidebar .el-menu { border-right: none !important; background: transparent !important; }
.ry-sidebar .el-menu-item,
.ry-sidebar .el-submenu__title {
  height: 50px; line-height: 50px;
  color: #bfcbd9 !important;
  background-color: transparent !important;
}
.ry-sidebar .el-menu-item i,
.ry-sidebar .el-submenu__title i { color: #bfcbd9 !important; }
.ry-sidebar .el-menu-item:hover,
.ry-sidebar .el-submenu__title:hover { background-color: #263445 !important; }
.ry-sidebar .el-menu-item.is-active {
  background-color: #1890ff !important;
  color: #fff !important;
}
.ry-sidebar .el-menu-item.is-active i { color: #fff !important; }
.ry-sidebar .el-submenu .el-menu-item {
  background-color: #1f2d3d !important;
  min-width: 0 !important;
  padding-left: 50px !important;
}
.ry-sidebar .el-submenu .el-menu-item.is-active { background-color: #1890ff !important; }

/* 折叠后的子菜单浮层修正 */
.el-menu--vertical .el-menu .el-menu-item { background-color: #1f2d3d !important; color: #bfcbd9 !important; }
.el-menu--vertical .el-menu .el-menu-item:hover { background-color: #001528 !important; }
.el-menu--vertical .el-menu .el-menu-item.is-active { background-color: #1890ff !important; color: #fff !important; }

/* ---------- 主区域 ---------- */
.ry-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- 顶部 navbar ---------- */
.ry-navbar {
  height: 50px; flex: 0 0 50px;
  background: #fff;
  border-bottom: 1px solid #e7eaec;
  display: flex; align-items: center;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,21,41,.08);
  z-index: 10;
}
.ry-hamburger {
  width: 40px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #5a5e66;
}
.ry-hamburger:hover { background: #f6f6f6; }
.ry-breadcrumb { flex: 1; padding: 0 14px; font-size: 14px; }
.ry-breadcrumb .el-breadcrumb { line-height: 50px; }
.ry-navbar-right { display: flex; align-items: center; height: 50px; }
.ry-navbar-right .ry-right-item {
  height: 50px; padding: 0 12px;
  display: flex; align-items: center; cursor: pointer;
  color: #5a5e66;
}
.ry-navbar-right .ry-right-item:hover { background: #f6f6f6; }
.ry-navbar-right .ry-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #409EFF, #36a2ff);
  color: #fff; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  margin-right: 8px;
}

/* ---------- tags-view ---------- */
.ry-tags-view {
  height: 34px; flex: 0 0 34px;
  background: #fff;
  border-bottom: 1px solid #d8dce5;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,.06);
  display: flex; align-items: center;
  padding: 0 4px;
  position: relative;
  z-index: 9;
}
.ry-tag-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; white-space: nowrap; height: 34px; }
.ry-tag-scroll::-webkit-scrollbar { display: none; }
.ry-tag-item {
  display: inline-flex; align-items: center;
  height: 26px; line-height: 26px;
  padding: 0 8px;
  margin: 4px 3px 0;
  font-size: 12px;
  border: 1px solid #d8dce5;
  background: #fff;
  color: #495060;
  cursor: pointer;
  user-select: none;
  border-radius: 2px;
}
.ry-tag-item:hover { color: #409EFF; }
.ry-tag-item.active {
  background: #42b983;
  color: #fff;
  border-color: #42b983;
}
.ry-tag-item.active::before {
  content: ''; display: inline-block;
  width: 8px; height: 8px;
  background: #fff; border-radius: 50%;
  margin-right: 4px;
}
.ry-tag-close {
  margin-left: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-style: normal;
}
.ry-tag-close:hover { background: #b4bccc; color: #fff; }
.ry-tag-item.active .ry-tag-close:hover { background: rgba(255,255,255,.3); }

.ry-tags-actions { display: flex; align-items: center; padding: 0 4px; }
.ry-tags-actions .ry-tags-btn {
  width: 28px; height: 26px; margin: 4px 2px 0;
  background: #fff; border: 1px solid #d8dce5; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: #495060;
}
.ry-tags-actions .ry-tags-btn:hover { color: #409EFF; }

/* ---------- 内容区 ---------- */
.ry-content {
  flex: 1; overflow-y: auto;
  padding: 16px;
  background: #f0f2f5;
}
.ry-content > .app-container { background: #fff; padding: 20px; min-height: calc(100vh - 116px); border-radius: 4px; }

/* footer */
.ry-footer {
  flex: 0 0 30px;
  text-align: center;
  font-size: 12px;
  color: #8a8e91;
  line-height: 30px;
  background: #f0f2f5;
}

/* ---------- ruoyi 经典 表单/搜索区 ---------- */
.ry-search-box {
  background: #fff;
  padding: 12px 16px 0;
  border-radius: 4px;
  margin-bottom: 16px;
  border: 1px solid #ebeef5;
}
.ry-search-box .el-form-item { margin-bottom: 12px; }
.ry-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ry-toolbar-left { display: flex; align-items: center; gap: 10px; }
.ry-toolbar-right { display: flex; align-items: center; gap: 8px; color: #909399; font-size: 16px; }
.ry-toolbar-right .ry-icon-btn {
  cursor: pointer; padding: 6px;
}
.ry-toolbar-right .ry-icon-btn:hover { color: #409EFF; }

/* ---------- KPI 风格（ruoyi dashboard 经典）---------- */
.ry-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.ry-kpi-card {
  background: #fff;
  border-radius: 4px;
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid #ebeef5;
}
.ry-kpi-card .ry-kpi-icon {
  position: absolute; right: 16px; top: 16px;
  width: 44px; height: 44px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.ry-kpi-card .ry-kpi-label { font-size: 13px; color: #909399; margin-bottom: 8px; }
.ry-kpi-card .ry-kpi-value { font-size: 24px; font-weight: 600; color: #303133; font-variant-numeric: tabular-nums; }
.ry-kpi-card .ry-kpi-delta { font-size: 12px; margin-top: 4px; }
.ry-kpi-card .ry-kpi-delta.up { color: #67C23A; }
.ry-kpi-card .ry-kpi-delta.down { color: #F56C6C; }

/* ---------- 卡片 / panel ---------- */
.ry-card { background: #fff; border: 1px solid #ebeef5; border-radius: 4px; margin-bottom: 16px; }
.ry-card-header {
  padding: 12px 16px; border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; justify-content: space-between;
}
.ry-card-header .ry-card-title { font-size: 14px; font-weight: 600; color: #303133; }
.ry-card-header .ry-card-title::before {
  content: ''; display: inline-block;
  width: 3px; height: 14px;
  background: #1890ff;
  margin-right: 8px;
  vertical-align: -2px;
}
.ry-card-body { padding: 16px; }

/* ---------- 表格美化 ---------- */
.el-table th.el-table__cell { background: #f8f8f9 !important; color: #515a6e !important; font-weight: 600 !important; }
.el-table td.el-table__cell, .el-table th.el-table__cell { padding: 8px 0 !important; }
.el-table .cell { font-size: 13px; }

/* ---------- 状态点 ---------- */
.ry-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.ry-dot.green { background: #67C23A; }
.ry-dot.blue { background: #409EFF; }
.ry-dot.orange { background: #E6A23C; }
.ry-dot.red { background: #F56C6C; }
.ry-dot.grey { background: #c0c4cc; }

/* ---------- 文本工具 ---------- */
.text-mono { font-family: Consolas, Menlo, monospace; }
.text-muted { color: #909399; }
.text-primary { color: #409EFF; }
.text-success { color: #67C23A; }
.text-warning { color: #E6A23C; }
.text-danger  { color: #F56C6C; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ---------- 登录页 ---------- */
.ry-login-bg {
  height: 100vh;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='1200' height='700'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0%' stop-color='%232d3a4b'/><stop offset='100%' stop-color='%23409EFF'/></linearGradient></defs><rect fill='url(%23g)' width='1200' height='700'/></svg>");
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.ry-login-card {
  width: 400px;
  background: #fff;
  border-radius: 6px;
  padding: 25px 25px 5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.ry-login-title {
  text-align: center;
  font-size: 26px;
  color: #707070;
  margin: 0 auto 30px;
  font-weight: bold;
}
.ry-login-card .el-input__inner { height: 38px; line-height: 38px; }
.ry-login-btn { width: 100%; height: 40px; margin-bottom: 8px; }
.ry-login-footer {
  text-align: center;
  font-size: 12px;
  color: #fff;
  position: fixed; bottom: 16px; left: 0; right: 0;
  font-family: "Arial";
  letter-spacing: 1px;
}

/* ---------- 导览首页（系统首页）---------- */
.ry-home-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.ry-home-section { margin-bottom: 24px; }
.ry-home-section-title {
  font-size: 14px; font-weight: 600; color: #303133;
  margin-bottom: 12px;
}
.ry-home-section-title::before {
  content: ''; display: inline-block;
  width: 3px; height: 14px; background: #409EFF;
  margin-right: 8px; vertical-align: -2px;
}
.ry-home-card {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
}
.ry-home-card:hover {
  border-color: #409EFF;
  box-shadow: 0 2px 12px rgba(64,158,255,.15);
  transform: translateY(-1px);
}
.ry-home-card .ry-home-icon {
  width: 36px; height: 36px; border-radius: 4px;
  background: #ecf5ff; color: #409EFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ry-home-card .ry-home-meta { flex: 1; min-width: 0; }
.ry-home-card .ry-home-name { font-size: 14px; font-weight: 500; color: #303133; }
.ry-home-card .ry-home-path { font-size: 11px; color: #909399; font-family: monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 杂项 ---------- */
.pagination-container { padding: 16px 0; text-align: right; }
.el-tag.is-light { font-weight: 500; }
.dialog-footer { text-align: right; }

/* sparkline */
.ry-spark { width: 100%; height: 60px; }
