* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === 视觉升级（简约高级风） === */
:root {
    --bg-1: #f4f6f1;
    --bg-2: #eef4ee;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --text-strong: #1b2a1f;
    --text-muted: #5c6b61;
    --accent: #7fbf7a;
    --accent-strong: #4a9b64;
    --shadow-lg: 0 18px 40px rgba(18, 30, 22, 0.12);
    --shadow-md: 0 10px 24px rgba(18, 30, 22, 0.12);
    --card-border: rgba(255, 255, 255, 0.7);
}

body {
    font-family: "Manrope", "Noto Sans SC", "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: radial-gradient(circle at 15% 10%, rgba(168, 217, 156, 0.35), transparent 45%),
        radial-gradient(circle at 90% 0%, rgba(127, 191, 122, 0.25), transparent 35%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--text-strong);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px);
    background-size: 18px 18px;
    opacity: 0.25;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    padding: 18px 16px 140px;
    max-width: 1100px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 14px;
}

.mini-back-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(74, 155, 100, 0.2);
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.mini-back-icon {
    font-size: 18px;
    line-height: 1;
}

.app-brand {
    flex: 1;
    text-align: center;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.app-subtitle {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.app-status {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(127, 191, 122, 0.18);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 600;
}

.weather-section {
    margin-bottom: 12px;
}

.weather-card {
    border-radius: 18px;
    padding: 18px 20px;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #9fd8a5 0%, #7fbf7a 55%, #6aad73 100%);
    position: relative;
    overflow: hidden;
}

.weather-card::after {
    content: "";
    position: absolute;
    top: -40px;
    right: -30px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45), transparent 60%);
    opacity: 0.7;
}

.main-layout {
    gap: 18px;
    padding: 0;
}

.monitor-section {
    background: var(--surface);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.monitor-tabs {
    padding: 14px 14px 8px;
    background: transparent;
    border-bottom: 1px solid rgba(15, 23, 18, 0.08);
}

.tab-button {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 18, 0.08);
    font-weight: 600;
    color: var(--text-muted);
}

.tab-button.active {
    background: linear-gradient(135deg, rgba(127, 191, 122, 0.95), rgba(74, 155, 100, 0.95));
    color: #fff;
    box-shadow: 0 6px 16px rgba(74, 155, 100, 0.35);
}

.monitor-content {
    padding: 16px;
}

.video-container {
    border-radius: 16px;
    background: #0e1511;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.status-bar {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 23, 18, 0.08);
    border-radius: 14px;
    gap: 16px;
}

.refresh-btn {
    border-radius: 999px;
    background: rgba(127, 191, 122, 0.12);
    border: 1px solid rgba(74, 155, 100, 0.2);
}

.panorama-section {
    position: relative;
}

.panorama-card {
    border-radius: 18px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-md);
    background: var(--surface);
    backdrop-filter: blur(10px);
}

.panorama-header {
    padding: 16px 18px;
}

.panorama-title h2 {
    font-size: 16px;
    letter-spacing: 0.3px;
}

.share-poster-btn,
.back-home-btn,
#launchBtn {
    border-radius: 18px;
}

.back-home-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--accent-strong);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(74, 155, 100, 0.2);
}

.back-home-btn span {
    font-size: 10px;
    color: var(--text-muted);
}

.share-poster-btn {
    width: 56px;
    height: 56px;
    background: rgba(255, 165, 0, 0.92);
    box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-wrap: wrap;
    }
    .app-brand {
        order: 3;
        width: 100%;
    }
    .app-status {
        order: 2;
    }
    .mini-back-btn {
        order: 1;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 0;
    /* 禁止移动端双击缩放 */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 100%;
    margin: 0 auto;
}

/* 顶部天气栏 - 绿色主题 */
.weather-section {
    margin: 0;
}

.weather-card {
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(140, 199, 117, 0.3);
}

.access-block {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    padding: 24px;
}

.access-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 20px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.access-title {
    font-size: 18px;
    font-weight: 600;
    color: #2f6f2f;
    margin-bottom: 10px;
}

.access-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 18px;
}

