/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 根变量定义 */
:root {
    --primary-color: #25B4E1;
    --primary-dark: #1E8FBA;
    --primary-light: #E3F7FD;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #E1E8ED;
    --error-color: #FF6B6B;
    --success-color: #51CF66;
    --warning-color: #FFD93D;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --border-radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.icon {
    font-size: 2.2rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 主要内容区域 */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 输入区域 */
.input-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.input-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.url-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--card-background);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.url-input:valid {
    border-color: var(--success-color);
}

.extract-btn {
    padding: 14px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: 100px;
}

.extract-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.extract-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.input-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 加载状态 */
.loading-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 错误状态 */
.error-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--error-color);
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.error-title {
    color: var(--error-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.retry-btn {
    padding: 12px 24px;
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.retry-btn:hover {
    background: #FF5252;
    transform: translateY(-2px);
}

/* 结果区域 */
.result-section {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--success-color);
    overflow: hidden;
}

.result-header {
    background: var(--primary-light);
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.result-title {
    color: var(--success-color);
    font-size: 1.3rem;
    font-weight: 600;
}

.podcast-info {
    padding: 30px;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.podcast-cover {
    flex-shrink: 0;
}

.podcast-image {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.podcast-details {
    flex: 1;
    min-width: 0;
}

.podcast-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

.podcast-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.podcast-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.meta-item {
    background: var(--background-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 音频链接区域 */
.audio-section {
    padding: 30px;
}

.audio-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.audio-link-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.audio-link {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--background-color);
    color: var(--text-primary);
    word-break: break-all;
}

.copy-btn {
    padding: 12px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: 80px;
    position: relative;
}

.copy-btn:hover:not([data-copied="true"]) {
    background: var(--primary-dark);
}

.copy-btn[data-copied="true"] {
    background: var(--success-color);
}

.copy-success {
    display: none;
}

.copy-btn[data-copied="true"] .copy-text {
    display: none;
}

.copy-btn[data-copied="true"] .copy-success {
    display: inline;
}

.download-section {
    text-align: center;
}

.download-btn {
    display: inline-block;
    padding: 14px 28px;
    background: var(--success-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    background: #40C057;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 快捷操作区域 */
.quick-actions-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.quick-actions-header {
    margin-bottom: 20px;
}

.quick-actions-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.quick-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action-btn .btn-icon {
    font-size: 2rem;
    line-height: 1;
}

.quick-action-btn .btn-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.quick-action-btn:hover .btn-text {
    color: var(--primary-color);
}

/* 帮助区域 */
.help-section {
    margin-top: 20px;
}

.help-details {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.help-summary {
    padding: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    transition: var(--transition);
    user-select: none;
}

.help-summary:hover {
    background: var(--primary-light);
}

.help-content {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.help-details[open] .help-content {
    display: block;
}

.help-content h4 {
    color: var(--text-primary);
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.help-content h4:first-child {
    margin-top: 20px;
}

.help-content ol, .help-content ul {
    margin-left: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.help-content li {
    margin-bottom: 8px;
}

.faq-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 5px;
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    margin: 0 5px;
}

.footer-link:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    .extract-btn {
        width: 100%;
    }
    
    .podcast-info {
        flex-direction: column;
        text-align: center;
    }
    
    .podcast-image {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .audio-link-wrapper {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .podcast-meta {
        justify-content: center;
    }
    
    .quick-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .quick-action-btn {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .podcast-info,
    .audio-section {
        padding: 20px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .quick-action-btn {
        flex-direction: column;
        padding: 15px;
    }
}

/* 动画和过渡效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-secondary: #000000;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #1a1a1a;
        --card-background: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-muted: #888888;
        --border-color: #404040;
        --primary-light: #1e3a4a;
    }
}