/* ================================================================
   IEP2 Web UI — 完整响应式样式方案
   ================================================================ */

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

html, body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1e293b;
  background: #f0f4f8;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

a { color: #2563eb; text-decoration: none; }
a:active { opacity: 0.7; }

img { max-width: 100%; height: auto; display: block; }

/* ===== 2. App 容器 ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  background: #f0f4f8;
}

/* ===== 3. 顶部导航栏 ===== */
#app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.25);
  flex-shrink: 0;
}

.header-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border-radius: 8px;
}
.header-back.visible {
  opacity: 1;
  pointer-events: auto;
}
.header-back:active {
  background: rgba(255,255,255,0.15);
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 8px;
}

.header-status {
  flex-shrink: 0;
  font-size: 14px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 连接状态点 */
.status-dot { color: #ff4d4f; }
.status-dot.connected { color: #22c55e; }
.status-dot.disconnected { color: #ef4444; }
.status-dot.loading { color: #f59e0b; animation: pulse 1.2s ease-in-out infinite; }

/* ===== 4. 侧边栏 (PC) ===== */
.sidebar {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  flex-direction: column;
  z-index: 900;
  overflow-y: auto;
}

.sidebar-logo {
  display: none; /* hidden on mobile, shown on PC */
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 4px;
}

.sidebar-nav .nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.15s;
  text-align: left;
  min-height: 44px;
}

.sidebar-nav .nav-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-nav .nav-btn:active {
  background: #e2e8f0;
}

.sidebar-nav .nav-btn.active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.sidebar-nav .nav-btn .nav-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sidebar-nav .nav-btn .nav-label {
  white-space: nowrap;
}

/* 首页底部占位，确保可滚动到底部导航之上 */
.home-bottom-spacer {
  height: 90px;
}

/* ===== 5. 底部导航 (手机) ===== */
.bottom-nav {
  display: flex;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  position: sticky;
  bottom: 0;
  z-index: 900;
  padding-bottom: env(safe-area-inset-bottom, 0);
  flex-shrink: 0;
  height: 56px;
}

.bottom-nav .nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 10px;
  cursor: pointer;
  transition: color 0.15s;
  min-height: 44px;
  gap: 0;
}

.bottom-nav .nav-btn:active {
  background: #f8fafc;
}

.bottom-nav .nav-btn.active {
  color: #2563eb;
}

.bottom-nav .nav-btn .nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav .nav-btn .nav-label {
  font-size: 11px;
  line-height: 1.2;
}

/* ===== 6. 主内容区 ===== */
#main-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  min-height: 0;
  padding-bottom: 10px; /* 近期计划框底到导航栏顶部间距 */
}

/* ===== 7. 响应式布局 ===== */

/* 手机横屏 + 小平板 */
@media (min-width: 480px) and (max-width: 767px) {
  #main-content {
    padding: 16px;
  }
}

/* 平板 / 桌面 (>=768px) */
@media (min-width: 768px) {
  #app {
    flex-direction: row;
    flex-wrap: wrap;
  }

  #app-header {
    width: 100%;
  }

  .sidebar {
    display: flex;
    position: relative;
    top: 0;
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 16px;
  }

  .sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a5f;
    letter-spacing: 1px;
  }

  .bottom-nav {
    display: none !important;
  }

  #main-content {
    flex: 1;
    padding: 24px;
    padding-bottom: 24px;
    max-width: calc(100% - 240px);
  }
}

/* 窄屏手机 (<360px) */
@media (max-width: 359px) {
  #app-header {
    padding: 0 8px;
    height: 48px;
  }

  .header-title {
    font-size: 16px;
  }

  #main-content {
    padding: 10px;
    padding-bottom: 66px;
  }

  .bottom-nav {
    height: 50px;
  }

  .bottom-nav .nav-btn {
    font-size: 10px;
  }

  .bottom-nav .nav-btn .nav-icon {
    font-size: 18px;
  }

  .bottom-nav .nav-btn .nav-label {
    font-size: 10px;
  }
}

