/* 通用隐藏类：所有依赖 class="hidden" 的元素（progress/valueSummary/gate/modal）都据此隐藏，
   否则 hidden 类不生效，会导致 valueSummary 的 ::before "✓" 常驻显示 */
.hidden { display: none !important; }

:root {
  --bg: #eef1f7;
  --bg-2: #e7ecf6;
  --panel: #ffffff;
  --ink: #1e2230;
  --ink-soft: #6b7280;
  --ink-faint: #9aa3b2;
  --line: #e6e9f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --chip: #f2f4f9;
  --chip-on-bg: #eef2ff;
  --warn: #d97706;
  --ok: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 2px 6px rgba(16,24,40,.05), 0 12px 32px rgba(16,24,40,.06);
  --shadow-lg: 0 24px 60px rgba(31,38,90,.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, #e9ecff 0%, rgba(233,236,255,0) 60%),
    radial-gradient(900px 500px at -10% 0%, #efe7ff 0%, rgba(239,231,255,0) 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(79,70,229,.35);
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .3px; }
.sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); max-width: 620px; }
.topbar-actions { display: flex; gap: 10px; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 14px; min-height: 44px; border-radius: 10px; cursor: pointer; font-size: 13px;
  font-weight: 500; transition: .16s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border: none; box-shadow: 0 8px 20px rgba(79,70,229,.30);
}
.btn.primary:hover { color: #fff; filter: brightness(1.05); box-shadow: 0 10px 26px rgba(79,70,229,.38); }
.btn.block { width: 100%; margin-top: 14px; padding: 13px 16px; font-size: 15px; font-weight: 600; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.layout {
  display: grid; grid-template-columns: minmax(380px, 1fr) minmax(440px, 1.1fr);
  gap: 22px; padding: 26px 28px 40px; align-items: stretch;
  max-width: 1380px; margin: 0 auto;
}
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; align-items: start; } }
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow);
}
.panel-title {
  font-size: 14px; margin: 4px 0 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ""; width: 4px; height: 15px; border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.hint { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.5; }

/* ---------- 流程步骤（输入栏顶部引导） ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  padding: 12px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(180deg, #fbfcff, #f6f8ff);
}
.step-num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.step-t { font-size: 13px; font-weight: 600; color: var(--ink); }
.step-d { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }

/* ---------- 表单 ---------- */
textarea, input[type="text"], input[type="password"] {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; font-family: inherit; color: var(--ink);
  background: #fcfdff; resize: vertical; transition: .16s ease;
}
textarea:focus, input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }

/* ---------- 拖拽上传 ---------- */
.drop {
  position: relative; border: 2px dashed #cfd6e6; border-radius: 14px;
  padding: 26px 18px; text-align: center; color: var(--ink-soft);
  font-size: 13.5px; transition: .18s ease; background: #fbfcff; cursor: pointer;
}
.drop:hover { border-color: var(--brand); background: var(--brand-soft); }
.drop.drag { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.drop-icon {
  width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; color: var(--brand);
  background: var(--brand-soft);
}
.link { color: var(--brand); cursor: pointer; font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--brand); }

