/* =========================================
   🌟 全局核心变量定义区
   ========================================= */
:root {
    --spring: cubic-bezier(0.25, 0.8, 0.1, 1);
    --spring-fast: cubic-bezier(0.2, 1.2, 0.3, 1);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-blur: blur(30px) saturate(180%);
    --theme-green: #65a30d;
}

/* 🌟 彻底干掉手机端长按弹出系统菜单和复制的行为 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    outline: none !important;
}

a,
a:active,
a:focus {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    text-decoration: none !important;
}

input,
textarea {
    -webkit-touch-callout: default !important;
    -webkit-user-select: auto !important;
    user-select: auto !important;
}

html,
body {
    height: 100%;
    width: 100%;
    height: -webkit-fill-available;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #000;
    overflow: hidden;
}

#app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
}

/* 🌟 1. 沉浸式动态壁纸 (追加 search-mode 触发背景缩放模糊) */
.wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background: url('/kk/DM_20260723033042_001.jpg') center/cover no-repeat;
    transition: filter 0.4s var(--spring), transform 0.4s var(--spring);
    transform: scale(1) translateZ(0);
    will-change: filter, transform;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.25);
    transition: background 0.4s var(--spring);
}

#app.grid-mode .wallpaper,
#app.search-mode .wallpaper {
    filter: blur(7px);
    transform: scale(1.04) translateZ(0);
}

#app.grid-mode .overlay,
#app.search-mode .overlay {
    background: rgba(0, 0, 0, 0.55);
}

/* 🌟 2. 右上角极简控制台与弹窗 */
.top-actions {
    position: absolute;
    top: 30px;
    right: 35px;
    z-index: 20;
    display: flex;
    gap: 16px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.35s var(--spring-fast);
}

#app.grid-mode .top-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.top-btn {
    color: rgba(255, 255, 255, 0.45);
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-btn:active {
    transform: scale(0.85);
    color: rgba(255, 255, 255, 0.9);
}

.top-btn:hover {
    color: rgba(255, 255, 255, 0.9);
}

.user-menu-wrapper {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 34px;
    right: -8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 4px;
    width: 110px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95) translateZ(0);
    transform-origin: top right;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    will-change: transform, opacity;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1) translateZ(0);
}

.ud-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
}

.ud-header:hover {
    background: #f4f5f8;
}

.ud-avatar {
    font-size: 16px;
    color: #94a3b8;
}

.ud-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ud-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
}

.ud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
}

.ud-item i {
    font-size: 12px;
    color: #94a3b8;
    width: 14px;
    text-align: center;
}

.ud-item:hover {
    background: #f4f5f8;
    color: var(--theme-green);
}

/* 🌟 3. 核心内容区 (时钟与搜索框) */
.main-content {
    position: absolute;
    top: 15vh;
    left: 0;
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.clock {
    font-size: 4rem;
    font-weight: 350;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    margin-bottom: 23px;
    transition: transform 0.4s var(--spring), opacity 0.3s;
    line-height: 1;
    pointer-events: auto;
}

#app.grid-mode .clock {
    transform: translateY(0);
}

.search-wrapper {
    position: relative;
    width: 525px;
    max-width: 90%;
    z-index: 50;
    transition: transform 0.4s var(--spring);
    pointer-events: auto;
}

#app.grid-mode .search-wrapper {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
    pointer-events: none;
}

.search-widget {
    height: 44px;
    border-radius: 22px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
    border: none;
    cursor: text;
    transform: translateZ(0);
    will-change: transform, background, box-shadow;
}

.search-widget.active {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border: none;
    padding: 0 5px;
}

.search-engine-btn {
    color: #64748b;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
    width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    margin-right: 0;
}

.search-widget.active .search-engine-btn {
    width: 32px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    margin-right: 8px;
    color: var(--theme-green);
}

