/**
 * 文件名称：theme.css
 * 文件功能：主题系统样式文件，包含主题变量定义、暗黑模式样式和主题切换效果
 * 创建日期：2026-03-16
 * 维护人员：前端开发团队
 * 
 * 关键功能模块：
 * 1. 核心变量定义（浅色模式）
 * 2. 暗黑模式变量定义
 * 3. 主题切换动画效果
 * 4. 高对比度模式支持
 * 5. 减少动画偏好设置
 * 6. 日/夜主题切换按钮样式
 * 
 * 关联文件：
 * - static/js/theme.js：主题切换逻辑实现
 * - static/js/script.js：与主脚本文件交互
 * - static/css/style.css：基础样式文件
 * 
 * 注意事项：
 * - 使用 CSS 变量实现主题切换
 * - 支持系统主题自动检测
 * - 主题切换时使用平滑过渡效果
 * - 兼容高对比度模式和减少动画偏好设置
 */

/* ================= 核心变量 ================= */
:root {
    /* 主色调 - 蓝色系 */
    --primary: #4a84e8;
    --primary-light: #6b99f0;
    --primary-dark: #3a6bc0;
    --primary-hover: #5a90f5;
    --primary-active: #3a6bc0;

    /* 辅助色 */
    --secondary: #00e5ff;
    --secondary-light: #33eaff;
    --secondary-dark: #00b8cc;

    /* 功能色 */
    --success: #4caf50;
    --success-light: #66bb6a;
    --success-dark: #388e3c;
    --warning: #ff9800;
    --warning-light: #ffb74d;
    --warning-dark: #f57c00;
    --error: #f44336;
    --error-light: #ef5350;
    --error-dark: #d32f2f;
    --info: #2196f3;
    --info-light: #42a5f5;
    --info-dark: #1976d2;

    /* 中性色 - iOS标准 */
    --bg-color: #ffffff;
    --content-bg: #ffffff;
    --surface-bg: #f8f9fa;
    --text-main: #000000;
    --text-secondary: #3c3c43;
    --text-light: #8e8e93;
    --text-lighter: #c7c7cc;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --divider-color: #f0f0f0;

    /* 旧变量兼容 */
    --pink: var(--primary);
    --blue: var(--secondary);
    --purple: #e1859d;
    --purple1: #a855f7;

    /* 字体 */
    --font-main: 'Microsoft YaHei', sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;

    /* 排版 */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    --text-4xl: 36px;
    --text-5xl: 48px;

    --line-height-xs: 1.2;
    --line-height-sm: 1.3;
    --line-height-base: 1.5;
    --line-height-lg: 1.6;
    --line-height-xl: 1.8;

    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* 布局 */
    --ios-header-height: 56px;
    --ios-border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);

    /* 间距 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;

    /* 响应式断点 */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;

    /* 网格系统 */
    --grid-columns: 12;
    --grid-gutter: var(--space-4);
    --container-max-width: 1200px;
    --container-padding: var(--space-4);

    /* 按钮样式 */
    --btn-primary-bg: var(--primary);
    --btn-primary-color: #ffffff;
    --btn-primary-hover-bg: var(--primary-hover);
    --btn-primary-active-bg: var(--primary-active);

    --btn-secondary-bg: var(--surface-bg);
    --btn-secondary-color: var(--text-main);
    --btn-secondary-border: var(--border-color);
    --btn-secondary-hover-bg: var(--primary-light);
    --btn-secondary-hover-color: #ffffff;

    --btn-ghost-bg: transparent;
    --btn-ghost-color: var(--text-main);
    --btn-ghost-border: var(--border-color);
    --btn-ghost-hover-bg: var(--primary);
    --btn-ghost-hover-color: #ffffff;

    --btn-sm-padding: var(--space-2) var(--space-4);
    --btn-md-padding: var(--space-3) var(--space-6);
    --btn-lg-padding: var(--space-4) var(--space-8);

    --btn-sm-font-size: var(--text-sm);
    --btn-md-font-size: var(--text-base);
    --btn-lg-font-size: var(--text-lg);

    --btn-radius: var(--radius-md);
    --btn-shadow: var(--shadow-sm);
    --btn-hover-shadow: var(--shadow-md);

    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-ease-in-out: 0.3s ease-in-out;

    /* 图标 */
    --icon-size-sm: 16px;
    --icon-size-md: 24px;
    --icon-size-lg: 32px;
    --icon-size-xl: 48px;
    --icon-color: var(--text-main);
    --icon-hover-color: var(--primary);
}

