/* styles.css - 全局样式 */
:root {
    --primary: #1a56db;     /* 科技蓝 */
    --secondary: #00c897;   /* 生态绿 */
    --accent: #ff6b35;      /* 活力橙 */
    --dark: #0f172a;        /* 深空背景 */
    --light: #f8fafc;       /* 浅色背景 */
    --gray: #64748b;        /* 文本灰色 */
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
    --card-radius: 15px;
    --section-padding: 100px 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: #334155;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: var(--section-padding);
    position: relative;
}

h1, h2, h3, h4 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    position: relative;
    text-align: center;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
    color: var(--gray);
    line-height: 1.8;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    text-align: center;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    color: white;
    box-shadow: 0 6px 18px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(26, 86, 219, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 15px rgba(26, 86, 219, 0.3);
}

.text-center {
    text-align: center;
}

.section-title {
    margin-bottom: 60px;
}

/* 导航栏 */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 55px;
    margin-right: 15px;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.logo-text span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s;
    position: relative;
    padding: 8px 0;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: width 0.3s;
    border-radius: 2px;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a:hover:after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
    z-index: 1001;
}

/* 首页Banner */
.hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 200px 0 120px;
    margin-top: 80px;
    overflow: hidden;
    position: relative;
}

.hero .container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero h1 {
    color: white;
    font-size: 3.8rem;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero p.subtitle {
    font-size: 1.3rem;
    color: #cbd5e1;
    margin-bottom: 40px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.hero-visual {
    flex: 1;
    position: relative;
    height: 450px;
}

.iot-animation {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.iot-node {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: float 6s infinite ease-in-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
    z-index: 1;
}

.iot-node i {
    font-size: 30px;
}

.chip-node {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.module-node {
    background: linear-gradient(135deg, var(--secondary), #34d399);
    top: 60%;
    left: 30%;
    animation-delay: 1s;
    width: 70px;
    height: 70px;
}

.gateway-node {
    background: linear-gradient(135deg, #f97316, var(--accent));
    top: 40%;
    left: 60%;
    animation-delay: 2s;
}

.cloud-node {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    top: 20%;
    left: 70%;
    animation-delay: 3s;
    width: 90px;
    height: 90px;
}

/* 内容卡片通用样式 */
.card {
    background: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
}

.card-img {
    height: 220px;
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card-img:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.1), rgba(0, 200, 151, 0.1));
}

.card-img i {
    font-size: 70px;
    color: var(--primary);
    z-index: 1;
    transition: transform 0.5s ease;
}

.card:hover .card-img i {
    transform: scale(1.1);
}

.card-content {
    padding: 30px;
}

.card-content h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.features-list {
    list-style: none;
    margin-bottom: 25px;
}

.features-list li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.features-list li:before {
    content: "✓";
    color: var(--secondary);
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2rem;
}

.card-link {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    margin-top: 10px;
    transition: color 0.3s;
    font-size: 1.05rem;
    position: relative;
    padding-bottom: 3px;
}

.card-link:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.card-link:hover {
    color: var(--secondary);
}

.card-link:hover:after {
    width: 100%;
}

/* 网格布局 */
.grid {
    display: grid;
    gap: 35px;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* 产品展示 */
.products {
    background-color: var(--light);
    position: relative;
}

.products:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://raw.githubusercontent.com/dywlkj/dywlkj.github.io/main/IMG/pattern.png') repeat;
    opacity: 0.05;
    z-index: 0;
}

.products .container {
    position: relative;
    z-index: 1;
}

.product-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 28px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 6px 15px rgba(26, 86, 219, 0.2);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 35px;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(26, 86, 219, 0.3);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--secondary);
    transform: translateY(-5px);
}

/* 页脚 */
footer {
    background: var(--dark);
    color: white;
    padding: 70px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.footer-logo .logo-icon {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.footer-logo .logo-text {
    color: white;
    font-size: 22px;
}

.footer-about p {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.3s;
}

.social-link:hover {
    background: var(--primary);
}

.footer-links h4, .footer-contact h4 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4:after, .footer-contact h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a i {
    margin-right: 10px;
}

.footer-contact p {
    color: #cbd5e1;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-contact p i {
    margin-right: 10px;
    width: 20px;
    color: var(--primary);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* 主题切换 */
.theme-toggle {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
}

/* 动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero .container {
        flex-direction: column;
    }

    .hero-content {
        text-align: center;
        margin-bottom: 60px;
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        flex-direction: column;
        background: white;
        width: 80%;
        height: calc(100vh - 80px);
        padding: 30px;
        transition: right 0.3s;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 0 0 25px 0;
    }

    .mobile-toggle {
        display: block;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .grid-cols-4, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .hero {
        padding: 180px 0 80px;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    section {
        padding: 80px 0;
    }
}