/* 试点页补充样式：只放 tokens.css 里没有的布局，颜色和字号一律用变量和已有类。 */

/* hidden 属性要压过所有 display，抽屉和主界面都是 flex/grid 布局 */
[hidden] { display: none !important; }

/* ---------- 登录卡放在画布中间 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 420px; }
.login-brand { padding-bottom: 24px; text-align: center; }
.login-brand .brand-name { font: 700 18px/1.2 var(--font-ui); letter-spacing: -.5px; color: var(--charcoal); }
.login-brand .brand-org { font: 600 16px/1.4 var(--font-ui); color: var(--primary); margin-top: 4px; }
.login-brand .brand-sub { margin-top: 4px; }
.login-error { text-align: left; white-space: normal; border-radius: var(--radius-md); }
#login-form-box summary { cursor: pointer; padding: 8px 0; }
#login-form-box summary:hover { color: var(--charcoal); }

/* ---------- 顶栏 ---------- */
/* 收件箱的未读数：小圆点挂在按钮字后面 */
.inbox-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px;
  border-radius: 999px; background: var(--error); color: var(--on-primary);
  letter-spacing: 0; vertical-align: 1px;
}

/* ---------- 列表：窄屏改用卡片 ---------- */
@media (max-width: 899px) { #table-wrap { display: none; } }
@media (min-width: 900px) { #pilot-cards { display: none; } }
#pilot-table tbody tr[data-cycle-id] { cursor: pointer; }
#pilot-table tbody tr[data-cycle-id]:focus-visible td { background: var(--primary-subtle); }
#pilot-table tbody tr[data-cycle-id]:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--primary); }

/* ---------- 抽屉：电脑上从右边滑出来，手机上从底部升起来 ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: var(--charcoal); opacity: .4; }
.drawer {
  position: fixed; z-index: 30; top: 0; right: 0; height: 100vh; width: min(480px, 100vw);
  background: var(--surface); border-left: 1px solid var(--hairline); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out);
}
.drawer.is-open { transform: translateX(0); }
.drawer-chat { z-index: 40; }
@media (max-width: 640px) {
  .drawer {
    top: auto; bottom: 0; left: 0; width: 100vw; height: 92vh;
    border-left: 0; border-top: 1px solid var(--hairline);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
  }
  .drawer.is-open { transform: translateY(0); }
}
.drawer-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline-soft); flex-shrink: 0;
}
.drawer-body { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.drawer-foot { border-top: 1px solid var(--hairline-soft); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.drawer .input, .drawer .select, .drawer .textarea { font-size: 16px; } /* 手机上聚焦不放大页面 */

/* 抽屉有新进展时的提示条：塞在抽屉头前面 */
.stale-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--yellow); color: var(--yellow-ink); border-radius: var(--radius-md); padding: 8px 12px;
  margin: 12px 16px 0;
}

/* ---------- 抽屉里的事实格子 ---------- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.facts .stat .v.warning-text { color: var(--warning); }
.facts .stat-wide { grid-column: 1 / -1; }

/* ---------- 为什么提醒我 ---------- */
.why { background: var(--yellow); color: var(--yellow-ink); border-radius: var(--radius-md); padding: 12px 16px; }
.why b { display: block; margin-bottom: 6px; }
.why ul { margin: 0; padding-left: 18px; }
.why li { margin: 2px 0; }
.why li + li { margin-top: 6px; }
.why.calm { background: var(--surface-sunk); color: var(--slate); }

/* ---------- 动作表单 ---------- */
.action-block { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--hairline-soft); padding-top: 16px; }
.action-block:first-child { border-top: 0; padding-top: 0; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-row .field { flex: 1 1 140px; }
.action-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border-top: 1px solid var(--hairline-soft); padding-top: 12px; }
.action-links .link { padding: 6px 4px; } /* 点击区域往上下撑一点，手指点得到 */

/* ---------- 收件箱 ---------- */
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--hairline-soft); }
.notice:last-child { border-bottom: none; }
.notice-main { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.notice-main:hover .notice-title { color: var(--primary); }
.notice-title { font: 500 14px/1.6 var(--font-ui); color: var(--ink); overflow-wrap: anywhere; }
.notice-time { font: 400 12px/1.6 var(--font-ui); color: var(--stone); margin-top: 2px; }
.notice-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.notice.read .notice-dot { background: var(--muted); }
.notice .btn { flex-shrink: 0; }

/* ---------- 问 AI ---------- */
.chat-log { display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-lg); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: var(--on-primary); }
.chat-msg.ai { align-self: flex-start; background: var(--surface-sunk); color: var(--ink); }
.chat-msg-mode { display: block; margin-top: 6px; font: 400 12px/1.5 var(--font-ui); color: var(--stone); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip {
  appearance: none; border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--slate);
  border-radius: var(--radius-lg); padding: 4px 12px; cursor: pointer;
  font: 500 13px/1.5 var(--font-ui); text-align: left;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.chat-chip:hover { background: var(--primary-subtle); border-color: var(--primary); color: var(--primary); }
.chat-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.chat-chip:disabled { color: var(--stone); cursor: not-allowed; background: var(--surface-sunk); border-color: var(--hairline); }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1 1 auto; min-width: 0; }
