:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-soft: #f8faff;
  --text: #17233a;
  --muted: #6f7f99;
  --line: #dce5f2;
  --primary: #2457d6;
  --primary-strong: #1b46b1;
  --ok: #13795b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background:
    radial-gradient(1000px 350px at 100% -20%, rgba(36, 87, 214, 0.16), transparent 60%),
    var(--bg);
  color: var(--text);
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: rgba(20, 44, 104, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: 0 2px 16px rgba(8, 24, 64, 0.2);
}

h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}

h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

header a {
  color: #dce7ff !important;
  text-decoration: none;
  font-weight: 600;
}

header a:hover {
  color: #fff !important;
}

main {
  max-width: 1200px;
  margin: 18px auto 26px;
  padding: 0 14px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

section {
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #e6edf8;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(18, 39, 85, 0.08);
}

form {
  display: grid;
  gap: 10px;
}

input,
button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

input {
  background: #fff;
}

input:focus {
  border-color: #89a8f5;
  box-shadow: 0 0 0 3px rgba(36, 87, 214, 0.12);
}

button {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(27, 70, 177, 0.35);
}

button:active {
  transform: translateY(0);
}

#privacyBtn {
  padding: 8px 12px;
}

.card {
  background: var(--panel);
  border: 1px solid #e1eaf7;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 3px 8px rgba(20, 50, 110, 0.06);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.toolbar input {
  min-width: 170px;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.column {
  background: var(--panel-soft);
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  min-height: 240px;
  padding: 8px;
}

.column h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #3a517e;
}

.draggable {
  cursor: grab;
}

.draggable:active {
  cursor: grabbing;
}

.drop-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px rgba(36, 87, 214, 0.1);
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}

.suggest-toolbar .field-inline input {
  min-width: 0;
}

.suggest-results {
  margin-top: 12px;
  overflow-x: auto;
}

.suggest-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.suggest-results th,
.suggest-results td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.suggest-results th {
  background: var(--panel-soft);
}

.card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 12px;
  padding: 6px 10px;
}

button.btn-secondary:hover {
  background: var(--panel-soft);
  box-shadow: 0 4px 12px rgba(27, 70, 177, 0.15);
}

button.btn-danger {
  background: #fff;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.55);
  font-size: 12px;
  padding: 6px 10px;
}

button.btn-danger:hover {
  background: rgba(180, 35, 24, 0.06);
  box-shadow: 0 4px 12px rgba(180, 35, 24, 0.12);
}