/* ================= 暗黑模式变量 ================= */
.dark-mode {
    /* 主色调 - 蓝色系 */
    --primary: #5a90f5;
    --primary-light: #6b99f0;
    --primary-dark: #4a84e8;
    --primary-hover: #6aa0f6;
    --primary-active: #4a84e8;

    /* 辅助色 */
    --secondary: #00e5ff;
    --secondary-light: #33eaff;
    --secondary-dark: #00b8cc;

    /* 功能色 */
    --success: #66bb6a;
    --success-light: #81c784;
    --success-dark: #4caf50;
    --warning: #ffb74d;
    --warning-light: #ffcc80;
    --warning-dark: #ff9800;
    --error: #ef5350;
    --error-light: #e57373;
    --error-dark: #f44336;
    --info: #42a5f5;
    --info-light: #64b5f6;
    --info-dark: #2196f3;

    /* 中性色 - iOS标准 */
    --bg-color: #1c1c1e;
    --content-bg: #2c2c2e;
    --surface-bg: #3a3a3c;
    --text-main: #ffffff;
    --text-secondary: #e0e0e0;
    --text-light: #a1a1a6;
    --text-lighter: #8e8e93;
    --border-color: #38383a;
    --border-light: #48484a;
    --divider-color: #2c2c2e;

    /* 布局 */
    --ios-border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);

    /* 按钮样式 */
    --btn-primary-bg: var(--primary);
    --btn-primary-color: #ffffff;
    --btn-primary-hover-bg: var(--primary-hover);
    --btn-primary-active-bg: var(--primary-active);

    --btn-secondary-bg: var(--surface-bg);
    --btn-secondary-color: var(--text-main);
    --btn-secondary-border: var(--border-color);
    --btn-secondary-hover-bg: var(--primary-light);
    --btn-secondary-hover-color: #ffffff;

    --btn-ghost-bg: transparent;
    --btn-ghost-color: var(--text-main);
    --btn-ghost-border: var(--border-color);
    --btn-ghost-hover-bg: var(--primary);
    --btn-ghost-hover-color: #ffffff;

    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-ease-in-out: 0.3s ease-in-out;
}

/* ================= 主题切换动画 ================= */

