:root,
[data-theme="light"] {
    --lp-bg: #f4f6f9;
    --lp-surface: #fff;
    --lp-surface-2: #f8fafc;
    --lp-border: #e8ecf1;
    --lp-text: #0f172a;
    --lp-muted: #64748b;
    --lp-primary: #2563eb;
    --lp-head-h: 52px;
    --lp-nav-h: 52px;
}

[data-theme="dark"] {
    --lp-bg: #080c14;
    --lp-surface: #12182a;
    --lp-surface-2: #1a2236;
    --lp-border: rgba(255, 255, 255, 0.07);
    --lp-text: #f1f5f9;
    --lp-muted: #94a3b8;
    --lp-primary: #60a5fa;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--lp-bg);
    color: var(--lp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* 手机仪表盘：隐藏顶栏导航和页脚，把空间留给站点 */
body.lp-minimal-mobile.lp-page-dashboard {
    padding-bottom: calc(var(--lp-nav-h) + env(safe-area-inset-bottom, 0px));
}

body.lp-minimal-mobile.lp-page-dashboard .lp-main {
    padding: 0;
    min-height: auto;
}

body.lp-minimal-mobile.lp-page-dashboard .lp-footer {
    display: none !important;
}

.lp-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

/* —— 粘性顶栏 —— */
.lp-sticky-head {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--lp-surface);
    border-bottom: 1px solid var(--lp-border);
    padding: 8px 12px 6px;
    backdrop-filter: blur(12px);
}

.lp-sticky-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
}

.lp-sticky-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

@keyframes lp-pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; transform: scale(1); }
    50% { box-shadow: 0 0 0 5px transparent; transform: scale(1.08); }
}

.lp-pulse-sm {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    color: rgba(34, 197, 94, 0.45);
    animation: lp-pulse-ring 2.4s ease-in-out infinite;
}

.lp-pulse-sm.warn {
    background: #f97316;
    color: rgba(249, 115, 22, 0.45);
}

.lp-pulse-sm.err {
    background: #ef4444;
    color: rgba(239, 68, 68, 0.45);
    animation-duration: 1.6s;
}

/* —— 状态横幅 —— */
.lp-hero-banner {
    margin: 8px 8px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--lp-border);
    background: linear-gradient(135deg, var(--lp-surface) 0%, var(--lp-surface-2) 100%);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.lp-hero-banner--ok {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.08);
}

.lp-hero-banner--warn {
    border-color: rgba(249, 115, 22, 0.35);
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.08);
}

.lp-hero-banner--err {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.12);
}

.lp-hero-banner-inner {
    padding: 14px 16px;
}

.lp-hero-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.lp-hero-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    margin-top: 5px;
    color: rgba(34, 197, 94, 0.5);
    animation: lp-pulse-ring 2.4s ease-in-out infinite;
}

.lp-hero-banner--warn .lp-hero-pulse {
    background: #f97316;
    color: rgba(249, 115, 22, 0.5);
}

.lp-hero-banner--err .lp-hero-pulse {
    background: #ef4444;
    color: rgba(239, 68, 68, 0.5);
    animation-duration: 1.6s;
}

.lp-hero-headline {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.3;
}

.lp-hero-sub {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: var(--lp-muted);
}

.lp-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lp-hero-metric {
    text-align: center;
    padding: 8px 4px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 10px;
}

.lp-hero-metric-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--lp-primary);
    line-height: 1.2;
}

.lp-hero-banner--ok .lp-hero-metric-val { color: #16a34a; }
.lp-hero-banner--err .lp-hero-metric:first-child .lp-hero-metric-val { color: #dc2626; }

.lp-hero-metric-label {
    display: block;
    font-size: 0.62rem;
    color: var(--lp-muted);
    margin-top: 2px;
    font-weight: 600;
}

/* —— 事件时间线 —— */
.lp-timeline-section {
    margin: 8px 8px 0;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    overflow: hidden;
}

.lp-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
}

.lp-timeline-collapsible.is-collapsed .lp-timeline-head {
    border-bottom-color: transparent;
}

.lp-timeline-collapsible:not(.is-collapsed) .lp-timeline-head {
    border-bottom-color: var(--lp-border);
}

.lp-timeline-head-title {
    flex: 1;
    min-width: 0;
}

.lp-timeline-head-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    color: var(--lp-muted);
    font-weight: 500;
}

