/* 仅作用于天文图组件内部的样式 */
.apod-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
}

.apod-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.apod-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.apod-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.apod-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apod-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
}

.apod-date-picker {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.apod-date-picker input[type="date"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 1rem;
    color: #1E293B;
    outline: none;
    transition: all 0.3s ease;
}

.apod-date-picker input[type="date"]:focus {
    border-color: #165DFF;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.2);
}

.apod-date-picker button {
    background-color: #165DFF;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.apod-date-picker button:hover {
    background-color: #0D47A1;
    transform: translateY(-1px);
}

.apod-content {
    padding: 2rem;
}

.apod-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    aspect-ratio: 16/9;
    background-color: #E2E8F0;
}

.apod-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
}

.apod-loading, .apod-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    text-align: center;
}

.apod-loading-icon {
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
    font-size: 2rem;
    color: #165DFF;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.apod-explanation {
    color: #64748B;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.apod-copyright {
    color: #94A3B8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.apod-download-btn {
    background-color: #36CBCB;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.apod-download-btn:disabled {
    background-color: #94A3B8;
    cursor: not-allowed;
}

/* 标题和下载按钮容器样式 */
.apod-title-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .apod-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }
    
    .apod-title {
        font-size: 1.25rem;
    }
    
    .apod-content {
        padding: 1.5rem 1rem;
    }

    /* 移动端下载按钮独立成行 */
    .apod-title-actions {
        flex-direction: column;
        align-items: flex-start; /* 标题左对齐 */
        gap: 1rem; /* 标题和按钮之间留出间距 */
    }

    .apod-title-actions .apod-download-btn {
        width: 100%; /* 按钮占满一行 */
        justify-content: center; /* 按钮内容居中 */
    }
}