/* 1.css - 智能控制面板所有样式 */
:root {
    --primary-color: #f00400;
    --hover-color: #ff0000;
    --bg-color: #00ffaa;
    --text-color: #ee008f;
    --panel-width: 400px;
    --zoom-level: 1;
}

.dark-mode {
    --primary-color: #da728e;
    --hover-color: #8fa3e6;
    --bg-color: #e60c60;
    --text-color: #fea50a;
}

#smartControlPanel {
    display: block;
    margin: 0;
    /* 底部留出固定任务栏的高度，避免最下面的按钮被任务栏挡住点不到 */
    padding: 0 0 70px;
}

/* 面板底色放到最底层，避免遮住面板自己的背景图与动态背景 */
#smartControlPanel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background: linear-gradient(135deg, var(--bg-color) 0%, #c3cfe2 100%);
    transition: background 0.3s ease;
    pointer-events: none;
}

#smartControlPanel.dark-mode::before {
    background: linear-gradient(135deg, var(--bg-color) 0%, #2b2b3c 100%);
}

/* 缩放说明：默认不写任何 transform / zoom，
   避免改变文字的渲染与抗锯齿表现；只有点击缩放按钮时由 JS 写入 zoom */

/* 梅干阿牛动态背景容器 */
#dynamic-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 回到最底层：电脑桌面的背景已改为透明，动态背景自然透出来。
       这样弹窗(100000)与框架(5002)都稳稳压在它上面，不会再互相覆盖 */
    z-index: -1;
    /* 这一层只负责「动态背景效果」（它里面的画布）。
       底色/壁纸交给下面的 #bgContainer（壁纸层）——
       原来这里写了一层不透明渐变，会把用户设置的壁纸整个盖住，
       表现就是「个性化里换壁纸完全没反应」。现在这里透明，
       壁纸照常显示，动态效果则画在它上面，两者可以同时生效。 */
    background: transparent;
    pointer-events: none;
}

/* 夜间模式下桌面底色的加深，改到壁纸层上（这一层已经透明） */
.night-mode #windowsDesktopSystem > .bg-container,
.dark-mode #windowsDesktopSystem > .bg-container {
    background-image: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

/* 隐藏模式样式 */
.hidden-mode .control-bar,
.hidden-mode .zoom-controls,
.hidden-mode header,
.hidden-mode footer {
    display: none !important;
}

.hidden-mode .page-container {
    margin-top: 80px;
}

.bg {
    background-size: cover;
    background-position: center;
}

.page-container {
    max-width: var(--panel-width);
    margin: 0 auto;
    padding: 20px;
    transition: margin-top 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark-mode .calculator {
    background: rgba(40,40,40,0.95);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
}

.nav-grid.active {
    max-height: 2000px;
}

.nav-item {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 12px;
    line-height: 1.4;
    background: linear-gradient(135deg, 
        hsl(var(--hue), 70%, 50%),
        hsl(calc(var(--hue) + 30), 70%, 50%)
    );
    position: relative;
    overflow: hidden;
}

.control-bar {
    position: fixed;
    top: 2px;
    left: 2px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.control-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

/* 隐藏按钮 */
.hide-toggle-btn {
    position: fixed;
    bottom: 710px;
    left: 8%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 3px 5px 20px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hide-toggle-btn:hover {
    background: var(--hover-color);
    transform: translateX(-50%) scale(1.1);
}

/* 缩放控制 */
.zoom-controls {
    position: fixed;
    bottom: 690px;
    left: 8%;
    transform: translateX(-45%);
    display: flex;
    gap: 0px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    padding: 3px;
    box-shadow: 2px 6px 13px 4px rgba(0, 0, 0, 0.123);
    transition: all 0.3s cubic-bezier(0.23, 0.34, 0.44, 1.19);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.zoom-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    font-weight: bold;
    color: var(--text-color);
}

/* 模态框样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
}

.modal-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.modal-link {
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 12px;
    background: linear-gradient(135deg, 
        hsl(var(--hue), 70%, 50%),
        hsl(calc(var(--hue) + 30), 70%, 50%)
    );
}

.modal-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.add-site-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.add-site-form input {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: var(--bg-color);
    color: var(--text-color);
}

.add-site-form button {
    padding: 10px;
    border-radius: 6px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.add-site-form button:hover {
    background: var(--hover-color);
}

/* 保留原有样式 */
.header-big { margin-bottom: 1rem; }
.s-search { position: relative; }
.super-search-fm { position: relative; }

/* 加载动画 */
#preloader_3 {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 0 auto;
}
#preloader_3:before {
    content: '';
    position: absolute;
    width: 50px;
    height: 5px;
    background: #4a90e2;
    top: 60px;
    left: 0;
    border-radius: 50%;
    animation: preloader_3_before 1.5s ease-in-out infinite;
}
@keyframes preloader_3_before {
    0% {transform: translateX(0px) rotate(0deg)}
    50% {transform: translateX(50px) scale(1.2) rotate(260deg); background-color:#f74d4d; border-radius:0px;}
    100% {transform: translateX(0px) rotate(0deg)}
}

.bookmark-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.img-bg {
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1519681393784-d120267933ba?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
}

.gradient-linear {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10%;
    background: linear-gradient(135deg, rgba(74,144,226,0.5) 0%, rgba(195,207,226,0.5) 100%);
    transition: all 0.3s ease;
}

/* 图片上传区域样式 */
.image-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.2);
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 8px;
    display: none;
}

