* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding-top: 64px;
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }
}

.header {
    background: var(--ihelp-gradient);
    color: white;
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;     /* flex 居中对齐 logo 与文字 */
    gap: 0.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    line-height: 1;          /* 文字单倍行高，避免文字行高把 flex 容器撑高导致错位 */
    height: 48px;            /* 锁定容器高度 = logo 高度 + 留白，文字垂直居中 */
}

/* ===== 联系方式三栏布局 ===== */
.footer-contact-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 1.5rem 0 0.5rem;
    flex-wrap: wrap;
}
.footer-contact-item {
    text-align: center;
    color: rgba(255,255,255,0.85);
}
.footer-contact-icon {
    font-size: 28px;
    margin-bottom: 4px;
    transition: transform 0.2s;
}
.footer-contact-icon:hover { transform: scale(1.1); }
.footer-contact-qr {
    width: 88px;
    height: 88px;
    margin: 0 auto 4px;
    display: block;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    background: #fff;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.footer-contact-qr:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.footer-contact-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 2px;
}
.footer-contact-value {
    font-size: 14px;
    font-weight: 500;
}

/* picture 元素默认 inline，会被父 flex 拉伸到文字同高，导致 img 居中后偏上/偏下
   修复：固定 picture 高度与 img 一致 (40px)，并禁止被拉伸，文字以 picture 高度为锚居中 */
.logo-link picture,
.footer-logo picture {
    display: inline-block;   /* inline-block 不参与父 flex 拉伸，高度由内容决定 */
    line-height: 0;          /* 兜底：消除 picture 内可能存在的基线 */
    height: 40px;            /* 与 .logo-img 高度一致 */
    flex: 0 0 auto;          /* 不被父 flex 拉伸 */
    align-self: center;      /* 垂直居中（虽然不会被拉伸，显式声明以防万一） */
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;          /* 消除 img 元素默认的 inline 基线 */
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* 移动端汉堡按钮 — 桌面端默认隐藏 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    gap: 5px;
    margin-left: auto;
    -webkit-tap-highlight-color: transparent;
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.2s;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 抽屉背景遮罩 — 桌面端默认隐藏 */
.nav-mask {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0s 0.25s;
}
.nav-mask.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s, visibility 0s 0s;
}
body.nav-open { overflow: hidden; }

/* 顶部 auth 按钮 */
.nav-auth {
    padding: 0.4rem 1rem !important;
    border-radius: 20px;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}
.nav-login {
    background: rgba(255, 255, 255, 0.15);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.nav-login:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
}
.nav-register {
    background: #fff;
    color: var(--ihelp-primary) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.nav-register:hover {
    background: #f0f0f0;
    color: #5568d3 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.hero {
    background: var(--ihelp-gradient);
    color: white;
    padding: 4rem 2rem 4rem;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.hero-btn {
    display: inline-block;
    background: white;
    color: var(--ihelp-primary);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

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

.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.app-showcase-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    padding: 0 5%;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.app-logo-placeholder {
    width: 100px;
    height: 100px;
    background: var(--ihelp-gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.app-logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 20px;
}

.app-name {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.success-stats {
    background: white;
    margin: 0;
}

.showcases-section {
    background: white;
    padding: 4rem 2rem;
    margin: 4rem 0;
}

.showcases-section .app-showcase-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.showcases-slider {
    max-width: 1200px;
    margin: 0 auto;
}

.showcases-pages {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
}

.showcases-page {
    display: contents;
}

.showcases-section .app-showcase-grid {
    display: contents;
}

.showcases-dots {
    display: none;
}


.card-content {
    padding: 1.5rem;
}

.card-date {
    color: #999;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.card-desc {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-btn {
    display: inline-block;
    background: var(--ihelp-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.card-btn:hover {
    opacity: 0.9;
}

.features {
    background: white;
    padding: 4rem 2rem;
    margin: 4rem 0;
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: center;
}

.feature-item {
    padding: 2rem;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--ihelp-gradient);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.feature-desc {
    color: #666;
    font-size: 0.95rem;
}

.footer {
    background: #1a1a2e;
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer p {
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.footer-contact {
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

.footer-contact span {
    color: var(--ihelp-primary);
    font-weight: bold;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    margin-bottom: 1rem;
}

.footer-logo .logo-img {
    height: 50px;
    width: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--ihelp-primary);
}

.modal-title {
    padding: 2rem 2rem 1rem;
    margin: 0;
    font-size: 1.8rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
}

.modal-body {
    padding: 1.5rem 2rem 2rem;
    overflow-y: auto;
    max-height: calc(85vh - 100px);
}

.modal-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

.modal-body strong {
    color: #333;
}

@media (max-width: 768px) {
    .header {
        height: 56px;
        padding: 0 1rem;
        display: flex;
        align-items: center;
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
        width: 100%;
    }

    .logo-link {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 32px;
    }

    .nav {
        /* 关键修复:5 个链接在 56px header 中按字符换行、内容溢出、logo 第一个字被截掉
           改为右侧抽屉式菜单 — 默认隐藏在屏幕外,点击汉堡按钮滑入 */
        display: flex;
        position: fixed;
        top: 56px;
        right: 0;
        width: 75vw;
        max-width: 320px;
        height: calc(100vh - 56px);
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
        padding: 1.25rem 1rem;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav.open { transform: translateX(0); }

    .nav a {
        font-size: 1rem;
        padding: 0.85rem 1rem;
        border-radius: 8px;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    .nav a:hover, .nav a:active, .nav a:focus {
        background: rgba(255, 255, 255, 0.12);
        opacity: 1;
    }

    /* 移动端显示汉堡按钮和遮罩 */
    .menu-toggle { display: flex; }
    .nav-mask { display: block; }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .showcases-section {
        padding: 2rem 1rem 3.5rem;
        position: relative;
    }

    .showcases-slider {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .showcases-slider::-webkit-scrollbar {
        display: none;
    }

    .showcases-pages {
        display: flex;
    }

    .showcases-page {
        display: block;
        min-width: 100%;
        flex-shrink: 0;
        scroll-snap-align: start;
    }

    .showcases-section .app-showcase-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .showcases-dots {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        position: absolute;
        bottom: 1rem;
        left: 0;
        right: 0;
        z-index: 10;
    }

    .showcases-dots .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: background 0.3s;
    }

    .showcases-dots .dot.active {
        background: var(--ihelp-primary);
    }

    .app-logo-img,
    .app-logo-placeholder {
        width: 70px;
        height: 70px;
    }

    .app-name {
        font-size: 0.85rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .feature-item {
        padding: 1rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .feature-title {
        font-size: 1rem;
    }

    .feature-desc {
        font-size: 0.85rem;
    }

    .footer-content {
        padding: 2rem 1rem;
    }

    .footer-logo {
        font-size: 1.5rem;
    }

    .footer-logo .logo-img {
        height: 40px;
    }

    .success-stats {
        padding: 2rem 1rem;
    }
}

.back-to-top {
    position: fixed;
    left: 2rem;
    bottom: 2rem;
    width: 50px;
    height: 50px;
    background: var(--ihelp-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    text-align: center;
    line-height: 50px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}