/* 全局样式 */
:root {
    --primary-color: #5c6bc0;
    --primary-dark: #3f51b5;
    --accent-color: #ff6f00;
    --success-color: #4caf50;
    --error-color: #f44336;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #607d8b;
    --border-color: #e1e8ed;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* 搜索区域 */
.search-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(92, 107, 192, 0.1);
}

.search-button {
    width: 100%;
    padding: 12px 30px;
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 107, 192, 0.3);
}

.search-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 1.2rem;
}

/* 状态消息 */
.status-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

.status-message.warning {
    background: #fff3e0;
    color: #f57c00;
    border-left: 4px solid #f57c00;
}

/* 加载动画 */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 结果区域 */
.results-section {
    margin-bottom: 40px;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.result-count {
    font-size: 1rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 6px 14px;
    border-radius: 20px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 播客卡片 - 横向布局 */
.podcast-card {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 12px;
    gap: 15px;
}

.podcast-card:hover {
    box-shadow: var(--shadow-hover);
    background: #fafbfc;
}

.podcast-image {
    width: 80px;
    height: 80px;
    min-width: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.podcast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.podcast-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.podcast-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.podcast-artist {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.podcast-genre {
    display: inline-block;
    padding: 2px 10px;
    background: var(--bg-color);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.75rem;
}

.podcast-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* RSS源区域 - 单行显示 */
.podcast-rss {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.rss-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    white-space: nowrap;
}

.rss-link {
    flex: 1;
    padding: 6px 10px;
    background: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-button {
    padding: 6px 14px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.copy-button:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.copy-button:active {
    transform: scale(0.95);
}

.copy-button.copied {
    background: var(--success-color);
}

/* 错误消息 */
.error-message {
    background: #ffebee;
    color: var(--error-color);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--error-color);
    margin-bottom: 20px;
}

.error-message.hidden {
    display: none;
}

/* Toast通知 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

.toast.hidden {
    display: none;
}

.toast.success {
    background: var(--success-color);
}

.toast.warning {
    background: #f57c00;
}

.toast.info {
    background: #1976d2;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .search-section {
        padding: 20px;
    }

    .podcast-card {
        padding: 10px;
        gap: 12px;
    }

    .podcast-image {
        width: 60px;
        height: 60px;
        min-width: 60px;
    }

    .podcast-title {
        font-size: 0.95rem;
    }

    .podcast-artist {
        font-size: 0.8rem;
    }

    .podcast-genre {
        font-size: 0.7rem;
        padding: 2px 8px;
    }

    .podcast-description {
        font-size: 0.8rem;
    }

    .rss-label {
        font-size: 0.7rem;
    }

    .rss-link {
        font-size: 0.7rem;
        padding: 5px 8px;
    }

    .copy-button {
        font-size: 0.7rem;
        padding: 5px 10px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .toast {
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px 0;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

/* 无结果状态 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