/* 滑块样式 */
.slider-container {
    margin-bottom: 15px;
}

.slider-container label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.slider {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: var(--hover-color);
    transform: scale(1.2);
}

/* 预设背景选择 */
.preset-backgrounds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.preset-bg-item {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.preset-bg-item:hover, .preset-bg-item.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* 按钮图片设置样式 */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item .item-image {
    width: 30px;
    height: 30px;
    margin: 0 auto 5px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.nav-item .edit-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-item:hover .edit-icon {
    opacity: 1;
}

/* 按钮图片裁剪区域 */
.crop-container {
    position: relative;
    width: 100%;
    height: 200px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    overflow: hidden;
}

.crop-area {
    position: absolute;
    border: 2px dashed white;
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* 预设图标选择 */
.preset-icons {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.preset-icon-item {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.preset-icon-item:hover, .preset-icon-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* 模态框按钮样式 */
.modal-link {
    position: relative;
    padding-top: 30px !important;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-link .item-image {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.modal-link .edit-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-link:hover .edit-icon {
    opacity: 1;
}

/* 按钮个性化设置样式 */
.button-settings-modal .color-picker {
    width: 100%;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
}

.button-animation-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.animation-option {
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.animation-option.active {
    background: var(--primary-color);
    color: white;
}

/* 梅干阿牛动态背景设置样式 */
.dynamic-bg-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.dynamic-bg-type {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dynamic-bg-type button {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dynamic-bg-type button.active {
    background: var(--primary-color);
    color: white;
}

/* Mega New Door 框架样式 */
.mega-new-door-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: all 0.5s ease;
}

/* 自定义图片设置面板 */
.custom-image-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* 按钮图标上传区域 */
.icon-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.icon-preview {
    width: 50px;
    height: 50px;
    margin: 10px auto;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 颜色选择器样式 */
.color-picker-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.color-picker-container label {
    min-width: 80px;
    margin-right: 10px;
}

.color-picker-container input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-left: 10px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* 动态背景类型选择 */
.dynamic-bg-types {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dynamic-bg-type-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dynamic-bg-type-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .page-container {
        max-width: 95%;
        padding: 15px;
    }
    
    .control-bar {
        top: 5px;
        left: 5px;
    }
    
    .zoom-controls {
        bottom: 650px;
    }
    
    .hide-toggle-btn {
        bottom: 600px;
    }
    
    .modal-content {
        width: 95%;
        padding: 15px;
    }
}
/* 隐藏模式样式 */
.hidden-mode .control-bar,
.hidden-mode .zoom-controls,
.hidden-mode header,
.hidden-mode footer {
    display: none !important;
}

.hidden-mode .page-container {
    margin-top: 80px;
}

.bg {
    background-size: cover;
    background-position: center;
}

.page-container {
    max-width: var(--panel-width);
    margin: 0 auto;
    padding: 0px;
    transition: margin-top 0.3s ease;
    background-color: rgb(255, 255, 255);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 0px solid rgb(255, 255, 255);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
    gap: 7px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
	align-items: 0;
	align-items: center;
}

.nav-grid.active {
    max-height: 2000px;
}

.nav-item {
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 12px;
    line-height: 1.4;
    background: linear-gradient(135deg, 
        hsl(var(--hue), 70%, 50%),
        hsl(calc(var(--hue) + 30), 70%, 50%)
    );
    position: relative;
    overflow: hidden;
}

.control-bar {
    position: fixed;
    top: 2px;
    left: 1px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 100;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1px 1px;
    border: 1px solid rgba(255, 255, 255, 0.052);
	flex-direction: row;
}

.control-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.control-btn:hover {
    background: var(--hover-color);
    transform: scale(1.1);
}

/* 隐藏按钮 */
.hide-toggle-btn {
    position: fixed;
    bottom: 55px;
    left: 95%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.771);
    border: none;
    cursor: pointer;
    box-shadow: 3px 5px 20px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hide-toggle-btn:hover {
    background: var(--hover-color);
    transform: translateX(-50%) scale(1.1);
}

/* 缩放控制 */
.zoom-controls {
    position: fixed;
    bottom: 55px;
    left: 95%;
    transform: translateX(-50%);
    display: flex;
    gap: 0px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    padding: 3px;
    box-shadow: 2px 6px 13px 4px rgba(0, 0, 0, 0.123);
    transition: all 0.3s cubic-bezier(0.23, 0.34, 0.44, 1.19);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.zoom-display {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    font-weight: bold;
    color: var(--text-color);
}