/* 全局主题过渡 - 为所有使用CSS变量的元素添加平滑过渡 */
html,
body {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* 避免全量元素过渡导致切换卡顿：只给常见文本/背景属性做轻量过渡 */
*,
*::before,
*::after {
    transition: background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease;
}

/* 特定元素的主题过渡优化 */
.ios-header,
.ios-main-content,
.tech-card,
.module-card,
.domain-card,
.stat-card,
.why-card,
.nav-menu,
.universe-menu,
.cta-banner,
.site-footer,
.carousel-container,
.carousel-slide,
.cyber-btn,
.cta-btn,
.domain-btn,
.top-nav-item,
.nav-menu-item,
.universe-menu-item,
.percent,
.card-icon,
.module-icon,
.why-icon,
.intro-card,
.licensing-features,
.licensing-advantages,
.licensing-why,
.richness-content,
.guarantee-header,
.marketing-header,
.brand-content,
.hero-wrapper,
.hero-container,
.cta-inner,
.footer-inner,
.content-inner,
.stats-container,
.marketing-modules,
.feature-grid,
.domains-grid,
.why-grid,
.domains-header,
.licensing-intro,
.intro-content {
    transition: background-color 0.4s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

/* 表单元素和交互组件过渡 */
input,
textarea,
select,
button {
    transition: background-color 0.4s ease,
        color 0.4s ease,
        border-color 0.4s ease,
        box-shadow 0.4s ease;
}

/* SVG图标颜色过渡 */
svg,
svg path,
svg circle,
svg rect,
svg line,
svg polyline {
    transition: fill 0.4s ease, stroke 0.4s ease;
}

/* 图片和背景过渡 */
img,
.character-image,
.richness-image img,
.macbook-logo,
.why-icon img,
.intro-icon img {
    transition: filter 0.4s ease, opacity 0.4s ease;
}

/* 暗色模式下图片亮度调整 */
.dark-mode img:not(.logo-img):not([src*="logo"]) {
    filter: brightness(0.95);
}

/* 链接和文字颜色过渡 */
a,
span,
p,
h1,
h2,
h3,
h4,
h5,
h6,
li {
    transition: color 0.4s ease;
}

/* 滚动条颜色过渡 */
::-webkit-scrollbar-track {
    transition: background-color 0.4s ease;
}

::-webkit-scrollbar-thumb {
    transition: background-color 0.4s ease;
}

/* 遮罩和模糊效果过渡 */
#blurOverlay,
.nav-menu::before,
.universe-menu::before {
    transition: backdrop-filter 0.4s ease, background-color 0.4s ease;
}

/* 确保动画元素在主题切换时保持流畅 */
.theme-switch__container,
.theme-switch__sun-moon-container,
.theme-switch__moon,
.theme-switch__spot {
    transition: background-color 0.4s ease, transform 0.4s ease, opacity 0.4s ease;
}

/* 主题切换过场：更顺滑 easing + 轻微模糊淡入（克制） */
:root {
    --theme-switch-duration: 350ms;
    --theme-switch-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.theme-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(16, 18, 26, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition:
        opacity var(--theme-switch-duration) var(--theme-switch-ease),
        visibility 0s linear var(--theme-switch-duration),
        backdrop-filter var(--theme-switch-duration) var(--theme-switch-ease),
        -webkit-backdrop-filter var(--theme-switch-duration) var(--theme-switch-ease),
        background-color var(--theme-switch-duration) var(--theme-switch-ease);
}

.theme-loader-overlay.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
    background: rgba(16, 18, 26, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* 全局加载动画（基于 Uiverse 版本） */
.loader-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    width: auto;
    margin: 0;
    padding: 0 10px;
    font-family: "Poppins", sans-serif;
    font-size: 1.6em;
    font-weight: 600;
    user-select: none;
    color: #fff;
    scale: 1.15;
    opacity: 0.92;
    transform: translateY(4px) scale(0.985);
    transition: transform var(--theme-switch-duration) var(--theme-switch-ease), opacity var(--theme-switch-duration) var(--theme-switch-ease);
}

.theme-loader-overlay.active .loader-wrapper {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.loader {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
    background-color: transparent;
    mask: repeating-linear-gradient(90deg,
            transparent 0,
            transparent 6px,
            black 7px,
            black 8px);
}

.loader::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 50% 50%, #ff0 0%, transparent 50%),
        radial-gradient(circle at 45% 45%, #f00 0%, transparent 45%),
        radial-gradient(circle at 55% 55%, #0ff 0%, transparent 45%),
        radial-gradient(circle at 45% 55%, #0f0 0%, transparent 45%),
        radial-gradient(circle at 55% 45%, #00f 0%, transparent 45%);
    mask: radial-gradient(circle at 50% 50%,
            transparent 0%,
            transparent 10%,
            black 25%);
    animation:
        theme-loader-transform 2s infinite alternate,
        theme-loader-opacity 4s infinite;
    animation-timing-function: cubic-bezier(0.6, 0.8, 0.5, 1);
}

.loader-letter {
    display: inline-block;
    opacity: 0;
    animation: theme-loader-letter-anim 4s infinite linear;
    z-index: 2;
}

.loader-letter:nth-child(1) {
    animation-delay: 0.1s;
}

.loader-letter:nth-child(2) {
    animation-delay: 0.205s;
}

.loader-letter:nth-child(3) {
    animation-delay: 0.31s;
}

.loader-letter:nth-child(4) {
    animation-delay: 0.415s;
}

.loader-letter:nth-child(5) {
    animation-delay: 0.521s;
}

.loader-letter:nth-child(6) {
    animation-delay: 0.626s;
}

.loader-letter:nth-child(7) {
    animation-delay: 0.731s;
}

.loader-letter:nth-child(8) {
    animation-delay: 0.837s;
}

@keyframes theme-loader-transform {
    0% {
        transform: translate(-55%);
    }

    100% {
        transform: translate(55%);
    }
}

@keyframes theme-loader-opacity {

    0%,
    100% {
        opacity: 0;
    }

    15% {
        opacity: 1;
    }

    65% {
        opacity: 0;
    }
}

@keyframes theme-loader-letter-anim {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 1;
        text-shadow: 0 0 4px #fff;
        transform: scale(1.1) translateY(-2px);
    }

    20% {
        opacity: 0.2;
    }

    100% {
        opacity: 0;
    }
}

/* 避免对 body 使用 filter 导致 fixed 顶栏绘制异常/消失 */
html.theme-transitioning .ios-main-content {
    opacity: 0.96;
    transition: opacity var(--theme-switch-duration) var(--theme-switch-ease);
}

/* 主题切换瞬间临时降级顶部玻璃效果（仅性能模式启用） */
html.theme-perf-mode.theme-transitioning .ios-header,
html.theme-perf-mode.theme-transitioning .ios-header.scrolled,
html.theme-perf-mode.theme-transitioning .ios-header--dark,
html.theme-perf-mode.theme-transitioning .ios-header--dark.scrolled {
    backdrop-filter: blur(12px) saturate(120%) brightness(1) !important;
    -webkit-backdrop-filter: blur(12px) saturate(120%) brightness(1) !important;
    will-change: auto;
}

/* 主题开关动画性能优化：尽量只走 transform/opacity 合成层 */
.theme-switch,
.theme-switch * {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.theme-switch__container,
.theme-switch__circle-container,
.theme-switch__sun-moon-container,
.theme-switch__moon,
.theme-switch__stars-container,
.theme-switch__shooting-star,
.theme-switch__shooting-star-2,
.theme-switch__meteor,
.theme-switch__aurora,
.theme-switch__comets,
.theme-switch__comets .comet,
.theme-switch__stars-cluster .star {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* 避免被全局 transition 拖慢，主题开关内部单独控制时长 */
.theme-switch,
.theme-switch *,
.theme-switch *::before,
.theme-switch *::after {
    transition-duration: 220ms !important;
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1) !important;
}

/* 低性能/节能模式下进一步减负，减少粒子与流光层 */
html.theme-perf-mode .theme-switch__shooting-star,
html.theme-perf-mode .theme-switch__shooting-star-2,
html.theme-perf-mode .theme-switch__meteor,
html.theme-perf-mode .theme-switch__aurora,
html.theme-perf-mode .theme-switch__comets {
    display: none !important;
}

/* ================= iOS 长按菜单（全局） ================= */
:root {
    --ios-lp-radius: 20px;
    --ios-lp-item-radius: 12px;
    --ios-lp-border: rgba(180, 210, 255, 0.25);
    --ios-lp-bg-1: rgba(30, 38, 58, 0.72);
    --ios-lp-bg-2: rgba(18, 24, 38, 0.6);
    --ios-lp-item-bg: rgba(255, 255, 255, 0.03);
    --ios-lp-item-hover: rgba(255, 255, 255, 0.12);
    --ios-lp-text: #f5f8ff;
    --ios-lp-title: rgba(255, 255, 255, 0.6);
}

.ios-liquid-longpress-menu {
    position: fixed;
    z-index: 12000;
    width: 236px;
    min-width: 228px;
    max-width: 244px;
    padding: 8px 8px 6px;
    border-radius: var(--ios-lp-radius);
    border: 1px solid var(--ios-lp-border);
    background: linear-gradient(140deg, var(--ios-lp-bg-1), var(--ios-lp-bg-2));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.26);
    transform: scale(0.945) translateY(-5px);
    transform-origin: top right;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

.ios-liquid-longpress-menu::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 18px;
    width: 14px;
    height: 14px;
    transform: rotate(45deg);
    border-top: 1px solid var(--ios-lp-border);
    border-left: 1px solid var(--ios-lp-border);
    background: linear-gradient(140deg, color-mix(in srgb, var(--ios-lp-bg-1) 92%, transparent), color-mix(in srgb, var(--ios-lp-bg-2) 92%, transparent));
}

.ios-liquid-longpress-menu.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1) translateY(0);
    animation: ios-context-pop 260ms cubic-bezier(0.22, 0.68, 0.24, 1.03);
}

.ios-liquid-longpress-menu .liquid-menu-title {
    position: relative;
    text-align: left;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ios-lp-title);
    margin: 2px 6px 10px;
    padding-bottom: 6px;
}

.ios-liquid-longpress-menu .liquid-menu-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(180, 210, 255, 0.22), rgba(180, 210, 255, 0.08));
}

.ios-liquid-longpress-menu .liquid-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 28px 10px 12px;
    border-radius: var(--ios-lp-item-radius);
    color: var(--ios-lp-text);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid transparent;
    background: var(--ios-lp-item-bg);
    transform: scale(1);
    transition: background-color .2s ease, border-color .2s ease, transform .18s ease;
}

