/* ===== 全局变量定义 ===== */
:root {
    /* 主题颜色 */
    --bg: #0d1117;
    --card: #161b22;
    --border: #30363d;
    --primary: #58a6ff;
    --secondary: #238636;
    --text: #c9d1d9;
    --text2: #8b949e;
    --text3: #328cf1;
    
    /* 尺寸变量 */
    --radius: 12px;
    --radius-sm: 6px;
    
    /* 阴影效果 */
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    /* 导航文本颜色 */
    --nav-text: #2563eb;
}

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

/* ===== 基础样式 ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== 动画效果 ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ===== 布局样式 ===== */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ===== 标题样式 ===== */
h1 {
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

/* ===== 卡片样式 ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display:flex;flex-direction:column;gap:16px
}

/* ===== 步骤标题 ===== */
.step-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-title::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* ===== 文件输入样式 ===== */
.file-input {
    display: none;
}

.file-input-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: #0d1117;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.file-input-label:hover {
    background: #79c0ff;
}

/* ===== 信息文本样式 ===== */
.info-text {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 8px;
}

/* ===== 错误信息样式 ===== */
.error-message {
    color: #f85149;
    font-size: 14px;
    margin-top: 8px;
}

/* ===== 清除按钮样式 ===== */
.clear-button {
    margin-left: 12px;
    padding: 10px 20px;
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.clear-button:hover {
    border-color: #f85149;
    color: #f85149;
}

/* ===== 转换按钮样式 ===== */
.convert-button {
    display: block;
    margin: 40px auto 30px;
    text-align: center;
    padding: 14px 32px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.convert-button.converting,
.convert-button.converting:hover {
    background: var(--border) !important;
}

.convert-button .progress-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #28a745 0%, #34d058 100%);
    transition: width 0.25s ease;
    z-index: 0;
}

.convert-button .btn-text {
    position: relative;
    z-index: 1;
}

.convert-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.convert-button:disabled {
    background: var(--border);
    cursor: not-allowed;
}

/* ===== 结果区域样式 ===== */
.result-area {
    text-align: center;
    max-width: 1200px;
    padding: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: none;
}

.result-image {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* ===== 下载按钮样式 ===== */
.download-button {
    display: inline-block;
    padding: 10px 24px;
    background: var(--primary);
    color: #0d1117;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
}

.download-button:hover {
    background: #79c0ff;
}

/* ===== 文件列表样式 ===== */
.file-list {
    margin-top: 2px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0;
}

.file-row {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.file-row.head {
    background: rgba(88, 166, 255, 0.05);
    font-weight: 600;
    color: var(--primary);
}

.file-row:last-child {
    border-bottom: none;
}

.col-index {
    width: 48px;
    text-align: left;
}

.col-name {
    flex: 1;
    text-align: left;
}

.col-size {
    width: 80px;
    text-align: left;
}

.col-sort {
    width: 120px;
    text-align: center;
}

.col-status {
    width: 90px;
    text-align: center;
}

/* 文件状态样式 */
.status-wait {
    color: var(--text-2);
}

.status-done {
    color: var(--secondary);
}

.status-error {
    color: #f85149;
}

/* ===== 页脚样式 ===== */
footer {
    background: var(--card);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    padding: 24px 24px;
    flex-direction: column;
    gap: 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.copyright {
    font-size: 13px;
    text-align: center;
}

/* ===== 选择组样式 ===== */
.select-group {
    width: 30%;
}

/* ===== 选项行样式 ===== */
.option-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}



.option-label {
    min-width: 80px;
    font-size: 14px;
    color: var(--text);
}

/* ===== 文件列表操作列样式 ===== */
.col-action {
    width: 50px;
    text-align: left;
}

/* ===== 统一控件样式 ===== */

/* 滑块组样式 */
.slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
    width:30%;
}

.slider {
    flex: 1;
    accent-color: var(--primary);
}

.slider-value {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text);
}

/* 文本输入框样式 */
.text-input,
.input-group {
    width: 30%;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    transition: border-color 0.2s;
}

.text-input:focus,
.input-group:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1);
}

