/* 主题控制面板样式 */
.theme-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-width: 200px;
    overflow: hidden;
}

.theme-controls:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
}

.controls-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
}

.hide-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.hide-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.controls-content {
    padding: 15px;
}

.theme-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 50px;
    flex: 1;
    border: none;
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    font-size: 16px;
}

.theme-text {
    font-weight: 500;
    white-space: nowrap;
}

/* 字体选择器 */
.font-switcher {
    margin-bottom: 15px;
}

.font-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.font-header:hover {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 6px;
}

.font-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: color 0.3s ease;
}

.font-header:hover .font-label {
    color: rgba(255, 255, 255, 0.95);
}

.font-toggle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    user-select: none;
}

.font-toggle.expanded {
    transform: rotate(180deg);
    color: rgba(255, 255, 255, 0.9);
}

.font-header:hover .font-toggle {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
}

.font-header:hover .font-toggle.expanded {
    transform: rotate(180deg) scale(1.1);
}

.font-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(-10px);
}

.font-categories.expanded {
    opacity: 1;
    max-height: 500px;
    transform: translateY(0);
}

.font-category {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.font-categories.expanded .font-category {
    transform: translateY(0);
    opacity: 1;
}

.font-categories.expanded .font-category:nth-child(1) { 
    transition-delay: 0.1s; 
}
.font-categories.expanded .font-category:nth-child(2) { 
    transition-delay: 0.2s; 
}
.font-categories.expanded .font-category:nth-child(3) { 
    transition-delay: 0.3s; 
}
.font-categories.expanded .font-category:nth-child(4) { 
    transition-delay: 0.4s; 
}

/* 折叠时的反向动画 */
.font-categories:not(.expanded) .font-category {
    transform: translateY(-20px);
    opacity: 0;
    transition-delay: 0s;
}

.font-categories:not(.expanded) .font-category:nth-child(1) { 
    transition-delay: 0.3s; 
}
.font-categories:not(.expanded) .font-category:nth-child(2) { 
    transition-delay: 0.2s; 
}
.font-categories:not(.expanded) .font-category:nth-child(3) { 
    transition-delay: 0.1s; 
}
.font-categories:not(.expanded) .font-category:nth-child(4) { 
    transition-delay: 0s; 
}

.category-title {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.font-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.font-btn {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 5px 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
    position: relative;
    overflow: hidden;
}

.font-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.font-btn:hover::before {
    left: 100%;
}

.font-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.font-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); 
    }
    50% { 
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.1); 
    }
}

/* 自定义字体控制 */
.custom-category {
    background: rgba(255, 255, 255, 0.05);
}

.custom-font-controls {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.custom-font-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
}

.custom-font-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.custom-font-input:focus {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.add-font-btn {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 30px;
    border: none;
    position: relative;
    overflow: hidden;
}

.add-font-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.add-font-btn:hover::before {
    width: 100px;
    height: 100px;
}

.add-font-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-fonts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    min-height: 20px;
}

.custom-font-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    padding: 5px 20px 5px 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: none;
}

.custom-font-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.custom-font-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.remove-font-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.6);
    border: none;
    border-radius: 2px;
    width: 14px;
    height: 14px;
    cursor: pointer;
    color: white;
    font-size: 8px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.remove-font-btn:hover {
    opacity: 1;
    background: rgba(255, 0, 0, 0.8);
    transform: scale(1.1);
}

.theme-info {
    text-align: center;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    padding-top: 10px;
}

.current-time {
    font-family: 'Monaco', 'Menlo', monospace;
}

/* 显示按钮样式 */
.show-controls-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}

.show-controls-btn button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: none;
}

.show-controls-btn button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 夜间模式控制面板样式 */
body.night-theme .theme-controls {
    background: rgba(0, 0, 0, 0.3);
}

body.night-theme .controls-header {
    background: rgba(0, 0, 0, 0.2);
}

body.night-theme .controls-title {
    color: rgba(255, 255, 255, 0.95);
}

body.night-theme .font-label {
    color: rgba(255, 255, 255, 0.9);
}

body.night-theme .theme-btn {
    background: rgba(0, 0, 0, 0.2);
}

body.night-theme .font-btn {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

body.night-theme .show-controls-btn button {
    background: rgba(0, 0, 0, 0.4);
}

/* 日间模式控制面板样式 */
body.day-theme .theme-controls {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(0, 0, 0, 0.8);
}

body.day-theme .controls-title {
    color: rgba(0, 0, 0, 0.8);
}

body.day-theme .font-label {
    color: rgba(0, 0, 0, 0.7);
}

body.day-theme .font-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.day-theme .font-header:hover .font-label {
    color: rgba(0, 0, 0, 0.9);
}

body.day-theme .font-header:hover .font-toggle {
    color: rgba(0, 0, 0, 0.7);
}

body.day-theme .font-toggle.expanded {
    color: rgba(0, 0, 0, 0.8);
}

body.day-theme .category-title {
    color: rgba(0, 0, 0, 0.5);
}

body.day-theme .font-category {
    background: rgba(0, 0, 0, 0.03);
}

body.day-theme .custom-category {
    background: rgba(0, 0, 0, 0.05);
}

body.day-theme .hide-btn {
    color: rgba(0, 0, 0, 0.6);
}

body.day-theme .hide-btn:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.1);
}

body.day-theme .theme-btn {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(255, 255, 255, 0.3);
}

body.day-theme .theme-btn.active {
    color: rgba(0, 0, 0, 0.9);
    background: rgba(255, 255, 255, 0.5);
}

body.day-theme .font-btn {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.2);
}

body.day-theme .font-btn:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(255, 255, 255, 0.4);
}

body.day-theme .font-btn.active {
    color: rgba(0, 0, 0, 0.9);
    background: rgba(255, 255, 255, 0.5);
}

body.day-theme .custom-font-input {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
}

body.day-theme .custom-font-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

body.day-theme .custom-font-input:focus {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
}

body.day-theme .add-font-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

body.day-theme .add-font-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.9);
}

body.day-theme .custom-font-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.7);
}

body.day-theme .custom-font-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.9);
}

body.day-theme .custom-font-btn.active {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.9);
}

body.day-theme .theme-info {
    color: rgba(0, 0, 0, 0.6);
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.day-theme .font-header {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

/* 隐藏状态样式 */
.theme-controls.hidden {
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .theme-controls {
        top: 10px;
        right: 10px;
        min-width: 180px;
    }
    
    .controls-content {
        padding: 12px;
    }
    
    .theme-switcher {
        gap: 5px;
    }
    
    .theme-btn {
        padding: 6px 4px;
        min-width: 40px;
    }
    
    .theme-text {
        font-size: 10px;
    }

    .show-controls-btn {
        top: 10px;
        right: 10px;
    }

    .show-controls-btn button {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}
