/* ==================================================
   任务拆分助手 v2.0  — 样式
   三大模式：拆分(橙) | 象限(紫) | 计时(绿)
   ================================================== */

/* ---------- Reset & Vars ---------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
:root {
  --bg:       #fafaf8;
  --card:     #ffffff;
  --text:     #1c1917;
  --text-2:   #57534e;
  --text-3:   #a8a29e;
  --line:     #e7e5e4;
  --line-2:   #f0efed;
  --accent:   #f97316;
  --accent-h: #ea580c;
  --accent-bg:#fff7ed;
  --green:    #10b981;
  --green-bg: #ecfdf5;
  --red:      #ef4444;
  --red-bg:   #fef2f2;
  --purple:   #8b5cf6;
  --purple-h: #7c3aed;
  --purple-bg:#f5f3ff;
  --radius:   14px;
  --radius-s: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --strip-w:  36px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================
   三模式滑动布局
   ============================================ */
.app-layout {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  overflow: hidden;
  transition: background .4s ease;
}
.app-layout[data-active="split"]    { background: #fff9f4; }
.app-layout[data-active="quadrant"] { background: #fbf9ff; }
.app-layout[data-active="timer"]    { background: #f5fdf9; }

.app-mode {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  /* 不再做切换动画——让页面瞬间切换 */
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-layout[data-active="split"]    .mode-split     { flex-basis: 100%; }
.app-layout[data-active="split"]    .mode-quadrant  { flex-basis: var(--strip-w); }
.app-layout[data-active="split"]    .mode-timer     { flex-basis: var(--strip-w); }

.app-layout[data-active="quadrant"] .mode-split     { flex-basis: var(--strip-w); }
.app-layout[data-active="quadrant"] .mode-quadrant  { flex-basis: 100%; }
.app-layout[data-active="quadrant"] .mode-timer     { flex-basis: var(--strip-w); }

.app-layout[data-active="timer"]    .mode-split     { flex-basis: var(--strip-w); }
.app-layout[data-active="timer"]    .mode-quadrant  { flex-basis: var(--strip-w); }
.app-layout[data-active="timer"]    .mode-timer     { flex-basis: 100%; }

/* 窄条背景色（按文档顺序决定显示：split 在最左/最远，quadrant 中间，timer 最右） */
.app-mode:not([data-current="true"]) {
  background: linear-gradient(180deg, #f97316, #ea580c);
}
.app-mode:not([data-current="true"])[data-mode="quadrant"] {
  background: linear-gradient(180deg, #8b5cf6, #7c3aed);
}
.app-mode:not([data-current="true"])[data-mode="timer"] {
  background: linear-gradient(180deg, #10b981, #059669);
}
.app-mode[data-current="true"] {
  background: transparent;
}
.app-mode:not([data-current="true"]):hover { filter: brightness(1.08); }
.app-mode:not([data-current="true"]) { cursor: pointer; }

.mode-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}
.app-mode:not([data-current="true"]) .mode-stage > *:not(.strip-label) {
  display: none;
}
.app-mode:not([data-current="true"]) .mode-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}
.strip-label {
  display: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 6px;
  user-select: none;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.app-mode:not([data-current="true"]) .strip-label {
  display: block;
}

/* ============================================
   模式 1：拆分
   ============================================ */
.mode-split .mode-stage {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
}

/* ---------- Top Bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 22px; line-height: 1; }
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.topbar-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-s);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: all .2s;
}
.topbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}

/* ---------- 顶部三段模式开关 ---------- */
.mode-switch {
  display: flex;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.mode-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
}
.mode-btn:hover {
  color: var(--c, var(--text));
  background: var(--bg, #fafaf8);
}
.mode-btn.active {
  background: var(--c, var(--accent));
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

/* ---------- Tagline ---------- */
.tagline { text-align: center; margin-bottom: 24px; }
.tagline p { font-size: 14px; color: var(--text-2); }
.hl { color: var(--accent); font-weight: 600; }

/* ---------- Input ---------- */
.input-zone { margin-bottom: 16px; }
.input-wrap { display: flex; gap: 10px; margin-bottom: 14px; }
.task-input {
  flex: 1;
  padding: 14px 18px;
  font-size: 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  outline: none;
  background: var(--card);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.task-input::placeholder { color: var(--text-3); }
.task-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.btn-split, .btn-confirm {
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-s);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.btn-split {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-h) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.btn-split::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg);
  transition: left .5s;
}
.btn-split:hover::after { left: 120%; }
.btn-split:hover { box-shadow: 0 4px 14px rgba(249,115,22,.35); }
.btn-confirm {
  background: none;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.btn-confirm:hover { background: var(--accent-bg); }
.btn-split:disabled, .btn-confirm:disabled { opacity: .45; cursor: not-allowed; }
.btn-split:active, .btn-confirm:active { transform: scale(.97); }

.quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 15px;
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ai-hint {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  display: none;
}
.ai-hint .hl { color: #7c3aed; }

/* ---------- Skeleton ---------- */
.skeleton {
  padding: 28px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.skeleton-bar {
  height: 16px;
  background: linear-gradient(90deg, #f0efed 25%, #e7e5e4 50%, #f0efed 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 12px;
  animation: shim 1.4s ease infinite;
}
@keyframes shim { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-hint { margin-top: 8px; font-size: 13px; color: var(--text-3); text-align: center; }

/* ---------- Task Feed ---------- */
.task-feed { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeUp .35s ease both;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 10px;
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}
.card-emoji { font-size: 18px; flex-shrink: 0; }
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.4;
}
.card-arrow {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform .25s ease;
  margin-left: auto;
  padding: 2px 6px;
}
.card.collapsed .card-arrow { transform: rotate(-90deg); }
.card-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .32s cubic-bezier(.4,0,.2,1);
}
.card-body > .card-steps, .card-body > .card-foot { min-height: 0; overflow: hidden; }
.card.collapsed .card-body { grid-template-rows: 0fr; }
.card.collapsed .card-head { padding-bottom: 10px; }
.card-kill {
  width: 30px; height: 30px;
  border: none; background: none;
  color: var(--text-3);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  line-height: 1;
}
.card-kill:hover { background: var(--red-bg); color: var(--red); }

.card-steps {
  list-style: none;
  padding: 6px 20px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.step { border-radius: 8px; transition: background .15s; position: relative; }
.step:hover { background: #fafaf8; }
.step-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
}
.step-cb { display: none; }
.step-cb-area {
  display: flex;
  align-items: flex-start;
  padding: 2px 0;
  cursor: pointer;
  flex-shrink: 0;
}
.step-dot {
  width: 20px; height: 20px;
  border: 2px solid #d6d3d1;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all .25s;
}
.step-cb:checked + .step-dot { background: var(--green); border-color: var(--green); }
.step-cb:checked + .step-dot::after {
  content: "";
  position: absolute;
  top: 3px; left: 6px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.step-body { flex: 1; min-width: 0; }
.step-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  transition: all .2s;
}
.step.is-done .step-text {
  color: #a8a29e;
  text-decoration: line-through;
  text-decoration-color: #d6d3d1;
}
.step-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
  align-items: flex-start;
  padding-top: 1px;
}
.step:hover .step-actions, .step-actions.visible { opacity: 1; }
.step-act {
  width: 26px; height: 26px;
  border: none; background: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  padding: 0; line-height: 1;
}
.step-act:hover { background: #e7e5e4; color: var(--text); }
.step-act[data-act="edit"]:hover   { color: var(--accent); background: var(--accent-bg); }
.step-act[data-act="delete"]:hover { color: var(--red); background: var(--red-bg); }
.step-act[data-act="insert"]:hover { color: #2563eb; background: #eff6ff; }
.step-act[data-act="split"]:hover  { color: var(--purple); background: var(--purple-bg); }
.step-act.loading { animation: spin .6s linear infinite; pointer-events: none; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 16px;
}
.card-progress { font-size: 12px; color: var(--green); font-weight: 500; }
.card-time     { font-size: 12px; color: var(--text-3); }

.step-editing .step-body { display: flex; flex-direction: column; gap: 6px; }
.step-editing .step-actions { opacity: 1; }
.step-edit-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 14px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
.step-edit-actions { display: flex; gap: 4px; }
.step-edit-save, .step-edit-cancel {
  height: 28px;
  padding: 0 12px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.step-edit-save { background: var(--green); color: #fff; font-weight: 500; }
.step-edit-save:hover { background: #059669; }
.step-edit-cancel { background: none; color: var(--text-3); }
.step-edit-cancel:hover { background: #f0efed; color: var(--text); }

.step-insert-form {
  padding: 4px 10px 6px;
  display: flex; gap: 6px;
  animation: fadeUp .2s ease;
}
.step-insert-input {
  flex: 1;
  padding: 7px 12px;
  font-size: 13px;
  border: 1.5px solid #2563eb;
  border-radius: 6px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.step-insert-input::placeholder { color: var(--text-3); }
.step-insert-done, .step-insert-cancel {
  width: 32px; height: 32px;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-insert-done { background: #2563eb; color: #fff; }
.step-insert-done:hover { background: #1d4ed8; }
.step-insert-cancel { background: none; color: var(--text-3); border: 1px solid var(--line); }
.step-insert-cancel:hover { background: #f0efed; }
.step-split-items { animation: fadeUp .3s ease; }

.empty-state { text-align: center; padding: 64px 20px; }
.empty-visual { display: flex; flex-direction: column; gap: 6px; margin-bottom: 24px; }
.empty-num {
  display: inline-block;
  padding: 12px 20px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius-s);
  font-size: 28px;
  font-weight: 700;
  color: #d6d3d1;
  letter-spacing: 1px;
  font-family: "SF Mono","Fira Code","Consolas",monospace;
  opacity: .6;
}
.empty-title { font-size: 17px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-desc { font-size: 14px; color: var(--text-3); line-height: 1.7; }

.snack {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1c1917;
  color: #fff;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 900;
  pointer-events: none;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow-lg);
}
.snack.show { transform: translateX(-50%) translateY(0); }
.snack.err  { background: var(--red); }

/* ============================================
   Drawer
   ============================================ */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(2px);
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  max-width: 88vw;
  background: var(--card);
  z-index: 401;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 17px; font-weight: 600; }
.drawer-head-right { display: flex; align-items: center; gap: 10px; }
.conn-badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: #f0efed;
  color: var(--text-3);
  letter-spacing: .3px;
}
.conn-badge.on { background: var(--green-bg); color: var(--green); }
.conn-badge.off { background: var(--red-bg); color: var(--red); }
.drawer-close {
  width: 32px; height: 32px;
  border: none; background: none;
  font-size: 24px; color: var(--text-3);
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.drawer-close:hover { background: #f5f5f4; color: var(--text); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field-note { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.drawer select, .drawer input[type="text"], .drawer input[type="password"] {
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--card);
  color: var(--text);
  width: 100%;
  font-family: inherit;
}
.drawer select:focus, .drawer input:focus { border-color: var(--accent); }
.drawer input::placeholder { color: var(--text-3); }
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; font-family: "SF Mono","Fira Code","Consolas",monospace; }
.mini-btn {
  width: 38px; height: 38px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.drawer-actions { display: flex; gap: 10px; margin-top: 6px; }
.btn-primary {
  flex: 1;
  padding: 11px 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-secondary {
  flex: 1;
  padding: 11px 0;
  background: none;
  color: var(--text-2);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.drawer-msg { font-size: 13px; min-height: 18px; color: var(--text-2); line-height: 1.4; }
.drawer-msg.good { color: var(--green); }
.drawer-msg.bad  { color: var(--red); }

/* 访客模式开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--line); border-radius: 24px; transition: .25s; }
.slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.switch input:checked+.slider { background: var(--green); }
.switch input:checked+.slider:before { transform: translateX(20px); }
.drawer-link { font-size: 12px; color: var(--text-3); padding-top: 10px; border-top: 1px solid var(--line); }
.drawer-link a { color: var(--accent); text-decoration: none; }
.drawer-link a:hover { text-decoration: underline; }

/* ============================================
   模式 2：象限（紫色）
   ============================================ */
.mode-quadrant .mode-stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
  color: #4c1d95;
}
.quadrant-page { text-align: center; }
.quadrant-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  margin-bottom: 6px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: -0.3px;
  margin: 0;
}
.btn-ai-fill {
  padding: 6px 16px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.btn-ai-fill:hover { background: var(--purple-h); box-shadow: 0 2px 8px rgba(139,92,246,.3); }
.btn-ai-fill:disabled { opacity: .5; cursor: not-allowed; }
.btn-ai-small {
  padding: 5px 14px;
  font-size: 12px;
  background: var(--bg, var(--green));
  display: block;
}
.btn-ai-small:hover { background: var(--bg-h, #059669); box-shadow: 0 2px 8px rgba(16,185,129,.3); }

.timer-todo-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 4px;
  max-height: 500px;
}
.timer-todo-item {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-2);
  border-radius: 6px;
  cursor: default;
}
.timer-todo-item:hover { background: #f0fdf4; }
.timer-todo-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timer-todo-item.done .timer-todo-text {
  text-decoration: line-through;
  color: var(--text-3);
}
.timer-todo-dot {
  width: 16px; height: 16px;
  border: 2px solid #a7f3d0;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  cursor: pointer;
}
.timer-todo-item.done .timer-todo-dot {
  background: var(--green);
  border-color: var(--green);
}
.timer-todo-item.done .timer-todo-dot::after {
  content: '✓';
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.timer-todo-text { flex: 1; font-weight: 600; }
.timer-todo-arrow {
  font-size: 10px;
  color: var(--text-3);
  transition: transform .2s;
  cursor: pointer;
  padding: 2px;
}
.timer-todo-item.collapsed .timer-todo-arrow { transform: rotate(-90deg); }
.timer-todo-item.collapsed .timer-steps-list { display: none; }
.timer-steps-list {
  margin: 4px 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.timer-step-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.timer-step-row:hover {
  background: #d1fae5;
  color: var(--text);
}
.timer-step-text { flex: 1; }
.timer-step-quick {
  padding: 2px 8px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
}
.timer-step-row:hover .timer-step-quick { opacity: 1; }
.timer-step-quick:hover { background: #059669; }
.page-title-sm {
  font-size: 16px;
  font-weight: 600;
  color: var(--purple);
  margin-bottom: 12px;
  text-align: center;
}
.page-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.quadrant {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: 1fr 28px;
  gap: 10px;
  margin: 0 auto;
  max-width: 600px;
  padding: 0 4px;
}
.q-axis-y {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-bg);
  border-radius: 8px;
  text-align: center;
  line-height: 1.2;
}
.q-axis-x {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-bg);
  border-radius: 8px;
  letter-spacing: 1px;
}
.q-grid {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 420px;
}
.q-cell {
  border: 2px solid var(--purple);
  border-radius: 10px;
  background: #fff;
  position: relative;
  transition: background .2s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.q-cell:hover { background: #fafaff; }
.q-cell-1 { border-color: #f59e0b; }    /* 不重要·紧急 - 黄 */
.q-cell-2 { border-color: #ef4444; }    /* 重要·紧急 - 红 */
.q-cell-3 { border-color: var(--text-3); }  /* 不重要·不紧急 - 灰 */
.q-cell-4 { border-color: var(--green); }   /* 重要·不紧急 - 绿 */
.q-cell-1 .q-label { color: #f59e0b; }
.q-cell-2 .q-label { color: #ef4444; }
.q-cell-3 .q-label { color: var(--text-3); }
.q-cell-4 .q-label { color: var(--green); }
.q-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
}
.q-label { font-weight: 600; font-size: 13px; }
.q-add {
  width: 24px; height: 24px;
  border: 1px solid var(--text-3);
  background: #fff;
  border-radius: 4px;
  font-size: 16px;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: all .15s;
  line-height: 1;
  padding: 0;
}
.q-add:hover { background: var(--purple-bg); color: var(--purple); border-color: var(--purple); }
.q-items {
  flex: 1;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 180px;
}
.q-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  padding: 3px 0;
}
.q-item::before { content: '•'; color: inherit; opacity: .5; }
.q-item-text { flex: 1; word-break: break-word; text-align: left; }
.q-item-kill {
  width: 16px; height: 16px;
  border: none; background: none;
  color: var(--text-3); cursor: pointer;
  font-size: 12px; flex-shrink: 0;
  display: none; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
}
.q-item:hover .q-item-kill { display: flex; }
.q-item-kill:hover { color: var(--red); }
.q-input-row {
  display: flex; gap: 4px; padding: 4px 12px 8px;
}
.q-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  border: 1.5px solid var(--purple);
  border-radius: 4px;
  outline: none;
  font-family: inherit;
}

/* ============================================
   模式 3：计时（绿色）
   ============================================ */
.mode-timer .mode-stage {
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
  max-width: 1000px;
  color: #064e3b;
}
.timer-page {
  display: flex;
  gap: 24px;
  min-height: 480px;
}
.timer-left, .timer-right {
  flex: 1;
  background: #fff;
  border: 1.5px solid #d1fae5;
  border-radius: var(--radius);
  padding: 24px;
}
.timer-left { flex: 0 0 55%; }
.timer-right {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-color: var(--green);
}
.timer-display {
  font-size: 88px;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  font-family: "SF Mono", "Consolas", monospace;
  letter-spacing: 4px;
  margin: 24px 0;
  font-variant-numeric: tabular-nums;
}
.timer-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.preset-group-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 4px 0;
  margin-top: 2px;
}
.preset {
  padding: 10px 0;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.preset:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.preset.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.timer-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-timer {
  flex: 1;
  padding: 12px 0;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-2);
  font-family: inherit;
  transition: all .2s;
}
.btn-timer:hover { border-color: var(--green); color: var(--green); }
.btn-timer.primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-timer.primary:hover { background: #059669; border-color: #059669; }
.btn-timer.primary.running {
  background: #ef4444;
  border-color: #ef4444;
}
.btn-timer.primary.running:hover { background: #dc2626; }

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .mode-switch { font-size: 12px; }
  .mode-btn { padding: 5px 10px; }
  .input-wrap { flex-wrap: wrap; }
  .input-wrap .task-input { width: 100%; }
  .timer-page { flex-direction: column; }
  .timer-left { flex: 1; }
  .timer-display { font-size: 64px; }
}