.text-input::placeholder,
.input-group::placeholder {
    color: var(--text-2);
}

/* 文本域样式 */
textarea {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1);
}

textarea::placeholder {
    color: var(--text-2);
}

/* 选择框样式 */
select {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-color: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="%238b949e" d="M118.6 374.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L128 289.4l114.7-114.7c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3l-128 128z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    width: 100%;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1);
}

/* 输入组样式 */
.input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.input-label {
    min-width: 80px;
    font-size: 14px;
    color: var(--text);
}

/* 选项网格样式 */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.option-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-card:hover {
    border-color: var(--primary);
}

.option-card.selected {
    border-color: var(--primary);
    background: rgba(88, 166, 255, 0.1);
}

.option-title {
    font-size: 15px;
    font-weight: 500;
}

.option-desc {
    font-size: 13px;
    color: var(--text-2);
}

.option-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

/* 布局类样式 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* 标签样式 */
label {
    color: var(--text);
    cursor: pointer;
}

/* 滑块容器样式 */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

/* 滑块样式 */
.slider {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Webkit 滑块样式 */
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: background 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    background: #79c0ff;
}

/* Firefox 滑块样式 */
.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.slider::-moz-range-thumb:hover {
    background: #79c0ff;
}

/* 滑块值显示样式 */
.slider-value {
    min-width: 48px;
    text-align: center;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

/* 颜色选择器样式 */
input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: transparent;
}

/* Webkit 颜色选择器样式 */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: var(--radius-sm);
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

/* Firefox 颜色选择器样式 */
input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: var(--radius-sm);
}

/* 单选按钮和复选框容器样式 */
.radio-group,
.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 自定义单选按钮样式 */
.radio-item input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.radio-item input[type="radio"]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
}

.radio-item input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-item input[type="radio"]:hover {
    border-color: var(--primary);
}

/* 自定义复选框样式 */
.checkbox-item input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.checkbox-item input[type="checkbox"]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
}

.checkbox-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-item input[type="checkbox"]:hover {
    border-color: var(--primary);
}

/* 按钮基础样式 */
button {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--bg);
    color: var(--text);
    padding: 10px 16px;
}

button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--text);
}

/* 主要按钮样式 */
.btn-primary {
    background-color: var(--primary);
    color: #0d1117;
    border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
    background-color: #79c0ff;
    border-color: #79c0ff;
    color: #0d1117;
}

/* 次要按钮样式 */
.btn-secondary {
    background-color: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

/* 危险按钮样式 */
.btn-danger {
    background-color: #f85149;
    color: white;
    border-color: #f85149;
}

.btn-danger:hover:not(:disabled) {
    background-color: #da3633;
    border-color: #da3633;
}

/* 禁用状态样式 */
input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

input:disabled:hover,
textarea:disabled:hover,
select:disabled:hover,
button:disabled:hover {
    border-color: var(--border);
    color: var(--text);
    background-color: var(--bg);
}

/* ===== 预览轮播样式 ===== */
.preview-card {
    margin-top: 16px;
}

.preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

#previewCanvas {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.preview-ctrl {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.ctrl-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-sizing: border-box;
}

.ctrl-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

#pageInfo {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-2);
}

/* 语言按钮样式 */
.lang-btn {
    margin-left: 40px;
    padding: 6px 12px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--primary);
    color: #0d1117;
}

/* ===== 浮动提示弹窗样式 ===== */
.toast {
    position: fixed;
    left: 50%;
    top: 20%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, top 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    top: 25%;
}

.toast.info {
    background: var(--text-3);
    color: #fff;
    border: 1px solid var(--border);
}

.toast.error {
    background: #f85149;
    color: #fff;
    border: 1px solid #f85149;
}

/* ===== 响应式设计 ===== */
@media (max-width: 600px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }
}
