/**
 * 中国天气预报系统 - 列表页样式
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    text-align: center;
    color: white;
    padding: 30px 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 图例 */
.legend {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-title {
    font-weight: 600;
    color: #555;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.normal {
    background-color: #81c784;
}

.legend-color.warning {
    background-color: #ffb74d;
}

.legend-color.danger {
    background-color: #e57373;
}

/* 操作按钮 */
.actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #555;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* 天气卡片网格 */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 加载状态 */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: white;
    font-size: 1.2rem;
}

/* 天气卡片 */
.weather-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #81c784;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.weather-card.normal {
    border-left-color: #81c784;
}

.weather-card.warning {
    border-left-color: #ffb74d;
}

.weather-card.danger {
    border-left-color: #e57373;
    animation: pulse 2s infinite;
}

/* 危险级别脉冲动画 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 25px rgba(229, 115, 115, 0.4);
    }
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.province-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.temperature {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.temperature::after {
    content: '°C';
    font-size: 1rem;
    font-weight: normal;
}

/* 天气状况 */
.weather-condition {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    display: inline-block;
}

/* 天气详情 */
.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

.detail-item .icon {
    font-size: 1rem;
}

/* 严重程度标签 */
.severity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.severity-badge.normal {
    background-color: #81c784;
}

.severity-badge.warning {
    background-color: #ffb74d;
}

.severity-badge.danger {
    background-color: #e57373;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .legend {
        justify-content: center;
    }
    
    .actions {
        justify-content: center;
    }
    
    .weather-grid {
        grid-template-columns: 1fr;
    }
}
