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

:root {
    --primary-color: #4a6bff;
    --primary-hover: #3451d1;
    --secondary-color: #6c2bd9;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f9fafc;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --gradient-primary: linear-gradient(135deg, #4a6bff, #6c2bd9);
    --gradient-secondary: linear-gradient(135deg, #ff7170, #ffe57f);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 107, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 107, 255, 0.35);
    color: white;
}

.btn-secondary {
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(74, 107, 255, 0.2);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.6em;
    line-height: 1.3;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

h3 {
    font-size: 1.5rem;
}

section {
    padding: 80px 0;
}

/* 顶部导航栏 */
header {
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition), transform 0.3s ease;
}

header.scroll {
    box-shadow: var(--shadow-md);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
    font-size: 2rem;
    font-weight: 700;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

nav ul li {
    margin-left: 20px;
    position: relative;
}

nav ul li a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 8px 4px;
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--primary-color);
}

nav ul li a.active {
    color: var(--primary-color);
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

nav ul li a.active::after {
    width: 100%;
}

/* 汉堡菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span {
    background: #ff3b30;
}

/* 英雄区域 */
.hero {
    background: var(--gradient-primary);
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="600" height="600" viewBox="0 0 800 800"><g fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="2"><path d="M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63"/><path d="M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764"/><path d="M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880"/><path d="M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382"/><path d="M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-31 229"/></g></svg>');
    opacity: 0.15;
}

.hero h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero h2::after {
    display: none;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* 技术领域部分 */
.tech-areas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tech-area {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.tech-area:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.tech-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
    background: var(--gradient-secondary);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tech-area h3 {
    margin-bottom: 15px;
    color: var(--text-color);
}

.tech-area p {
    color: var(--text-light);
    font-size: 1rem;
}

/* 项目展示区 */
.featured-projects {
    padding: 80px 0;
    background-color: rgba(74, 107, 255, 0.03);
    position: relative;
}

.featured-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 255, 0.2), transparent);
}

.featured-projects::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 255, 0.2), transparent);
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.project-image {
    position: relative;
    overflow: hidden;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.5));
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.project-card:hover .project-image::before {
    opacity: 1;
}

.project-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.project-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 12px;
    transition: var(--transition);
    font-weight: 600;
}

.project-card:hover .project-info h3 {
    color: var(--primary-color);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.project-info a {
    align-self: flex-start;
    padding: 8px 16px;
    background-color: rgba(74, 107, 255, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.project-info a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 视频专区 */
.latest-videos {
    background-color: var(--bg-color);
    padding: 80px 0;
    position: relative;
}

.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.video-thumbnail {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.7));
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.video-card:hover .video-thumbnail::before {
    opacity: 1;
}

.play-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.video-thumbnail:hover .play-button {
    background-color: #ff0000;
    transform: scale(1.05);
}

.video-info {
    padding: 20px;
}

.video-info h3 {
    margin-bottom: 10px;
    transition: var(--transition);
    font-size: 1.1rem;
    line-height: 1.4;
}

.video-card:hover .video-info h3 {
    color: var(--primary-color);
}

.video-info p {
    margin-bottom: 15px;
    color: var(--text-light);
    font-size: 0.95rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 视频标签样式 */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.video-tag {
    background-color: rgba(74, 107, 255, 0.1);
    color: var(--primary-color);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.video-tag:hover {
    background-color: rgba(74, 107, 255, 0.2);
}

/* 视频时长标签 */
.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    z-index: 2;
}

/* 博客区域 */
.tech-blog {
    padding: 80px 0;
}

.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.blog-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(74, 107, 255, 0.1);
    border-radius: 20px;
}

.blog-card h3 {
    margin-bottom: 12px;
    transition: var(--transition);
    font-weight: 600;
}

.blog-card:hover h3 {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.6;
}

/* AI服务预览 */
.ai-service-preview {
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.05), rgba(108, 43, 217, 0.08));
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ai-service-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 255, 0.2), transparent);
}

