/* ============================================================
   美业客服任务管理系统 v25 — 设计系统
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
  /* Primary */
  --primary: #534AB7;
  --primary-dark: #3F3699;
  --primary-hover: #4840A8;
  --primary-light: #EEEDFE;

  /* Semantic */
  --success: #1D9E75;
  --success-light: #E1F5EE;
  --danger: #E24B4A;
  --danger-light: #FCEBEB;
  --warning: #EF9F27;
  --warning-light: #FAEEDA;

  /* Green scale */
  --green-50: #E1F5EE;
  --green-100: #E6F9EF;
  --green-600: #1D9E75;
  --green-700: #1A7A44;

  /* Orange scale */
  --orange-50: #FFF3E0;
  --orange-600: #E65100;
  --orange-700: #B06000;

  /* Red scale */
  --red-50: #FCEBEB;
  --red-600: #E24B4A;

  /* Neutral gray */
  --gray-50: #FAFAFA;
  --gray-100: #F5F4F0;
  --gray-200: #EEEDE9;
  --gray-300: #D3D1C7;
  --gray-400: #B8B5AA;
  --gray-500: #888780;
  --gray-600: #5F5E5A;
  --gray-700: #3D3C39;
  --gray-800: #2C2C2A;
  --gray-900: #1A1A18;

  /* Text (mapped to gray scale) */
  --text: var(--gray-800);
  --text-secondary: var(--gray-600);
  --text-hint: var(--gray-500);

  /* Background */
  --bg: var(--gray-100);
  --bg-card: #FFFFFF;

  /* Border */
  --border: var(--gray-300);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.15);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;

  /* Typography — rem scale (base 16px) */
  --font-xs:   0.6875rem;   /* 11px */
  --font-sm:   0.8125rem;   /* 13px */
  --font-base: 0.9375rem;   /* 15px */
  --font-md:   1rem;        /* 16px */
  --font-lg:   1.125rem;    /* 18px */
  --font-xl:   1.25rem;     /* 20px */
  --font-2xl:  1.5rem;      /* 24px */
  --font-3xl:  1.75rem;     /* 28px */

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;

  /* Z-Index */
  --z-header: 100;
  --z-nav: 100;
  --z-toast: 9999;
  --z-modal: 200;

  /* Layout */
  --max-width: 640px;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
#header {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.header-title {
  font-size: var(--font-lg); font-weight: 600; color: var(--primary);
  transition: color var(--transition-fast);
}
.header-right { display: flex; align-items: center; gap: 8px; }
#header-user { font-size: var(--font-sm); color: var(--text-secondary); }

/* ===== Main Content ===== */
#main-content {
  max-width: var(--max-width); margin: 0 auto;
  padding: 16px 16px 90px;
  animation: pageIn 0.3s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content {
  animation: pageIn 0.25s ease;
}

/* ===== Bottom Nav ===== */
#bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 4px 0; padding-bottom: max(4px, env(safe-area-inset-bottom));
  z-index: var(--z-nav); box-shadow: 0 -1px 6px rgba(0,0,0,0.04);
}
.nav-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px 8px; border: none; background: none;
  color: var(--text-hint); font-size: var(--font-xs); cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  border-radius: var(--radius-sm);
}
.nav-item:hover { color: var(--primary); }
.nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}
.nav-item.active::after {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--primary); border-radius: 0 0 3px 3px;
}
.nav-icon { font-size: 1.25rem; line-height: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: var(--font-base); font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { box-shadow: 0 0 0 3px var(--primary-light); }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-outline  { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.mode-tab-btn {
  background: var(--gray-100); color: var(--text-hint);
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: var(--font-sm); font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast);
}
.mode-tab-btn:hover { background: var(--primary-light); color: var(--primary); }
.mode-tab-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

.btn-sm   { padding: 6px 14px; font-size: var(--font-sm); }
.btn-block { width: 100%; }

.btn-text {
  background: none; border: none; color: var(--primary);
  font-size: var(--font-sm); cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm); transition: background var(--transition-fast);
}
.btn-text:hover { background: var(--primary-light); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: var(--font-sm); font-weight: 500;
  margin-bottom: 6px; color: var(--text);
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: var(--font-base); color: var(--text);
  background: #fff; outline: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.form-inline .form-input, .form-inline .form-select { width: auto; flex: 1; min-width: 100px; }
.form-inline .btn { flex-shrink: 0; }

/* ===== Cards (unified base) ===== */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}
.card:hover { box-shadow: var(--shadow-md); }

.task-card.closed { opacity: 0.6; }
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.task-title { font-size: var(--font-md); font-weight: 600; }
.task-status {
  font-size: var(--font-xs); padding: 2px 8px; border-radius: 4px; font-weight: 500;
}
.task-status.active     { background: var(--success-light); color: var(--success); }
.task-status.closed     { background: var(--gray-400); color: #fff; }
.task-status.completed  { background: var(--primary-light); color: var(--primary); }
.task-card.completed { opacity: 0.8; border-left: 3px solid var(--primary); }
.task-card.task-completed { opacity: 0.75; border-left: 3px solid var(--success); }
.task-meta { font-size: var(--font-sm); color: var(--text-hint); margin-bottom: 6px; }
.task-desc { font-size: var(--font-sm); color: var(--text-secondary); margin-bottom: 8px; }
.assign-list { margin-bottom: 8px; }
.assign-user-row {
  padding: 6px 10px; margin-bottom: 4px; background: var(--primary-light);
  border-radius: var(--radius-sm); font-size: var(--font-sm); line-height: 1.7;
}
.assign-types { color: var(--text-secondary); }
.team-tag {
  display: inline-block; padding: 1px 8px; margin-left: 4px;
  background: var(--primary); color: #fff; border-radius: 4px;
  font-size: var(--font-xs); font-weight: 500;
}
.task-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 8px; border-top: 1px solid var(--border);
}

/* ===== Team Tree ===== */
.team-group {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; overflow: hidden;
}
.team-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--border);
}
.team-group-header-click {
  cursor: pointer; user-select: none; font-weight: 600; font-size: var(--font-sm);
  display: flex; align-items: center; gap: 6px;
}
.team-arrow { font-size: 10px; transition: transform var(--transition-fast); }
.team-count { font-weight: 400; color: var(--text-hint); font-size: var(--font-sm); }
.team-select-all { flex-shrink: 0; }
.team-group-body {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px;
  transition: max-height var(--transition-normal); max-height: 500px; overflow: hidden;
}
.team-group-body.collapsed { max-height: 0; padding: 0 12px; }
.agent-cb { font-weight: 500; }
.agent-empid { color: var(--text-hint); font-size: var(--font-xs); font-weight: 400; }

/* ===== Task Type Checkboxes ===== */
.type-checkbox {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--font-sm); user-select: none; background: #fff;
  transition: all var(--transition-fast);
}
.type-checkbox:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.type-checkbox input { display: none; }

