/* ========================================
 * 动态壁纸新标签页 - 自定义样式
 * 纯 CSS 版本（配合 Tailwind CDN 使用）
 * 注意：不使用 @layer/@apply，避免 Tailwind CDN 不解析外部 CSS
 * ======================================== */

/* ===== 全局字体 ===== */
/* ===== 自定义字体 仅保留woff2 减少冗余格式 ===== */
@font-face {
    font-family: "Museo";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/museo-500.woff2") format("woff2");
}
/* Sofia Regular */
@font-face {
    font-family: 'Sofia';
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local('Sofia'), local('Sofia-Normal'),
        url('https://lib.baomitu.com/fonts/sofia/sofia-regular.woff2') format('woff2');
}
/* Roboto Regular */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: normal;
    font-display: swap;
    src: local('Roboto'), local('Roboto-Normal'),
        url('https://lib.baomitu.com/fonts/roboto/roboto-regular.woff2') format('woff2');
}

body {
    font-family: 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', Roboto, Sofia, 'Source Han Sans TC', 'Noto Sans SC', 'Noto Sans TC', system-ui, -apple-system, sans-serif;
    cursor: url(../assets/icons/pointer_normal.cur), auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a:hover, a:active {
    cursor: url(../assets/icons/pointer_link.cur), pointer;
    transition: color 0.3s ease-out;
}


#timeText, #dateText {
    font-family: 'Consolas', 'Cascadia Mono', 'Menlo', 'monospace', 'Museo', 'Sofia', 'Roboto', 'HarmonyOS Sans SC', 'PingFang SC', system-ui, -apple-system, sans-serif;
}

footer {
    font-family: 'Museo', 'Sofia', 'Roboto', 'HarmonyOS Sans SC', 'PingFang SC', system-ui, -apple-system, sans-serif;
}

/* ===== 滚动条隐藏 ===== */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* ===== 玻璃拟态背景 ===== */
.glass {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glassDark {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.borderGray {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== 按钮悬停效果 ===== */
.btn-hover-effect {
    transition: all 0.2s ease-out;
}

.btn-hover-effect:hover {
    cursor: url(../assets/icons/pointer_link.cur), pointer;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ===== 壁纸视频过渡 ===== */
#bgWallpaper {
    transition: opacity 0.5s ease;
    will-change: opacity;
}

.search-box {
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.10);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.search-history-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    overflow: hidden;
    z-index: 50;
    color: white;
    animation: dropdownFadeIn 0.2s ease;
}

.search-history-menu button:hover, .search-history-menu .cursor-pointer {
    cursor: url(../assets/icons/pointer_link.cur), pointer;
}


@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 下拉菜单通用 ===== */
.dropdown-menu {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    overflow: hidden;
    color: white;
    animation: dropdownFadeIn 0.2s ease;
}

/* ===== 搜索引擎下拉菜单专属样式 ===== */
#engineMenu {
    /* 高不透明度深色背景，完全遮挡下方内容，与快捷导航区分 */
    background-color: rgba(255, 255, 255, 0.1)
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    left: 0px;
    /* 使用专属居中动画，避免与通用动画的transform冲突 */
    animation: none;
}

@media (min-width: 768px) {
    #engineMenu {
        left: 50%;
        --tw-translate-x: -50%;
        transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
        animation: engineMenuFadeIn 0.2s ease;
    }
}


@keyframes engineMenuFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== 弹窗通用样式 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.25s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 1rem;
    color: white;
    animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== 表单输入 ===== */
.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

/* ===== 按钮样式 ===== */
.btn-primary {
    padding: 0.5rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.bt-success {
    padding: 0.5rem 1.25rem;
    background-color: rgba(25, 135, 84, 0.3);
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
}

.bt-success:hover {
    background-color: rgba(25, 135, 84, 0.5);
}

.btn-danger {
    padding: 0.5rem 1.25rem;
    background-color: rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.5);
}

.btn-ghost {
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    transition: background-color 0.2s;
    cursor: pointer;
    border: none;
}

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

/* ===== 快捷方式项 ===== */
.shortcut-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.shortcut-item:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.shortcut-add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    cursor: pointer;
    opacity: 0.7;
}

.shortcut-add-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ===== 壁纸项悬停 ===== */
.wall-item-hover {
    transition: all 0.2s;
}

.wall-item-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* ===== 加载骨架屏 ===== */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 25%,
            rgba(255, 255, 255, 0.15) 50%,
            rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== 壁纸切换 loading 指示器 ===== */
.wallpaper-loading {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallpaper-loading.active {
    opacity: 1;
}

.wallpaper-loading .spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== 文字阴影 ===== */
.text-shadow {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.text-shadow-lg {
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ===== 禁止选中 ===== */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* ===== 搜索历史条目 ===== */
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.history-item .history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.history-item .history-delete {
    opacity: 0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: opacity 0.15s;
    color: rgba(255, 255, 255, 0.5);
}

.history-item:hover .history-delete {
    opacity: 1;
}

.history-item .history-delete:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-header .clear-all-btn {
    cursor: pointer;
    transition: color 0.15s;
}

.history-header .clear-all-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.history-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== 壁纸列表项 ===== */
.wallpaper-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.wallpaper-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.wallpaper-item.active {
    border-color: #60a5fa;
}

.wallpaper-item video,
.wallpaper-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wallpaper-item .wall-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: white;
    font-size: 0.75rem;
    text-align: center;
}

.wallpaper-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.box-inlineBlock {
    position: relative;
    margin: 0px;
    box-sizing: border-box;
    display: inline-block;
    height: auto;
    width: auto;
    max-width: 100%;
    overflow: hidden;
    border-width: 0px;
    background-color: transparent;
    padding: 0px;
    opacity: 1;
}
.box-block, .img-block, .img-absolute {
    display: block;
}

.img-absolute {
    position: absolute;
    inset: 0px;
    margin: auto;
    height: 0px;
    max-height: 100%;
    min-height: 100%;
    width: 0px;
    min-width: 100%;
    border-style: none;
}