*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: -apple-system, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
    line-height: 1.7;
    color: #1a1a1a;
    background: #fafafa;
}

[hidden] { display: none !important; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }

.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #333; }
.btn-primary:disabled { background: #ddd; color: #999; cursor: not-allowed; }
.btn-secondary { background: transparent; color: #1a1a1a; border: 1.5px solid #ccc; }
.btn-secondary:hover { border-color: #1a1a1a; }

.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 1000;
}
.nav-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.nav-menu { display: flex; list-style: none; gap: 8px; }
.nav-link {
    display: block;
    padding: 6px 14px;
    font-size: 14px;
    color: #666;
    border-radius: 6px;
    transition: all 0.15s;
}
.nav-link:hover { color: #1a1a1a; background: rgba(0,0,0,0.04); }
.nav-link.active { color: #1a1a1a; background: rgba(0,0,0,0.06); }
.hamburger { display: none; flex-direction: column; cursor: pointer; gap: 5px; }
.bar { width: 20px; height: 2px; background: #1a1a1a; border-radius: 2px; }

.page-hero { padding: 128px 0 40px; background: #fafafa; }
.page-hero h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}
.page-hero p { font-size: 16px; color: #999; line-height: 1.8; }
.page-hero strong { color: #666; font-weight: 500; }

.work { padding: 0 0 72px; }

.panel {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 20px;
}

.step { display: flex; gap: 18px; padding-bottom: 28px; }
.step:last-child { padding-bottom: 0; }
.step-no {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #f5f5f5;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}
.step-body { flex: 1; min-width: 0; }
.step-body h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

.drop {
    border: 1.5px dashed #ddd;
    border-radius: 10px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.drop:hover, .drop.over { border-color: #999; background: #fafafa; }
.drop-empty p { font-size: 14px; color: #666; margin: 10px 0 4px; }
.drop-empty .link { color: #1a1a1a; font-weight: 500; text-decoration: underline; }
.hint { font-size: 13px; color: #aaa; }

.drop-file { display: flex; align-items: center; gap: 14px; text-align: left; }
.file-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.file-meta { flex: 1; min-width: 0; }
.file-meta strong {
    display: block;
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-meta span { font-size: 13px; color: #aaa; }
.mini {
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    font-family: inherit;
}
.mini:hover { background: #ececec; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mode {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: block;
}
.mode:hover { border-color: #ddd; }
.mode input { display: none; }
.mode.on { border-color: #1a1a1a; background: #fafafa; }
.mode-title { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mode-desc { display: block; font-size: 13px; color: #999; line-height: 1.5; }

.params { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.params label { font-size: 14px; color: #666; display: flex; align-items: center; gap: 8px; }
.params input {
    width: 96px;
    padding: 9px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.params input:focus { outline: none; border-color: #999; }

.tip {
    margin-top: 14px;
    font-size: 13px;
    color: #999;
    background: #fafafa;
    border-left: 2px solid #e5e5e5;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
}
.err { margin-left: 14px; font-size: 14px; color: #c0392b; }

.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.progress-head strong { font-size: 15px; font-weight: 600; }
.progress-head span { font-size: 14px; color: #888; }
.pbar { height: 6px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: #1a1a1a; transition: width 0.3s; }
.progress-panel .hint { margin-top: 10px; }

.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.result-head h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.result-actions { display: flex; gap: 10px; }
.result-actions .btn { padding: 10px 20px; font-size: 14px; }

.files, .history { list-style: none; margin-top: 20px; }
.files li, .history li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #f0f0f0;
}
.files .n, .history .n {
    width: 24px;
    font-size: 13px;
    color: #bbb;
    flex-shrink: 0;
    text-align: right;
}
.files .name, .history .name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.files .size, .history .size { font-size: 13px; color: #aaa; flex-shrink: 0; }
.files .dl, .history .dl {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    color: #1a1a1a;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.files .dl:hover, .history .dl:hover { background: #ececec; }
.files .dl.got { color: #aaa; }

.history-panel h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.history .state { font-size: 13px; color: #aaa; flex-shrink: 0; }
.history .state.failed {
    color: #c0392b;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer { background: #1a1a1a; color: #999; padding: 48px 0 24px; }
.footer-content { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-section h3 { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.footer-section h4 { color: #ccc; font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.footer-section p { font-size: 14px; line-height: 1.7; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section ul li a { color: #888; font-size: 14px; transition: color 0.15s; }
.footer-section ul li a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #333; padding-top: 20px; text-align: center; font-size: 13px; }

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .nav-menu {
        position: fixed;
        left: 0;
        top: 60px;
        width: 100%;
        flex-direction: column;
        background: rgba(250,250,250,0.98);
        backdrop-filter: blur(12px);
        padding: 12px;
        gap: 2px;
        transform: translateY(-140%);
        transition: transform 0.25s ease;
        border-bottom: 1px solid #eee;
    }
    .nav-menu.active { transform: translateY(0); }
    .nav-link { padding: 12px 16px; }

    .page-hero { padding: 96px 0 28px; }
    .page-hero h1 { font-size: 28px; }
    .panel { padding: 22px; }
    .step { gap: 12px; }
    .modes { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .result-head { flex-direction: column; }
    .result-actions { width: 100%; }
    .result-actions .btn { flex: 1; }
}