.lp-timeline-head-meta small {
    font-size: 0.65rem;
}

.lp-timeline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--lp-primary);
    color: #fff;
}

.lp-timeline-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.lp-timeline-collapsible:not(.is-collapsed) .lp-timeline-chevron {
    transform: rotate(180deg);
}

.lp-timeline-panel[hidden] {
    display: none !important;
}

.lp-timeline-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 6px 0;
}

.lp-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--lp-border);
}

.lp-timeline-item:last-child {
    border-bottom: none;
}

.lp-timeline-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.lp-timeline-dot.down { background: #ef4444; }
.lp-timeline-dot.recovery { background: #22c55e; }
.lp-timeline-dot.warning { background: #f97316; }

.lp-timeline-body {
    flex: 1;
    min-width: 0;
}

.lp-timeline-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.lp-timeline-meta {
    color: var(--lp-muted);
    font-size: 0.68rem;
}

.lp-timeline-msg {
    color: #f97316;
    font-size: 0.65rem;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-timeline-empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--lp-muted);
    font-size: 0.75rem;
}

/* —— 手机端紧凑布局 —— */
@media (max-width: 991.98px) {
    body.lp-minimal-mobile {
        --lp-nav-h: 48px;
        font-size: 14px;
    }

    .lp-timeline-collapsible .lp-timeline-head {
        cursor: pointer;
    }

    body.lp-minimal-mobile .lp-hero-banner {
        margin: 4px 6px 0;
        border-radius: 10px;
    }

    body.lp-minimal-mobile .lp-hero-banner-inner {
        padding: 10px 12px;
    }

    body.lp-minimal-mobile .lp-hero-status {
        gap: 8px;
        margin-bottom: 8px;
    }

    body.lp-minimal-mobile .lp-hero-pulse {
        width: 10px;
        height: 10px;
        margin-top: 3px;
    }

    body.lp-minimal-mobile .lp-hero-headline {
        font-size: 1rem;
    }

    body.lp-minimal-mobile .lp-hero-sub {
        font-size: 0.68rem;
        margin-top: 2px;
        line-height: 1.35;
    }

    body.lp-minimal-mobile .lp-hero-metrics {
        gap: 4px;
    }

    body.lp-minimal-mobile .lp-hero-metric {
        padding: 5px 2px;
        border-radius: 8px;
    }

    body.lp-minimal-mobile .lp-hero-metric-val {
        font-size: 1.05rem;
    }

    body.lp-minimal-mobile .lp-hero-metric-label {
        font-size: 0.58rem;
        margin-top: 0;
    }

    body.lp-minimal-mobile .lp-sticky-head {
        padding: 5px 8px 4px;
    }

    body.lp-minimal-mobile .lp-sticky-row {
        min-height: 28px;
        gap: 6px;
    }

    body.lp-minimal-mobile .lp-sticky-left {
        gap: 6px;
    }

    body.lp-minimal-mobile .lp-pulse-sm {
        width: 7px;
        height: 7px;
    }

    body.lp-minimal-mobile .lp-sticky-title {
        font-size: 0.82rem;
    }

    body.lp-minimal-mobile .lp-sticky-uptime {
        font-size: 0.78rem;
    }

    body.lp-minimal-mobile .lp-icon-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    body.lp-minimal-mobile .lp-sticky-chips {
        margin-top: 4px;
        gap: 3px;
    }

    body.lp-minimal-mobile .lp-mini-chip {
        font-size: 0.6rem;
        padding: 1px 5px;
        border-radius: 5px;
    }

    body.lp-minimal-mobile .lp-sticky-meta {
        margin-top: 2px;
        font-size: 0.6rem;
        gap: 2px 6px;
    }

    body.lp-minimal-mobile .lp-filter-drawer {
        margin-top: 6px;
        padding-top: 6px;
    }

    body.lp-minimal-mobile .lp-chip {
        padding: 3px 8px;
        font-size: 0.68rem;
    }

    body.lp-minimal-mobile .lp-timeline-section {
        margin: 4px 6px 0;
        border-radius: 10px;
    }

    body.lp-minimal-mobile .lp-timeline-head {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    body.lp-minimal-mobile .lp-timeline-list {
        max-height: 130px;
    }

    body.lp-minimal-mobile .lp-timeline-item {
        padding: 6px 10px;
        font-size: 0.72rem;
    }

    body.lp-minimal-mobile .lp-timeline-meta {
        font-size: 0.64rem;
    }

    body.lp-minimal-mobile .lp-site-list {
        padding: 4px 6px 8px;
        gap: 4px;
    }

    body.lp-minimal-mobile .lp-site-card {
        border-radius: 10px;
        border-left-width: 3px;
    }

    body.lp-minimal-mobile .lp-card-main {
        min-height: 56px;
    }

    body.lp-minimal-mobile .lp-card-body {
        padding: 7px 6px 7px 8px;
        gap: 6px;
    }

    body.lp-minimal-mobile .lp-card-dot {
        width: 8px;
        height: 8px;
    }

    body.lp-minimal-mobile .lp-card-name {
        font-size: 0.88rem;
    }

    body.lp-minimal-mobile .lp-card-sub {
        gap: 6px;
        font-size: 0.65rem;
        margin-top: 1px;
    }

    body.lp-minimal-mobile .lp-card-metrics {
        min-width: 72px;
        padding: 6px 2px 6px 0;
        gap: 1px;
    }

    body.lp-minimal-mobile .lp-card-ms {
        font-size: 0.95rem;
    }

    body.lp-minimal-mobile .lp-card-ms small {
        font-size: 0.58rem;
    }

    body.lp-minimal-mobile .lp-spark-wrap {
        width: 68px;
        height: 22px;
    }

    body.lp-minimal-mobile .lp-card-toggle {
        width: 24px;
        height: 24px;
        margin-right: 2px;
        font-size: 0.72rem;
    }

    body.lp-minimal-mobile .lp-timing-row {
        margin-top: 3px;
        font-size: 0.62rem;
        gap: 8px;
    }

    body.lp-minimal-mobile .lp-ssl-badge {
        font-size: 0.58rem;
        margin-top: 2px;
        padding: 1px 6px;
    }

    body.lp-minimal-mobile .lp-card-err {
        font-size: 0.6rem;
        margin-top: 2px;
    }

    body.lp-minimal-mobile .lp-card-expand {
        padding: 0 8px 10px;
    }

    body.lp-minimal-mobile .lp-inline-chart {
        height: 140px;
    }

    body.lp-minimal-mobile .lp-bottom-nav-item {
        font-size: 0.58rem;
        gap: 0;
    }

    body.lp-minimal-mobile .lp-bottom-nav-item i {
        font-size: 1rem;
    }

    body.lp-minimal-mobile .lp-status-page {
        padding-bottom: calc(var(--lp-nav-h) + 8px);
    }

    body.lp-minimal-mobile .lp-status-hero-block {
        padding: 16px 12px 12px;
    }

    body.lp-minimal-mobile .lp-status-page-title {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    body.lp-minimal-mobile .lp-status-badge {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }

    body.lp-minimal-mobile .lp-status-hero-stats {
        gap: 16px;
        margin-top: 12px;
    }

    body.lp-minimal-mobile .lp-status-hero-stat b {
        font-size: 1.25rem;
    }

    body.lp-minimal-mobile .lp-status-services {
        padding: 6px;
    }

    body.lp-minimal-mobile .lp-status-card {
        padding: 10px 12px 8px;
        margin-bottom: 6px;
    }

    body.lp-minimal-mobile .lp-status-timeline {
        margin: 0 6px 6px;
    }
}

.lp-sticky-title {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-sticky-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.lp-sticky-uptime {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--lp-primary);
    margin-right: 2px;
}

.lp-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--lp-surface-2);
    color: var(--lp-text);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.lp-icon-btn:active {
    transform: scale(0.94);
}

.lp-sticky-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.lp-mini-chip {
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 600;
    background: var(--lp-surface-2);
    color: var(--lp-muted);
}

.lp-mini-chip.ok { color: #16a34a; background: rgba(34, 197, 94, 0.12); }
.lp-mini-chip.err { color: #dc2626; background: rgba(239, 68, 68, 0.12); }
.lp-mini-chip.warn { color: #ea580c; background: rgba(249, 115, 22, 0.12); }
.lp-mini-chip.unk { color: #ca8a04; background: rgba(234, 179, 8, 0.12); }
.lp-mini-chip.avg { color: var(--lp-primary); }
.lp-mini-chip.ssl-urgent { color: #dc2626; background: rgba(239, 68, 68, 0.12); }

.lp-ssl-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
}

.lp-ssl-badge.ok {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.1);
}

.lp-ssl-badge.warn {
    color: #ea580c;
    background: rgba(249, 115, 22, 0.12);
}

.lp-ssl-badge.urgent {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
}

.lp-ssl-detail {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 4px;
}

.lp-sticky-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 0.65rem;
    color: var(--lp-muted);
    margin-top: 4px;
}

.lp-probe-hint {
    flex: 1 1 100%;
    color: var(--lp-primary);
    font-weight: 600;
}

@media (min-width: 992px) {
    .lp-probe-hint {
        flex: 1 1 auto;
    }
}

/* 耗时分解 */
.lp-timing-row {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.68rem;
    color: var(--lp-muted);
}

.lp-timing-row b {
    color: var(--lp-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.lp-timing-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
    background: var(--lp-border);
}

.lp-timing-bar i {
    display: block;
    height: 100%;
    min-width: 2px;
}

.lp-timing-bar .seg-connect { background: #6366f1; }
.lp-timing-bar .seg-wait { background: #3b82f6; }
.lp-timing-bar .seg-down { background: #22c55e; }

.lp-timing-detail {
    margin-bottom: 8px;
}

.lp-timing-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--lp-muted);
    margin-bottom: 6px;
}

.lp-timing-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.lp-timing-legend .dot.c { background: #6366f1; }
.lp-timing-legend .dot.w { background: #3b82f6; }
.lp-timing-legend .dot.d { background: #22c55e; }

.lp-filter-drawer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--lp-border);
}

.lp-filter-drawer:not(.show) {
    display: none;
}

.lp-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lp-chip {
    border: 1px solid var(--lp-border);
    background: var(--lp-surface-2);
    color: var(--lp-muted);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.72rem;
    cursor: pointer;
}

.lp-chip.active {
    background: var(--lp-primary);
    border-color: var(--lp-primary);
    color: #fff;
}

/* 桌面统计 */
.lp-desktop-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 12px;
}

.lp-dstat {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.lp-dstat span {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
}

.lp-dstat label {
    font-size: 0.7rem;
    color: var(--lp-muted);
}

.lp-dstat.ok span { color: #22c55e; }
.lp-dstat.err span { color: #ef4444; }
.lp-dstat.warn span { color: #f97316; }

/* —— 站点卡片 —— */
.lp-site-list {
    padding: 6px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lp-site-card {
    position: relative;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    overflow: hidden;
    border-left: 4px solid var(--lp-card-accent, #9ca3af);
}

.lp-card-main {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    cursor: pointer;
    min-height: 72px;
}

.lp-card-body {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 10px 8px 10px 10px;
}

.lp-card-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.lp-card-dot.pulse-active {
    animation: lp-pulse-ring 2.2s ease-in-out infinite;
}

.lp-card-dot.pulse-urgent {
    animation-duration: 1.5s;
}

.lp-card-info {
    flex: 1;
    min-width: 0;
}

.lp-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.lp-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.lp-card-link {
    color: var(--lp-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    min-width: 0;
}

a.lp-card-link:active {
    color: var(--lp-primary);
}

.lp-card-link-icon {
    font-size: 0.65rem;
    color: var(--lp-primary);
    flex-shrink: 0;
    opacity: 0.85;
}

.lp-card-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    flex-shrink: 0;
    padding: 8px 4px 8px 0;
    min-width: 88px;
}

.lp-card-ms {
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    color: var(--lp-text);
    line-height: 1;
}

.lp-card-ms.lat-fast { color: #16a34a; }
.lp-card-ms.lat-ok { color: #2563eb; }
.lp-card-ms.lat-slow { color: #ea580c; }
.lp-card-ms.lat-critical { color: #dc2626; }
.lp-card-ms.lat-neutral { color: var(--lp-muted); }

.lp-card-ms small {
    font-size: 0.65rem;
    font-weight: 600;
    color: inherit;
    opacity: 0.75;
    margin-left: 1px;
}

.lp-card-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 0.7rem;
    color: var(--lp-muted);
}

.lp-card-status {
    font-weight: 600;
}

.lp-card-err {
    font-size: 0.65rem;
    color: #f97316;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-spark-wrap {
    width: 84px;
    height: 28px;
    flex-shrink: 0;
    pointer-events: none;
}

.lp-spark-empty {
    font-size: 0.6rem;
    color: var(--lp-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.lp-card-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--lp-muted);
    flex-shrink: 0;
    align-self: center;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.lp-site-card.is-open .lp-card-toggle {
    transform: rotate(180deg);
}

.lp-card-expand {
    display: none;
    padding: 0 12px 12px;
    border-top: 1px solid var(--lp-border);
    background: var(--lp-surface-2);
}

.lp-site-card.is-open .lp-card-expand {
    display: block;
}

.lp-inline-chart {
    height: 160px;
    width: 100%;
    margin-top: 10px;
}

.lp-inline-heat {
    display: flex;
    gap: 2px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.lp-inline-heat i {
    flex: 1 0 4px;
    min-width: 4px;
    height: 20px;
    border-radius: 2px;
    display: block;
}

.lp-istat {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.lp-istat b {
    display: block;
    font-size: 0.95rem;
}

.lp-istat small {
    color: var(--lp-muted);
    font-size: 0.65rem;
}

.lp-istat-warn {
    color: #f97316;
    padding: 6px 8px;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 8px;
}

/* 底栏 */
.lp-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--lp-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--lp-surface);
    border-top: 1px solid var(--lp-border);
    display: flex;
    z-index: 1030;
}

.lp-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--lp-muted);
    text-decoration: none;
    font-size: 0.62rem;
}

.lp-bottom-nav-item i {
    font-size: 1.1rem;
}

.lp-bottom-nav-item.active {
    color: var(--lp-primary);
}

.lp-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--lp-muted);
}

.lp-empty i {
    font-size: 2rem;
    opacity: 0.35;
    margin-bottom: 0.5rem;
}

/* 通用 */
.lp-navbar {
    background: var(--lp-surface) !important;
    border-bottom: 1px solid var(--lp-border);
}

.lp-navbar .navbar-brand,
.lp-navbar .nav-link {
    color: var(--lp-text) !important;
}

.lp-main {
    padding: 1rem 0 2rem;
}

.lp-footer {
    border-top: 1px solid var(--lp-border);
    color: var(--lp-muted);
    font-size: 0.8rem;
}

.lp-card {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
}

.form-control,
.form-select {
    background: var(--lp-surface);
    border-color: var(--lp-border);
    color: var(--lp-text);
}

.lp-login-card { margin-top: 1.5rem; }

.lp-table { color: var(--lp-text); }
.lp-table th { color: var(--lp-muted); font-size: 0.8rem; }

/* 公开状态页 */
.lp-status-page {
    padding: 0 0 calc(var(--lp-nav-h) + 12px);
    max-width: 720px;
}

.lp-status-hero-block {
    margin: 0;
    padding: 28px 20px 24px;
    text-align: center;
    border-bottom: 1px solid var(--lp-border);
    background: linear-gradient(180deg, var(--lp-surface) 0%, var(--lp-surface-2) 100%);
}

.lp-status-hero-block.operational {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, var(--lp-surface) 100%);
}

.lp-status-hero-block.degraded {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, var(--lp-surface) 100%);
}

.lp-status-big-pulse {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: #22c55e;
    color: rgba(34, 197, 94, 0.5);
    animation: lp-pulse-ring 2.4s ease-in-out infinite;
}

.lp-status-hero-block.degraded .lp-status-big-pulse {
    background: #ef4444;
    color: rgba(239, 68, 68, 0.5);
    animation-duration: 1.6s;
}

.lp-status-page-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 800;
}

.lp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
}

.lp-status-badge.operational {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.lp-status-badge.degraded {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.lp-status-hero-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 18px;
}

.lp-status-hero-stat b {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--lp-primary);
    line-height: 1.2;
}

.lp-status-hero-stat span {
    font-size: 0.68rem;
    color: var(--lp-muted);
    font-weight: 600;
}

.lp-status-updated {
    margin-top: 14px;
    font-size: 0.7rem;
    color: var(--lp-muted);
}

.lp-status-services {
    padding: 12px;
}

.lp-status-services h2 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--lp-muted);
    margin: 0 0 10px 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lp-status-card {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-left: 4px solid var(--lp-accent, #9ca3af);
    border-radius: 12px;
    padding: 14px 14px 12px;
    margin-bottom: 8px;
}

.lp-status-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.lp-status-card-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.lp-status-card-ms {
    font-weight: 800;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}

.lp-status-card-ms.lat-fast { color: #16a34a; }
.lp-status-card-ms.lat-ok { color: #2563eb; }
.lp-status-card-ms.lat-slow { color: #ea580c; }
.lp-status-card-ms.lat-critical { color: #dc2626; }

.lp-status-card-label {
    font-size: 0.72rem;
    font-weight: 600;
}

.lp-status-uptime-bar {
    height: 6px;
    background: var(--lp-surface-2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.lp-status-uptime-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width 0.4s ease;
}

.lp-status-uptime-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--lp-muted);
    margin-top: 4px;
}

.lp-status-timeline {
    margin: 0 12px 12px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    overflow: hidden;
}

.lp-site-item-static {
    cursor: default;
}

.lp-site-item-static .lp-card-main {
    cursor: default;
}

[data-theme="dark"] .navbar-toggler-icon,
[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* 桌面加宽 spark + 双列可选 */
@media (min-width: 992px) {
    body.lp-minimal-mobile.lp-page-dashboard {
        padding-bottom: 0;
    }

    .lp-sticky-head {
        position: relative;
        border-radius: 12px;
        margin: 12px 12px 0;
    }

    .lp-site-list {
        padding: 12px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        align-items: start;
    }

    .lp-site-card {
        height: auto;
        align-self: start;
    }

    .lp-hero-banner,
    .lp-timeline-section {
        margin-left: 12px;
        margin-right: 12px;
    }

    .lp-timeline-collapsible .lp-timeline-head {
        cursor: default;
        pointer-events: none;
    }

    .lp-timeline-collapsible .lp-timeline-chevron {
        display: none;
    }

    .lp-timeline-collapsible .lp-timeline-panel,
    .lp-timeline-collapsible.is-collapsed .lp-timeline-panel {
        display: block !important;
    }

    .lp-timeline-collapsible.is-collapsed .lp-timeline-head {
        border-bottom-color: var(--lp-border);
    }

    .lp-timeline-list {
        max-height: 220px;
    }

    .lp-spark-wrap {
        width: 96px;
        height: 32px;
    }

    .lp-inline-chart {
        height: 200px;
    }

    .lp-bottom-nav {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .lp-site-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* —— 后台移动端 —— */
body.lp-admin-mobile {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

body.lp-admin-mobile .lp-admin-main {
    padding: 0;
    min-height: auto;
}

.lp-admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 1rem;
}

.lp-admin-mhead {
    position: sticky;
    top: 0;
    z-index: 1010;
    background: var(--lp-surface);
    border-bottom: 1px solid var(--lp-border);
    padding: 12px 12px 10px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    backdrop-filter: blur(12px);
}

.lp-admin-mhead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.lp-admin-mhead-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-admin-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    background: var(--lp-surface);
    border-top: 1px solid var(--lp-border);
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(56px + env(safe-area-inset-bottom, 0));
}

.lp-admin-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--lp-muted);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 600;
    padding-top: 6px;
}

.lp-admin-bottom-nav-item i {
    font-size: 1.15rem;
}

.lp-admin-bottom-nav-item.active {
    color: var(--lp-primary);
}

.lp-admin-alert {
    margin: 10px 0;
    border-radius: 10px;
}

/* 网站卡片列表 */
.lp-admin-site-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 0 72px;
}

.lp-admin-site-card {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 14px;
    padding: 14px;
}

.lp-admin-site-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.lp-admin-site-card-name {
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.3;
}

.lp-admin-site-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

.lp-admin-site-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.lp-admin-site-badge.paused {
    background: var(--lp-surface-2);
    color: var(--lp-muted);
}

.lp-admin-site-url {
    display: block;
    font-size: 0.78rem;
    color: var(--lp-primary);
    word-break: break-all;
    text-decoration: none;
    margin-bottom: 8px;
    line-height: 1.4;
}

.lp-admin-site-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.lp-admin-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--lp-surface-2);
    color: var(--lp-text);
}

.lp-admin-tag.muted {
    color: var(--lp-muted);
}

.lp-admin-site-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lp-admin-site-actions form {
    display: contents;
}

.lp-admin-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    background: var(--lp-surface-2);
    color: var(--lp-text);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    padding: 8px 4px;
    width: 100%;
}

.lp-admin-action-btn i {
    font-size: 1rem;
}

.lp-admin-action-btn.primary { color: var(--lp-primary); border-color: rgba(37, 99, 235, 0.25); }
.lp-admin-action-btn.warning { color: #ea580c; border-color: rgba(249, 115, 22, 0.25); }
.lp-admin-action-btn.danger { color: #dc2626; border-color: rgba(239, 68, 68, 0.25); }

.lp-admin-action-btn:active {
    transform: scale(0.97);
}

.lp-admin-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--lp-muted);
}

.lp-admin-empty i {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.75rem;
}

.lp-admin-fab {
    position: fixed;
    right: 16px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--lp-primary);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 全屏表单 */
.lp-site-modal.lp-site-modal-open {
    display: block;
    background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .lp-settings-accordion .accordion-button::after {
    filter: invert(1);
}

/* 站点表单弹窗：PC 居中可滚动，手机全屏 */
.lp-site-modal .modal-content {
    border: none;
    overflow: hidden;
}

.lp-site-modal .lp-site-form {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 760px);
}

.lp-site-modal .lp-site-form .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 576px) {
    .lp-site-modal .modal-dialog {
        margin: 1.75rem auto;
    }

    .lp-site-modal .lp-touch-input {
        font-size: 1rem;
        min-height: 38px;
    }

    .lp-modal-footer {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
    }

    .lp-modal-footer .btn {
        flex: 0 0 auto;
        min-width: 110px;
        min-height: 38px;
    }
}

@media (max-width: 575.98px) {
    .lp-site-modal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    .lp-site-modal .modal-content {
        border-radius: 0;
        height: 100%;
    }

    .lp-site-modal .lp-site-form {
        max-height: none;
        min-height: 100dvh;
    }
}

.lp-modal-header {
    border-bottom: 1px solid var(--lp-border);
    padding: 14px 16px;
    flex-shrink: 0;
}

.lp-modal-body {
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.lp-modal-footer {
    border-top: 1px solid var(--lp-border);
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    flex-shrink: 0;
    background: var(--lp-surface);
}

.lp-modal-footer .btn {
    flex: 1;
    min-height: 44px;
    font-weight: 600;
}

@media (min-width: 576px) {
    .lp-modal-footer .btn {
        flex: 0 0 auto;
    }
}

.lp-form-section {
    margin-bottom: 20px;
    padding-bottom: 4px;
}

.lp-form-section-last {
    margin-bottom: 0;
}

.lp-form-section-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lp-muted);
    margin-bottom: 10px;
}

.lp-touch-input {
    font-size: 16px;
    min-height: 48px;
    border-radius: 10px;
}

.lp-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lp-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--lp-surface-2);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
}

.lp-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lp-toggle-text strong {
    font-size: 0.9rem;
}

.lp-toggle-text small {
    font-size: 0.72rem;
    color: var(--lp-muted);
    line-height: 1.3;
}

.lp-toggle-row .form-check-input {
    width: 2.5em;
    height: 1.35em;
    margin: 0;
    flex-shrink: 0;
}

.lp-adv-details {
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    background: var(--lp-surface-2);
    overflow: hidden;
}

.lp-adv-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: var(--lp-text);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.lp-adv-summary::-webkit-details-marker {
    display: none;
}

.lp-adv-details[open] .lp-adv-chevron {
    transform: rotate(180deg);
}

.lp-adv-chevron {
    transition: transform 0.2s ease;
    color: var(--lp-muted);
}

.lp-adv-panel {
    padding: 0 14px 14px;
    border-top: 1px solid var(--lp-border);
}

.lp-segment {
    display: flex;
    gap: 0;
    background: var(--lp-surface-2);
    border: 1px solid var(--lp-border);
    border-radius: 10px;
    padding: 3px;
}

.lp-segment-btn {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--lp-muted);
    cursor: pointer;
    margin: 0;
}

.btn-check:checked + .lp-segment-btn {
    background: var(--lp-primary);
    color: #fff;
}

.lp-code-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lp-code-chip {
    margin: 0;
    cursor: pointer;
}

.lp-code-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lp-code-chip span {
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--lp-border);
    background: var(--lp-surface-2);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--lp-muted);
    transition: all 0.15s ease;
}

.lp-code-chip.is-checked span,
.lp-code-chip input:checked + span {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--lp-primary);
    color: var(--lp-primary);
}

