/* CocoPanda Studio - Application 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);
}

.sidebar .tagline {
    margin-bottom: 32px;
}

.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);
}

/* 预设卡片 */
.preset-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
}

.preset-grid::-webkit-scrollbar {
    display: none;
}

.preset-pill {
    flex: 0 0 110px;
    height: 110px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.preset-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    transform: translateY(-4px);
}

.preset-pill.active {
    background: rgba(61, 90, 254, 0.15);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(61, 90, 254, 0.3);
}

.preset-pill .material-symbols-outlined {
    font-size: 1.6rem;
    color: var(--text-dim);
    transition: transform 0.3s ease;
}

.preset-pill.active .material-symbols-outlined {
    color: var(--primary);
    transform: scale(1.1);
}

.preset-pill .title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.preset-pill .desc {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* 配置面板调整 */
.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;
}

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

#dprValueDisplay {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
}

/* 自定义 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);
}

/* 霓虹滑块样式优化 */
.range-wrapper {
    padding: 10px 0;
}

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);
}

/* 侧边栏按钮覆盖 */
.sidebar .glow-btn {
    display: block;
    width: 100%;
}

.sidebar .ghost-btn {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* 主工作区 */
.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-bottom: 120px;
}

#lottiePreview {
    width: 512px;
    height: 512px;
    max-width: 80%;
}

.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);
}

.stat.alt span {
    color: var(--primary);
    font-weight: 700;
}

.stat.highlight-val span {
    color: var(--accent);
    font-weight: 700;
}

/* 处理状态 */
.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;
}

/* 结果列表 */
.results-shelf {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    width: 260px;
}

.result-card {
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateX(10px);
    border-color: var(--primary);
}

.result-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-info {
    display: flex;
    flex-direction: column;
}

.result-filename {
    font-size: 0.85rem;
    font-weight: 600;
}

.result-meta {
    font-size: 0.6rem;
    color: var(--accent);
}

/* 队列管理 */
.queue-list {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

#queueItems {
    display: flex;
    gap: 12px;
    padding: 10px 20px 30px;
}

.queue-item {
    width: 90px;
    height: 90px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px;
    flex-shrink: 0;
}

.queue-item.active {
    border: 2px solid var(--primary);
    background: rgba(61, 90, 254, 0.1);
    box-shadow:
        0 0 20px var(--glow),
        inset 0 0 10px rgba(61, 90, 254, 0.1);
    transform: scale(1.05);
}

.queue-preview-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.queue-item:hover .queue-preview-box {
    opacity: 1;
}

.queue-item span {
    position: absolute;
    bottom: -22px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.queue-item:hover span {
    color: var(--text);
}

.remove-item {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #ff4081;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(255, 64, 129, 0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.queue-item:hover .remove-item {
    opacity: 1;
    transform: scale(1);
}

/* 开关 */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch label {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.05);
    transition: 0.4s;
    border-radius: 34px;
    border: 1px solid var(--border);
}

.toggle-switch label:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-dim);
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + label {
    background-color: rgba(61, 90, 254, 0.2);
    border-color: var(--primary);
}
.toggle-switch input:checked + label:before {
    transform: translateX(20px);
    background-color: var(--primary);
}