/* ===== Agent Config Cards ===== */
.agent-config-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 10px;
}
.agent-config-name { font-weight: 600; font-size: var(--font-base); color: var(--primary); margin-bottom: 8px; }
.agent-type-list { display: flex; flex-direction: column; gap: 6px; }
.agent-type-row { display: flex; align-items: center; gap: 8px; }
.agent-type-row .type-checkbox { flex-shrink: 0; }
.qty-input {
  width: 50px; padding: 4px 6px; border: 1.5px solid var(--border);
  border-radius: 4px; text-align: center; font-size: var(--font-sm);
}
.qty-input:disabled { background: var(--gray-200); color: var(--gray-500); }

/* ===== Submission ===== */
.submit-type-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; margin-bottom: 6px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.submit-type-label { font-weight: 500; font-size: var(--font-base); }
.submit-types-list { margin-top: 8px; }
.badge-pending {
  display: inline-block; padding: 1px 8px; margin-left: 6px;
  background: var(--warning-light); color: var(--warning);
  border-radius: 4px; font-size: var(--font-xs); font-weight: 500;
}
.badge-approved {
  display: inline-block; padding: 2px 10px; margin-left: 8px;
  background: var(--green-100); color: var(--green-700);
  border-radius: 4px; font-size: var(--font-sm); font-weight: 500;
}
.submit-type-row.done { opacity: 0.65; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-secondary); background: var(--bg-card);
  border-radius: var(--radius); margin-top: 12px;
  font-size: var(--font-base);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; display: block; }

/* ===== Stats ===== */
.stats-task-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.stats-task-title { font-size: var(--font-md); font-weight: 600; color: var(--primary); flex: 1; }
.stats-task-date { font-size: var(--font-xs); color: var(--text-hint); }
.stats-progress {
  font-size: var(--font-sm); font-weight: 600; padding: 2px 10px;
  background: var(--primary-light); color: var(--primary); border-radius: 20px;
}
.stats-table { width: 100%; border-collapse: collapse; font-size: var(--font-sm); }
.stats-table th {
  background: var(--bg); padding: 8px 10px; text-align: left;
  font-weight: 600; color: var(--text-secondary); font-size: var(--font-sm);
  border-bottom: 2px solid var(--border);
}
.stats-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.stat-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: var(--font-xs); font-weight: 500; }
.stat-badge.done    { background: var(--green-100); color: var(--green-700); }
.stat-badge.pending { background: var(--orange-50); color: var(--orange-700); }

/* ===== Review ===== */
.review-task-title { font-size: var(--font-md); font-weight: 600; color: var(--primary); margin-bottom: 12px; }
.review-item {
  padding: 12px; margin-bottom: 8px; background: var(--bg);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: var(--font-sm); line-height: 1.8;
}
.review-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; }
.review-type-badge {
  display: inline-block; padding: 2px 10px; background: var(--primary); color: #fff;
  border-radius: 4px; font-size: var(--font-sm); font-weight: 500;
}
.review-time { color: var(--text-hint); font-size: var(--font-xs); margin-left: auto; }
.review-actions { display: flex; gap: 8px; margin-top: 10px; }

/* === 任务审核批量操作 === */
.review-batch-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.review-batch-bar .batch-select-all {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: var(--font-sm); font-weight: 500; user-select: none;
}
.review-batch-bar .batch-select-all input { width: 18px; height: 18px; cursor: pointer; }
.review-batch-bar .batch-stats { font-size: var(--font-sm); color: var(--text-hint); flex: 1; min-width: 100px; }
.review-batch-bar .btn { font-size: var(--font-sm); }
.review-batch-bar .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.review-task-block { position: relative; }
.review-task-block .review-card-checkbox {
  position: absolute; top: 14px; right: 12px;
  width: 18px; height: 18px; cursor: pointer; z-index: 2;
}
.review-task-block.selected { border-color: var(--primary); background: var(--primary-light); }

/* Review Image Grid */
.review-images-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px; padding: 8px; background: var(--bg); border-radius: var(--radius-sm);
}
.review-img-thumb {
  width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); cursor: zoom-in; transition: all var(--transition-fast);
}
.review-img-thumb:hover { transform: scale(1.05); border-color: var(--primary); box-shadow: var(--shadow-md); }

/* Review image item wrapper (for individual reject) */
.review-img-item {
  position: relative; display: inline-block;
}
.review-img-item .review-img-reject {
  position: absolute; top: 2px; right: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(220,38,38,0.9); color: #fff; border: 2px solid rgba(255,255,255,0.5);
  font-size: 14px; line-height: 1; cursor: pointer; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.8; transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 5;
}
.review-img-item .review-img-reject:hover { opacity: 1; transform: scale(1.15); }

/* Image preview modal - body 直接子元素，完全独立 */
#imagePreviewModal {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92);
  z-index: 999999;
  overflow: hidden;
  flex-direction: column;
  pointer-events: auto;
}
#imagePreviewModal.show { display: flex; }

/* 顶部固定栏：关闭按钮 + 页码 */
.preview-top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 48px;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.preview-top-bar .img-modal-close {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.2); border: none; font-size: 1.8rem;
  cursor: pointer; color: #fff;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  pointer-events: auto;
  transition: background var(--transition-fast);
}
.preview-top-bar .img-modal-close:hover { background: rgba(255,255,255,0.4); }
.preview-top-bar .preview-counter {
  font-size: var(--font-sm); color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 4px 16px; border-radius: 20px;
}

/* 滚动区域：图片在这里显示，可上下滚动 */
.image-preview-scroll-area {
  flex: 1;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 16px 40px;
  cursor: zoom-out;
}
.image-preview-scroll-area img {
  max-width: 92vw; width: auto; height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: block;
}

/* 左右翻页箭头 */
#imagePreviewModal .preview-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.2); color: #fff; border: none;
  font-size: 28px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10; pointer-events: auto;
  transition: background var(--transition-fast);
}
#imagePreviewModal .preview-nav:hover { background: rgba(255,255,255,0.4); }
#imagePreviewModal .preview-prev { left: 12px; }
#imagePreviewModal .preview-next { right: 12px; }

/* ===== Admin Panel ===== */
.admin-panel h3 { margin-bottom: 12px; color: var(--primary); font-size: var(--font-lg); }
.admin-panel h4 { margin: 16px 0 8px; color: var(--text); font-size: var(--font-md); }
.member-list { margin-top: 8px; }
.member-list div { padding: 4px 0; font-size: var(--font-sm); }

/* 折叠管理面板 */
.admin-panel-title {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 0;
  transition: color 0.2s;
}
.admin-panel-title:hover { color: var(--primary); }
.admin-panel-title .panel-toggle-icon {
  font-size: 11px;
  color: var(--text-hint);
  transition: transform 0.2s;
  min-width: 14px;
}
.admin-panel-body { transition: max-height 0.3s ease, opacity 0.3s; overflow: hidden; }
.admin-panel-body.collapsed { display: none; }