.search-engine-btn:hover {
    background: rgba(101, 163, 13, 0.1);
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    color: #fff;
    caret-color: var(--theme-green);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
    /* 🌟 核心修复：抹除手机自带边距，并用 2px 首行缩进抵消字间距带来的左偏 */
    padding: 0;
    margin: 0;
    -webkit-appearance: none;
    text-indent: 2px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.search-widget.active .search-input {
    color: #1e293b;
}

.search-widget.active .search-input::placeholder {
    color: transparent;
    letter-spacing: normal;
}

.search-submit-btn {
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-green);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
    width: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    margin-left: 0;
}

.search-widget.active .search-submit-btn {
    width: 32px;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    margin-left: 8px;
}

.search-submit-btn:hover {
    background: rgba(101, 163, 13, 0.1);
}

.search-submit-btn:active {
    transform: scale(0.9);
}

.engine-dropdown {
    position: absolute;
    top: 52px;
    left: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 4px;
    width: 110px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px) scale(0.95) translateZ(0);
    transform-origin: top left;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    will-change: transform, opacity;
}

.engine-dropdown.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1) translateZ(0);
}

.engine-item {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 8px;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    transition: 0.2s;
}

.engine-item img {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    object-fit: contain;
}

.engine-item i {
    font-size: 12px;
    width: 14px;
    text-align: center;
    color: #64748b;
}

.engine-item:hover {
    background: #f1f5f9;
    color: var(--theme-green);
}

/* 🌟 4. 应用图标网格与收纳夹 */
.app-grid-widget {
    position: absolute;
    top: 110px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
    transition: all 0.35s var(--spring-fast);
}

#app.grid-mode .app-grid-widget {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.app-grid-inner,
.folder-view-grid {
    display: grid;
    grid-template-columns: repeat(6, 66px);
    justify-content: space-between;
    row-gap: 28px;
    width: 575px;
    align-content: start;
    padding-top: 10px;
    padding-bottom: 10px;
}

