/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 横向功能组件标题 - 加粗轮廓背景透明 */
#horizontal-components h3 {
    font-weight: 900 !important;
    color: var(--accent-cyan) !important;
    background: transparent !important;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.6), -1px -1px 0px rgba(0,0,0,0.6), 1px -1px 0px rgba(0,0,0,0.6), -1px 1px 0px rgba(0,0,0,0.6);
    font-size: 16px !important;
}

/* 在线时长统计内容 - 加粗轮廓背景透明 */
#online-time {
    font-weight: 900 !important;
    color: var(--accent-cyan) !important;
    background: transparent !important;
    text-shadow: 1px 1px 0px rgba(0,0,0,0.6), -1px -1px 0px rgba(0,0,0,0.6), 1px -1px 0px rgba(0,0,0,0.6), -1px 1px 0px rgba(0,0,0,0.6);
    font-size: 18px !important;
}

/* 在线时长容器 - 透明背景 */
#horizontal-components > div:first-child {
    background: transparent !important;
    border: 1.5px solid var(--accent-cyan) !important;
    box-shadow: 0 0 7px rgba(34, 211, 238, 0.5) !important;
}

/* 搜索书签输入框容器 - 透明背景带边框 */
#horizontal-components > div:nth-child(4) {
    background: transparent !important;
    border: 1.5px solid var(--accent-cyan) !important;
    box-shadow: 0 0 7px rgba(34, 211, 238, 0.5) !important;
}

/* 主题颜色定义 */
:root {
    /* 深色主题 */
    --primary-bg: #0F172A;
    --secondary-bg: #1E293B;
    --accent-purple: #8B5CF6;
    --accent-cyan: #22D3EE;
    --text-light: #F8FAFC;
    --text-gray: #94A3B8;
    --border-color: #334155;
    --shadow: 0 4px 12px rgba(0,0,0,0.2);
    --card-hover: transform scale(1.05);
    
    /* 浅色主题 */
    --light-primary-bg: #E0F2FE;
    --light-secondary-bg: #FFFFFF;
    --light-text-dark: #1E293B;
    --light-text-gray: #64748B;
}

/* 深色主题 */
body {
    background-color: var(--primary-bg);
    color: var(--text-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* 确保星空背景固定不动 */
#stars-background {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
}

/* 主内容区域 - 向下移动6em */
main {
    margin-top: 6em !important;
    position: relative;
    z-index: 10;
}

/* 浅色主题 */
body.light-mode {
    background-color: var(--light-primary-bg);
    color: var(--light-text-dark);
}

body.light-mode #top-control-bar {
    background-color: transparent !important;
}

body.light-mode #theme-toggle i {
    color: var(--light-text-dark);
}

body.light-mode #settings-btn i {
    color: var(--light-text-dark);
}

body.light-mode #edit-center-btn i {
    color: var(--accent-cyan);
}

body.light-mode #horizontal-components > div {
    background-color: var(--light-secondary-bg)/60;
}

body.light-mode #horizontal-components h3 {
    color: var(--light-text-gray);
}

body.light-mode #horizontal-components p {
    color: var(--light-text-dark);
}

body.light-mode #search-input {
    color: var(--light-text-dark);
}

body.light-mode #search-input::placeholder {
    color: var(--light-text-gray);
}

body.light-mode #search-results {
    background-color: var(--light-secondary-bg);
}

body.light-mode .bookmark-category {
    background-color: var(--light-secondary-bg);
}

body.light-mode .bookmark-card {
    background-color: var(--light-secondary-bg);
}

body.light-mode .bookmark-title {
    color: var(--light-text-dark);
}

body.light-mode footer {
    background-color: var(--light-secondary-bg);
}

body.light-mode #bookmark-count,
body.light-mode #copyright {
    color: var(--light-text-gray);
}

/* 返回顶部按钮样式 */
#back-to-top {
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* 浅色主题下的返回顶部按钮 */
body.light-mode #back-to-top {
    background-color: var(--light-secondary-bg)/80;
    color: var(--light-text-dark);
    border-color: var(--border-color);
}

body.light-mode #back-to-top:hover {
    background-color: var(--light-secondary-bg);
}

