/* ==========================================================================
   通用中后台 · 基于 Arco Design 的静态后台模板
   布局骨架 + 主题扩展。组件样式全部来自 Arco，此文件只负责
   「布局 / 品牌色 / 明暗适配 / 业务小卡片」，不覆盖 Arco 组件默认外观。
   ========================================================================== */

/* ---------- 1. 语义变量：明暗两套 ---------- */
:root {
  --app-brand: #165dff;
  --app-brand-weak: rgba(22, 93, 255, 0.1);
  --app-brand-line: rgba(22, 93, 255, 0.24);
  --app-header-h: 60px;
  --app-tabs-h: 44px;
  --app-sider-w: 220px;
  --app-sider-mini-w: 48px;
  --app-footer-h: 48px;
  --app-pad: 16px;
}

body {
  --app-page-bg: #f4f5f7;
  --app-surface: #ffffff;
  --app-surface-2: #f7f8fa;
  --app-line: #e5e6eb;
  --app-line-soft: #f2f3f5;
  --app-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 12px rgba(0, 0, 0, 0.03);
}

body[arco-theme='dark'] {
  --app-page-bg: #141416;
  --app-surface: #232324;
  --app-surface-2: #2a2a2b;
  --app-line: #333335;
  --app-line-soft: #2a2a2b;
  --app-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  --app-brand-weak: rgba(22, 93, 255, 0.18);
}

/* ---------- 2. 基础重置 ---------- */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: var(--app-page-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--color-text-1);
  overflow: hidden;
}

#app {
  height: 100%;
}

* {
  box-sizing: border-box;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--color-fill-4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-4);
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- 3. 整体骨架 ---------- */
.app-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* 侧边栏 */
.app-sider {
  width: var(--app-sider-w);
  flex: 0 0 var(--app-sider-w);
  height: 100%;
  background: var(--app-surface);
  border-right: 1px solid var(--app-line);
  display: flex;
  flex-direction: column;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    flex-basis 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 20;
}

.app-layout.is-collapsed .app-sider {
  width: var(--app-sider-mini-w);
  flex-basis: var(--app-sider-mini-w);
}

.app-logo {
  height: var(--app-header-h);
  flex: 0 0 var(--app-header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--app-line);
  white-space: nowrap;
  cursor: pointer;
}

.app-logo-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #165dff 0%, #4080ff 50%, #0fc6c2 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 4px 10px rgba(22, 93, 255, 0.32);
}

.app-logo-mark svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.app-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
}

.app-logo-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--color-text-1);
}

.app-logo-sub {
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--color-text-4);
  text-transform: uppercase;
}

.app-layout.is-collapsed .app-logo-text {
  display: none;
}

.app-menu-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}

.app-menu-wrap .arco-menu {
  border-radius: 0;
}

.app-sider-foot {
  flex: 0 0 auto;
  padding: 10px 12px;
  border-top: 1px solid var(--app-line);
  font-size: 11px;
  color: var(--color-text-4);
  white-space: nowrap;
  overflow: hidden;
}

/* 主区 */
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* 顶栏 */
.app-header {
  height: var(--app-header-h);
  flex: 0 0 var(--app-header-h);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 12px;
  z-index: 15;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-2);
  cursor: pointer;
  transition: all 0.16s;
  font-size: 16px;
  border: none;
  background: transparent;
  padding: 0;
}

.icon-btn:hover {
  background: var(--color-fill-2);
  color: var(--app-brand);
}

.app-header-search {
  width: 220px;
}

.app-header-divider {
  width: 1px;
  height: 20px;
  background: var(--app-line);
  margin: 0 6px;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.16s;
}

.app-user:hover {
  background: var(--color-fill-2);
}

.app-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-brand);
  color: #fff;
  flex: 0 0 30px;
}