.app-grid-inner {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.app-grid-inner::-webkit-scrollbar {
    display: none;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 66px;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.app-item:active {
    transform: scale(0.9);
}

.app-item:hover {
    transform: translateY(-4px);
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.app-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.app-item.add-btn .app-icon,
.folder-icon {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    transition: background 0.3s ease;
}

.app-item.add-btn .app-icon {
    font-weight: 250;
    font-size: 28px;
}

.folder-icon {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    padding: 10px;
    align-content: center;
    justify-content: center;
}

.folder-icon .mini-icon {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    width: 100%;
    height: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: background 0.3s ease;
}

/* 🌟 深浅色主题 */
body.dark-app-icons .app-icon:not(.folder-icon),
body.dark-app-icons .dock-item {
    background: #27272a !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
}

body.dark-app-icons .folder-icon .mini-icon {
    background: #3f3f46 !important;
}

body.dark-app-icons .app-item.add-btn .app-icon,
body.dark-app-icons .folder-icon {
    background: rgba(39, 39, 42, 0.8) !important;
}

/* 🌟 5. 底部悬浮 Dock 栏 */
.dock-container {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: max-content;
    padding: 10px;
    transition: opacity 0.3s ease;
}

.dock-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    z-index: -1;
}

.dock-scroll {
    display: flex;
    gap: 12px;
    width: 100%;
    position: relative;
    z-index: 1;
    justify-content: center;
    align-items: center;
}

.dock-item {
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
}

.dock-item:active {
    transform: scale(0.85);
}

.dock-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.dock-item.add-btn {
    background: rgba(255, 255, 255, 0.4);
    border: 1.5px dashed #cbd5e1;
    color: #64748b;
    box-shadow: none;
}

.dock-item.add-btn i {
    font-size: 14px;
}
/* 🌟 6. 移动端极致适配 */
@media (max-width: 768px) {
    .kk-context-menu, 
.auth-glass-card, 
.settings-glass-card, 
.resource-independent-card, 
#kk-folder-view-modal {
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}
    .top-actions {
        top: max(25px, env(safe-area-inset-top));
        right: 19px;
        gap: 15px;
    }

    .top-btn {
        font-size: 19px;
    }

    .main-content {
        top: 9vh;
    }

    .clock {
        font-size: 4.8rem;
        margin-bottom: 22px;
    }

    #app.grid-mode .clock {
        transform: translateY(0);
    }

    .search-wrapper {
        width: 82%;
        max-width: 420px;
    }

    .search-widget {
        height: 44px;
        border-radius: 22px;
        padding: 0 5px;
    }

    .app-grid-widget,
    .folder-view-grid-widget {
        top: 100px !important;
        bottom: auto !important;
        height: 418px !important;
        max-height: calc(100vh - 250px) !important;
        border: none !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    .app-grid-inner,
    .folder-view-grid {
        grid-template-columns: repeat(4, 68px);
        width: 100%;
        height: 100% !important;
        max-height: none !important;
        padding: 20px 40px !important;
        row-gap: 24px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: none !important;
        mask-image: none !important;
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    .app-item {
        width: 68px;
    }

    .app-item:hover {
        transform: none;
    }

    .app-icon {
        width: 62px;
        height: 62px;
        border-radius: 18px;
        font-size: 20px;
    }

    .app-item.add-btn .app-icon {
        font-size: 28px;
    }

    .app-name {
        font-size: 12px;
    }

    .folder-view-main-content {
        top: 11vh;
    }

    .folder-view-header-inner {
        width: 100%;
        padding: 0 40px;
        display: flex;
        justify-content: flex-start;
    }

    .folder-view-title {
        font-size: 24px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .folder-view-back {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        padding: 0;
        margin: 0;
    }

    .folder-view-back i {
        font-size: 20px;
        margin: 0;
    }

    .dock-container {
        left: 12px;
        right: 12px;
        transform: none;
        width: auto;
        max-width: none;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        padding: 10px;
    }

    .dock-container::before {
        border-radius: 22px;
    }

    .dock-scroll {
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .dock-scroll::-webkit-scrollbar {
        display: none;
    }

    .dock-item {
        flex: 0 0 calc((100% - 7 * 8px) / 8);
        aspect-ratio: 1 / 1;
        width: auto;
        height: auto;
        font-size: 20px;
        border-radius: 26%;
        scroll-snap-align: start;
    }

    .dock-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
}

/* 🌟 7. 极简弹窗与侧滑收纳夹 UI */
.kk-context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateZ(0);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    transform-origin: top left;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 125px !important;
    padding: 5px !important;
    border-radius: 10px !important;
    will-change: transform, opacity;
}

.kk-context-menu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateZ(0);
}

.kk-context-menu .menu-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
    font-weight: 500;
    color: #333;
    padding: 8px 10px !important;
    font-size: 12.5px !important;
    gap: 8px !important;
    border-radius: 6px !important;
}

.kk-context-menu .menu-item i {
    color: #64748b;
    text-align: center;
    font-size: 12px !important;
    width: 14px !important;
}

.kk-context-menu .menu-item:hover {
    background: #f1f5f9;
    color: var(--theme-green);
}

.kk-context-menu .menu-item.menu-item-danger:hover {
    color: #ef4444;
    background: #fee2e2;
}

.kk-context-menu .menu-item.menu-item-danger:hover i {
    color: #ef4444;
}

.kk-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kk-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.kk-mac-card {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 90%;
    max-width: 270px !important;
    border-radius: 14px !important;
    overflow: hidden;
    padding: 0 !important;
}

.kk-modal-overlay.active .kk-mac-card {
    transform: scale(1);
}

/* --- 统一接管替换掉的内联确认弹窗样式 --- */
.kk-confirm-card-ext {
    max-width: 240px !important;
    text-align: center;
    padding: 20px 18px !important;
    margin: auto;
}

.confirm-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.confirm-msg {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-cancel {
    background: #f1f5f9;
    color: #475569;
    box-shadow: none;
    font-size: 13px !important;
    padding: 10px !important;
}

.btn-danger {
    background: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    font-size: 13px !important;
    padding: 10px !important;
}


.kk-modal-slider {
    display: flex;
    width: 200%;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
}

.kk-modal-panel {
    width: 50%;
    flex-shrink: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kk-mac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px !important;
}

.kk-mac-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kk-mac-title i {
    cursor: pointer;
    color: #64748b;
    margin-right: 2px;
    padding: 2px 6px 2px 0;
}

.kk-mac-close {
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
}

.kk-mac-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.kk-mac-tabs {
    display: flex;
    border-bottom: 1px solid #f1f5f9;
    gap: 10px !important;
    margin-bottom: 12px !important;
    padding-bottom: 4px !important;
}

.kk-mac-tab {
    color: #64748b;
    cursor: pointer;
    position: relative;
    font-weight: 500;
    transition: 0.2s;
    font-size: 11.5px !important;
}

.kk-mac-tab.active {
    color: var(--theme-green);
}

.kk-mac-tab.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--theme-green);
    border-radius: 2px;
}

