/* 天气信息显示样式 */

.weather-info {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: normal;
    background: none !important;
    padding: 0 10px;
    border-radius: 0;
    border-left: 1px solid #ddd;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
}

.weather-city {
    cursor: pointer;
    text-decoration: underline;
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, sans-serif;
}

/* 位置来源标识样式 */
.weather-city::after {
    font-size: 0.8em;
    color: #7f8c8d;
    font-weight: normal;
    margin-left: 2px;
}

.weather-condition {
    cursor: pointer;
}

.weather-icon {
    display: inline-block;
    padding: 0 3px;
}

.weather-icon-img {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s ease;
}

.weather-icon-img:hover {
    transform: scale(1.1);
}

.weather-tip {
    font-size: 0.7rem;
    color: #bbb;
    cursor: help;
}

/* 加载状态样式 */
.weather-info.loading::after {
    content: " ";
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #7f8c8d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 城市选择模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

#city-selector-modal .modal-content {
    background-color: #fff !important;
    margin: 5% auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 1200px !important; /* 城市选择模态框更大宽度 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    max-height: none !important;
    overflow-y: visible !important;
}

#weather-detail-modal .modal-content {
    background-color: #fff !important;
    margin: 5% auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 12px !important;
    width: 90% !important;
    max-width: 800px !important; /* 保持天气详情模态框原有宽度 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    position: relative !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    max-height: none !important;
    overflow-y: visible !important;
}

#weather-detail-modal .modal-content {
    max-width: 800px;
    max-height: 70vh; /* 限制最大高度 */
    overflow-y: auto; /* 允许垂直滚动 */
}

#city-selector-modal .modal-header, #weather-detail-modal .modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-radius: 12px 12px 0 0;
}

.modal-header .weather-location-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
    line-height: 1.2;
    font-weight: 600;
}

#city-selector-modal .close, #weather-detail-modal .close {
    color: rgba(0, 0, 0, 0.5);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#city-selector-modal .close:hover,
#city-selector-modal .close:focus,
#weather-detail-modal .close:hover,
#weather-detail-modal .close:focus {
    color: #000;
    background-color: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

#city-selector-modal .modal-body, #weather-detail-modal .modal-body {
    padding: 20px;
}

.modal-body p {
    margin-top: 0;
}

.modal-body .form-control {
    width: 25%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 15px;
}

#city-selector-modal .btn, #weather-detail-modal .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 100px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#city-selector-modal .btn-primary, #weather-detail-modal .btn-primary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    border: 1px solid #dee2e6;
}

#city-selector-modal .btn-primary:hover, #weather-detail-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

#city-selector-modal .btn-secondary, #weather-detail-modal .btn-secondary {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #6c757d;
    border: 1px solid #ced4da;
}

#city-selector-modal .btn-secondary:hover, #weather-detail-modal .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
}

#city-selector-modal .btn:active, #weather-detail-modal .btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.popular-cities {
    margin-top: 20px;
}

.popular-cities p {
    margin: 15px 0 10px 0;
    font-weight: bold;
    font-size: 16px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 5px;
}

.city-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* 增加标签间距 */
    margin-top: 15px;
}

.city-tag {
    padding: 7px 12px; /* 调整内边距 */
    border-radius: 20px; /* 调整圆角 */
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    user-select: none;
}

/* 直辖市样式 */
.municipality .city-tag {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee2e6;
}

.municipality .city-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 省会城市样式 */
.provincial .city-tag {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    border: 1px solid #ced4da;
}

.provincial .city-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.city-tag:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 天气详情样式 */

.location-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #495057;
}

.weather-icon-display {
    display: inline-flex;
    align-items: center;
}

.weather-icon-display img {
    width: 24px;
    height: 24px;
}

/* 当前天气详情区域 */
.weather-detail-current {
    margin-bottom: 15px;
}

.weather-info-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.weather-info-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.weather-info-item .label {
    display: block;
    font-size: 0.8rem;
    color: #adb5bd;
    margin-bottom: 3px;
}

.weather-info-item .value {
    display: block;
    font-weight: bold;
    color: #495057;
    font-size: 0.9rem;
}

.weather-condition-main {
    font-weight: bold;
    font-size: 1.2rem;
    color: #495057;
}

/* 7天预报区域 */
.weather-forecast-section {
    margin-bottom: 15px;
}

.weather-forecast-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid #dee2e6;
    display: inline-block;
}

.weather-forecast-container {
    overflow-x: auto;
    padding-bottom: 5px;
}

#weather-forecast-list {
    display: flex;
    gap: 15px;
    min-width: max-content;
    padding: 10px 0;
}

.forecast-day {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 15px 12px;
    text-align: center;
    min-width: 85px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.forecast-day:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    border-color: #dee2e6;
}

.forecast-today {
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
}

.forecast-today:hover {
    background-color: #e9ecef !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1) !important;
}

.forecast-date {
    margin-bottom: 5px;
}

.day-name {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
}

.date-str {
    display: block;
    font-size: 0.7rem;
    color: #6c757d;
}

.forecast-icon {
    margin: 5px 0;
}

.forecast-icon img {
    width: 36px;
    height: 36px;
}

.forecast-weather {
    font-size: 0.8rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.forecast-temp {
    font-size: 0.8rem;
}

.high-temp {
    color: #495057;
    font-weight: bold;
}

.temp-separator {
    color: #adb5bd;
    margin: 0 4px;
    font-weight: bold;
}

.low-temp {
    color: #6c757d;
}

.forecast-loading {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding: 20px;
}

/* 页脚样式 */
.weather-detail-footer {
    text-align: center;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.update-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .modal-content.weather-detail-modal {
        max-width: 700px;
        max-height: 70vh;
    }
}

@media (max-width: 768px) {
    .weather-info {
        display: none;
    }
    
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .weather-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal-content.weather-detail-modal {
        margin: 10% auto;
        max-width: 95%;
    }
}