/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    height: calc(100vh - 60px);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    padding: 1.5rem;
    will-change: transform;
    /* 优化移动端性能 */
    -webkit-transform: translateX(100%);
    -webkit-transition: -webkit-transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -webkit-overflow-scrolling: touch;
    /* 防止内容闪烁 */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.settings-panel.open {
    transform: translateX(0);
    -webkit-transform: translateX(0);
}

/* 桌面端默认打开设置面板 */
@media (min-width: 1024px) {
    .settings-panel.open {
        right: 0;
    }
    
    /* 当设置面板打开时，调整时钟区域的布局 */
    body.settings-panel-open .clock-section {
        padding-right: 320px;
    }
}

.settings-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--page-text);
}

/* 时钟模板设置独立样式 */
.settings-group.template-group {
    padding-top: 0.5rem;
}

.settings-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    /* margin-bottom: 0.5rem; */
    color: var(--page-text);
}

/* 时钟模板标签特殊样式 */
.settings-label.template-label {
    margin-bottom: 1rem;
    font-weight: 600;
}

.template-options {
    display: grid;
    gap: 0.5rem;
}

/* 滑块设置 */
.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.settings-toggle .settings-label {
    font-size: 0.9rem;
    color: var(--page-text);
    white-space: nowrap;
}

.toggle-input {
    display: none;
}