.kk-mac-tab.beta {
    color: #94a3b8;
}

.kk-mac-tab.beta span {
    background: #f0fdf4;
    color: var(--theme-green);
    border-radius: 4px;
    font-weight: 600;
    font-size: 9px !important;
    padding: 1px 3px !important;
    margin-left: 4px !important;
}

.kk-mac-input-group,
.kk-mac-select-group {
    background: #f4f5f8;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: 0.2s;
    padding: 6px 10px !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    border-radius: 8px !important;
}

.kk-mac-select-group {
    cursor: pointer;
}

.kk-mac-select-group:hover {
    background: #e2e8f0;
}

.kk-mac-input-group:focus-within {
    border-color: var(--theme-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(101, 163, 13, 0.1);
}

.kk-mac-input-group i,
.kk-mac-select-group i.front-icon {
    color: #94a3b8;
    text-align: center;
    font-size: 12px !important;
    width: 14px !important;
}

.kk-mac-input-group input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #1e293b;
    font-weight: 500;
    font-size: 12px !important;
    width: 100%;
}

.kk-mac-input-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.kk-mac-select-group span {
    flex: 1;
    color: #1e293b;
    font-weight: 500;
    font-size: 12px !important;
}

.kk-mac-select-value {
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px !important;
}

.kk-mac-btn {
    background: var(--theme-green);
    color: #fff;
    border: none;
    width: 100%;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    padding: 7px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    margin-top: 4px !important;
}

.kk-mac-btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.folder-list-wrap {
    border-top: 1px solid #f1f5f9;
    padding-top: 6px;
    margin-top: 4px;
    max-height: 165px;
    overflow-y: auto;
}

.folder-list-wrap::-webkit-scrollbar {
    display: none;
}

.folder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: #f4f5f8;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
}

.folder-item:hover {
    background: #e2e8f0;
}

.folder-item i {
    color: var(--theme-green);
    font-size: 13px;
    display: none;
}

.folder-item.active {
    background: #f0fdf4;
    color: var(--theme-green);
}

.folder-item.active i {
    display: block;
}

#kk-toast {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

#kk-toast.show {
    top: 30px;
}

/* 收纳夹面板 */
#kk-folder-view-modal {
    z-index: 9998;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#kk-folder-view-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.folder-view-main-content {
    position: absolute;
    top: 11vh;
    left: 0;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kk-modal-overlay.active .folder-view-main-content {
    opacity: 1;
    transform: scale(1);
}

.folder-view-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 23px;
    height: 4rem;
    width: 100%;
}

.folder-view-header-inner {
    width: 550px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    height: 100%;
}

.folder-view-back {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: 0.2s;
    padding: 10px;
    margin-left: -10px;
    z-index: 10;
}

