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

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: nowrap;
}

.logo {
    flex-shrink: 0;
    min-width: 0;
    margin-right: 2rem;
}

.logo h2 {
    color: #007bff;
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin: 0;
}

.logo i {
    margin-right: 0.5rem;
    color: #007bff;
}

.main-nav {
    flex: 1;
    min-width: 0;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.main-nav li {
    white-space: nowrap;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #007bff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav a:hover,
.main-nav a.active {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-1px);
}

.main-nav a:hover::before,
.main-nav a.active::before {
    width: 80%;
}

/* 特殊样式用于登录/注册链接 */
.main-nav a[href*="login"],
.main-nav a[href*="member"] {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white !important;
    border: none;
    font-weight: 600;
}

.main-nav a[href*="login"]:hover,
.main-nav a[href*="member"]:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 主横幅区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #007bff;
    transform: translateY(-2px);
}

/* 通用区域样式 */
section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.section-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* 服务区域 */
.services {
    background: white;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.service-item {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.service-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon i {
    font-size: 2rem;
    color: white;
}

.service-item h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.service-item p {
    color: #666;
    line-height: 1.7;
}

/* 技术开发区域 */
.development {
    background: #f8f9fa;
}

.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tech-category {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.tech-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #007bff;
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-item {
    background: #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #495057;
    transition: all 0.3s;
}

.tech-item:hover {
    background: #007bff;
    color: white;
    transform: scale(1.05);
}

/* 技术咨询区域 */
.consulting {
    background: white;
}

.consulting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.consulting-item {
    position: relative;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #007bff;
    transition: all 0.3s;
}

.consulting-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.consulting-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    font-weight: bold;
    color: rgba(0, 123, 255, 0.1);
}

.consulting-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.consulting-item p {
    color: #666;
    line-height: 1.7;
}

/* 技术交流区域 */
.community {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.community-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    font-size: 3rem;
    color: #007bff;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-item p {
    color: #666;
}

/* 关于我们区域 */
.about {
    background: white;
}

.about-content {
    display: flex;
    align-items: flex-start;
    gap: 4rem;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.about-text p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.8;
}


.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 1rem;
}

/* 联系我们区域 */
.contact {
    background: #f8f9fa;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.contact-item i {
    font-size: 1.5rem;
    color: #007bff;
    width: 30px;
}

.contact-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-item p {
    color: #666;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-group textarea {
    resize: vertical;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1.5rem;
    color: #007bff;
}

.footer-section p {
    margin-bottom: 1rem;
    color: #bdc3c7;
    line-height: 1.7;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #007bff;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.social-links a:hover {
    background: #007bff;
    transform: scale(1.1);
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 2rem;
    text-align: center;
    color: #bdc3c7;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-nav ul {
        gap: 0.8rem;
    }

    .main-nav a {
        font-size: 0.85rem;
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 1024px) {
    .nav-wrapper {
        padding: 0.8rem 0;
    }

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

    .main-nav ul {
        gap: 0.6rem;
    }

    .main-nav a {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
}

@media (max-width: 768px) {
    /* 导航优化 */
    .nav-wrapper {
        padding: 0.6rem 0;
    }

    .logo {
        margin-right: 1rem;
        flex: 1;
    }

    .logo h2 {
        font-size: 1.1rem;
        max-width: 180px;
        line-height: 1.1;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid rgba(0, 123, 255, 0.1);
        max-height: 80vh;
        overflow-y: auto;
    }

    .main-nav.active {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }

    .main-nav li {
        width: 100%;
    }

    .main-nav a {
        display: block;
        padding: 1rem 1.5rem;
        border-radius: 0;
        font-size: 1rem;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        transition: all 0.2s ease;
    }

    .main-nav a:hover,
    .main-nav a.active {
        background: rgba(0, 123, 255, 0.1);
        transform: none;
    }

    .main-nav a::before {
        display: none;
    }

    .main-nav a[href*="login"],
    .main-nav a[href*="member"] {
        margin: 0.5rem 1rem;
        border-radius: 8px;
        text-align: center;
        font-weight: 600;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        color: #007bff;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 8px;
        transition: all 0.3s ease;
        z-index: 1001;
        width: 44px;
        height: 44px;
        touch-action: manipulation;
    }

    .mobile-menu-btn:hover {
        background: rgba(0, 123, 255, 0.1);
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
        background: rgba(0, 123, 255, 0.2);
    }

    /* 主横幅优化 */
    .hero {
        padding: 6rem 0 4rem;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: 1rem;
        touch-action: manipulation;
    }

    /* 区域优化 */
    section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
        padding: 0 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .section-header p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* 网格布局优化 */
    .services-grid,
    .tech-stack,
    .consulting-grid,
    .community-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .service-item,
    .tech-category,
    .consulting-item,
    .feature-item {
        padding: 2rem 1.5rem;
        margin: 0;
        transition: all 0.2s ease;
    }

    .service-item:active,
    .feature-item:active,
    .consulting-item:active {
        transform: scale(0.98);
    }

    .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .service-icon i {
        font-size: 1.5rem;
    }

    .service-item h3,
    .feature-item h3,
    .consulting-item h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    /* 关于我们区域优化 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .about-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* 联系表单优化 */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .contact-form {
        padding: 2rem 1.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 8px;
    }

    .contact-item {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }

    .contact-item i {
        font-size: 1.2rem;
        width: 24px;
    }

    /* 页脚优化 */
    .footer {
        padding: 3rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 0 1rem;
    }

    .footer-section {
        margin-bottom: 2rem;
    }

    .social-links {
        justify-content: center;
        gap: 1rem;
    }

    .social-links a {
        width: 44px;
        height: 44px;
        touch-action: manipulation;
    }

    /* 返回顶部按钮优化 */
    .back-to-top {
        bottom: 20px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 1rem !important;
        touch-action: manipulation;
    }

    /* 通知框优化 */
    .success-toast,
    .error-toast,
    .notification {
        left: 20px !important;
        right: 20px !important;
        max-width: none !important;
        margin: 0 auto;
    }

    /* 容器内边距优化 */
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-wrapper {
        padding: 0.5rem 0;
    }

    .logo h2 {
        font-size: 0.9rem;
        max-width: 150px;
    }

    .logo i {
        font-size: 0.8rem;
        margin-right: 0.3rem;
    }

    .mobile-menu-btn {
        font-size: 1.2rem;
        padding: 0.3rem;
    }

    .main-nav a {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    section {
        padding: 60px 0;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .service-item,
    .tech-category,
    .consulting-item,
    .feature-item,
    .contact-item {
        padding: 1.5rem;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }
}

/* 滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 加载动画 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 灯箱动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 新增的增强样式 */
/* 加载状态指示器 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 表单验证样式 */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: #28a745;
    background-color: #d4edda;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* 成功提示框 */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.success-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 错误提示框 */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.error-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 按钮加载状态 */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.6s linear infinite;
}

/* 移动端触摸反馈 */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.95);
    }

    .service-item:active,
    .feature-item:active,
    .consulting-item:active {
        transform: scale(0.98);
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .service-item,
    .tech-category,
    .consulting-item,
    .feature-item {
        border-width: 2px;
        border-color: #333;
    }

    .btn {
        border-width: 2px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    .service-item,
    .tech-category,
    .consulting-item,
    .feature-item {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .contact-form {
        background: #2d2d2d;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* 打印样式优化 */
@media print {
    .header,
    .mobile-menu-btn,
    .back-to-top,
    .hero-buttons,
    .contact-form {
        display: none !important;
    }

    .hero {
        height: auto;
        min-height: 50vh;
    }

    section {
        padding: 40px 0;
        break-inside: avoid;
    }

    .service-item,
    .tech-category,
    .consulting-item,
    .feature-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}