.app-user-avatar svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.app-user-name {
  font-size: 13px;
  color: var(--color-text-1);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 页签栏 */
.app-tabs {
  height: var(--app-tabs-h);
  flex: 0 0 var(--app-tabs-h);
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.app-tabs::-webkit-scrollbar {
  height: 0;
}

.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px 0 10px;
  border-radius: 13px;
  font-size: 12px;
  color: var(--color-text-2);
  background: var(--app-surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex: 0 0 auto;
  transition: all 0.16s;
}

.app-tab:hover {
  color: var(--app-brand);
}

.app-tab.is-active {
  background: var(--app-brand-weak);
  color: var(--app-brand);
  border-color: var(--app-brand-line);
}

.app-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.app-tab-close {
  font-size: 12px;
  opacity: 0.55;
  border-radius: 50%;
  display: inline-flex;
}

.app-tab-close:hover {
  opacity: 1;
  color: #f53f3f;
}

/* 内容区 */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--app-pad);
  background: var(--app-page-bg);
}

.app-page {
  animation: appFadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes appFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-footer {
  padding: 16px 0 8px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-4);
  line-height: 1.8;
}

/* ---------- 4. 通用业务面板 ---------- */
.panel {
  background: var(--app-surface);
  border-radius: 8px;
  border: 1px solid var(--app-line-soft);
  box-shadow: var(--app-card-shadow);
  overflow: hidden;
}

.panel + .panel {
  margin-top: var(--app-pad);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-line-soft);
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
}

.panel-sub {
  font-size: 12px;
  color: var(--color-text-4);
}

.panel-extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 18px;
}

.panel-body.is-flush {
  padding: 0;
}

.bar-title {
  position: relative;
  padding-left: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
}

.bar-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--app-brand);
}

/* 面板内 HTML 图例
   不使用 echarts 内置图例：容器宽度变化（如收起侧栏）时它的图例不会可靠重排，
   会停留在按旧宽度计算的位置，因此统一改用 HTML 图例。 */
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-3);
  flex-wrap: wrap;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chart-legend-item > i,
.chart-legend-row > i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: 0 0 10px;
}

.chart-legend-list {
  margin-top: 14px;
  border-top: 1px dashed var(--app-line);
  padding-top: 10px;
}

.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
}

.chart-legend-name {
  color: var(--color-text-2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend-value {
  color: var(--color-text-1);
  font-variant-numeric: tabular-nums;
}

.chart-legend-pct {
  width: 48px;
  text-align: right;
  color: var(--color-text-4);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--color-text-3);
}

.dim {
  color: var(--color-text-4);
  font-size: 12px;
}

.mono {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-8 {
  gap: 8px;
}

/* 欢迎横幅 */
.welcome {
  position: relative;
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: var(--app-pad);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, #165dff 0%, #2f6bff 42%, #0fc6c2 100%);
}

.welcome::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.welcome::before {
  content: '';
  position: absolute;
  right: 90px;
  bottom: -110px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.welcome-inner {
  position: relative;
  z-index: 1;
}

.welcome-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 6px;
}

.welcome-desc {
  font-size: 13px;
  opacity: 0.85;
  margin: 0 0 14px;
}

.welcome .arco-tag {
  margin-right: 8px;
}

/* 横幅上的快捷入口胶囊 */
.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.welcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(2px);
  transition: background 0.16s;
  cursor: default;
}

.welcome-chip:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 监控页指标格 */
.metric-cell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.metric-ring {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  line-height: 0;
}

.metric-info {
  flex: 1;
  min-width: 0;
}

.metric-info .stat-label {
  margin-bottom: 2px;
  white-space: nowrap;
}

/* 指标卡 */
.stat-card {
  background: var(--app-surface);
  border-radius: 8px;
  border: 1px solid var(--app-line-soft);
  box-shadow: var(--app-card-shadow);
  padding: 18px;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

body[arco-theme='dark'] .stat-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-3);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text-1);
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-3);
  margin-left: 4px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex: 0 0 40px;
}

.stat-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--app-line);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-text-3);
}

.trend-up,
.trend-down {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

/* A股/国内习惯：涨红跌绿 */
.trend-up {
  color: #f53f3f;
}

.trend-down {
  color: #00b42a;
}

/* 迷你进度条 */
.mini-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--color-fill-3);
  overflow: hidden;
  margin-top: 10px;
}

