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

:root {
    --primary: #00f0ff;
    --primary-dark: #0088ff;
    --secondary: #7b2fff;
    --accent: #ff00aa;
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #8888aa;
    --text-muted: #555566;
    --border: #2a2a3a;
    --success: #00ff88;
    --error: #ff4466;
    --glow-primary: rgba(0, 240, 255, 0.5);
    --glow-secondary: rgba(123, 47, 255, 0.5);
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(123, 47, 255, 0.08) 0%, transparent 40%),
                radial-gradient(ellipse at 20% 80%, rgba(255, 0, 170, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.logo-icon {
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.logo-text h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px var(--glow-primary);
}

.logo-text h1 .highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 8px;
}

.cyber-lines {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.cyber-lines span {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: lineGlow 2s ease-in-out infinite;
}

.cyber-lines span:nth-child(2) {
    animation-delay: 0.3s;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

.cyber-lines span:nth-child(3) {
    animation-delay: 0.6s;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

@keyframes lineGlow {
    0%, 100% { opacity: 0.3; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}

main {
    position: relative;
}

.upload-section {
    text-align: center;
}

.path-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.path-item {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: left;
}

.path-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.path-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.path-text {
    font-size: 0.9rem;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.cyber-btn {
    position: relative;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.cyber-btn:hover::before {
    left: 100%;
}

.cyber-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cyber-btn.small {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.cyber-btn.large {
    padding: 14px 40px;
    font-size: 1rem;
}

.cyber-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-dark);
    border: none;
    box-shadow: 0 4px 20px var(--glow-primary);
}

.cyber-btn.primary:hover {
    box-shadow: 0 6px 30px var(--glow-primary);
}

.cyber-btn.secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.cyber-btn.secondary:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 4px 20px var(--glow-primary);
}

.cyber-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px 24px;
    cursor: pointer;
    transition: all 0.4s ease;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(18, 18, 26, 0.8) 100%);
    overflow: hidden;
    margin-bottom: 24px;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.05), transparent);
    transition: left 0.6s ease;
}

.drop-zone:hover::before,
.drop-zone.dragover::before {
    left: 100%;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2),
                inset 0 0 30px rgba(0, 240, 255, 0.05);
}

.drop-zone-inner {
    position: relative;
    z-index: 1;
}

.upload-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary);
}

.upload-icon svg {
    filter: drop-shadow(0 0 10px var(--glow-primary));
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanMove 2s linear infinite;
}

@keyframes scanMove {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 80px; opacity: 0; }
}

.drop-text {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.drop-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.file-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: left;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.file-count {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.select-all {
    font-size: 0.85rem;
    color: var(--primary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.select-all:hover {
    color: var(--text-primary);
}

.file-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

.file-list::-webkit-scrollbar {
    width: 4px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 2px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item:hover {
    background: var(--bg-card-hover);
}

.file-item.selected {
    border-left: 3px solid var(--primary);
    background: rgba(0, 240, 255, 0.05);
}

.file-item-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: var(--primary);
}

.file-item-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.file-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 12px;
}

.file-item-remove {
    width: 24px;
    height: 24px;
    margin-left: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-remove:hover {
    color: var(--error);
}

.supported-formats {
    text-align: left;
}

.format-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.formats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.format-tag {
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.format-tag.highlight {
    border-color: var(--primary);
    color: var(--primary);
}

.format-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px var(--glow-primary);
}

.progress-section {
    margin-top: 40px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-count {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.progress-bar {
    position: relative;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    z-index: 1;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
    animation: progressGlow 1.5s ease-in-out infinite;
}

@keyframes progressGlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.progress-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
}

.progress-list::-webkit-scrollbar {
    width: 4px;
}

.progress-list::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 2px;
}

.progress-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.progress-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid var(--border);
    transition: all 0.3s ease;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-item.loading {
    border-left-color: var(--primary);
}

.progress-item.success {
    border-left-color: var(--success);
}

.progress-item.error {
    border-left-color: var(--error);
}

.progress-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 0.9rem;
}

.progress-item-icon.pending {
    color: var(--text-muted);
}

.progress-item-icon.loading {
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.progress-item-icon.success {
    color: var(--success);
}

.progress-item-icon.error {
    color: var(--error);
}

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

.progress-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.progress-item-status {
    font-size: 0.8rem;
    margin-left: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-card);
}

.progress-item.loading .progress-item-status {
    color: var(--primary);
}

.progress-item.success .progress-item-status {
    color: var(--success);
}

.progress-item.error .progress-item-status {
    color: var(--error);
}

.result-section {
    margin-top: 40px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.result-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.result-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.result-content {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.tabs {
    display: flex;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.05);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    transform: scaleX(1);
}

.tab-content {
    padding: 20px;
}

#resultTextarea {
    width: 100%;
    min-height: 350px;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.preview {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: 8px;
    min-height: 350px;
    line-height: 1.8;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.preview h1 { font-size: 1.8rem; margin-bottom: 16px; color: var(--primary); }
.preview h2 { font-size: 1.5rem; margin-bottom: 12px; color: var(--primary); }
.preview h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-primary); }
.preview p { margin-bottom: 12px; }
.preview ul, .preview ol { padding-left: 24px; margin-bottom: 12px; }
.preview li { margin-bottom: 4px; }
.preview code { background: var(--bg-card); padding: 2px 6px; border-radius: 4px; font-family: monospace; color: var(--accent); }
.preview pre { background: var(--bg-card); padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 12px; border: 1px solid var(--border); }
.preview pre code { background: none; padding: 0; color: var(--text-primary); }
.preview blockquote { border-left: 4px solid var(--primary); padding-left: 16px; color: var(--text-secondary); margin-bottom: 12px; background: rgba(0, 240, 255, 0.05); padding: 12px 16px; border-radius: 0 8px 8px 0; }
.preview table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.preview th, .preview td { border: 1px solid var(--border); padding: 10px; text-align: left; }
.preview th { background: var(--bg-card); color: var(--primary); }
.preview a { color: var(--primary); text-decoration: none; }
.preview a:hover { text-decoration: underline; }

.error-section {
    text-align: center;
    padding: 60px 24px;
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
}

.error-icon {
    color: var(--error);
    margin-bottom: 24px;
    animation: errorPulse 1s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.error-message {
    font-size: 1.1rem;
    color: var(--error);
    margin-bottom: 24px;
}

footer {
    text-align: center;
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.divider {
    color: var(--text-muted);
}

.tech {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .path-selector {
        flex-direction: column;
    }

    .logo-container {
        flex-direction: column;
        gap: 12px;
    }

    .logo-text h1 {
        font-size: 1.8rem;
    }

    .drop-zone {
        padding: 32px 16px;
    }

    .drop-text {
        font-size: 1.2rem;
    }

    .action-bar {
        flex-direction: column;
    }

    .cyber-btn.large {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        gap: 12px;
        text-align: left;
    }

    .result-actions {
        flex-direction: column;
    }

    .cyber-btn {
        width: 100%;
    }
}