.legend {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.legend.pre {
  border-color: rgba(112, 61, 219, 0.35);
  color: #4b2aa7;
}
.legend.flight {
  border-color: rgba(36, 87, 214, 0.35);
  color: #1b46b1;
}
.legend.post {
  border-color: rgba(19, 121, 91, 0.35);
  color: #0f6149;
}

.console-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.console-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.time-cell {
  margin-top: 10px;
}

.time-bars {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.time-bars .bar {
  min-width: 6px;
}

.time-bars .bar.pre {
  background: linear-gradient(180deg, rgba(112, 61, 219, 0.9), rgba(112, 61, 219, 0.65));
}
.time-bars .bar.flight {
  background: linear-gradient(180deg, rgba(36, 87, 214, 0.95), rgba(36, 87, 214, 0.65));
}
.time-bars .bar.post {
  background: linear-gradient(180deg, rgba(19, 121, 91, 0.95), rgba(19, 121, 91, 0.65));
}

.time-badges {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.badge.pre {
  border-color: rgba(112, 61, 219, 0.35);
  color: #4b2aa7;
}
.badge.flight {
  border-color: rgba(36, 87, 214, 0.35);
  color: #1b46b1;
}
.badge.post {
  border-color: rgba(19, 121, 91, 0.35);
  color: #0f6149;
}

@media (max-width: 768px) {
  header {
    padding: 12px 14px;
  }

  h1 {
    font-size: 17px;
  }

  main {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 10px;
  }

  .toolbar input {
    min-width: 140px;
  }
}

/* —— 飞行员执勤签派视图（航司客户端风格） —— */
.crew-app-body {
  margin: 0;
  background: #1a0b0e;
  color: #e8eef7;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  min-height: 100%;
}

.crew-app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, #b4001a 0%, #6f0a18 22%, #f6f7fb 22%, #f6f7fb 100%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.crew-hero {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 14px;
  background: linear-gradient(145deg, #b4001a 0%, #8b1020 55%, #5a0d18 100%);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 第一行：应用标题 + 今日 + 隐私 */
.crew-hero-line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.crew-hero-line1 .crew-brand {
  flex: 1 1 auto;
  min-width: 0;
}

.crew-hero-line1-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.crew-hero-line1-trail .crew-privacy {
  align-self: center;
}

/* 第二行：飞行员身份卡独占一行 */
.crew-hero-line2 {
  width: 100%;
}

.crew-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crew-brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #ffe4e8 100%);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.crew-mark-chart {
  width: 30px;
  height: 30px;
  display: block;
}

.crew-brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.crew-brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  line-height: 1.25;
}

.crew-brand-sub {
  font-size: 9px;
  color: rgba(200, 220, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.crew-privacy {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.crew-privacy:active {
  opacity: 0.85;
}

.crew-id-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.crew-hero .crew-id-card {
  margin-bottom: 0;
}

.crew-id-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.crew-id-gap {
  flex-shrink: 0;
  color: rgba(148, 163, 184, 0.4);
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.crew-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.crew-id-inline .crew-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-rank-pill {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.25);
  color: #f5e6a8;
  border: 1px solid rgba(201, 162, 39, 0.45);
  flex-shrink: 0;
}

.crew-id-inline .crew-id-line--file,
.crew-id-inline .crew-id-line--base {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(203, 213, 225, 0.92);
}

.crew-id-line--file strong {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.crew-id-inline .crew-id-line--base {
  color: rgba(203, 213, 225, 0.82);
}

.crew-today-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 0;
  margin-top: 0;
  min-width: 0;
}

.crew-today-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding-top: 0;
}

.crew-today-values {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.crew-today-date {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.crew-today-weekday {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.78);
}

.crew-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 0;
  margin-top: -6px;
  position: relative;
  z-index: 1;
}

.crew-tab {
  flex: 1;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.crew-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.crew-main {
  padding: 12px 12px 8px;
  animation: crewFadeUp 0.4s ease both;
}

.crew-panel {
  display: none;
}

.crew-panel.is-visible {
  display: block;
}

.crew-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.crew-section-label--spaced {
  margin-top: 20px;
}

.crew-install-hint {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #78350f;
}

.crew-install-hint-title {
  font-weight: 700;
  font-size: 13px;
}

.crew-install-hint-text {
  font-size: 12px;
  opacity: 0.9;
  line-height: 1.45;
}

.crew-today-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crew-trip-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.crew-trip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.crew-fn {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.crew-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.crew-chip--flight {
  background: #ffe4e8;
  color: #9f1239;
}

.crew-chip--standby {
  background: #fef3c7;
  color: #92400e;
}

.crew-chip--chg {
  background: #fee2e2;
  color: #b91c1c;
}

.crew-chip--rest {
  background: #e2e8f0;
  color: #475569;
}

.crew-trip-body {
  padding: 14px;
  color: #334155;
}

.crew-route-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.crew-ap {
  min-width: 3rem;
  text-align: center;
}

.crew-route-arrow {
  flex: 0 0 40px;
  height: 2px;
  background: linear-gradient(90deg, #94a3b8, #1e3a5f);
  border-radius: 2px;
  position: relative;
}

.crew-route-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #1e3a5f;
}

.crew-ac-line,
.crew-prep-line,
.crew-standby-line {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}

.crew-trip-times {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  margin-top: 6px;
}

.crew-trip-foot {
  display: flex;
  align-items: stretch;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

.crew-time-block {
  flex: 1;
  padding: 12px;
  text-align: center;
}

.crew-time-lab {
  display: block;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.crew-time-val {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.crew-time-sep {
  width: 1px;
  background: #e2e8f0;
  align-self: stretch;
}

.crew-empty-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 20px;
  text-align: center;
  border: 1px dashed #cbd5e1;
  color: #475569;
}

.crew-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.crew-empty-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.crew-week-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crew-day-details {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  background: #fff;
  overflow: hidden;
}

.crew-day-details > summary.crew-day-row {
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.crew-day-details > summary.crew-day-row::-webkit-details-marker {
  display: none;
}

.crew-day-details > summary.crew-day-row::marker {
  content: "";
}

.crew-day-details > summary.crew-day-row:active {
  background: rgba(241, 245, 249, 0.85);
}

.crew-day-detail-panel {
  padding: 10px 12px 14px;
  background: #eef2f7;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.crew-day-detail-panel .crew-today-stack {
  gap: 10px;
}

.crew-day-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: center;
  background: #fff;
  border-radius: 0;
  padding: 12px;
  border: none;
  box-shadow: none;
}

.crew-day-row--off {
  opacity: 0.92;
}

.crew-day-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crew-day-md {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.crew-day-wd {
  font-size: 11px;
  color: #64748b;
}

.crew-day-mid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.crew-day-mid .crew-chip {
  align-self: flex-start;
}

.crew-day-route {
  font-size: 13px;
  color: #334155;
  line-height: 1.35;
}

.crew-day-fn {
  font-size: 11px;
}

.crew-day-right {
  font-size: 11px;
  text-align: right;
  max-width: 72px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  justify-content: center;
}

.crew-day-expand-icon {
  display: block;
  width: 6px;
  height: 6px;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-1px) rotate(45deg);
  transition: transform 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}

.crew-day-details[open] > summary .crew-day-expand-icon {
  transform: translateY(2px) rotate(-135deg);
  border-right-color: #64748b;
  border-bottom-color: #64748b;
}

.crew-hours-board {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.crew-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.crew-hours-row:last-of-type {
  border-bottom: none;
}

.crew-hours-label {
  font-size: 14px;
  color: #475569;
}

.crew-hours-val {
  font-size: 22px;
  font-weight: 700;
  color: #0f2137;
  font-variant-numeric: tabular-nums;
}

.crew-hours-val small {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.crew-hours-note {
  margin-top: 12px;
  font-size: 11px;
}

.crew-list-row {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.crew-list-main {
  font-size: 14px;
  color: #0f172a;
}

.crew-list-sub {
  margin-top: 4px;
  font-size: 12px;
}

.crew-alert-row {
  display: flex;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 4px solid #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}

.crew-alert-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #dc2626;
  background: #fef2f2;
  padding: 4px 8px;
  border-radius: 6px;
  height: fit-content;
}

.crew-alert-title {
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 4px;
}

.crew-muted-block {
  font-size: 13px;
  color: #64748b;
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px dashed #cbd5e1;
}

.crew-bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #e2e8f0;
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
}

.crew-bottom-nav a {
  text-decoration: none;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-radius: 10px;
  transition: background 0.2s, color 0.2s;
}

.crew-bottom-nav a.is-active {
  color: #0f2137;
  background: #e8edf5;
}

.crew-nav-ic {
  font-size: 15px;
  opacity: 0.85;
}

@keyframes crewFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====== 排班管理 · 时间轴网格周视图 ====== */

/* 容器：时间轴列 + 7 天列 */
.tg-container {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  gap: 0;
  overflow-x: auto;
  border: 1px solid #dbe5f4;
  background: #fff;
}

/* 时间轴 */
.tg-time-axis {
  position: relative;
  border-right: 1px solid #e6edf8;
}
.tg-time-head {
  background: #f1f5fb !important;
  border-bottom: 1px solid #e6edf8;
  min-height: 52px;
}
.tg-time-track {
  position: relative;
}
.tg-hour-label {
  position: absolute;
  left: 0;
  width: 100%;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-align: center;
  transform: translateY(-7px);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.tg-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px solid #e6edf8;
  pointer-events: none;
  z-index: 0;
}
.tg-half-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed #f0f2f8;
  pointer-events: none;
  z-index: 0;
}

/* 天列 */
.tg-day-col {
  border-left: 1px solid #e6edf8;
  display: flex;
  flex-direction: column;
  min-width: 110px;
}
.tg-day-col.tg-day-today {
  background: rgba(36, 87, 214, 0.03);
}
.tg-day-col.tg-day-today .tg-day-head {
  background: linear-gradient(180deg, #edf2ff 0%, #f0f5ff 100%);
  border-bottom-color: #b8cdf5;
}

.tg-day-head {
  padding: 8px 6px;
  text-align: center;
  background: #f8faff;
  border-bottom: 1px solid #e6edf8;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: sticky;
  top: 0;
  z-index: 2;
}
.tg-day-name {
  font-size: 12px;
  font-weight: 700;
  color: #3a517e;
}
.tg-day-date {
  font-size: 11px;
  color: #64748b;
}
.tg-day-count {
  font-size: 10px;
  color: var(--primary);
  font-weight: 600;
}

/* 网格区域 */
.tg-day-grid {
  position: relative;
  flex: 1;
  overflow: visible;
}

/* 航班块 */
.tg-block {
  position: absolute;
  left: 3px;
  right: 3px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(20, 50, 110, 0.08);
  cursor: default;
  z-index: 1;
  transition: box-shadow 0.15s;
  border: 1px solid rgba(180, 195, 220, 0.4);
}
.tg-block:hover {
  box-shadow: 0 2px 10px rgba(20, 50, 110, 0.18);
  z-index: 3;
}

/* 三段色块 */
.tg-seg {
  position: relative;
  min-height: 3px;
  overflow: visible;
}

/* 航前（淡藕荷） */
.tg-seg-pre { background: #ede9fe; }
/* 飞行（淡天蓝） */
.tg-seg-fly { background: #dbeafe; }
/* 航后（淡薄荷） */
.tg-seg-post { background: #d1fae5; }

/* 时间标签 — 溢出到块外部，不会被遮挡 */
.tg-time-badge {
  position: absolute;
  font-size: 8.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0 2px;
  line-height: 13px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.tg-time-top {
  top: -13px;
  left: 0;
  color: #7c3aed;
}
.tg-time-bot {
  bottom: -13px;
  right: 0;
  color: #047857;
}

/* 信息浮层 */
.tg-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
  padding: 2px 4px;
}
.tg-info-fn {
  font-size: 11px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.2;
  letter-spacing: 0.3px;
  background: rgba(255,255,255,0.5);
  padding: 0 4px;
  white-space: nowrap;
}
.tg-info-route {
  font-size: 9.5px;
  color: #475569;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}
.tg-info-dur {
  font-size: 8.5px;
  color: #64748b;
  line-height: 1;
  white-space: nowrap;
}

/* 紧凑模式 */
.tg-info-compact {
  flex-direction: row;
  gap: 4px;
}
.tg-info-compact .tg-info-fn { font-size: 10px; }
.tg-info-compact .tg-info-route { font-size: 8.5px; }

/* 操作按钮（悬浮显示） */
.tg-block-actions {
  position: absolute;
  top: 2px;
  right: 2px;
  display: none;
  gap: 2px;
  z-index: 4;
}
.tg-block:hover .tg-block-actions {
  display: flex;
}
.tg-btn {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.4);
  font-size: 10px;
  padding: 1px 5px;
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  line-height: 1.4;
}
.tg-btn:hover {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
  transform: none;
}
.tg-btn-del {
  color: #dc2626;
  border-color: rgba(220,38,38,0.3);
}

/* 添加按钮 */
.sched-add-btn {
  display: block;
  width: calc(100% - 8px);
  margin: 4px 4px 6px;
  padding: 5px 6px;
  border: 1px dashed var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.sched-add-btn:hover {
  background: rgba(36, 87, 214, 0.06);
  transform: none;
  box-shadow: none;
}

/* 图例 */
.tg-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 0;
  margin: 0;
}
.tg-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #475569;
}
.tg-legend-dot {
  width: 12px;
  height: 12px;
}
.tg-legend-dot.pre  { background: #ddd6fe; border: 1px solid #c4b5fd; }
.tg-legend-dot.fly  { background: #bfdbfe; border: 1px solid #93c5fd; }
.tg-legend-dot.post { background: #a7f3d0; border: 1px solid #6ee7b7; }

/* 弹窗 */
.sched-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  animation: schedFadeIn 0.2s ease;
}
@keyframes schedFadeIn { from{opacity:0} to{opacity:1} }
.sched-modal {
  background: #fff; border-radius: 18px;
  width: min(720px, 94vw); max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.25);
}
.sched-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
}
.sched-modal-header h3 { margin: 0; font-size: 16px; }
.sched-modal-close {
  background: none; border: none; font-size: 22px; color: #64748b;
  cursor: pointer; padding: 4px 8px; border-radius: 8px; line-height: 1;
}
.sched-modal-close:hover { background: #f1f5f9; color: #0f172a; box-shadow: none; transform: none; }
.sched-modal-body { padding: 16px 20px 20px; overflow-y: auto; flex: 1; }
.sched-modal-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sched-modal-body select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff;
}

/* 航班池表格 */
.sched-flight-pool { max-height: 420px; overflow-y: auto; }
.sched-pool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sched-pool-table th, .sched-pool-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.sched-pool-table th { background: var(--panel-soft); position: sticky; top: 0; z-index: 1; }
.sched-pool-table tr:hover { background: rgba(36, 87, 214, 0.03); }
.sched-pool-added { opacity: 0.5; }
.sched-pool-added td { background: #f8fafc; }

/* 智能推荐 */
.sched-ctx-info {
  background: linear-gradient(135deg, #eef4ff 0%, #f0f7ff 100%);
  border: 1px solid #c7d9f5; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #334155; line-height: 1.6;
}
.sched-ctx-warn {
  background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px;
  padding: 10px 14px; font-size: 13px; color: #92400e; font-weight: 600;
}
.sched-ctx-tag {
  display: inline-block; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-right: 6px;
}
.sched-tag-base {
  display: inline-block; background: #dcfce7; color: #166534;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}
.sched-tag-good {
  display: inline-block; background: #e0f2fe; color: #0369a1;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
}
.sched-suggest-top td { background: rgba(36, 87, 214, 0.04); }
.sched-suggest-top td:first-child { border-left: 3px solid var(--primary); }

/* 手动搜索折叠 */
.sched-manual-details { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.sched-manual-summary {
  padding: 10px 14px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: #64748b; background: #f8fafc; list-style: none; display: flex; align-items: center; gap: 6px;
}
.sched-manual-summary::-webkit-details-marker { display: none; }
.sched-manual-summary::before { content: "▶"; font-size: 9px; transition: transform 0.2s; }
.sched-manual-details[open] > .sched-manual-summary::before { transform: rotate(90deg); }
.sched-manual-details > div { padding: 0 14px 14px; }

/* 响应式 */
@media (max-width: 768px) {
  .tg-container { grid-template-columns: 40px repeat(7, 1fr); }
  .tg-day-col { min-width: 80px; }
  .tg-hour-label { font-size: 9px; }
  .sched-modal { width: 98vw; max-height: 90vh; }
}
