/* 天气预报页面样式 */

.tool-content {
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 搜索区域样式 */
.search-area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px 30px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.search-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-subtitle {
    text-align: center;
    opacity: 0.9;
    margin-bottom: 30px;
    font-size: 16px;
}

/* 常用城市样式 */
.common-cities {
    max-width: 650px;
    margin: 20px auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.common-cities-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.common-cities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.city-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 650px;
    margin: 0 auto;
    align-items: stretch;
}

.search-input-group {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-input::placeholder {
    color: #888;
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-height: 240px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    border: 1px solid #e0e0e0;
}

.suggestion-item {
    padding: 14px 20px;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #f8f9ff;
    color: #667eea;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* 按钮样式 */
.search-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    height: 52px;
    padding: 0 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    box-sizing: border-box;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 天气容器 */
.weather-container {
    display: grid;
    gap: 24px;
}

/* 当前天气卡片 */
.current-weather-card {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.current-weather-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.current-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.current-location {
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-icon {
    font-size: 18px;
}

.location-name {
    font-size: 20px;
    font-weight: 600;
}

.update-time {
    font-size: 14px;
    opacity: 0.8;
}

.current-main {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 30px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.current-temp {
    font-size: 4rem;
    font-weight: 300;
    line-height: 1;
}

.current-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.weather-desc {
    font-size: 18px;
    font-weight: 500;
}

.feels-like {
    font-size: 14px;
    opacity: 0.9;
}

.weather-icon {
    font-size: 4rem;
    opacity: 0.9;
}

.current-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
}

/* 预报区域 */
.forecast-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.forecast-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.forecast-date {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.forecast-icon {
    font-size: 2.5rem;
    margin: 12px 0;
}

.forecast-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.forecast-temp {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.temp-high {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.temp-low {
    font-size: 14px;
    color: #999;
}

/* 生活指数区域 */
.life-index-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.index-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.index-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.index-name {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.index-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.index-desc {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

/* 消息提示样式 */
.message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.message.info {
    background-color: #cce7ff;
    border: 1px solid #b3d9ff;
    color: #004085;
}

/* 底部推荐工具 */
.bottom-recommendations {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-area {
        padding: 30px 20px;
        margin: 0 -10px 30px -10px;
    }
    
    .search-title {
        font-size: 24px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-buttons {
        justify-content: center;
        gap: 12px;
    }
    
    .btn {
        flex: 1;
        min-width: auto;
    }
    
    .common-cities {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .common-cities-list {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .current-main {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    
    .current-details {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forecast-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .index-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .search-area {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .search-title {
        font-size: 22px;
    }
    
    .search-subtitle {
        font-size: 14px;
    }
    
    .search-input {
        height: 48px;
        font-size: 15px;
    }
    
    .btn {
        height: 48px;
        font-size: 15px;
        padding: 0 20px;
    }
    
    .search-buttons {
        flex-direction: column;
    }
    
    .city-tag {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    .common-cities-list {
        gap: 6px;
    }
    
    .current-temp {
        font-size: 3rem;
    }
    
    .weather-icon {
        font-size: 3rem;
    }
    
    .forecast-container {
        grid-template-columns: 1fr;
    }
    
    .current-details {
        grid-template-columns: 1fr;
    }
}
