/* 乘务组协同页 — 独立暗色主题，手机竖屏 / iPad mini 竖屏两用。
   视觉与主站保持一致（色板、卡片、时间轴条带、统计卡），不引主站 styles.css，
   避免主站改版牵连协同页。 */

:root {
  color-scheme: dark;
  --bg: #070b11;
  --line: #24313f;
  --ink: #e9eff7;
  --muted: #8ea3ba;
  --accent: #34d399;
  --accent-2: #fbbf24;
  --danger: #fb7185;
  --info: #60a5fa;
  --on-accent: #05140f;
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .035);
  --glass-3: rgba(255, 255, 255, .085);
  --hair: rgba(255, 255, 255, .10);
  --hair-2: rgba(255, 255, 255, .06);
  --sheen: rgba(255, 255, 255, .10);
  --shadow: 0 20px 42px -24px rgba(0, 0, 0, .9), 0 2px 10px -6px rgba(0, 0, 0, .7);
  --mesh-a: rgba(52, 211, 153, .16);
  --mesh-b: rgba(96, 165, 250, .15);
  --mesh-c: rgba(167, 139, 250, .13);
  --fs: 17px;
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: var(--fs)/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: -.01em;
  padding-bottom: calc(env(safe-area-inset-bottom) + 26px);
}
body::before {
  content: "";
  position: fixed; inset: -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 34% at 12% 4%, var(--mesh-a), transparent 62%),
    radial-gradient(38% 30% at 92% 0%, var(--mesh-b), transparent 62%),
    radial-gradient(46% 38% at 78% 78%, var(--mesh-c), transparent 64%);
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: calc(var(--fs) * 1.0); }
p { margin: 6px 0; }
b { font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: calc(var(--fs) * .82); }
.empty { color: var(--muted); text-align: center; padding: 22px 0; font-size: calc(var(--fs) * .88); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  background: rgba(9, 14, 21, .78);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid var(--hair-2);
  box-shadow: 0 12px 30px -24px rgba(0, 0, 0, .9), inset 0 1px 0 var(--sheen);
}
.brand { min-width: 0; }
.brand h1 { font-size: calc(var(--fs) * 1.05); }
.brand p { margin: 1px 0 0; font-size: calc(var(--fs) * .72); color: var(--muted); letter-spacing: 0; }
.topbar-actions { display: flex; gap: 8px; align-items: center; flex: none; }

main { padding: 14px 14px 0; max-width: 760px; margin: 0 auto; }

/* ---------- 卡片 / 胶囊 / 按钮 ---------- */
.card {
  position: relative;
  background: var(--glass);
  background-image: linear-gradient(158deg, var(--glass-3), var(--glass-2) 42%, var(--glass));
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 var(--sheen);
}
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, var(--sheen), transparent 34%);
  opacity: .45; pointer-events: none;
}
.card > * { position: relative; z-index: 1; }

.chip {
  background-image: linear-gradient(180deg, var(--glass-3), var(--glass-2));
  background-color: var(--glass-2);
  border: 1px solid var(--hair-2); border-radius: 999px;
  padding: 4px 11px; font-size: calc(var(--fs) * .78); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--sheen);
}
button.chip { font: inherit; font-size: calc(var(--fs) * .78); cursor: pointer; }
button.chip.on {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .3), transparent);
  background-color: var(--accent); color: var(--on-accent);
  border-color: transparent; font-weight: 650;
  box-shadow: 0 8px 26px -12px rgba(52, 211, 153, .55);
}
button.chip.off { color: var(--muted); }
/* 总飞行时间：常用项，主题色高亮 */
.chip.hl {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent);
  background-color: color-mix(in srgb, var(--accent) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--accent); font-weight: 650;
}

