* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #222; }
.topbar { display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #1f3a5f; color: #fff; }
.topbar .brand { font-weight: 700; font-size: 18px; }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar a { color: #dbe6f5; text-decoration: none; }
.topbar a:hover { color: #fff; }
.pull-form { margin: 0; }
.container { max-width: 1080px; margin: 24px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid #e3e6ea; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.card h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 8px 10px; border-bottom: 1px solid #e8eaed; text-align: left; font-size: 14px; }
th { background: #f0f2f5; }
button, .btn { background: #1f3a5f; color: #fff; border: none; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #2a4f7e; }
.btn-secondary { background: #6b7280; }
input, select, textarea { padding: 6px 8px; border: 1px solid #cbd2d9; border-radius: 6px; font-size: 14px; width: 100%; max-width: 420px; }
textarea { min-height: 90px; }
label { display: block; margin: 10px 0 4px; font-size: 14px; color: #444; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #e8eef7; color: #1f3a5f; }
.tag-pending { background: #fff3cd; color: #856404; }
.tag-confirmed { background: #d4edda; color: #155724; }
.tag-reassigned { background: #d1ecf1; color: #0c5460; }
.tag-skipped { background: #e2e3e5; color: #383d41; }
.muted { color: #888; font-size: 13px; }
.reason { color: #555; font-size: 13px; }
.transcript { white-space: pre-wrap; background: #fafbfc; border: 1px solid #eee; border-radius: 6px; padding: 10px; font-size: 13px; max-height: 320px; overflow: auto; }
.filters { margin: 0 0 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.filters a { padding: 4px 10px; border-radius: 12px; background: #e8eaed; color: #333; text-decoration: none; font-size: 13px; }
.filters a.active { background: #1f3a5f; color: #fff; }
.inline-form { display: inline; }

/* M3：登录页 / 用户芯片 / 模拟视角横幅（响应式大改由后续里程碑统一追加） */
.login-panel { max-width: 360px; margin: 48px auto; }
.error { color: #b91c1c; font-size: 14px; }
.user-chip { color: #e8eef7; font-size: 13px; margin-left: 12px; }
.btn-link { background: transparent; color: #e8eef7; text-decoration: underline; padding: 0 4px; }
.impersonate-banner { background: #b45309; color: #fff; padding: 8px 16px; font-size: 14px; }
.impersonate-banner .inline-form button { background: #fff; color: #b45309; margin-left: 8px; }

/* ============ M3：工作台 / 徽章 / tab / 时间线 / CSS 条形图 ============ */
.wb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wb-head h2 { margin: 8px 0; }
.wb-more { font-size: 13px; font-weight: normal; margin-left: 8px; }
.badge { display: inline-block; background: #b45309; color: #fff; border-radius: 14px; padding: 4px 12px; font-size: 13px; text-decoration: none; }
.badge:hover { background: #92400e; }
.wb-actions { display: flex; gap: 16px; margin: 12px 0 20px; }
.btn-big { flex: 1; display: block; text-align: center; background: #1f3a5f; color: #fff; border-radius: 10px; padding: 22px 12px; font-size: 18px; font-weight: 600; text-decoration: none; }
.btn-big:hover { background: #2a4f7e; }
.wb-refresh { float: right; }
.suggestion { border-top: 1px solid #eef0f2; padding: 8px 0; }
.suggestion p { margin: 4px 0; }
.reject-form input { width: auto; max-width: 240px; }
.reminder { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f2f5; }
.btn-check { background: #d1fae5; color: #065f46; border-radius: 50%; width: 26px; height: 26px; padding: 0; font-weight: 700; }
.btn-check:hover { background: #a7f3d0; }
.pipeline-summary span { margin-right: 4px; }
.user-roles { opacity: .75; font-size: 12px; margin-left: 4px; }

/* 分级徽章 */
.grade-badge { display: inline-block; min-width: 22px; text-align: center; border-radius: 6px; padding: 2px 7px; font-weight: 700; font-size: 13px; color: #fff; }
.grade-S { background: #b45309; }
.grade-A { background: #1f6f43; }
.grade-B { background: #1f3a5f; }
.grade-C { background: #6b7280; }

/* 提示横幅（预处理失败 / 表单错误） */
.banner-warn { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* tab 页 */
.tabs { display: flex; gap: 8px; margin: 8px 0 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 16px; background: #e8eaed; color: #333; text-decoration: none; font-size: 14px; }
.tabs a.active { background: #1f3a5f; color: #fff; }

/* 时间线 */
.timeline-item { border-left: 3px solid #dbe3ee; padding: 4px 0 4px 14px; margin-bottom: 12px; }
.timeline-item p { margin: 4px 0; }

/* 纯 CSS 条形图（仪表盘） */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.bar-label { width: 72px; font-size: 13px; color: #444; flex: none; }
.bar-track { flex: 1; background: #eef0f2; border-radius: 4px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #1f3a5f; border-radius: 4px; }
.bar-value { width: 48px; text-align: right; font-size: 13px; flex: none; }

/* 行内表单组（详情页操作区 / admin） */
.inline-fields { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.inline-fields input, .inline-fields select { width: auto; max-width: 240px; }
.status-form { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.status-form select { width: auto; }
.status-form label { margin: 0; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-head h2 { margin: 0; }
.btn-small { padding: 3px 10px; font-size: 13px; }
.input-inline { width: 140px; display: inline-block; }
.role-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.role-check { display: inline-flex; align-items: center; gap: 3px; margin: 0; font-size: 13px; }
.role-check input { width: auto; }
.radio-group label.radio { display: block; margin: 4px 0; }
.radio-group input[type=radio] { width: auto; }
.line-status { font-size: 13px; padding: 2px 8px; border-radius: 10px; background: #e8eaed; }
.line-进行中 { background: #dbeafe; color: #1d4ed8; }
.line-完成 { background: #d4edda; color: #155724; }
.filter-form select { width: auto; }
.confirm-alt { border-top: 1px solid #eef0f2; margin-top: 12px; padding-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ M3：响应式（≤480px，微信内打开可用） ============ */
@media (max-width: 480px) {
  /* topbar 纵向堆叠 */
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .topbar nav { flex-wrap: wrap; gap: 12px; }
  .container { margin: 12px auto; padding: 0 10px; }
  /* 大按钮通栏 */
  .wb-actions { flex-direction: column; gap: 10px; }
  .btn-big { width: 100%; padding: 18px 12px; font-size: 17px; }
  /* 工作台格子单列 */
  .dash-grid { grid-template-columns: 1fr; }
  /* 表格转卡片：表头隐藏，行/单元格块级 */
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  tr { border: 1px solid #e3e6ea; border-radius: 8px; margin-bottom: 10px; padding: 8px 10px; }
  th, td { border-bottom: none; padding: 4px 0; }
  .card table tr { border: none; border-bottom: 1px solid #eef0f2; border-radius: 0; margin-bottom: 0; padding: 6px 0; }
  /* 表单控件 100% 宽 */
  input, select, textarea { width: 100%; max-width: 100%; }
  .inline-fields input, .inline-fields select, .status-form select,
  .filter-form select, .input-inline, .reject-form input { width: 100%; max-width: 100%; }
  .inline-fields, .status-form { flex-direction: column; align-items: stretch; }
  .bar-label { width: 60px; }
}