.ai-service-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 255, 0.2), transparent);
}

.ai-service-preview p {
    max-width: 700px;
    margin: 0 auto 40px;
    color: var(--text-color);
    font-size: 1.15rem;
    line-height: 1.7;
    opacity: 0.9;
}

.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 35px 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.service-icon {
    font-size: 2.8rem;
    margin-bottom: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.service-card h3 {
    margin-bottom: 15px;
    transition: var(--transition);
    font-weight: 600;
}

.service-card:hover h3 {
    color: var(--primary-color);
}

.service-card p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #2d3748, #1a202c);
    color: white;
    padding: 80px 0 30px;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 50px;
    margin-bottom: 60px;
}

.footer-logo h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #fff, #ddd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin-bottom: 20px;
}

.footer-links h3, .footer-contact h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

.footer-links h3::after, .footer-contact h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 2px;
    background: var(--gradient-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 15px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.footer-links ul li a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-contact p {
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 18px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: white;
    background: var(--gradient-primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    section {
        padding: 60px 0;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    header .container {
        flex-direction: row;
        justify-content: space-between;
        padding: 16px 24px;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: var(--shadow-lg);
        padding: 80px 30px;
        z-index: 999;
        transition: right 0.3s ease;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        gap: 20px;
    }
    
    nav ul li {
        margin: 0;
    }
    
    nav ul li a {
        display: block;
        padding: 10px 0;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .tech-areas, .project-cards, .video-gallery {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .footer-content {
        gap: 40px;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .tech-areas, .project-cards, .video-gallery, .blog-posts, .service-cards {
        grid-template-columns: 1fr;
    }
    
    .tech-area, .project-card, .video-card, .blog-card, .service-card {
        margin: 0 auto;
        max-width: 350px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links h3::after, .footer-contact h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-links ul li a {
        justify-content: center;
    }
    
    .footer-links ul li a:hover {
        transform: none;
    }
    
    .social-links {
        justify-content: center;
    }
    
    section {
        padding: 50px 0;
    }
}

/* 表单样式优化 */
.newsletter-form {
    position: relative;
    display: flex;
    max-width: 500px;
    margin: 30px auto 0;
}

.newsletter-form input {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.15);
}

.newsletter-form button {
    margin-left: 10px;
    white-space: nowrap;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.2s ease;
    pointer-events: none;
}

.form-group.focused label {
    top: 0;
    left: 12px;
    font-size: 0.8rem;
    background: white;
    padding: 0 5px;
    color: var(--primary-color);
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group .error {
    border-color: #ff3b30;
}

.form-group .error:focus {
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.15);
}

/* 联系表单 */
.contact-form {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin-top: 30px;
}

/* 粒子背景效果 */
.particles-bg {
    position: relative;
    overflow: hidden;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 80 80"><circle cx="10" cy="10" r="2" fill="rgba(74, 107, 255, 0.1)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

/* 订阅区域 */
.newsletter {
    padding: 80px 0;
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.05), rgba(108, 43, 217, 0.08));
    position: relative;
    text-align: center;
    overflow: hidden;
}

.newsletter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 255, 0.2), transparent);
}

.newsletter p {
    max-width: 600px;
    margin: 0 auto 30px;
    color: var(--text-color);
    font-size: 1.1rem;
}

.newsletter-form {
    position: relative;
    display: flex;
    max-width: 500px;
    margin: 30px auto 15px;
}

.form-field {
    position: relative;
    flex: 1;
}

.newsletter-form input {
    width: 100%;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.newsletter-form label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--text-light);
    transition: all 0.2s ease;
    pointer-events: none;
}

.newsletter-form input:focus + label,
.newsletter-form input:not(:placeholder-shown) + label,
.newsletter-form label.float {
    top: -10px;
    left: 12px;
    font-size: 0.8rem;
    background: white;
    padding: 0 5px;
    color: var(--primary-color);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.15);
}

