/* ---------- 基础通用样式 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
    color: #ffffff !important;
    font-weight: bold !important;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #111;
}

/* ---------- 背景 ---------- */
body {
    background: url('白丝小姐姐.jpg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
}

/* ---------- 玻璃卡片基类（优化后） ---------- */
.glass-bg {
    background: rgba(255, 255, 255, 0.1); /* 背景透明度提升到 18% */
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255,0.1);/*透明度提升到 25% */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* 阴影加深，增强层次感 */
    backdrop-filter: blur(1px); /* 模糊度降低，更清晰 */
    -webkit-backdrop-filter: blur(10px);
    padding: 0.9rem;
}

/* ---------- 页面布局 ---------- */
.glass {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    gap: 1.6rem;
    padding: 2rem;
    overflow: auto;
}

/* 左右面板（卡片容器） */
.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.left-panel {
    flex: 3;
}

.right-panel {
    flex: 1.8;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* 自定义滚动条 */
.right-panel::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.right-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

/* ---------- 地图容器（优化后） ---------- */
.map-box {
    flex: 65%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1); /* 10% 透明度 */
    backdrop-filter: blur(10px); /* 10px 模糊，平衡玻璃感和地图清晰度 */
    -webkit-backdrop-filter: blur(10px); /* 统一模糊值 */
}

#map {
    width: 100%;
    height: 100%;
}

/* ---------- 按钮 & 图标 ---------- */
.magnifier,
.gps-icon {
    position: absolute;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    z-index: 10;
    transition: background-color .2s;
}

.magnifier {
    top: 1.2rem;
    right: 1.2rem;
    width: 48px;
    height: 48px;
    background: url('https://cdn-icons-png.flaticon.com/512/992/992651.png') no-repeat center;
    background-size: 24px 24px;
}

.gps-icon {
    top: 1.2rem;
    left: 1.2rem;
    width: 48px;
    height: 48px;
    background: url('https://cdn-icons-png.flaticon.com/512/684/684908.png') no-repeat center;
    background-size: 24px 24px;
}

.magnifier:hover,
.gps-icon:hover {
    background-color: #f0f0f0;
}

/* ---------- 搜索栏（优化后） ---------- */
.search-bar {
    position: absolute;
    left: 2rem;
    bottom: 2rem;
    display: flex;
    background: rgba(255, 255, 255, 0.1); /* 降低到 20% 透明度 */
    border: 1px solid rgba(255, 255, 255, 0.2); /* 边框透明度同步降低 */
    border-radius: 12px;
    backdrop-filter: blur(20px);/* 轻微模糊即可 */
    padding: 8px 10px;
}

.search-bar input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.15) !important;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: normal !important;
}

.search-bar button {
    margin-left: 0.6rem;
    padding: 0.6rem 1rem;
    background: #3083ff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

.search-bar button:hover {
    background: #2569e6;
}

/* ---------- 地址卡片 ---------- */
.address-card .address-line {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.address-card .address-line:last-child {
    border-bottom: none;
}

.address-card label {
    flex: 0 0 80px;
    font-size: 1rem;
}

.address-card input {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15) !important;
    font-size: 0.95rem;
}

.address-card input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: normal !important;
}

.address-card span {
    flex: 1;
    font-size: 0.95rem;
}

/* ---------- 天气卡片 ---------- */
.weather-item {
    margin-bottom: 0.8rem;
}

.weather-item:last-child {
    margin-bottom: 0;
}

.weather-item label {
    margin-bottom: 0.3rem;
    display: block;
    font-size: 1rem;
}

.weather-combo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.weather-icon {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.weather-combo span,
.value-display {
    font-size: 1.2rem;
}

/* ---------- 预报卡片容器（优化后） ---------- */
.forecast-container > label {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

#forecastCards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.daily-forecast-card {
    background: rgba(255, 255, 255, 0.15); /* 15% 透明度 */
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2); /* 20% 边框透明度 */
    transition: transform .2s ease-in-out, border-color .2s ease-in-out, background .2s; /* 增加背景过渡 */
}

.daily-forecast-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.2); /* hover 时 20% 透明度 */
}

.daily-forecast-card .card-header {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.4rem;
}

.daily-forecast-card .card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem 0.5rem;
    font-size: 0.95rem;
}

.daily-forecast-card .card-item {
    display: flex;
    flex-direction: column;
}

