/* 基础布局 */
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f6fa;
    color: #222;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: always;
    text-rendering: optimizeLegibility;
}

header {
    background: #2d3e50;
    padding: 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 实时信息展示样式 */
.real-time-info {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 1rem;
    color: white;
    font-size: 14px;
}

.time-display {
    font-weight: 500;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    margin: 0 2rem;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.3s;
}

/* 导航悬停动画 */
.nav-item::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: #00b894;
    transition: width 0.3s;
    position: absolute;
    left: 0;
    bottom: -5px;
}
.nav-item:hover {
    color: #00b894;
}
.nav-item:hover::after {
    width: 100%;
}

/* 动画定义 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 底部 */
footer {
    text-align: center;
    padding: 2rem 0;
    background: #2d3e50;
    color: #fff;
    font-size: 0.95rem;
}

/* 板块通用样式 */
section {
    margin: 3rem auto;
    max-width: 1000px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2.5rem 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

/* 动画激活类 */
.section-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 淡出动画 */
.section-hidden {
    opacity: 0 !important;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 从上方进入的元素（在视口中心上方的元素） */
.section-hidden.top {
    transform: translateY(-40px) !important;
}

/* 板块悬停效果 */
section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

/* 板块标题样式 */
section h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: #00b894;
    border-radius: 2px;
    transition: width 0.3s ease;
}

section:hover h2::after {
    width: 100px;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 主体布局 */
.main-content {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.right {
    width: 100%;
}

/* AI 相关样式 */
.ai-image {
    margin-bottom: 2rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.ai-image img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.ai-image:hover img {
    transform: scale(1.05);
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    background: #e3f2fd;
}

.tool-card h3 {
    color: #1976d2;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #666;
    margin: 0;
}

/* 响应式布局 */
@media (max-width: 900px) {
    .main-flex {
        flex-direction: column;
    }
    .right {
        order: 0;
        width: 100%;
    }
    .left {
        order: 1;
        margin: 0 auto;
    }
    
    section {
        padding: 2rem 1rem;
    }

    /* 导航栏移动端适配 */
    .navbar {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }

    .nav-item {
        margin: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
    }

    /* 图片移动端适配 */
    .ai-image {
        width: 100%;
        max-width: 400px;
    }

    section img {
        width: 100% !important;
        height: auto !important;
        max-width: 400px;
    }
    
    .tool-cards {
        grid-template-columns: 1fr;
    }
}

/* 禁止文本选择 */
.unselectable
{
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 设置下拉菜单样式 */
.settings-dropdown {
    position: relative;
    display: inline-block;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.settings-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.settings-dropdown-content a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.3s;
}

.settings-dropdown-content a:hover {
    background: #f5f6fa;
}

.settings-theme {
    padding: 10px 16px;
}

.settings-theme a {
    padding: 4px 8px;
    margin: 0 4px 4px 0;
    border-radius: 4px;
    display: inline-block;
}

/* 深色模式样式 */
.dark-mode {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

.dark-mode header {
    background-color: #2d3e50;
}

.dark-mode footer {
    background-color: #2d3e50;
    color: #f5f5f5;
}

.dark-mode section {
    background-color: #2c2c2c;
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content {
    background-color: #2c2c2c;
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content a {
    color: #f5f5f5;
}

.dark-mode .settings-dropdown-content a:hover {
    background-color: #444;
}

/* 浅色主题样式 */
.light-mode {
    background-color: #f5f6fa;
    color: #222;
}

.light-mode header {
    background-color: #2d3e50;
}

.light-mode footer {
    background-color: #2d3e50;
    color: #fff;
}

.light-mode section {
    background-color: #fff;
    color: #222;
}

.light-mode .settings-dropdown-content {
    background-color: #fff;
    color: #333;
}

.light-mode .settings-dropdown-content a {
    color: #333;
}

.light-mode .settings-dropdown-content a:hover {
    background-color: #f5f6fa;
}

/* 蓝色主题样式 */
.blue-mode {
    background-color: #e3f2fd;
    color: #1a237e;
}

.blue-mode header {
    background-color: #1976d2;
}

.blue-mode footer {
    background-color: #1976d2;
    color: #fff;
}

.blue-mode section {
    background-color: #fff;
    color: #1a237e;
}

.blue-mode section h2 {
    color: #1976d2;
}

.blue-mode .settings-dropdown-content {
    background-color: #fff;
    color: #1a237e;
}

.blue-mode .settings-dropdown-content a {
    color: #1a237e;
}

.blue-mode .settings-dropdown-content a:hover {
    background-color: #e3f2fd;
}

/* 绿色主题样式 */
.green-mode {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.green-mode header {
    background-color: #388e3c;
}

.green-mode footer {
    background-color: #388e3c;
    color: #fff;
}

.green-mode section {
    background-color: #fff;
    color: #2e7d32;
}

.green-mode section h2 {
    color: #388e3c;
}

.green-mode .settings-dropdown-content {
    background-color: #fff;
    color: #2e7d32;
}

.green-mode .settings-dropdown-content a {
    color: #2e7d32;
}

.green-mode .settings-dropdown-content a:hover {
    background-color: #e8f5e8;
}

/* 响应式调整 */
@media (max-width: 900px), (orientation: portrait) {
    /* 实时信息显示在移动端的适配 */
    .real-time-info {
        order: 2;
        margin: 0.5rem auto;
        width: calc(100% - 1rem);
        justify-content: center;
        font-size: 12px;
        gap: 1rem;
    }

    .time-display {
        font-size: 12px;
    }

    /* 导航项在移动端和竖屏设备的适配 */
    .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-item {
        margin: 0;
        padding: 0.8rem 1rem;
        text-align: center;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 6px;
        flex: 1 1 auto;
        min-width: 100px;
        max-width: calc(50% - 0.75rem);
    }

    /* 设置按钮在移动端和竖屏设备的适配 */
    .settings-dropdown {
        order: 1;
        margin: 0.5rem auto 0;
        width: calc(100% - 1rem);
        text-align: center;
    }
}

@media (max-width: 480px), (orientation: portrait) and (max-height: 600px) {
    /* 导航栏适配 */
    .navbar {
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
    }

    .nav-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        max-width: calc(50% - 0.375rem);
        min-width: 80px;
    }

    /* 优化小高度竖屏设备上的设置按钮 */
    .settings-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}