.newsletter-form input::-webkit-input-placeholder {
    color: transparent;
}

.newsletter-form button {
    margin-left: 10px;
    white-space: nowrap;
    padding: 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.privacy-note {
    font-size: 0.85rem !important;
    opacity: 0.7;
    margin-top: 10px !important;
}

/* 推荐工具区域 */
.featured-tools {
    background-color: #f5f7ff;
    padding: 80px 0;
    position: relative;
}

.featured-tools::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234a6bff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.8;
    z-index: 1;
}

.featured-tools .container {
    position: relative;
    z-index: 2;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.tool-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.tool-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    transition: var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.05);
}

.tool-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    transition: var(--transition);
}

.tool-card:hover .tool-info h3 {
    color: var(--primary-color);
}

.tool-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    flex: 1;
}

.tool-info .btn {
    align-self: flex-start;
}

/* 视图切换按钮样式 */
.search-and-view {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.view-toggle {
    display: flex;
    gap: 10px;
}

.view-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.view-btn:hover:not(.active) {
    background-color: #e0e0e0;
}

/* 列表视图样式 */
.video-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-grid.list-view .video-item {
    display: flex;
    flex-direction: row;
    height: auto;
}

.video-grid.list-view .video-thumbnail {
    width: 250px;
    min-width: 250px;
    height: 150px;
    border-radius: 8px 0 0 8px;
}

.video-grid.list-view .video-info {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.video-grid.list-view .video-description {
    margin-top: auto;
    margin-bottom: 15px;
}

.video-grid.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* 黑暗模式样式 */
.dark-theme {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-light: #aaa;
    --border-color: #333;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.dark-theme body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.dark-theme .video-item,
.dark-theme .tool-card {
    background-color: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.dark-theme .video-meta,
.dark-theme .video-description {
    color: var(--text-light);
}

.dark-theme .filter-btn {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

/* 视频博客区域样式 */
.tech-blog {
    padding: 80px 0;
}

.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.blog-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(74, 107, 255, 0.1);
    border-radius: 20px;
}

.blog-card h3 {
    margin-bottom: 12px;
    transition: var(--transition);
    font-weight: 600;
}

.blog-card:hover h3 {
    color: var(--primary-color);
}

.blog-card p {
    color: var(--text-light);
    margin-bottom: 18px;
    line-height: 1.6;
}

/* 视频模态框共享样式 */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    padding: 2% 5%;
    box-sizing: border-box;
    overflow-y: auto;
}

.video-modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background-color: black;
    border-radius: 8px;
    overflow: hidden;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 宽高比 */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.close-modal:hover {
    background-color: rgba(255, 0, 0, 0.7);
}

.video-modal-title {
    color: white;
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 1.5em;
    padding: 0 40px;
}

.video-controls {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    padding: 10px;
}

.video-controls button {
    margin: 0 5px;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.video-controls button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.related-videos {
    margin-top: 20px;
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
}

.related-video {
    flex: 0 0 240px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.related-video img {
    width: 100%;
    height: 135px;
    object-fit: cover;
}

.related-video-title {
    color: white;
    font-size: 0.9em;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.7);
}

/* 通用视频指示器样式 */
.video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.play-icon, .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 2;
}

.play-icon:hover, .play-button:hover {
    background-color: rgba(255, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* 视频预览容器 */
.video-preview-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.video-preview {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 3;
}

/* 响应式视频模态框调整 */
@media (max-width: 768px) {
    .video-modal {
        padding: 1% 2%;
    }
    
    .video-modal-title {
        font-size: 1.2em;
        padding: 0 20px;
    }
    
    .video-controls button {
        padding: 6px 10px;
        font-size: 0.9em;
    }
    
    .related-videos {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .related-video {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 576px) {
    .related-video {
        flex: 0 0 calc(100% - 15px);
    }
}