.mini-bar > i {
  display: block;
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

/* 待办列表 */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--app-line-soft);
}

.todo-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.todo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex: 0 0 8px;
}

.todo-main {
  flex: 1;
  min-width: 0;
}

.todo-text {
  font-size: 13px;
  color: var(--color-text-1);
  margin-bottom: 3px;
}

.todo-text.is-done {
  text-decoration: line-through;
  color: var(--color-text-4);
}

/* 时间线日志 */
.log-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 9px 0 9px 4px;
  border-bottom: 1px dashed var(--app-line-soft);
  font-size: 12.5px;
  align-items: baseline;
}

.log-time {
  color: var(--color-text-4);
  flex: 0 0 62px;
  font-variant-numeric: tabular-nums;
}

.log-tag {
  flex: 0 0 52px;
}

.log-text {
  color: var(--color-text-2);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

/* 商品卡 */
.goods-card {
  background: var(--app-surface);
  border: 1px solid var(--app-line-soft);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  transition: transform 0.2s, box-shadow 0.2s;
}

.goods-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

body[arco-theme='dark'] .goods-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.goods-thumb {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  color: rgba(255, 255, 255, 0.95);
  position: relative;
}

.goods-badge {
  position: absolute;
  left: 10px;
  top: 10px;
}

.goods-body {
  padding: 12px 14px 14px;
}

.goods-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-1);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goods-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-4);
  margin-bottom: 10px;
}

.goods-price {
  color: #f53f3f;
  font-size: 16px;
  font-weight: 600;
}

.goods-price small {
  font-size: 12px;
  font-weight: 400;
}

/* 个人中心 */
.profile-hero {
  border-radius: 8px;
  padding: 24px 20px;
  text-align: center;
  background: linear-gradient(140deg, rgba(22, 93, 255, 0.1), rgba(15, 198, 194, 0.08));
  border: 1px solid var(--app-line-soft);
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  margin: 12px 0 4px;
  color: var(--color-text-1);
}

.profile-role {
  font-size: 12px;
  color: var(--color-text-3);
  margin-bottom: 12px;
}

.profile-stats {
  display: flex;
  border-top: 1px solid var(--app-line);
  margin-top: 16px;
  padding-top: 14px;
}

.profile-stat {
  flex: 1;
  text-align: center;
}

.profile-stat b {
  display: block;
  font-size: 17px;
  color: var(--color-text-1);
}

.profile-stat span {
  font-size: 12px;
  color: var(--color-text-4);
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-2);
  margin-bottom: 8px;
}

/* 顶栏搜索下拉 */
.search-panel {
  position: absolute;
  top: 34px;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
}

body[arco-theme='dark'] .search-panel {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.search-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--color-text-2);
  cursor: pointer;
}

.search-item:hover {
  background: var(--color-fill-2);
  color: var(--app-brand);
}

/* 通知浮层 */
.pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-line-soft);
  font-size: 13px;
}

.pop-list {
  max-height: 320px;
  overflow-y: auto;
}

.pop-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--app-line-soft);
}

.pop-item:last-child {
  border-bottom: none;
}

.pop-item-title {
  font-size: 13px;
  color: var(--color-text-1);
  margin-bottom: 3px;
  line-height: 1.4;
}

/* 状态点 */
.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-2);
}

.status-cell > i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}

/* 实时采集徽标 */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #00b42a;
  background: rgba(0, 180, 42, 0.12);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00b42a;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(0, 180, 42, 0.5);
  }
  50% {
    opacity: 0.6;
    box-shadow: 0 0 0 5px rgba(0, 180, 42, 0);
  }
}

/* 空状态占位 */
.app-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 20px;
  gap: 14px;
  text-align: center;
}

.app-placeholder-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--app-brand);
  background: var(--app-brand-weak);
}

/* ---------- 5. Arco 局部微调 ---------- */
.app-menu-wrap .arco-menu-inner {
  padding: 4px 8px;
  overflow-y: auto;
}