/* 横屏手机 (<768px) */
@media (max-width: 767px) and (orientation: landscape) {
  #app-header {
    height: 48px;
  }

  .bottom-nav {
    height: 48px;
  }

  .bottom-nav .nav-btn .nav-icon {
    font-size: 18px;
  }

  .bottom-nav .nav-btn .nav-label {
    font-size: 10px;
  }

  #main-content {
    padding-bottom: 64px;
  }
}

/* ===== 8. 通用组件 ===== */

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

.card-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:active {
  background: #1d4ed8;
}

.btn-success {
  background: #22c55e;
  color: #fff;
}

.btn-success:active {
  background: #16a34a;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:active {
  background: #dc2626;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid #2563eb;
  color: #2563eb;
}

.btn-outline:active {
  background: #eff6ff;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
}

.btn-ghost:active {
  background: #f1f5f9;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  min-height: 36px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* 按钮网格 */
.btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.btn-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

@media (max-width: 359px) {
  .btn-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .btn-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

/* 首页改版样式 */
.home-welcome {
  display: none;
}

/* 分区标题 */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  padding-left: 2px;
}

/* 快速入口网格 */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 420px) {
  .quick-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.quick-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid transparent;
}

.quick-card:active {
  transform: scale(0.96);
}

.quick-card-blue { border-left-color: #4a6cf7; }
.quick-card-purple { border-left-color: #a855f7; }
.quick-card-green { border-left-color: #22c55e; }
.quick-card-orange { border-left-color: #f97316; }
.quick-card-red { border-left-color: #ef4444; }

.quick-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.quick-label {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.quick-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* 首页卡片区块 */
.home-section {
  margin-bottom: 8px;
}

.home-section .card-title {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

/* 首页两个等高卡片 */
.home-section-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-section-wrap .card.home-section {
  flex: 1;
  margin-bottom: 0;
}
#recent-assessments,
#recent-plans {
  min-height: 60px;
}

/* 首页列表项（可点击行） */
.home-list-item {
  cursor: pointer;
  transition: background 0.15s;
}

.home-list-item:active {
  background: #f1f5f9;
}

/* 首页列表左侧头像 */
.list-item-left {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.assess-avatar { background: #f5f3ff; color: #a855f7; }
.goal-avatar { background: #eef1ff; color: #4a6cf7; }

/* 通用 badge 样式补全 */
.badge-outline {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  background: #fff;
}

/* 表单元素 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  min-height: 44px;
  font-family: inherit;
}

.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 过滤芯片 */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: #f1f5f9;
  color: #64748b;
  border: none;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.15s;
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background: #2563eb;
  color: #fff;
}

/* 标签页 */
.tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  font-size: 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  font-weight: 500;
  min-height: 40px;
  transition: all 0.15s;
}

.tab.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s;
  min-height: 56px;
}

.list-item:active {
  background: #f8fafc;
}

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

.list-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-right: 12px;
  flex-shrink: 0;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}

/* 徽章 */
.list-item-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: #eff6ff; color: #2563eb; }
.badge-green { background: #f0fdf4; color: #22c55e; }
.badge-orange { background: #fefce8; color: #f59e0b; }
.badge-red { background: #fef2f2; color: #ef4444; }
.badge-gray { background: #f8fafc; color: #94a3b8; }

/* 详情行 */
.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-label {
  width: 80px;
  flex-shrink: 0;
  color: #94a3b8;
  font-size: 14px;
}

.detail-value {
  flex: 1;
  font-size: 14px;
  color: #1e293b;
  word-break: break-all;
}

/* 统计卡片 - 改版 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  padding-top: 4px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.stat-icon-blue { background: #eef1ff; color: #4a6cf7; }
.stat-icon-purple { background: #f5f3ff; color: #a855f7; }
.stat-icon-green { background: #ecfdf5; color: #22c55e; }
.stat-icon-orange { background: #fff7ed; color: #f97316; }

.stat-info {}
.stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-value-blue { color: #4a6cf7; }
.stat-value-purple { color: #a855f7; }
.stat-value-green { color: #22c55e; }
.stat-value-orange { color: #f97316; }

.stat-label {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 1px;
}
  gap: 10px;
  margin-bottom: 16px;
}

/* 进度条 */
.progress-bar {
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.4s ease;
}

/* ===== 9. 加载状态 & 空状态 ===== */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: #94a3b8;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #94a3b8;
}

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

.empty-text {
  font-size: 15px;
  text-align: center;
}

/* ===== 10. Toast 通知 ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  max-width: 90%;
  text-align: center;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  pointer-events: none;
}

.toast-success { background: #22c55e; color: #fff; }
.toast-error { background: #ef4444; color: #fff; }
.toast-info { background: #2563eb; color: #fff; }
.toast-warning { background: #f59e0b; color: #fff; }

/* ===== 11. 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  z-index: 99998;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1e293b;
}

.modal-body {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
}

/* ===== 12. 评估专用样式 ===== */

/* 评分按钮 (大号圆形) */
.score-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.score-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 100px;
  min-height: 100px;
  padding: 16px 12px;
  border: 3px solid #e2e8f0;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
  text-align: center;
}

.score-btn:active {
  transform: scale(0.95);
}

.score-btn.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.score-letter {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1;
}

.score-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.3;
}

.score-btn.selected .score-letter {
  color: #2563eb;
}

/* P/E/F 三色评分 */
.score-btn[data-score="P"].selected {
  border-color: #22c55e;
  background: #f0fdf4;
}
.score-btn[data-score="P"].selected .score-letter { color: #22c55e; }

.score-btn[data-score="E"].selected {
  border-color: #f59e0b;
  background: #fefce8;
}
.score-btn[data-score="E"].selected .score-letter { color: #f59e0b; }

.score-btn[data-score="F"].selected {
  border-color: #ef4444;
  background: #fef2f2;
}
.score-btn[data-score="F"].selected .score-letter { color: #ef4444; }

/* 领域选择卡片 */
.domain-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 10px;
}

.domain-card:active {
  border-color: #2563eb;
  background: #f8faff;
}

.domain-card.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.domain-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.domain-card-desc {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 4px;
}

.domain-card-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 项目列表 */
.item-list {
  list-style: none;
}

.item-list li {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 10px;
  min-height: 48px;
}

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

.item-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.item-checkbox.checked {
  background: #2563eb;
  border-color: #2563eb;
}

.item-checkbox.checked::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

/* ===== 13. 目标树样式 ===== */
.tree-container {
  padding: 4px 0;
}

.tree-node {
  position: relative;
  padding: 12px 12px;
  margin: 4px 0;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid #2563eb;
  cursor: pointer;
  transition: background 0.12s;
}

.tree-node:active {
  background: #f1f5f9;
}

.tree-node.expandable {
  cursor: pointer;
}

.tree-node-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  font-size: 12px;
  color: #94a3b8;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.tree-node-toggle.expanded {
  transform: rotate(90deg);
}

.tree-node-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  display: flex;
  align-items: center;
}

.tree-node-meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.tree-node.selected {
  background: #eff6ff;
  border-left-color: #2563eb;
}

.tree-children {
  padding-left: 24px;
  overflow: hidden;
}

.tree-children.collapsed {
  display: none;
}

/* 层级缩进 */
.tree-node.level-1 { margin-left: 0; border-left-color: #2563eb; }
.tree-node.level-2 { margin-left: 20px; border-left-color: #60a5fa; }
.tree-node.level-3 { margin-left: 40px; border-left-color: #93c5fd; }
.tree-node.level-4 { margin-left: 60px; border-left-color: #bfdbfe; }
.tree-node.level-5 { margin-left: 80px; border-left-color: #dbeafe; }

/* ===== 14. 训练计划表格样式 ===== */

/* 月计划 (4 列: 周次/周一/周三/周五) */
.plan-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.plan-table th,
.plan-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.plan-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 13px;
  position: sticky;
  top: 0;
}

.plan-table tr:active {
  background: #f8fafc;
}

.plan-table.weekly th,
.plan-table.weekly td {
  text-align: center;
}

/* 周计划 (5 列: 时间/周一~周四) */
.plan-table-daily th,
.plan-table-daily td {
  text-align: center;
}

.plan-table-daily td:first-child {
  font-weight: 500;
  color: #475569;
  text-align: left;
}

/* 计划中的任务行 */
.plan-task {
  font-size: 13px;
  color: #1e293b;
  padding: 2px 0;
}

.plan-task .task-time {
  font-size: 12px;
  color: #94a3b8;
}

.plan-task .task-status {
  font-size: 11px;
}

/* ===== 15. 动画 ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 16. 辅助类 ===== */
.text-success { color: #22c55e; }
.text-danger { color: #ef4444; }
.text-warning { color: #f59e0b; }
.text-muted { color: #94a3b8; }
.text-primary { color: #2563eb; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.ml-8 { margin-left: 8px; }
.mr-8 { margin-right: 8px; }

.p-8 { padding: 8px; }
.p-16 { padding: 16px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.w-full { width: 100%; }
.hidden { display: none; }

/* 分割线 */
.divider {
  border: none;
  border-top: 1px solid #f1f5f9;
  margin: 16px 0;
}

/* 下拉指示器 */
.pull-indicator {
  text-align: center;
  padding: 16px;
  color: #94a3b8;
  font-size: 13px;
}

/* ===== 17. Action Sheet ===== */
.action-sheet {
  list-style: none;
}

.action-sheet li {
  padding: 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-sheet li:active {
  background: #f8fafc;
}

.action-sheet li.danger {
  color: #ef4444;
}

.action-sheet li:last-child {
  border-bottom: none;
}

/* 安全区域 */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* 评估页面内容区强制可滚动 - 仅手机端 */
/* ===== 移动端（<768px）通用 ===== */
@media (max-width: 767px) {
  .assess-scroll {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 240px);
    min-height: 60px;
  }
  
  /* 评估页面卡片，不限制最小高度，让内容自然滚动 */
  .page-assess .card {
    display: flex;
    flex-direction: column;
  }
  
  .page-assess .card #assess-list {
    flex: 1;
    overflow-y: auto;
  }
  
  /* 评估页面：顶部固定操作栏 (固定的，因为父容器 overflow:auto 不支持 sticky) */
  .assess-page .assess-top-bar {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 800;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
  }
  .assess-top-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
  }
  .assess-scroll-area {
    margin-top: 90px;
  }
  
  /* 底部固定操作栏 */
  .assess-bottom-bar {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 10px 16px;
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    z-index: 900;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
  }
  
  /* 内容区为底部操作栏留出空间 */
  .assess-bottom-bar-fill {
    height: 140px;
  }
}

/* ===== 首页顶部区域 ===== */
.home-top {
  background: linear-gradient(135deg, #4a6cf7 0%, #6c5ce7 100%);
  border-radius: 16px;
  margin: 0 0 16px 0;
  padding: 20px 16px 16px;
  color: #fff;
}

.home-top-company {
  font-size: 1.25em;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.home-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.home-top-logo {
  font-size: 28px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-top-date {
  font-size: 0.85em;
  opacity: 0.9;
  flex: 1;
}

.home-top-todo {
  font-size: 0.8em;
  background: rgba(255,255,255,0.2);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.todo-count {
  font-weight: 700;
  font-size: 1.1em;
}

.home-top-search {
  position: relative;
  margin-top: 4px;
}

.home-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px 10px 36px;
  border: none;
  border-radius: 24px;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.9em;
  outline: none;
  transition: background 0.2s;
}

.home-search-input::placeholder {
  color: rgba(255,255,255,0.7);
}

.home-search-input:focus {
  background: rgba(255,255,255,0.35);
}

/* DTT目标分解步骤样式 */
.dtt-steps {
  margin-top: 8px;
}
.dtt-step-collapse {
  border-bottom: 1px solid #f0f0f0;
}
.dtt-step-collapse:last-child {
  border-bottom: none;
}
.dtt-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
  user-select: none;
}
.dtt-step-header:active {
  background: #f9f9fb;
}
.dtt-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #4472C4;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dtt-focus {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
  color: #333;
}
.dtt-arrow {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}
.dtt-step-detail {
  padding: 4px 0 10px 30px;
}
.dtt-item {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.dtt-label {
  flex-shrink: 0;
  color: #666;
  min-width: 64px;
}
.dtt-val {
  color: #444;
}

.home-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.7;
}
