/* 字体 / 文字颜色 / 文字大小：可在「设置 → 字体设置」里切换。
   三个默认值都与原文件一致，不切换时外观完全不变。 */
:root {
    --app-font: 'Segoe UI', 'Segoe UI Variable Text', -apple-system, BlinkMacSystemFont,
        'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei',
        'Noto Sans SC', Tahoma, Geneva, Verdana, system-ui, sans-serif;
    --app-text-color: #000000;
    --app-font-size: 16px;
    /* Windows 桌面按钮与高亮颜色：可在「设置 → 个性化 → 按钮颜色」里更换 */
    --win-accent: #0078d7;
}

* {
    font-family: var(--app-font);
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeLegibility;
}

/* 【20261030AF】换字体以前"没反应"的原因：
   上面那条 * 选择器权重是 0，而页面里几乎每个组件（胶囊、窗口、卡片…）都自己写了
   font-family，随便一条都能盖掉它，于是 --app-font 变了也看不出区别。
   现在把同一条提到 html / body，并对界面里除图标以外的所有元素生效；
   <i class="fa …">、svg 一律排除，避免把 Font Awesome 图标换成普通字体变成方块。 */
html,
body {
    font-family: var(--app-font) !important;
}

body *:not(i):not(svg):not(svg *):not(.fa):not([class*="fa-"]) {
    font-family: var(--app-font) !important;
}

/* 文字大小：作为 rem 基准，默认 16px 与浏览器默认一致 */
html {
    font-size: var(--app-font-size);
}

/* 文字颜色与文字效果：只影响没有单独指定样式的文字，按钮等固定配色不受影响 */
body {
    color: var(--app-text-color);
    font-weight: var(--app-font-weight, 400);
    letter-spacing: var(--app-letter-spacing, normal);
    line-height: var(--app-line-height, normal);
}

/* 布局重置只作用于 Windows 桌面容器，避免影响其他两个桌面的间距与排版 */
#windowsDesktopSystem,
#windowsDesktopSystem * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 只作为作用域标记：不定位、不设背景、不拦截点击，避免影响其他两个桌面。
   注意：这里不能写死 color，否则会盖掉「字体设置」里的文字颜色 */
#windowsDesktopSystem {
    display: block;
}

#windowsDesktopSystem .icon,
#windowsDesktopSystem .taskbar,
#windowsDesktopSystem .window,
#windowsDesktopSystem .start-menu,
#windowsDesktopSystem .context-menu,
#windowsDesktopSystem .overlay.active {
    pointer-events: auto;
}

/* 背景容器 */
#windowsDesktopSystem > .bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* -2：动态背景层（-1）在它上面。
       动态背景层现在是透明的，所以这里的壁纸 / 纯色能正常显示，
       而粒子、波浪之类的动态效果会画在壁纸上面，两者同时生效。
       下面这行渐变就是「没设置壁纸时」的默认桌面底色（和原来完全一致），
       用户在「个性化」里选了壁纸或纯色后，2.js 会用行内样式覆盖它。 */
    z-index: -2;
    background-image: linear-gradient(135deg, #f70000 0%, #00ff95 100%);
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
}

/* 桌面图标 */
#windowsDesktopSystem > .desktop-icons {
    padding: 2px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    gap: 15px;
}

#windowsDesktopSystem .icon {
    width: 100px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
    position: relative;
}

#windowsDesktopSystem .icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

#windowsDesktopSystem .icon img {
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
}

#windowsDesktopSystem .icon span {
    font-size: 12px;
    text-shadow: 1px 1px 2px #000;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 任务栏 */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: rgba(32, 32, 32, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 10;
}

.start-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s;
}

.start-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.taskbar-apps {
    display: flex;
    align-items: center;
    gap: 5px;
}

#windowsDesktopSystem .taskbar-app {
    height: 40px;
    padding: 0 15px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

#windowsDesktopSystem .taskbar-app:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#windowsDesktopSystem .taskbar-app.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-bottom: 2px solid var(--win-accent, #0078d7);
}

