/* ========== 设置弹窗样式 - 浅色苹果液态玻璃风格 ========== */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.settings-modal {
    width: 90%;
    max-width: 900px;
    height: 80%;
    max-height: 600px;
    background: rgba(245, 245, 247, 0.95);
    backdrop-filter: blur(30px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    overflow: hidden;
    animation: scaleIn 0.25s ease;
    color: #1c1c1e;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 左侧导航栏 */
.settings-sidebar {
    width: 200px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

.settings-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1c1c1e;
    font-size: 14px;
    font-weight: 500;
}

.settings-sidebar-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.settings-sidebar-item.active {
    background: #007aff;
    color: #fff;
}

.sidebar-icon {
    font-size: 20px;
}

/* 右侧内容区 */
.settings-content {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.5);
}

.settings-pane {
    display: none;
}

.settings-pane.active {
    display: block;
}

.settings-pane h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 壁纸设置 */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.wallpaper-option {
    height: 80px;
    border-radius: 16px;
    cursor: pointer;
    border: 3px solid transparent;
    background-size: cover;
    background-position: center;
    transition: all 0.2s ease;
}

.wallpaper-option.active {
    border-color: #007aff;
    transform: scale(1.02);
}

.wallpaper-option:hover {
    transform: scale(1.02);
}

.custom-wallpaper {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.custom-wallpaper input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    outline: none;
    color: #1c1c1e;
}

.custom-wallpaper input:focus {
    border-color: #007aff;
    background: #fff;
}

.custom-wallpaper button {
    padding: 12px 24px;
    background: #007aff;
    border: none;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.custom-wallpaper button:hover {
    background: #0055cc;
    transform: scale(1.02);
}

/* 应用/Dock列表样式 */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: default;
    transition: all 0.2s ease;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.settings-item-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.settings-item-info {
    display: flex;
    flex-direction: column;
}

.settings-item-title {
    font-weight: 500;
    color: #1c1c1e;
}

.settings-item-link {
    font-size: 12px;
    color: #8e8e93;
    word-break: break-all;
}

.settings-item-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.delete-item {
    cursor: pointer;
    color: #ff3b30;
    font-size: 18px;
    padding: 4px 8px;
}

.delete-item:hover {
    opacity: 0.7;
}

.drag-handle {
    cursor: grab;
    color: #8e8e93;
    font-size: 16px;
    padding: 4px 8px;
}

.drag-handle:active {
    cursor: grabbing;
}

.add-item-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: #007aff;
    border: none;
    border-radius: 14px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s ease;
}

.add-item-btn:hover {
    background: #0055cc;
    transform: scale(1.02);
}

/* 小组件选择器 */
.widget-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-height: 350px;
    overflow-y: auto;
}

.widget-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.widget-selector-item.selected {
    background: rgba(0, 122, 255, 0.15);
    border-color: #007aff;
}

.widget-selector-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.widget-selector-icon {
    font-size: 28px;
    min-width: 40px;
    text-align: center;
}

.widget-selector-info {
    flex: 1;
}

.widget-selector-name {
    font-weight: 500;
    color: #1c1c1e;
    font-size: 14px;
}

.widget-selector-desc {
    font-size: 11px;
    color: #8e8e93;
}

.widget-selector-check {
    font-size: 18px;
    color: #007aff;
    min-width: 32px;
    text-align: center;
}

/* Dock开关 */
.dock-switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    margin-bottom: 20px;
}

.dock-switch-label {
    font-weight: 500;
    color: #1c1c1e;
}

.dock-switch-desc {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 4px;
}

/* 液态玻璃开关 */
.glass-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.glass-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 28px;
    transition: all 0.3s ease;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.glass-switch input:checked + .switch-slider {
    background: rgba(0, 122, 255, 0.5);
}

.glass-switch input:checked + .switch-slider:before {
    transform: translateX(24px);
}

/* 弹窗底部按钮 */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-footer button {
    padding: 10px 24px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-footer .btn-cancel {
    background: rgba(0, 0, 0, 0.05);
    color: #1c1c1e;
}

.modal-footer .btn-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-footer .btn-save {
    background: #007aff;
    color: #fff;
}

.modal-footer .btn-save:hover {
    background: #0055cc;
    transform: scale(1.02);
}

/* 滚动条 */
.settings-content::-webkit-scrollbar,
.settings-list::-webkit-scrollbar,
.widget-selector-grid::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track,
.settings-list::-webkit-scrollbar-track,
.widget-selector-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb,
.settings-list::-webkit-scrollbar-thumb,
.widget-selector-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* 工具提示 */
.tools-order-hint {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 12px;
    text-align: center;
}

/* 响应式 */
@media (max-width: 700px) {
    .settings-modal {
        flex-direction: column;
        height: 90%;
        max-height: 90%;
    }
    
    .settings-sidebar {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .settings-sidebar-item {
        padding: 8px 16px;
        margin: 0;
    }
    
    .settings-content {
        padding: 20px;
    }
    
    .wallpaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}