/* ===== 基础（适老化大字体） ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    font-size: 18px;
    line-height: 1.7;
    color: #1f2937;
    background: #eef2f8;
    word-break: break-all;
}
.page {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 18px 40px;
}

/* ===== 顶部 ===== */
.hero {
    background: linear-gradient(135deg, #2456e6, #1aa3c7);
    color: #fff;
    border-radius: 18px;
    padding: 30px 28px 24px;
    box-shadow: 0 8px 24px rgba(36, 86, 230, .25);
}
.hero h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 1px; }
.subtitle { margin: 0 0 16px; font-size: 18px; opacity: .92; }
.env-bar { display: flex; flex-wrap: wrap; gap: 10px; }
.env-item {
    display: inline-block;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    padding: 5px 16px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.env-item.ok    { background: rgba(46, 204, 113, .35); }
.env-item.warn  { background: rgba(255, 165, 0, .4); }
.env-item.error { background: rgba(231, 76, 60, .45); }

/* 环境诊断面板 */
.env-diag {
    margin-top: 14px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 16px;
    line-height: 1.8;
}
.diag-row { display: flex; align-items: baseline; gap: 10px; }
.diag-row .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
    transform: translateY(1px);
}
.diag-row.ok .dot  { background: #4ade80; }
.diag-row.bad .dot { background: #fca5a5; }
.diag-tip {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.25);
    opacity: .95;
}
@media (max-width: 600px) {
    .env-diag { font-size: 15px; }
}

/* ===== 卡片 ===== */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 26px;
    margin-top: 18px;
    box-shadow: 0 2px 10px rgba(31, 41, 55, .06);
}
.card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 12px;
    margin-bottom: 18px;
}
.card-head h2 { margin: 0; font-size: 22px; }
.step-no {
    width: 38px; height: 38px;
    line-height: 38px;
    text-align: center;
    border-radius: 50%;
    background: #2456e6;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    flex: 0 0 auto;
}
.hint { color: #6b7280; font-size: 15px; }

/* ===== SG 版本卡片：每行两个 ===== */
.version-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.ver-card {
    position: relative;
    border: 2px solid #d8deea;
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    user-select: none;
}
.ver-card:hover { border-color: #8fb0f5; }
.ver-card input { position: absolute; opacity: 0; pointer-events: none; }
.ver-card .ver-title { font-size: 22px; font-weight: bold; color: #1d4ed8; }
.ver-card .ver-desc { font-size: 16px; color: #4b5563; margin-top: 2px; }
.ver-card .ver-check {
    position: absolute;
    top: 12px; right: 14px;
    width: 26px; height: 26px;
    border: 2px solid #c2cad8;
    border-radius: 50%;
    font-size: 16px;
    color: #fff;
    text-align: center;
    line-height: 22px;
}
.ver-card.checked {
    border-color: #2456e6;
    background: #f0f5ff;
    box-shadow: 0 3px 12px rgba(36,86,230,.14);
}
.ver-card.checked .ver-check { background: #2456e6; border-color: #2456e6; }

/* ===== 上传区 ===== */
.dropzone {
    border: 2.5px dashed #a8b6d4;
    border-radius: 14px;
    background: #f8faff;
    padding: 34px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    outline: none;
}
.dropzone:hover, .dropzone.drag, .dropzone:focus {
    border-color: #2456e6;
    background: #eef4ff;
}
.dz-icon {
    display: inline-block;
    background: #2456e6;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    border-radius: 8px;
    padding: 4px 14px;
    margin-bottom: 10px;
}
.dz-text { font-size: 18px; color: #374151; }
.dz-file { margin-top: 10px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.dz-filename {
    font-weight: bold;
    color: #1d4ed8;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dz-filesize { color: #6b7280; white-space: nowrap; }

/* ===== 高级选项 ===== */
.adv { margin-top: 14px; border-top: 1px dashed #e2e7f0; padding-top: 12px; }
.adv summary {
    cursor: pointer;
    font-size: 17px;
    color: #2456e6;
    font-weight: bold;
    outline: none;
}
.adv-body { padding-top: 12px; }
.adv-label { display: block; font-size: 16px; color: #4b5563; margin: 10px 0 6px; }
.text-input {
    width: 100%;
    font-size: 17px;
    padding: 11px 14px;
    border: 1.5px solid #cfd7e6;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}
.text-input:focus { border-color: #2456e6; }
.ext-group { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    border: 1.5px solid #cfd7e6;
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 16px;
    cursor: pointer;
    background: #fff;
}
.chip input { width: 17px; height: 17px; vertical-align: -3px; margin-right: 4px; }

/* ===== 按钮 ===== */
.btn-lg {
    width: 100%;
    height: 60px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    letter-spacing: 2px;
}
.btn-primary {
    background: linear-gradient(135deg, #2456e6, #1aa3c7);
    color: #fff;
    box-shadow: 0 6px 16px rgba(36,86,230,.3);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled {
    background: #b6c0d4; box-shadow: none; cursor: not-allowed;
}
.btn-download {
    display: block;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(135deg, #18a957, #12a07a);
    color: #fff;
    box-shadow: 0 6px 16px rgba(24,169,87,.3);
    margin-top: 16px;
    line-height: 60px;
}
.btn-download:hover { filter: brightness(1.05); }
.btn-ghost {
    background: #fff;
    border: 1.5px solid #cfd7e6;
    color: #374151;
    border-radius: 10px;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
}
.btn-ghost:hover { border-color: #2456e6; color: #2456e6; }
.btn-ghost.danger:hover { border-color: #e74c3c; color: #e74c3c; }
.result-actions { display: flex; gap: 12px; margin-top: 14px; justify-content: center; }

/* ===== 进度条 ===== */
.progress-wrap { margin-top: 20px; }
.progress-title { font-size: 19px; font-weight: bold; margin-bottom: 8px; color: #111827; }
.progress-bar {
    height: 18px;
    background: #e6eaf3;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar.big { height: 26px; }
.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4f7cf0, #1aa3c7);
    border-radius: 999px;
    transition: width .3s ease;
}
.progress-fill.encode { background: linear-gradient(90deg, #2456e6, #18a957); }
.progress-meta {
    display: flex;
    gap: 18px;
    align-items: baseline;
    margin-top: 8px;
    color: #4b5563;
    font-size: 16px;
    flex-wrap: wrap;
}
.progress-meta .pct { font-size: 26px; font-weight: bold; color: #2456e6; }
#encodeFailed { color: #d97706; font-weight: bold; }
.current-file {
    margin-top: 8px;
    color: #6b7280;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 结果 / 提示 ===== */
.result {
    margin-top: 22px;
    text-align: center;
    border-top: 1px dashed #e2e7f0;
    padding-top: 22px;
}
.result-icon {
    width: 60px; height: 60px;
    line-height: 60px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #18a957;
    color: #fff;
    font-size: 32px;
    font-weight: bold;
}
.result-title { font-size: 24px; font-weight: bold; color: #128043; }
.result-desc { color: #4b5563; font-size: 16px; margin-top: 4px; }
.result-warn {
    margin-top: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #c2410c;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 15px;
    text-align: left;
}
.alert {
    margin-top: 16px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 16px;
}

.footer {
    text-align: center;
    color: #9aa3b2;
    font-size: 14px;
    margin-top: 26px;
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    body { font-size: 17px; }
    .hero h1 { font-size: 24px; }
    .version-grid { grid-template-columns: 1fr; }
    .card { padding: 18px 16px; }
    .btn-lg { font-size: 19px; height: 54px; }
}
