:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #e3e8ef;
  --text: #1f2733;
  --muted: #6b7785;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --chip: #eef2ff;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Segoe UI, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.btn { background: var(--primary); color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; }
.btn:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: #f8fafc; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn.danger { background: var(--bad); }
.btn.ghost.del { color: var(--bad); border-color: #fca5a5; }
.btn.ghost.del:hover { background: #fef2f2; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg,#1e3a8a,#2563eb); }
.login-card { background: #fff; padding: 36px 32px; border-radius: 14px; width: 340px; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; }
.field textarea { resize: vertical; min-height: 64px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* 布局 */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #0f172a; color: #cbd5e1; padding: 18px 0; flex-shrink: 0; }
.sidebar .brand { color: #fff; font-weight: 700; font-size: 16px; padding: 0 20px 16px; border-bottom: 1px solid #1e293b; margin-bottom: 10px; }
.nav-item { padding: 11px 20px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.nav-item:hover { background: #1e293b; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .badge { margin-left: auto; background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 12px; }
.topbar .title { font-weight: 600; font-size: 16px; }
.topbar .spacer { flex: 1; }
.topbar .me { font-size: 13px; color: var(--muted); }
.content { padding: 20px; overflow: auto; flex: 1; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }

/* 状态芯片 —— 按「负责角色」配色，区分度高 */
.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
/* 待分配：管理员负责 -> 红 */
.chip.pending_assignment { background: #fee2e2; color: #b91c1c; }
/* 待反馈：航线员负责 -> 橙 */
.chip.pending_feedback { background: #ffedd5; color: #c2410c; }
/* 部分反馈：航线员待补充 -> 黄 */
.chip.partial_feedback { background: #fef9c3; color: #854d0e; }
/* 全部反馈：发起者待确认 -> 蓝 */
.chip.all_feedback { background: #dbeafe; color: #1e40af; }
/* 已确认：已完成 -> 绿 */
.chip.completed { background: #dcfce7; color: #166534; }
/* 图例 */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.pending_assignment { background: #dc2626; }
.dot.pending_feedback { background: #ea580c; }
.dot.partial_feedback { background: #ca8a04; }
.dot.all_feedback { background: #2563eb; }
.dot.completed { background: #16a34a; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: #f8fafc; position: sticky; top: 0; }
tr:hover td { background: #fafbff; }
.best { background: #dcfce7 !important; font-weight: 700; }

/* 列表/筛选 */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select, .toolbar input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.search { flex: 1; min-width: 180px; }

/* 统计 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bar { height: 10px; background: #eef2f7; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; background: var(--primary); }

/* 附件 */
.att { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border: 1px solid #c7d2fe; color: #3730a3; padding: 4px 9px; border-radius: 8px; font-size: 12px; margin: 3px 4px 3px 0; }
.att::before { content: "📎"; }

/* modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal h2 { margin: 0 0 16px; font-size: 17px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 99; }
.toast.show { opacity: 1; }

.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.tag { background: var(--chip); color: #3730a3; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.section-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.checkrow { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.checkrow input { margin-top: 3px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb0 { margin-bottom: 0; }
.nowrap { white-space: nowrap; }
.pill { font-size: 11px; background: #e2e8f0; color: #475569; padding: 1px 7px; border-radius: 10px; }