.folder-view-back i {
    font-size: 18px;
}

.folder-view-back:hover {
    color: #fff;
    transform: translateX(-3px);
}

.folder-view-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 28px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    line-height: 1;
    pointer-events: none;
}

.folder-view-grid-widget {
    position: absolute;
    top: 110px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.folder-view-grid {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

/* 🌟 Apple级全能毛玻璃弹窗 (登录框使用) */
.auth-glass-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    width: 90%;
    max-width: 310px;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.95) translateZ(0);
    transition: all 0.4s var(--spring-bounce);
    display: flex;
    flex-direction: column;
    position: relative;
    will-change: transform;
}

.kk-modal-overlay.active .auth-glass-card {
    transform: scale(1) translateZ(0);
}

/* --- 验证框替换的内联隐藏样式 --- */
.auth-hidden-area {
    display: none;
}

.auth-tips {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
    display: none;
}

.auth-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    font-size: 11px;
    z-index: 10;
}

.auth-close-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.auth-logo {
    text-align: center;
    margin-bottom: 4px;
}

.auth-logo i {
    font-size: 28px;
    color: var(--theme-green);
    background: linear-gradient(135deg, #84cc16, #65a30d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-m-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.auth-m-desc {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 16px;
}

.auth-segment {
    position: relative;
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 14px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.segment-bg {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 6px);
    height: calc(100% - 6px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.1, 1);
}

.segment-btn {
    flex: 1;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    padding: 6px 0;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    transition: color 0.3s;
    outline: none;
}

.segment-btn.active {
    color: #1e293b;
}

.auth-m-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-input-wrap {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.auth-input-wrap:focus-within {
    border-color: var(--theme-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(101, 163, 13, 0.1);
}

.auth-input-wrap i {
    color: #94a3b8;
    font-size: 13px;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.auth-input-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    color: #1e293b;
    font-weight: 500;
}

.auth-input-wrap input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.auth-input-wrap.with-addon input {
    padding-right: 90px;
}

.auth-addon-img {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    height: calc(100% - 8px);
    width: 80px;
    border-radius: 6px;
    cursor: pointer;
    object-fit: contain;
    mix-blend-mode: darken;
    background: transparent;
    border: none;
    transition: 0.2s;
    z-index: 2;
}

.auth-addon-img:hover {
    opacity: 0.7;
}

.auth-addon-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    height: calc(100% - 8px);
    width: 80px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    outline: none;
    z-index: 2;
}

.auth-addon-btn:active {
    transform: scale(0.95);
    background: #e2e8f0;
}

.auth-submit-btn {
    background: var(--theme-green);
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 2px;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(101, 163, 13, 0.3);
}

.auth-submit-btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(101, 163, 13, 0.2);
}

/* 🌟 全新重构：极致大气的设置面板 */
.settings-glass-card {
    background: #f4f5f8;
    width: 570px;
    max-width: 90%;
    height: 420px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateZ(0);
    transition: all 0.4s var(--spring-bounce);
    overflow: hidden;
    will-change: transform;
}

.kk-modal-overlay.active .settings-glass-card {
    transform: scale(1) translateZ(0);
}

.settings-header {
    background: transparent;
    padding: 16px 20px 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: none;
}

.settings-header h3 {
    font-size: 15px;
    color: #1e293b;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.settings-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    font-size: 11px;
    z-index: 10;
}

.settings-close:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.settings-body {
    padding: 8px 20px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-body::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .settings-glass-card {
        height: auto;
        max-height: 50vh;
    }

    .settings-body {
        padding-bottom: 180px;
    }
}

.settings-group {
    margin-bottom: 16px;
    position: relative;
}

.settings-body>.settings-group:nth-child(1) {
    z-index: 30;
}

.settings-body>.settings-group:nth-child(2) {
    z-index: 20;
}

.settings-body>.settings-group:nth-child(3) {
    z-index: 10;
}

.settings-body>.settings-group:nth-child(4) {
    z-index: 5;
}

/* --- 替换内联设置间距样式 --- */
.settings-group-no-mb {
    margin-bottom: 0 !important;
}

.settings-group-mt {
    margin-top: 20px !important;
    margin-bottom: 0 !important;
}

.settings-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
    margin-left: 6px;
}

