/**
 * 主题设置面板样式
 * 用于右侧弹出的主题配置面板
 */

/* Offcanvas 面板基础样式 */
.offcanvas {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    z-index: 9999;
    transition: right 0.18s cubic-bezier(.4,0,.2,1);
}

.offcanvas.show {
    right: 0;
}

.offcanvas-overlay {
    position: absolute;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.18s cubic-bezier(.4,0,.2,1);
}

.offcanvas.show .offcanvas-overlay {
    opacity: 1;
    visibility: visible;
}

.offcanvas-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.offcanvas-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px ;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.offcanvas-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.offcanvas-header .close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.offcanvas-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 内容区域样式 */
.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 颜色选项 */
.theme-color-options, 
.theme-mode-options, 
.theme-nav-style-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.color-option {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.color-option:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-option.active {
    border-color: #4379EE;
    background: #e7f1ff;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-option span {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* 主题模式选项 */
.theme-mode-options .btn {
    font-weight: 500;
    transition: all 0.3s;
}

.theme-mode-options .btn.active {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 黑夜模式适配 */
body.dark-mode .offcanvas-content {
    background: #1a1d21;
    color: #e9ecef;
}

body.dark-mode .offcanvas-header {
    background: linear-gradient(135deg, #2c323e 0%, #373f50 100%);
    border-bottom-color: #373f50;
}

body.dark-mode .color-option {
    background: #222730;
    color: #adb5bd;
}

body.dark-mode .color-option:hover {
    background: #2c323e;
}

body.dark-mode .color-option.active {
    border-color: #4379EE;
    background: rgba(67, 121, 238, 0.15);
}

body.dark-mode .color-option span {
    color: #e9ecef;
}

body.dark-mode .offcanvas-body {
    background: #1a1d21;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .offcanvas {
        width: 280px;
        right: -280px;
    }
    
    .theme-color-options {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes slideIn {
    from {
        right: -320px;
    }
    to {
        right: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.offcanvas.show {
    animation: slideIn 0.18s cubic-bezier(.4,0,.2,1) forwards;
}

.offcanvas.show .offcanvas-overlay {
    animation: fadeIn 0.18s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes slideOut {
    from {
        right: 0;
    }
    to {
        right: -320px;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.offcanvas.show.closing {
    animation: slideOut 0.18s cubic-bezier(.4,0,.2,1) forwards;
}

.offcanvas.show.closing .offcanvas-overlay {
    animation: fadeOut 0.18s cubic-bezier(.4,0,.2,1) forwards;
}

/* 滚动条美化 */
.offcanvas-body::-webkit-scrollbar {
    width: 6px;
}

.offcanvas-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.offcanvas-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.offcanvas-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

body.dark-mode .offcanvas-body::-webkit-scrollbar-track {
    background: #222730;
}

body.dark-mode .offcanvas-body::-webkit-scrollbar-thumb {
    background: #4a5568;
}