.access-btn {
    border: none;
    background: #6AB344;
    color: #ffffff;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(106, 179, 68, 0.35);
}

.access-btn:active {
    transform: translateY(1px);
}

.weather-loading {
    text-align: center;
    padding: 8px;
    color: white;
    font-size: 14px;
}

.weather-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 15px;
}

.weather-left {
    display: flex;
    align-items: center;
    gap: 5px;
    color: white;
    flex-shrink: 1;
    min-width: 0;
}

.weather-location-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.weather-location-text {
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    flex-shrink: 0;
}

.weather-temp-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-meta-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    opacity: 0.95;
}

.weather-meta-item {
    white-space: nowrap;
}

.weather-icon-large {
    font-size: 28px;
}

.weather-temp {
    font-size: 20px;
    font-weight: 600;
}

/* 未来天气预报 - 折线图样式 */
.weather-forecast {
    position: relative;
    margin-top: 12px;
    padding: 8px 0;
    height: 60px;
}

/* 折线图容器 */
.forecast-chart {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 10px;
}

/* SVG折线 */
.forecast-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.forecast-line path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.8);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.forecast-line circle {
    fill: white;
    stroke: rgba(140, 199, 117, 0.3);
    stroke-width: 3;
}

/* 预报数据点 */
.forecast-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    transition: all 0.3s ease;
}

.forecast-item:hover .forecast-temp {
    transform: scale(1.15);
    font-weight: 700;
}

.forecast-time {
    font-size: 11px;
    opacity: 0.85;
    font-weight: 500;
    color: white;
    margin-bottom: 2px;
}

.forecast-temp {
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.forecast-icon {
    font-size: 16px;
    margin-top: auto;
}

/* 返回首页按钮 */
.back-home-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    border-radius: 50%;
    display: none; /* 默认隐藏，通过JS控制显示 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(140, 199, 117, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* 微信开放标签按钮 */
#launchBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    display: none; /* 默认隐藏，通过JS控制显示 */
    z-index: 1000;
}

.back-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(140, 199, 117, 0.5);
}

.back-home-btn:active {
    transform: translateY(-1px);
}

.back-home-btn svg {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
}

.back-home-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* 分享海报按钮 */
.share-poster-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.share-poster-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.5);
}

.share-poster-btn:active {
    transform: translateY(-1px);
}

.share-poster-btn svg {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
}

.share-poster-btn span {
    font-size: 11px;
    font-weight: 500;
}