.app-menu-wrap .arco-menu-item,
.app-menu-wrap .arco-menu-inline-header {
  border-radius: 6px !important;
  margin-bottom: 2px;
  line-height: 38px;
  height: 38px;
}

.app-menu-wrap .arco-menu-item.arco-menu-selected {
  background: var(--app-brand-weak);
  color: var(--app-brand);
  font-weight: 500;
}

.app-menu-wrap .arco-menu-item.arco-menu-selected::after {
  display: none;
}

.app-menu-wrap .arco-menu-icon {
  margin-right: 10px;
}

.arco-table-td .arco-btn-text {
  padding: 0 6px;
  height: 24px;
  font-size: 13px;
}

.arco-card {
  border-radius: 8px;
}

.arco-layout-sider {
  background: var(--app-surface);
}

/* 表格内主信息单元 */
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-user-name {
  font-size: 13px;
  color: var(--color-text-1);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-user-mail {
  font-size: 12px;
  color: var(--color-text-4);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页面过渡遮罩（全屏） */
.app-header-search .arco-input-inner-wrapper {
  border-radius: 18px;
  background: var(--color-fill-2);
  border-color: transparent;
}

/* 响应式：窄屏自动收起侧栏 */
@media (max-width: 1100px) {
  .app-header-search {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-sider {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.12);
  }
  .app-user-name {
    display: none;
  }
}

/* ==========================================================================
   登录页 / 启动页 / 业务页补充样式
   ========================================================================== */

/* ---------- 启动校验登录态 ---------- */
.boot-splash {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--color-text-3);
}
.boot-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #165dff, #0fc6c2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.boot-text {
  font-size: 13px;
}

/* ---------- 登录页 ---------- */
.login-page {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf2ff 0%, #f7f9fc 45%, #e6fbfa 100%);
}
body[arco-theme='dark'] .login-page {
  background: linear-gradient(135deg, #10131a 0%, #171a21 50%, #101820 100%);
}
.login-card {
  width: 400px;
  padding: 34px 32px 22px;
  border-radius: 14px;
  background: var(--color-bg-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--color-border-1);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.login-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #165dff, #0fc6c2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}
.login-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text-1);
}
.login-sub {
  font-size: 12px;
  color: var(--color-text-3);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgb(var(--red-6));
  font-size: 13px;
}
.login-foot {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-3);
}

/* ---------- 顶栏角色小字 ---------- */
.app-user-role {
  font-size: 12px;
  color: var(--color-text-3);
  margin-left: 2px;
}

/* ---------- 报销审批：图片上传 / 详情 ---------- */
.uploader-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 4px;
  overflow: visible;
}
.uploader-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 14px;
  color: var(--color-text-3);
  cursor: pointer;
  background: var(--color-bg-1);
  border-radius: 50%;
}
.uploader-remove:hover {
  color: rgb(var(--danger-6));
}
.uploader-add {
  width: 72px;
  height: 72px;
  border: 1px dashed var(--color-border-2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-3);
  font-size: 20px;
  cursor: pointer;
}
.uploader-add:hover {
  border-color: rgb(var(--primary-6));
  color: rgb(var(--primary-6));
}
/* 附件上传（FileUploader）：文件链接行 */
.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 26px;
}
.file-item-icon {
  color: var(--color-text-3);
  font-size: 14px;
}
.file-item-name {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 证件记录列表：照片/附件列最小高度，避免空态塌陷 */
.cert-records .cert-cell-none {
  color: var(--color-text-3);
}
/* 证件识别：AI 原始返回（JSON）展示块 */
.ai-raw {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  background: var(--color-fill-1);
  border: 1px solid var(--color-border-2);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--color-text-2);
  white-space: pre-wrap;
  word-break: break-all;
}
.reimburse-detail .detail-imgs {
  margin-top: 8px;
}
.reimburse-detail .detail-imgs-label {
  font-size: 12px;
  color: var(--color-text-3);
  margin-bottom: 4px;
}

