/* 默认主题：柔和深色 */
:root {
    --bg-color: #3a4345; /* 柔和灰绿色，温暖不沉闷 */
    --text-color: #f0f4f5; /* 浅灰白，清晰柔和 */
    --header-bg: linear-gradient(135deg, #ff9f85, #e06b6b); /* 温暖桃红渐变 */
    --header-text: #ffffff;
    --category-bg: rgba(70, 85, 95, 0.9); /* 浅灰蓝，优雅明快 */
    --category-text: #f9d77e; /* 柔和金黄，温暖醒目 */
    --link-bg: rgba(95, 110, 120, 0.25); /* 淡灰蓝，透明轻盈 */
    --link-text: #f0f4f5; /* 浅灰白 */
    --link-hover-text: #ffb399; /* 柔和珊瑚色，温暖过渡 */
    --footer-bg: rgba(50, 60, 70, 0.95); /* 中灰蓝，沉稳不暗 */
    --footer-text: #b8d8ff; /* 浅天蓝，清新优雅 */
    --button-bg: #e07b6b; /* 柔和赤桃色 */
    --button-hover-bg: #ffaa99; /* 浅桃红，活力优雅 */
}

/* 浪漫紫梦主题 */
.theme-romantic-purple {
    --bg-color: #403354; /* 柔和紫灰，浪漫不暗 */
    --header-bg: linear-gradient(135deg, #d4b8e8, #a88cd5); /* 浅薰衣草紫渐变 */
    --category-bg: rgba(85, 70, 110, 0.9); /* 淡紫灰，层次明快 */
    --category-text: #ffadd6; /* 浅樱花粉，浪漫柔和 */
    --link-bg: rgba(120, 95, 145, 0.25); /* 淡紫灰，轻盈透明 */
    --link-text: #f0f4f5; /* 浅灰白 */
    --link-hover-text: #f7e8a0; /* 浅金黄，温暖对比 */
    --footer-bg: rgba(60, 45, 80, 0.95); /* 中紫灰，沉稳优雅 */
    --footer-text: #e0c8f0; /* 淡紫白，清新高雅 */
    --button-bg: #9b6bc3; /* 柔和紫罗兰 */
    --button-hover-bg: #c495e0; /* 浅紫，活力优雅 */
}

/* 经典红唇主题 */
.theme-classic-red {
    --bg-color: #3c2a2a; /* 柔和红棕，复古不暗 */
    --header-bg: linear-gradient(135deg, #ff9e9b, #c94c4c); /* 浅红到中红渐变 */
    --category-bg: rgba(90, 60, 70, 0.9); /* 淡红棕，温暖明快 */
    --category-text: #ffd9a3; /* 浅杏色，柔和优雅 */
    --link-bg: rgba(120, 75, 85, 0.25); /* 淡红棕，轻盈透明 */
    --link-text: #f0f4f5; /* 浅灰白 */
    --link-hover-text: #90e8f5; /* 浅青蓝，清新对比 */
    --footer-bg: rgba(55, 35, 45, 0.95); /* 中红棕，沉稳不暗 */
    --footer-text: #ffc1cc; /* 浅粉红，清新柔和 */
    --button-bg: #c94c4c; /* 中红，低调温暖 */
    --button-hover-bg: #e57575; /* 浅红，活力优雅 */
}

/* 现代奢华主题 */
.theme-modern-luxe {
    --bg-color: #2e3749; /* 柔和海军蓝，现代不暗 */
    --header-bg: linear-gradient(135deg, #7abaff, #4c7bc3); /* 浅天蓝到中蓝渐变 */
    --category-bg: rgba(55, 70, 90, 0.9); /* 淡蓝灰，高级明快 */
    --category-text: #ffdca8; /* 柔和琥珀色，温暖优雅 */
    --link-bg: rgba(80, 95, 115, 0.25); /* 淡蓝灰，轻盈透明 */
    --link-text: #f0f4f5; /* 浅灰白 */
    --link-hover-text: #ffbca8; /* 浅珊瑚橙，活力对比 */
    --footer-bg: rgba(40, 50, 65, 0.95); /* 中蓝灰，低调奢华 */
    --footer-text: #a8d4ff; /* 浅天蓝，清新优雅 */
    --button-bg: #4c8cd9; /* 中蓝，现代感 */
    --button-hover-bg: #75aaff; /* 浅蓝，柔和过渡 */
}

/* Pornhub风格黑黄主题 */
.theme-pornhub-style {
    --bg-color: #1a1a1a; /* 深黑色背景，经典且低调 */
    --header-bg: linear-gradient(135deg, #ffcc00, #ff9900); /* 鲜黄到橙黄渐变，活力十足 */
    --category-bg: rgba(40, 40, 40, 0.9); /* 深灰色，沉稳且有层次 */
    --category-text: #ffcc00; /* 明亮黄色，醒目且符合风格 */
    --link-bg: rgba(60, 60, 60, 0.25); /* 淡灰色，透明轻盈 */
    --link-text: #ffffff; /* 纯白文字，清晰对比 */
    --link-hover-text: #ff9900; /* 橙黄色，hover时温暖且显眼 */
    --footer-bg: rgba(30, 30, 30, 0.95); /* 更深的灰黑，低调酷感 */
    --footer-text: #ffcc00; /* 黄色文字，保持一致性 */
    --button-bg: #ff9900; /* 橙黄色按钮，活力与辨识度兼具 */
    --button-hover-bg: #ffcc00; /* 明黄色，hover时更亮眼 */
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', 'PingFang SC', sans-serif;
}

body {
    background: linear-gradient(180deg, var(--bg-color), rgba(0, 0, 0, 0.7)), 
                url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJElEQVQYV2NkYGD4z8DAwMgABXAGNg4ODA8MDAzMwMDAwAABZgAEG2X9WAAAAAElFTkSuQmCC');
    background-blend-mode: overlay;
    color: var(--text-color);
    line-height: 1.6;
    transition: background 0.5s ease, color 0.5s ease;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    padding-top: 20px;
    font-size: 1.1rem;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.15) 100%);
    animation: pulse 15s infinite ease-in-out;
    z-index: -1;
}

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

.container {
    max-width: 1200px;
    min-width: 320px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 15px;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--header-bg);
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 3px 3px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 15px;
    position: relative;
    animation: glow 4s infinite alternate;
}

@keyframes glow {
    0% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.3), 3px 3px 20px rgba(0, 0, 0, 0.3); }
    100% { text-shadow: 0 0 20px rgba(255, 255, 255, 0.6), 3px 3px 25px rgba(0, 0, 0, 0.4); }
}