/* 浅色主题下的健康提醒样式 */
body.light-mode #horizontal-components > div.bg-red-900\/40 {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

body.light-mode #horizontal-components > div.bg-orange-900\/40 {
    background-color: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

body.light-mode #horizontal-components > div.bg-yellow-900\/40 {
    background-color: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

body.light-mode #horizontal-components > div.bg-slate-900\/60 {
    background-color: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

/* 健康提醒小组件基础样式 */
#health-reminder {
    transition: all 0.3s ease;
    font-weight: 500;
    line-height: 1.5;
    opacity: 1;
    transform: translateY(0);
}

/* 确保浅色主题下文本颜色正确 */
/* 网站标题响应式优化 - 移动端文字大小调整 */
#site-title h1 {
    /* 针对超小屏幕（手机竖屏）设置更小的字体 */
    font-size: clamp(1rem, 5vw, 1.5rem) !important;
}

/* 确保在小屏幕设备上标题不会挤压变形 */
@media (max-width: 480px) {
    #site-title {
        margin: 0 0.5rem;
    }
    #site-title h1 {
        font-size: 1.1rem !important;
        letter-spacing: -0.025em;
    }
}

body.light-mode #health-reminder {
    color: var(--light-text-dark);
    font-weight: 500;
}

/* 健康提醒容器多元化样式 */
/* 基础样式 */
.health-reminder-container {
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 蓝色系列 - 与水相关的提醒 */
.health-reminder-container.water {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.4));
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

/* 绿色系列 - 与活动相关的提醒 */
.health-reminder-container.activity {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.4));
    border: 1px solid rgba(16, 185, 129, 0.5);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

/* 黄色系列 - 与眼睛相关的提醒 */
.health-reminder-container.eye {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4));
    border: 1px solid rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
}

/* 红色系列 - 与心脏相关的提醒 */
.health-reminder-container.heart {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(220, 38, 38, 0.4));
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

/* 紫色系列 - 与姿势相关的提醒 */
.health-reminder-container.posture {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(124, 58, 237, 0.4));
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

/* 发光边框效果 */
.health-reminder-container.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 30px rgba(139, 92, 246, 0.3);
    }
}

/* 轻微呼吸动画 */
.health-reminder-container.breathing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 旋转图标动画 */
#health-reminder i {
    display: inline-block;
    margin-right: 8px;
}

/* 波浪底部装饰 */
.health-reminder-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.5) 50%, 
        rgba(255,255,255,0) 100%);
    animation: wave 3s linear infinite;
}

/* 装饰性元素动画类 */
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-spin-slow {
    animation: spin-slow 10s linear infinite;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.05);
    }
}

.animate-beat {
    animation: beat 1.5s ease-in-out infinite;
}

@keyframes beat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.1);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(1);
    }
}

.animate-head-shake {
    animation: head-shake 2s ease-in-out infinite;
}

@keyframes head-shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px) rotate(-2deg);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px) rotate(2deg);
    }
}

@keyframes wave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* 浅色主题适配 */
body.light-mode .health-reminder-container {
    background-blend-mode: overlay;
}

body.light-mode .health-reminder-container.water {
    background-color: rgba(240, 249, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.8);
}

body.light-mode .health-reminder-container.activity {
    background-color: rgba(240, 253, 244, 0.9);
    border-color: rgba(16, 185, 129, 0.8);
}

body.light-mode .health-reminder-container.eye {
    background-color: rgba(255, 251, 235, 0.9);
    border-color: rgba(245, 158, 11, 0.8);
}

body.light-mode .health-reminder-container.heart {
    background-color: rgba(254, 242, 242, 0.9);
    border-color: rgba(239, 68, 68, 0.8);
}

body.light-mode .health-reminder-container.posture {
    background-color: rgba(250, 245, 255, 0.9);
    border-color: rgba(139, 92, 246, 0.8);
}

/* 左边框样式 - 增强视觉区分 */
.health-reminder-container.border-l-4 {
    border-left-width: 4px;
    border-left-style: solid;
}

/* 各类型健康提醒的左边框颜色 */
.health-reminder-container.border-blue-500 {
    border-left-color: rgba(59, 130, 246, 0.8);
}

