/* =========================================================
   有序 StepFlow · 设计系统
   浅色 / 深色双主题 · Web / 移动双端响应式
   ========================================================= */

/* ---------- 设计 Token ---------- */
:root {
  /* 主色 */
  --brand-500: #4F46E5;
  --brand-400: #8B5CF6;
  --brand-100: #EEF2FF;
  --brand-50:  #F5F3FF;
  --gradient-brand: linear-gradient(135deg, #4F46E5 0%, #8B5CF6 100%);

  /* 强调色 */
  --success: #10B981;
  --success-bg: #ECFDF5;
  --success-bg-deep: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --danger:  #EF4444;
  --danger-bg: #FEF2F2;
  --info:    #3B82F6;

  /* 浅色主题 */
  --bg: #F7F8FC;
  --surface: #FFFFFF;
  --surface-2: #F4F5F9;
  --surface-hover: #F1F2F7;
  --text-1: #18191C;
  --text-2: #4E5060;
  --text-3: #71717A;
  --text-4: #9CA3AF;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --overlay: rgba(15, 17, 27, .55);

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(16, 18, 27, .06);
  --shadow-md: 0 6px 20px rgba(16, 18, 27, .08);
  --shadow-lg: 0 16px 40px rgba(16, 18, 27, .10);
  --shadow-brand: 0 8px 24px rgba(79, 70, 229, .30);

  /* 圆角 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* 间距 / 尺寸 */
  --sidebar-w: 220px;
  --tabbar-h: 64px;
  --topbar-h: 56px;
  --maxw: 1280px;

  /* 字体 */
  --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* 动效 */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --t-fast: 150ms;
  --t-mid: 250ms;
}

[data-theme="dark"] {
  --bg: #101219;
  --surface: #181B24;
  --surface-2: #1F2330;
  --surface-hover: #262B3A;
  --text-1: #F2F3F8;
  --text-2: #A6ACC0;
  --text-3: #6B7280;
  --text-4: #4B5563;
  --border: #2A2F3D;
  --border-strong: #353B4A;
  --brand-100: #2A2654;
  --brand-50: #221F44;
  --success-bg: #0E2A22;
  --success-bg-deep: #134838;
  --warning-bg: #2A210A;
  --danger-bg: #2A0F0F;
  --overlay: rgba(0, 0, 0, .65);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .30);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .40);
  --shadow-brand: 0 8px 24px rgba(139, 147, 248, .30);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 14px; line-height: 1.5;
  color: var(--text-1); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
  overflow-x: hidden;
}
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; outline: none; }
input, textarea { font: inherit; color: inherit; border: none; outline: none; background: transparent; }
a { color: var(--brand-500); text-decoration: none; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 22px;
  border-radius: var(--r-pill); font-weight: 700; font-size: 14px;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--gradient-brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary.btn-shadow { box-shadow: var(--shadow-brand); }
.btn-secondary { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 6px 20px rgba(16, 185, 129, .25); }
.btn-success:hover { filter: brightness(1.05); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-1); }
.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 32px; font-size: 16px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-1); }
.icon-btn:active { transform: scale(.92); }

.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: inline-block; }

/* ---------- 表单 ---------- */
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 14px 0 6px; }
.form-input {
  width: 100%; height: 44px; padding: 0 14px;
  background: var(--surface); color: var(--text-1);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 14px; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.form-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 44px; }
.form-input-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.form-input-action:hover { color: var(--text-1); background: var(--surface-hover); }


/* =========================================================
   登录页
   ========================================================= */
.login-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px;
}
.login-form {
  width: 100%; max-width: 340px;
  background: var(--surface);
  padding: 22px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; gap: 14px;
}
.login-form::before {
  content: '请输入密码';
  display: block;
  font-size: 14px; font-weight: 600;
  color: var(--text-1);
  text-align: center; letter-spacing: .02em;
}
.login-error {
  margin-top: 2px;
  color: var(--danger); font-size: 13px; font-weight: 600;
  text-align: center; background: var(--danger-bg);
  padding: 9px 12px; border-radius: 12px;
}

/* =========================================================
   Web 端应用布局
   ========================================================= */