/* ===== 系统管理面板 ===== */
.admin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 12px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.admin-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.admin-card-icon { font-size: 28px; margin-bottom: 6px; }
.admin-card-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.admin-card-desc { font-size: 12px; color: var(--text-hint); line-height: 1.4; }
.admin-sub-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.admin-sub-header h3 { margin-bottom: 0 !important; }

/* ===== 设备管理 ===== */
.devices-info {
  background: #f0f9ff; border-radius: 8px; padding: 10px 14px;
  margin: 0 16px 12px; font-size: 12px; color: #1e40af; line-height: 1.6;
}
.device-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-card); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border);
}
.device-info { flex: 1; min-width: 0; }
.device-id { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.device-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--text-hint); }
.device-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.device-status {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.device-status-active { background: rgba(34,197,94,.12); color: var(--success); }
.device-status-inactive { background: rgba(148,163,184,.15); color: var(--text-hint); }

/* ===== 白名单管理 ===== */
.whitelist-status-bar {
  background: var(--bg); border-radius: 8px; padding: 10px 14px;
  margin: 0 16px 12px; display: flex; align-items: center; gap: 16px;
  font-size: 13px; flex-wrap: wrap;
}
.whitelist-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; margin-bottom: 4px;
  background: var(--bg-card); border-radius: 6px; border: 1px solid var(--border);
  font-size: 14px; font-weight: 500;
}
.whitelist-code { font-family: monospace; }

/* ===== Data Table ===== */
.table-wrapper {
  width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin-top: 12px;
}
.data-table { width: 100%; border-collapse: collapse; font-size: var(--font-sm); margin-top: 12px; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-weight: 600; color: var(--text-secondary); font-size: var(--font-sm); background: var(--bg); }

/* ===== Login Page ===== */
.login-container {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 80vh; padding: 20px;
}
.login-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(83,74,183,0.35);
}
.login-logo svg { width: 36px; height: 36px; }
.login-title { font-size: var(--font-xl); font-weight: 700; margin-bottom: 6px; color: var(--primary); }
.login-subtitle { font-size: var(--font-sm); color: var(--text-hint); margin-bottom: 32px; }
.login-form {
  width: 100%; max-width: 340px;
  background: var(--bg-card); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

/* ===== Toast (CSS component) ===== */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-toast);
  padding: 10px 24px; border-radius: var(--radius-sm);
  color: #fff; font-size: var(--font-sm); font-weight: 500;
  box-shadow: var(--shadow-md); max-width: 90%; text-align: center;
  animation: toastIn 0.3s ease;
  pointer-events: none;
}
.toast--info    { background: var(--primary); }
.toast--success { background: var(--success); }
.toast--error   { background: var(--danger); }
.toast--warning { background: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Error / Inline ===== */
.error { color: var(--danger); padding: 8px; background: var(--danger-light); border-radius: var(--radius-sm); }
.tab-content > p { text-align: center; color: var(--text-hint); padding: 40px 20px; }

/* ===== Task Type Management ===== */
.type-manage-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: #fff; font-size: var(--font-sm);
}
.type-manage-row:last-child { border-bottom: none; }
.type-manage-row.disabled { opacity: 0.55; background: var(--bg); }
.type-manage-label { font-weight: 500; color: var(--text); min-width: 120px; }
.type-manage-status { font-size: var(--font-xs); color: var(--text-secondary); white-space: nowrap; }
.type-manage-actions { display: flex; gap: 6px; }
.type-manage-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }

/* ===== Drop Zone (upload) ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 20px; text-align: center; cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: 12px; background: var(--gray-50);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.drop-zone-icon { font-size: 2.25rem; margin-bottom: 8px; }
.drop-zone-text { color: var(--text-hint); font-size: var(--font-sm); line-height: 1.8; }
.drop-zone-text small { font-size: var(--font-xs); }

/* Preview thumbnails */
.preview-area { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; min-height: 10px; }
.preview-thumb {
  position: relative; width: 80px; height: 80px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--gray-200);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-thumb .thumb-clickable {
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.preview-thumb .thumb-clickable:hover { opacity: 0.82; }
.preview-remove {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff; border-radius: 50%;
  width: 20px; height: 20px; font-size: var(--font-xs); line-height: 20px;
  text-align: center; cursor: pointer; box-shadow: var(--shadow-sm);
}
.preview-remove:hover { opacity: 0.9; }

/* ===== Task Status Badges ===== */
.task-status-badge {
  font-size: var(--font-xs); font-weight: 600;
  padding: 2px 10px; border-radius: 20px;
  margin-left: 10px; white-space: nowrap;
}
.task-status-badge.active    { background: var(--orange-50);  color: var(--orange-600); }
.task-status-badge.completed { background: var(--green-50);   color: var(--green-600); }

/* ===== Section Divider ===== */
.section-divider {
  margin: 20px 0 12px; padding: 8px 14px;
  background: var(--green-50); border-radius: var(--radius-sm);
  font-size: var(--font-sm); font-weight: 600; color: var(--green-600);
  border-left: 4px solid var(--success);
}

/* ============================================================
   Phase B — Loading / Skeleton
   ============================================================ */

@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-card { height: 160px; margin-bottom: 12px; border-radius: var(--radius); width: 100%; }
.skeleton-text { height: 16px; margin-bottom: 8px; width: 80%; }
.skeleton-text--short { width: 50%; }

.loader {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  text-align: center; padding: 40px 20px;
  color: var(--text-hint); font-size: var(--font-sm);
}

/* ============================================================
   Phase C — Analytics Dashboard
   ============================================================ */

/* Overview cards */
.analytics-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 16px;
}

.analytics-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); text-align: center;
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}
.analytics-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.analytics-card__value {
  font-size: var(--font-2xl); font-weight: 700;
  color: var(--primary); line-height: 1.2;
}
.analytics-card__value--success { color: var(--success); }
.analytics-card__value--warning { color: var(--warning); }
.analytics-card__value--danger  { color: var(--danger); }
.analytics-card__label {
  font-size: var(--font-xs); color: var(--text-hint); margin-top: 4px;
}