.health-reminder-container.border-green-500 {
    border-left-color: rgba(16, 185, 129, 0.8);
}

.health-reminder-container.border-yellow-500 {
    border-left-color: rgba(245, 158, 11, 0.8);
}

.health-reminder-container.border-red-500 {
    border-left-color: rgba(239, 68, 68, 0.8);
}

.health-reminder-container.border-purple-500 {
    border-left-color: rgba(139, 92, 246, 0.8);
}

.health-reminder-container.border-yellow-300 {
    border-left-color: rgba(251, 191, 36, 0.8);
}

.health-reminder-container.border-slate-500 {
    border-left-color: rgba(100, 116, 139, 0.8);
}

/* 增加图标大小和间距 */
#health-reminder i {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

body.light-mode .health-reminder-container::after {
    background: linear-gradient(90deg, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.2) 50%, 
        rgba(0,0,0,0) 100%);
}

/* 动态星空背景 - 增强宇宙效果 */
#stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at bottom,
        #0d1117 0%,
        #0a0e14 30%,
        #05080c 70%,
        #030507 100%
    );
    z-index: -1;
    overflow: hidden;
}

/* 添加星系光晕效果 */
#stars-background::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 30%;
    width: 60%;
    height: 60%;
    background: radial-gradient(
        circle,
        rgba(45, 212, 191, 0.05) 0%,
        rgba(45, 212, 191, 0) 70%
    );
    filter: blur(40px);
    animation: galaxyPulse 15s ease-in-out infinite;
}

#stars-background::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: 20%;
    width: 50%;
    height: 50%;
    background: radial-gradient(
        circle,
        rgba(139, 92, 246, 0.05) 0%,
        rgba(139, 92, 246, 0) 70%
    );
    filter: blur(40px);
    animation: galaxyPulse 18s ease-in-out infinite reverse;
}

/* 星星基础样式 */
.star {
    position: absolute;
    border-radius: 50%;
    animation: twinkle var(--twinkle-duration, 3s) infinite ease-in-out;
    transform-origin: center;
}

/* 不同层级的星星样式 */
.star-layer-1 {
    z-index: 1;
    animation-delay: calc(var(--twinkle-duration) * 0.2);
}

.star-layer-2 {
    z-index: 2;
    animation-delay: calc(var(--twinkle-duration) * 0.4);
}

.star-layer-3 {
    z-index: 3;
    animation-delay: calc(var(--twinkle-duration) * 0.6);
}

/* 星星闪烁动画 - 增强效果 */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 移动星星效果 */
.moving-star {
    animation: twinkle var(--twinkle-duration, 3s) infinite ease-in-out,
               starMove var(--move-duration, 15s) infinite linear;
}

@keyframes starMove {
    0% {
        transform: translateX(0) translateY(0);
    }
    50% {
        transform: translateX(calc(var(--move-direction) * 50px)) translateY(calc(var(--move-direction) * -30px));
    }
    100% {
        transform: translateX(0) translateY(0);
    }
}

/* 大星星发光效果 */
.star-layer-1 {
    box-shadow: 0 0 8px 1px rgba(255, 255, 255, 0.5);
}

/* 行星样式 */
.planet {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 15px 2px currentColor;
    animation: planetGlow 5s ease-in-out infinite;
    z-index: 4;
}

@keyframes planetGlow {
    0%, 100% {
        opacity: 0.8;
        box-shadow: 0 0 15px 2px currentColor;
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 20px 3px currentColor;
    }
}

/* 星云样式 */
.nebula {
    position: absolute;
    border-radius: 50%;
    opacity: 0.7;
    animation: nebulaFlow var(--nebula-duration, 15s) infinite ease-in-out;
    z-index: 0;
    pointer-events: none;
}

@keyframes nebulaFlow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.5;
    }
    25% {
        transform: scale(1.05) rotate(2deg);
        opacity: 0.7;
    }
    50% {
        transform: scale(1) rotate(0deg);
        opacity: 0.6;
    }
    75% {
        transform: scale(0.95) rotate(-2deg);
        opacity: 0.5;
    }
}

