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

.global-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; color: #409eff; }
.global-loading p { margin-top: 12px; font-size: 14px; color: #909399; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d); background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-box { width: 400px; background: #fff; border-radius: 12px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h2 { font-size: 24px; color: #303133; margin-bottom: 8px; }
.login-header p { font-size: 13px; color: #909399; }
.login-hint { text-align: center; color: #c0c4cc; font-size: 12px; margin-top: 16px; }
.login-icp { text-align: center; margin-top: 10px; font-size: 12px; }
.login-icp a { color: #909399; text-decoration: none; }
.login-icp a:hover { color: #409eff; }
.sidebar-icp { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 11px; }
.sidebar-icp a { color: rgba(255,255,255,0.35); text-decoration: none; }
.sidebar-icp a:hover { color: #409eff; }
.sidebar { position: relative; }

/* Main Layout */
.main-layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 200px; background: #304156; transition: width 0.3s; flex-shrink: 0; overflow: hidden; }
.sidebar.collapsed { width: 64px; }
.sidebar-header { height: 50px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); }
.logo-text { white-space: nowrap; }
.sidebar-menu { border-right: none; }
.sidebar-menu .el-menu-item { color: #bfcbd9; }
.sidebar-menu .el-menu-item:hover { background: #263445; color: #fff; }
.sidebar-menu .el-menu-item.is-active { background: #1f2d3d; color: #409eff; }
.sidebar:not(.collapsed) .el-menu-item span { display: inline; }
.sidebar.collapsed .el-menu-item span { display: none; }

.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 50px; background: #fff; box-shadow: 0 1px 4px rgba(0,21,41,0.08); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.collapse-btn { cursor: pointer; color: #606266; }
.collapse-btn:hover { color: #409eff; }
.page-title { font-size: 16px; font-weight: 600; color: #303133; }
.user-info { display: flex; align-items: center; gap: 4px; cursor: pointer; color: #606266; font-size: 14px; }
.user-info:hover { color: #409eff; }

.page-content { flex: 1; padding: 16px; overflow-y: auto; }

/* Filter Bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.filter-spacer { flex: 1; }

/* Pagination */
.pagination-bar { margin-top: 16px; display: flex; justify-content: flex-end; }

/* Stat Cards */
.stat-cards { margin-bottom: 16px; }
.stat-cards .el-col { display: flex; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.06); width: 100%; display: flex; flex-direction: column; justify-content: center; min-height: 100px; }
.stat-value { font-size: 28px; font-weight: 700; color: #409eff; }
.stat-value-sm { font-size: 20px; }
.stat-label { font-size: 13px; color: #909399; margin-top: 8px; }
.modified-field { background: #fff3cd; padding: 2px 6px; border-radius: 3px; border-bottom: 2px dotted #e6a23c; }

/* Chart Cards */
.chart-card { background: #fff; border-radius: 8px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.chart-title { font-size: 14px; font-weight: 600; color: #303133; margin-bottom: 12px; }

/* Column Config */
.column-config { max-height: 400px; overflow-y: auto; }
.column-config-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.column-config .el-checkbox { display: block; margin-bottom: 4px; }

/* Comm Timeline */
.comm-item { padding: 8px 12px; background: #f5f7fa; border-radius: 6px; }
.comm-content { font-size: 14px; color: #303133; margin-bottom: 4px; }
.comm-meta { font-size: 12px; color: #909399; }

/* Text helpers */
.text-muted { color: #c0c4cc; }
.text-danger { color: #f56c6c; }

/* Import Page */
.import-page { max-width: 700px; }

/* Detail Dialog */
.detail-dialog .el-dialog__body { padding: 16px 20px; }
.detail-section { margin-bottom: 20px; }
.detail-section-title { font-size: 15px; font-weight: 600; color: #303133; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid #409eff; }

/* Brand Detail Table */
.brand-detail-table { width: 100%; border-collapse: collapse; }
.brand-detail-table td { border: 1px solid #ebeef5; padding: 8px 12px; font-size: 13px; }
.brand-type-label { width: 80px; font-weight: 600; color: #606266; background: #f5f7fa; }
.brand-cell { color: #303133; }

/* Calendar */
.cal-has-comm { background: #f0f9ff; }
.el-calendar { --el-calendar-border-color: #ebeef5; }
.el-calendar-table .el-calendar-day { height: 60px; padding: 0; }
.el-calendar-table .el-calendar-day:hover { background: #f0f9ff; }

/* Compact Calendar (详情页用) */
.cal-compact .el-calendar { max-width: 500px; }
.cal-compact .el-calendar__header { padding: 4px 8px; }
.cal-compact .el-calendar__title { font-size: 13px; }
.cal-compact .el-calendar-table thead th { padding: 2px 0; font-size: 12px; }
.cal-compact .el-calendar-table .el-calendar-day { height: 40px; padding: 2px; }
.cal-compact .el-calendar-table .el-calendar-day > div { font-size: 12px; }

/* Element Plus overrides for dark sidebar */
.el-menu--collapse { width: 64px; }

/* ===== 移动端适配 ===== */
.sidebar-overlay { display: none; }

@media screen and (max-width: 768px) {
  /* 侧边栏抽屉化 */
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 2001; }
  .sidebar.collapsed { width: 0; }
  .sidebar.collapsed .sidebar-header,
  .sidebar.collapsed .sidebar-menu { display: none; }
  .sidebar-overlay { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 2000; }

  /* 顶栏 */
  .topbar { padding: 0 10px; }
  .page-title { font-size: 14px; }
  .topbar-right .el-tag { display: none; }

  /* 页面内容 */
  .page-content { padding: 8px; }

  /* 筛选栏垂直堆叠 */
  .filter-bar { flex-direction: column; align-items: stretch; gap: 6px; }
  .filter-search { order: -1 !important; }
  .filter-secondary { display: none !important; }
  .filter-bar .el-select,
  .filter-bar .el-input,
  .filter-bar .el-input__wrapper { width: 100% !important; }
  .filter-bar .el-button { width: 100%; }
  .filter-spacer { display: none; }

  /* 统计卡片2列 */
  .stat-cards .el-col { width: 50% !important; margin-bottom: 8px; }
  .stat-card { padding: 12px; min-height: 80px; }
  .stat-value { font-size: 20px; }
  .stat-value-sm { font-size: 16px; }
  .stat-label { font-size: 11px; }

  /* 表格横向滚动 */
  .el-table { font-size: 12px; }
  .el-table .el-table__body-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .el-table .el-button { padding: 4px; }

  /* 弹窗自适应 */
  .el-dialog { width: 95% !important; margin: 2vh auto !important; }
  .edit-dialog .el-dialog__body { padding: 10px; }
  .el-dialog .el-form-item__label { font-size: 13px; }

  /* 编辑表单单列 */
  .el-dialog .el-col-12, .el-dialog .el-col-8 { width: 100% !important; }

  /* 分页简化 */
  .pagination-bar { justify-content: center; }
  .el-pagination { font-size: 12px; }
  .el-pagination .el-pagination__jump, .el-pagination .el-pagination__sizes { display: none; }

  /* 周报月报表格 */
  .el-table .el-input, .el-table .el-textarea__inner { font-size: 12px; }

  /* 详情页 */
  .detail-dialog .el-dialog { width: 95% !important; }
  .el-descriptions { font-size: 12px; }
  .el-descriptions__label { width: 80px !important; }

  /* 登录页 */
  .login-box { width: 90%; padding: 24px 20px; }

  /* 图表卡片 */
  .chart-card { padding: 8px; }
  .chart-title { font-size: 13px; }
}

/* 触控友好的按钮尺寸（手机端） */
@media screen and (max-width: 768px) {
  .el-button { min-height: 36px; }
  .el-button--small { min-height: 32px; }
  .el-input__wrapper { min-height: 36px; }
}

/* 超时提醒按钮 */
.reminder-btn { position: relative; }
.reminder-btn .el-badge { margin-left: 4px; }
.reminder-btn .el-badge__content { transform: translateY(-2px); }

