:root {
    --primary: #1e40af;
    --accent: #3b82f6;
    --success: #10b981;
    --dark: #0f172a;
}

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: #1e2937;
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(to right, var(--dark), #1e3a8a);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.3);
}

.brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 1.35rem;
}

.main-container {
    margin-top: 20px;
    padding-bottom: 40px;
}

.column-card {
    background: white;
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    height: 390px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.column-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
}

.column-card.drag-over {
    border: 3px dashed #60a5fa;
    background: #f0f9ff;
    transform: scale(1.02);
}

.column-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    font-size: 1rem;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #f8fafc;
    gap: 6px;
    flex-wrap: nowrap !important;
}

.wrap-header {
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.column-header .title-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
}

.column-header .title-group span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.column-header .btn-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
}

.column-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    color: #64748b;
}

.file-item {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    background: #f8fafc;
}

.file-item:hover {
    background: #e0f2fe;
    transform: translateX(4px);
}

.file-name {
    font-weight: 500;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.char-count {
    font-size: 0.78rem;
    color: #64748b;
}

.invalid-file {
    color: #ef4444 !important;
}

.btn-action {
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 9999px;
}

.delete-btn {
    color: #ef4444;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.delete-btn:hover {
    transform: scale(1.2);
    color: #dc2626;
}

.btn-start {
    padding: 14px 72px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 9999px;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    transition: all 0.3s;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.5);
}

.loader {
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 0.9s linear infinite;
    margin-right: 10px;
}

@keyframes rotation {
    to {
        transform: rotate(360deg);
    }
}

.empty-tip {
    text-align: center;
    color: #94a3b8;
    margin-top: 65px;
    font-size: 1rem;
    line-height: 1.4;
    pointer-events: none;
}

.empty-tip i,
.empty-tip span,
.empty-tip br {
    pointer-events: none;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge-pro {
    background: linear-gradient(90deg, #22d3ee, #67e8f9);
    color: #0e7490;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 9999px;
}

.reset-all-btn {
    border-radius: 9999px;
    padding: 8px 24px;
}

.hidden {
    display: none !important;
}

.result-download {
    padding: 6px 12px !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    border-radius: 9999px !important;
    white-space: nowrap !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.2s !important;
}

.result-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5) !important;
    background-color: #10b981 !important;
    color: #fff !important;
}

#resultList .file-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
}

.btn-xs {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    white-space: nowrap !important;
}

.alert-mini {
    font-size: 0.8rem;
    padding: 10px 14px;
    border-radius: 12px;
    margin-top: 20px;
    text-align: left;
    line-height: 1.4;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.app-wrapper {
    display: flex;
    min-height: calc(100vh - 72px);
}

.sidebar {
    width: 80px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    gap: 25px;
    transition: all 0.3s;
    z-index: 1000;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab-item {
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    width: 100%;
    padding: 10px 0;
}

.nav-tab-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-tab-item:hover,
.nav-tab-item.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.nav-tab-item.active {
    color: #ef4444;
    position: relative;
}

.nav-tab-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    background: #3b82f6;
    border-radius: 4px 0 0 4px;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 72px);
}

.stitch-file-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.stitch-file-item:active {
    cursor: grabbing;
}

.stitch-file-item .drag-handle {
    color: #94a3b8;
    cursor: grab;
}

.delay-indicator {
    text-align: center;
    margin: -5px 0 10px 0;
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 600;
    position: relative;
    padding: 4px 0;
}

.delay-indicator::before,
.delay-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 1px;
    height: 8px;
    background: #cbd5e1;
}

.delay-indicator::before {
    top: -8px;
}

.delay-indicator::after {
    bottom: -8px;
}

.preview-container {
    background: #1e2937;
    border-radius: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e2e8f0;
    overflow: hidden;
}

.preview-header {
    padding: 12px 20px;
    background: #0f172a;
    border-bottom: 1px solid #334155;
    font-weight: 600;
}

.preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Consolas', monospace;
}

.preview-block {
    margin-bottom: 30px;
    border-left: 3px solid #3b82f6;
    padding-left: 15px;
}

.preview-block.file-b {
    border-left-color: #10b981;
}

.sub-item {
    margin-bottom: 10px;
    opacity: 0.8;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sub-item.playing {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.15) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
    opacity: 1 !important;
}

.sub-time {
    color: #94a3b8;
    font-size: 0.85rem;
}

.sub-text {
    font-size: 1rem;
    margin-top: 2px;
}

.junction-label {
    text-align: center;
    margin: 20px 0;
    color: #f59e0b;
    font-size: 0.8rem;
    border-top: 1px dashed #475569;
    padding-top: 10px;
    position: relative;
}

.btn-delay-add {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.audio-info {
    font-size: 0.75rem;
    color: #10b981;
    margin-left: 10px;
    font-weight: normal;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auto-height-card {
    height: auto !important;
    min-height: 480px;
}

.auto-height-body {
    flex: none !important;
    overflow-y: visible !important;
}
