/* ============================================================================
   待执行 v2 · 样式（珊瑚橙品牌 hero + 四象限统计 + 任务卡 + 三类弹层）
   ----------------------------------------------------------------------------
   设计：扁平化纯色（无 gradient），珊瑚橙 var(--brand) 为主品牌色
        + 任务卡多态（pending/progress/done/overdue）+ 倒计时档位色阶
        + 学习/考试弹层（SVG ring 倒计时、单/多选题、答题详情）
   布局：移动端 .tasks-page 12/14px 内边距；hero 珊瑚橙；2x2/4 列象限网格；
         内容区底部由 .app-content 留白避开浮动 tabbar
   弹层：.sheet-mask 已由 core.css 定义；本文件补充 .sheet（底部上滑）
         + .sheet-btn 的 ghost/primary/disabled 变体（业务定制）
   ============================================================================ */

/* ==================== 1. 页面布局 ==================== */
.tasks-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 14px 0;        /* 移动端：顶部、左右留白；底部由 .app-content 留白避开 tabbar */
  width: 100%;
  box-sizing: border-box;
  animation: tasksFadeIn var(--dur-3) var(--ease-out) both;
}
@keyframes tasksFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (min-width: 768px) {
  .tasks-page { gap: 18px; padding: 0; }   /* 平板起由 .app-content 控制留白 */
}
@media (min-width: 1024px) {
  .tasks-page { gap: 20px; max-width: 1120px; margin: 0 auto; }
}

/* ==================== 2. 执行分 Hero ==================== */
/* es-hero-wrap 同时容纳 hero + 4 格统计，需纵向间距避免贴合 */
.es-hero-wrap {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.es-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--brand, #f97316);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 0 16px 36px -16px rgba(249, 115, 22, 0.5);
  position: relative;
  overflow: hidden;
  color: #fff;
}
/* 扁平化装饰：右上角静态色块（无 gradient） */
.es-hero::after {
  content: "";
  position: absolute;
  right: -36px; top: -36px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}