/* ---------- 业务页通用工具条 ---------- */
.search-bar {
  margin-bottom: 12px;
}
/* 检索区输入框：浅色模式白底 + 灰色边框 */
.search-bar .arco-input-wrapper,
.search-bar .arco-input-group,
.search-bar .arco-select-view,
.search-bar .arco-range-picker,
.search-bar .arco-picker,
.search-bar .arco-input-inner-wrapper,
.search-bar .arco-range-picker-input {
  background: #fff !important;
  border-color: var(--app-line) !important;
}
/* Arco Select / RangePicker 内部两个 input 也要白底 */
.search-bar .arco-range-picker .arco-input-wrapper,
.search-bar .arco-range-picker .arco-input-inner-wrapper {
  background: #fff !important;
}
.search-bar .arco-form-item {
  margin-bottom: 0;
}
/* 暗黑模式：深灰背景 + 深灰边框（仍用 !important 覆盖 Arco 主题变量） */
body[arco-theme='dark'] .search-bar .arco-input-wrapper,
body[arco-theme='dark'] .search-bar .arco-input-group,
body[arco-theme='dark'] .search-bar .arco-select-view,
body[arco-theme='dark'] .search-bar .arco-range-picker,
body[arco-theme='dark'] .search-bar .arco-picker,
body[arco-theme='dark'] .search-bar .arco-input-inner-wrapper,
body[arco-theme='dark'] .search-bar .arco-range-picker-input {
  background: var(--app-surface-2) !important;
  border-color: var(--app-line) !important;
}
.search-bar-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px;
}
.search-bar-actions > .arco-btn {
  min-width: 96px;
}
/* 功能区：创建按钮贴行内最左，其余功能按钮组贴行内最右（全局规范 §2.10） */
.tool-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
/* 创建按钮之外的其余功能按钮组：整体推到行尾 */
.tool-bar .tool-actions {
  margin-left: auto;
}
.tool-bar > .a-button,
.tool-bar .arco-btn {
  min-width: 96px;
}
/* 合计条：表格上方一行文字汇总（当前筛选口径） */
.sum-bar {
  margin-bottom: 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--color-text-2);
  background: var(--color-fill-1);
  border-radius: 4px;
}
.sum-bar b {
  color: var(--color-text-1);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pager-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.warn-tip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgb(var(--orange-6));
  background: rgba(255, 125, 0, 0.1);
}

/* ---------- 弹窗内小行 / 日志 ---------- */
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--color-border-1);
  font-size: 13px;
  color: var(--color-text-1);
}
.mini-row:last-child {
  border-bottom: none;
}
.log-item {
  border: 1px solid var(--color-border-1);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.log-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.log-url {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--color-text-1);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-body {
  margin-top: 6px;
  font-size: 12px;
}
.log-pre {
  margin: 4px 0 0;
  padding: 8px 10px;
  background: var(--color-fill-2);
  border-radius: 6px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--color-text-2);
}

/* ---------- 权限抽屉 ---------- */
.perm-group {
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border-1);
}
.perm-pages {
  padding-left: 18px;
}
.perm-page {
  padding: 6px 0;
}
.perm-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding-left: 22px;
  margin-top: 4px;
}

/* ==========================================================================
   运单管理（page-transport-order）
   ========================================================================== */

/* 页签样式（与检索区拉开层次） */
.filter-tabs {
  margin: 4px 0 10px;
}

/* 单元格：多行堆叠（对齐兄弟项目「换行=单元格内子项」） */
.to-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  line-height: 1.5;
}
.to-cell-right {
  align-items: flex-end;
  text-align: right;
}
.to-cell-center {
  align-items: center;
  text-align: center;
}
.to-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  word-break: break-all;
}
/* 同一行内并列的子项（空格分隔） */
.to-multi {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.to-label {
  flex: none;
  color: var(--color-text-3);
}
.to-arrow {
  margin: 0 2px;
  color: var(--color-text-3);
}
.to-no {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--color-text-2);
}
.to-empty {
  color: var(--color-text-3);
}
.to-price {
  font-weight: 500;
  color: rgb(var(--orange-6));
}