.settings-list {
    background: transparent;
}

.settings-item {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    background: #ffffff;
}

.settings-item:first-child {
    border-radius: 12px 12px 0 0;
}

.settings-item:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    margin: 0;
}

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

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 20px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.slider {
    background-color: var(--theme-green);
}

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

.custom-select-wrapper {
    position: relative;
    width: 80px;
}

.custom-select {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.custom-select:hover {
    border-color: #cbd5e1;
}

.custom-select i {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s;
}

.custom-select-wrapper.open .custom-select {
    border-color: var(--theme-green);
    box-shadow: 0 0 0 2px rgba(101, 163, 13, 0.1);
}

.custom-select-wrapper.open .custom-select i {
    transform: rotate(180deg);
}

.select-val {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 6px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.1, 1);
    border: 1px solid #e2e8f0;
    overflow-y: auto;
    max-height: 180px;
}

.custom-select-options::-webkit-scrollbar {
    display: none;
}

.custom-select-options {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 8px 10px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-option:hover {
    background: #f8fafc;
    color: var(--theme-green);
}

.custom-option.selected {
    color: var(--theme-green);
    font-weight: 600;
    background: #f0fdf4;
}

.engine-opt-img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    display: block;
    object-fit: contain;
}

.wallpaper-box {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    padding: 14px;
}

.wp-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wp-item {
    aspect-ratio: 16/9;
    border-radius: 6px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.wp-item:hover {
    transform: scale(1.03);
}

.wp-item.active {
    border-color: var(--theme-green);
}

/* --- 替换壁纸自定义输入的内联样式 --- */
.custom-wp-wrapper {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.custom-wp-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11.5px;
    outline: none;
    background: #ffffff;
    color: #1e293b;
}

.custom-wp-btn {
    background: var(--theme-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.reset-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.reset-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reset-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
}

.reset-desc {
    font-size: 11px;
    color: #64748b;
}

.reset-btn {
    background: #f1f5f9;
    color: #1e293b;
    border: none;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.reset-btn:hover {
    background: #e2e8f0;
}

.reset-btn:active {
    transform: scale(0.95);
}

/* 🌟 深色模式反色大集成 */
body.dark-app-icons .auth-glass-card,
body.dark-app-icons .settings-glass-card {
    background: rgba(39, 39, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-app-icons .auth-m-title,
body.dark-app-icons .settings-header h3 {
    color: #f8fafc;
}

body.dark-app-icons .auth-segment {
    background: #18181b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-app-icons .segment-bg {
    background: #3f3f46;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-app-icons .segment-btn {
    color: #a1a1aa;
}

body.dark-app-icons .segment-btn.active {
    color: #f8fafc;
}

body.dark-app-icons .auth-input-wrap {
    background: #18181b;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-app-icons .auth-input-wrap input {
    color: #f8fafc;
}

body.dark-app-icons .auth-input-wrap input::placeholder {
    color: #52525b;
}

body.dark-app-icons .auth-addon-img {
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: screen;
    opacity: 0.9;
}

body.dark-app-icons .auth-addon-btn {
    background: #3f3f46;
    color: #e2e8f0;
}

body.dark-app-icons .auth-close-btn,
body.dark-app-icons .settings-close {
    background: #3f3f46;
    color: #a1a1aa;
}

body.dark-app-icons .auth-close-btn:hover,
body.dark-app-icons .settings-close:hover {
    background: #52525b;
    color: #f8fafc;
}

body.dark-app-icons .settings-title {
    color: #a1a1aa;
}

body.dark-app-icons .settings-item {
    border-bottom-color: #3f3f46;
    color: #e2e8f0;
    background: #27272a;
}

body.dark-app-icons .wallpaper-box {
    background: #27272a;
    border-color: #3f3f46;
}

body.dark-app-icons .toggle-switch .slider {
    background-color: #52525b;
}

body.dark-app-icons .custom-select {
    background: #3f3f46;
    border-color: #52525b;
    color: #f8fafc;
}

body.dark-app-icons .custom-select-options {
    background: #27272a;
    border-color: #52525b;
}

body.dark-app-icons .custom-option {
    color: #d1d5db;
}

body.dark-app-icons .custom-option:hover {
    background: #3f3f46;
    color: #fde047;
}

body.dark-app-icons .custom-option.selected {
    color: #fde047;
    background: rgba(253, 224, 71, 0.1);
}

body.dark-app-icons #custom-wp-input {
    background: #3f3f46 !important;
    border-color: #52525b !important;
    color: #f8fafc !important;
}

body.dark-app-icons .reset-box {
    background: #27272a;
    border-color: #3f3f46;
}

body.dark-app-icons .reset-title {
    color: #f8fafc;
}

body.dark-app-icons .reset-desc {
    color: #a1a1aa;
}

body.dark-app-icons .reset-btn {
    background: #3f3f46;
    color: #e2e8f0;
}

body.dark-app-icons .reset-btn:hover {
    background: #52525b;
}

.engine-mask-icon {
    width: 17px;
    height: 17px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
}



/* =========================================
   🌟 精选资源库核心 UI (原生通透版 + 防切割 + 精确列数)
   ========================================= */
.resource-independent-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 570px;
    height: 420px;
    max-width: 90%;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.95) translateZ(0);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    will-change: transform;
}

.kk-modal-overlay.active .resource-independent-card {
    transform: scale(1) translateZ(0);
}

#kk-resource-context-menu {
    z-index: 20005 !important;
}

#kk-toast {
    z-index: 99999 !important;
}