/* 星系脉动效果 */
@keyframes galaxyPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* 呼吸动画效果定义 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes slow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes very-slow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes fast-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes scale-in {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes scale-out {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0; }
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* 呼吸动画CSS类 */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-slow-pulse {
    animation: slow-pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-very-slow-pulse {
    animation: very-slow-pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-fast-pulse {
    animation: fast-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-scale-in {
    animation: scale-in 0.3s ease-out;
}

.animate-scale-out {
    animation: scale-out 0.3s ease-in;
}

.animate-bounce-in {
    animation: bounce-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 彩色跑马灯动画 */
@keyframes neon-border {
    0% {
        box-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff, 0 0 15px #ff00ff;
    }
    25% {
        box-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #00ffff;
    }
    50% {
        box-shadow: 0 0 5px #ffff00, 0 0 10px #ffff00, 0 0 15px #ffff00;
    }
    75% {
        box-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00, 0 0 15px #00ff00;
    }
    100% {
        box-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff, 0 0 15px #ff00ff;
    }
}

/* 健康提醒组件 - 背景透明 */
#horizontal-components > div:nth-child(2),
.health-reminder-container {
    background-color: transparent !important;
}

/* 世界时钟彩色跑马灯效果 - 背景透明 */
#horizontal-components > div:nth-child(3) {
    position: relative;
    border: 2px solid transparent;
    animation: neon-border 5s linear infinite;
    background-color: transparent !important;
}

/* 增强跑马灯效果 - 添加发光内阴影 */
#horizontal-components > div:nth-child(3):before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, transparent);
    z-index: -1;
}

/* 顶部控制栏 */
#top-control-bar {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#top-control-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

/* 横向功能组件 */
#horizontal-components > div {
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    background-color: var(--secondary-bg);
    transition: all 0.3s ease;
}

#horizontal-components > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

/* 书签展示区域 - 参考jznav样式 */
.bookmark-category {
    margin-bottom: 20px;
    background-color: transparent;
    border-radius: 8px;
    padding: 12px;
    box-shadow: none;
    border: 1px solid rgba(14, 165, 233, 0.3);
    transition: all 0.2s ease;
}

.bookmark-category:hover {
    border-color: rgba(14, 165, 233, 0.6);
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.2);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.category-name {
    font-weight: 800;
    color: var(--text-primary);
    font-size: 16px;
    max-width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: transparent;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3), -2px -2px 0px rgba(0,0,0,0.3), 2px -2px 0px rgba(0,0,0,0.3), -2px 2px 0px rgba(0,0,0,0.3);
}

.category-toggle {
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.category-toggle.expanded {
    transform: rotate(180deg);
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .bookmark-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }
}

.bookmark-card {
    width: 100%;
    height: auto;
    min-height: 80px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(56, 189, 248, 0.1) 100%);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(14, 165, 233, 0.2);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(1px);
}

@media (min-width: 769px) {
    .bookmark-card {
        min-height: 90px;
    }
}

.bookmark-card:hover {
    transform: translateY(-2px);
    background-color: rgba(14, 165, 233, 0.15);
    box-shadow: 0 3px 8px rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.4);
}

/* 书签悬停时的辉光效果 */
.bookmark-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(14, 165, 233, 0.05), transparent);
    transform: rotate(45deg);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.bookmark-card:hover::before {
    opacity: 1;
}

.bookmark-favicon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    object-fit: contain;
    border-radius: 4px;
    background-color: transparent;
    padding: 2px;
}

.bookmark-letter {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    border-radius: 6px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.bookmark-letter:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bookmark-letter-text {
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.bookmark-letter-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    opacity: 0.4;
    transition: all 0.3s ease;
    z-index: 1;
}

.bookmark-letter:hover .bookmark-letter-glow {
    opacity: 0.7;
    transform: scale(1.1);
}

/* 浅色主题下的bookmark-letter样式 */
body.light-mode .bookmark-letter {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

body.light-mode .bookmark-letter:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bookmark-title {
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    max-width: 100%;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0 2px;
}

/* 广告位 - 全透明样式 - 尺寸锁定 */
[id^="ad-slot-"] {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    z-index: 1; /* 明确设置较低的z-index，确保在搜索结果之下 */
    cursor: pointer;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    width: 100%;
    height: 128px; /* 固定高度，对应Tailwind的h-32 */
    margin-bottom: 24px;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    will-change: transform; /* 优化性能 */
    min-height: 128px !important; /* 强制最小高度，覆盖响应式设置 */
    max-height: 128px !important; /* 强制最大高度，确保尺寸锁定 */
}

[id^="ad-slot-"]:hover {
    box-shadow: none;
}

/* 广告图片样式 */
.ad-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: visible;
    position: relative;
}

.ad-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s ease;
    backface-visibility: hidden;
}