/* 运输状态四色：待接单/已接单=灰，已装货=橙，运输完成=绿 */
.to-status {
  flex: none;
}
.to-status-0,
.to-status-1 {
  color: var(--color-text-3);
}
.to-status-2 {
  color: rgb(var(--orange-6));
}
.to-status-3 {
  color: rgb(var(--green-6));
}

/* 磅单识别比对结果 */
.to-bill {
  flex: none;
}
.to-bill.is-ok {
  color: rgb(var(--green-6));
}
.to-bill.is-err {
  color: rgb(var(--red-6));
}
.to-bill.is-pending {
  color: var(--color-text-3);
}

/* 作废：灰色文字带下划线 */
.to-void {
  color: var(--color-text-2);
  text-decoration: underline;
  cursor: pointer;
}
.to-void:hover {
  color: rgb(var(--red-6));
}

.void-box {
  font-size: 13px;
}

/* ---------- 班线管理（2026-09-14）---------- */
/* 表格内长地址单行省略（保留 title 悬浮全文） */
.to-ellipsis {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 弹框内「司机必填重量」双开关 */
.line-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
}

/* 弹框内分区小标题 */
.form-divider {
  margin: 4px 0 12px;
  padding-left: 10px;
  position: relative;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-2);
}
.form-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--app-brand);
}

/* 磅单图查看器 */
.pic-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pic-main {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 6px;
  background: var(--color-fill-1);
}
.pic-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   计划任务（page-job）
   ========================================================================== */
.job-name {
  font-weight: 500;
}
.job-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-on {
  color: rgb(var(--green-6));
}
.job-off {
  color: var(--color-text-3);
}