.resource-header {
    background: transparent;
    padding: 14px 20px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.resource-header h3 {
    font-size: 14px;
    color: #1e293b;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.resource-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: 0.2s;
    font-size: 11px;
    z-index: 10;
}

.resource-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1e293b;
    transform: rotate(90deg);
}

.resource-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.resource-sidebar {
    width: 125px;
    background: transparent;
    border-right: 1px solid rgba(0, 0, 0, 0.04);
    padding: 10px 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.resource-sidebar::-webkit-scrollbar {
    display: none;
}

.resource-sidebar {
    scrollbar-width: none;
}

.res-cat-item {
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 6px;
}

.res-cat-item i {
    font-size: 13px;
    width: 14px;
    text-align: center;
}

.res-cat-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
}

.res-cat-item.active {
    background: transparent;
    color: var(--theme-green);
    box-shadow: none;
}

.resource-content-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 20px 20px;
}

.resource-content {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    display: grid;
    /* 👇 核心修改：强制分为 5 等份，并让格子在等份内居中对齐 */
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    gap: 20px 0;
    /* 左右间距由 1fr 自动计算，保持完美均分 */
    align-content: start;
    padding-top: 10px;
    /* 防切割顶棚缓冲 */
    padding-bottom: 20px;
}

.resource-content::-webkit-scrollbar {
    display: none;
}

.resource-content {
    scrollbar-width: none;
}

.res-app-item {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 62px;
}

.res-app-item:hover {
    transform: translateY(-3px);
}

.res-app-item .app-name {
    color: #334155;
    text-shadow: none;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .resource-independent-card {
        height: 70vh;
    }

    .resource-body {
        flex-direction: column;
    }

    .resource-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        flex-direction: row;
        padding: 10px;
        overflow-x: auto;
        gap: 8px;
    }

    .res-cat-item {
        padding: 6px 12px;
    }

    .resource-content-wrap {
        padding: 16px;
    }

    /* 👇 手机端核心修改：强行切换为 4 等份列布局 */
    .resource-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =========================================
   📱 修复手机端分类被挤压变形（变乱码）的 Bug
   ========================================= */
