:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #5b6577;
  --line: #d9e2ec;
  --navy: #0f2540;
  --blue: #2068b8;
  --amber: #b45309;
  --green: #147d4d;
  --red: #b4232c;
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--navy);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 24px 12px;
  position: sticky;
  top: 0;
  z-index: 870;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  min-width: 0;
}
.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 5px;
  object-fit: contain;
  background: #fff;
  flex: none;
}
.fleet-tag {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  color: #e2e8f0;
}
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: #cfd9e8;
  padding: 7px 12px;
  border-radius: 7px;
  font-weight: 600;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
.page { max-width: 1320px; margin: 0 auto; padding: 24px; }
.intro { margin-bottom: 18px; }
.eyebrow {
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 4px;
}
h1 { margin: 0; font-size: 26px; line-height: 1.25; }
h2 { margin: 0; font-size: 18px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 78px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 800; line-height: 1.15; }
.stat-card .stat-label { color: var(--muted); margin-top: 4px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; word-break: break-word; }
.data-table th {
  background: #eef2f7;
  color: #24344d;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ebeff4;
  vertical-align: top;
}
.data-table tbody tr:hover { background: #f7faff; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 520px; }
.step-btn.step-link { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.compliance-ref-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.compliance-ref-links .compliance-link { font-size: 12px; }
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 7px 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.ghost { background: transparent; }
.btn:hover { filter: brightness(0.97); }
.search { width: 260px; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.audit-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.audit-toolbar select { width: auto; max-width: 180px; min-width: 120px; }
.audit-date-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.audit-date { width: auto; min-width: 140px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; font-family: inherit; }
.audit-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.audit-pager-info { font-size: 13px; color: var(--muted); }
.audit-pager-actions { display: flex; gap: 8px; }
.audit-pager-actions .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.attachment-panel-head { margin-bottom: 12px; }
.attachment-panel-head .btn { white-space: nowrap; }
input[type=date], select, textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
}
textarea { resize: vertical; min-height: 52px; }
.progress-track { width: 120px; height: 8px; background: #e3e8ef; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; }
.save-status { margin-top: 12px; padding: 8px 10px; border-radius: 7px; font-weight: 700; }
.save-status.ok { background: #e8f5ee; color: var(--green); }
.save-status.err { background: #fdeceb; color: var(--red); }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.meta-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.meta-box strong { display: block; font-size: 13px; }
.meta-box span { color: var(--muted); font-size: 12px; }
.session-dates {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions .save-status { margin: 0; }
@media (max-width: 900px) {
  .stats-grid, .session-dates, .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .page { padding: 12px; }
  .stats-grid, .session-dates, .meta-grid { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
}

.user-chip { margin-left: auto; padding: 7px 12px; border-radius: 7px; background: rgba(255,255,255,0.14); color: #fff; font-weight: 700; }
.compliance-note { margin-top: 6px; padding: 8px 10px; background: #fff8e6; border-left: 3px solid #b45309; border-radius: 6px; color: #5b3a12; }
.badge { display: inline-block; margin-bottom: 4px; padding: 2px 7px; border-radius: 5px; background: #b45309; color: #fff; font-size: 12px; font-weight: 700; }
@media (max-width: 900px) { .user-chip { margin-left: 0; } }

.event-name-field,
.remark-field {
  min-height: 46px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.event-column { min-width: 420px; }
.remark-column { min-width: 200px; width: 22%; }
.compliance-link { font-weight: 800; }
.attachment-table { min-width: 0; table-layout: fixed; }
.attachment-table .section-row { background: #e8eef7; }
.attachment-table .section-row td { font-weight: 800; color: #24344d; }
.attachment-note { white-space: pre-line; color: #34455e; }

.step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-width: 220px; }
.step { display: inline-flex; align-items: center; justify-content: center; padding: 5px 3px; border-radius: 6px; background: #e8edf4; color: #5b6577; font-size: 11px; font-weight: 800; text-align: center; }
.step.done { background: #147d4d; color: #fff; }
.step-caption { margin-top: 5px; color: #5b6577; font-size: 12px; }
[data-owner-input] { min-width: 160px; }

.owner-multi { position: relative; min-width: 220px; }
.owner-drop-btn { width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-family: inherit; font-size: 13px; }
.owner-menu { position: absolute; z-index: 20; min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(15,37,64,0.14); padding: 8px; }
.owner-menu.is-floating {
  position: fixed;
  z-index: 1190;
  box-shadow: 0 18px 48px rgba(15,37,64,0.22);
}
.owner-menu label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.owner-menu label:hover { background: #f0f5fb; }
.owner-menu-actions { margin-top: 8px; text-align: right; }
.hidden { display: none; }

.log-action { font-weight: 800; color: #2068b8; }

.compliance-multi { position: relative; min-width: 0; }
.compliance-drop-btn { width: 100%; min-width: 0; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-family: inherit; font-size: 13px; line-height: 1.4; white-space: normal; }
.compliance-menu { position: absolute; z-index: 25; min-width: 360px; max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(15,37,64,0.14); padding: 8px; }
.compliance-menu.is-floating {
  position: fixed;
  z-index: 1200;
  min-width: 560px;
  max-width: min(720px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 0 18px 48px rgba(15,37,64,0.22);
}
.compliance-menu.is-floating .compliance-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.compliance-menu.is-floating .compliance-menu-head strong { font-size: 14px; }
.compliance-menu.is-floating .compliance-search { margin: 0; padding: 10px 12px; font-size: 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.compliance-menu.is-floating .compliance-options { flex: 1; overflow: auto; padding: 8px; }
.compliance-menu.is-floating label {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.compliance-menu.is-floating .compliance-option-text { display: block; min-width: 0; }
.compliance-menu.is-floating label:hover { background: #f0f5fb; border-color: #dbeafe; }
.compliance-menu.is-floating .compliance-code { display: block; font-weight: 800; font-size: 13px; min-width: 0; }
.compliance-code.compliance-linked { color: #1d4ed8; }
.compliance-code.compliance-unlinked { color: #b4232c; }
.compliance-option-unlinked .compliance-code,
.compliance-option-unlinked .compliance-label { color: #b4232c !important; font-weight: 600; }
.compliance-option-linked .compliance-code { color: #1d4ed8; }
.compliance-legend-linked { color: #1d4ed8; font-weight: 700; }
.compliance-legend-unlinked { color: #b4232c; font-weight: 700; }
.attachment-table .compliance-na { color: var(--muted); text-align: center; }
.attachment-table .compliance-pending { color: #b4232c; font-weight: 700; text-align: center; }
.attachment-table tr.compliance-row-pending td { color: #b4232c; }
.attachment-table tr.compliance-row-pending .attachment-remark { color: #b4232c; }
.compliance-menu.is-floating .compliance-label { color: var(--muted); font-size: 12px; flex: 1; min-width: 140px; }
.compliance-menu.is-floating .compliance-menu-actions { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.compliance-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1190;
  background: rgba(15, 37, 64, 0.28);
}
.compliance-column { min-width: 280px; width: 22%; }
.session-events-table .event-column { width: 34%; }
.session-events-table td[data-label="符合性"] { overflow: visible; }
.compliance-menu label { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.compliance-menu label:hover { background: #f0f5fb; }
.compliance-menu-actions { margin-top: 8px; text-align: right; }

.progress-edit { min-width: 300px; }
.step-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-width: 340px; }
.step-btn { appearance: none; border: 1px solid var(--line); background: #e8edf4; color: #5b6577; border-radius: 6px; padding: 6px 4px; font-weight: 800; font-size: 11px; cursor: pointer; text-align: center; font-family: inherit; }
.step-btn.done { background: #147d4d; border-color: #147d4d; color: #fff; }
.step-date-picker { margin-top: 6px; }

.session-link { display: inline-block; min-height: 38px; padding: 6px 2px; }
@media (max-width: 760px) {
  #overviewTable, #overviewTable thead, #overviewTable tbody, #overviewTable tr, #overviewTable td { display: block; }
  #overviewTable thead { display: none; }
  #overviewTable tbody { display: block; }
  #overviewTable tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--panel); }
  #overviewTable td { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #eef2f7; }
  #overviewTable td:last-child { border-bottom: 0; }
  #overviewTable td::before { content: attr(data-label); flex: 0 0 72px; font-weight: 800; color: var(--muted); }
  #overviewTable td > div, #overviewTable td > a { flex: 1; min-width: 0; }
  #overviewTable .step-buttons { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  #overviewTable .owner-multi, #overviewTable .progress-edit { min-width: 0; }
  #overviewTable td[data-label="负责人"], #overviewTable td[data-label="审核人"] { overflow: visible; }
  #overviewTable .step-date-picker { width: 100%; }
}

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; z-index: 999; max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 8px; font-weight: 800; box-shadow: 0 10px 30px rgba(15,37,64,0.22); transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #147d4d; color: #fff; }
.toast.error { background: #b4232c; color: #fff; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.65; cursor: wait; }
@media (max-width: 560px) {
  .toast { bottom: 16px; font-size: 13px; }
}

.course-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.course-tab { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--ink); }
.course-tab strong { display: block; font-size: 15px; }
.course-tab span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.course-tab.active { border-color: #2068b8; background: #eaf2fb; }
@media (max-width: 900px) {
  .course-tabs { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .course-tabs { grid-template-columns: 1fr; }
}

.course-total-progress { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.course-total-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.course-total-progress .progress-track { width: 100%; }

.attachment-ffs { width: 100%; min-width: 140px; }
.attachment-e-remark { width: 100%; min-height: 48px; resize: vertical; }

.attachment-table th:first-child, .attachment-table td:first-child { width: 51%; min-width: 0; overflow-wrap: anywhere; }
.attachment-table th:nth-child(2), .attachment-table td:nth-child(2) { width: 26%; min-width: 0; }
.attachment-table th:last-child, .attachment-table td:last-child { width: 23%; min-width: 0; }

.e-matrix-table { min-width: 1100px; table-layout: fixed; }
.e-matrix-table th:first-child, .e-matrix-table td:first-child { width: 24% !important; }
.e-matrix-table th:nth-child(2), .e-matrix-table td:nth-child(2),
.e-matrix-table th:nth-child(3), .e-matrix-table td:nth-child(3),
.e-matrix-table th:nth-child(4), .e-matrix-table td:nth-child(4) { width: 12% !important; }
.e-matrix-table th:nth-child(5), .e-matrix-table td:nth-child(5),
.e-matrix-table th:nth-child(6), .e-matrix-table td:nth-child(6) { width: 10% !important; text-align: center; }
.e-matrix-table th:nth-child(5), .e-matrix-table th:nth-child(6) { font-size: 12px; line-height: 1.3; }
.e-matrix-table th:last-child, .e-matrix-table td:last-child { width: 16% !important; }
.e-clause-id { display: block; font-weight: 800; color: #1e3a5f; margin-bottom: 4px; }
.e-clause-text { display: block; color: #334155; }
.e-window-ok { color: #147d4d; font-weight: 800; }
.e-window-gap { color: #b4232c; font-weight: 800; }
.e-duty-must-h1 { background: #fff7d6; }
.e-duty-must-h2 { background: #e8f0fe; }
.e-duty-ok { background: #e8f6ee; }
.e-duty-na { background: #f8fafc; color: #64748b; }
.attachment-table tr.e-duty-must-h1 td { background: #fff7d6; }
.attachment-table tr.e-duty-must-h2 td { background: #e8f0fe; }
.attachment-table tr.e-duty-ok td { background: #e8f6ee; }
.attachment-table tr.e-duty-na td { background: #f8fafc; }
.e-window-summary { margin-bottom: 16px; }
.e-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.e-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.e-summary-card strong { font-size: 20px; }
.e-summary-card.is-ok { border-color: #86efac; background: #f0fdf4; }
.e-summary-card.is-gap { border-color: #fecaca; background: #fef2f2; }
@media (max-width: 900px) {
  .e-summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .e-summary-cards { grid-template-columns: 1fr; }
}
.e-summary-ledger-missing {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff7d6;
  color: #92400e;
  font-weight: 700;
}
.e-summary-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.e-summary-legend span {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.overview-term-row td {
  background: #e8eef7;
  font-weight: 800;
  color: #24344d;
}
.compliance-option-duty { border-left: 4px solid transparent; }
.compliance-option-duty.e-duty-must-h1 { border-left-color: #d97706; background: #fffbeb; }
.compliance-option-duty.e-duty-must-h2 { border-left-color: #2563eb; background: #eff6ff; }
.compliance-option-duty.e-duty-ok { border-left-color: #16a34a; background: #f0fdf4; }
.e-duty-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.e-duty-must-h1 .e-duty-chip { background: #f59e0b; color: #fff; }
.e-duty-must-h2 .e-duty-chip { background: #2563eb; color: #fff; }
.e-duty-ok .e-duty-chip { background: #16a34a; color: #fff; }
.attachment-table td, .attachment-table th { word-break: break-word; white-space: normal; }
.attachment-table td[data-label="符合性"] { vertical-align: top; overflow-wrap: anywhere; }
.attachment-table .compliance-detail { min-width: 0; max-width: 100%; }
.attachment-table .compliance-item { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: 100%; min-width: 0; box-sizing: border-box; }
.attachment-table .compliance-event-link { flex: 1 1 120px; min-width: 0; max-width: 100%; word-break: break-word; overflow-wrap: anywhere; }
.attachment-table .attachment-remark { width: 100%; max-width: 100%; box-sizing: border-box; min-width: 0; }
@media (max-width: 760px) {
  .e-matrix-table { min-width: 0; }
  .attachment-table, .attachment-table thead, .attachment-table tbody, .attachment-table tr, .attachment-table td { display: block; }
  .attachment-table thead { display: none; }
  .attachment-table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--panel); }
  .attachment-table td { width: 100% !important; display: block; padding: 10px 12px; border-bottom: 1px solid #eef2f7; }
  .attachment-table td:last-child { border-bottom: 0; }
  .attachment-table td::before { content: attr(data-label); display: block; font-weight: 800; color: var(--muted); margin-bottom: 5px; }
}

@media (max-width: 760px) {
  .data-table, .data-table thead, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table thead { display: none; }
  .data-table tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; background: var(--panel); }
  .data-table td { display: block; padding: 10px 12px; border-bottom: 1px solid #eef2f7; }
  .data-table td:last-child { border-bottom: 0; }
  .data-table td::before { content: attr(data-label); display: block; font-weight: 800; color: var(--muted); margin-bottom: 5px; }
  .event-column { min-width: 0; }
}

.ffs-editor { display: grid; gap: 6px; }
.ffs-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ffs-links a { font-weight: 800; }

.drag-cell { cursor: grab; user-select: none; text-align: center; }
.drag-cell:active { cursor: grabbing; }
.drag-handle { font-size: 16px; line-height: 1; }

.compliance-search { width: 100%; margin-bottom: 6px; }
.compliance-menu label { flex-wrap: wrap; }
.compliance-code { font-weight: 800; min-width: 70px; }
.compliance-label { color: var(--muted); font-size: 12px; flex: 1; min-width: 140px; }

.attachment-d-compliance { width: 100%; min-width: 140px; }
.attachment-d-links { display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-d-links a { font-weight: 800; }

.compliance-detail { display: grid; gap: 10px; min-width: 0; max-width: 100%; }
.compliance-item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; line-height: 1.5; padding: 8px 10px; background: #f8fafc; border-radius: 6px; border: 1px solid #e8eef5; min-width: 0; max-width: 100%; box-sizing: border-box; }
.compliance-session { font-weight: 800; font-size: 12px; color: #1d4ed8; white-space: nowrap; padding: 2px 8px; background: #eff6ff; border-radius: 4px; text-decoration: none; }
.compliance-session:hover { background: #dbeafe; }
.compliance-event-link { font-weight: 700; font-size: 13px; color: var(--text); text-decoration: none; flex: 1 1 auto; min-width: 0; max-width: 100%; white-space: normal; word-break: break-word; overflow-wrap: anywhere; line-height: 1.55; }
.compliance-event-link:hover { color: #1d4ed8; text-decoration: underline; }
.compliance-event-link::before { content: "→ "; color: #94a3b8; font-weight: 400; }
.event-row-highlight { animation: eventFlash 2.4s ease; }
@keyframes eventFlash { 0%,100% { background: transparent; } 20%,60% { background: #fef3c7; } }
.attachment-table tr[id],
.data-table tr[id] { scroll-margin-top: 80px; }
.hash-target-highlight td {
  background: #ffe566 !important;
  box-shadow: inset 0 0 0 2px #eab308;
  transition: background 0.35s ease;
}

.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.upload-block { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.upload-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.upload-file-link { font-weight: 800; }
@media (max-width: 900px) { .upload-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .upload-grid { grid-template-columns: 1fr; } }

/* ============ 移动端与触屏交互增强 ============ */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

/* 触屏：禁用双击缩放与点击延迟 */
button, .btn, .nav a, a, input, select, textarea, label, [role="button"] {
  touch-action: manipulation;
}

/* 汉堡菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 返回顶部按钮 */
.back-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,37,64,0.28);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 900;
}
.back-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* 行内操作：仅删除，排序用序号列拖动 */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 移动端导航抽屉 */
@media (max-width: 900px) {
  .topbar { flex-direction: row; flex-wrap: wrap; align-items: center; padding: calc(12px + var(--safe-top)) 16px 12px; }
  .brand { order: 1; flex: 1 1 auto; }
  .nav-toggle { order: 2; display: flex; }
  .nav {
    order: 3;
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 6px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 15px; border-radius: 8px; }
  .nav a.active { background: rgba(255,255,255,0.14); }
  .user-chip { order: 10; margin-left: 0; text-align: center; border-radius: 8px; }
}

/* 触屏/小屏：更大的点击目标，并避免 iOS 输入聚焦缩放 */
@media (max-width: 760px) {
  .btn { min-height: 44px; padding: 10px 14px; font-size: 15px; }
  .btn.ghost { min-height: 44px; }
  .step-btn { min-height: 40px; padding: 8px 4px; font-size: 12px; }
  .owner-drop-btn, .compliance-drop-btn { min-height: 44px; font-size: 15px; padding: 10px 12px; }
  .search { min-height: 44px; }
  input, select, textarea { font-size: 16px !important; }
}

/* 移动端：表格卡片内的下拉菜单静态化，避免超出屏幕 */
@media (max-width: 760px) {
  .data-table .compliance-menu:not(.is-floating) { position: static; min-width: 0; width: 100%; max-height: 280px; box-shadow: none; }
  .compliance-multi, .compliance-drop-btn { min-width: 0; width: 100%; }
  .owner-multi { min-width: 0; }
  .owner-drop-btn { width: 100%; }
  .row-actions .btn { flex: 1 1 auto; }
  .form-actions { width: 100%; }
  .form-actions .btn { flex: 1 1 auto; }
  .panel-head { align-items: stretch; }
  .panel-head .search { flex: 1 1 100%; }
}

/* iOS 底部安全区：提示条与悬浮按钮避让 */
@media (max-width: 560px) {
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .back-top { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
}
/* ==========================================================================
   AC139 现代航空设计系统增强 (Modern Aviation UI 2.0)
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;
  --navy: #0b192c;
  --navy-light: #1e3a8a;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --amber: #d97706;
  --green: #16a34a;
  --red: #dc2626;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 顶栏现代化毛玻璃与层次 */
.topbar {
  background: rgba(11, 25, 44, 0.94) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: calc(14px + var(--safe-top)) 28px 14px !important;
  transition: all 0.2s ease;
}

.brand {
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

img.brand-mark {
  width: 28px !important;
  height: 28px !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: none;
  object-fit: contain;
}

.brand-name {
  font-size: 16px;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.nav {
  gap: 6px;
}

.nav a {
  color: #94a3b8 !important;
  padding: 8px 14px !important;
  border-radius: var(--radius-md) !important;
  font-size: 14px;
  font-weight: 600 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.nav a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
}

.nav a.active {
  background: rgba(37, 99, 235, 0.2) !important;
  color: #60a5fa !important;
  border-color: rgba(96, 165, 250, 0.3);
}

.user-chip {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 6px 14px !important;
  border-radius: 9999px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-chip::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* 页面主容器与头部介绍 */
.page {
  max-width: 1360px !important;
  padding: 32px 28px !important;
}

.intro h1 {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.eyebrow {
  color: #d97706 !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em !important;
}

/* 统计卡片与指标看板 */
.stats-grid {
  gap: 16px !important;
  margin-bottom: 24px !important;
}

.stat-card {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  padding: 18px 20px !important;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1 !important;
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card .stat-value {
  font-size: 32px !important;
  font-weight: 800 !important;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.stat-card .stat-label {
  color: var(--muted) !important;
  font-size: 13px !important;
  font-weight: 500;
  margin-top: 6px !important;
}

/* 面板通用样式 */
.panel {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-xl) !important;
  padding: 22px 24px !important;
  margin-bottom: 24px !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel-head {
  margin-bottom: 18px !important;
  border-bottom: 1px solid var(--line-subtle);
  padding-bottom: 14px;
}

.panel-head h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* 课程标签切换栏 (Course Tabs) */
.course-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.course-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  color: #334155;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.course-tab:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--blue);
  transform: translateY(-1px);
}

.course-tab.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.course-tab.active strong {
  color: #ffffff;
}

/* 课程总体进度卡片 */
.course-total-progress {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.course-total-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
  color: var(--ink);
}

.course-total-head span {
  font-size: 13px;
  color: var(--blue);
  font-weight: 700;
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

/* 现代化数据表格 */
.table-wrap {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xs);
  background: #ffffff;
  overflow: hidden;
}

.data-table {
  border-collapse: separate !important;
  border-spacing: 0;
}

.data-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--line) !important;
}

.data-table td {
  padding: 13px 16px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  font-size: 13.5px;
  color: #334155;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f8fafc !important;
}

.data-table tbody tr:last-child td {
  border-bottom: none !important;
}

/* 按钮通用现代化 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  line-height: 1.4;
  border: 1px solid var(--line) !important;
  background: #ffffff;
  color: #334155;
  box-shadow: var(--shadow-xs);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1 !important;
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  filter: none !important;
}

.btn:active {
  transform: translateY(0) scale(0.98) !important;
}

.btn.primary {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn.amber {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: #b45309 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn.amber:hover {
  background: linear-gradient(180deg, #d97706 0%, #b45309 100%) !important;
}

.btn.ghost {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
}

.btn.ghost:hover {
  background: #f1f5f9 !important;
  color: var(--ink) !important;
}

/* 输入框与表单控件现代化 */
input[type="text"],
input[type="search"],
input[type="date"],
input[type="password"],
select,
textarea {
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius-md) !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  color: var(--ink) !important;
  background: #ffffff !important;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.search {
  padding-left: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 9px center !important;
  background-size: 16px 16px !important;
}

/* 进度条轨道 */
.progress-track {
  background: #e2e8f0 !important;
  border-radius: 9999px !important;
  height: 8px !important;
}

.progress-fill {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%) !important;
  border-radius: 9999px !important;
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}

/* 步骤按钮组合 */
.step-buttons {
  gap: 5px !important;
}

.step-btn {
  border-radius: var(--radius-sm) !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700 !important;
  padding: 6px 6px !important;
  transition: all 0.15s ease;
}

.step-btn:hover {
  border-color: #94a3b8 !important;
  background: #f1f5f9 !important;
}

.step-btn.done {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}

/* 人员选择下拉 */
.owner-drop-btn {
  border-radius: var(--radius-md) !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  padding: 8px 12px !important;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.owner-drop-btn:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}

.owner-menu {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
}

/* 符合性弹窗与多选菜单 */
.compliance-menu.is-floating {
  border-radius: var(--radius-lg) !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
  overflow: hidden;
}

.compliance-menu.is-floating .compliance-menu-head {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 14px 18px !important;
}

.compliance-menu.is-floating .compliance-menu-head strong {
  font-size: 15px !important;
  color: var(--ink);
}

.compliance-code {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* 浮动与Toast提醒 */
.toast {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  letter-spacing: 0.01em;
}

.toast.success {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast.error {
  background: #b91c1c !important;
  color: #ffffff !important;
}

/* 附件说明块 */
.attachment-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  line-height: 1.6;
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 16px;
}

/* 场次链接高亮 */
.session-link strong {
  color: var(--blue);
  font-size: 14.5px;
  transition: color 0.15s ease;
}

.session-link:hover strong {
  color: var(--blue-hover);
  text-decoration: underline;
}

/* 附件D/E表格特定行美化 */
.attachment-table .section-row td {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  padding: 14px 16px !important;
  border-top: 2px solid #e2e8f0;
  border-bottom: 1px solid #cbd5e1 !important;
}

.attachment-remark {
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 8px !important;
  transition: all 0.18s ease;
}

.attachment-remark:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}

.attachment-remark:focus {
  background: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.leader-hint {
  margin: 8px 0 0;
  color: var(--muted);
}
.leader-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.leader-loading {
  grid-column: 1 / -1;
  color: var(--muted);
}
.leader-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 16px;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 37, 64, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.leader-card:hover {
  border-color: #2068b8;
  box-shadow: 0 12px 24px rgba(32, 104, 184, 0.12);
  transform: translateY(-2px);
}
.leader-card:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}
.leader-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.leader-card-head h2 {
  font-size: 22px;
}
.leader-card-head span,
.leader-courses strong {
  color: var(--muted);
  font-size: 13px;
}
.leader-card .progress-track {
  width: 100%;
}
.leader-courses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.leader-courses li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.leader-enter {
  margin-top: auto;
  color: var(--blue);
  font-weight: 800;
}
@media (max-width: 960px) {
  .leader-grid { grid-template-columns: 1fr; }
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 910;
  background: rgba(15, 37, 64, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 16px 24px;
  overflow: auto;
}
.profile-modal.hidden { display: none; }
.profile-modal-card {
  width: min(1100px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px 18px;
  box-shadow: 0 18px 48px rgba(15, 37, 64, 0.22);
  margin-bottom: 24px;
}
.profile-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}
.profile-scene-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.profile-scene-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: inherit;
  color: inherit;
}
.profile-scene-card strong { font-size: 15px; }
.profile-scene-card span,
.profile-scene-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.profile-scene-card:hover { border-color: var(--blue); }
.profile-scene-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.profile-empty {
  color: var(--muted);
  padding: 16px 8px;
  text-align: center;
}
.profile-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #f8fafc;
}
.profile-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.profile-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  flex: 1;
}
.profile-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.profile-event-wrap { background: #fff; margin-bottom: 12px; }
.profile-event-table { min-width: 640px; }
.profile-preview-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.profile-canvas {
  display: block;
  width: 100%;
  height: 420px;
}
.profile-picker-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 64, 0.45);
  z-index: 920;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.profile-picker {
  width: min(640px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(15, 37, 64, 0.2);
}
.profile-picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
  margin: 8px 0 14px;
}
.profile-pick-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}
.profile-pick-row.is-busy { opacity: 0.65; background: #f8fafc; }
.profile-pick-no {
  min-width: 22px;
  color: var(--muted);
  font-weight: 700;
}
.profile-pick-row em {
  margin-left: auto;
  color: var(--amber);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}
.profile-picker-actions { justify-content: flex-end; }
.profile-picker-actions [data-profile-pick-all] { margin-right: auto; }
@media (max-width: 760px) {
  .profile-editor-head { flex-direction: column; }
  .profile-event-table { min-width: 0; }
}

/* 启动遮罩：body[data-boot] 存在期间盖住页面，避免 /api/me 返回前闪现默认机型的静态内容。
   延迟 120ms 淡入——网络快时 JS 先移除属性，用户根本看不到遮罩；
   6s 后自动淡出兜底——JS 异常或请求挂起时不会永久卡住页面。 */
body[data-boot]::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 3000;
  opacity: 0;
  animation: bootVeilIn 0.15s ease 0.12s forwards, bootVeilOut 0.4s ease 6s forwards;
}
body[data-boot]::after {
  content: '正在加载…';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  z-index: 3001;
  opacity: 0;
  animation: bootVeilIn 0.15s ease 0.12s forwards, bootVeilOut 0.4s ease 6s forwards;
}
@keyframes bootVeilIn {
  to { opacity: 1; }
}
@keyframes bootVeilOut {
  to { opacity: 0; visibility: hidden; }
}
