/* ===== Theme Color Variables (M3) ===== */
:root {
    --color-background: 250 248 255;
    --color-on-background: 27 27 33;
    --color-surface: 250 248 255;
    --color-surface-dim: 218 216 224;
    --color-surface-bright: 250 248 255;
    --color-surface-container-lowest: 255 255 255;
    --color-surface-container-low: 244 242 250;
    --color-surface-container: 238 237 250;
    --color-surface-container-high: 233 231 244;
    --color-surface-container-highest: 227 225 238;
    --color-surface-variant: 228 225 236;
    --color-surface-tint: 73 75 214;
    --color-on-surface: 27 27 33;
    --color-on-surface-variant: 70 70 79;
    --color-primary: 73 75 214;
    --color-on-primary: 255 255 255;
    --color-primary-container: 225 224 255;
    --color-on-primary-container: 7 0 108;
    --color-primary-fixed: 225 224 255;
    --color-primary-fixed-dim: 192 193 255;
    --color-on-primary-fixed: 7 0 108;
    --color-on-primary-fixed-variant: 47 46 190;
    --color-inverse-primary: 192 193 255;
    --color-secondary: 90 93 114;
    --color-on-secondary: 255 255 255;
    --color-secondary-container: 223 225 249;
    --color-on-secondary-container: 23 26 45;
    --color-secondary-fixed: 223 225 249;
    --color-secondary-fixed-dim: 195 197 220;
    --color-on-secondary-fixed: 23 26 45;
    --color-on-secondary-fixed-variant: 66 70 89;
    --color-tertiary: 143 78 0;
    --color-on-tertiary: 255 255 255;
    --color-tertiary-container: 255 220 197;
    --color-on-tertiary-container: 48 20 0;
    --color-tertiary-fixed: 255 220 197;
    --color-tertiary-fixed-dim: 245 184 136;
    --color-on-tertiary-fixed: 48 20 0;
    --color-on-tertiary-fixed-variant: 108 55 0;
    --color-outline: 118 118 128;
    --color-outline-variant: 199 197 208;
    --color-error: 186 26 26;
    --color-on-error: 255 255 255;
    --color-error-container: 255 218 214;
    --color-on-error-container: 65 0 2;
    --color-inverse-surface: 48 48 54;
    --color-inverse-on-surface: 243 240 247;
    --color-overlay: 0 0 0;
    --color-scrim: 0 0 0;
}

.dark {
    --color-background: 11 19 38;
    --color-on-background: 218 226 253;
    --color-surface: 11 19 38;
    --color-surface-dim: 11 19 38;
    --color-surface-bright: 49 57 77;
    --color-surface-container-lowest: 6 14 32;
    --color-surface-container-low: 19 27 46;
    --color-surface-container: 23 31 51;
    --color-surface-container-high: 34 42 61;
    --color-surface-container-highest: 45 52 73;
    --color-surface-variant: 45 52 73;
    --color-surface-tint: 192 193 255;
    --color-on-surface: 218 226 253;
    --color-on-surface-variant: 199 196 215;
    --color-primary: 192 193 255;
    --color-on-primary: 16 0 169;
    --color-primary-container: 128 131 255;
    --color-on-primary-container: 13 0 150;
    --color-primary-fixed: 225 224 255;
    --color-primary-fixed-dim: 192 193 255;
    --color-on-primary-fixed: 7 0 108;
    --color-on-primary-fixed-variant: 47 46 190;
    --color-inverse-primary: 73 75 214;
    --color-secondary: 185 199 224;
    --color-on-secondary: 35 49 68;
    --color-secondary-container: 60 74 94;
    --color-on-secondary-container: 171 185 210;
    --color-secondary-fixed: 213 227 253;
    --color-secondary-fixed-dim: 185 199 224;
    --color-on-secondary-fixed: 13 28 47;
    --color-on-secondary-fixed-variant: 58 72 92;
    --color-tertiary: 255 183 131;
    --color-on-tertiary: 79 37 0;
    --color-tertiary-container: 217 119 33;
    --color-on-tertiary-container: 69 32 0;
    --color-tertiary-fixed: 255 220 197;
    --color-tertiary-fixed-dim: 255 183 131;
    --color-on-tertiary-fixed: 48 20 0;
    --color-on-tertiary-fixed-variant: 112 55 0;
    --color-outline: 144 143 160;
    --color-outline-variant: 70 69 84;
    --color-error: 255 180 171;
    --color-on-error: 105 0 5;
    --color-error-container: 147 0 10;
    --color-on-error-container: 255 218 214;
    --color-inverse-surface: 218 226 253;
    --color-inverse-on-surface: 40 48 68;
    --color-overlay: 255 255 255;
    --color-scrim: 0 0 0;
}

/* Material Symbols 配置 */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.material-symbols-outlined.filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 毛玻璃效果 */
.glass-panel {
    background: rgb(var(--color-surface-container-highest) / 0.4);
    backdrop-filter: blur(12px);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgb(var(--color-outline-variant));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(var(--color-primary));
}

/* 呼吸灯动画 */
@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 8px rgb(var(--color-primary) / 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgb(var(--color-primary) / 0.6);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* 闪烁加载动画 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent 35%, rgb(var(--color-primary) / 0.15) 50%, transparent 65%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer-ltr {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.shimmer-ltr {
    background-size: 200% 100%;
    animation: shimmer-ltr 1.5s linear infinite;
}

/* 浮动进入动画 */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.35s ease-out both;
}

/* 拖拽上传样式 */
.drag-over {
    border-color: rgb(var(--color-primary)) !important;
    background: rgb(var(--color-primary) / 0.08) !important;
}

/* 视频弹窗进入动画 */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-in {
    animation: modal-in 0.3s ease-out both;
}

/* 对话列表滚动区域 */
.conversation-list::-webkit-scrollbar {
    width: 2px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 3.25rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid rgb(var(--color-overlay) / 0.06);
    border-radius: 0.75rem;
    background: rgb(var(--color-surface-container-lowest) / 0.72);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.switch-row:hover {
    border-color: rgb(var(--color-primary) / 0.22);
    background: rgb(var(--color-surface-container-low) / 0.96);
}

.switch-row:has(.peer:focus-visible) {
    border-color: rgb(var(--color-primary) / 0.4);
    box-shadow: 0 0 0 1px rgb(var(--color-primary) / 0.2);
}

.switch-ui {
    position: relative;
    flex-shrink: 0;
    width: 2.75rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgb(var(--color-outline-variant) / 0.95);
    box-shadow: inset 0 0 0 1px rgb(var(--color-overlay) / 0.05);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.switch-thumb {
    position: absolute;
    top: 0.175rem;
    left: 0.175rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: rgb(var(--color-on-background));
    box-shadow: 0 4px 10px rgb(var(--color-scrim) / 0.25);
    transition: transform 0.2s ease;
}

.peer:checked + .switch-ui {
    background: linear-gradient(135deg, rgb(var(--color-primary-container) / 0.95), rgb(var(--color-primary) / 0.95));
    box-shadow: 0 0 0 1px rgb(var(--color-primary) / 0.2), 0 0 18px rgb(var(--color-primary-container) / 0.18);
}

.peer:checked + .switch-ui .switch-thumb {
    transform: translateX(1.15rem);
}

.switch-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.switch-title {
    color: rgb(var(--color-on-background));
    font-size: 0.9rem;
    font-weight: 600;
}

.switch-state {
    color: rgb(var(--color-outline));
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.conversation-delete-button .material-symbols-outlined {
    transition: transform 0.2s ease;
}

.conversation-delete-button:hover .material-symbols-outlined {
    transform: scale(0.95);
}