.system-tray {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    padding-right: 10px;
	flex-direction: column;
}

/* 窗口样式 */
.window {
    width: 800px;
    height: 600px;
    background: #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    overflow: hidden;
    resize: both;
}

.win-header {
    height: 45px;
    line-height: 45px;
    background: var(--win-accent, #0078d7);
    color: #fff;
    padding: 0 15px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.win-title {
    font-weight: 600;
}

.win-controls {
    display: flex;
    gap: 5px;
}

.win-btn {
    width: 40px;
    height: 40px;
    border: none;
    background-color: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.win-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.close-btn:hover {
    background-color: #e81123;
}

.win-content {
    height: calc(100% - 45px);
    overflow: auto;
    background: #fff;
    color: #333;
}

/* 设置窗口特定样式 */
.settings-sidebar {
    width: 125px;
    background-color: #fff;
    padding: 20px 0;
    overflow-y: auto;
    float: left;
    height: 100%;
    border-right: 1px solid #e0e0e0;
}

.sidebar-item {
    padding: 12px 20px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    transition: background-color 0.2s;
}

.sidebar-item:hover {
    background-color: #f0f0f0;
}

.sidebar-item.active {
    background-color: #e1f5fe;
    color: var(--win-accent, #0078d7);
    border-left: 4px solid var(--win-accent, #0078d7);
}

.settings-main {
    margin-left: 120px;
    padding: 10px;
    background-color: #f9f9f9;
    height: 100%;
    overflow-y: auto;
    display: none;
}

.settings-main.active {
    display: block;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.settings-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-item label {
    width: 150px;
    color: #666;
    font-size: 14px;
}

.setting-item input, .setting-item select {
    flex: 1;
    padding: 2px 80px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.setting-item button {
    padding: 8px 20px;
    background: var(--win-accent, #0078d7);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.setting-item button:hover {
    background: #005a9e;
}

/* 壁纸预览 */
.wallpaper-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.wallpaper-item {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
}

.wallpaper-item:hover {
    transform: scale(1.05);
}

.wallpaper-item.active {
    border-color: var(--win-accent, #0078d7);
}

.wallpaper-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* 开始菜单 */
.start-menu {
    position: fixed;
    bottom: 48px;
    left: 10px;
    width: 600px;
    height: 500px;
    background-color: rgba(32, 32, 32, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    display: none;
    z-index: 999;
    padding: 20px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.start-menu.active {
    display: block;
}

.start-search {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    margin-bottom: 20px;
}

.start-apps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.start-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-app:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.start-app img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

/* 计算器样式 */
.calculator {
    padding: 20px;
    background: #f0f0f0;
    color: #333;
}

.calc-display {
    width: 100%;
    height: 60px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: right;
    padding: 0 15px;
    line-height: 60px;
    overflow: hidden;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

#windowsDesktopSystem .calc-btn {
    height: 50px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#windowsDesktopSystem .calc-btn:hover {
    background: #e0e0e0;
}

#windowsDesktopSystem .calc-btn.operator {
    background: #f0f0f0;
}

#windowsDesktopSystem .calc-btn.equals {
    background: var(--win-accent, #0078d7);
    color: #fff;
}

/* 记事本样式 */
.notepad {
    padding: 20px;
    background: #fff;
    color: #333;
    height: 100%;
}

.notepad textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

/* 文件管理器样式 */
.file-explorer {
    padding: 20px;
    background: #fff;
    color: #333;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.file-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.file-content {
    display: flex;
    flex: 1;
    gap: 20px;
}

.file-sidebar {
    width: 200px;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 10px;
}

.file-list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: #f0f0f0;
}

.file-item.selected {
    background-color: #e1f5fe;
}

.file-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

/* 网页浏览器样式 */
.browser {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.browser-address-bar {
    display: flex;
    padding: 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.browser-address-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
}

.browser-content {
    flex: 1;
    border: none;
}

/* 媒体播放器样式 */
.media-player {
    padding: 20px;
    background: #fff;
    color: #333;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.media-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.media-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    border-radius: 4px;
    overflow: hidden;
}

.media-content img, .media-content video {
    max-width: 100%;
    max-height: 100%;
}

/* 自定义网站样式 */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.website-item {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    padding: 10px;
}

.website-item:hover {
    transform: scale(1.05);
}

.website-item.active {
    border-color: var(--win-accent, #0078d7);
}

.website-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    object-fit: contain;
}

.website-item span {
    display: block;
    font-size: 12px;
    color: #333;
}

.website-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    justify-content: center;
}

.website-actions button {
    padding: 4px 8px;
    font-size: 10px;
}

/* 回收站样式 */
.trash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.trash-actions {
    display: flex;
    gap: 5px;
}

/* 遮罩层 */
#windowsDesktopSystem .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
}

#windowsDesktopSystem .overlay.active {
    display: block;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: rgba(32, 32, 32, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1001;
    display: none;
    padding: 5px 0;
}

.context-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.context-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 分类标签样式 */
.category-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.category-tab {
    padding: 8px 15px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.category-tab.active {
    border-bottom: 2px solid var(--win-accent, #0078d7);
    color: var(--win-accent, #0078d7);
}

/* 图片缓存状态 */
.cache-status {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 本地图片预览 */
.local-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.local-image-item {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s;
}

.local-image-item:hover {
    transform: scale(1.05);
}

.local-image-item.active {
    border-color: var(--win-accent, #0078d7);
}

.local-image-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

/* 动态壁纸设置 */
.dynamic-settings {
    margin-top: 20px;
}

.dynamic-slider {
    width: 100%;
    margin: 10px 0;
}

/* 手机端样式 */
@media (max-width: 768px) {
    #windowsDesktopSystem > .desktop-icons {
        grid-template-columns: repeat(auto-fill, 55px);
        gap: 14px;
    }
    
    #windowsDesktopSystem .icon {
        width: 80px;
        height: 100px;
    }
    
    #windowsDesktopSystem .icon img {
        width: 48px;
        height: 48px;
    }
    
    #windowsDesktopSystem .icon span {
        font-size: 10px;
    }
    
    .window {
        width: 95%;
        height: 80%;
    }
    
    .start-menu {
        width: 95%;
        height: 60%;
    }
}

/* ===== 字体设置（新增：设置 → 字体设置）===== */
.font-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.font-option {
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.25s ease;
}

.font-option:hover {
    border-color: var(--win-accent, #0078d7);
    transform: translateY(-2px);
}

.font-option.active {
    border-color: var(--win-accent, #0078d7);
    box-shadow: 0 6px 18px rgba(0, 120, 215, 0.18);
}

.font-option-preview {
    font-size: 20px;
    line-height: 1.35;
    margin-bottom: 8px;
    color: #222222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-option-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--win-accent, #0078d7);
    margin-bottom: 2px;
}

.font-option-desc {
    font-size: 12px;
    color: #888888;
}

.font-option-check {
    float: right;
    color: var(--win-accent, #0078d7);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.font-option.active .font-option-check {
    opacity: 1;
}

/* ===== 各字体方案的预览字形（全部为系统自带字体，含多语言回退，不依赖网络） ===== */
.font-option-preview[data-font="default"] { font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif; }
.font-option-preview[data-font="cn-yahei"] { font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', sans-serif; }
.font-option-preview[data-font="cn-hei"] { font-family: 'SimHei', '黑体', 'Microsoft YaHei', sans-serif; }
.font-option-preview[data-font="cn-song"] { font-family: 'Source Han Serif SC', 'Songti SC', SimSun, '宋体', serif; }
.font-option-preview[data-font="cn-kai"] { font-family: KaiTi, '楷体', STKaiti, 'Kaiti SC', serif; }
.font-option-preview[data-font="en-segoe"] { font-family: 'Segoe UI', Tahoma, sans-serif; }
.font-option-preview[data-font="en-arial"] { font-family: Arial, Helvetica, sans-serif; }
.font-option-preview[data-font="en-verdana"] { font-family: Verdana, Geneva, Tahoma, sans-serif; }
.font-option-preview[data-font="en-georgia"] { font-family: Georgia, 'Times New Roman', serif; }
.font-option-preview[data-font="en-candara"] { font-family: Candara, Optima, 'Segoe UI', sans-serif; }
.font-option-preview[data-font="multi-jp"] { font-family: 'Yu Gothic UI', 'Yu Gothic', Meiryo, 'MS PGothic', 'Hiragino Kaku Gothic ProN', sans-serif; }
.font-option-preview[data-font="multi-kr"] { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Nanum Gothic', sans-serif; }
.font-option-preview[data-font="multi-south"] { font-family: 'Nirmala UI', 'Leelawadee UI', Mangal, Tahoma, sans-serif; }
.font-option-preview[data-font="multi-noto"] { font-family: 'Noto Sans SC', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans', sans-serif; }
.font-option-preview[data-font="mono-cascadia"] { font-family: 'Cascadia Code', 'Cascadia Mono', Consolas, monospace; }
.font-option-preview[data-font="mono-consolas"] { font-family: Consolas, 'Courier New', monospace; }
.font-option-preview[data-font="mono-courier"] { font-family: 'Courier New', Courier, monospace; }

/* ===== 字体中心：分组、实时预览、文字颜色、文字大小（新增） ===== */
.font-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.font-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #555555;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 3px solid var(--win-accent, #0078d7);
}

.font-group .font-options {
    grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

/* 实时预览框 */
.font-preview-box {
    padding: 14px 16px;
    border-radius: 10px;
    background: #f6f8fb;
    border: 1px solid #e3e8ef;
    margin-bottom: 16px;
}

.font-preview-box .preview-line-1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.font-preview-box .preview-line-2 {
    font-size: 14px;
    margin-bottom: 6px;
}

.font-preview-box .preview-line-3 {
    font-size: 14px;
    color: #7a8699;
}

/* 文字颜色色板 */
.text-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.text-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.text-color-option:hover {
    transform: scale(1.12);
}

.text-color-option.active {
    border-color: var(--win-accent, #0078d7);
}

/* 文字大小档位 */
.font-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.font-size-option {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.font-size-option:hover {
    border-color: var(--win-accent, #0078d7);
}

.font-size-option.active {
    border-color: var(--win-accent, #0078d7);
    background: var(--win-accent, #0078d7);
    color: #ffffff;
}

/* 设置行：标签 + 控件 */
.font-setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.font-setting-label {
    font-size: 13px;
    color: #555555;
    min-width: 72px;
}

.font-setting-row input[type="color"] {
    width: 46px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.font-setting-row input[type="range"] {
    flex: 1;
    min-width: 150px;
}

.font-size-value {
    font-size: 13px;
    color: var(--win-accent, #0078d7);
    font-weight: 600;
    min-width: 46px;
}

/* 设置项下方的说明文字（新增） */
.setting-hint {
    font-size: 12px;
    color: #888888;
    margin-top: 10px;
    line-height: 1.6;
}

/* 右上角框架按钮开关的分组标题（新增） */
.top-toolbar-group-title {
    margin: 16px 0 6px;
    padding-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #666666;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.top-toolbar-group-title:first-child {
    margin-top: 4px;
}

/* 设置项右侧的操作区（▶ 打开 + 显示开关） */
.setting-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 「▶ 打开」按钮：立刻在桌面上运行这个功能 */
.setting-run-btn {
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease;
}

.setting-run-btn:hover {
    background: #e5e7eb;
}

.night-mode .setting-run-btn {
    background: #334155;
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.12);
}

.night-mode .setting-run-btn:hover {
    background: #475569;
}

/* 全部显示 / 全部隐藏 */
.setting-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

/* 主按钮：一键恢复干净桌面（放在卡片最上面，最显眼，一眼能找到） */
.setting-run-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #ffffff;
    font-weight: 600;
}

.setting-run-btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4194);
}

.night-mode .setting-run-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
}

#topToolbarSettingsList {
    max-height: 340px;
    overflow-y: auto;
}

/* ===== 按钮颜色色板（新增：设置 → 个性化 → 按钮颜色）===== */
.accent-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.accent-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.accent-option:hover {
    transform: scale(1.12);
}

.accent-option.active {
    border-color: #333333;
}

/* ===== 字体中心扩展：未安装标记、文字效果、恢复默认 ===== */
.font-option.unavailable {
    opacity: 0.7;
    border-style: dashed;
}

.font-option-badge {
    float: right;
    margin-left: 6px;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    background: #fdecec;
    color: #d43f3f;
    font-weight: 500;
}

.font-option.is-current {
    border-color: var(--win-accent, #0078d7);
}

/* 文字效果档位（字重 / 字间距 / 行高） */
.effect-group-title {
    font-size: 13px;
    color: #555555;
    margin: 14px 0 8px;
}

.effect-group-title:first-child {
    margin-top: 0;
}

.effect-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.effect-option {
    padding: 9px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.effect-option:hover {
    border-color: var(--win-accent, #0078d7);
}

.effect-option.active {
    border-color: var(--win-accent, #0078d7);
    background: var(--win-accent, #0078d7);
    color: #ffffff;
}

/* 恢复默认按钮 */
.font-reset-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.font-reset-btn {
    padding: 10px 22px;
    border: 2px solid #d0d5dd;
    border-radius: 8px;
    background: #f7f9fc;
    color: #444444;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.font-reset-btn:hover {
    border-color: #d43f3f;
    color: #d43f3f;
}


/* 【20261031J】文字颜色的上色改由脚本逐个元素写行内颜色（见 2.js 的 kzPaintTextColor）：
   这里原来那套 html.kz-color-custom .window * 的 CSS 规则会把设置界面也一起染掉，
   而且改完还会盖住"设置窗口保持自己配色"的判断，已经整段删掉。 */

/* ============================================================
   【20261031M】窗口颜色：改成「样式表直接管」，不再等脚本后刷
   ------------------------------------------------------------
   以前是 JS 打开窗口后再逐个元素写行内色，所以你看到的是
   「第一次打开先是白的，过半秒才变」。现在颜色来自两个变量：
     --kz-fw-color   （按钮颜色 → 框架）
     --app-text-color（字体颜色 → 里面写的字）
   元素一被创建就已经带着颜色，没有过渡、没有白闪。
   ============================================================ */

/* ---------- 一、按钮颜色 = 窗口框架 ---------- */
html.kz-fw-custom .window:not(#settingsWin),
html.kz-fw-custom .kzp-app,
html.kz-fw-custom .kzwt-win {
    outline: 2px solid var(--kz-fw-color) !important;
    outline-offset: -2px !important;
}

html.kz-fw-custom .window:not(#settingsWin) .win-header,
html.kz-fw-custom .window:not(#settingsWin) .win-title,
html.kz-fw-custom .kzp-head,
html.kz-fw-custom .kzwt-head {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, .35) !important;
}

html.kz-fw-custom .window:not(#settingsWin) .win-content,
html.kz-fw-custom .window:not(#settingsWin) .win-body,
html.kz-fw-custom .kzp-body,
html.kz-fw-custom .kzp-main,
html.kz-fw-custom .kzp-side,
html.kz-fw-custom .kzp-notes,
html.kz-fw-custom .kzp-nlist,
html.kz-fw-custom .kzp-editor,
html.kz-fw-custom .kzp-calc,
html.kz-fw-custom .kzp-files,
html.kz-fw-custom .kzp-filelist,
html.kz-fw-custom .kzwt-body,
html.kz-fw-custom .kzwt-nav,
html.kz-fw-custom .kzwt-main {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
}

/* 输入框 / 里面的小按钮：铺色后改成半透明白，别留一块白疙瘩 */
html.kz-fw-custom .kzp-app textarea,
html.kz-fw-custom .kzp-app input,
html.kz-fw-custom .kzp-app .kzp-pane,
html.kz-fw-custom .kzp-app .kzp-view,
html.kz-fw-custom .kzp-app button,
html.kz-fw-custom .kzp-app .kzp-btn {
    background: rgba(255, 255, 255, .18) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, .45) !important;
}

/* 字色只在「没单独设字体颜色」时才转白；设了字体色就以字体色为准 */
html.kz-fw-custom:not(.kz-color-custom) .kzp-app textarea,
html.kz-fw-custom:not(.kz-color-custom) .kzp-app input,
html.kz-fw-custom:not(.kz-color-custom) .kzp-app .kzp-pane,
html.kz-fw-custom:not(.kz-color-custom) .kzp-app .kzp-view,
html.kz-fw-custom:not(.kz-color-custom) .kzp-app button,
html.kz-fw-custom:not(.kz-color-custom) .kzp-app .kzp-btn {
    color: #fff !important;
}

/* 只设了框架色、没单独设字体色 → 里面文字转白，保证看得清 */
html.kz-fw-custom:not(.kz-color-custom) .window:not(#settingsWin) *:not(i):not(svg):not(img),
html.kz-fw-custom:not(.kz-color-custom) .kzp-app *:not(i):not(svg):not(img),
html.kz-fw-custom:not(.kz-color-custom) .kzwt-win *:not(i):not(svg):not(img) {
    color: #fff !important;
}

/* ---------- 二、字体颜色 = 窗口里的文字 ---------- */
/* 【20261031N】把按钮、下拉、输入框里的文字也算进来 ——
   用户要的是「整个框架里面的字体都跟着变」，之前把这些排除掉，
   文件管理顶部那排按钮（图标 / 新建文件夹 / 上传文件…）就一直没变。 */
html.kz-color-custom .window *:not(i):not(svg):not(img),
html.kz-color-custom .kzp-app *:not(i):not(svg):not(img),
html.kz-color-custom .kzwt-win *:not(i):not(svg):not(img) {
    color: var(--app-text-color) !important;
}

/* ============================================================
   【20261031P】把「所有窗口」都纳入，不止文件管理 / 设置
   ------------------------------------------------------------
   这几类窗口各自是独立画的，类名不同，之前没被接上，所以一直是白的：
     .kzf-win  文件资源管理器 / 收纳盒 / 应用库面板
     .kzv-win  隐私保险箱
   ============================================================ */

/* ---------- 文件资源管理器 / 收纳盒 / 应用库 ---------- */
html.kz-fw-custom .kzf-win {
    background: var(--kz-fw-color) !important;
    outline: 2px solid var(--kz-fw-color) !important;
    outline-offset: -2px !important;
}

html.kz-fw-custom .kzf-head,
html.kz-fw-custom .kzf-tabs,
html.kz-fw-custom .kzf-tab.kz-on {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, .32) !important;
}

html.kz-fw-custom .kzf-body,
html.kz-fw-custom .kzf-grid,
html.kz-fw-custom .kzf-plist,
html.kz-fw-custom .kzf-picker,
html.kz-fw-custom .kzf-tip {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
}

/* 里面的小卡片 / 搜索框：半透明白，别留白块 */
html.kz-fw-custom .kzf-win input,
html.kz-fw-custom .kzf-win .kzf-search,
html.kz-fw-custom .kzf-item,
html.kz-fw-custom .kzf-app,
html.kz-fw-custom .kzf-row {
    background: rgba(255, 255, 255, .16) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, .35) !important;
}

/* ---------- 隐私保险箱 ---------- */
html.kz-fw-custom .kzv-win {
    background: var(--kz-fw-color) !important;
    outline: 2px solid var(--kz-fw-color) !important;
    outline-offset: -2px !important;
}

html.kz-fw-custom .kzv-head {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
    border-bottom-color: rgba(255, 255, 255, .3) !important;
}

html.kz-fw-custom .kzv-body,
html.kz-fw-custom .kzv-card,
html.kz-fw-custom .kzv-panel,
html.kz-fw-custom .kzv-list {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
}

html.kz-fw-custom .kzv-win input,
html.kz-fw-custom .kzv-win button {
    background: rgba(255, 255, 255, .18) !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, .4) !important;
}

/* 只设框架色、没设字体色 → 这两类窗口里的字也转白 */
html.kz-fw-custom:not(.kz-color-custom) .kzf-win *:not(i):not(svg):not(img),
html.kz-fw-custom:not(.kz-color-custom) .kzv-win *:not(i):not(svg):not(img) {
    color: #fff !important;
}

/* ---------- 字体颜色：这两类窗口里的文字也要跟着变 ---------- */
html.kz-color-custom .kzf-win *:not(i):not(svg):not(img),
html.kz-color-custom .kzv-win *:not(i):not(svg):not(img) {
    color: var(--app-text-color) !important;
}

/* ============================================================
   【20261031R】收纳盒面板（.kzbox）也一起跟着按钮颜色走
   ============================================================ */
html.kz-fw-custom .kzbox {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
    outline: 2px solid var(--kz-fw-color) !important;
    outline-offset: -2px !important;
}

html.kz-fw-custom .kzbox-head,
html.kz-fw-custom .kzbox-body,
html.kz-fw-custom .kzbox-apps,
html.kz-fw-custom .kzbox-widgets,
html.kz-fw-custom .kzbox-legacy,
html.kz-fw-custom .kzbox-legacy-bar,
html.kz-fw-custom .kzbox-apps-bar {
    background: var(--kz-fw-color) !important;
    background-image: none !important;
}

html.kz-fw-custom:not(.kz-color-custom) .kzbox *:not(i):not(svg):not(img) {
    color: #fff !important;
}

html.kz-color-custom .kzbox *:not(i):not(svg):not(img) {
    color: var(--app-text-color) !important;
}

/* ============================================================
   【20261031S】窗口层级：一律在开始菜单 / 收纳盒面板之上
   ------------------------------------------------------------
   以前窗口是 100 / 260 / 340，而开始菜单、收纳盒是 999~2000，
   所以"点开文件管理，窗口跑到开始菜单后面去了"，只露出个标题栏。
   这里把各类窗口统一抬到 12000 这一档（仍低于顶部胶囊 999999）。
   数值特意分开，方便同类窗口之间还能分先后。
   ============================================================ */
.kzp-app { z-index: 12010 !important; }
.kzf { z-index: 12020 !important; }
.kzv { z-index: 12030 !important; }
.kzwt { z-index: 12040 !important; }

/* ============================================================
   20261110 · 设置面板文字可读性兜底（③ 版）
   ------------------------------------------------------------
   现象：换成黑色主题 / 开过「自定义字体颜色」之后，
        「系统设置与状态」等白底窗口里的文字变成同色，等于看不见。
   做法：只给这些白底面板强制深色文字，优先级压过全局配色；
        设置窗口（#settingsWin）本身保持原样，不跟随框架色。
   ============================================================ */
#systemPanel,
#systemPanel *:not(i):not(svg):not(img):not(button),
#systemPanel .panel-title,
#systemPanel h3,
#systemPanel h4,
#systemPanel span,
#systemPanel label,
#systemPanel .health-item,
#systemPanel .dl-layout-btn {
    color: #1b1b1b !important;
}

#systemPanel .text-gray-500,
#systemPanel .text-sm.text-gray-500,
#systemPanel small {
    color: #5b6472 !important;
}

#systemPanel button:not(.dl-layout-btn) {
    color: #1b1b1b !important;
}