/* 控制台 */
.lp-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.lp-admin-stat {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.lp-admin-stat b {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.lp-admin-stat span {
    font-size: 0.72rem;
    color: var(--lp-muted);
}

.lp-admin-stat.ok b { color: #22c55e; }
.lp-admin-stat.err b { color: #ef4444; }

.lp-admin-menu-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lp-admin-menu-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--lp-text);
}

.lp-admin-menu-card:active {
    transform: scale(0.99);
}

.lp-admin-menu-card i.icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--lp-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.lp-admin-menu-card .info {
    flex: 1;
    min-width: 0;
}

.lp-admin-menu-card .info strong {
    display: block;
    font-size: 0.95rem;
}

.lp-admin-menu-card .info small {
    color: var(--lp-muted);
    font-size: 0.75rem;
}

.lp-admin-menu-card .arrow {
    color: var(--lp-muted);
}

/* 设置页手风琴 */
.lp-settings-accordion .accordion-item {
    background: var(--lp-surface);
    border: 1px solid var(--lp-border);
    border-radius: 12px !important;
    margin-bottom: 10px;
    overflow: hidden;
}

.lp-settings-accordion .accordion-button {
    background: var(--lp-surface);
    color: var(--lp-text);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 14px 16px;
    box-shadow: none;
}

.lp-settings-accordion .accordion-button:not(.collapsed) {
    background: var(--lp-surface-2);
    color: var(--lp-primary);
}

.lp-settings-accordion .accordion-body {
    padding: 16px;
}

.lp-settings-accordion .btn-primary,
.lp-settings-accordion .btn-warning {
    width: 100%;
    min-height: 44px;
    font-weight: 600;
}

.lp-copy-row {
    display: flex;
    gap: 8px;
}

.lp-copy-row .form-control {
    font-size: 0.75rem;
}

@media (min-width: 992px) {
    body.lp-admin-mobile {
        padding-bottom: 0;
    }

    body.lp-admin-mobile .lp-admin-main {
        padding: 1rem 0 2rem;
    }

    .lp-admin-page {
        padding-top: 0.5rem;
    }

    .lp-admin-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .lp-admin-menu-cards {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .lp-settings-accordion .btn-primary,
    .lp-settings-accordion .btn-warning {
        width: auto;
    }
}