/* 海报弹窗 */
.poster-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.poster-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.poster-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.poster-close-btn {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.poster-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.poster-image-container {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.poster-image-container img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    /* 允许长按保存，不禁用用户选择 */
    -webkit-touch-callout: default;
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    pointer-events: auto;
}

.poster-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.poster-hint svg {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.poster-hint p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .weather-card {
        padding: 10px 15px;
    }
    
    .weather-info {
        gap: 12px;
    }
    
    .weather-location-text {
        font-size: 12px;
    }
    
    .weather-icon-large {
        font-size: 28px;
    }
    
    .weather-temp {
        font-size: 20px;
    }
    
    .weather-details {
        font-size: 11px;
        gap: 15px;
    }
    
    .back-home-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .back-home-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .back-home-btn span {
        font-size: 10px;
    }
    
    .share-poster-btn {
        bottom: 85px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .share-poster-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .share-poster-btn span {
        font-size: 10px;
    }
    
    .poster-modal-content {
        max-width: 95%;
    }
    
    .poster-close-btn {
        top: -45px;
        width: 36px;
        height: 36px;
    }
    
    .poster-hint {
        bottom: 20px;
        padding: 12px 24px;
        font-size: 13px;
    }
    
    .poster-hint svg {
        width: 24px;
        height: 24px;
    }
}

/* 主内容区域 */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 15px;
    padding: 15px;
}

/* 监控区域 */
.monitor-section {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.monitor-tabs {
    display: flex;
    background: #fafafa;
    padding: 10px;
    gap: 8px;
    border-bottom: 1px solid #e8e8e8;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* 隐藏滚动条但保持滚动功能 */
.monitor-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.tab-button {
    flex: 0 0 auto;
    min-width: 120px;
    padding: 10px 16px;
    background: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.tab-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(140, 199, 117, 0.3);
    color: #8CC775;
}

.tab-button.active {
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(140, 199, 117, 0.4);
}

.monitor-content {
    padding: 15px;
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 13px;
    color: #495057;
    gap: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    color: #868e96;
    font-weight: 400;
}

.status-value {
    color: #212529;
    font-weight: 600;
}

.status-value.playing {
    color: #8CC775;
}

.status-value.stopped {
    color: #868e96;
}

.status-value.loading {
    color: #ff9800;
}

.status-value.online {
    color: #2e7d32;
}

.status-value.offline {
    color: #d32f2f;
}

.status-value.checking {
    color: #ff9800;
}

/* 刷新按钮 */
.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #8CC775 0%, #6AB344 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(140, 199, 117, 0.3);
}

.refresh-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(140, 199, 117, 0.5);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn svg {
    color: white;
    transition: transform 0.6s;
}

.refresh-btn:active svg {
    transform: rotate(360deg);
}

.protocol-btn {
    border: 1px solid rgba(74, 155, 100, 0.25);
    background: rgba(255, 255, 255, 0.85);
    color: #2f6f2f;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    display: none;
    white-space: nowrap;
}

.protocol-btn:active {
    transform: translateY(1px);
}

/* video元素隐藏控制条 */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-enclosure {
    display: none !important;
}

video::-webkit-media-controls-panel {
    display: none !important;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* 云台控制器 - 放在视频下方 */
.ptz-controller {
    margin-top: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.ptz-controller-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ptz-controller-title::before {
    content: '🎮';
    font-size: 18px;
}

/* 云台控制头部 */
.ptz-controller-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* 信号状态指示器 */
.ptz-signal-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.ptz-signal-status .signal-icon {
    font-size: 14px;
    line-height: 1;
}

.ptz-signal-status .signal-text {
    line-height: 1;
}

/* 待机状态 - 灰色 */
.ptz-signal-status.idle {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.ptz-signal-status.idle .signal-icon {
    color: #adb5bd;
}

/* 发送中状态 - 橙色闪烁 */
.ptz-signal-status.sending {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #f57c00;
    border: 1px solid #ffb74d;
    animation: pulse 1.5s ease-in-out infinite;
}

.ptz-signal-status.sending .signal-icon {
    color: #ff9800;
    animation: blink 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 152, 0, 0);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* 成功状态 - 绿色 */
.ptz-signal-status.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #388e3c;
    border: 1px solid #81c784;
}

.ptz-signal-status.success .signal-icon {
    color: #4caf50;
}

/* 错误状态 - 红色 */
.ptz-signal-status.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #d32f2f;
    border: 1px solid #ef5350;
}

.ptz-signal-status.error .signal-icon {
    color: #f44336;
}

.ptz-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    max-width: 220px;
    margin: 0 auto 15px;
}

.ptz-btn {
    height: 60px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: 24px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, background, border-color;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 🔥 完全禁用transition，避免状态粘滞 */
    transition: none !important;
}

/* 🚫 强制禁用:active伪类 */
.ptz-btn:active {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
    transform: translateZ(0) !important;
}

.ptz-btn:hover {
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    border-color: #8CC775;
    color: white;
    box-shadow: 0 4px 8px rgba(140, 199, 117, 0.3);
}

.ptz-btn.center {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
    border-color: #ff6b6b;
    color: white;
    font-size: 20px;
}

.ptz-btn.center:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff6b6b 100%);
    border-color: #ff5252;
}

.ptz-zoom {
    display: flex;
    gap: 10px;
    max-width: 220px;
    margin: 0 auto;
}

.ptz-zoom-btn {
    flex: 1;
    height: 50px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    font-size: 24px;
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform, background, border-color;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* 🔥 禁用transition */
    transition: none !important;
}

/* 🚫 强制禁用:active伪类 */
.ptz-zoom-btn:active {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    border-color: #dee2e6 !important;
    color: #495057 !important;
    transform: translateZ(0) !important;
}

