/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #06b6d4;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --bg: #0f0f1a;
    --bg2: #16162a;
    --bg3: #1e1e35;
    --card: rgba(30, 30, 55, 0.85);
    --border: rgba(99, 102, 241, 0.25);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --glow: 0 0 20px rgba(99,102,241,0.3);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== 背景动画 ===== */
.bg-animation {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.bg-circle {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.18; animation: drift 12s ease-in-out infinite alternate;
}
.c1 { width: 600px; height: 600px; background: #6366f1; top: -200px; left: -200px; animation-delay: 0s; }
.c2 { width: 500px; height: 500px; background: #06b6d4; bottom: -150px; right: -100px; animation-delay: 4s; }
.c3 { width: 400px; height: 400px; background: #8b5cf6; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 8s; }
@keyframes drift {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(40px) scale(1.1); }
}

/* ===== 容器 ===== */
.container {
    position: relative; z-index: 1;
    max-width: 900px; margin: 0 auto;
    padding: 30px 20px 60px;
}

/* ===== Header ===== */
.header { text-align: center; margin-bottom: 36px; }
.logo {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 8px;
}
.logo i { font-size: 2.2rem; color: var(--primary-light); -webkit-text-fill-color: var(--primary-light); }
.subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex; gap: 8px;
    background: var(--bg2); border-radius: 14px; padding: 6px;
    margin-bottom: 28px; border: 1px solid var(--border);
}
.tab-btn {
    flex: 1; padding: 12px 20px;
    background: transparent; border: none; border-radius: 10px;
    color: var(--text-muted); font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.tab-btn:hover { color: var(--text); background: rgba(99,102,241,0.1); }
.tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff; box-shadow: var(--glow);
}
.tab-btn i { font-size: 1rem; }

/* ===== Panel ===== */
.panel {
    display: none; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 30px; backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    animation: fadeUp 0.4s ease;
    margin-bottom: 24px;
}
.panel.active { display: block; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.panel-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px; padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.panel-header i { font-size: 1.3rem; color: var(--primary-light); }
.panel-header h2 { font-size: 1.1rem; font-weight: 700; }

/* ===== Upload Zone ===== */
.form-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 20px;
}
@media(max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

.upload-zone {
    border: 2px dashed rgba(99,102,241,0.4);
    border-radius: var(--radius-sm);
    background: rgba(99,102,241,0.05);
    transition: all 0.3s; position: relative; overflow: hidden;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(99,102,241,0.12);
    box-shadow: var(--glow);
}
.upload-zone.single { margin-bottom: 20px; }

.upload-label {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 32px 20px;
    cursor: pointer; transition: all 0.2s;
}
.upload-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
.upload-icon.large { width: 72px; height: 72px; font-size: 2rem; }
.upload-text { text-align: center; }
.upload-text strong { display: block; font-size: 0.95rem; color: var(--text); margin-bottom: 4px; }
.upload-text span { font-size: 0.8rem; color: var(--text-muted); }

.file-preview {
    display: none; align-items: center; gap: 10px;
    padding: 10px 16px; background: rgba(16,185,129,0.1);
    border-top: 1px solid rgba(16,185,129,0.2); font-size: 0.85rem;
}
.file-preview.show { display: flex; }
.file-preview i { color: var(--success); }
.file-preview .fname { color: var(--text); font-weight: 600; flex: 1; word-break: break-all; }
.file-preview .fsize { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; }

/* ===== Options Card ===== */
.options-card {
    background: rgba(15,15,30,0.6); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 22px; margin-bottom: 24px;
}
.options-card h3 {
    font-size: 0.9rem; font-weight: 700; color: var(--primary-light);
    display: flex; align-items: center; gap: 8px; margin-bottom: 18px;
}
.options-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media(max-width: 600px) { .options-grid { grid-template-columns: 1fr; } }

.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.82rem; color: var(--text-muted);
    margin-bottom: 8px; font-weight: 600;
}
.form-group label i { color: var(--primary-light); }
.optional { color: var(--text-muted); font-weight: 400; opacity: 0.7; }

.input-field {
    width: 100%; padding: 10px 14px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 0.9rem;
    outline: none; transition: all 0.2s;
}
.input-field:focus {
    border-color: var(--primary); background: rgba(99,102,241,0.08);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.input-field::placeholder { color: var(--text-muted); opacity: 0.6; }

.input-wrap { position: relative; }
.input-wrap .input-field { padding-right: 40px; }
.eye-btn {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; transition: color 0.2s;
}
.eye-btn:hover { color: var(--primary-light); }

/* ===== Inline Upload ===== */
.upload-inline-label {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 8px; cursor: pointer;
    border: 1px dashed rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.05); font-size: 0.88rem;
    color: var(--text-muted); transition: all 0.2s; width: 100%;
}
.upload-inline-label:hover {
    border-color: var(--primary); color: var(--primary-light);
    background: rgba(99,102,241,0.1);
}
.upload-inline-label i { color: var(--primary-light); }

/* ===== Convert Button ===== */
.btn-convert {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none; border-radius: var(--radius-sm); color: #fff;
    font-size: 1.05rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: all 0.3s; box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.55);
}
.btn-convert:active { transform: translateY(0); }
.btn-convert:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ===== Result Card ===== */
.result-card {
    background: var(--card); border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius); padding: 36px;
    text-align: center; backdrop-filter: blur(20px);
    box-shadow: var(--shadow); margin-bottom: 24px;
    animation: fadeUp 0.4s ease;
}
.error-card { border-color: rgba(239,68,68,0.3); }
.result-icon {
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.result-icon.success { background: rgba(16,185,129,0.15); color: var(--success); }
.result-icon.error   { background: rgba(239,68,68,0.15);  color: var(--error); }
.result-card h3 { font-size: 1.3rem; margin-bottom: 8px; }
.result-card p { color: var(--text-muted); margin-bottom: 24px; }
.result-card pre {
    text-align: left; background: rgba(0,0,0,0.3); border-radius: 8px;
    padding: 16px; font-size: 0.82rem; color: #fca5a5; white-space: pre-wrap;
    word-break: break-all; margin-bottom: 20px; max-height: 200px; overflow-y: auto;
}

.download-list {
    display: flex; flex-wrap: wrap; gap: 12px;
    justify-content: center; margin-bottom: 24px;
}
.download-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 22px; border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--success), #059669);
    color: #fff; text-decoration: none; font-weight: 700; font-size: 0.95rem;
    transition: all 0.3s; box-shadow: 0 4px 16px rgba(16,185,129,0.35);
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,185,129,0.5); }
.download-btn.secondary {
    background: linear-gradient(135deg, var(--secondary), #0891b2);
    box-shadow: 0 4px 16px rgba(6,182,212,0.35);
}
.download-btn.secondary:hover { box-shadow: 0 8px 24px rgba(6,182,212,0.5); }

.btn-reset {
    padding: 10px 28px; border-radius: 8px;
    background: rgba(99,102,241,0.15); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-reset:hover { background: rgba(99,102,241,0.25); color: var(--text); }

/* ===== Loading ===== */
.loading-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(15,15,26,0.85); backdrop-filter: blur(8px);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.loading-overlay p { color: var(--text-muted); font-size: 1rem; }
.spinner { position: relative; width: 80px; height: 80px; }
.spin-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    animation: spin 1s linear infinite;
}
.spinner i {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    font-size: 1.8rem; color: var(--primary-light);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Info Section ===== */
.info-section {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px;
}
@media(max-width: 600px) { .info-section { grid-template-columns: 1fr; } }

.info-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 22px; backdrop-filter: blur(10px);
}
.info-card > i { font-size: 1.4rem; color: var(--primary-light); margin-bottom: 10px; display: block; }
.info-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.info-card ul { list-style: none; }
.info-card ul li {
    font-size: 0.82rem; color: var(--text-muted);
    padding: 4px 0; padding-left: 16px; position: relative;
}
.info-card ul li::before {
    content: '▹'; position: absolute; left: 0; color: var(--primary-light);
}

/* ===== Footer ===== */
.footer { text-align: center; color: var(--text-muted); font-size: 0.82rem; padding-top: 12px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