.toggle-slider {
    position: relative;
    display: block;
    width: 36px;
    height: 20px;
    background: var(--page-border);
    border-radius: 20px;
    transition: background-color 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 选中状态 */
.toggle-input:checked + .toggle-slider {
    background: #007bff;
}

.toggle-input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* 模板预览样式 */
.template-preview-option {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 2px solid var(--page-border);
    border-radius: 8px;
    background: var(--page-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.template-preview-option:hover {
    border-color: var(--page-text);
    transform: translateY(-1px);
}

.template-preview-option.active {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.1);
}

.template-preview-display {
    width: 80px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.template-preview-info {
    flex: 1;
}

.template-preview-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--page-text);
    margin-bottom: 0.1rem;
}


/* 各模板预览样式 */
.template-preview-option[data-template="digital"] .template-preview-display {
    background: #000000;
    color: #ffffff;
    font-family: 'DSEG7', 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
}

.template-preview-option[data-template="digital-blue"] .template-preview-display {
    background: #000000;
    color: #66B8F0;
    font-family: 'DSEG7', 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
}

.template-preview-option[data-template="digital-red"] .template-preview-display {
    background: #000000;
    color: #D54D39;
    font-family: 'DSEG7', 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
}

.template-preview-option[data-template="digital-amber"] .template-preview-display {
    background: #000000;
    color: #E58F2E;
    font-family: 'DSEG7', 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
}

.template-preview-option[data-template="digital-orange"] .template-preview-display {
    background: #FB7C00;
    color: #222222;
    font-family: 'DSEG7', 'Courier New', monospace;
    font-weight: bold;
    font-style: italic;
}



.template-preview-option[data-template="pure-dark"] .template-preview-display {
    background: #000000;
    color: #FFFFFF;
    font-family: 'Helvetica', Arial, sans-serif;
    font-weight: 500;
    font-style: normal;
}

.template-preview-option[data-template="dark"] .template-preview-display {
    background: #1a1a1a;
    color: #F2F2F2;
    font-family: 'Helvetica', Arial, sans-serif;
    font-weight: 500;
    font-style: normal;
}

.template-preview-option[data-template="light"] .template-preview-display {
    background: #ffffff;
    color: #111111;
    font-family: 'Helvetica', Arial, sans-serif;
    font-weight: 500;
    font-style: normal;
    border: 1px solid #ddd;
}

.template-preview-option[data-template="classic"] .template-preview-display {
    background: #000000;
    color: #ffffff;
    font-family: 'Courier New', 'Monaco', monospace;
    font-weight: 600;
    font-style: normal;
}

/* 移动端探索按钮样式 */
.mobile-explore-section {
    display: none;
    text-align: center;
}

.explore-styles-banner {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    overflow: hidden;
    max-width: 250px;
    margin: 0 auto;
}

.explore-styles-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.banner-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.banner-content {
    position: relative;
    z-index: 1;
}

.banner-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.banner-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.usage-steps {
    text-align: left;
    margin-top: 0.75rem;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.step-text {
    font-size: 0.8rem;
    line-height: 1.4;
    opacity: 0.95;
}

.step-text strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* 只在移动端显示探索按钮 */
@media (max-width: 1023px) {
    .mobile-explore-section {
        display: block;
        flex-shrink: 0;
        margin-left: 1rem;
        align-self: center;
    }
    
    .clock-section {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 2rem 1rem;
    }
    
    .clock-container {
        flex-shrink: 0;
    }
    
    .settings-panel {
        width: 60%;
        right: 0;
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
    }
    
    .settings-panel.open {
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
}

.mobile-explore-section.hidden {
    display: none !important;
}

/* 设置面板遮罩 */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                visibility 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity;
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 全屏模式下隐藏设置面板 */
:fullscreen .settings-panel,
:fullscreen .settings-overlay {
    display: none;
}

:-webkit-full-screen .settings-panel,
:-webkit-full-screen .settings-overlay {
    display: none;
}

:-moz-full-screen .settings-panel,
:-moz-full-screen .settings-overlay {
    display: none;
}

:-ms-fullscreen .settings-panel,
:-ms-fullscreen .settings-overlay {
    display: none;
}

/* Flip时钟页面只显示3个模板 */
[data-clock-template="flip-clock"] .template-preview-option:not([data-template="pure-dark"]):not([data-template="dark"]):not([data-template="light"]) {
    display: none;
}

/* Flip时钟页面的预览样式 - 基础样式 */
[data-clock-template="flip-clock"] .template-preview-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-size: 5px;
    font-weight: 700;
    padding: 3px 2px;
    letter-spacing: 0.5px;
}

/* 隐藏原始文本 */
[data-clock-template="flip-clock"] .template-preview-display {
    color: transparent;
}

/* 使用伪元素创建翻转卡片效果 */
[data-clock-template="flip-clock"] .template-preview-display::before {
    content: '■■ : ■■ : ■■';
    display: block;
    width: 100%;
    height: 100%;
    line-height: 38px;
    text-align: center;
    font-size: 6px;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: monospace;
}

/* 只为3个主题添加flip预览样式 */
[data-clock-template="flip-clock"] .template-preview-option[data-template="pure-dark"] .template-preview-display::before {
    color: #ffffff;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
}

[data-clock-template="flip-clock"] .template-preview-option[data-template="dark"] .template-preview-display::before {
    color: #ccc;
    text-shadow: 0 0 1px rgba(204, 204, 204, 0.2);
}

[data-clock-template="flip-clock"] .template-preview-option[data-template="light"] .template-preview-display::before {
    color: #333333;
    text-shadow: none;
}

/* 为3个主题添加背景色 */
[data-clock-template="flip-clock"] .template-preview-option[data-template="pure-dark"] .template-preview-display {
    background: #000000;
}

[data-clock-template="flip-clock"] .template-preview-option[data-template="dark"] .template-preview-display {
    background: #151515;
}

[data-clock-template="flip-clock"] .template-preview-option[data-template="light"] .template-preview-display {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .settings-panel {
        width: 60%;
        right: 0;
        left: auto;
        transform: translateX(100%);
        -webkit-transform: translateX(100%);
    }
    
    .settings-panel.open {
        transform: translateX(0);
        -webkit-transform: translateX(0);
    }
    
    /* 移动端模版预览字体强化 */
    .template-preview-option[data-template="digital"] .template-preview-display,
    .template-preview-option[data-template="digital-blue"] .template-preview-display,
    .template-preview-option[data-template="digital-red"] .template-preview-display,
    .template-preview-option[data-template="digital-amber"] .template-preview-display,
    .template-preview-option[data-template="digital-orange"] .template-preview-display {
        font-family: 'DSEG7', 'Courier New', monospace !important;
        font-weight: bold !important;
        font-style: italic !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        text-rendering: optimizeLegibility !important;
    }
    
    .template-preview-option[data-template="classic"] .template-preview-display {
        font-family: 'Courier New', 'Monaco', monospace !important;
        font-weight: 600 !important;
        font-style: normal !important;
    }
    
    .template-preview-option[data-template="dark"] .template-preview-display,
    .template-preview-option[data-template="light"] .template-preview-display {
        font-family: 'Helvetica', Arial, sans-serif !important;
        font-weight: 400 !important;
        font-style: normal !important;
    }
}

/* 小屏幕优化 - 垂直布局 */
@media (max-width: 480px) {
    .clock-section {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .mobile-explore-section {
        margin-left: 0 !important;
        align-self: stretch !important;
    }
    
    .explore-styles-banner {
        max-width: none;
        margin: 0 1rem;
    }
} 