/* ===== 春秋航空维修看板 · 深蓝绿高级感主题 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #03191d;
  --bg-2: #062428;
  --card: rgba(255,255,255,.045);
  --card-strong: rgba(255,255,255,.07);
  --border: rgba(255,255,255,.09);
  --border-glow: rgba(52,224,174,.38);
  --text: #e9f5f1;
  --text-2: #8fb3ac;
  --text-3: #5f827c;
  --cyan: #34e0ae;   /* 春秋薄荷绿（主强调色） */
  --blue: #0ea78b;   /* 春秋深青绿 */
  --lime: #a3e635;   /* 春秋嫩芽绿 */
  --violet: #8b5cf6;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --pink: #f472b6;
  --radius: 18px;
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 330;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 90px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* aurora background */
.bg-aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-aurora i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .17; animation: drift 18s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(1) { width: 60vw; height: 60vw; background: #0f766e; top: -20vw; left: -15vw; }
.bg-aurora i:nth-child(2) { width: 50vw; height: 50vw; background: #059669; top: 30vh; right: -20vw; animation-delay: -6s; }
.bg-aurora i:nth-child(3) { width: 45vw; height: 45vw; background: #155e63; bottom: -10vh; left: 10vw; animation-delay: -12s; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(6vw,4vh) scale(1.15); } }

/* ===== Header ===== */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  background: rgba(3,25,29,.84);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; object-fit: contain;
  padding: 6px; flex: 0 0 auto;
  background: linear-gradient(140deg, #11a34c, #00773a);
  border: 1.5px solid rgba(52,224,174,.55);
  box-shadow: 0 0 16px rgba(52,224,174,.35);
}
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 14.5px; font-weight: 630; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text p { font-size: 8px; color: var(--text-3); letter-spacing: 1px; margin-top: 2px; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pulse 1.6s infinite; display: inline-block; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.live-text { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--border); color: var(--text-2); text-decoration: none;
}
.icon-btn svg { width: 17px; height: 17px; }

/* ===== Dimension Nav ===== */
.dim-nav {
  position: sticky; z-index: 49;
  top: calc(env(safe-area-inset-top) + 64px);
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px;
  background: rgba(3,25,29,.84); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.dim-nav::-webkit-scrollbar { display: none; }
.dim-tab {
  flex: 0 0 auto; padding: 7px 15px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12.5px; white-space: nowrap; cursor: pointer;
  font-family: inherit;
  transition: all .25s;
}
.dim-tab.active {
  background: linear-gradient(135deg, rgba(52,224,174,.22), rgba(14,167,139,.22));
  border-color: var(--border-glow); color: #b8f5de;
  box-shadow: 0 0 14px rgba(52,224,174,.2);
  font-weight: 520;
}

/* ===== Board ===== */
.board { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 16px 14px 0; }
.dim-section { display: none; animation: fadeUp .4s ease; }
.dim-section.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 4px 14px; }
.section-title h2 { font-size: 19px; font-weight: 630; letter-spacing: .5px; }
.section-title h2::before {
  content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  margin-right: 8px; vertical-align: -2px;
  box-shadow: 0 0 10px rgba(52,224,174,.6);
}
.section-sub { font-size: 11px; color: var(--text-3); }

/* ===== Hero KPI ===== */
.hero-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 14px; }
.hero-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 14px 14px 10px;
  background: var(--card); border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.hero-card::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
  background: radial-gradient(120px 60px at 85% 0%, var(--hc, rgba(52,224,174,.14)), transparent 70%);
}
.hero-label { font-size: 11px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.hero-label i { width: 6px; height: 6px; border-radius: 2px; background: var(--hc-solid, var(--cyan)); box-shadow: 0 0 6px var(--hc-solid, var(--cyan)); }
.hero-value { font-size: 27px; font-weight: 630; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.hero-value small { font-size: 12px; color: var(--text-2); font-weight: 380; margin-left: 3px; }
.hero-trend { font-size: 11px; margin-top: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; }
.hero-trend.up { color: var(--red); background: rgba(248,113,113,.12); }
.hero-trend.down { color: var(--green); background: rgba(52,211,153,.12); }
.hero-trend.flat { color: var(--text-2); background: var(--card-strong); }
.hero-spark { height: 38px; margin: 6px -6px -4px; }

/* ===== Overview cards ===== */
.overview-cards { display: flex; flex-direction: column; gap: 12px; }
.ov-card {
  border-radius: var(--radius); padding: 15px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; transition: transform .2s, border-color .2s;
}
.ov-card:active { transform: scale(.985); border-color: var(--border-glow); }
.ov-head { display: flex; justify-content: space-between; align-items: center; }
.ov-name { font-size: 14px; font-weight: 520; display: flex; align-items: center; gap: 8px; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; }
.ov-metric { text-align: right; }
.ov-metric b { font-size: 19px; font-weight: 630; font-variant-numeric: tabular-nums; }
.ov-metric small { font-size: 10px; color: var(--text-3); display: block; }
.ov-spark { height: 52px; margin-top: 8px; }
.ov-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10.5px; color: var(--text-3); }

/* ===== Dimension detail ===== */
.dim-card {
  border-radius: var(--radius); padding: 15px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--border);
}
.dim-desc {
  border-left: 3px solid var(--cyan);
  background: rgba(52,224,174,.07);
  border-radius: 0 12px 12px 0;
  padding: 10px 13px; margin-bottom: 14px;
  font-size: 12px; line-height: 1.7; color: var(--text-2);
}
.dim-desc b { color: #8df0cd; display: block; margin-bottom: 3px; font-size: 11px; letter-spacing: 1px; font-weight: 520; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi-chip {
  border-radius: 14px; padding: 11px 10px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
}
.kpi-chip b { font-size: 18px; font-weight: 630; display: block; font-variant-numeric: tabular-nums; }
.kpi-chip span { font-size: 10px; color: var(--text-3); margin-top: 3px; display: block; }
.chart-title { font-size: 13px; font-weight: 520; margin: 0 2px 8px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.chart-title::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.chart-box { width: 100%; }
.chart-h220 { height: 220px; }
.chart-h260 { height: 260px; }
.chart-h300 { height: 300px; }
.dim-updated { font-size: 10.5px; color: var(--text-3); text-align: right; margin: -6px 4px 14px; }

/* ===== Table ===== */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-table th { color: var(--text-3); font-weight: 380; text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); font-size: 11px; }
.mini-table td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.04); font-variant-numeric: tabular-nums; }
.mini-table tr:last-child td { border-bottom: none; }
.rank-badge { display: inline-flex; width: 18px; height: 18px; border-radius: 6px; align-items: center; justify-content: center; font-size: 10px; font-weight: 630; margin-right: 6px; background: var(--card-strong); color: var(--text-2); }
.rank-badge.r1 { background: rgba(251,191,36,.18); color: var(--gold); }
.rank-badge.r2 { background: rgba(148,163,184,.18); color: #cbd5e1; }
.rank-badge.r3 { background: rgba(217,119,6,.15); color: #f59e0b; }

/* ===== AI FAB ===== */
.ai-fab {
  position: fixed; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 20px); z-index: 80;
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff; font-size: 14px; font-weight: 630; letter-spacing: 1px;
  font-family: inherit;
  box-shadow: 0 8px 28px rgba(124,58,237,.5), 0 0 0 1px rgba(255,255,255,.12) inset;
  animation: fabFloat 3s ease-in-out infinite;
}
.ai-fab svg { width: 19px; height: 19px; }
@keyframes fabFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ===== AI Panel ===== */
.ai-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(2,10,12,.6);
  backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.ai-mask.open { opacity: 1; pointer-events: auto; }
.ai-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  height: min(82vh, 760px);
  max-width: 520px; margin: 0 auto;
  background: linear-gradient(180deg, #0a2428, #05181b);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column;
  transform: translateY(105%); transition: transform .38s cubic-bezier(.32,.72,.28,1);
  box-shadow: 0 -12px 50px rgba(0,0,0,.6);
}
.ai-panel.open { transform: translateY(0); }
.ai-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
.ai-head-left { display: flex; align-items: center; gap: 11px; }
.ai-avatar {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(52,224,174,.2), rgba(14,167,139,.2));
  border: 1px solid rgba(52,224,174,.4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 14px rgba(52,224,174,.2);
}
.ai-avatar img { width: 28px; height: 28px; object-fit: contain; }
.ai-head h3 { font-size: 15px; font-weight: 630; }
.ai-head p { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.ai-head-right { display: flex; gap: 8px; }
.ai-icon-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ai-icon-btn svg { width: 15px; height: 15px; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble {
  max-width: 86%; padding: 11px 14px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.75; word-break: break-word; white-space: pre-wrap;
}
.ai-msg.assistant .ai-bubble {
  background: var(--card-strong); border: 1px solid var(--border);
  border-top-left-radius: 4px; color: var(--text);
}
.ai-msg.user .ai-bubble {
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  border-top-right-radius: 4px; color: #fff;
}
.ai-bubble strong { color: #8df0cd; font-weight: 630; }
.ai-bubble .md-h { display: block; font-weight: 630; color: #b8f5de; margin: 4px 0 6px; }
.ai-bubble.typing::after { content: "▍"; color: var(--cyan); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ai-quick { display: flex; gap: 8px; padding: 4px 14px 10px; overflow-x: auto; scrollbar-width: none; }
.ai-quick::-webkit-scrollbar { display: none; }
.ai-quick button {
  flex: 0 0 auto; padding: 7px 13px; border-radius: 999px; font-size: 11.5px; cursor: pointer;
  background: rgba(52,224,174,.09); border: 1px solid rgba(52,224,174,.3); color: #8df0cd;
  font-family: inherit;
}
.ai-input-bar {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 14px);
  border-top: 1px solid var(--border); background: rgba(5,24,27,.92);
}
#aiInput {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--text); padding: 11px 13px;
  font-size: 14px; font-family: inherit; outline: none; max-height: 110px; line-height: 1.5;
}
#aiInput:focus { border-color: rgba(52,224,174,.5); }
.ai-send {
  width: 42px; height: 42px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #10b981, #0ea78b); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(16,185,129,.35);
}
.ai-send:disabled { opacity: .45; }
.ai-send svg { width: 18px; height: 18px; }

/* ===== Loading ===== */
.loading-screen {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  transition: opacity .5s;
}
.loading-screen.hide { opacity: 0; pointer-events: none; }
.loading-logo { width: 172px; filter: drop-shadow(0 0 20px rgba(52,224,174,.35)); animation: logoBreath 2s ease-in-out infinite; }
@keyframes logoBreath { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.045); opacity: 1; } }
.loader-ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(52,224,174,.15); border-top-color: var(--cyan);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen p { font-size: 12.5px; color: var(--text-2); letter-spacing: 3px; }

/* ===== Footer ===== */
.app-footer { text-align: center; padding: 30px 0 10px; }
.footer-logo { height: 15px; opacity: .92; margin-bottom: 10px; filter: drop-shadow(0 0 8px rgba(52,224,174,.25)); }
.app-footer p { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }
.app-footer .dim-note { margin-top: 6px; font-size: 10px; color: #42605b; }

/* ===== Admin ===== */
.admin-wrap { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 18px 14px 40px; }
.admin-card {
  border-radius: var(--radius); padding: 16px; margin-bottom: 13px;
  background: var(--card); border: 1px solid var(--border);
}
.admin-card h3 { font-size: 15px; font-weight: 630; display: flex; align-items: center; justify-content: space-between; }
.admin-meta { font-size: 11px; color: var(--text-3); margin: 8px 0 12px; line-height: 1.7; }
.admin-meta b { color: var(--text-2); font-weight: 450; }
.upload-row { display: flex; gap: 10px; align-items: center; }
.file-btn {
  flex: 1; position: relative; overflow: hidden;
  border: 1px dashed rgba(52,224,174,.4); border-radius: 12px;
  padding: 11px; text-align: center; font-size: 12.5px; color: var(--cyan);
  background: rgba(52,224,174,.05); cursor: pointer;
}
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-btn {
  padding: 11px 18px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #0ea78b, #059669); color: #fff;
  font-size: 12.5px; font-weight: 520; font-family: inherit;
  box-shadow: 0 4px 14px rgba(14,167,139,.3);
}
.upload-btn:disabled { opacity: .4; }
.upload-result { font-size: 11.5px; margin-top: 9px; min-height: 16px; }
.upload-result.ok { color: var(--green); }
.upload-result.err { color: var(--red); }
.status-pill { font-size: 10px; padding: 3px 9px; border-radius: 999px; }
.status-pill.has { background: rgba(52,211,153,.12); color: var(--green); }
.status-pill.none { background: rgba(248,113,113,.12); color: var(--red); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; text-decoration: none; margin-bottom: 16px; }
.notice-box {
  border-radius: 14px; padding: 13px 15px; margin-bottom: 16px; font-size: 12px; line-height: 1.8;
  background: rgba(163,230,53,.06); border: 1px solid rgba(163,230,53,.25); color: #d9f99d;
}
.notice-box b { font-weight: 520; }

@media (max-width: 430px) {
  .brand-mark { width: 30px; height: 30px; padding: 5px; }
  .brand-text h1 { font-size: 13px; }
  .mode-btn { width: 24px; height: 21px; border-radius: 6px; }
  .mode-btn svg { width: 11.5px; height: 11.5px; }
  .icon-btn { width: 28px; height: 28px; }
  .icon-btn svg { width: 14px; height: 14px; }
  .header-actions { gap: 6px; }
  .section-sub { font-size: 10px; }
}

@media (min-width: 521px) {
  body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    border-left: 1px solid rgba(255,255,255,.05); border-right: 1px solid rgba(255,255,255,.05);
    max-width: 520px; margin: 0 auto;
  }
}

/* ===== 视图模式切换按钮 ===== */
.mode-toggle {
  display: flex; align-items: center; gap: 2px; padding: 2px;
  border-radius: 9px; background: var(--card); border: 1px solid var(--border);
  flex: 0 0 auto;
}
.mode-btn {
  width: 28px; height: 24px; border: none; border-radius: 7px; background: transparent;
  color: var(--text-3); cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.mode-btn svg { width: 13px; height: 13px; }
.mode-btn:hover { color: var(--text-2); }
.mode-btn.active {
  background: linear-gradient(135deg, rgba(52,224,174,.25), rgba(14,167,139,.25));
  color: #b8f5de; box-shadow: 0 0 10px rgba(52,224,174,.18);
}

/* ===== PC 版宽屏布局 ===== */
body.pc-mode::before { display: none; }
body.pc-mode { padding-bottom: 70px; }
body.pc-mode .board { max-width: 1320px; padding: 22px 26px 0; }
body.pc-mode .app-header { padding-left: 26px; padding-right: 26px; }
body.pc-mode .dim-nav {
  flex-wrap: wrap; justify-content: center; overflow-x: visible;
  padding-left: 26px; padding-right: 26px; gap: 9px;
}
body.pc-mode .dim-tab { padding: 8px 18px; font-size: 13.5px; }
body.pc-mode .section-title h2 { font-size: 22px; }
body.pc-mode .section-sub { font-size: 12px; }
/* 总览：KPI 4 列、维度卡 2 列 */
body.pc-mode .hero-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
body.pc-mode .hero-value { font-size: 29px; }
body.pc-mode .overview-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
body.pc-mode .ov-card { padding: 17px; }
body.pc-mode .ov-spark { height: 60px; }
/* 维度详情：标题/口径/KPI/更新时间通栏，图表双列 */
body.pc-mode .dim-section.active { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
body.pc-mode .dim-section.active > .section-title,
body.pc-mode .dim-section.active > .dim-desc,
body.pc-mode .dim-section.active > .kpi-row,
body.pc-mode .dim-section.active > .dim-updated,
body.pc-mode #sec-overview > .hero-grid,
body.pc-mode #sec-overview > .overview-cards { grid-column: 1 / -1; }
body.pc-mode .dim-desc { font-size: 13px; }
body.pc-mode .kpi-row { max-width: 760px; }
body.pc-mode .kpi-chip b { font-size: 21px; }
body.pc-mode .dim-card { padding: 17px; }
body.pc-mode .chart-title { font-size: 14px; }
body.pc-mode .chart-h220 { height: 264px; }
body.pc-mode .chart-h260 { height: 304px; }
body.pc-mode .chart-h300 { height: 348px; }
body.pc-mode .mini-table { font-size: 13px; }
/* AI 面板：右侧抽屉 */
body.pc-mode .ai-panel {
  left: auto; right: 26px; top: 84px; bottom: 26px; height: auto;
  max-width: none; width: 432px;
  border-radius: 20px; border: 1px solid var(--border);
  transform: translateX(calc(100% + 60px));
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
body.pc-mode .ai-panel.open { transform: translateX(0); }
body.pc-mode .ai-input-bar { padding: 10px 14px 14px; }
body.pc-mode .ai-fab { bottom: 26px; }
