html, body, #app { height: 100%; margin: 0; padding: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }

.layout { height: 100vh; display: flex; }
.sidebar {
  width: 220px; background: #001529; color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.logo {
  height: 56px; line-height: 56px; text-align: center;
  font-size: 16px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,0.04);
  letter-spacing: 1px;
}
.logo .brand { color: #409eff; }
.menu { flex: 1; border-right: 0; background: #001529; }
.el-menu--dark { background: #001529 !important; }
.main { flex: 1; display: flex; flex-direction: column; background: #f5f7fa; overflow: hidden; min-width: 0; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid #ebeef5;
  display: flex; align-items: center; padding: 0 20px; justify-content: space-between;
  gap: 12px;
}
.topbar .title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { flex: 1; overflow: auto; padding: 16px; }

.card { background: #fff; border-radius: 6px; padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #303133; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: #fff; border-radius: 6px; padding: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .label { color: #909399; font-size: 13px; }
.stat-card .value { font-size: 24px; font-weight: 600; color: #303133; }
.stat-card .sub { color: #909399; font-size: 12px; }
.stat-card.primary .value { color: #409eff; }
.stat-card.success .value { color: #67c23a; }
.stat-card.warning .value { color: #e6a23c; }
.stat-card.danger .value { color: #f56c6c; }

.chart { width: 100%; height: 320px; }
.chart-sm { width: 100%; height: 260px; }

.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filters .el-input, .filters .el-select { width: 200px; }

.api-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f0f2f5; padding: 2px 6px; border-radius: 3px; }

.bill-detail { padding: 8px; }
.bill-detail .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #ebeef5; }
.bill-detail .row .k { color: #606266; }
.bill-detail .row .v { color: #303133; font-weight: 500; }

.tag-cat-ai { color: #409eff; }
.tag-cat-robot { color: #67c23a; }
.tag-cat-tactile { color: #e6a23c; }

.cockpit { background: linear-gradient(180deg, #061a3a 0%, #02061a 100%); color: #cfe1ff; padding: 20px; border-radius: 6px; min-height: calc(100vh - 120px); }
.cockpit h1 { text-align: center; color: #66b1ff; letter-spacing: 4px; margin: 0 0 16px; font-weight: 500; }
.cockpit .stat-card { background: rgba(64,158,255,0.08); border: 1px solid rgba(64,158,255,0.2); color: #cfe1ff; }
.cockpit .stat-card .label { color: #8aa9d4; }
.cockpit .stat-card .value { color: #66b1ff; }
.cockpit .card { background: rgba(64,158,255,0.06); border: 1px solid rgba(64,158,255,0.15); color: #cfe1ff; }
.cockpit .card-title { color: #66b1ff; }

/* ============================ 登录页 ============================ */
.login-stage {
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #050a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 背景装饰：3 个光斑 + 网格 */
.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 18s ease-in-out infinite;
}
.login-orb.orb1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #1e90ff 0%, transparent 70%);
  top: -120px; left: -120px;
}
.login-orb.orb2 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #6f42c1 0%, transparent 70%);
  bottom: -140px; right: -100px;
  animation-delay: -6s;
}
.login-orb.orb3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #00d2ff 0%, transparent 70%);
  top: 40%; left: 50%;
  animation-delay: -12s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.1); }
  66%      { transform: translate(-40px, 60px) scale(0.95); }
}
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64,158,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64,158,255,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* 主容器：双栏 */
.login-shell {
  position: relative;
  display: flex;
  width: 880px;
  max-width: 92vw;
  min-height: 520px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 左侧品牌区 */
.login-brand {
  flex: 1;
  background: linear-gradient(135deg, rgba(30,90,180,0.55) 0%, rgba(15,20,50,0.7) 100%);
  padding: 50px 44px 40px;
  color: #cfe1ff;
  display: flex;
  flex-direction: column;
  position: relative;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.brand-mark { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.mark-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #409eff);
  box-shadow: 0 0 12px rgba(64,158,255,0.8);
}
.mark-line { width: 24px; height: 1px; background: rgba(207,225,255,0.4); }
.mark-text { font-size: 11px; letter-spacing: 4px; color: rgba(207,225,255,0.6); }
.brand-title {
  font-size: 44px; font-weight: 200; margin: 0 0 8px;
  letter-spacing: 8px; color: #fff;
  text-shadow: 0 2px 20px rgba(64,158,255,0.4);
}
.brand-sub {
  font-size: 14px; color: rgba(207,225,255,0.7);
  letter-spacing: 2px; margin-bottom: 48px;
}
.brand-features {
  list-style: none; padding: 0; margin: 0;
  flex: 1;
}
.brand-features li {
  font-size: 13px;
  color: rgba(207,225,255,0.75);
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
.brand-features li span {
  color: #00d2ff; font-size: 8px;
}
.brand-footer {
  font-size: 11px; color: rgba(207,225,255,0.35);
  margin-top: 20px; letter-spacing: 1px;
}

/* 右侧表单区 */
.login-panel {
  flex: 0 0 380px;
  background: rgba(255,255,255,0.96);
  padding: 56px 44px 40px;
  display: flex;
  flex-direction: column;
}
.panel-head { margin-bottom: 32px; }
.panel-title {
  font-size: 24px; font-weight: 600;
  color: #1a2942; margin-bottom: 6px;
}
.panel-sub {
  font-size: 13px; color: #8a96a8;
  letter-spacing: 0.5px;
}
.panel-form {
  flex: 1;
}
.panel-form .el-input__wrapper {
  background: #f5f7fb;
  box-shadow: 0 0 0 1px transparent inset;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}
.panel-form .el-input__wrapper:hover { background: #eef1f7; }
.panel-form .el-input__wrapper.is-focus {
  background: #fff;
  box-shadow: 0 0 0 1px #409eff inset, 0 0 0 4px rgba(64,158,255,0.12) !important;
}
.panel-form .el-input__inner { height: 40px; font-size: 14px; }
.panel-form .el-form-item { margin-bottom: 20px; }

.login-btn {
  width: 100%;
  height: 46px !important;
  margin-top: 12px;
  font-size: 15px !important;
  letter-spacing: 4px;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #409eff 0%, #1e6fdd 100%) !important;
  border: 0 !important;
  box-shadow: 0 6px 20px rgba(64,158,255,0.35) !important;
  transition: all 0.2s !important;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(64,158,255,0.5) !important;
}
.login-btn:active { transform: translateY(0); }

.panel-foot {
  margin-top: 24px;
  text-align: center;
  color: #a0aec0;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* 平板适配：缩小品牌区 */
@media (max-width: 900px) {
  .login-shell { width: 92vw; }
  .login-brand { padding: 36px 30px; }
  .brand-title { font-size: 36px; letter-spacing: 6px; }
  .login-panel { flex: 0 0 340px; padding: 44px 32px; }
}

/* 手机端：单栏，只显示登录卡 */
@media (max-width: 640px) {
  .login-shell {
    flex-direction: column;
    width: 92vw;
    min-height: auto;
  }
  .login-brand { display: none; }
  .login-panel {
    flex: 1; padding: 40px 28px;
    border-radius: 16px;
  }
  .login-orb { filter: blur(60px); }
  .login-orb.orb1 { width: 280px; height: 280px; }
  .login-orb.orb2 { width: 240px; height: 240px; }
  .login-orb.orb3 { width: 200px; height: 200px; }
}

/* ============================ 抽屉里的菜单 ============================ */
.el-drawer .logo { cursor: pointer; user-select: none; }
.el-drawer__body { padding: 0 !important; background: #001529 !important; }

/* ============================ 响应式：平板 ============================ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .filters .el-input, .filters .el-select { width: 100%; max-width: 220px; }
}

/* ============================ 响应式：手机 ============================ */
@media (max-width: 768px) {
  .content { padding: 10px; }
  .card { padding: 12px; margin-bottom: 12px; border-radius: 4px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .title { font-size: 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 20px; }
  .stat-card .label { font-size: 12px; }
  .chart { height: 260px; }
  .chart-sm { height: 220px; }
  .filters { gap: 6px; }
  .filters .el-input, .filters .el-select, .filters .el-date-editor { width: 100% !important; max-width: none; }
  .cockpit { padding: 12px; }
  .cockpit h1 { font-size: 18px; letter-spacing: 2px; }

  /* 表格在手机端允许横向滚动 */
  .el-table { font-size: 12px; }

  /* dialog 在手机端贴边 */
  .el-dialog { width: 92vw !important; margin: 5vh auto !important; }

  /* 登录卡片在手机上窄一点 */
  .login-card { padding: 28px 22px; }
  .login-logo { font-size: 18px; }
}

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

/* ============================ 合成对账单弹窗 + 日期选择器 移动端适配 ============================ */

/* 日期选择器弹层确保不超出屏幕，按钮始终可点 */
.synth-date-popper {
  max-width: 96vw !important;
}
.synth-date-popper .el-picker-panel__sidebar {
  display: none !important;  /* 隐藏左侧快捷栏，给主面板留空间 */
}
.synth-date-popper .el-picker-panel__body {
  margin-left: 0 !important;
}
.synth-date-popper .el-picker-panel__footer {
  padding: 8px 12px !important;
}
.synth-date-popper .el-picker-panel__footer .el-button {
  min-width: 60px;
}

/* 合成对账单表单 - 顶部 label 占用更小空间 */
.synth-form .el-form-item__label {
  padding-bottom: 4px !important;
  font-size: 13px;
  color: #606266;
}
.synth-form .el-form-item {
  margin-bottom: 14px;
}

/* ============================ 手机端 (≤ 768) 强化适配 ============================ */
@media (max-width: 768px) {
  /* 弹窗在手机上几乎贴边显示 */
  .el-dialog {
    width: 96vw !important;
    margin: 4vh auto !important;
    max-height: 92vh;
    overflow-y: auto;
  }
  .el-dialog__body {
    padding: 16px 12px !important;
    max-height: 70vh;
    overflow-y: auto;
  }
  .el-dialog__header {
    padding: 12px 16px !important;
  }
  .el-dialog__footer {
    padding: 10px 12px !important;
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #ebeef5;
    z-index: 10;
  }
  .el-dialog__footer .el-button {
    margin-left: 6px;
    margin-bottom: 4px;
    padding: 8px 12px;
    font-size: 13px;
  }

  /* 日期选择器弹层在手机上 */
  .el-picker-panel {
    max-width: 96vw !important;
  }
  .el-picker-panel.has-sidebar {
    width: auto !important;
  }
  .el-date-range-picker {
    width: 96vw !important;
    max-width: 96vw !important;
  }
  .el-date-range-picker__content {
    width: 50% !important;
  }
  .el-date-range-picker__editors-wrap {
    flex-wrap: wrap;
  }

  /* 表单 input 字号防止 iOS 自动放大 */
  .el-input__inner, .el-textarea__inner {
    font-size: 16px !important;
  }
  /* 但 dialog 里的按钮文字保持小 */
  .el-button { font-size: 13px; }

  /* 表格头部按钮换行 */
  .filters {
    flex-direction: column;
    align-items: stretch !important;
  }
  .filters .el-button {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 4px;
  }

  /* 表格操作列在手机端单独占一行 */
  .el-table .el-button + .el-button {
    margin-left: 0;
  }

  /* el-row el-col span=24 强制全宽（备用） */
  .el-row > .el-col {
    margin-bottom: 4px;
  }
}

/* 超小屏（≤ 480）日期范围选择器单列显示 */
@media (max-width: 480px) {
  .el-date-range-picker__content {
    width: 100% !important;
    float: none !important;
  }
  .el-date-range-picker__content.is-left {
    border-right: 0 !important;
    border-bottom: 1px solid #ebeef5 !important;
  }
  .el-date-range-picker {
    height: auto !important;
  }
}
