/* ===== 小桔ESOP小工单 - 完整响应式优化版 ===== */
/* 统一PC端和移动端适配，解决CSS冲突 */

/* ===== 1. CSS变量统一 ===== */
:root {
    --primary: #ff8c42;
    --primary-dark: #e67e3a;
    --primary-light: #fff3e6;
    --secondary: #1e293b;
    --text: #334155;
    --text-light: #64748b;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
}

/* ===== 2. 移动端菜单按钮 ===== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: fixed;
    top: 14px;
    right: 24px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--secondary);
    margin: 5px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== 3. 移动端全屏菜单 ===== */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    padding: 100px 24px 40px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu a {
    display: block;
    padding: 16px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: color 0.3s;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: var(--primary);
}

.mobile-menu-cta {
    margin-top: 30px;
    background: linear-gradient(135deg, #ff8c42 0%, #ff6b35 100%);
    color: white;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    padding: 16px;
    text-decoration: none;
    display: block;
}

.mobile-menu-contacts {
    margin-top: 30px;
    text-align: center;
}

.mobile-menu-contacts p {
    padding: 10px 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.mobile-menu-contacts a {
    display: block;
    color: var(--primary);
    font-weight: 600;
    border: none;
    padding: 5px 0;
    font-size: 1.1rem;
}

/* ===== 4. 响应式断点 ===== */

/* 4.1 平板端 - 1024px及以下 */
@media (max-width: 1024px) {
    /* 导航栏调整 */
    .navbar {
        padding: 10px 0;
    }
    
    /* Hero区域 */
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 30px;
    }
    
    .hero-visual {
        max-width: 600px;
        margin: 0 auto;
    }
    
    /* 产品网格 */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .product-tab {
        flex: 1 1 45%;
    }
    
    /* 案例网格 */
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 产品详情 */
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* 页脚 */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 隐藏部分装饰 */
    .desktop-only {
        display: none;
    }
}

/* 4.2 手机端 - 768px及以下 */
@media (max-width: 768px) {
    /* 显示移动菜单 */
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-menu {
        display: block;
    }
    
    /* 隐藏PC导航 */
    .nav-menu {
        display: none !important;
    }
    
    /* 导航栏 */
    .navbar {
        padding: 12px 0;
    }
    
    .navbar .container {
        padding: 0 20px;
    }
    
    /* Logo调整 */
    .logo-img {
        width: 36px;
        height: 36px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    /* Hero区域 */
    .hero {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero .container {
        gap: 30px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .hero-title br {
        display: none;
    }
    
    .hero-title .highlight {
        color: var(--primary);
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 10px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 320px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
        padding: 0 20px;
    }
    
    .stat-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 15px;
        background: rgba(255,255,255,0.1);
        border-radius: 10px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
        text-align: left;
    }
    
    .hero-visual {
        margin: 20px 16px 0;
        padding: 16px;
    }
    
    /* Dashboard */
    .kpi-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Section通用 */
    .section {
        padding: 60px 0;
    }
    
    .section-header {
        padding: 0 16px;
    }
    
    .section-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* 产品区域 */
    .products-section {
        padding: 60px 0;
    }
    
    .products-tabs {
        flex-direction: column;
        gap: 8px;
        padding: 0 16px;
    }
    
    .product-tab {
        flex: 1 1 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .product-card {
        padding: 24px 20px;
    }
    
    .product-icon {
        font-size: 2.5rem;
    }
    
    .product-card h3 {
        font-size: 1.2rem;
    }
    
    .feature-list {
        font-size: 0.9rem;
    }
    
    /* 产品详情 */
    .page-header {
        padding: 100px 0 60px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .page-header p {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .product-detail {
        padding: 30px 16px;
    }
    
    .product-text h3 {
        font-size: 1.3rem;
    }
    
    .product-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .product-features {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .feature-card {
        padding: 20px;
    }
    
    /* 案例页面 */
    .hero-stats {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        padding: 100px 0 60px;
    }
    
    .hero-badge {
        font-size: 0.8rem;
        padding: 6px 14px;
        margin-bottom: 16px;
    }
    
    .cases-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 0 16px;
    }
    
    .case-card {
        padding: 24px 20px;
    }
    
    .case-card h3 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .case-industry {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    .case-result {
        font-size: 1.3rem;
    }
    
    .case-card > p {
        font-size: 0.9rem;
    }
    
    .case-metrics {
        flex-direction: column;
        gap: 12px;
    }
    
    .metric-value {
        font-size: 1.3rem;
    }
    
    /* 统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px 16px;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* 解决方案 */
    .solutions-tabs {
        flex-direction: column;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        flex: 1 1 100%;
        padding: 15px;
        text-align: left;
    }
    
    .solution-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .solution-visual {
        height: 250px;
    }
    
    /* 关于我们 */
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-visual {
        height: 250px;
    }
    
    .advantages {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* 联系方式 */
    .contact {
        padding: 60px 0;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-info h2 {
        font-size: 1.8rem;
    }
    
    .contact-methods {
        align-items: center;
    }
    
    /* 页脚 */
    .footer {
        padding: 50px 0 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 30px;
        padding: 0 20px;
    }
    
    .footer-brand p {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .footer-column h4 {
        font-size: 0.95rem;
        margin-bottom: 16px;
    }
    
    .footer-column a {
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        padding: 20px 16px 0;
        text-align: center;
    }
    
    .footer-bottom p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* 表格响应式 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* 图片优化 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 容器优化 */
    .container {
        padding: 0 16px;
    }
}

/* 4.3 小屏手机 - 480px及以下 */
@media (max-width: 480px) {
    /* Hero */
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* Section */
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    /* 产品 */
    .product-tab {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .product-card {
        padding: 20px 16px;
    }
    
    /* 产品详情 */
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .product-metrics {
        grid-template-columns: 1fr !important;
    }
    
    /* 案例 */
    .case-card {
        padding: 20px 16px;
    }
    
    .case-card h3 {
        font-size: 1rem;
    }
    
    .case-result {
        font-size: 1.2rem;
    }
    
    /* 按钮 */
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 14px 24px;
    }
}

/* ===== 5. PC端优化 (1440px及以上) ===== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cases-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== 6. 超大屏优化 (1920px及以上) ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 2.8rem;
    }
}

/* ===== 7. 横屏手机优化 ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 60px 0 40px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .mobile-menu {
        padding: 60px 24px 20px;
    }
    
    .mobile-menu a {
        padding: 10px 0;
        font-size: 1rem;
    }
}

/* ===== 8. 打印优化 ===== */
@media print {
    .navbar,
    .mobile-menu-btn,
    .mobile-menu,
    .btn,
    .hero-buttons {
        display: none;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    body {
        font-size: 12pt;
    }
}

/* ===== 9. 辅助功能 ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 10. 暗黑模式支持 ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #ff9f6a;
        --secondary: #f1f5f9;
        --text: #f1f5f9;
        --text-light: #cbd5e1;
        --bg: #0f172a;
        --white: #1e293b;
        --border: #334155;
    }
    
    .navbar {
        background: rgba(30, 41, 59, 0.98);
    }
    
    .mobile-menu {
        background: rgba(30, 41, 59, 0.98);
    }
    
    .mobile-menu a {
        color: #f1f5f9;
    }
    
    .card,
    .product-card,
    .case-card {
        background: #1e293b;
        border-color: #334155;
    }
}