/* ---------- 报销表格：双行单元格 / 审批节点行 ---------- */
.cell-sub {
  font-size: 12px;
  color: var(--color-text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flow-line {
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 节点状态色：提交审核灰 / 等待审批蓝 / 通过审核绿 / 退回上步橙 / 退回重审红（表格列+详情时间线共用） */
.fs-submit { color: var(--color-text-3); }
/* 本项目 arco.min.css 的色板变量是 RGB 三元组（--primary-6:22,93,255），作 color 用须包 rgb() */
.fs-0 { color: rgb(var(--primary-6)); }
.fs-1 { color: rgb(var(--success-6)); }
.fs-401 { color: rgb(var(--warning-6)); }
.fs-404 { color: rgb(var(--danger-6)); }

/* —— 运力管理：车辆状态 / 证件链接（2026-09-12；着色口径 2026-09-13 改版）—— */
/* ⚠️ `--color-text-*` 本身就是完整颜色值（var(--color-neutral-x)），**不能再包一层 rgb()**，
 *    否则变成 rgb(rgb(...)) 属非法值 → 整条声明被浏览器丢弃 → 看着"没颜色"（2026-09-13 修复） */
.car-st-static { color: var(--color-text-1); }           /* 静止：黑 */
.car-st-offline { color: rgb(var(--warning-6)); }        /* 断联：橙（覆盖一切） */
.car-st-running { color: rgb(var(--primary-6)); }        /* 行驶：蓝 */
.car-st-charging { color: rgb(var(--success-6)); }       /* 充电：绿 */
.cert-item { margin-right: 10px; white-space: nowrap; }
/* 证件信息列：一行显示 4 个（2026-09-12 拍板），自动换行 */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  column-gap: 12px;
  row-gap: 2px;
}
.cert-link { cursor: pointer; }                          /* 证件名称一律可点（2026-09-13） */
.cert-none { color: rgb(var(--warning-6)); }             /* 无记录：橙（2026-09-13 改口径，原为"灰"） */
.cert-ok { color: var(--color-text-3); }                 /* 正常（距到期 > N 天）：灰 */
.cert-danger { color: rgb(var(--danger-6)); }            /* 不足 N 天 / 已过期 / 无到期日：红 */

/* ---------- 报销打款状态色：未打款灰 / 待打款蓝 / 已打款绿 ---------- */
.pay-none { color: var(--color-text-3); }
.pay-pending { color: rgb(var(--primary-6)); }
.pay-paid { color: rgb(var(--success-6)); }
.pay-voided { color: var(--color-text-3); text-decoration: line-through; }
/* 打款弹框：可打款池底部汇总条 */
.pay-pool-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
}

/* ---------- 运力管理 · 全图监控（2026-09-13）----------
   本页以「地图区」替代右表格区：.map-stage 是 a-table + .pager-bar 的位置替代物。
   2026-09-13 改版：本页**无标题区 / 无检索区**，搜索改为浮层（.map-search）叠加在地图之上，
   地图铺满 .panel-body，高度按视口自适应（不再固定 560px）。 */
.map-stage {
  position: relative;
  /* 100vh - header(60) - tabs(44) - footer(48) - content padding(16×2) - panel-body padding(18×2) */
  height: calc(100vh - 220px);
  min-height: 480px;
  border: 1px solid var(--app-line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--app-surface-2);
}
.map-canvas { width: 100%; height: 100%; }

/* 搜索浮层：所属车队 + 车牌号（只这两项，**变动即搜**，无查询/重置按钮）
   ⚠️ z-index 必须 > 天地图 pane 的 400，且要**高于 .map-mask（501）** ——
      否则地图 loading / 无结果遮罩会把浮层盖住，用户输入到一半就无法继续操作。 */
.map-search {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 502;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 4px;
  box-shadow: var(--app-card-shadow);
}
.map-search-fleet { width: 168px; }
.map-search-plate { width: 190px; }

/* 角落浮层：左=数量统计（**下移一行**避让搜索浮层），右=无定位入口
   ⚠️ z-index 必须 > 400：天地图自己的 pane 是 `.tdt-pane { z-index: 400 }`（实测），
      之前写 5 → 浮层被地图整块盖住（DOM 在、文案在、命中测试也能命中，但**屏幕上看不见**）。
      排查方法：只改背景色不变层级 → 看不到；只把层级提到 99999 → 立刻可见。 */
.map-badge {
  position: absolute;
  top: 10px;
  z-index: 500;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text-1);
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 4px;
  box-shadow: var(--app-card-shadow);
}
.map-badge-left { top: 62px; left: 10px; }
.map-badge-right { right: 10px; }
/* 覆盖层：加载中 / 底图失败 / 无结果 —— 同样要压在天地图 pane（z-index 400）之上 */
.map-mask {
  position: absolute;
  inset: 0;
  z-index: 501;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-2);
}
/* 轨迹 + 充电弹框：左右分栏（左栏固定 400px = 时间检索 + 充电汇总明细；右栏 = 轨迹地图） */
.track-layout { display: flex; gap: 12px; height: 470px; }
.track-left {
  flex: 0 0 400px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 明细超出 → **栏内滚动**（不在弹框里分页，2026-09-13 拍板 Q2） */
  overflow-y: auto;
  padding-right: 4px;
}
.track-left-head { flex: none; }
/* 充电汇总：次数 / 电量 / 费用（口径 = 充电费用表，不去重） */
.charge-summary {
  flex: none;
  display: flex;
  align-items: center;
  padding: 10px 6px;
  background: var(--app-surface-2);
  border-radius: 4px;
}
.charge-summary-item { flex: 1; min-width: 0; text-align: center; }
.charge-summary-label { font-size: 12px; color: var(--color-text-3); }
.charge-summary-value {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  color: var(--color-text-1);
  white-space: nowrap;
}
.charge-summary-value em,
.charge-summary-value i {
  margin-left: 2px;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: var(--color-text-3);
}
.charge-list { flex: none; }
.charge-list-empty {
  flex: none;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.track-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.track-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid var(--app-line);
  border-radius: 4px;
  overflow: hidden;
}
.track-empty { flex: none; margin-top: 8px; text-align: center; font-size: 13px; color: var(--color-text-3); }
/* 车辆标记（天地图 T.DivIcon 的 DOM 内容）：状态色圆点 + 车牌文字，整块可点 */
.map-car-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  box-sizing: border-box;
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 12px;
  box-shadow: var(--app-card-shadow);
  font-size: 12px;
  font-weight: 600;
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.map-car-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