@media (max-width: 768px) {
    .resource-sidebar {
        flex-wrap: nowrap !important;
        /* 强制排成一排 */
        -webkit-overflow-scrolling: touch;
        /* 让手机横向滑动更丝滑 */
    }

    .res-cat-item {
        /* 👇 核心修复：禁止系统强行挤压分类宽度，保持文字完美显示！ */
        flex-shrink: 0 !important;
    }
}

/* 深色模式全局适配 */
body.dark-app-icons .resource-independent-card {
    background: rgba(30, 30, 32, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.dark-app-icons .resource-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

body.dark-app-icons .resource-header h3 {
    color: #f8fafc;
}

body.dark-app-icons .resource-close {
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
}

body.dark-app-icons .resource-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

body.dark-app-icons .resource-sidebar {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-app-icons .res-cat-item {
    color: #a1a1aa;
}

body.dark-app-icons .res-cat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

body.dark-app-icons .res-cat-item.active {
    background: transparent;
    color: #fde047;
    box-shadow: none;
}

body.dark-app-icons .res-app-item .app-name {
    color: rgba(255, 255, 255, 0.95);
}

.dock-item[data-name] {
    position: relative;
}

.dock-item[data-name]::after {
    content: attr(data-name);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 1000;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-item[data-name]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 15px);
    transform: translateX(-50%) scale(1);
}

body.dark-app-icons .dock-item[data-name]::after {
    background: rgba(50, 50, 50, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-app-icons .kk-mac-card {
    background: rgba(30, 30, 32, 0.85) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    color: #e2e8f0;
}

body.dark-app-icons .kk-mac-title,
body.dark-app-icons .confirm-title {
    color: #f8fafc !important;
}

body.dark-app-icons .confirm-msg {
    color: #a1a1aa !important;
}

body.dark-app-icons .kk-mac-close {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #a1a1aa !important;
}

body.dark-app-icons .kk-mac-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #f8fafc !important;
}

body.dark-app-icons .kk-mac-tab {
    color: #a1a1aa !important;
}

body.dark-app-icons .kk-mac-tab:hover {
    color: #f8fafc !important;
}

body.dark-app-icons .kk-mac-tab.active {
    color: var(--theme-green) !important;
    border-bottom-color: var(--theme-green) !important;
}

body.dark-app-icons .kk-mac-input-group,
body.dark-app-icons .kk-mac-select-group {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #e2e8f0 !important;
}

body.dark-app-icons .kk-mac-input-group input {
    color: #f8fafc !important;
}

body.dark-app-icons .kk-mac-input-group input::placeholder {
    color: #64748b !important;
}

body.dark-app-icons .kk-mac-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

body.dark-app-icons .kk-mac-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

body.dark-app-icons .kk-mac-btn.btn-danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

body.dark-app-icons .folder-item {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #a1a1aa !important;
}

body.dark-app-icons .folder-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #f8fafc !important;
}

body.dark-app-icons .folder-item.active {
    background: rgba(101, 163, 13, 0.15) !important;
    border-color: rgba(101, 163, 13, 0.3) !important;
    color: var(--theme-green) !important;
}

body.dark-app-icons .kk-mac-tabs {
    border-bottom-color: transparent !important;
    /* 将深色模式下的分割线设为透明 */
}

/* 🌟 手机端收纳夹网格强制微调 (调整这里让影子完美重叠) */
@media (max-width: 768px) {
    #kk-folder-view-modal .folder-view-main-content {
        top: 9vh !important; 
    }
    #kk-folder-view-modal .folder-view-grid-widget {
        top: 100px !important; /* 👈 核心在这里！*/
    }
}