/* Rank table */
.rank-table {
  width: 100%; border-collapse: collapse; font-size: var(--font-sm);
}
.rank-table th {
  background: var(--gray-50); padding: 8px 10px; text-align: left;
  font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border);
}
.rank-table td { padding: 10px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition-fast); }
.rank-table tbody tr:hover { background: var(--primary-light); }
.rank-table .rank-num { font-weight: 700; color: var(--primary); width: 40px; text-align: center; }
.rank-table tbody tr:first-child .rank-num { color: #F4B400; }
.rank-table tbody tr:nth-child(2) .rank-num { color: var(--gray-400); }
.rank-table tbody tr:nth-child(3) .rank-num { color: #CD7F32; }

.speed-fast   { color: var(--success); font-weight: 600; }
.speed-medium { color: var(--warning); font-weight: 600; }
.speed-slow   { color: var(--danger); font-weight: 600; }

/* CSS Bar chart */
.bar-chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 160px; padding: 0 4px;
}
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart__bar {
  width: 100%; max-width: 40px; min-height: 4px;
  background: var(--primary); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height var(--transition-normal);
}
.bar-chart__bar--success { background: var(--success); }
.bar-chart__label { font-size: var(--font-xs); color: var(--text-hint); white-space: nowrap; }
.bar-chart__value { font-size: var(--font-xs); color: var(--text-secondary); font-weight: 600; }

/* Team compare bars */
.team-compare-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; padding: 8px 0;
}
.team-compare-name {
  width: 80px; font-size: var(--font-sm); font-weight: 500;
  text-align: right; flex-shrink: 0;
}
.team-compare-bar-wrapper {
  flex: 1; height: 24px; background: var(--gray-100);
  border-radius: 12px; overflow: hidden; position: relative;
}
.team-compare-bar {
  height: 100%; border-radius: 12px;
  transition: width var(--transition-normal);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px; min-width: 32px;
}
.team-compare-bar__label { font-size: var(--font-xs); color: #fff; font-weight: 600; }
.team-compare-bar--a { background: var(--primary); }
.team-compare-bar--b { background: var(--success); }
.team-compare-bar--c { background: var(--warning); }

/* Modal */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--bg-card); border-radius: var(--radius);
  width: 92%; max-width: 600px; max-height: 80vh;
  overflow-y: auto; padding: 24px 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: var(--text-hint);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background var(--transition-fast);
}
.modal-close:hover { background: var(--gray-200); }
.modal-header { font-size: var(--font-lg); font-weight: 700; color: var(--primary); margin-bottom: 16px; padding-right: 36px; }

/* Time range tabs */
.time-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.time-tab {
  padding: 4px 14px; border: 1px solid var(--border);
  border-radius: 20px; font-size: var(--font-xs);
  cursor: pointer; background: #fff; color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.time-tab:hover { border-color: var(--primary); color: var(--primary); }
.time-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Analytics section header */
.analytics-section h4 {
  font-size: var(--font-md); font-weight: 600; color: var(--text);
  margin-bottom: 12px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 768px) {
  :root { --max-width: 900px; }
  #main-content { padding: 24px 24px 90px; }
  .analytics-overview { grid-template-columns: repeat(4, 1fr); }
  .bar-chart__bar { max-width: 48px; }
  .bar-chart { height: 200px; }
}

/* ===== Accessibility ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   财务系统样式
   ============================================================ */
.finance-sub-tabs { margin-bottom: 16px; }
.finance-sub-content { animation: pageIn 0.25s ease; }

.finance-month-picker {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-bottom: 16px;
}
.finance-month-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--border); background: #fff;
  font-size: 18px; cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.finance-month-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.finance-month-label {
  font-size: var(--font-md); font-weight: 600; color: var(--text);
  min-width: 100px; text-align: center;
}

.finance-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.finance-summary-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 14px 10px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); text-align: center;
}
.finance-summary-card__value { font-size: var(--font-lg); font-weight: 700; line-height: 1.3; }
.finance-summary-card__value--income  { color: var(--success); }
.finance-summary-card__value--expense { color: var(--danger); }
.finance-summary-card__value--balance { color: var(--primary); }
.finance-summary-card__label { font-size: var(--font-xs); color: var(--text-hint); margin-top: 4px; }

.finance-category-section { margin-bottom: 16px; }
.finance-category-title {
  font-size: var(--font-sm); font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; padding-left: 4px;
}
.finance-category-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 4px;
  background: var(--bg); border-radius: var(--radius-sm);
  font-size: var(--font-sm);
}
.finance-category-name { flex: 1; color: var(--text); }
.finance-category-amount { font-weight: 600; }
.finance-category-amount--income { color: var(--success); }
.finance-category-amount--expense { color: var(--danger); }

.finance-txn-list { margin-top: 8px; }
.finance-txn-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: var(--font-sm);
}
.finance-txn-type {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.finance-txn-type--income { background: var(--success-light); }
.finance-txn-type--expense { background: var(--danger-light); }
.finance-txn-info { flex: 1; }
.finance-txn-category { font-weight: 500; color: var(--text); }
.finance-txn-desc { font-size: var(--font-xs); color: var(--text-hint); }
.finance-txn-amount { font-weight: 700; font-size: var(--font-base); }
.finance-txn-amount--income { color: var(--success); }
.finance-txn-amount--expense { color: var(--danger); }
.finance-txn-date { font-size: var(--font-xs); color: var(--text-hint); }

.finance-reimb-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.finance-reimb-card.pending { border-left: 3px solid var(--warning); }
.finance-reimb-card.approved { border-left: 3px solid var(--success); }
.finance-reimb-card.rejected { border-left: 3px solid var(--danger); opacity: 0.7; }
.finance-reimb-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.finance-reimb-amount { font-size: var(--font-lg); font-weight: 700; color: var(--primary); }
.finance-reimb-status { font-size: var(--font-xs); padding: 2px 10px; border-radius: 4px; font-weight: 500; }
.finance-reimb-status--pending { background: var(--warning-light); color: var(--warning); }
.finance-reimb-status--approved { background: var(--green-100); color: var(--green-700); }
.finance-reimb-status--rejected { background: var(--danger-light); color: var(--danger); }
.finance-reimb-screenshot {
  width: 100%; max-height: 200px; object-fit: cover;
  border-radius: var(--radius-sm); margin: 8px 0; cursor: zoom-in;
  border: 1px solid var(--border);
}
.finance-reimb-meta { font-size: var(--font-xs); color: var(--text-hint); margin-top: 4px; }
.finance-reimb-actions { display: flex; gap: 8px; margin-top: 10px; }

/* === 报销批量操作 === */
.reimb-batch-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.reimb-batch-bar .batch-select-all {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: var(--font-sm); font-weight: 500; user-select: none;
}
.reimb-batch-bar .batch-select-all input { width: 18px; height: 18px; cursor: pointer; }
.reimb-batch-bar .batch-stats { font-size: var(--font-sm); color: var(--text-hint); flex: 1; min-width: 100px; }
.reimb-batch-bar .batch-stats .batch-amount { font-weight: 700; color: var(--primary); }
.reimb-batch-bar .btn { font-size: var(--font-sm); }
.reimb-batch-bar .btn:disabled { opacity: 0.45; cursor: not-allowed; }

.finance-reimb-card { position: relative; }
.finance-reimb-card .reimb-card-checkbox {
  position: absolute; top: 14px; left: 12px;
  width: 18px; height: 18px; cursor: pointer; z-index: 2;
}
.finance-reimb-card.selected { border-color: var(--primary); background: var(--primary-light); }

.finance-ledger-form { margin-bottom: 16px; }
.finance-type-toggle { display: flex; gap: 0; margin-bottom: 12px; }
.finance-type-toggle-btn {
  flex: 1; padding: 10px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; font-weight: 500; font-size: var(--font-sm);
  transition: all var(--transition-fast);
}
.finance-type-toggle-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.finance-type-toggle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.finance-type-toggle-btn.active--income { background: var(--success); color: #fff; border-color: var(--success); }
.finance-type-toggle-btn.active--expense { background: var(--danger); color: #fff; border-color: var(--danger); }

.finance-team-selector { margin-bottom: 12px; }
.finance-empty { text-align: center; padding: 40px 20px; color: var(--text-hint); font-size: var(--font-sm); }

/* Reimbursement monthly summary */
.finance-reimb-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; margin-bottom: 4px;
  background: var(--bg); border-radius: var(--radius-sm);
}
.finance-reimb-summary-name { font-weight: 500; color: var(--text); font-size: var(--font-sm); }
.finance-reimb-summary-detail { display: flex; align-items: center; gap: 6px; }
.finance-reimb-summary-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; margin-top: 8px; border-top: 1px solid var(--border);
  font-size: var(--font-sm); color: var(--text-secondary);
}

/* Transaction delete button */
.finance-txn-delete {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; color: var(--text-hint);
  transition: all var(--transition-fast); flex-shrink: 0;
}
.finance-txn-delete:hover { background: var(--danger-light); color: var(--danger); }

/* === 报销截图画廊（多图） === */
.finance-reimb-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
  padding: 6px;
  background: var(--bg-card-hover);
  border-radius: var(--radius);
  position: relative;
}
.finance-reimb-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform var(--transition-fast);
  background: var(--bg-card);
}
.finance-reimb-thumb:hover { transform: scale(1.05); border-color: var(--primary); }
.finance-reimb-gallery-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: var(--font-xs);
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
}