.ad-container:hover img {
    transform: scale(1.05);
}

/* 广告遮罩效果 */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ad-container:hover .ad-overlay {
    opacity: 1;
}

/* 响应式广告调整 - 由于尺寸锁定，这里不再改变高度 */
@media (max-width: 768px) {
    #ad-slot-1, #ad-slot-2, #ad-slot-3 {
    min-height: 128px !important; /* 保持固定高度 */
    max-height: 128px !important;
}
    
.ad-container {
    display: block;
}
    
.ad-container img {
    object-fit: contain;
}
}

/* 底部版权栏 */
footer {
    background-color: var(--primary-bg);
    padding: 16px 0;
    width: 100%;
}

/* 对话框样式 */
[id$="-dialog"] {
    animation: fadeIn 0.3s ease;
    z-index: 50;
}

/* 移动端适配 - 弹窗优化 */
@media (max-width: 768px) {
    [id$="-dialog"] > div {
        margin: 20px;
        padding: 20px;
        max-width: none !important;
        width: calc(100% - 40px) !important;
        border-radius: 12px;
    }
    
    /* 确保弹窗在小屏幕上居中显示 */
    [id$="-dialog"] {
        padding: 20px;
        align-items: flex-start;
        min-height: 100vh;
    }
    
    /* 按钮尺寸优化 - 增加触摸区域 */
    button {
        min-height: 48px;
        min-width: 48px;
        font-size: 16px;
    }
    
    /* 表单元素优化 - 增加触摸区域 */
    input, select, textarea {
        min-height: 48px;
        font-size: 16px;
        padding: 12px;
    }
    
    /* 编辑中心模态框适配 */
    #edit-center-modal {
        padding: 0;
    }
    
    #edit-center-modal > div {
        margin: 0;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        border-radius: 0;
    }
    
    /* 优化移动端菜单按钮和菜单项 */
    #mobile-menu-btn, .edit-menu-item {
        min-height: 52px;
        padding: 16px;
        font-size: 16px;
    }
    
    /* 优化设置中心和添加书签对话框表单 */
    #settings-dialog label, #add-bookmark-dialog label {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    /* 优化确认对话框按钮布局 */
    #confirm-dialog .flex {
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    /* 优化搜索结果在移动端的显示 */
    #search-results {
        margin: 0 20px;
        width: calc(100% - 40px);
    }
    
    /* 优化顶部控制栏按钮 */
    #top-control-bar button {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* 优化返回顶部按钮 */
    #back-to-top {
        min-width: 56px;
        min-height: 56px;
    }
}

/* 编辑中心内部模态框样式 - 设置更高的z-index */
#add-bookmark-dialog,
#confirm-dialog {
    z-index: 60;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

[id$="-dialog"] > div {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 设置对话框 */
#settings-dialog > div {
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* 密码可见性切换按钮样式 */
#toggle-password-visibility {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 防止按钮在hover时移动 */
    transition: color 0.2s ease;
}

#toggle-password-visibility:hover {
    /* 只改变颜色，不改变位置 */
    transform: translateY(-50%) !important;
    box-shadow: none !important;
}

#toggle-password-visibility:active {
    /* 点击时轻微缩放，但不移动 */
    transform: translateY(-50%) scale(0.95) !important;
}