#app {
  display: grid; grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh; min-height: 100dvh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  text-align: left;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-1); }
.nav-item.active { background: var(--brand-100); color: var(--brand-500); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }

.content {
  flex: 1; padding: 32px 40px 60px;
  max-width: var(--maxw); width: 100%;
}
@media (min-width: 1024px) {
  #app { height: 100vh; height: 100dvh; min-height: 0; }
  .main { min-height: 0; overflow-y: auto; }
  .content { padding: 32px 40px 80px; }
}
@media (max-width: 1023px) { .content { padding: 0 0 calc(var(--tabbar-h) + 96px); } }

.page { animation: fadeIn .25s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 页面头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.page-head .head-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 执行台：Hero 横幅 ---------- */
.hero-banner {
  position: relative;
  background: var(--gradient-brand); color: #fff;
  border-radius: var(--r-xl); padding: 24px 28px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center;
  box-shadow: var(--shadow-brand); margin-bottom: 28px;
}
.hero-icon {
  width: 56px; height: 56px; border-radius: var(--r-md);
  background: rgba(255,255,255,.18); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.hero-icon svg { width: 26px; height: 26px; }
.hero-info { min-width: 0; }
.hero-title { font-size: 22px; font-weight: 700; line-height: 1.3; }
.hero-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; opacity: .9; margin-top: 6px; }
.hero-meta .chip { padding: 2px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.18); }
.hero-progress { margin-top: 12px; height: 6px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.hero-progress-fill { height: 100%; background: #fff; border-radius: 999px; transition: width .4s var(--ease); }
.hero-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12px; opacity: .9; }
.hero-actions .btn-secondary { background: #fff; color: var(--brand-500); border: none; font-weight: 700; }
.hero-del { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.65); background: transparent; border: none; cursor: pointer; transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.hero-del:hover { color: #fff; background: rgba(255,255,255,.16); }

/* ---------- 任务卡（Web 端） ---------- */
.section { margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.section-link { color: var(--brand-500); font-size: 13px; font-weight: 500; cursor: pointer; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--surface); border-radius: var(--r-md); padding: 16px 20px;
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  cursor: pointer;
}
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.task-card-icon {
  width: 48px; height: 48px; border-radius: var(--r-sm);
  background: var(--brand-100); color: var(--brand-500);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.task-card-icon.green { background: var(--success-bg); color: var(--success); }
.task-card-body { min-width: 0; }
.task-card-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.task-card-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.task-card-progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.task-card-progress-fill { height: 100%; background: var(--gradient-brand); border-radius: 999px; transition: width .4s var(--ease); }
.task-card-progress-fill.green { background: var(--success); }
.task-card-side { text-align: right; display: flex; align-items: center; gap: 12px; }
.task-card-count { font-size: 14px; font-weight: 700; color: var(--text-1); }
.task-card-time { font-size: 12px; color: var(--text-3); }
.task-card-archive, .task-card-action {
  color: var(--text-3); font-size: 12px; padding: 4px 10px; border-radius: 6px;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.task-card-archive:hover, .task-card-action:hover { color: var(--text-1); background: var(--surface-hover); }
.task-card-del { color: var(--text-3); }
.task-card-del:hover { color: #e5484d; }
.task-card-side .task-card-actions { display: flex; gap: 4px; }

/* ---------- 模板库（Web 端） ---------- */
.tpl-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px; max-width: 320px; height: 40px; padding: 0 14px 0 40px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  font-size: 13px; transition: border-color var(--t-fast) var(--ease);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat; background-position: 14px center;
}
.search-input:focus { border-color: var(--brand-500); }
.tpl-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.tag:hover { color: var(--text-1); border-color: var(--border-strong); }
.tag.active { background: var(--brand-100); color: var(--brand-500); border-color: var(--brand-100); font-weight: 600; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tpl-card {
  background: var(--surface); border-radius: var(--r-md); padding: 20px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid transparent;
}
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border); }
.tpl-card-head { display: flex; align-items: center; gap: 10px; }
.tpl-card-icon {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--brand-100); color: var(--brand-500);
  display: flex; align-items: center; justify-content: center;
}
.tpl-card-icon svg { width: 22px; height: 22px; }
.tpl-card-cat { font-size: 12px; font-weight: 600; color: var(--brand-500); padding: 3px 10px; border-radius: var(--r-pill); background: var(--brand-100); }
.tpl-card-name { font-size: 15px; font-weight: 700; color: var(--text-1); }
.tpl-card-desc { font-size: 12px; color: var(--text-3); line-height: 1.5; min-height: 36px; }
.tpl-card-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 4px; flex-wrap: wrap; }
.tpl-card-meta strong { color: var(--text-1); font-weight: 600; }
.tpl-card-actions { display: flex; gap: 6px; margin-top: 4px; }
@media (hover: hover) {
  .tpl-card-actions { opacity: 0; transition: opacity var(--t-fast) var(--ease); }
  .tpl-card:hover .tpl-card-actions { opacity: 1; }
}
.tpl-card-blank {
  border: 2px dashed var(--border); background: transparent; box-shadow: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--text-3); min-height: 180px;
}
.tpl-card-blank:hover { border-color: var(--brand-500); color: var(--brand-500); }
.tpl-card-blank .plus {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; color: var(--text-2);
}
.tpl-card-blank:hover .plus { background: var(--brand-100); color: var(--brand-500); }
.tpl-card-blank h4 { font-size: 14px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.tpl-card-blank p { font-size: 12px; }

/* ---------- 任务执行页（Web 端：左右分栏） ---------- */
.run-shell { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.run-head { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.run-head-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.run-back {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.run-back:hover { color: var(--text-1); }
.run-title { font-size: 18px; font-weight: 700; }
.run-head-right { display: flex; align-items: center; gap: 12px; }
.run-progress-pill { padding: 4px 12px; border-radius: var(--r-pill); background: var(--brand-100); color: var(--brand-500); font-size: 12px; font-weight: 600; }
.run-progress-bar { width: 200px; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.run-progress-bar-fill { height: 100%; background: var(--gradient-brand); border-radius: 999px; transition: width .4s var(--ease); }

.step-nav {
  background: var(--surface); border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky; top: 24px; max-height: calc(100vh - 80px); overflow-y: auto;
}
.step-nav-title { font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.step-nav-list { display: flex; flex-direction: column; gap: 6px; }
.step-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t-fast) var(--ease);
  font-size: 13px; color: var(--text-1);
}
.step-nav-item:hover { background: var(--surface-hover); }
.step-nav-item.active { background: var(--brand-100); color: var(--brand-500); font-weight: 600; }
.step-nav-item.checked .sn-text { text-decoration: line-through; color: var(--text-3); }
.step-nav-item.skipped .sn-text { color: var(--text-3); text-decoration: line-through; opacity: .7; }
.sn-check {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; transition: all var(--t-fast) var(--ease);
}
.step-nav-item.checked .sn-check { background: var(--success); border-color: var(--success); }
.step-nav-item.checked .sn-check::after { content: '✓'; font-size: 11px; font-weight: 700; }
.step-nav-item.skipped .sn-check { border-style: dashed; border-color: var(--text-3); }
.step-nav-item.active .sn-check { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.sn-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-meta { font-size: 11px; color: var(--text-3); }

.step-detail {
  background: var(--surface); border-radius: var(--r-lg); padding: 48px 40px;
  box-shadow: var(--shadow-sm); min-height: 480px;
  display: flex; flex-direction: column;
}
.step-detail-head { text-align: center; margin-bottom: 32px; }
.step-detail-label { font-size: 13px; font-weight: 600; color: var(--brand-500); letter-spacing: .04em; margin-bottom: 12px; }
.step-detail-text { font-size: 32px; font-weight: 700; line-height: 1.4; color: var(--text-1); letter-spacing: -.01em; }
.step-detail.checked .step-detail-text { color: var(--text-3); text-decoration: line-through; }
.step-detail.skipped .step-detail-text { color: var(--text-3); text-decoration: line-through; opacity: .7; }
.step-note {
  background: var(--surface-2); border-radius: var(--r-sm); padding: 14px 16px;
  font-size: 12px; color: var(--text-2); margin: 24px auto 32px; max-width: 520px; width: 100%;
}
.step-note-label { font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.step-actions-row { display: flex; gap: 12px; margin-top: auto; max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }
.step-actions-row .btn { flex: 1; }

/* 移动端：单列勾选列表 */
.check-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 100px; }
.check-item {
  background: var(--surface); border-radius: var(--r-md); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.check-item:hover { background: var(--surface-hover); }
.check-item.checked { opacity: .65; }
.check-item.checked .check-text { text-decoration: line-through; color: var(--text-3); }
.check-item.skipped { opacity: .55; }
.check-item.skipped .check-text { text-decoration: line-through; color: var(--text-3); }
.check-item.active { border: 1.5px solid var(--brand-500); }
.check-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--border-strong); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  transition: all var(--t-fast) var(--ease);
}
.check-item.checked .check-circle { background: var(--success); border-color: var(--success); }
.check-item.skipped .check-circle { border-style: dashed; border-color: var(--text-3); color: var(--text-3); }
.check-item.active .check-circle { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); }
.check-text { flex: 1; font-size: 15px; font-weight: 600; color: var(--text-1); }
.check-meta { font-size: 11px; color: var(--brand-500); font-weight: 600; }
.check-done-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 16px 0; padding: 10px; font-size: 13px; font-weight: 600;
  color: var(--text-3); background: var(--surface); border-radius: var(--r-md);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.check-done-toggle:hover { color: var(--text-1); background: var(--surface-hover); }
.check-done-toggle .cd-chevron { transition: transform var(--t-fast) var(--ease); }
.check-done-toggle .cd-chevron.open { transform: rotate(180deg); }
.check-done-toggle + .check-list { padding-top: 8px; }

/* 移动端底部操作栏（任务执行） */
.mobile-run-foot {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 12px);
  padding: 0 16px; display: flex; gap: 8px; align-items: center; z-index: 15;
  max-width: 480px; margin: 0 auto;
}
.mobile-run-foot .btn { flex: 1; }
.mobile-run-foot .btn-abandon { flex: 0; background: transparent; color: var(--danger); font-size: 12px; padding: 0 12px; height: 44px; }

/* ---------- 模板编辑页 ---------- */
.editor-shell { max-width: 760px; margin: 0 auto; }
.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.editor-head h2 { font-size: 22px; font-weight: 700; }
.editor-card { background: var(--surface); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.editor-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 14px 0 8px; }
.editor-label:first-child { margin-top: 0; }
.editor-title-input {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1.5px solid var(--brand-500); border-radius: var(--r-sm);
  font-size: 16px; font-weight: 600; background: var(--surface); color: var(--text-1);
}
.editor-desc-input {
  width: 100%; min-height: 44px; padding: 12px 16px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 14px; background: var(--surface); color: var(--text-1);
  transition: border-color var(--t-fast) var(--ease);
}
.editor-desc-input:focus { border-color: var(--brand-500); }
.editor-meta { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.editor-meta-left { font-size: 13px; color: var(--text-2); }
.editor-meta-left strong { color: var(--text-1); font-weight: 700; }
.editor-meta-right { font-size: 12px; color: var(--text-3); }
.step-list { }
.step-row {
  display: grid; grid-template-columns: 28px 32px 1fr 36px; gap: 10px; align-items: center;
  padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); margin-bottom: 8px;
  transition: background var(--t-fast) var(--ease);
}
.step-row:hover { background: var(--surface-hover); }
.step-row.dragging { opacity: .4; }
.step-row.drag-over-top { border-top: 2px solid var(--brand-500); }
.step-row.drag-over-bottom { border-bottom: 2px solid var(--brand-500); }
.step-handle { color: var(--text-3); cursor: grab; display: flex; align-items: center; justify-content: center; }
.step-handle:active { cursor: grabbing; }
.step-num {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--brand-100); color: var(--brand-500);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.step-text-input {
  width: 100%; height: 36px; padding: 0 12px;
  background: transparent; font-size: 14px; color: var(--text-1); border: 1px solid transparent; border-radius: 6px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.step-text-input:hover { background: var(--surface); }
.step-text-input:focus { background: var(--surface); border-color: var(--brand-500); }
.step-del { color: var(--text-3); width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.step-del:hover { color: var(--danger); background: var(--danger-bg); }
.btn-add-step {
  width: 100%; height: 48px; border-radius: var(--r-sm);
  background: transparent; border: 1.5px dashed var(--border-strong);
  color: var(--brand-500); font-weight: 600; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 10px; transition: all var(--t-fast) var(--ease);
}
.btn-add-step:hover { border-color: var(--brand-500); background: var(--brand-50); }
.editor-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.save-hint { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.save-hint::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.save-hint.dirty::before { background: var(--warning); }
.save-hint.dirty { color: var(--warning); }

/* ---------- 沉浸模式（共用） ---------- */
.immersive {
  position: fixed; inset: 0; z-index: 90;
  background: var(--gradient-brand);
  color: #fff; display: flex; flex-direction: column;
  animation: immersiveIn .35s var(--ease);
}
@keyframes immersiveIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.immersive-decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.immersive-decor::before { content: ''; position: absolute; top: -100px; left: -100px; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.06); }
.immersive-decor::after { content: ''; position: absolute; bottom: -100px; right: -100px; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.05); }
.immersive-head { flex-shrink: 0; display: flex; align-items: center; gap: 16px; padding: 18px 24px; }
.immersive-close {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.immersive-progress-text { font-size: 14px; font-weight: 600; }
.immersive-progress-bar { flex: 1; height: 4px; background: rgba(255,255,255,.2); border-radius: 999px; overflow: hidden; }
.immersive-progress-fill { height: 100%; background: #fff; border-radius: 999px; transition: width .4s var(--ease); }
.immersive-body { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; padding: 32px 80px; }
.immersive-step { text-align: center; max-width: 720px; animation: stepFadeIn .35s var(--ease); }
@keyframes stepFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.immersive-step-label { font-size: 14px; opacity: .9; margin-bottom: 18px; }
.immersive-step-text { font-size: 40px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.immersive-step.done .immersive-step-text { text-decoration: line-through; opacity: .7; }
.immersive-step.skipped .immersive-step-text { text-decoration: line-through; opacity: .5; }
.immersive-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.immersive-nav:hover { background: rgba(255,255,255,.28); }
.immersive-nav:active { transform: translateY(-50%) scale(.9); }
.immersive-nav.disabled { opacity: .25; pointer-events: none; }
.immersive-nav-left { left: 24px; }
.immersive-nav-right { right: 24px; }
.immersive-foot { flex-shrink: 0; padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.immersive-complete {
  min-width: 280px; padding: 16px 36px; border-radius: var(--r-pill);
  background: #fff; color: var(--brand-500); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  transition: transform var(--t-fast) var(--ease);
}
.immersive-complete:active { transform: scale(.96); }
.immersive-complete.is-done { background: var(--success); color: #fff; }
.immersive-complete.all-done { background: rgba(255,255,255,.2); color: #fff; }
.immersive-skip { color: rgba(255,255,255,.85); font-size: 14px; padding: 8px 16px; border-radius: var(--r-pill); }
.immersive-skip:hover { color: #fff; }
.immersive-hint { display: flex; gap: 18px; font-size: 12px; opacity: .65; }
.immersive-hint span { display: flex; align-items: center; gap: 4px; }

/* ---------- 庆祝页 ---------- */
.celebrate {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; animation: celebrateIn .5s var(--ease);
}
@keyframes celebrateIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
.celebrate-icon {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--success-bg-deep);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px; position: relative;
  animation: bounceIn .6s var(--ease);
}
.celebrate-icon svg { width: 44px; height: 44px; color: var(--success); }
.celebrate-icon::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; background: var(--success); opacity: .15; z-index: -1; animation: pulse 2s var(--ease) infinite; }
@keyframes bounceIn { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .15; } 50% { transform: scale(1.2); opacity: 0; } }
.celebrate-title { font-size: 36px; font-weight: 700; margin-bottom: 8px; color: var(--text-1); }
.celebrate-sub { font-size: 14px; color: var(--text-3); margin-bottom: 32px; }
.celebrate-stats { display: flex; gap: 16px; margin-bottom: 32px; }
.celebrate-stat {
  background: var(--surface); border-radius: var(--r-md);
  padding: 18px 32px; text-align: center; min-width: 140px; box-shadow: var(--shadow-sm);
}
.celebrate-stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.celebrate-stat-value { font-size: 28px; font-weight: 700; color: var(--brand-500); }
.celebrate-stat-value.green { color: var(--success); }
.celebrate-actions { display: flex; gap: 12px; }

/* ---------- 弹窗 / Sheet / Toast / Confetti ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: overlayIn .2s var(--ease);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  background: var(--surface); border-radius: var(--r-lg);
  padding: 28px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .3s cubic-bezier(.34, 1.56, .64, 1);
  max-height: 90vh; overflow-y: auto;
}
/* 创建任务弹窗：加宽版，仅模板选择弹窗使用 */
.modal.modal-lg { max-width: 560px; }
@keyframes modalIn { from { opacity: 0; transform: scale(.85) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--surface-hover); color: var(--text-1); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

.sheet-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn .2s var(--ease);
}
.sheet {
  position: relative;
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto;
  animation: sheetIn .35s var(--ease);
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-compact { width: calc(100vw - 32px); max-width: 440px; margin: 0 auto; }
.sheet-compact .tpl-picker { width: 100%; }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.sheet-close:hover { background: var(--surface-hover); color: var(--text-1); }

/* 新建任务弹窗：固定高度，仅模板列表滚动，底部操作固定 */
.tpl-picker { display: flex; flex-direction: column; height: min(60vh, 480px); }
.tpl-picker-head { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.tpl-picker-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.tpl-picker-head .tpl-picker-search { position: relative; }
.tpl-picker-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 12px -4px 0; padding: 0 4px; }
.tpl-picker-foot { flex-shrink: 0; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tpl-picker-empty { padding: 20px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.tpl-picker-list { display: flex; flex-direction: column; gap: 4px; }
.tpl-picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-sm);
  cursor: pointer; transition: background var(--t-fast) var(--ease);
  border: 1.5px solid transparent;
}
.tpl-picker-item:hover { background: var(--surface-hover); }
.tpl-picker-item.selected { background: var(--brand-50); border-color: var(--brand-500); }
[data-theme="dark"] .tpl-picker-item.selected { background: var(--brand-100); }
.tpl-picker-item .tpl-card-icon { width: 36px; height: 36px; }
.tpl-picker-item .tpi-info { flex: 1; min-width: 0; }
.tpl-picker-item .tpi-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.tpl-picker-item .tpi-meta { font-size: 12px; color: var(--text-3); }
.tpl-picker-item .tpi-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.tpl-picker-item.selected .tpi-check { background: var(--brand-500); border-color: var(--brand-500); }
.tpl-picker-item.selected .tpi-check::after { content: '✓'; font-size: 13px; font-weight: 700; }

/* ---------- 模板图标选择器 ---------- */
.editor-icon-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.editor-icon-prev { width: 52px; height: 52px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; background: var(--brand-100); color: var(--brand-500); flex-shrink: 0; }
.editor-icon-prev svg { width: 26px; height: 26px; }
.editor-icon-info { flex: 1; min-width: 0; }
.editor-icon-info .editor-label { margin: 0 0 2px; }
.editor-icon-name { font-size: 13px; color: var(--text-2); text-transform: capitalize; }

.icon-picker-search { position: relative; margin-bottom: 12px; }
.icon-picker-list { max-height: 52vh; overflow-y: auto; padding: 2px 4px; display: flex; flex-direction: column; gap: 14px; }
.icon-picker-group-name { font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 8px; }
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.icon-picker-item { aspect-ratio: 1; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.icon-picker-item svg { width: 22px; height: 22px; }
.icon-picker-item:hover { background: var(--surface-hover); color: var(--text-1); }
.icon-picker-item.selected { background: var(--brand-100); color: var(--brand-500); border-color: var(--brand-500); }
.icon-picker-empty { padding: 24px 4px; text-align: center; color: var(--text-3); font-size: 14px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(24, 25, 28, .92); color: #fff;
  padding: 10px 22px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; z-index: 300;
  animation: toastIn .25s var(--ease);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .toast { background: rgba(242, 243, 248, .92); color: #101219; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

.confetti-canvas { position: fixed; inset: 0; z-index: 250; pointer-events: none; }

/* ---------- 执行台：常用（快捷模板） ---------- */
.quick-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.quick-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.quick-title { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--text-1); }
.quick-title svg { color: var(--brand-500); }
.quick-tip { font-size: 12px; color: var(--text-3); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.quick-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 18px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; text-align: center; box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.quick-card:hover { background: var(--bg); }
.quick-card-icon {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  background: var(--brand-100); color: var(--brand-500);
}
.quick-card-icon svg { width: 24px; height: 24px; }
.quick-card-name { font-size: 12px; font-weight: 600; color: var(--text-1); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-card-plus {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-500); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.6); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.quick-card:hover .quick-card-plus { opacity: 0; transform: scale(.6); }
/* 常用栏拖拽排序 */
.quick-card[draggable="true"] { cursor: grab; }
.quick-card.dragging { opacity: .4; box-shadow: var(--shadow-lg); }
.quick-card.drag-over { outline: 2px dashed var(--brand-500); outline-offset: 2px; background: var(--brand-100); transform: scale(1.02); }

/* 模板卡片星标按钮 */
.tpl-star-btn {
  margin-left: auto; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-sm); border: none; background: transparent;
  color: var(--text-3); cursor: pointer; flex-shrink: 0;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tpl-star-btn:hover { background: var(--bg); color: var(--text-1); transform: scale(1.1); }
.tpl-star-btn.active { color: #f6a733; }
.tpl-star-btn.active:hover { background: rgba(246, 167, 51, .12); }

@media (max-width: 1023px) {
  .quick-section { margin: 0 16px 24px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-card { min-width: 0; }
  .quick-card-name { min-width: 0; }
}

/* ---------- 空态 / 错误 ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 24px; text-align: center; }
.empty-icon {
  width: 80px; height: 80px; border-radius: var(--r-lg);
  background: var(--brand-100); color: var(--brand-500);
  display: flex; align-items: center; justify-content: center; position: relative;
  margin-bottom: 20px;
}
.empty-icon svg { width: 36px; height: 36px; }
.empty-icon::after { content: '✓'; position: absolute; top: -4px; right: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-500); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-brand); }
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-desc { font-size: 13px; color: var(--text-3); margin-bottom: 20px; max-width: 280px; line-height: 1.6; }

.js-error { position: fixed; top: 16px; left: 16px; right: 16px; background: var(--danger); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); z-index: 999; font-size: 13px; box-shadow: var(--shadow-lg); }

/* ---------- 统计 / 设置 / 归档页 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: var(--surface); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-1); }
.stat-trend { font-size: 12px; color: var(--success); margin-top: 4px; }
.settings-list { background: var(--surface); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.settings-item:last-child { border-bottom: none; }
.settings-item-name { font-size: 14px; color: var(--text-1); }
.settings-item-desc { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 移动端专用元素：桌面端隐藏，避免作为普通按钮/导航占位撑高页面 */
.fab { display: none; }
.tabbar { display: none; }

/* =========================================================
   移动端布局（≤1023px）
   ========================================================= */
@media (max-width: 1023px) {
  #app {
    grid-template-columns: 1fr;
    max-width: 480px; margin: 0 auto;
    background: var(--bg);
    min-height: 100vh; min-height: 100dvh;
  }
  .sidebar { display: none; }

  /* 移动端所有底部弹窗统一：留左右边距，不贴边 */
  .sheet { width: calc(100vw - 32px); max-width: 440px; }

  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    background: var(--bg);
    position: sticky; top: 0; z-index: 10;
  }
  .topbar-title { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
  .topbar-actions { display: flex; gap: 4px; }

  .page-head { padding: 8px 16px 16px; margin-bottom: 8px; align-items: center; }
  .page-head h2 { display: none; }
  .page-head p { display: block; margin-top: 0; }

  .hero-banner {
    margin: 0 16px 16px; padding: 18px 20px; border-radius: var(--r-lg);
    grid-template-columns: 48px 1fr; gap: 14px;
  }
  .hero-icon { width: 48px; height: 48px; }
  .hero-title { font-size: 18px; }
  .hero-progress { margin-top: 8px; }
  .hero-foot { display: none; }
  .hero-actions { grid-column: 1/-1; }
  .hero-actions .btn { width: 100%; }
  .hero-actions .btn-secondary { background: #fff; }

  .task-list { padding: 0 16px; gap: 10px; }
  .task-card { grid-template-columns: 40px 1fr; padding: 14px 16px; gap: 12px; }
  .task-card-icon { width: 40px; height: 40px; font-size: 18px; }
  .task-card-side { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; text-align: left; }
  .task-card-time { display: none; }

  .section { padding: 0 16px; margin-top: 24px; }
  .section-title { font-size: 14px; }
  .section-head .section-link { display: none; }

  .tpl-toolbar { padding: 0 16px; }
  .tpl-tags { padding: 0 16px; gap: 6px; }
  .tag { padding: 5px 12px; font-size: 12px; }
  .tpl-grid { padding: 0 16px; grid-template-columns: 1fr 1fr; gap: 12px; }
  .tpl-card { padding: 14px; }
  .tpl-card-head { gap: 6px; }
  .tpl-card-icon { width: 34px; height: 34px; flex-shrink: 0; }
  .tpl-card-icon svg { width: 18px; height: 18px; }
  .tpl-card-cat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; padding: 2px 8px; font-size: 11px; }
  .tpl-star-btn { width: 22px; height: 22px; }
  .tpl-card-name { font-size: 13px; }
  .tpl-card-desc { display: none; }
  .tpl-card-meta { font-size: 11px; }
  .tpl-card-actions { display: none; }
  .tpl-card-mark { margin-top: 4px; }
  .tpl-mark-btn { color: var(--text-3); font-size: 12px; background: none; border: none; padding: 0; cursor: pointer; transition: color var(--t-fast) var(--ease); }
  .tpl-mark-btn:hover { color: var(--text-1); }

  .run-shell { grid-template-columns: 1fr; gap: 0; }
  .run-head { padding: 8px 16px 12px; }
  .run-title { font-size: 16px; }
  .run-progress-pill { font-size: 11px; padding: 3px 10px; }
  .run-progress-bar { width: 120px; }
  .step-nav { display: none; }
  .step-detail { padding: 12px 16px 100px; box-shadow: none; background: transparent; min-height: auto; }
  .step-detail-text { font-size: 22px; }
  .check-list { padding: 8px 16px 100px; }

  .editor-shell { padding: 0 16px; }
  .editor-card { padding: 18px; }
  .editor-head { gap: 8px; }
  .editor-head h2 { font-size: 18px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .editor-head .run-progress-pill { display: none; }

  .immersive-body { padding: 24px 56px; }
  .immersive-step-text { font-size: 28px; }
  .immersive-nav { width: 44px; height: 44px; }
  .immersive-nav-left { left: 12px; }
  .immersive-nav-right { right: 12px; }

  .celebrate { padding: 24px; }
  .celebrate-title { font-size: 28px; }
  .celebrate-stats { flex-direction: row; gap: 8px; }
  .celebrate-stat { padding: 14px 18px; min-width: 0; flex: 1; }
  .celebrate-stat-value { font-size: 22px; }

  .tabbar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 448px;
    height: var(--tabbar-h);
    background: var(--surface);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-md);
    display: flex; align-items: center; padding: 0 8px;
    z-index: 20; margin-bottom: 12px;
    border: 1px solid var(--border);
  }
  .tab-item {
    flex: 1; height: 48px; border-radius: var(--r-pill);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 13px; font-weight: 600; color: var(--text-3);
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  }
  .tab-item.active { background: var(--gradient-brand); color: #fff; }
  .tab-item svg { width: 20px; height: 20px; flex-shrink: 0; }
  .tab-item span { font-size: 11px; white-space: nowrap; line-height: 1; }

  .fab {
    position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 24px);
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--gradient-brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-brand);
    z-index: 18; transition: transform var(--t-fast) var(--ease);
  }
  .fab:active { transform: scale(.92); }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
  .settings-list { margin: 0 16px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
