:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --json-color: #f7df1e;
    --valid-color: #06d6a0;
    --error-color: #ef476f;
    --border-radius: 12px;
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f0f2f5;
    color: var(--dark-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.logo span {
    color: var(--success-color);
}

/* ===== 下拉菜单样式 ===== */
nav {
    flex: 1 1 auto;
    min-width: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin: 0;
    padding: 0;
}

nav li {
    position: relative;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-block;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 下拉菜单容器 - 网格布局，多列显示，右对齐父菜单 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

/* 悬停时显示下拉菜单 */
.dropdown:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉菜单项 */
.dropdown-menu li {
    width: 100%;
    margin: 0;
    padding: 0;
}

.dropdown-menu a {
    color: var(--dark-color);
    padding: 8px 10px;
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    border-radius: 4px;
    white-space: normal;
    word-break: break-word;
    background-color: transparent;
    transition: background-color 0.2s;
}

.dropdown-menu a:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

/* 下拉箭头图标 */
.dropdown > a i {
    margin-left: 5px;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.dropdown:hover > a i {
    transform: rotate(180deg);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* 主内容区 */
main {
    padding: 40px 0;
    flex: 1;
}

.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(58, 12, 163, 0.05));
    border-radius: var(--border-radius);
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(67, 97, 238, 0.03)"/></svg>');
    background-size: cover;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-section h2 {
    font-size: 2.8rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    color: var(--gray-color);
    max-width: 800px;
    margin: 0 auto 30px;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
    border: 2px solid transparent;
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    color: var(--secondary-color);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent-color);
}

/* 功能卡片区 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
    margin-bottom: 20px;
    flex-grow: 1;
}

.feature-link {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}

.feature-link:hover {
    background-color: var(--secondary-color);
}

/* 平台介绍区 */
.platform-intro {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 50px;
    box-shadow: var(--box-shadow);
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
}

.platform-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.intro-content {
    position: relative;
    z-index: 1;
}

.intro-content h2 {
    font-size: 2.2rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.intro-content p {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 25px;
    line-height: 1.8;
}

.intro-highlight {
    background-color: rgba(67, 97, 238, 0.1);
    padding: 30px;
    border-radius: var(--border-radius);
    margin: 30px 0;
    border-left: 4px solid var(--primary-color);
}

.intro-highlight p {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    text-align: center;
}

/* 统计数据 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, var(--accent-color), #f72585);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, var(--success-color), #06d6a0);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, var(--json-color), #f7b731);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 页脚 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--success-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--success-color);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #444;
    color: #aaa;
    font-size: 0.9rem;
}

/* 工具页面样式 */
.tool-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tool-detail {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-top: 30px;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

.tool-header h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
}

.close-tool {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.close-tool:hover {
    color: var(--warning-color);
}

/* 中等屏幕：垂直排列菜单（防止溢出） */
@media (min-width: 769px) and (max-width: 1000px) {
    nav ul {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .logo {
        justify-content: center;
    }
    
    nav ul {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        justify-content: center;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 25px;
        right: 20px;
    }
    
    .mobile-menu {
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    
    .mobile-menu.show {
        display: block;
    }
    
    /* 移动端下拉菜单平铺，重置网格为块级 */
    .dropdown-menu {
        position: static;
        width: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        padding: 0 0 0 20px;
        margin-top: 5px;
        display: none;
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .dropdown.open > .dropdown-menu {
        display: grid;
    }
    
    .dropdown-menu li {
        width: 100%;
    }
    
    .dropdown-menu a {
        color: white;
        padding: 8px 12px;
        background-color: rgba(255,255,255,0.1);
        border-radius: 6px;
        margin-bottom: 5px;
        white-space: nowrap;
    }
    
    .dropdown-menu a:hover {
        background-color: rgba(255,255,255,0.2);
    }
    
    .dropdown.open > a i {
        transform: rotate(180deg);
    }
    
    .hero-section h2 {
        font-size: 2.2rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .platform-intro {
        padding: 30px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    animation: fadeInUp 0.6s ease forwards;
}

.hidden {
    opacity: 0;
}