.es-hero-main {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  min-width: 0;
}
.es-hero-icon {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.es-hero-icon svg { width: 22px; height: 22px; }
.es-hero-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.es-hero-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.4px;
  line-height: 1;
}
.es-hero-sub {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.45;
  max-width: 160px;
}
.es-hero-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.es-hero-score {
  font-family: var(--font-num);
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}
.es-hero-bonus {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.es-hero-bonus-sub {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1;
}

/* ==================== 3. 四象限统计格 ==================== */
.es-cells {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 768px) {
  .es-cells { grid-template-columns: repeat(4, 1fr); }
}

.es-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md, 14px);
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.04));
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
/* 左侧细色条（4 态语义色） */
.es-cell::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: currentColor;
  opacity: 0.9;
}
.es-cell.neutral { color: var(--slate-400, #94a3b8); }
.es-cell.pos      { color: var(--success, #22c55e); }
.es-cell.flat     { color: var(--slate-500, #64748b); }
.es-cell.neg      { color: var(--danger, #ef4444); }

.es-ico {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
/* 浅色底块用伪元素，避免 opacity 影响内部 SVG 图标 */
.es-ico::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: currentColor;
  opacity: 0.14;
}
.es-ico svg { width: 16px; height: 16px; color: #0f172a; position: relative; z-index: 1; }
/* 图标色块用 currentColor 浅底，svg 描边用对应态的深色 */
.es-cell.neutral .es-ico svg { color: var(--slate-500, #64748b); }
.es-cell.pos      .es-ico svg { color: var(--success, #16a34a); }
.es-cell.flat     .es-ico svg { color: var(--slate-700, #334155); }
.es-cell.neg      .es-ico svg { color: var(--danger, #dc2626); }

.es-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.es-cell-val {
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  line-height: 1.1;
  letter-spacing: -0.3px;
}
.es-cell-pct {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}
.es-cell.neutral .es-cell-pct { color: var(--slate-400, #94a3b8); }
.es-cell.pos      .es-cell-pct { color: var(--success, #16a34a); }
.es-cell.flat     .es-cell-pct { color: var(--slate-500, #64748b); }
.es-cell.neg      .es-cell-pct { color: var(--danger, #dc2626); }
.es-cell-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-500, #64748b);
  letter-spacing: 0.2px;
  line-height: 1;
  margin-top: 1px;
}

/* ==================== 4. 子 Tab（进行中 / 已结束） ==================== */
.tasks-tabs {
  position: relative;
  display: flex;
  background: var(--slate-100, #f1f5f9);
  border-radius: var(--r-md, 14px);
  padding: 4px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}
.sub-tab {
  flex: 1;
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-500, #64748b);
  cursor: pointer;
  font-family: inherit;
  transition: color var(--dur-2) var(--ease-out);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sub-tab.active { color: var(--brand, #f97316); }
/* 计数角标：右上角绝对定位（通知徽章式），不挤占文字居中空间 */
.sub-tab .badge-count {
  position: absolute;
  top: 2px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--slate-400, #94a3b8);
  color: #fff;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 800;
  font-family: var(--font-num);
  letter-spacing: 0;
  z-index: 2;
  box-shadow: 0 0 0 1.5px var(--slate-100, #f1f5f9);
}
.sub-tab.active .badge-count {
  background: var(--brand, #f97316);
  box-shadow: 0 0 0 1.5px #fff;
}
.sub-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 11px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10);
  transform: translateX(0);
  transition: transform var(--dur-3) var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
  z-index: 0;
}
.sub-indicator.right { transform: translateX(100%); }

/* ==================== 5. 任务列表 ==================== */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 任务卡（白底 + 左色条 + 入场动画） */
.task-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--r-md, 14px);
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.04));
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: taskCardIn var(--dur-3) var(--ease-out) forwards;
}
@keyframes taskCardIn {
  to { opacity: 1; transform: translateY(0); }
}
/* 卡片左侧细色条（按状态语义色） */
.task-card::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--slate-300, #cbd5e1);
}
.task-card.done::before    { background: var(--slate-300, #cbd5e1); }
.task-card.overdue::before { background: var(--danger, #ef4444); }
.task-card.urgent::before  { background: var(--warning, #f59e0b); }
.task-card.manual-adj::before { background: var(--cat-4, #a855f7); }

.task-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px 8px;
  padding-left: 8px;
  margin-bottom: 8px;
}
/* 标题占可用空间，标签靠右同行排列（空间不足时换行） */
.task-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  line-height: 1.4;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
/* 标签行（标题之后的所有 .task-tag）作为一组收紧排列 */
.task-head .task-tag { flex-shrink: 0; }
.task-card.done .task-title {
  color: var(--slate-500, #64748b);
}
.task-card.overdue .task-title {
  color: var(--slate-900, #0f172a);
}

/* 标签/徽章基础 */
.task-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-600, #475569);
  border: 1px solid var(--slate-200, #e2e8f0);
}
.task-tag.tag-manual   { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.task-tag.tag-urgent   { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.task-tag.tag-form     { background: var(--brand-100, #ffedd5); color: var(--brand-600, #ea580c); border-color: #fed7aa; }
.task-tag.tag-study    { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.task-tag.tag-exam     { background: #fae8ff; color: #9333ea; border-color: #e9d5ff; }
.task-tag.tag-important{ background: #fef3c7; color: #b45309; border-color: #fcd34d; }

/* 执行分徽章（pos/neg/zero/exempt 四态） */
.task-tag.tag-earned {
  font-family: var(--font-num);
  font-weight: 800;
  letter-spacing: -0.2px;
}
.task-tag.tag-earned em {
  font-style: normal;
  font-weight: 700;
  opacity: 0.85;
  margin-left: 2px;
}
.task-tag.tag-earned.pos    { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.task-tag.tag-earned.neg    { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.task-tag.tag-earned.zero   { background: var(--slate-100, #f1f5f9); color: var(--slate-500, #64748b); border-color: var(--slate-200, #e2e8f0); }
.task-tag.tag-earned.exempt { background: #ccfbf1; color: #0d9488; border-color: #99f6e4; }

/* 任务元信息行 */
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding-left: 8px;
  font-size: 11.5px;
  color: var(--slate-500, #64748b);
  font-weight: 600;
  line-height: 1.5;
}
.task-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.task-meta-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--slate-400, #94a3b8); }

.task-desc {
  padding-left: 8px;
  font-size: 12px;
  color: var(--slate-600, #475569);
  line-height: 1.55;
  font-weight: 500;
  word-break: break-word;
  border-left: 2px dashed rgba(148, 163, 184, 0.35);
  padding-top: 2px;
  padding-bottom: 2px;
}
.task-form-preview {
  padding-left: 8px;
  font-size: 11px;
  color: var(--slate-500, #64748b);
  font-weight: 600;
}

/* 倒计时（4 档色阶：bonus30 / bonus15 / flat / penalty） */
.task-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm, 10px);
  font-family: var(--font-num);
  font-weight: 800;
  border: 1px solid transparent;
  align-self: stretch;
  flex-wrap: wrap;
}
.task-countdown svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}
.cd-time {
  font-size: 14px;
  letter-spacing: -0.3px;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}
.cd-label {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.9;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.task-countdown.tier-bonus30 { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.task-countdown.tier-bonus15 { background: var(--brand-100, #ffedd5); color: var(--brand-600, #ea580c); border-color: #fed7aa; }
.task-countdown.tier-flat    { background: var(--slate-100, #f1f5f9); color: var(--slate-600, #475569); border-color: var(--slate-200, #e2e8f0); }
.task-countdown.tier-penalty {
  background: #fee2e2; color: #dc2626; border-color: #fecaca;
  animation: cdPulse 1.4s ease-in-out infinite;
}
@keyframes cdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.30); }
  50%      { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

/* 逾期 / 失败横幅 */
.task-overdue-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
  padding: 8px 12px;
  border-radius: var(--r-sm, 10px);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  align-self: center;
}
.task-overdue-banner svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.task-overdue-banner span {
  white-space: nowrap;
}
.task-overdue-banner .penalty {
  font-style: normal;
  font-family: var(--font-num);
  color: #dc2626;
  font-weight: 800;
  margin-left: 2px;
}

/* 操作按钮（多态）
   按钮实际位于 .task-meta flex 行内，需右对齐避免与 meta 文字混排 */
.task-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 14px;
  border-radius: var(--r-sm, 10px);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--dur-1) var(--ease-snap),
              box-shadow var(--dur-2) var(--ease-out),
              background var(--dur-2) var(--ease-out);
  background: var(--brand, #f97316);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(249, 115, 22, 0.4);
}
/* 在 meta 行内右对齐，使已完成/已生效等状态按钮成为右侧状态徽章 */
.task-meta .task-action {
  margin-left: auto;
  align-self: center;
  flex-shrink: 0;
}
.task-action:active { transform: scale(0.96); }
.task-action.acknowledge {
  background: #fff;
  color: var(--slate-700, #334155);
  border-color: var(--slate-300, #cbd5e1);
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.04));
}
.task-action.done {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-500, #64748b);
  border-color: var(--slate-200, #e2e8f0);
  box-shadow: none;
  cursor: default;
}
.task-action.overdue {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fecaca;
  box-shadow: none;
  cursor: default;
}
.task-action.newbie-exempt {
  background: #ccfbf1;
  color: #0d9488;
  border-color: #99f6e4;
  box-shadow: none;
  cursor: default;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 20px;
  text-align: center;
}
.empty-state .empty-ico {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--slate-100, #f1f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-300, #cbd5e1);
}
.empty-state .empty-ico svg { width: 32px; height: 32px; }
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--slate-700, #334155);
}
.empty-state .empty-sub {
  font-size: 12.5px;
  color: var(--slate-400, #94a3b8);
  font-weight: 500;
  line-height: 1.6;
  max-width: 280px;
}

/* ==================== 6. 底部 Sheet 弹层 ==================== */
/* .sheet-mask 已由 core.css 提供（position:fixed 全屏 + 半透明背景 + .show 切换） */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: var(--r-xl, 28px) var(--r-xl, 28px) 0 0;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  box-sizing: border-box !important;  /* 强制 border-box，确保 max-height 含 padding，真机上全局 * 规则可能未生效 */
  transform: translateY(100%);
  transition: transform var(--dur-3) var(--ease-out);
  z-index: 9001;
  /* 移动端 100vh 含浏览器地址栏且不避灵动岛，弹层会超出顶部被遮挡。
     用 100svh（最小视口高度，地址栏展开时）保证不超出；
     再减 env(safe-area-inset-top) 避开灵动岛/刘海，最后留 20px 间距。
     多重 fallback：vh → svh → dvh → JS 动态 --app-height，最后声明的生效。 */
  max-height: calc(100vh - var(--safe-top, 0px) - 20px);
  max-height: calc(100svh - var(--safe-top, 0px) - 20px);
  max-height: calc(100dvh - var(--safe-top, 0px) - 20px);
  max-height: calc(var(--app-height, 100vh) - var(--safe-top, 0px) - 20px);
  display: flex;
  flex-direction: column;
  pointer-events: none;
  box-shadow: 0 -10px 30px -10px rgba(15, 23, 42, 0.2);
}
.sheet.show { transform: translateY(0); pointer-events: auto; }
.sheet::before {
  content: "";
  width: 40px; height: 4px;
  background: var(--slate-200, #e2e8f0);
  border-radius: 2px;
  margin: 0 auto 12px;
  flex-shrink: 0;
}
/* 桌面端：弹窗居中显示 */
@media (min-width: 768px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 460px;
    max-width: calc(100vw - 40px);
    border-radius: var(--r-xl, 28px);
    padding: 24px;
    transform: translate(-50%, -50%) scale(0.94);
    opacity: 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    max-height: 86vh;
    max-height: 86svh;
    max-height: 86dvh;
    max-height: calc(var(--app-height, 100vh) * 0.86);
  }
  .sheet::before { display: none; }
  .sheet.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.sheet-head {
  flex-shrink: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
  margin-bottom: 14px;
}
.sheet-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  text-align: center;
  line-height: 1.3;
}
.sheet-sub {
  font-size: 12px;
  color: var(--slate-500, #64748b);
  text-align: center;
  margin-top: 4px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-word;
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* 阻止滚动链穿透到背后的页面 */
  padding-right: 4px;
  margin-right: -4px;
}
.sheet-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid var(--slate-100, #f1f5f9);
}
.sheet-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--r-sm, 10px);
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--dur-1) var(--ease-snap),
              background var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              opacity var(--dur-2) var(--ease-out);
}
.sheet-btn:active { transform: scale(0.97); }
.sheet-btn.ghost {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-600, #475569);
}
.sheet-btn.ghost:hover { background: var(--slate-200, #e2e8f0); }
.sheet-btn.primary {
  background: var(--brand, #f97316);
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(249, 115, 22, 0.4);
}
.sheet-btn.primary:hover {
  background: var(--brand-600, #ea580c);
  box-shadow: 0 6px 16px -4px rgba(249, 115, 22, 0.5);
}
.sheet-btn.primary.disabled,
.sheet-btn.primary:disabled {
  background: var(--slate-200, #e2e8f0) !important;
  color: var(--slate-400, #94a3b8) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

/* ==================== 7. 执行表单弹层（te- 前缀） ==================== */
.te-desc {
  font-size: 12.5px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--slate-50, #f8fafc);
  border-radius: var(--r-sm, 10px);
  margin-bottom: 14px;
  font-weight: 500;
  word-break: break-word;
}
.te-field { margin-bottom: 14px; }
.te-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700, #334155);
  margin-bottom: 6px;
  line-height: 1.4;
}
.te-field-label .req { color: var(--danger, #ef4444); margin-left: 2px; }

/* 文案块（含复制 FAB） */
.te-text-block {
  position: relative;
  padding: 10px 12px;
  padding-right: 56px;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--r-sm, 10px);
  font-size: 13px;
  color: var(--slate-800, #1e293b);
  line-height: 1.55;
  font-weight: 500;
  word-break: break-word;
  white-space: pre-wrap;
}
.te-text-block.no-copy { padding-right: 12px; }
.te-copy-fab {
  position: absolute;
  top: 50%; right: 8px;
  transform: translateY(-50%);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--brand, #f97316);
  background: var(--brand-100, #ffedd5);
  color: var(--brand-600, #ea580c);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--dur-1) var(--ease-snap);
}
.te-copy-fab:active { transform: translateY(-50%) scale(0.92); }

/* 图片展示（含下载 FAB） */
.te-image-wrap {
  position: relative;
  border-radius: var(--r-sm, 10px);
  overflow: hidden;
  background: var(--slate-100, #f1f5f9);
  border: 1px solid var(--slate-200, #e2e8f0);
}
.te-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #fff;
}
.te-save-fab {
  position: absolute;
  bottom: 8px; right: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.te-save-fab:active { transform: scale(0.94); }

/* 输入框 */
.te-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-sm, 10px);
  border: 1.5px solid var(--slate-200, #e2e8f0);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--slate-900, #0f172a);
  box-sizing: border-box;
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
.te-input::placeholder { color: var(--slate-400, #94a3b8); font-weight: 500; }
.te-input:focus {
  outline: none;
  border-color: var(--brand, #f97316);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

/* 上传区域 */
.te-upload-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  border: 1.5px dashed var(--slate-300, #cbd5e1);
  border-radius: var(--r-sm, 10px);
  background: var(--slate-50, #f8fafc);
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.te-upload-area:hover {
  border-color: var(--brand, #f97316);
  background: var(--brand-100, #ffedd5);
}
.te-upload-area img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.te-upload-tip {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--slate-500, #64748b);
  position: relative;
  z-index: 1;
  text-align: center;
  pointer-events: none;
}
.te-upload-tip.overlay {
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* 上传进度条（压缩中不确定流光 → 上传中实时%） */
.upload-progress {
  position: relative;
  width: 100%;
  height: 96px;
  border-radius: var(--r-sm, 10px);
  background: var(--slate-50, #f8fafc);
  border: 1.5px solid var(--slate-200, #e2e8f0);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-progress-bar {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--brand-100, #ffedd5);
  transition: width 0.3s var(--ease-out);
}
.upload-progress.indeterminate .upload-progress-bar {
  width: 100% !important;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--brand-100, #ffedd5) 40%,
    var(--brand-400, #fb923c) 50%,
    var(--brand-100, #ffedd5) 60%,
    transparent 100%);
  background-size: 200% 100%;
  animation: uploadShine 1.4s linear infinite;
  opacity: 0.6;
}
@keyframes uploadShine {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.upload-progress-text {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--slate-700, #334155);
  font-family: var(--font-num);
  letter-spacing: -0.2px;
}
.upload-progress-text .mini-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--slate-200, #e2e8f0);
  border-top-color: var(--brand, #f97316);
  border-radius: 50%;
  animation: miniSpin 0.7s linear infinite;
}
@keyframes miniSpin { to { transform: rotate(360deg); } }

.te-no-form {
  padding: 18px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--slate-500, #64748b);
  background: var(--slate-50, #f8fafc);
  border-radius: var(--r-sm, 10px);
  font-weight: 500;
}

/* ==================== 8. 学习弹层（ss- 前缀） ==================== */
.ss-desc {
  font-size: 12.5px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--slate-50, #f8fafc);
  border-radius: var(--r-sm, 10px);
  margin-bottom: 14px;
  font-weight: 500;
}
.ss-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.ss-point {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--r-md, 14px);
  box-shadow: var(--elev-1, 0 1px 2px rgba(15, 23, 42, 0.04));
}
.ss-point-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ss-point-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand, #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-num);
  flex-shrink: 0;
}
.ss-point-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  line-height: 1.4;
}
.ss-point-content {
  font-size: 12.5px;
  color: var(--slate-600, #475569);
  line-height: 1.65;
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
}

/* SVG ring 倒计时 */
.ss-timer {
  display: flex;
  flex-direction: row;          /* 横向：圆环 + 文案，节省垂直空间 */
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--slate-50, #f8fafc);
  border-radius: var(--r-md, 14px);
  margin-bottom: 14px;
}
.ss-timer-ring {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
}
.ss-timer-ring svg {
  width: 44px; height: 44px;
  transform: rotate(-90deg);
}
.ss-timer-bg {
  fill: none;
  stroke: var(--slate-200, #e2e8f0);
  stroke-width: 4;
}
.ss-timer-fg {
  fill: none;
  stroke: var(--brand, #f97316);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 132;        /* 2πr, r=21 ≈ 131.95 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}
.ss-timer-fg.warn { stroke: var(--warning, #f59e0b); }
.ss-timer-fg.urgent { stroke: var(--danger, #ef4444); }
.ss-timer-num {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  letter-spacing: -0.5px;
  line-height: 1;
}
.ss-timer-tip {
  font-size: 12px;
  color: var(--slate-500, #64748b);
  text-align: left;
  font-weight: 600;
  line-height: 1.5;
  flex: 1;
}

/* ==================== 9. 考试弹层（ex- 前缀） ==================== */
.ex-desc {
  font-size: 12.5px;
  color: var(--slate-600, #475569);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--slate-50, #f8fafc);
  border-radius: var(--r-sm, 10px);
  margin-bottom: 12px;
  font-weight: 500;
}
.ex-study-hint {
  font-size: 12px;
  color: var(--brand-600, #ea580c);
  background: var(--brand-100, #ffedd5);
  padding: 8px 12px;
  border-radius: var(--r-sm, 10px);
  margin-bottom: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.ex-questions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ex-question {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: var(--r-md, 14px);
}
.ex-q-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.ex-q-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand, #f97316);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.ex-q-type {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--slate-500, #64748b);
  background: var(--slate-100, #f1f5f9);
  padding: 2px 6px;
  border-radius: 6px;
}
.ex-q-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  line-height: 1.5;
  margin-bottom: 10px;
  word-break: break-word;
}
.ex-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ex-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--slate-50, #f8fafc);
  border: 1.5px solid var(--slate-200, #e2e8f0);
  border-radius: var(--r-sm, 10px);
  cursor: pointer;
  transition: background var(--dur-2), border-color var(--dur-2);
}
.ex-opt:hover {
  background: var(--brand-100, #ffedd5);
  border-color: var(--brand-400, #fb923c);
}
.ex-opt.selected {
  background: var(--brand-100, #ffedd5);
  border-color: var(--brand, #f97316);
}
.ex-opt-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--slate-300, #cbd5e1);
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--dur-2), background var(--dur-2);
}
.ex-opt.selected .ex-opt-check {
  border-color: var(--brand, #f97316);
  background: var(--brand, #f97316);
}
.ex-opt.selected .ex-opt-check::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: 0; border-left: 0;
  transform: translate(-55%, -65%) rotate(45deg);
}
.ex-opt-text {
  font-size: 13px;
  color: var(--slate-800, #1e293b);
  line-height: 1.5;
  font-weight: 500;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

/* 考试结果 */
.ex-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--r-md, 14px);
  margin-bottom: 14px;
  text-align: center;
}
.ex-result.pass {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}
.ex-result.fail {
  background: #fee2e2;
  border: 1px solid #fecaca;
}
.ex-result-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.ex-result.pass .ex-result-icon { background: var(--success, #22c55e); }
.ex-result.fail .ex-result-icon { background: var(--danger, #ef4444); }
.ex-result-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900, #0f172a);
  line-height: 1.3;
}
.ex-result-score {
  font-size: 13px;
  color: var(--slate-600, #475569);
  font-weight: 600;
}
.ex-result-score b {
  font-family: var(--font-num);
  font-size: 18px;
  color: var(--slate-900, #0f172a);
  font-weight: 800;
}
.ex-result-pts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-num);
}
.ex-result-pts.pos { background: #dcfce7; color: #15803d; }
.ex-result-pts.neg { background: #fee2e2; color: #dc2626; }
.ex-result-pts:not(.pos):not(.neg) {
  background: var(--slate-100, #f1f5f9);
  color: var(--slate-600, #475569);
}

/* 答题详情 */
.ex-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ex-review-q {
  padding: 12px 14px;
  border-radius: var(--r-md, 14px);
  border: 1px solid var(--slate-200, #e2e8f0);
  background: #fff;
}
.ex-review-q.ok { border-left: 3px solid var(--success, #22c55e); }
.ex-review-q.wrong { border-left: 3px solid var(--danger, #ef4444); }
.ex-review-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.ex-review-no {
  font-size: 11px;
  font-weight: 800;
  color: var(--slate-500, #64748b);
}
.ex-review-flag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}
.ex-review-q.ok .ex-review-flag { background: #dcfce7; color: #15803d; }
.ex-review-q.wrong .ex-review-flag { background: #fee2e2; color: #dc2626; }
.ex-review-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-900, #0f172a);
  line-height: 1.5;
  margin-bottom: 8px;
  word-break: break-word;
}
.ex-review-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-sm, 10px);
  background: var(--slate-50, #f8fafc);
  margin-bottom: 4px;
  font-size: 12.5px;
  color: var(--slate-700, #334155);
  line-height: 1.5;
  word-break: break-word;
}
.ex-review-opt:last-child { margin-bottom: 0; }
.ex-review-mark {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  background: var(--slate-200, #e2e8f0);
  color: var(--slate-500, #64748b);
}
.ex-review-opt.correct { background: #dcfce7; color: #15803d; }
.ex-review-opt.correct .ex-review-mark { background: var(--success, #22c55e); color: #fff; }
.ex-review-opt.user-wrong { background: #fee2e2; color: #dc2626; }
.ex-review-opt.user-wrong .ex-review-mark { background: var(--danger, #ef4444); color: #fff; }
.ex-review-opt.picked { font-weight: 700; }
.ex-review-text { flex: 1; min-width: 0; }

/* ==================== 10. 响应式适配 ==================== */
@media (max-width: 480px) {
  /* 中小屏：hero 收紧，避免右侧分数与左侧文本挤压 */
  .es-hero { padding: 14px 16px; gap: 10px; }
  .es-hero-icon { width: 36px; height: 36px; }
  .es-hero-icon svg { width: 18px; height: 18px; }
  .es-hero-label { font-size: 11px; }
  .es-hero-sub { font-size: 10.5px; max-width: 120px; line-height: 1.4; }
  .es-hero-score { font-size: 32px; }
  .es-hero-bonus { font-size: 10px; padding: 2px 6px; }
  .es-hero-bonus-sub { font-size: 9px; }
  /* 标签更紧凑，避免已结束列表内胶囊挤压 */
  .task-tag { padding: 2px 7px; font-size: 10.5px; }
  .task-action { padding: 6px 12px; font-size: 11.5px; }
}

@media (max-width: 389px) {
  /* 小屏：hero 缩小、统计格改竖排紧凑 */
  .es-hero { padding: 14px 16px; }
  .es-hero-icon { width: 36px; height: 36px; }
  .es-hero-icon svg { width: 18px; height: 18px; }
  .es-hero-label { font-size: 11px; }
  .es-hero-sub { font-size: 10.5px; max-width: 160px; }
  .es-hero-score { font-size: 32px; }
  .es-cells { gap: 6px; }
  .es-cell { padding: 10px; gap: 8px; }
  .es-ico { width: 26px; height: 26px; }
  .es-ico svg { width: 14px; height: 14px; }
  .es-cell-val { font-size: 14px; }
  .es-cell-pct, .es-cell-label { font-size: 10px; }
  .task-card { padding: 12px 12px 10px; }
  .task-title { font-size: 14px; }
  .task-meta { font-size: 11px; gap: 6px 10px; }
  .sheet { padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 14px); }
  .sheet-title { font-size: 15px; }
}

@media (min-width: 1024px) {
  /* 桌面：hero 装饰更突出 */
  .es-hero { padding: 22px 26px; }
  .es-hero-icon { width: 48px; height: 48px; border-radius: 16px; }
  .es-hero-icon svg { width: 26px; height: 26px; }
  .es-hero-label { font-size: 13px; }
  .es-hero-sub { font-size: 12px; max-width: 280px; }
  .es-hero-score { font-size: 48px; }
  .es-cells { gap: 12px; }
  .es-cell { padding: 14px; }
  .es-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-3, 0 4px 8px rgba(15, 23, 42, 0.08));
  }
  .task-card { padding: 16px 16px 14px; }
  .task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--elev-3, 0 4px 8px rgba(15, 23, 42, 0.08));
  }
  .task-title { font-size: 16px; }
}