.header .subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    opacity: 0.9;
    margin: 5px 0 10px;
    font-style: italic;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.header-decor {
    width: 80px;
    height: 4px;
    background: var(--header-bg);
    margin: 10px auto;
    border-radius: 5px;
    box-shadow: 0 2px 15px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.header-decor::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.announcement {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    margin: 0 auto 20px;
    max-width: 70%;
    animation: fadeIn 1.5s ease-in;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* 分类样式 */
.category {
    background: var(--category-bg);
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    backdrop-filter: blur(5px);
}

.category:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

.category h2 {
    font-size: 2rem;
    color: var(--category-text);
    margin-bottom: 25px;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.25);
    position: relative;
    display: inline-block;
    z-index: 1;
}

.category h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60%;
    height: 3px;
    background: var(--category-text);
    opacity: 0.7;
    border-radius: 2px;
}

.links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.link-item {
    background: var(--link-bg);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--link-text);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease-in-out;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.link-item:nth-child(1):hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: var(--link-hover-text);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--link-hover-text);
}

.link-item:nth-child(2):hover {
    transform: translateX(-8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: var(--link-hover-text);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--link-hover-text);
}

.link-item:nth-child(3):hover {
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: var(--link-hover-text);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--link-hover-text);
}

.link-item:nth-child(4):hover {
    transform: rotate(-2deg) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: var(--link-hover-text);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--link-hover-text);
}

.link-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: all 0.5s ease;
    pointer-events: none;
}

.link-item:hover::before {
    left: 100%;
}

.link-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.link-item:active::after {
    width: 200%;
    height: 200%;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 按钮样式（仅在桌面端显示） */
.theme-toggle {
    position: fixed;
    bottom: 40px;
    right: 40px;
    background: var(--button-bg);
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
    font-size: 1.2rem;
    color: white;
    overflow: hidden;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--button-hover-bg);
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.theme-toggle:active::after {
    width: 200%;
    height: 200%;
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 35px;
    background: var(--footer-bg);
    margin-top: 50px;
    border-radius: 25px;
    color: var(--footer-text);
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--header-bg);
    opacity: 0.7;
}

.footer p {
    margin: 8px 0;
    font-size: 0.95rem;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* 手机端底部按钮容器 */
.footer-buttons {
    display: none;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* 手机端底部主题切换按钮 */
.footer-theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--footer-text);
    transition: all 0.3s ease;
    box-shadow: none;
}

.footer-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--link-hover-text);
    transform: scale(1.05);
}

/* 手机端返回顶部按钮 */
.footer-top-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--footer-text);
    transition: all 0.3s ease;
    box-shadow: none;
}

.footer-top-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--link-hover-text);
    transform: scale(1.05);
}

/* 手机端适配 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 15px 0;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header .subtitle {
        font-size: 1rem;
    }

    .announcement {
        font-size: 0.85rem;
        padding: 6px 15px;
        max-width: 85%;
    }

    .links {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .category {
        padding: 20px;
        margin-bottom: 20px;
    }

    .category h2 {
        font-size: 1.5rem;
    }

    .link-item {
        padding: 12px;
        font-size: 0.95rem;
    }

    .theme-toggle {
        display: none;
    }

    .footer-buttons {
        display: flex;
    }

    .footer {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .header .subtitle {
        font-size: 0.85rem;
    }

    .announcement {
        font-size: 0.75rem;
        padding: 5px 12px;
        max-width: 90%;
    }

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

    .link-item {
        padding: 10px;
        font-size: 0.9rem;
    }

    .category {
        padding: 15px;
    }

    .category h2 {
        font-size: 1.3rem;
    }
}