.ios-liquid-longpress-menu .liquid-menu-item+.liquid-menu-item {
    margin-top: 6px;
}

.ios-liquid-longpress-menu .liquid-menu-item:hover {
    background: var(--ios-lp-item-hover);
    border-color: rgba(255, 255, 255, 0.22);
    transform: scale(1.01);
}

.ios-liquid-longpress-menu .liquid-menu-item:active {
    transform: scale(0.985);
    transition-duration: .08s;
}

.ios-liquid-longpress-menu .liquid-menu-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(130, 180, 255, 0.55), 0 0 0 5px rgba(130, 180, 255, 0.2);
}

.ios-liquid-longpress-menu .liquid-menu-item.is-suggested {
    background: rgba(125, 180, 255, 0.18);
    border-color: rgba(165, 205, 255, 0.35);
}

.ios-liquid-longpress-menu .liquid-menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(157, 194, 255, 0.2);
    border: 1px solid rgba(182, 214, 255, 0.32);
    color: #e8f2ff;
    opacity: 1;
    flex-shrink: 0;
}

.ios-liquid-longpress-menu .liquid-menu-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ios-liquid-longpress-menu .liquid-menu-label {
    flex: 1;
}

.ios-liquid-longpress-menu .liquid-menu-item::after {
    content: '›';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(235, 245, 255, 0.45);
    font-size: 16px;
    line-height: 1;
}

