/* ===== CSS 变量 ===== */
:root {
  --primary: #2c5f5d;
  --primary-light: #3a7a78;
  --primary-dark: #1f4543;
  --accent: #d4a574;
  --accent-light: #e0b88a;
  --accent-dark: #b88a5a;
  --bg: #f5f3f0;
  --surface: #ffffff;
  --surface-alt: #faf9f7;
  --text: #2d3436;
  --text-secondary: #636e72;
  --text-light: #b2bec3;
  --border: #e3e0dc;
  --border-light: #eeece8;
  --success: #27ae60;
  --success-bg: #e8f8f0;
  --warning: #e67e22;
  --warning-bg: #fef5e7;
  --danger: #e74c3c;
  --danger-bg: #fdf0ef;
  --info: #3498db;
  --info-bg: #ebf5fb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --sidebar-w: 240px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 全局重置 ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ===== 布局 ===== */
#app {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
}

.logo-text h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-text p {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 11px;
  opacity: 0.6;
}

.sidebar-footer .copyright {
  margin-top: 4px;
  color: var(--accent-light);
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 顶部栏 ===== */
.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-left h2 {
  font-size: 18px;
  font-weight: 600;
}

.menu-toggle {
  font-size: 20px;
  display: none;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  padding: 8px 36px 8px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface-alt);
  outline: none;
  transition: all var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(44,95,93,0.1);
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-light);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--surface);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

/* ===== 页面容器 ===== */
.page-container {
  flex: 1;
  padding: 24px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}

/* 无图标、紧凑堆叠的统计卡片（客资统计等） */
.stats-grid-compact .stat-card {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  min-height: auto;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.teal { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.gold { background: #fdf6ec; color: var(--accent); }
.stat-icon.purple { background: #f5f0fa; color: #9b59b6; }

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

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

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-trend {
  font-size: 12px;
  margin-top: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* 收款总业绩：可点击钻取的统计卡 + 提示 */
.stat-clickable { cursor: pointer; }
.stat-clickable:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.stat-hint { font-size: 11px; color: var(--accent); margin-top: 6px; }

/* 排名表合计行 */
.table-footer td { background: var(--bg-color); font-weight: 700; border-top: 2px solid var(--border-color); }

/* ===== 表格 ===== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

tr:hover td {
  background: var(--surface-alt);
}

.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 14px;
}

/* ===== 徽章/标签 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-default { background: var(--surface-alt); color: var(--text-secondary); }
.badge-primary { background: rgba(44,95,93,0.1); color: var(--primary); }

/* ===== 状态指示器 ===== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: all var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,95,93,0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

.modal.modal-lg {
  max-width: 900px;
}

.modal.modal-sm {
  max-width: 420px;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  font-size: 18px;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== 图片上传 ===== */
.image-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: default;
  transition: all var(--transition);
  background: var(--surface-alt);
}

.image-upload:hover {
  border-color: var(--primary);
  background: rgba(44,95,93,0.03);
}

.image-upload.has-image {
  padding: 12px;
  border-style: solid;
}

.image-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.image-upload-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.image-upload-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
}

.image-upload-thumb .image-remove {
  top: 4px;
  right: 4px;
}

.image-upload-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 80px;
}

.image-upload-add:hover {
  border-color: var(--primary);
  background: rgba(44,95,93,0.03);
}

.image-upload-add span {
  font-size: 24px;
}

.image-upload-placeholder {
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
}

.image-upload-placeholder span {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1;
  cursor: pointer;
  border: none;
  padding: 0;
}

.image-upload-actions {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.image-reupload {
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  z-index: 1;
}

.image-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  overflow-y: auto;
}

.image-stack img {
  flex-shrink: 0;
  height: 0;
  min-height: 80px;
  border-radius: var(--radius);
}

/* ===== 图片预览 ===== */
.image-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.image-viewer-overlay.active {
  display: flex;
}

.image-viewer-content {
  max-width: 90vw;
  max-height: 90vh;
}

.image-viewer-content img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  object-fit: contain;
}

/* ===== 缩略图 ===== */
.thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.thumb:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-light);
  border: 1px dashed var(--border);
}

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--info);
  min-width: 280px;
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 140px;
  padding: 7px 12px;
  font-size: 13px;
}

.filter-bar .search-inline {
  flex: 1;
  min-width: 200px;
}

/* ===== 页面标题区 ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.page-header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== 订单详情 ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.detail-item {
  display: flex;
  margin-bottom: 8px;
}

.detail-label {
  width: 100px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.detail-value {
  flex: 1;
  font-weight: 500;
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--surface);
}

.timeline-item.done::before {
  background: var(--success);
}

.timeline-item.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(212,165,116,0.2);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-light);
}

.timeline-title {
  font-size: 14px;
  font-weight: 500;
  margin-top: 2px;
}

/* ===== 图片网格 ===== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.image-grid-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-alt);
}

.image-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: all var(--transition);
}

.image-grid-item img:hover {
  transform: scale(1.05);
}

.image-grid-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
  text-align: center;
}

/* ===== 多选下拉组件 MultiSelect ===== */
.ms-wrap {
  position: relative;
  display: inline-block;
  min-width: 110px;
  user-select: none;
}

.ms-trigger {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  padding-right: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  cursor: pointer;
}

.ms-trigger:hover {
  border-color: var(--primary-light);
}

.ms-wrap.open .ms-trigger,
.ms-trigger:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 95, 93, 0.12);
  outline: none;
}

.ms-trigger-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-count {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ms-arrow {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform var(--transition);
}

.ms-wrap.open .ms-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.ms-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 100%;
  max-width: 280px;
  max-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ms-fade-in 0.15s ease;
}

@keyframes ms-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.ms-actions {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface-alt);
}

.ms-action-btn {
  font-size: 12px;
  color: var(--primary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.ms-action-btn:hover {
  background: rgba(44, 95, 93, 0.08);
}

.ms-options {
  overflow-y: auto;
  padding: 4px 0;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
  outline: none;
}

.ms-option:hover,
.ms-option.focused {
  background: var(--surface-alt);
}

.ms-option.selected .ms-label {
  color: var(--primary);
  font-weight: 500;
}

.ms-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: #fff;
  transition: all var(--transition);
}

.ms-option.selected .ms-checkbox {
  background: var(--primary);
  border-color: var(--primary);
}

.ms-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.ms-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.image-grid-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-light);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.image-grid-empty span {
  font-size: 24px;
  margin-bottom: 4px;
}

/* ===== 进度条 ===== */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }
.progress-bar-fill.success { background: var(--success); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 标签页 ===== */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}

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

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ===== 成本汇总 ===== */
.cost-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.cost-summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.cost-summary-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.cost-summary-card .value {
  font-size: 20px;
  font-weight: 700;
}

/* ===== 行内操作按钮 ===== */
.row-actions {
  display: flex;
  gap: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cost-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .menu-toggle {
    display: block;
  }
  .search-box input {
    width: 160px;
  }
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .image-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

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

/* ===== 文本工具类 ===== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ===== 登录页 ===== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form .form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.login-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
}

.login-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,95,93,0.1);
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.login-hint {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-light);
  text-align: left;
  line-height: 1.8;
}

/* ===== 用户信息栏 ===== */
.user-info {
  display: flex;
  align-items: center;
}

.user-badge {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 12px;
  background: var(--surface-alt);
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ===== 加载文本 ===== */
.loading-text {
  text-align: center;
  padding: 60px;
  color: var(--text-light);
  font-size: 15px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