/* ---------- 附件列表 ---------- */
.attach-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.attach {
  width: 92px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: #fff; font-size: 11px; text-align: center; box-shadow: var(--shadow-sm);
}
.attach .doc { height: 54px; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .5px; color: var(--brand); background: #f4f6ff; }
.attach .name { padding: 5px 7px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach .rm {
  display: block; font-size: 11px; color: var(--ink-faint); padding: 3px 0;
  border-top: 1px solid var(--line); cursor: pointer;
}
.attach .rm:hover { color: var(--warn); background: #fff7ed; }

/* ---------- 状态文字 ---------- */
.status { margin-top: 12px; font-size: 13px; min-height: 18px; color: var(--ink-soft); }
.status.ok { color: var(--ok); }
.status.err { color: var(--warn); }

/* ---------- 进度（移到结果栏） ---------- */
.progress {
  margin: 14px 0; border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; background: linear-gradient(180deg, #fbfcff, #f5f7ff);
  display: flex; flex-direction: column; gap: 12px;
}
.progress.hidden { display: none; }
.pstep { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--ink-faint); transition: .2s; }
.pstep .ptext { transition: .2s; }
.pstep.done { color: var(--ok); }
.pstep.done .ptext { color: var(--ink); }
.pstep.active { color: var(--brand); font-weight: 600; }
.pstep.active .ptext { color: var(--ink); }
.pmark { width: 22px; height: 22px; flex: none; display: grid; place-items: center; font-size: 12px; border-radius: 50%; background: #e7eaf2; color: var(--ink-faint); }
.pstep.done .pmark { background: var(--ok); color: #fff; }
.pstep.active .pmark { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.spin { width: 14px; height: 14px; border: 2px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 结果栏头部 ---------- */
.output-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.output-note { font-size: 12px; color: var(--ink-faint); }

/* ---------- 输出面板：等高 + 内容内部滚动（避免左右失衡 / 整页过长） ---------- */
.output-panel { display: flex; flex-direction: column; max-height: calc(100vh - 110px); }
.output-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 6px; margin-right: -6px; }
.output-body::-webkit-scrollbar { width: 8px; }
.output-body::-webkit-scrollbar-thumb { background: #d7dcec; border-radius: 8px; }
.output-body::-webkit-scrollbar-thumb:hover { background: #c3cbe0; }
@media (max-width: 980px) {
  .output-panel { max-height: none; }
  .output-body { overflow: visible; padding-right: 0; margin-right: 0; }
}
/* 移动端：顶栏动作按钮平铺，隐藏过长的副标题 */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .sub { display: none; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1 1 0; min-width: 0; padding: 11px 6px; font-size: 12.5px; }
  .layout { padding: 16px 14px 32px; gap: 16px; }
  .panel { padding: 18px 16px; }
}
/* 尊重「减少动态效果」系统偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spin { animation: none; }
}

/* ---------- 歧义确认（友好澄清卡，非告警红） ---------- */
.ambiguities { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ambiguities:empty { display: none; }
.amb-intro {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--brand-soft); border: 1px solid #dfe4ff; border-radius: 12px;
  font-size: 13.5px; color: #3730a3; font-weight: 600;
}
.amb-intro .ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.amb-card { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow-sm); }
.amb-q { font-size: 14px; margin-bottom: 10px; color: var(--ink); }
.amb-q b { color: var(--brand); }
.amb-opts { display: flex; flex-direction: column; gap: 10px; }
.amb-opt { display: flex; flex-direction: column; gap: 4px; }
.amb-example { font-size: 12.5px; color: var(--ink-faint); padding: 0 4px 2px; line-height: 1.55; }
.value-summary {
  font-size: 13px; color: var(--ink-soft); background: #f6f8ff; border: 1px solid #e3e9ff;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 12px;
}
.value-summary::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.chip {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; min-height: 48px;
  border: 1px solid var(--line); background: var(--chip); color: var(--ink);
  padding: 12px 16px; border-radius: 12px; cursor: pointer; font-size: 15px; line-height: 1.4; transition: .15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--chip-on-bg); color: var(--brand); border-color: var(--brand); font-weight: 600; box-shadow: 0 0 0 3px var(--brand-soft); }
.chip.on:hover { color: var(--brand); }
.amb-done { font-size: 13px; color: var(--ok); font-weight: 600; padding: 6px 0 2px; }
.btn.apply {
  margin-top: 4px; align-self: flex-start; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border: none; padding: 10px 18px; font-size: 14px; font-weight: 600;
  border-radius: 10px; cursor: pointer; box-shadow: 0 8px 20px rgba(79,70,229,.28);
}
.btn.apply:hover { filter: brightness(1.05); color: #fff; }

/* 澄清卡兜底项：「以上都不是，我想自己说一句」与其小输入框 */
.chip.amb-other.on {
  background: var(--chip-on-bg); color: var(--brand);
  border-color: var(--brand); font-weight: 600; box-shadow: 0 0 0 3px var(--brand-soft);
}
.amb-other-input {
  display: none;
  width: 100%; margin-top: 10px; padding: 10px 14px; min-height: 40px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fcfdff;
  transition: .16s ease;
}
.amb-other-input.open { display: block; }
.amb-other-input:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

/* ---------- 访问口令浮层 ---------- */
.gate { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex;
  align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.gate.hidden { display: none; }
.gate-box { background: #fff; border-radius: 16px; padding: 24px 26px; width: min(92vw, 360px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.gate-box h3 { margin: 0 0 6px; font-size: 18px; }
.gate-box .hint { margin: 0 0 12px; }
.gate-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 9px;
  font-size: 15px; margin: 4px 0; }
.gate-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.gate-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }

/* ---------- 需求单正文 ---------- */
.spec { font-size: 14px; }
.spec h2 { font-size: 20px; margin: 6px 0 14px; font-weight: 700; }
.spec h3 { font-size: 16px; margin: 22px 0 10px; padding-left: 11px; border-left: 3px solid var(--brand); }
.spec h4 { font-size: 14px; margin: 14px 0 6px; color: var(--ink-soft); font-weight: 600; }
.spec p { margin: 5px 0; }
.spec ul { margin: 7px 0; padding-left: 22px; }
.spec li { margin: 3px 0; }
.spec .quote { background: var(--brand-soft); border-radius: 10px; padding: 11px 14px; color: #3730a3; white-space: pre-wrap; border: 1px solid #e2e6ff; }
.spec code { background: #f0f2f5; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.spec .empty { color: var(--ink-faint); font-style: normal; }

/* 空状态引导 */
.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-faint);
}
.empty-state .es-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px;
  display: grid; place-items: center; font-size: 30px; color: var(--brand);
  background: var(--brand-soft);
}
.empty-state .es-t { font-size: 15px; color: var(--ink-soft); font-weight: 600; }
.empty-state .es-d { font-size: 13px; margin-top: 6px; color: var(--ink-faint); line-height: 1.6; }
.empty-state .es-btn { margin-top: 18px; }

/* ---------- 弹窗 / 旧结构占位（兼容） ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 50; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; width: min(440px, 92vw); box-shadow: var(--shadow-lg); }
.modal-box h3 { margin: 0 0 14px; font-size: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.manual { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbff; }
.manual textarea { margin-top: 8px; background: #fff; }
.row-btns { display: flex; gap: 8px; margin: 8px 0; }

/* ---------- 页脚版本号 ---------- */
.site-footer {
  margin-top: 28px;
  padding: 16px 28px 22px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
.site-footer #ver { color: var(--ink-soft); font-weight: 600; letter-spacing: .2px; }