@keyframes ios-context-pop {
    0% {
        opacity: 0;
        transform: scale(0.935) translateY(-6px);
    }

    70% {
        opacity: 1;
        transform: scale(1.018) translateY(0);
    }

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

.ios-longpress-trigger.ios-longpress-flash {
    box-shadow: 0 0 0 0 rgba(105, 170, 255, 0.55);
    animation: ios-longpress-blue-flash 1000ms ease-out;
}

@keyframes ios-longpress-blue-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(105, 170, 255, 0.55);
    }

    100% {
        box-shadow: 0 0 0 12px rgba(105, 170, 255, 0);
    }
}

html.ios-scroll-lock,
body.ios-scroll-lock {
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: none;
}

html:not(.dark-mode) {
    --ios-lp-border: rgba(170, 198, 238, 0.35);
    --ios-lp-bg-1: rgba(248, 252, 255, 0.98);
    --ios-lp-bg-2: rgba(238, 246, 255, 0.93);
    --ios-lp-item-bg: rgba(255, 255, 255, 0.7);
    --ios-lp-item-hover: rgba(255, 255, 255, 0.92);
    --ios-lp-text: #0e1f33;
    --ios-lp-title: rgba(20, 40, 72, 0.6);
}

.ios-longpress-tip {
    position: fixed;
    z-index: 12010;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
    color: #f0f6ff;
    background: rgba(20, 28, 46, 0.88);
    border: 1px solid rgba(180, 210, 255, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}

.ios-longpress-tip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ================= 高对比度模式支持 ================= */
@media (prefers-contrast: high) {
    .ios-header {
        border-bottom: 2px solid rgba(0, 0, 0, 0.5);
    }

    .dark-mode .ios-header {
        border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    }
}

/* ================= 减少动画偏好设置 ================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================= 日/夜主题切换按钮 ================= */
.fox-theme-toggle {
    display: block;
    position: relative;
    width: 50px;
    height: 30px;
    cursor: pointer;
    z-index: 9999;
}

.fox-theme-toggle input[type=checkbox] {
    cursor: pointer;
    z-index: 3;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.fox-switch {
    display: block;
    position: relative;
    width: 50px;
    height: 30px;
    border: 4px solid dodgerblue;
    border-radius: 30px;
    transition: border-color 0.25s ease 0s;
}

.fox-switch .fox-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    height: 20px;
    width: 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 100%;
    top: 50%;
    margin-top: -10px;
    left: 1px;
    transform: translateX(0px);
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.fox-button svg {
    width: 12px;
    height: 12px;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease, rotate 0.3s ease;
}

.sun-icon {
    color: #fff;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    color: #fefcd7;
    opacity: 0;
    transform: rotate(-90deg) scale(1.3);
}

.dark-mode .fox-switch {
    border-color: #fff;
}

.dark-mode .fox-switch .fox-button {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.6);
}

.dark-mode .fox-button .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.dark-mode .fox-button .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1.3);
}

.fox-theme-toggle input[type=checkbox]:checked~.fox-switch .fox-button {
    transform: translateX(20px);
}

.fox-theme-toggle input[type=checkbox]:checked~.fox-switch .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.fox-theme-toggle input[type=checkbox]:checked~.fox-switch .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1.3);
}