/* 移动端优化 - 防止密码可见按钮在点击时出现位置问题 */
@media (max-width: 768px) {
    #toggle-password-visibility {
        /* 确保绝对定位生效 */
        position: absolute !important;
        /* 增加按钮尺寸以提高移动端点击体验 */
        width: 32px;
        height: 32px;
        /* 确保z-index高于其他元素 */
        z-index: 100;
    }
    
    /* 禁用全局伪元素对密码可见按钮的影响 */
    #toggle-password-visibility::before {
        content: none !important;
        display: none !important;
    }
}


/* 搜索结果 */
#search-results {
    animation: slideDown 0.2s ease;
    z-index: 99999;
    background-color: var(--secondary-bg);
}

@keyframes slideDown {
    from {
        margin-top: -10px;
        opacity: 0;
    }
    to {
        margin-top: 0;
        opacity: 1;
    }
}

.search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-item:hover {
    background-color: rgba(139, 92, 246, 0.2);
}

.search-result-item .highlight {
    color: var(--accent-cyan);
    font-weight: bold;
}

/* 通知提示 */
#notification {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0) translateY(-20px);
        opacity: 1;
    }
}

#notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* 编辑中心 */
#edit-center-modal {
    animation: fadeIn 0.3s ease;
    z-index: 40;
}

#edit-center-modal > div {
    animation: slideUp 0.3s ease;
}

.edit-menu-item {
    transition: all 0.2s ease;
}

.edit-menu-item.active-menu-item {
    border-left: 3px solid var(--accent-cyan);
    background-color: rgba(139, 92, 246, 0.2);
}

.edit-content {
    animation: fadeIn 0.3s ease;
}

/* 书签列表 */
#bookmark-list tr {
    transition: background-color 0.2s ease;
}

#bookmark-list tr:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

.bookmark-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 广告预览 */
.ad-preview {
    width: 200px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ad-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 4px;
    margin-top: 0;
    object-fit: contain;
}

/* 城市列表 */
.city-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.city-item:last-child {
    border-bottom: none;
}

.city-timezone {
    color: var(--text-gray);
    font-size: 14px;
}

.delete-city-btn {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.delete-city-btn:hover {
    transform: scale(1.2);
}

/* 添加书签对话框 */
#add-bookmark-dialog .error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 4px;
}

/* 加载动画 */
#loading-container {
    animation: fadeIn 0.3s ease;
}

/* 按钮点击效果 */
button {
    transition: all 0.1s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: scale(0.98);
}

/* 移动端触摸操作优化 */
@media (max-width: 768px) {
    /* 防止双击缩放和文本选择干扰 */
    button, a, [role="button"], .edit-menu-item {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* 优化点击区域 - 确保即使元素小，点击区域也足够大 */
    button::before, a::before, [role="button"]::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        z-index: -1;
    }
    
    /* 已定位元素不需要额外的点击区域优化 */
    button[style*="position"], a[style*="position"], [role="button"][style*="position"] {
        position: relative;
    }
    
    /* 优化动画性能 - 避免不必要的重排重绘 */
    [id$="-dialog"] > div, #edit-center-modal > div, #search-results {
        will-change: transform, opacity;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    /* 关闭页面滚动时的动画以提高性能 */
    .disable-transitions * {
        transition: none !important;
        animation: none !important;
    }
}

/* 输入框聚焦效果 */
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 允许控制栏在移动端显示和隐藏 */
    #top-control-bar {
        /* 移除强制常驻的样式 */
    }
    
    /* 隐藏桌面端元素 */
    .hidden-mobile {
        display: none;
    }
    
    /* 调整字体大小 */
    h1, h2, h3, h4, h5, h6 {
        font-size: 18px;
    }
    
    /* 输入框最小字体大小 */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* 移除移动端hover效果 */
    button:hover,
    .bookmark-card:hover,
    [id^="ad-slot-"]:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* 可点击元素最小尺寸 */
    button, 
    .bookmark-card, 
    [id^="ad-slot-"] {
        min-width: 44px;
        min-height: 44px;
    }
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 保存中动画 */
.saving-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

body.light-mode .saving-spinner {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: black;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-gray);
}

body.light-mode ::-webkit-scrollbar-track {
    background: var(--light-primary-bg);
}

body.light-mode ::-webkit-scrollbar-thumb {
    background: var(--light-text-gray);
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--light-text-dark);
}