.theme-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.theme-modal-content {
    background: var(--panel);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--window-shadow);
}

.theme-modal-content h3 {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text);
}

.theme-option:hover {
    background: rgba(14, 165, 233, 0.1);
    transform: translateY(-2px);
}

.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.light-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
}

.dark-preview {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid #1e293b;
}

.auto-preview {
    background: linear-gradient(135deg, #f8fafc 0%, #1e293b 100%);
    border: 1px solid #e2e8f0;
}

.theme-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-close:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
}

/* 主题相关的 CSS 变量 */
:root {
    /* 亮色主题变量 */
    --primary: #475569;
    --secondary: #64748b;
    --accent: #0ea5e9;
    --bg: #f8fafc;
    --panel: #ffffff;
    --text: #0f172a;
    --text-dim: #475569;
    --border: #e2e8f0;
    --panel-blur: blur(10px);
    --dock-blur: blur(20px);
    --window-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    --card-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    --hover-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}

/* 暗色主题变量 */
:root[data-theme="dark"] {
    --primary: #6366f1;
    --secondary: #818cf8;
    --accent: #38bdf8;
    --bg: #0f172a;
    --panel: #1e293b;
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --border: #2d3748;
}

/* Dock 夜间模式 */
[data-theme="dark"] .dock {
    background: rgba(17, 25, 40, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dock-item {
    background: rgba(17, 25, 40, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dock-item:hover {
    background: rgba(14, 165, 233, 0.15);
}

/* Topbar 夜间模式 */
[data-theme="dark"] .topbar {
    background: rgba(17, 25, 40, 0.75);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nav-link {
    color: var(--text);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(14, 165, 233, 0.15);
}

/* Dock 夜间模式样式 */
[data-theme="dark"] .gnome-dock {
    background: rgba(15, 23, 42, 0.75);  /* 深色半透明背景 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

/* GNOME Dock 基础样式 */
.dock-icon {
    position: relative;  /* 添加相对定位 */
    background: rgba(255, 255, 255, 0.8);  /* 浅色模式背景 */
    color: var(--text-dim);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.dock-icon:hover,
.dock-icon.active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent);
    transform: translateY(-3px);
}

/* 激活指示器样式 */
.dock-icon.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent);
    transition: all 0.3s ease;
}

/* 暗色模式适配 */
[data-theme="dark"] .dock-icon {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
}

[data-theme="dark"] .dock-icon:hover,
[data-theme="dark"] .dock-icon.active {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent);
}

/* Topbar 夜间模式样式 */
[data-theme="dark"] .gnome-top-bar {
    background: rgba(15, 23, 42, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .activities-button,
[data-theme="dark"] .current-app,
[data-theme="dark"] .system-status,
[data-theme="dark"] .time {
    color: var(--text);
}

[data-theme="dark"] .activities-button:hover {
    background: rgba(14, 165, 233, 0.15);
}

[data-theme="dark"] .system-status i {
    color: var(--text);
}

/* 添加哔哩哔哩图标样式 */
.fab.fa-bilibili::before {
    content: ""; /* 清除原有内容 */
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M777.514667 131.669333a53.333333 53.333333 0 0 1 0 75.434667L728.746667 255.829333h49.92A160 160 0 0 1 938.666667 415.872v320a160 160 0 0 1-160 160H245.333333A160 160 0 0 1 85.333333 735.872v-320a160 160 0 0 1 160-160h49.749334L246.4 207.146667a53.333333 53.333333 0 0 1 75.392-75.434667l113.152 113.152c3.370667 3.370667 6.186667 7.04 8.448 10.965333h137.088c2.261333-3.925333 5.12-7.68 8.490667-11.008l113.109333-113.152a53.333333 53.333333 0 0 1 75.434667 0z m1.152 231.253334H245.333333a53.333333 53.333333 0 0 0-53.205333 49.365333l-0.128 4.010667v320c0 28.117333 21.76 51.114667 49.365333 53.162666l3.968 0.170667h533.333334a53.333333 53.333333 0 0 0 53.205333-49.365333l0.128-3.968v-320c0-29.44-23.893333-53.333333-53.333333-53.333334z m-426.666667 106.666666c29.44 0 53.333333 23.893333 53.333333 53.333334v53.333333a53.333333 53.333333 0 1 1-106.666666 0v-53.333333c0-29.44 23.893333-53.333333 53.333333-53.333334z m320 0c29.44 0 53.333333 23.893333 53.333333 53.333334v53.333333a53.333333 53.333333 0 1 1-106.666666 0v-53.333333c0-29.44 23.893333-53.333333 53.333333-53.333334z' fill='%23515151'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* 暗色模式下的图标颜色 */
[data-theme="dark"] .fab.fa-bilibili::before {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M777.514667 131.669333a53.333333 53.333333 0 0 1 0 75.434667L728.746667 255.829333h49.92A160 160 0 0 1 938.666667 415.872v320a160 160 0 0 1-160 160H245.333333A160 160 0 0 1 85.333333 735.872v-320a160 160 0 0 1 160-160h49.749334L246.4 207.146667a53.333333 53.333333 0 0 1 75.392-75.434667l113.152 113.152c3.370667 3.370667 6.186667 7.04 8.448 10.965333h137.088c2.261333-3.925333 5.12-7.68 8.490667-11.008l113.109333-113.152a53.333333 53.333333 0 0 1 75.434667 0z m1.152 231.253334H245.333333a53.333333 53.333333 0 0 0-53.205333 49.365333l-0.128 4.010667v320c0 28.117333 21.76 51.114667 49.365333 53.162666l3.968 0.170667h533.333334a53.333333 53.333333 0 0 0 53.205333-49.365333l0.128-3.968v-320c0-29.44-23.893333-53.333333-53.333333-53.333334z m-426.666667 106.666666c29.44 0 53.333333 23.893333 53.333333 53.333334v53.333333a53.333333 53.333333 0 1 1-106.666666 0v-53.333333c0-29.44 23.893333-53.333333 53.333333-53.333334z m320 0c29.44 0 53.333333 23.893333 53.333333 53.333334v53.333333a53.333333 53.333333 0 1 1-106.666666 0v-53.333333c0-29.44 23.893333-53.333333 53.333333-53.333334z' fill='%23FFFFFF'/%3E%3C/svg%3E");
}

/* 自定义HTML容器样式 - 作为装饰层 */
.custom-html-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;  /* 低层级，确保不影响交互 */
    pointer-events: none;  /* 禁用鼠标事件，使其不影响下层元素的点击 */
    overflow: hidden;  /* 防止内容溢出 */
}

/* 如果自定义HTML中有需要交互的元素，可以单独启用其事件 */
.custom-html-container a,
.custom-html-container button {
    pointer-events: auto;
}

/* 添加关键渲染路径CSS */
:root {
    /* 预定义所有颜色变量 */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    /* ... 其他颜色变量 ... */
    
    /* 性能优化: 预定义动画关键帧 */
    --animation-timing: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-speed: 0.3s;
}

/* 优化字体加载 */
@font-face {
    font-family: 'CustomFont';
    font-display: swap;
    src: url('../fonts/custom-font.woff2') format('woff2');
}

/* 添加打印样式 */
@media print {
    .gnome-dock,
    .theme-modal,
    .social-links {
        display: none !important;
    }
}

/* GNOME顶栏样式 */
.gnome-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: var(--panel-blur);
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--text);
    font-size: 13px;
    z-index: 9999;
    border-bottom: 1px solid var(--border);
}

.activities-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activities-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.top-bar-center {
    flex: 1;
    text-align: center;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 12px;
}