/* ---------- 提醒横幅 ---------- */
.remind {
  position: fixed; left: 12px; right: 12px;
  top: calc(env(safe-area-inset-top) + 62px); z-index: 30;
  max-width: 736px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  border: 1px solid var(--hair);
  font-size: calc(var(--fs) * .9);
  animation: remind-in .24s cubic-bezier(.2, .9, .3, 1);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .95);
}
/* display:flex 会盖掉 [hidden]，关闭按钮与自动隐藏都会失效，必须显式压回 */
.remind[hidden] { display: none; }
.remind.g-moderate { background: rgba(221, 107, 32, .22); border-color: rgba(221, 107, 32, .55); }
.remind.g-severe { background: rgba(229, 62, 62, .24); border-color: rgba(229, 62, 62, .6); }
.remind.g-light { background: rgba(201, 162, 39, .20); border-color: rgba(201, 162, 39, .5); }
.remind .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.remind.g-light .dot { background: #c9a227; }
.remind.g-moderate .dot { background: #dd6b20; }
.remind.g-severe .dot { background: #e53e3e; }
.remind .msg { flex: 1; min-width: 0; }
.remind .close {
  flex: none; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: calc(var(--fs) * 1.1); padding: 0 4px; cursor: pointer;
}
@keyframes remind-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- 微信内提示条 ---------- */
.wxbar {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 11px 13px; margin-bottom: 14px; border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, .45);
  background: rgba(96, 165, 250, .13);
  font-size: calc(var(--fs) * .84); line-height: 1.5;
  animation: remind-in .24s cubic-bezier(.2, .9, .3, 1);
}
.wxbar-ico { flex: none; color: var(--info); font-weight: 700; }
.wxbar-msg { flex: 1; min-width: 0; }
.wxbar-x { flex: none; border: 0; background: none; color: var(--muted); font: inherit; padding: 0 2px; cursor: pointer; }

/* ---------- 颠簸统计卡 ---------- */
.turb-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.tbar { position: relative; height: 22px; margin: 12px 0 5px; }
.tbar .tseg-track { position: absolute; inset: 0; border-radius: 11px; background: var(--glass-2); border: 1px solid var(--hair-2); }
.tbar .tseg { position: absolute; top: 0; bottom: 0; border-radius: 11px; }
.tbar .tseg.g-moderate { box-shadow: 0 0 14px -3px rgba(221, 107, 32, .85); }
.tbar .tseg.g-severe { box-shadow: 0 0 14px -3px rgba(229, 62, 62, .95); }
.tbar-axis { display: flex; justify-content: space-between; font-size: calc(var(--fs) * .72); color: var(--muted); margin-bottom: 8px; }
.twin { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--hair-2); font-size: calc(var(--fs) * .86); }
.twin:last-of-type { border-bottom: 0; }
.twin .sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* ---------- 颠簸时间轴 ---------- */
.turb-wrap { position: relative; margin-top: 10px; }
.turb-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
/* 手动滑动暂停跟随后出现的「回到当前」浮标 */
.turb-recenter {
  position: absolute; right: 6px; top: 4px; z-index: 3;
  padding: 3px 10px; font-size: calc(var(--fs) * .72);
  background-color: rgba(9, 14, 21, .9);
}
.turb-axis { display: flex; gap: 4px; align-items: flex-end; position: relative; }
.turb-cell {
  flex: 0 0 auto; width: 44px; height: 148px; padding: 0; border: 0; background: none;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px;
  border-radius: 12px; position: relative;
}
.turb-plane {
  position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--accent) 30%, var(--accent));
  opacity: .9; pointer-events: none; border-radius: 2px;
}
.turb-plane::after {
  content: '✈'; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  font-size: calc(var(--fs) * .78); color: #fff;
  padding: 1px 3px; border-radius: 7px; background: rgba(0, 0, 0, .38);
}
.turb-t, .turb-n { font-size: calc(var(--fs) * .6); color: var(--muted); line-height: 1.2; }
.turb-n { max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turb-sr { font-size: calc(var(--fs) * .7); font-weight: 700; line-height: 1; }
.turb-leg {
  position: absolute; left: -24px; bottom: calc(var(--fs) * .72 + 3px);
  width: 44px; height: 148px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px;
}
.turb-leg .turb-t { white-space: nowrap; }
.turb-bar {
  width: 100%; min-height: 6px; border-radius: 7px 7px 3px 3px; position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.g-none { background: var(--hair); box-shadow: none; }
.g-smooth { background-image: linear-gradient(180deg, #48bb78, #2f855a); }
.g-light { background-image: linear-gradient(180deg, #e3c14a, #c9a227); box-shadow: 0 0 16px -4px rgba(201, 162, 39, .8); }
.g-moderate { background-image: linear-gradient(180deg, #f08a3c, #dd6b20); box-shadow: 0 0 18px -4px rgba(221, 107, 32, .9); }
.g-severe { background-image: linear-gradient(180deg, #f56565, #e53e3e); box-shadow: 0 0 20px -3px rgba(229, 62, 62, .95); }

/* ---------- 图例 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 11px; margin: 12px 0 4px; font-size: calc(var(--fs) * .74); color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend .sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

/* ---------- 飞行剖面 ---------- */
.prof-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.prof-svg { display: block; width: 100%; height: auto; }
.prof-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; opacity: .75; }
.prof-base { stroke: var(--line); stroke-width: 1; }
.prof-axis { fill: var(--muted); font-size: 11px; }
.prof-alt { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* 颠簸等级色段叠在白色计划高度线上；平稳段浅绿，线宽略粗于底线 */
.prof-seg { fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.prof-seg.g-smooth { stroke: #48bb78; }
.prof-seg.g-light { stroke: #e3c14a; }
.prof-seg.g-moderate { stroke: #f08a3c; }
.prof-seg.g-severe { stroke: #f56565; }
.prof-alt-area { fill: var(--ink); opacity: .06; }
.prof-tick { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 6; opacity: .55; }
.prof-plane-line { stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .85; }
/* 白色飞机带深色描边：叠在近白色航线上也能看清 */
.prof-plane text { font-size: 17px; fill: #fff; stroke: var(--bg); stroke-width: 3px; paint-order: stroke; }
.prof-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 8px 0 2px; font-size: calc(var(--fs) * .82); }

/* ---------- 更新起飞时间弹层 ---------- */
dialog.upd-dlg {
  width: min(92vw, 360px); margin: auto; padding: 18px 16px 16px;
  border: 1px solid var(--hair); border-radius: var(--radius);
  background: #0d1420; color: var(--ink);
  box-shadow: var(--shadow);
  font: var(--fs)/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
dialog.upd-dlg::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.upd-dlg h3 { font-size: calc(var(--fs) * 1.02); margin-bottom: 4px; }
.upd-row { display: flex; gap: 10px; align-items: center; margin: 14px 0 4px; }
.upd-row input[type="time"] {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--hair); border-radius: 12px;
  background: var(--glass-2); color: var(--ink);
  font: inherit; font-size: calc(var(--fs) * 1.1); font-variant-numeric: tabular-nums;
}
.upd-row input[type="time"]:focus { outline: 1px solid var(--accent); }
.upd-row input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(.7); }
.upd-msg { min-height: 1.2em; }
.upd-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.upd-actions .chip { padding: 9px 20px; font-size: calc(var(--fs) * .88); }
button.chip:disabled { opacity: .5; pointer-events: none; }

/* ---------- 页脚 / 提示 ---------- */
.c-foot { padding: 4px 4px 0; text-align: center; }
.c-foot p { margin: 5px 0; }
.install { margin-top: 6px; }
.errbox { text-align: center; padding: 40px 16px; }
.errbox .big { font-size: 40px; margin-bottom: 8px; }

/* ---------- 页脚四件套（与主站同款，彩虹字） ---------- */
/* 彩虹字。首尾同色 + background-size 200% 才能让位移循环无接缝 */
.rainbow {
  background-image: linear-gradient(90deg, #ff0080 0%, #ff8c00 16%, #ffd700 33%, #00c853 50%, #00b0ff 66%, #8a2be2 83%, #ff0080 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: .3px;
  animation: rainbow-flow 7s linear infinite;
}
@keyframes rainbow-flow { to { background-position: 200% 0; } }
/* 五条错开相位，避免同步像闪烁 */
.app-footer .footer-beian { animation-delay: -1.4s; }
.app-footer .footer-icp { animation-delay: -2.8s; }
.footer-legal .rainbow:nth-of-type(1) { animation-delay: -4.2s; }
.footer-legal .rainbow:nth-of-type(2) { animation-delay: -5.6s; }
.app-footer .footer-copy { animation-delay: -7s; }
@media (prefers-reduced-motion: reduce) { .rainbow { animation: none; } }

.app-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 0; max-width: 760px; margin: 4px auto 0; padding: 16px 10px 24px;
  border-top: 1px solid var(--hair-2);
  font-size: calc(var(--fs) * .78); line-height: 1.7; text-align: center;
}
.app-footer > * + * { padding-left: 12px; margin-left: 12px; border-left: 1px solid var(--hair-2); }
.footer-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; text-decoration: none; }
.footer-legal { display: inline-flex; align-items: center; }
.footer-sep { color: var(--muted); margin: 0 3px; }
.footer-beian img { display: block; -webkit-user-drag: none; pointer-events: none; }

/* 上架 App 内不显示页脚四件套；PWA/网页保留 */
html[data-in-app="1"] .app-footer { display: none !important; }
