/*
 * intent.css — P1-16 意图理解三层（2026-11-30）
 * ---------------------------------------------------------------
 * 只作用于 #task-landing 的澄清区（复述卡 / 追问卡 / 假设清单）。
 * 设计口径：
 *   · 颜色 100% 走全站令牌（--ink / --muted / --line / --panel / --tl-*），
 *     本文件不出现任何硬编码色值、无橙色、无渐变、无 3D；
 *   · 强调只靠字重、细边框与 --ink 实底按钮，不用高饱和图标；
 *   · 375px 单列、按钮可换行、长句可折行（overflow-wrap:anywhere），不横向溢出；
 *   · 与既有 .tl-q-*（clarify-ux 的一次性选择卡）保持同一套视觉语言，便于替换。
 * 载入顺序：shell.css 之后（index.html 中紧跟 delivery-preview.css）。
 */

/* 外层容器：与旧澄清卡同样的留白和细边框，但不再有阴影（无 3D）。 */
#task-landing .tl-intent {
  margin: 10px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--tl-panel, var(--panel));
}
#task-landing .tl-intent[hidden] { display: none; }

#task-landing .tl-intent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
#task-landing .tl-intent-title {
  margin: 0;
  color: var(--tl-sub, var(--text-2));
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
}
#task-landing .tl-intent-round {
  color: var(--tl-faint, var(--faint));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#task-landing .tl-intent-round[hidden] { display: none; }

#task-landing .tl-intent-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 0;
}
#task-landing .tl-intent-dots[hidden] { display: none; }
#task-landing .tl-intent-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}
#task-landing .tl-intent-dots i.on {
  width: 16px;
  border-radius: 999px;
  background: var(--ink);
}

/* 复述回声：从追问开始一直显示在顶部，用户随时能看到「我按什么理解在做」。 */
#task-landing .tl-intent-echo {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-left: 2px solid var(--ink);
  border-radius: 0 8px 8px 0;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#task-landing .tl-intent-echo[hidden] { display: none; }

/* 卡片：steps 共用。 */
#task-landing .tl-intent-card { display: block; }
#task-landing .tl-intent-card[hidden] { display: none; }
#task-landing .tl-intent-card > :first-child { margin-top: 0; }

#task-landing .tl-intent-restate-text {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
#task-landing .tl-intent-restate-unknown {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
#task-landing .tl-intent-restate-unknown[hidden] { display: none; }
#task-landing .tl-intent-ask {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* 追问区：题号 + 问题 + why。 */
#task-landing .tl-intent-count {
  display: inline-block;
  color: var(--tl-faint, var(--faint));
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#task-landing .tl-intent-count[hidden] { display: none; }
#task-landing .tl-intent-question {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
#task-landing .tl-intent-why {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
#task-landing .tl-intent-why:empty { display: none; }

/* 候选项：一列，带 label + why；选中用 --ink 内描边（与旧卡一致）。 */
#task-landing .tl-intent-options {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}
#task-landing .tl-intent-options[hidden] { display: none; }
#task-landing .tl-intent-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--t-fast, .12s ease), border-color var(--t-fast, .12s ease), box-shadow var(--t-fast, .12s ease);
}
#task-landing .tl-intent-option-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#task-landing .tl-intent-option-label { font-size: 14px; font-weight: 600; line-height: 1.4; }
#task-landing .tl-intent-option-why { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
#task-landing .tl-intent-option-tag {
  flex: none;
  align-self: center;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
#task-landing .tl-intent-option:hover { border-color: var(--ink); background: var(--panel); }
#task-landing .tl-intent-option.is-on {
  border-color: var(--ink);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--ink);
}
#task-landing .tl-intent-option.is-uncertain { border-style: dashed; }
#task-landing .tl-intent-option:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
#task-landing .tl-intent-option:disabled { opacity: .55; cursor: progress; }

/* 自写一句 / 改一下：40px 高，与输入框同语言。 */
#task-landing .tl-intent-custom {
  display: block;
  width: 100%;
  height: 40px;
  margin: 10px 0 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 40px;
  outline: none;
  transition: border-color var(--t-fast, .12s ease), box-shadow var(--t-fast, .12s ease);
}
#task-landing .tl-intent-custom[hidden] { display: none; }
#task-landing .tl-intent-custom:focus { border-color: var(--ink); }
#task-landing .tl-intent-custom::placeholder { color: var(--faint); }

/* 假设清单：有序列表 + 依据标签；最多 5 条，长句折行。 */
#task-landing .tl-intent-label {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
#task-landing .tl-intent-assumptions {
  margin: 8px 0 0;
  padding: 0 0 0 22px;
  /* v5 的 Tailwind preflight 会把 ul/ol 重置成 list-style:none，这里显式还原编号 */
  list-style: decimal outside;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}
#task-landing .tl-intent-assumptions li { margin: 3px 0; overflow-wrap: anywhere; }
#task-landing .tl-intent-assumptions li::marker { color: var(--faint); font-variant-numeric: tabular-nums; }
#task-landing .tl-intent-basis {
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
#task-landing .tl-intent-open {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
#task-landing .tl-intent-open[hidden] { display: none; }
#task-landing .tl-intent-review {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
#task-landing .tl-intent-review[hidden] { display: none; }

/* 动作行：主按钮 --ink 实底（全站主按钮口径），次按钮文字按钮。 */
#task-landing .tl-intent-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
#task-landing .tl-intent-primary {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: var(--ink-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--t-fast, .12s ease), border-color var(--t-fast, .12s ease), opacity var(--t-fast, .12s ease);
}
#task-landing .tl-intent-primary:hover { background: var(--ink); opacity: .88; }
#task-landing .tl-intent-primary:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
#task-landing .tl-intent-primary:disabled { opacity: .5; cursor: progress; }
#task-landing .tl-intent-quiet {
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
#task-landing .tl-intent-quiet:hover { color: var(--text); }
#task-landing .tl-intent-quiet:focus-visible { outline: 2px solid var(--lamp); outline-offset: 2px; }
#task-landing .tl-intent-quiet:disabled { opacity: .5; cursor: progress; }

/* 兜底说明：模型不可用时只占一行，不用错误色（不阻塞、不吓人）。 */
#task-landing .tl-intent-engine,
#task-landing .tl-intent-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
#task-landing .tl-intent-engine[hidden],
#task-landing .tl-intent-note[hidden] { display: none; }
#task-landing .tl-intent-note.is-warn { color: var(--warn); }

/* 375px：动作行两个按钮可以换行，主按钮不撑破卡片。 */
@media (max-width: 560px) {
  #task-landing .tl-intent { padding: 12px; }
  #task-landing .tl-intent-actions { justify-content: flex-start; }
  #task-landing .tl-intent-primary { flex: 1 1 auto; min-width: 0; }
  #task-landing .tl-intent-quiet { flex: 0 0 auto; }
  #task-landing .tl-intent-question { font-size: 15px; }
}

/* 键盘用户：不抢 focus 视觉，但保证描边可见。 */
@media (prefers-reduced-motion: reduce) {
  #task-landing .tl-intent-option,
  #task-landing .tl-intent-custom,
  #task-landing .tl-intent-primary { transition: none; }
}
