/* 全局重置和基础样式 */
* {
    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: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* 输入区域样式 */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

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

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

#parse-btn {
    padding: 15px 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
}

#parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

#parse-btn:active {
    transform: translateY(0);
}

#parse-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: none;
}

#parse-btn.loading .btn-text {
    display: none;
}

#parse-btn.loading .btn-loading {
    display: inline;
}

.example {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.example p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.example code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #495057;
}

/* 状态区域样式 */
.status-section {
    margin-bottom: 20px;
}

.status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.status.loading {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

.status.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #17a2b8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 结果区域样式 */
.result {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.result-header h3 {
    color: #28a745;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.video-info {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

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

.info-item:last-child {
    margin-bottom: 0;
}

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

.info-item span, .info-item a {
    color: #007bff;
    text-decoration: none;
    word-break: break-all;
}

.info-item a:hover {
    text-decoration: underline;
}

.download-section {
    margin-bottom: 25px;
}

.download-item h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.url-display {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#download-url {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #495057;
}

#copy-btn {
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-download, .btn-preview {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-download {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.btn-preview {
    background: linear-gradient(45deg, #17a2b8, #6f42c1);
    color: white;
}

.btn-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.3);
}

/* 预览区域样式 */
.preview {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.preview h4 {
    margin-bottom: 15px;
    color: #333;
}

.preview video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 页脚样式 */
footer {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.tips {
    margin-bottom: 25px;
}

.tips h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #666;
}

.tips li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.disclaimer {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    text-align: center;
}

.disclaimer p {
    margin: 0;
    color: #856404;
    font-weight: 500;
}

/* 调试区域样式 */
.debug-section {
    margin-bottom: 20px;
}

.btn-toggle-debug {
    width: 100%;
    padding: 12px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    margin-bottom: 15px;
}

.btn-toggle-debug:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.debug-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

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

.debug-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.btn-clear, .btn-copy-logs {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.btn-clear {
    background: #dc3545;
    color: white;
}

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

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

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

.debug-logs {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-logs:empty::before {
    content: "暂无日志信息...";
    color: #6c757d;
    font-style: italic;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    border-left: 4px solid #dee2e6;
}

.log-entry.info {
    background: rgba(23, 162, 184, 0.1);
    border-left-color: #17a2b8;
}

.log-entry.error {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
}

.log-entry.success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
}

.log-entry.warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.log-timestamp {
    color: #6c757d;
    font-size: 12px;
    margin-right: 8px;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    #parse-btn {
        width: 100%;
    }

    .actions {
        flex-direction: column;
    }

    .btn-download, .btn-preview {
        text-align: center;
    }

    .url-display {
        flex-direction: column;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .info-item label {
        min-width: auto;
    }
}
