/* ATH2 Harvey Cockpit MVP styles. 极简, 服务端渲染优先. */
:root {
  --fg: #1f2937;
  --muted: #6b7280;
  --bg: #f8fafc;
  --panel: #ffffff;
  --border: #e5e7eb;
  --accent: #2563eb;
  --approve: #16a34a;
  --reject: #dc2626;
  --hold: #6b7280;
  --upgrade: #0891b2;
  --downgrade: #ea580c;
  --warn-low: #fde68a;
  --warn-medium: #fb923c;
  --warn-high: #ef4444;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--fg); font-size: 14px; line-height: 1.5;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; background: #111827; color: white;
}
.topbar .brand { color: white; font-weight: 600; text-decoration: none; }
.topbar nav a { color: #cbd5e1; text-decoration: none; margin-left: 1rem; }
.container { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.panel h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.panel h3 { margin: 1rem 0 0.5rem; font-size: 0.95rem; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.9rem; }
.cards { list-style: none; padding: 0; margin: 0; }
.card {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.75rem 1rem; margin-bottom: 0.5rem; position: relative;
}
.card-acted { background: #f1f5f9; }
.card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.card-head .name { font-weight: 600; color: var(--accent); text-decoration: none; }
.card-head .meta { color: var(--muted); }
.card-head .score {
  margin-left: auto; font-weight: 700; font-size: 1.05rem; color: var(--accent);
}
.family-technical { color: var(--accent); }
.family-business { color: #ca8a04; }
.ap { padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.8rem; font-weight: 500; }
.ap-low { background: var(--warn-low); }
.ap-medium { background: var(--warn-medium); color: white; }
.ap-high { background: var(--warn-high); color: white; }
.reason { margin: 0.5rem 0; color: #374151; }
.actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; align-items: center;
}
.btn {
  border: 1px solid var(--border); background: white; color: var(--fg);
  padding: 0.3rem 0.75rem; border-radius: 4px; cursor: pointer;
  font-size: 0.85rem; text-decoration: none;
}
.btn-approve { background: var(--approve); color: white; border-color: var(--approve); }
.btn-reject { background: var(--reject); color: white; border-color: var(--reject); }
.btn-hold { background: var(--hold); color: white; border-color: var(--hold); }
.btn-upgrade { background: var(--upgrade); color: white; border-color: var(--upgrade); }
.btn-downgrade { background: var(--downgrade); color: white; border-color: var(--downgrade); }
.btn-link { color: var(--accent); }
.acted-tag {
  position: absolute; top: 0.5rem; right: 0.75rem;
  background: #94a3b8; color: white; padding: 0.1rem 0.5rem;
  border-radius: 4px; font-size: 0.75rem;
}
.comment-input {
  flex: 1; min-width: 200px; padding: 0.3rem 0.5rem;
  border: 1px solid var(--border); border-radius: 4px;
}
.action-result { margin-top: 0.75rem; }

table.funnel, table.dims {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
}
table.funnel th, table.funnel td, table.dims th, table.dims td {
  text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border);
}
table.funnel th, table.dims th { background: #f9fafb; }

.proposal-list { list-style: none; padding: 0; margin: 0; }
.proposal {
  padding: 0.6rem 0.8rem; border-left: 3px solid var(--border);
  margin-bottom: 0.5rem; background: #f9fafb;
}
.proposal-A { border-left-color: var(--approve); }
.proposal-B { border-left-color: var(--upgrade); }
.proposal-C { border-left-color: var(--downgrade); }
.proposal .cls { font-weight: 600; margin-right: 0.5rem; }
.proposal .type { color: var(--muted); }
.proposal .target { color: var(--accent); font-family: monospace; font-size: 0.85rem; }
.proposal .rationale { margin: 0.4rem 0 0; color: #374151; }

.modtype { padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.8rem; }
.mod-consistent { background: #d1fae5; color: #065f46; }
.mod-upgrade    { background: #cffafe; color: #155e75; }
.mod-downgrade  { background: #fed7aa; color: #9a3412; }

pre.json {
  background: #f8fafc; border: 1px solid var(--border);
  padding: 0.5rem; border-radius: 4px; overflow: auto; font-size: 0.8rem;
}
.prior-actions { list-style: none; padding: 0; margin: 0; }
.prior-actions li {
  padding: 0.35rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.prior-actions .ts { color: var(--muted); font-family: monospace; }
.footer {
  text-align: center; color: var(--muted);
  font-size: 0.8rem; padding: 1rem; border-top: 1px solid var(--border);
}

.topbar .userinfo { color: #cbd5e1; font-size: 0.85rem; }
.topbar .userinfo small { color: #fbbf24; }
.topbar .userinfo a { color: #cbd5e1; }

.auth-container { max-width: 480px; margin-top: 4rem; }
.auth-container .panel { text-align: center; padding: 2rem 1.5rem; }

/* ---- 移动端响应式 (≤600px) ---- */
@media (max-width: 600px) {
  body { font-size: 13.5px; }
  .topbar { padding: 0.6rem 0.75rem; flex-wrap: wrap; }
  .topbar nav a { margin-left: 0.6rem; }
  .topbar .userinfo { width: 100%; margin-top: 0.4rem; font-size: 0.78rem; }

  .container { margin: 0.75rem auto; padding: 0 0.6rem; }
  .panel { padding: 0.75rem 0.85rem; margin-bottom: 0.85rem; border-radius: 6px; }
  .panel h2 { font-size: 1rem; }

  .card { padding: 0.6rem 0.75rem; }
  .card-head { flex-direction: column; align-items: flex-start; gap: 0.2rem; }
  .card-head .score { margin-left: 0; font-size: 1rem; }
  .acted-tag { top: 0.4rem; right: 0.5rem; font-size: 0.7rem; }

  .actions { gap: 0.35rem; }
  .btn {
    padding: 0.45rem 0.75rem; font-size: 0.9rem; min-height: 36px;
    flex-grow: 1; min-width: 75px; text-align: center;
  }
  .comment-input { width: 100%; flex: 1 1 100%; }

  table.funnel, table.dims { font-size: 0.85rem; display: block; overflow-x: auto; }
  pre.json { font-size: 0.72rem; }

  .proposal { padding: 0.5rem 0.6rem; }
}

/* ---- 钉钉容器内: 隐藏 footer 路径泄漏 ---- */
@media (max-width: 480px) {
  .footer { font-size: 0.7rem; padding: 0.6rem; }
}

/* ---- 唐琴工作台 ---- */
.route {
  padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.78rem;
  font-weight: 500; background: #e0e7ff; color: #3730a3;
}
.route-P0_must_review { background: #fee2e2; color: #991b1b; }
.route-P1_invite      { background: #fef3c7; color: #92400e; }
.route-P2_talent_pool { background: #e0e7ff; color: #3730a3; }
.route-reject         { background: #f1f5f9; color: #475569; }
.route-advance        { background: #d1fae5; color: #065f46; }
.route-hold           { background: #fef3c7; color: #92400e; }

.biz-flags { margin: 0.4rem 0; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.biz-flag {
  background: #fef3c7; color: #92400e; padding: 0.1rem 0.4rem;
  border-radius: 4px; font-size: 0.78rem;
}
.biz-flag.biz-legacy_strong_ai_weak { background: #fee2e2; color: #991b1b; }
.biz-flag.biz-lone_wolf_risk        { background: #fed7aa; color: #9a3412; }
.biz-flag.biz-not_ai_first_ready    { background: #fde68a; color: #92400e; }

.phone { margin: 0.35rem 0; font-size: 0.9rem; }
.phone a { color: var(--accent); text-decoration: none; }

.card-followup { background: #fffbeb; }
.card-pending  { background: #ecfeff; }
.card-feedback { background: #f5f3ff; }

.hidden { display: none; }
.prefilter-form {
  margin-top: 0.6rem; padding: 0.6rem; background: #fef2f2;
  border-radius: 4px; border: 1px solid #fecaca;
}
.prefilter-form form {
  display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center;
}
.prefilter-select {
  padding: 0.3rem 0.5rem; border: 1px solid var(--border);
  border-radius: 4px; min-width: 160px;
}
@media (max-width: 600px) {
  .prefilter-form form { flex-direction: column; align-items: stretch; }
  .prefilter-select, .prefilter-form .comment-input { width: 100%; }
}

/* ---- HR 反馈卡 form ---- */
.feedback-form fieldset {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.75rem 1rem; margin: 0 0 1rem;
}
.feedback-form legend { font-weight: 600; font-size: 0.95rem; padding: 0 0.4rem; }
.radio-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.radio-pill input { display: none; }
.radio-pill .pill {
  display: inline-block; padding: 0.4rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: white; cursor: pointer;
  font-size: 0.85rem;
}
.radio-pill input:checked + .pill { background: var(--accent); color: white; border-color: var(--accent); }
.radio-pill input:checked + .pill.pill-advance        { background: var(--approve); border-color: var(--approve); }
.radio-pill input:checked + .pill.pill-reject         { background: var(--reject);  border-color: var(--reject); }
.radio-pill input:checked + .pill.pill-hold           { background: var(--hold);    border-color: var(--hold); }
.radio-pill input:checked + .pill.pill-ap-confirmed_packaged { background: var(--reject);  border-color: var(--reject); }
.radio-pill input:checked + .pill.pill-ap-verified           { background: var(--approve); border-color: var(--approve); }
.radio-pill input:checked + .pill.pill-ap-unclear            { background: var(--hold);    border-color: var(--hold); }

.dims-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}
.dim-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dim-name { font-size: 0.88rem; color: #374151; }
.dim-select { padding: 0.25rem 0.4rem; border: 1px solid var(--border); border-radius: 4px; }

.factor-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.3rem 1rem;
}
.factor-checkbox { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }

.notes-input {
  width: 100%; padding: 0.5rem; border: 1px solid var(--border);
  border-radius: 4px; font-family: inherit; font-size: 0.9rem;
  resize: vertical;
}

.form-actions { display: flex; gap: 0.5rem; align-items: center; }

.pill-advance, .pill-reject, .pill-hold {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px;
  font-size: 0.85rem; font-weight: 500;
}
.pill-advance { background: var(--approve); color: white; }
.pill-reject  { background: var(--reject);  color: white; }
.pill-hold    { background: var(--hold);    color: white; }

@media (max-width: 600px) {
  .dims-grid, .factor-grid { grid-template-columns: 1fr; }
  .feedback-form fieldset { padding: 0.6rem 0.75rem; }
}
