/* 地震查询工具样式 - 使用 eq- 前缀避免与主站样式冲突 */

/* === 工具头部通用样式 === */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.header .header-actions {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
}

.back-btn:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button {
    display: inline-flex;
    align-items: center;
    padding: 6px 18px;
    background-color: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 36px;
    box-sizing: border-box;
    font-family: inherit;
}

.favorite-button:hover {
    background-color: #e8e8e8;
    color: #333;
    transform: translateY(-1px);
}

.favorite-button.favorited {
    background-color: #fff8e1;
    color: #f9a825;
}

.favorite-button.favorited:hover {
    background-color: #ffecb3;
    color: #f57f17;
}

.tool-title {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.tool-subtitle {
    font-size: 16px;
    color: #86868b;
    margin-bottom: 30px;
}

/* === 地震查询容器 === */
.eq-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.eq-main-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* === 筛选栏 === */
.eq-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.eq-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.eq-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eq-filter-group select,
.eq-filter-group input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    min-width: 120px;
    outline: none;
    transition: border-color 0.2s;
}
.eq-filter-group select:focus,
.eq-filter-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.eq-filter-group input {
    min-width: 180px;
}

#countryFilter {
    min-width: 140px;
}

.eq-btn-refresh {
    padding: 8px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.eq-btn-refresh:hover {
    background: #1d4ed8;
}

/* === 统计栏 === */
.eq-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.eq-stat-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.2s;
}

.eq-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.eq-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 6px;
    line-height: 1;
}

.eq-stat-label {
    font-size: 12px;
    color: #86868b;
    font-weight: 500;
}

/* === 加载状态 === */
.eq-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #86868b;
}

.eq-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: eq-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes eq-spin {
    to { transform: rotate(360deg); }
}

/* === 空状态和错误状态 === */
.eq-empty-state,
.eq-error-state {
    text-align: center;
    padding: 60px 20px;
    color: #86868b;
}

.eq-empty-icon,
.eq-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.eq-empty-state p,
.eq-error-state p {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.eq-empty-state span,
.eq-error-state span {
    display: block;
    margin-bottom: 16px;
}

.eq-btn-retry {
    padding: 8px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.eq-btn-retry:hover { background: #1d4ed8; }

/* === 地震列表 === */
.eq-quake-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- 地震卡片 --- */
.eq-quake-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #e5e7eb;
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 90px 1fr auto;
    gap: 20px;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.eq-quake-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateX(2px);
}

/* 左侧边框颜色按震级 */
.eq-quake-item.eq-border-minor { border-left-color: #22c55e; }
.eq-quake-item.eq-border-light { border-left-color: #84cc16; }
.eq-quake-item.eq-border-moderate { border-left-color: #eab308; }
.eq-quake-item.eq-border-strong { border-left-color: #f97316; }
.eq-quake-item.eq-border-major { border-left-color: #ef4444; }
.eq-quake-item.eq-border-great { border-left-color: #991b1b; }

/* --- 震级徽章 --- */
.eq-quake-mag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.eq-quake-mag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
    pointer-events: none;
}

.eq-mag-value {
    font-size: 32px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.eq-mag-label {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

.eq-mag-minor { background: linear-gradient(135deg, #22c55e, #16a34a); }
.eq-mag-light { background: linear-gradient(135deg, #84cc16, #65a30d); }
.eq-mag-moderate { background: linear-gradient(135deg, #eab308, #ca8a04); }
.eq-mag-strong { background: linear-gradient(135deg, #f97316, #ea580c); }
.eq-mag-major { background: linear-gradient(135deg, #ef4444, #dc2626); }
.eq-mag-great { background: linear-gradient(135deg, #991b1b, #7f1d1d); }

/* --- 地震信息 --- */
.eq-quake-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.eq-quake-place {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.eq-quake-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.eq-quake-detail .eq-detail-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.eq-quake-detail .eq-detail-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.eq-dot {
    width: 4px;
    height: 4px;
    background: #d1d5db;
    border-radius: 50%;
    display: inline-block;
    margin: 0 4px;
}

/* --- 右侧元信息 --- */
.eq-quake-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.eq-quake-time {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.eq-tsunami-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    text-align: center;
    white-space: nowrap;
}

.eq-tsunami-tag.warning {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

/* === 弹窗 === */
.eq-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.eq-overlay.active {
    display: flex;
}

.eq-detail-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.eq-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: #86868b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.eq-detail-close:hover {
    background: #f3f4f6;
    color: #1d1d1f;
}

.eq-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 24px;
    padding-right: 40px;
    line-height: 1.4;
}

.eq-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.eq-detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
}

.eq-detail-field .eq-field-label {
    font-size: 11px;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.eq-detail-field .eq-field-value {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}

.eq-detail-map {
    margin-top: 20px;
    height: 280px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #f0f0f0;
}

.eq-detail-map .leaflet-container {
    height: 100%;
    width: 100%;
    border-radius: 10px;
}

.eq-detail-link {
    margin-top: 16px;
    text-align: right;
}

.eq-detail-link a {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.eq-detail-link a:hover {
    text-decoration: underline;
}

/* === 响应式 === */
@media (max-width: 768px) {
    .eq-container { padding: 20px 12px 40px; }
    .tool-title { font-size: 26px; }
    .eq-filter-bar { flex-direction: column; align-items: stretch; }
    .eq-filter-group select,
    .eq-filter-group input { width: 100%; }
    .eq-stats-bar { grid-template-columns: repeat(2, 1fr); }
    .eq-stat-item { padding: 14px 10px; }
    .eq-stat-value { font-size: 22px; }

    .eq-quake-item {
        grid-template-columns: 70px 1fr;
        padding: 16px;
        gap: 14px;
    }
    .eq-quake-mag { width: 70px; height: 70px; border-radius: 12px; }
    .eq-mag-value { font-size: 26px; }
    .eq-quake-meta { display: none; }
    .eq-quake-place { font-size: 14px; }
    .eq-quake-detail { gap: 8px; font-size: 12px; }

    .eq-detail-grid { grid-template-columns: 1fr; }
    .eq-detail-card { padding: 24px; }
}