/* === 调休提醒横幅 === */
.leave-reminder-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(239, 159, 39, 0.12), rgba(239, 159, 39, 0.06));
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  position: relative;
  animation: reminderPulse 2s ease-in-out infinite;
}
@keyframes reminderPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 159, 39, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(239, 159, 39, 0); }
}
.leave-reminder-banner .reminder-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.leave-reminder-banner .reminder-content {
  flex: 1;
  min-width: 0;
}
.leave-reminder-banner .reminder-title {
  font-weight: 700;
  font-size: var(--font-sm);
  color: var(--text-primary);
  margin-bottom: 4px;
}
.leave-reminder-banner .reminder-text {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  line-height: 1.5;
}
.leave-reminder-banner .reminder-text strong {
  color: var(--warning);
  font-weight: 600;
}
.leave-reminder-banner .reminder-deadline {
  font-size: var(--font-xs);
  color: var(--danger);
  margin-top: 4px;
  font-weight: 600;
}
.leave-reminder-banner .reminder-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-hint);
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}
.leave-reminder-banner .reminder-close:hover {
  color: var(--text-primary);
}

/* === 调休排班 - 日历视图 === */
.schedule-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.schedule-calendar-weekday {
  text-align: center;
  font-size: var(--font-xs);
  color: var(--text-hint);
  padding: 6px 0;
  font-weight: 600;
}
.schedule-calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-body);
  border: 1.5px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  min-height: 48px;
  gap: 2px;
}
.schedule-calendar-day.empty {
  background: transparent;
  cursor: default;
  border-color: transparent;
}
.schedule-calendar-day:hover:not(.empty):not(.past) {
  background: var(--bg-hover);
  border-color: var(--border);
  transform: scale(1.05);
}
.schedule-calendar-day.today .schedule-day-num {
  background: var(--primary);
  color: #fff;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.schedule-calendar-day.weekend:not(.past) .schedule-day-num {
  color: var(--danger);
}
.schedule-calendar-day.holiday:not(.past) .schedule-day-num {
  color: var(--danger);
}
.schedule-calendar-day.holiday:not(.past) {
  background: rgba(220, 53, 69, 0.06);
  border-color: rgba(220, 53, 69, 0.25);
}
.schedule-calendar-day.past {
  opacity: 0.4;
  cursor: not-allowed;
}
.schedule-calendar-day.full {
  background: rgba(255, 159, 28, 0.15);
  border-color: var(--warning);
}
.schedule-calendar-day.full .schedule-day-num {
  color: var(--warning);
}
.schedule-calendar-day.has-leave {
  background: rgba(67, 97, 238, 0.06);
  border-color: rgba(67, 97, 238, 0.3);
}
.schedule-calendar-day.my-leave {
  background: rgba(67, 97, 238, 0.12);
  border-color: var(--primary);
  border-width: 2px;
}
.schedule-calendar-day.selected {
  background: var(--primary-light, rgba(67, 97, 238, 0.15));
  border-color: var(--primary);
  border-width: 2px;
}
.schedule-day-num {
  font-weight: 700;
  font-size: var(--font-sm);
  color: var(--text-primary);
  line-height: 1;
}
.schedule-day-badge {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}
.schedule-day-badge.free {
  color: var(--success);
  background: rgba(32, 184, 139, 0.1);
}
.schedule-day-badge.partial {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.1);
}
.schedule-day-badge.full {
  color: var(--warning);
  background: rgba(255, 159, 28, 0.15);
}
.schedule-day-badge.weekend-label {
  color: var(--danger);
  background: rgba(220, 53, 69, 0.08);
}
.schedule-day-badge.holiday {
  color: #fff;
  background: var(--danger);
}
.schedule-calendar-day.past .schedule-day-badge {
  display: none;
}

