:root {
    --bg: #eef3ff;
    --card: #f7f9ff;
    --line: #e1e9fb;
    --text: #1f2a44;
    --muted: #7f8aa7;
    --brand: #2f66f5;
    --brand-soft: #dce8ff;
    --ok: #23a26d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f5f8ff 0%, var(--bg) 100%);
    color: var(--text);
}
.container {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 16px 24px;
}
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(31, 42, 68, 0.04);
}
.hero {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hero h1 {
    font-size: 30px;
    margin: 0;
    letter-spacing: 0.5px;
}
.hero p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}
.status {
    margin-top: 12px;
    display: flex;
    gap: 16px;
    color: #5f6b8a;
    font-size: 13px;
}
.status-bar {
    margin-top: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: #516180;
    font-size: 13px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.status-pill-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.7);
}
.status-pill.live {
    background: #e7f8ef;
    color: #157347;
}
.status-pill.fallback {
    background: #fff3d9;
    color: #ad6800;
}
.status-pill.loading {
    background: #e8f1ff;
    color: #1f5eff;
}
.status-message {
    flex: 1;
    min-width: 0;
}
.status-detail-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.status-detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.status-detail-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid currentColor;
}
.status-detail-label {
    opacity: 0.72;
    font-weight: 700;
}
.status-detail.good {
    background: #e7f8ef;
    border-color: #bfe9cf;
    color: #157347;
}
.status-detail.reuse {
    background: #eef3ff;
    border-color: #cad8ff;
    color: #2457df;
}
.status-detail.recovering {
    background: #fff6df;
    border-color: #f3d58e;
    color: #ad6800;
}
.status-detail.degraded {
    background: #fff1e8;
    border-color: #ffc4a8;
    color: #c25100;
}
.status-detail.pending {
    background: #f2f5fb;
    border-color: #d9e1f0;
    color: #60708f;
}
.status-updated {
    color: var(--muted);
    white-space: nowrap;
}
.status span::before {
    content: "▲";
    margin-right: 6px;
    color: var(--ok);
    font-size: 10px;
}
.btn {
    border: none;
    border-radius: 10px;
    padding: 11px 18px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.form {
    margin-top: 14px;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 220px 170px;
    gap: 12px;
    align-items: end;
}
.field label {
    display: block;
    font-size: 13px;
    color: #5f6b8a;
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    outline: none;
}
.field input.invalid {
    border-color: #e14d4d;
    box-shadow: 0 0 0 3px rgba(225, 77, 77, 0.12);
}
.field-error {
    min-height: 18px;
    margin-top: 6px;
    color: #c62828;
    font-size: 12px;
}
.content {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 14px;
}
.section {
    padding: 16px;
}
.section h2 {
    margin: 0 0 8px;
    font-size: 28px;
}
.desc {
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 13px;
}
.day-lines {
    line-height: 1.9;
    font-size: 14px;
}
.day-line-item {
    padding: 3px 8px;
    border-radius: 8px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.day-line-main {
    line-height: 1.8;
}
.day-line-spots {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.day-spot-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #52617f;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(47, 102, 245, 0.14);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.day-spot-chip.active {
    background: #fff;
    color: #1f5eff;
    box-shadow: 0 6px 14px rgba(31, 94, 255, 0.16);
    transform: translateY(-1px);
}
.day-line-item:hover {
    background: #eaf1ff;
    transform: translateX(2px);
}
.day-line-item.active {
    background: #2f66f5;
    color: #fff;
    font-weight: 600;
}
.kpi {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.kpi .item {
    background: #f2f6ff;
    border: 1px solid #e7efff;
    border-radius: 10px;
    padding: 10px 12px;
}
.kpi .item .v {
    font-weight: 700;
    margin-top: 4px;
}
.right .card {
    padding: 14px 16px;
    margin-bottom: 12px;
}
.right h3 {
    margin: 0 0 10px;
    font-size: 24px;
}
.mini-title {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #5f6b8a;
    margin-bottom: 10px;
}
.tips {
    margin: 8px 0 0;
    padding-left: 16px;
    color: #4d5877;
    line-height: 1.8;
}
.route-box {
    margin-top: 8px;
    height: 360px;
    border-radius: 12px;
    border: 1px solid #c7d6fb;
    background: #dbe7ff;
    overflow: hidden;
    position: relative;
}
.route-box.fullscreen {
    position: fixed;
    inset: 16px;
    z-index: 9999;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(22, 38, 75, 0.28);
    background: #fff;
}
#amapMap { width: 100%; height: 100%; }
.map-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    gap: 8px;
}
.map-mode-group {
    display: inline-flex;
    align-items: center;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(47, 102, 245, 0.12);
    backdrop-filter: blur(8px);
}
.map-btn {
    border: 1px solid rgba(47, 102, 245, 0.18);
    background: rgba(255, 255, 255, 0.92);
    color: #2f66f5;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.map-mode-group .map-btn {
    border: none;
    background: transparent;
    padding: 6px 10px;
}
.map-btn.active {
    background: #2f66f5;
    color: #fff;
    box-shadow: 0 6px 14px rgba(47, 102, 245, 0.18);
}
.route-legend {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 20;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: calc(100% - 120px);
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #40517f;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.legend-item.active {
    box-shadow: 0 0 0 2px rgba(47, 102, 245, 0.12);
}
.legend-note {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.transport-text {
    margin-top: 10px;
    color: #40517f;
    line-height: 1.7;
    font-size: 14px;
}
.footer-kpi {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    color: #3e5287;
    font-size: 13px;
}
.chip {
    background: #e8f1ff;
    border-radius: 16px;
    padding: 6px 10px;
}
.error {
    margin-top: 8px;
    color: #c62828;
    font-size: 13px;
    min-height: 18px;
}
@media (max-width: 1120px) {
    .form { grid-template-columns: 1fr; }
    .content { grid-template-columns: 1fr; }
}