.daily-forecast-card .card-item-label {
    color: #ffffff !important;
    font-weight: 900 !important;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.daily-forecast-card .card-item-value {
    font-size: 1rem;
}

/* ---------- 语音播报按钮 ---------- */
#broadcastBtn {
    align-self: center;
    width: 100%;
    padding: 0.9rem 1.5rem;

    /* 统一玻璃拟态样式 */
    background: rgba(255, 255, 255, 0.1); /* 25% 透明玻璃背景 */
    color: #ffffff !important; /* 文字白色 */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 半透明边框 */
    border-radius: 12px; /* 统一圆角 */

    /* 毛玻璃效果 */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* 阴影增强层次感 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);

    cursor: pointer;
    font-size: 1rem;
    transition: all .3s ease-in-out; /* 稍慢的过渡效果更显优雅 */
}

#broadcastBtn:hover {
    /* hover 时增强透明度和边框效果 */
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    /* 增强阴影 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#broadcastBtn.playing {
    /* 播放状态使用醒目的主题色，同时保留玻璃质感 */
    background: rgb(243, 239, 239); /* 使用搜索栏的蓝色 #3083ff */
    border-color: rgb(243, 239, 239);
    color: #ffffff !important;
    animation: pulse 1.5s infinite;
}

/* ---------- 加载提示 ---------- */
.loading {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 10;
    animation: fadeIn .3s ease-out;
    color: #000 !important;
    font-weight: 600 !important;
}

/* ---------- 系统提示 ---------- */
.system-tip {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.2rem;
    z-index: 20;
    font-size: 1rem;
    cursor: pointer;
    animation: slideDown .6s ease-out;
}

/* ---------- 卡片交互动画 ---------- */
.card {
    transition: transform .2s, border-color .2s;
}

.card:active {
    transform: scale(0.97);
    border-color: #ff4d4f;
}

/* ---------- 心跳/脉冲动画 ---------- */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.05);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 77, 79, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0);
    }
}

/* ---------- 数值变化动画 ---------- */
@keyframes valuePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #ffd700 !important;
    }
    100% {
        transform: scale(1);
    }
}

.value-change-animation {
    animation: valuePulse .8s ease-out;
}

@keyframes tempRise {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(5px);
        color: #ff4d4f !important;
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(5px);
        color: #ff4d4f !important;
    }
    100% {
        transform: translateX(0);
    }
}

.temp-rise-animation {
    animation: tempRise 1s ease-in-out;
}

@keyframes tempDrop {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
        color: #409eff !important;
    }
    50% {
        transform: translateX(0);
    }
    75% {
        transform: translateX(-5px);
        color: #409eff !important;
    }
    100% {
        transform: translateX(0);
    }
}

.temp-drop-animation {
    animation: tempDrop 1s ease-in-out;
}

/* ---------- 弹窗 ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    height: 80%;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#modalMap {
    width: 100%;
    height: 100%;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: #fff url('https://cdn-icons-png.flaticon.com/512/1828/1828774.png') no-repeat center;
    background-size: 16px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 20;
    transition: background-color .2s;
}

.close-modal:hover {
    background-color: #f0f0f0;
}

/* ---------- 响应式布局 ---------- */
@media (max-width: 1023px) and (min-width: 768px) {
    .glass {
        flex-direction: row;
        padding: 1.4rem;
        gap: 1.2rem;
    }

    .left-panel {
        flex: 2.5;
    }

    .right-panel {
        flex: 1.5;
    }

    .map-box {
        flex: 60%;
    }
}

@media (max-width: 767px) {
    .glass {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        overflow-y: auto;
    }

    .left-panel, .right-panel {
        flex: none;
        width: 100%;
        margin: 0;
    }

    .map-box {
        height: 250px;
        flex: none;
    }

    .right-panel {
        margin-top: 1rem;
    }

    .search-bar {
        left: 50%;
        transform: translateX(-50%);
        bottom: 1rem;
        width: 90%;
    }

    .gps-icon {
        right: 10px;
        bottom: 10px;
        width: 40px;
        height: 40px;
        background-size: 20px 20px;
    }

    .magnifier {
        width: 40px;
        height: 40px;
        background-size: 20px 20px;
    }

    .address-line input,
    .weather-combo span,
    .search-bar input,
    .search-bar button,
    #broadcastBtn {
        font-size: 0.95rem;
    }
}

/* ---------- 加载提示文字颜色（黑色） ---------- */
#loadingTip.loading {
    color: #000 !important;
}

/* ---------- 自定义弹窗样式（优化后） ---------- */
.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.25); /* 25% 透明玻璃背景 */
    color: #ffffff !important; /* 文字白色，与整体风格一致 */
    padding: 20px 30px;
    border-radius: 12px; /* 圆角与其他卡片统一 */
    z-index: 9999;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* 深色阴影，增强层次感 */
    backdrop-filter: blur(1px); /* 玻璃模糊效果 */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3); /* 半透明边框 */
}