/* CocoPanda Studio - Frame Extractor Specific Styles */

.app-body {
    height: 100vh;
    overflow: hidden;
}

/* 布局容器 */
.app-layout {
    display: flex;
    height: 100vh;
    padding: 24px;
    gap: 24px;
}

/* 侧边栏优化 */
.sidebar {
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 32px 0 0 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 28px;
}

.sidebar-scrollable::-webkit-scrollbar {
    width: 4px;
}

.sidebar-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-footer {
    padding: 24px 28px 32px;
    background: rgba(13, 17, 23, 0.9);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    margin-top: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(61, 90, 254, 0.2), transparent);
}

/* 上传区 */
.upload-v2 {
    border: 1.5px dashed var(--border);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text);
}

.upload-v2:hover {
    background: rgba(61, 90, 254, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(61, 90, 254, 0.1);
}

.upload-v2 .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--primary);
}

/* 配置面板 */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 20px;
}

.field label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
    font-weight: 600;
}

/* 自定义 Select 样式 */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "expand_more";
    font-family: "Material Symbols Outlined";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-dim);
    font-size: 1.2rem;
}

.select-wrapper select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
}

.select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(61, 90, 254, 0.2);
}

/* 霓虹滑块样式优化 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 4px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px var(--primary);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px var(--primary);
}

/* 主工作区 */
.viewport {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 24px;
    border: 1px dashed var(--border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-stage {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
}

#lottiePreview {
    width: 100%;
    flex: 1;
    max-width: 95%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lottiePreview svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
}

.example-btn {
    margin-top: 24px;
    background: rgba(61, 90, 254, 0.1);
    border: 1px solid rgba(61, 90, 254, 0.3);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.example-btn:hover {
    background: rgba(61, 90, 254, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(61, 90, 254, 0.2);
}

.example-btn .material-symbols-outlined {
    font-size: 1.2rem;
}

.pulse-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    opacity: 0.1;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.1;
    }
}

.stats-float {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 140px;
    pointer-events: none;
}

.stat label {
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.stat span {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
}

/* 处理状态 */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 10, 0.95);
    backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loader {
    width: 64px;
    height: 64px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--primary);
    border-right: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

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

#statusText {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.progress-container {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 20px;
    border-radius: 2px;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.1s linear;
}

/* 播放器控制条专用样式 */
.player-toolbar {
    margin-top: 40px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(13, 17, 23, 0.8);
    padding: 12px 24px;
    border-radius: 24px;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    flex-shrink: 0; /* 防止工具条被压缩 */
}

.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 4px 12px var(--glow);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--glow);
    filter: brightness(1.1);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .material-symbols-outlined {
    font-size: 20px;
}

.frame-info {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text);
    min-width: 80px;
    text-align: center;
}

.divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

/* 范围选择器 V2 样式 */
.range-selector-v2 {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 8px;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.range-selector-v2:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(61, 90, 254, 0.15);
}

.range-input-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
}

.range-input-box .label {
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.range-input-box .input-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-input-box .material-symbols-outlined {
    font-size: 16px;
    color: var(--primary);
    opacity: 0.8;
}

.range-input-box input {
    background: transparent !important;
    border: none !important;
    padding: 4px 0 !important;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text);
    width: 100%;
    outline: none;
}

.range-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    margin: 0 4px;
}

/* Toast 提示系统 */
.toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 64, 129, 0.5);
    color: #fff;
    padding: 14px 28px;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 64, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation:
        toastIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
        toastOut 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 3s;
}

.toast .icon {
    color: #ff4081;
    font-size: 1.2rem;
}

@keyframes toastIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}
