/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo-icon {
    font-size: 3rem;
    margin-right: 15px;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

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

/* 主要内容区域 */
.main {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* 输入区域 */
.input-section {
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.url-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.process-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.process-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.process-btn:active {
    transform: translateY(0);
}

.process-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

.process-btn.loading .btn-text {
    display: none;
}

.process-btn.loading .btn-loading {
    display: inline;
}

/* 支持的平台标签 */
.supported-platforms {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-tag {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* 结果区域 */
.result-section {
    border-top: 1px solid #e1e5e9;
    padding-top: 30px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.result-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.platform-info {
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.process-time {
    color: #6c757d;
    font-size: 14px;
}

/* 视频容器 */
.video-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.video-info {
    margin-bottom: 20px;
}

.video-title {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 20px;
    color: #6c757d;
    font-size: 14px;
    flex-wrap: wrap;
}

.author-info, .video-id {
    margin-top: 8px;
    font-size: 14px;
}

.author-label, .id-label {
    color: #6c757d;
    font-weight: 500;
}

.author-name {
    color: #667eea;
    font-weight: 600;
}

.id-value {
    color: #495057;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* HTML文件信息样式 */
.html-file-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.html-info-header h4 {
    color: #1976d2;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.html-info-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.html-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.html-info-item .info-label {
    font-weight: 600;
    color: #424242;
    min-width: 80px;
}

.html-info-item .info-value {
    color: #1976d2;
    font-family: 'Courier New', monospace;
    background: rgba(25, 118, 210, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.html-link {
    color: #1976d2;
    text-decoration: none;
    word-break: break-all;
    background: rgba(25, 118, 210, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.html-link:hover {
    background: rgba(25, 118, 210, 0.2);
    text-decoration: underline;
}

.html-info-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.view-html-btn, .copy-html-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-html-btn {
    background: #1976d2;
    color: white;
}

.view-html-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

.copy-html-btn {
    background: #4caf50;
    color: white;
}

.copy-html-btn:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* 视频播放器 */
.video-player-container {
    position: relative;
    margin-bottom: 25px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-player {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
}

.video-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.8);
}

.cover-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn, .copy-btn, .share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.copy-btn {
    background: #17a2b8;
    color: white;
}

.copy-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.share-btn {
    background: #6f42c1;
    color: white;
}

.share-btn:hover {
    background: #5a32a3;
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
}

/* 错误区域 */
.error-section {
    text-align: center;
    padding: 40px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 12px;
    color: #721c24;
}

.error-content {
    max-width: 400px;
    margin: 0 auto;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.error-content h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.error-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.retry-btn {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.retry-btn:hover {
    background: #c82333;
}

/* 页脚 */
.footer {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px;
    color: white;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #fff;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
    opacity: 0.9;
    font-size: 14px;
}

/* 文章网格布局 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 12px;
    max-height: 240px;
    overflow: hidden;
}

.article-item {
    color: white;
    text-decoration: none;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.article-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, auto);
        gap: 8px;
    }
    
    .article-item {
        font-size: 11px;
        padding: 6px 8px;
        min-height: 28px;
    }
}

@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, auto);
        gap: 6px;
    }
    
    .article-item {
        font-size: 10px;
        padding: 4px 6px;
        min-height: 24px;
    }
}

/* 视频加载警告样式 */
.video-load-warning {
    background: linear-gradient(135deg, #ffa726, #ff9800);
    border: 1px solid #ff9800;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    transition: all 0.3s ease;
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.warning-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.warning-text h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.warning-text p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.warning-text ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.warning-text li {
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.3;
}

/* 小程序提示样式 */
.mini-program-tip {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border: 1px solid #4CAF50;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.tip-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.tip-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.tip-text h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.tip-text p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.5;
}

.mini-program-code {
    margin: 15px 0;
    text-align: center;
}

.code-placeholder {
    display: inline-block;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.code-placeholder span {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
}

.code-placeholder small {
    font-size: 12px;
    opacity: 0.8;
}

.tip-note {
    font-size: 12px;
    opacity: 0.8;
    word-break: break-all;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
}

/* 访问限制信息样式 */
.access-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    border: 1px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: white;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    transition: all 0.3s ease;
}

.access-info-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.access-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.access-text h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.access-text p {
    margin: 0 0 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.access-detail {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.remaining-count {
    color: #4CAF50;
    font-weight: 600;
}

.reset-time {
    color: #FFC107;
    font-weight: 600;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    opacity: 0.8;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .logo-icon {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .main {
        padding: 25px;
        border-radius: 15px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .process-btn {
        width: 100%;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .download-btn, .copy-btn, .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .main {
        padding: 20px;
    }
    
    .logo {
        font-size: 1.8rem;
    }
    
    .logo-icon {
        font-size: 2rem;
    }
    
    .video-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .supported-platforms {
        gap: 8px;
    }
    
    .platform-tag {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 成功提示 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-message::before {
    content: "✅";
    font-size: 1.2rem;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .main {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .url-input {
        background: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .url-input:focus {
        background: #34495e;
        border-color: #667eea;
    }
    
    .video-container {
        background: #34495e;
    }
    
    .video-title {
        color: #ecf0f1;
    }
    
    .result-header h2 {
        color: #ecf0f1;
    }
}
