/* ==================== 视频转音频工具 - 样式 ==================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 
                 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

.container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 640px;
    overflow: hidden;
}

/* ==================== 头部 ==================== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* ==================== 环境状态 ==================== */
.env-status {
    padding: 12px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.env-loading,
.env-ok,
.env-error,
.env-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.status-text {
    font-weight: 500;
}

.status-detail {
    color: #6c757d;
    font-size: 12px;
    padding: 2px 8px;
    background: #e9ecef;
    border-radius: 10px;
}

.env-error {
    color: #dc3545;
}

.env-warning {
    color: #ffc107;
}

.error-list {
    list-style: none;
    padding-left: 0;
    width: 100%;
    margin-top: 8px;
}

.error-list li {
    padding: 6px 12px;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    color: #c92a2a;
}

/* ==================== 安装引导卡片 ==================== */
.install-guide {
    margin: 16px 30px;
    background: #fff9db;
    border: 1px solid #ffe066;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.install-guide.hidden {
    display: none;
}

.install-guide-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, #fff3bf 0%, #ffd8a8 100%);
    border-bottom: 1px solid #ffe066;
}

.install-guide-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}

.install-guide-title h3 {
    font-size: 17px;
    font-weight: 700;
    color: #d9480f;
    margin-bottom: 4px;
}

.guide-method {
    font-size: 13px;
    color: #868e3b;
}

.install-guide-body {
    padding: 20px 24px;
}

.guide-section {
    margin-bottom: 20px;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.guide-section h4::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #667eea;
    border-radius: 2px;
}

/* 命令复制块 */
.guide-commands {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f3f5;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 8px 10px 8px 12px;
    transition: all 0.2s;
}

.cmd-item:hover {
    background: #e7f5ff;
    border-color: #74c0fc;
}

.cmd-code {
    flex: 1;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #1864ab;
    background: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-copy {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 64px;
    text-align: center;
}

.btn-copy:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.btn-copy.copied {
    background: #37b24d;
    color: #fff;
    border-color: #37b24d;
}

/* 步骤列表 */
.guide-steps {
    padding-left: 20px;
    margin: 0;
}

.guide-steps li {
    font-size: 13px;
    color: #495057;
    margin-bottom: 6px;
    line-height: 1.5;
}

.guide-steps li::marker {
    color: #667eea;
    font-weight: 700;
}

/* 手动安装 */
.guide-manual p {
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
    line-height: 1.6;
}

.guide-config-note {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px !important;
    color: #c92a2a !important;
    border-left: 3px solid #fa5252;
}

.guide-path-hint {
    color: #5c7cfa !important;
    font-size: 12px !important;
}

/* 下载链接 */
.guide-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1971c2;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
}

.guide-download:hover {
    color: #1864ab;
    text-decoration: underline;
}

/* 重新检测按钮 */
.install-guide-footer {
    padding: 16px 24px;
    background: #fff9db;
    border-top: 1px solid #ffe066;
    text-align: center;
}

.btn-recheck {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-recheck:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.recheck-icon {
    display: inline-block;
    transition: transform 0.5s;
}

.btn-recheck:hover .recheck-icon {
    transform: rotate(180deg);
}

.loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 主面板 ==================== */
.main-panel {
    padding: 30px;
}

/* ==================== 上传区域 ==================== */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.upload-zone.hidden {
    display: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 13px;
    color: #868e96;
    margin-bottom: 4px;
}

.upload-size-hint {
    font-size: 12px;
    color: #adb5bd;
}

/* ==================== 文件信息 ==================== */
.file-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.file-info.hidden {
    display: none;
}

.file-detail {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    font-size: 32px;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    display: block;
    font-weight: 600;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 13px;
    color: #6c757d;
}

.btn-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #fff5f5;
    color: #dc3545;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #dc3545;
    color: #fff;
}

/* ==================== 转换选项 ==================== */
.convert-options {
    margin-bottom: 24px;
}

.convert-options.hidden {
    display: none;
}

.options-title {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 3px solid #667eea;
}

.option-group {
    margin-bottom: 16px;
}

.option-group label {
    display: block;
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.option-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #212529;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8.825c-.2 0-.4-.07-.55-.22l-3-3a.77.77 0 1 1 1.1-1.08L6 6.95l2.45-2.43a.77.77 0 1 1 1.1 1.08l-3 3a.77.77 0 0 1-.55.22z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.option-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.option-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ==================== 操作按钮 ==================== */
.action-area {
    text-align: center;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 14px 48px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.loading {
    background: linear-gradient(135deg, #adb5bd 0%, #868e96 100%);
}

.btn-primary.loading .btn-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ==================== 进度显示 ==================== */
.progress-area {
    text-align: center;
}

.progress-area.hidden {
    display: none;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    margin-bottom: 4px;
}

.progress-note {
    font-size: 12px;
    color: #868e96;
}

/* ==================== 结果显示 ==================== */
.result-area {
    text-align: center;
}

.result-area.hidden {
    display: none;
}

.result-success {
    background: #f0fff4;
    border: 1px solid #b2f2bb;
    border-radius: 12px;
    padding: 30px;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.result-success h3 {
    color: #2f9e44;
    margin-bottom: 16px;
}

.result-info {
    text-align: left;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.result-info p {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

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

.result-info span {
    font-weight: 600;
    color: #212529;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #40c057 0%, #37b24d 100%);
    color: #fff;
    padding: 14px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(64, 192, 87, 0.4);
}

.download-icon {
    font-size: 18px;
}

.result-hint {
    font-size: 12px;
    color: #868e96;
    margin-top: 16px;
}

/* ==================== 错误显示 ==================== */
.error-area {
    text-align: center;
}

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

.error-content {
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 12px;
    padding: 30px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.error-content h3 {
    color: #c92a2a;
    margin-bottom: 12px;
}

.error-content p {
    color: #495057;
    margin-bottom: 16px;
}

.error-detail {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #868e96;
    text-align: left;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

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

.btn-retry {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-retry:hover {
    background: #667eea;
    color: #fff;
}

/* ==================== 页脚 ==================== */
.footer {
    padding: 16px 30px;
    text-align: center;
    font-size: 12px;
    color: #adb5bd;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 16px;
    }

    .header {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .main-panel {
        padding: 20px;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .option-row {
        grid-template-columns: 1fr;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

    .result-info {
        text-align: left;
    }

    .install-guide {
        margin: 12px 16px;
    }

    .install-guide-header {
        padding: 16px 18px 12px;
    }

    .install-guide-body {
        padding: 16px 18px;
    }

    .install-guide-footer {
        padding: 14px 18px;
    }

    .btn-recheck {
        width: 100%;
        justify-content: center;
    }

    .cmd-item {
        flex-wrap: wrap;
        gap: 6px;
    }

    .cmd-code {
        width: 100%;
    }
}