.ptz-zoom-btn:hover {
    background: linear-gradient(135deg, #4dabf7 0%, #74c0fc 100%);
    border-color: #4dabf7;
    color: white;
    box-shadow: 0 4px 8px rgba(77, 171, 247, 0.3);
}

/* 云台控制消息提示 */
.ptz-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ptz-message-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border: 1px solid #90caf9;
}

.ptz-message-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #388e3c;
    border: 1px solid #81c784;
}

.ptz-message-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #f57c00;
    border: 1px solid #ffb74d;
}

.ptz-message-error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #d32f2f;
    border: 1px solid #ef5350;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}

.video-container .cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.cover-image.hidden {
    display: none;
}

/* 播放按钮 */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(140, 199, 117, 0.9);
    border-radius: 50%;
    border: 4px solid white;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.play-button:hover {
    background: rgba(140, 199, 117, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-button.hidden {
    display: none;
}

.play-button::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 25px solid white;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    margin-left: 5px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    color: white;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #8CC775;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 12px;
    font-size: 13px;
}

/* 拉流进度条 */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8CC775, #A8D99C);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0;
}

.loading-percentage {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #8CC775;
}

/* 全景VR - 优化样式 */
.panorama-section {
    display: flex;
    flex-direction: column;
}

.panorama-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    height: fit-content;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.panorama-card:hover {
    box-shadow: 0 6px 24px rgba(140, 199, 117, 0.25);
    border-color: rgba(140, 199, 117, 0.3);
}

.panorama-card.expanded {
    box-shadow: 0 8px 32px rgba(140, 199, 117, 0.3);
    border-color: #8CC775;
    transform: translateY(-2px);
}

.panorama-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #8CC775 0%, #A8D99C 100%);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.3s;
    position: relative;
}

.panorama-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.panorama-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.panorama-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.panorama-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.panorama-card.expanded .panorama-header::after {
    transform: scaleX(1);
}

.panorama-header:hover {
    background: linear-gradient(135deg, #7AB665 0%, #98C88C 100%);
    transform: translateY(-1px);
}

.panorama-header h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
    color: white;
}

.toggle-icon {
    font-size: 16px;
    color: white;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.panorama-card.expanded .toggle-icon {
    transform: rotate(180deg) scale(1.1);
}

.panorama-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
    padding: 0;
    background: #f8f9fa;
    position: relative;
}

.panorama-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #8CC775;
    z-index: 10;
    display: none;
}

.panorama-card.expanded.loading .panorama-loading {
    display: block;
}

.loading-icon {
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.panorama-card.expanded .panorama-content {
    max-height: 700px;
    padding: 15px;
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#panoramaFrame {
    width: 100%;
    height: 650px;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef3 100%);
}

/* 动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式 */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .panorama-section {
        order: -1;
    }
    
    #panoramaFrame {
        height: 500px;
    }
    
    .panorama-card.expanded .panorama-content {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 10px;
    }
    
    .weather-card {
        padding: 10px 15px;
    }
    
    .weather-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .weather-location-text {
        font-size: 12px;
    }
    
    .weather-details {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .monitor-tabs {
        gap: 6px;
        padding: 8px;
    }
    
    .tab-button {
        flex: 0 0 auto;
        min-width: 90px;
    }
    
    #panoramaFrame {
        height: 300px;
    }
    
    .panorama-card.expanded .panorama-content {
        max-height: 300px;
    }
}

/* 协议切换弹窗 */
.protocol-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.protocol-modal.show {
    display: flex;
}

.protocol-card {
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.protocol-title {
    font-size: 15px;
    font-weight: 600;
    color: #2f6f2f;
    margin-bottom: 12px;
    text-align: center;
}

.protocol-list {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.protocol-item {
    border: 1px solid #e0e6eb;
    background: #f7f9fb;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #2f6f2f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.protocol-item.active {
    background: rgba(127, 191, 122, 0.18);
    border-color: rgba(74, 155, 100, 0.35);
}

.protocol-item.disabled {
    color: #9aa0a6;
    background: #f3f4f6;
    cursor: not-allowed;
}

.protocol-close-btn {
    width: 100%;
    border: none;
    background: #6AB344;
    color: #ffffff;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 999px;
    cursor: pointer;
}