/* Day detail panel */
.schedule-day-detail {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.schedule-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.schedule-detail-title {
  font-weight: 700;
  font-size: var(--font-md);
  color: var(--text-primary);
}
.schedule-detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: var(--font-md);
  margin-bottom: 10px;
}
.schedule-detail-count {
  font-size: var(--font-xs);
  color: var(--text-hint);
  font-weight: 600;
}
.schedule-detail-people {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.schedule-detail-person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.schedule-detail-person.me {
  background: rgba(67, 97, 238, 0.08);
  color: var(--primary);
  font-weight: 600;
}
.schedule-detail-name {
  display: flex;
  align-items: center;
  gap: 4px;
}
.schedule-detail-empty {
  color: var(--text-hint);
  font-size: var(--font-sm);
  text-align: center;
  padding: 16px 0;
}
.schedule-detail-action {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.schedule-btn-apply {
  background: var(--primary);
  color: #fff;
  padding: 6px 16px;
  font-size: var(--font-sm);
  border-radius: 6px;
  border: none;
  cursor: pointer;
}
.schedule-btn-apply:hover { opacity: 0.85; }
.schedule-btn-cancel {
  background: var(--danger);
  color: #fff;
  padding: 4px 12px;
  font-size: var(--font-xs);
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.schedule-btn-cancel:hover { opacity: 0.85; }
.schedule-full-label { font-size: var(--font-sm); color: var(--warning); }

/* 电商活动日（不可调休） */
.schedule-calendar-day.ecom:not(.past) {
  background: rgba(239, 159, 39, 0.12);
  border-color: rgba(239, 159, 39, 0.35);
}
.schedule-calendar-day.ecom:not(.past) .schedule-day-num { color: var(--warning); }
.schedule-day-badge.ecom { color: #fff; background: var(--warning); }

/* 月底最后一天等无标签禁休日 */
.schedule-calendar-day.blocked:not(.past) {
  background: rgba(136, 135, 128, 0.10);
  border-color: rgba(136, 135, 128, 0.30);
}
.schedule-calendar-day.blocked:not(.past) .schedule-day-num { color: var(--text-hint); }
.schedule-day-badge.blocked { color: var(--text-hint); background: rgba(136, 135, 128, 0.12); }

/* 详情面板里的禁休提示 */
.schedule-blocked-label {
  font-size: var(--font-sm); font-weight: 600; color: var(--danger);
  display: block; padding: 6px 0;
}

/* ============================================================
   培训模块样式 (tr- 前缀，从独立培训系统合并)
   ============================================================ */

/* 变量别名 — 兼容培训系统引用 */
:root {
  --card: var(--bg-card);
  --primary-bg: var(--primary-light);
  --shadow: var(--shadow-sm);
}

/* 通用页面结构 */
.tr-page { padding-bottom: 80px; }
.tr-page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.tr-page-header h2 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; margin: 0; }
.tr-header-actions { display: flex; gap: 4px; }
.tr-section-title { padding: 12px 20px 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.tr-section-label { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.tr-empty { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14px; white-space: pre-line; }

/* 模块选择页 */
.tr-module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 8px 20px 16px; }
.tr-module-card {
  background: var(--card); border-radius: var(--radius-sm); padding: 14px 10px;
  text-align: center; cursor: pointer; border: 1.5px solid var(--border); transition: all 0.2s;
}
.tr-module-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.tr-module-card.disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg); }
.tr-module-card.disabled:hover { border-color: var(--border); transform: none; box-shadow: none; }
.tr-module-num { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.tr-module-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.tr-module-status .badge { font-size: 10px; }

/* 学习页 */
.tr-learning-page { padding-bottom: 120px; }
.tr-learning-progress { height: 3px; background: var(--border); }
.tr-learning-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 1s ease-out; }
.tr-learning-content { padding: 16px 20px; }
.tr-learning-section { margin-bottom: 24px; }
.tr-learning-obj-list { display: flex; flex-direction: column; gap: 6px; }
.tr-learning-obj-item {
  padding: 8px 12px; background: var(--primary-bg); border-radius: var(--radius-sm);
  font-size: 14px; color: var(--primary); font-weight: 500;
}
.tr-point-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.tr-point-title { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.tr-point-content { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.tr-point-content strong { color: var(--primary); }
.tr-script-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.tr-script-title { font-size: 14px; font-weight: 600; color: #92400e; margin-bottom: 8px; }
.tr-script-content { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.tr-script-content strong { color: #92400e; }
.tr-mistake-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; }
.tr-mistake-wrong { font-size: 14px; color: var(--danger); margin-bottom: 6px; font-weight: 500; }
.tr-mistake-right { font-size: 14px; color: var(--success); font-weight: 500; }
.tr-learning-bottom {
  position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: var(--card); padding: 16px 20px;
  border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(0,0,0,0.06); z-index: 20;
}

/* 场景选择页 */
.tr-scenario-list { padding: 0 20px; }
.tr-scenario-card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  border: 1.5px solid var(--border); cursor: pointer; transition: all 0.2s;
}
.tr-scenario-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.tr-scenario-card:active { transform: scale(0.98); }
.tr-scenario-num { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.tr-scenario-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.tr-scenario-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); }
.tr-scenario-tag {
  font-size: 12px; color: var(--primary); background: var(--primary-bg);
  padding: 2px 8px; border-radius: 99px; white-space: nowrap; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis;
}

/* 对练聊天页 */
.tr-chat-page { display: flex; flex-direction: column; height: calc(100vh - 56px); height: calc(100dvh - 56px); }
.tr-chat-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.tr-chat-progress { flex: 1; }
.tr-progress-bar { height: 4px; background: var(--border); border-radius: 99px; margin-top: 4px; overflow: hidden; }
.tr-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width 0.3s; }

.tr-chat-area { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.tr-chat-system {
  background: linear-gradient(135deg, var(--primary-bg), #faf5ff);
  border-radius: var(--radius); padding: 14px; margin-bottom: 16px; border: 1px solid var(--border);
}
.tr-system-label { font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.tr-system-content { font-size: 14px; color: var(--text); line-height: 1.6; }

.tr-chat-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.tr-chat-msg.me { flex-direction: row-reverse; }
.tr-msg-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: var(--card); }
.tr-msg-bubble { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.tr-msg-bubble.customer-bubble { background: var(--card); border: 1px solid var(--border); border-top-left-radius: 4px; }
.tr-msg-bubble.me-bubble { background: var(--primary); color: #fff; border-top-right-radius: 4px; }
.tr-msg-img { max-width: 200px; max-height: 200px; border-radius: 8px; margin-top: 4px; }
.tr-msg-video { max-width: 250px; max-height: 200px; border-radius: 8px; margin-top: 4px; }

.tr-chat-hint { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: #92400e; margin-bottom: 12px; }

.tr-input-toolbar { display: flex; gap: 8px; padding: 6px 16px; background: var(--card); border-top: 1px solid var(--border); align-items: center; }
.tr-toolbar-btn { width: 36px; height: 36px; border: none; background: transparent; font-size: 18px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.tr-toolbar-btn:hover { background: var(--primary-bg); }

.tr-input-area { padding: 12px 16px; background: var(--card); border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; flex-wrap: wrap; }
.tr-input-area textarea { flex: 1; min-width: 200px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; resize: none; outline: none; font-family: inherit; line-height: 1.5; }
.tr-input-area textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.tr-send-btn { flex-shrink: 0; height: 44px; padding: 0 16px; }

.tr-emoji-panel { background: var(--card); border-top: 1px solid var(--border); }
.tr-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 12px; max-height: 200px; overflow-y: auto; }
.tr-emoji-btn { width: 36px; height: 36px; border: none; background: transparent; font-size: 20px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.tr-emoji-btn:hover { background: var(--primary-bg); }

/* 结果页 */
.tr-result-page { padding-bottom: 24px; }
.tr-result-section { margin: 16px 20px; background: var(--card); border-radius: var(--radius); padding: 16px; border: 1px solid var(--border); }
.tr-qa-item { padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.tr-qa-item:last-child { border-bottom: none; }
.tr-qa-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.tr-qa-customer { font-size: 14px; color: var(--text); padding: 6px 10px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 8px; }
.tr-qa-user { font-size: 14px; color: var(--primary); padding: 6px 10px; background: var(--primary-bg); border-radius: var(--radius-sm); }
.tr-ref-answer { font-size: 14px; line-height: 1.8; white-space: pre-wrap; color: var(--text); }
.tr-result-actions { padding: 16px 20px; }

/* 评分卡片 */
.tr-score-card { margin: 16px 20px; background: var(--card); border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.tr-score-header { font-size: 17px; font-weight: 700; margin-bottom: 16px; text-align: center; }
.tr-score-display { text-align: center; margin-bottom: 20px; }
.tr-score-number { font-size: 56px; font-weight: 800; line-height: 1; }
.tr-score-total { font-size: 20px; font-weight: 500; opacity: 0.6; }
.tr-score-breakdown { margin-bottom: 16px; }
.tr-breakdown-item { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tr-breakdown-name { font-size: 13px; width: 100px; flex-shrink: 0; color: var(--text-secondary); }
.tr-breakdown-bar { flex: 1; height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.tr-breakdown-fill { height: 100%; border-radius: 99px; transition: width 0.5s; }
.tr-breakdown-score { font-size: 13px; font-weight: 600; width: 30px; text-align: right; }
.tr-feedback-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.tr-feedback-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.tr-feedback-item { font-size: 14px; color: var(--text); padding: 2px 0; line-height: 1.5; }

/* 训练记录页 */
.tr-records-summary { display: flex; padding: 20px; gap: 12px; }
.tr-summary-item { flex: 1; text-align: center; background: var(--card); padding: 16px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.tr-summary-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.tr-summary-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tr-record-group { margin: 0 20px 16px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.tr-record-group-header { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--bg); font-size: 15px; font-weight: 600; }
.tr-record-group-score { color: var(--primary); font-size: 13px; }
.tr-record-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--gray-100); }
.tr-record-info { flex: 1; }
.tr-record-scenario { font-size: 14px; font-weight: 500; }
.tr-record-date { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.tr-record-score { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; }
.tr-score-good { background: var(--success); }
.tr-score-ok { background: var(--warning); }
.tr-score-bad { background: var(--danger); }

/* 管理后台 */
.tr-admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; }
.tr-admin-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px 16px; text-align: center; cursor: pointer; transition: all 0.2s; font-size: 32px; }
.tr-admin-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tr-admin-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tr-admin-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* 模块管理 */
.tr-module-mgr-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; margin: 0 20px 8px; }
.tr-module-mgr-name { font-size: 15px; font-weight: 600; }

/* 内容管理列表 */
.tr-admin-module-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0 20px 8px; cursor: pointer; transition: all 0.2s; }
.tr-admin-module-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.tr-admin-module-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* 场景编辑 */
.tr-edit-section { margin: 16px 0; }
.tr-edit-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tr-scenario-edit-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.tr-scenario-edit-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.tr-scenario-edit-title { font-size: 15px; font-weight: 600; }

/* 响应式 */
@media (min-width: 768px) { .tr-module-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 360px) { .tr-module-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   学习模块样式 (lrn- 前缀)
   ============================================================ */

.lrn-page { padding-bottom: 80px; }
.lrn-page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.lrn-page-header h2 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; margin: 0; padding: 0 8px; }
.lrn-header-actions { display: flex; gap: 4px; }
.lrn-section-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin: 16px 20px 8px; }

/* 搜索框 */
.lrn-search-bar { padding: 8px 16px; }
.lrn-search-bar .form-input { width: 100%; }

/* 搜索结果 */
.lrn-search-results { padding: 0 16px; }
.lrn-search-item {
  padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
}
.lrn-search-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lrn-search-item-module { font-size: 12px; color: var(--text-hint); margin-bottom: 4px; }
.lrn-search-item-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.lrn-search-item-preview { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.lrn-search-item-meta { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

/* 模块网格 */
.lrn-module-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 8px 16px;
}
.lrn-module-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 8px; text-align: center; cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.lrn-module-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.lrn-module-card.lrn-disabled { opacity: 0.5; cursor: default; }
.lrn-module-card.lrn-disabled:hover { border-color: var(--border); box-shadow: none; transform: none; }
.lrn-module-icon { font-size: 28px; }
.lrn-module-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.lrn-module-meta { font-size: 11px; }
.lrn-module-progress { width: 100%; height: 4px; background: var(--gray-100); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.lrn-module-progress-text { font-size: 10px; color: var(--text-hint); }
.lrn-module-admin-hint { font-size: 10px; color: var(--primary); margin-top: 4px; }

/* 进度条 */
.lrn-progress-bar { width: 100%; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.lrn-progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.3s; }

/* 课程列表 */
.lrn-lessons-progress { display: flex; align-items: center; gap: 8px; padding: 8px 16px; }
.lrn-lessons-progress .lrn-progress-bar { flex: 1; }
.lrn-progress-text { font-size: 12px; color: var(--text-hint); white-space: nowrap; }

.lrn-lesson-list { padding: 0 16px; }
.lrn-lesson-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
}
.lrn-lesson-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lrn-lesson-card.lrn-learned { background: var(--primary-light); }
.lrn-lesson-num { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.lrn-lesson-card.lrn-learned .lrn-lesson-num { background: var(--primary); color: #fff; }
.lrn-lesson-info { flex: 1; min-width: 0; }
.lrn-lesson-title { font-size: 15px; font-weight: 600; }
.lrn-lesson-sub { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.lrn-lesson-arrow { color: var(--text-hint); font-size: 20px; }
.lrn-must-read { display: inline-block; background: rgba(255,193,7,.15); color: var(--warning); font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* 课程详情 */
.lrn-detail-page { padding-bottom: 100px; }
.lrn-must-read-banner { background: rgba(255,193,7,.1); color: var(--warning); font-size: 14px; font-weight: 600; padding: 8px 16px; text-align: center; }
.lrn-detail-section { margin: 0 16px 16px; }
.lrn-detail-content {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
}
.lrn-media-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lrn-media-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.lrn-media-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.lrn-media-info { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; gap: 4px; }
.lrn-media-name { font-size: 12px; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrn-video-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 8px;
}
.lrn-video-item video { width: 100%; max-height: 240px; background: #000; }
.lrn-detail-actions { display: flex; gap: 8px; padding: 0 16px 16px; flex-wrap: wrap; }
.lrn-detail-actions .btn { flex: 1; min-width: 120px; }

/* 空状态 */
.lrn-empty { text-align: center; padding: 40px 20px; color: var(--text-hint); font-size: 14px; line-height: 2; }

/* 管理后台 */
.lrn-admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px; }
.lrn-admin-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 12px; text-align: center; cursor: pointer; transition: all 0.2s; font-size: 32px;
}
.lrn-admin-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lrn-admin-title { font-size: 14px; font-weight: 600; margin-top: 8px; }
.lrn-admin-desc { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

.lrn-admin-module-item {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin: 0 16px 8px; cursor: pointer; transition: all 0.2s;
}
.lrn-admin-module-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lrn-admin-module-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* 课程编辑列表 */
.lrn-admin-lesson-list { padding: 0 16px; }
.lrn-admin-lesson-card {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.lrn-admin-lesson-info { flex: 1; cursor: pointer; }
.lrn-admin-lesson-title { font-size: 14px; font-weight: 600; }
.lrn-admin-lesson-meta { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.lrn-admin-lesson-actions { display: flex; gap: 2px; flex-shrink: 0; }
.lrn-admin-lesson-actions .btn { padding: 4px 8px; font-size: 12px; }

/* 编辑面板 */
.lrn-edit-panel { margin: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.lrn-edit-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lrn-edit-panel .card { border: none; border-radius: 0; margin: 0; box-shadow: none; }
.lrn-edit-panel-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.lrn-edit-panel-actions .btn { flex: 1; }

/* 媒体编辑区 */
.lrn-edit-media-area { margin-top: 8px; }
.lrn-edit-media-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.lrn-edit-media-thumb { position: relative; width: 80px; }
.lrn-edit-media-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.lrn-edit-media-name { font-size: 10px; color: var(--text-hint); text-align: center; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrn-media-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; border: none; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lrn-edit-video-list { margin-bottom: 8px; }
.lrn-edit-video-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--gray-50); border-radius: var(--radius-sm); margin-bottom: 4px; }
.lrn-edit-video-info { font-size: 13px; }

/* 学习进度统计 */
.lrn-records-summary { display: flex; padding: 16px; gap: 8px; }
.lrn-summary-item { flex: 1; text-align: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 8px; }
.lrn-summary-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.lrn-summary-label { font-size: 12px; color: var(--text-hint); margin-top: 4px; }
.lrn-record-group { margin: 0 16px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.lrn-record-group-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--gray-50); font-size: 14px; font-weight: 600; }
.lrn-record-group-score { font-size: 13px; color: var(--primary); }
.lrn-record-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); }
.lrn-record-info { flex: 1; min-width: 0; }
.lrn-record-scenario { font-size: 13px; font-weight: 500; }
.lrn-record-date { font-size: 11px; color: var(--text-hint); margin-top: 2px; }
.lrn-record-score { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 14px; border-radius: 50%; }
.lrn-score-good { background: rgba(76,175,80,.15); color: var(--success); }

/* 响应式 */
@media (min-width: 768px) { .lrn-module-grid { grid-template-columns: repeat(4, 1fr); } .lrn-media-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 360px) { .lrn-module-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   块式编辑器样式 (lrn-block-* 前缀)
   ============================================================ */

/* 编辑区整体 */
.lrn-block-editor {
  margin: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lrn-block-editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.lrn-block-editor-header .lrn-section-label { margin: 0; }
.lrn-block-editor-body { padding: 16px; }
.lrn-block-editor-footer {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.lrn-block-editor-footer .btn { flex: 1; }

/* 块列表区域 */
.lrn-blocks-area { margin-top: 16px; }
.lrn-blocks-label { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }

/* 块卡片 */
.lrn-block-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px;
  overflow: hidden; cursor: pointer; transition: all 0.15s;
}
.lrn-block-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.lrn-block-card.lrn-block-editing {
  border-color: var(--primary);
  border-width: 2px;
  cursor: default;
  background: #fff;
}

/* 块卡片头部 */
.lrn-block-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--gray-50); border-bottom: 1px solid var(--border);
}
.lrn-block-card.lrn-block-editing .lrn-block-card-header {
  background: rgba(83,74,183,0.06);
  border-bottom-color: rgba(83,74,183,0.15);
}

/* 块类型标签 */
.lrn-block-type-tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; color: #fff;
}
.lrn-tag-text  { background: #6366f1; }
.lrn-tag-image { background: #10b981; }
.lrn-tag-video { background: #f59e0b; }

.lrn-block-card-actions { display: flex; gap: 2px; }
.lrn-block-card-actions .btn { padding: 4px 8px; font-size: 12px; }

/* 块卡片预览 */
.lrn-block-card-body { padding: 10px 12px; }
.lrn-block-preview { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.lrn-block-preview-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 块内媒体列表 */
.lrn-block-media-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.lrn-block-media-thumb { position: relative; width: 72px; }
.lrn-block-media-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.lrn-block-media-name { font-size: 10px; color: var(--text-hint); text-align: center; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrn-block-video-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; background: var(--gray-50); border-radius: var(--radius-sm);
  margin-bottom: 4px; font-size: 13px;
}

/* 添加块按钮栏 */
.lrn-add-block-bar {
  display: flex; align-items: center; gap: 8px; padding-top: 12px;
  border-top: 1px dashed var(--border); margin-top: 12px;
}
.lrn-add-block-bar .btn { font-size: 13px; }

/* 拖拽上传区域 */
.lrn-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 8px;
}
.lrn-dropzone:hover {
  border-color: var(--primary);
  background: rgba(0, 122, 255, .04);
}
.lrn-dropzone-active {
  border-color: var(--primary) !important;
  background: rgba(0, 122, 255, .08) !important;
}

/* 详情页块样式 */
.lrn-detail-blocks { padding: 12px 0; }
.lrn-block { margin: 0 16px 12px; }
.lrn-block-label {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 8px; text-transform: uppercase;
}
.lrn-block-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  font-size: 15px; line-height: 1.8; white-space: pre-wrap; word-break: break-word;
}

/* ====== 后台管理：搜索/筛选栏 ====== */
.admin-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px; align-items: center;
}
.admin-filter-bar .admin-search { flex: 2 1 180px; min-width: 160px; width: auto; }
.admin-filter-bar .form-select { flex: 1 1 120px; min-width: 100px; width: auto; padding: 8px 10px; font-size: var(--font-sm); }
.admin-filter-bar .btn { flex: 0 0 auto; }

/* 面板标题右侧的计数 */
.panel-count {
  font-size: var(--font-xs); font-weight: 500; color: var(--text-hint);
  background: var(--gray-100); border-radius: 10px; padding: 2px 8px;
}

/* 用户表格操作列 */
.cell-actions { white-space: nowrap; }
.cell-actions .btn-text { padding: 2px 6px; font-size: var(--font-xs); }
.btn-text-danger { color: var(--danger) !important; }
.row-off { opacity: .55; }

/* 状态小标签 */
.badge-ok, .badge-off {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap;
}
.badge-ok { color: var(--green-700); background: var(--green-50); }
.badge-off { color: var(--gray-600); background: var(--gray-200); }

/* 白名单/设备行里的姓名 */
.whitelist-name {
  margin-left: 8px; font-family: inherit;
  font-size: var(--font-sm); font-weight: 500; color: var(--text-secondary);
}
.whitelist-name-missing { color: var(--danger); font-style: italic; }

/* 行内提示条 */
.admin-inline-tip {
  background: var(--warning-light); color: var(--gray-700);
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: var(--font-sm); margin-bottom: 8px; line-height: 1.6;
}
.admin-inline-tip a { color: var(--primary); font-weight: 600; }

/* 管理页底部版本标记 */
.app-version {
  margin-top: 16px; text-align: center;
  font-size: var(--font-xs); color: var(--text-hint); line-height: 1.8;
}
.app-version a { color: var(--primary); font-weight: 600; margin-left: 4px; }

/* 编辑账号弹窗头部 */
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: var(--font-lg); }
