/**
 * TiboSpeak Website Styles
 * 配色直接取自 App 的设计系统（TiboSpeak/Core/DesignSystem/Theme.swift），
 * 让官网和 App 内看起来是同一个产品。
 */

:root {
    /* 主色 —— App 的 primary / primaryDark / primaryOnNight */
    --color-primary: #047857;
    --color-primary-dark: #035E45;
    --color-primary-bright: #34D399;
    --color-primary-light: #E6F5F0;

    /* 强调色 —— 琥珀（星级 / 高亮）与砖红（录音） */
    --color-highlight: #E8A33D;
    --color-highlight-dark: #9A6114;
    --color-highlight-soft: #FDF3E2;
    --color-record: #E8583F;
    --color-record-dark: #C33A25;
    --color-record-light: #FDECE8;
    --color-accent: #3B6FD4;

    /* 背景 */
    --color-bg-light: #F7F7FB;
    --color-bg-cream: #EDF7F3;
    --color-bg-card: #FFFFFF;
    --color-bg-subtle: #F1F1F7;

    /* 夜色（App 里对话舞台的底色） */
    --color-night-top: #1A1440;
    --color-night-bottom: #2E2266;

    /* 文字 */
    --color-text: #2B2250;
    --color-text-secondary: #635B8A;
    --color-text-muted: #9A92BC;

    --color-border: #E7E6F0;
    --color-success: #047857;

    /* 字体：App 全站是 SF Rounded，网页用 Nunito 最接近 */
    --font-display: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 48px;
    --spacing-2xl: 88px;

    --border-radius-sm: 10px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --border-radius-xl: 26px;

    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.01em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(4, 120, 87, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(4, 120, 87, 0.3);
}

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: #fff;
}

.btn-lg {
    padding: 16px 34px;
    font-size: 1.05rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 18px 0;
    background: transparent;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    padding: 12px 0;
    box-shadow: 0 2px 20px rgba(43, 34, 80, 0.08);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-text);
}

.logo img {
    height: 38px;
    width: auto;
    border-radius: 9px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition);
}

/* Hero */
.hero {
    padding: 150px 0 90px;
    background: linear-gradient(180deg, var(--color-bg-cream) 0%, var(--color-bg-light) 100%);
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}

.hero-content {
    max-width: 580px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 15px;
    background: rgba(4, 120, 87, 0.1);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 22px;
}

.hero h1 {
    font-size: 3.4rem;
    line-height: 1.08;
    margin-bottom: 20px;
}

.hero h1 span {
    color: var(--color-primary);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 500px;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    margin-bottom: 44px;
}

.hero-stats {
    display: flex;
    gap: 44px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--color-primary);
}

.stat-label {
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

/* 手机外框：跟 App 引导页的截图卡是同一种处理 —— 白色机身 + 同色系软阴影 */
.phone {
    position: relative;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 40px;
    box-shadow: 0 30px 70px rgba(4, 120, 87, 0.22);
}

.phone img {
    display: block;
    width: 100%;
    border-radius: 32px;
    /* 竖屏截图很长，整张塞进来会把版面拉散：统一按宽度裁，只留上半屏 */
    object-fit: cover;
    object-position: top;
}

.hero-image .phone img { max-height: 580px; }
.step-image .phone img { max-height: 440px; }
.screenshot-card .phone img { max-height: 460px; }

.hero-image {
    position: relative;
    /* 必须建层叠上下文，否则 .hero-glow 的 z-index:-1 会掉到页面背景之后，整个看不见 */
    z-index: 0;
    display: flex;
    justify-content: center;
}

.hero-image .phone {
    max-width: 310px;
}

.hero-glow {
    position: absolute;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(4, 120, 87, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Sections */
section {
    padding: var(--spacing-2xl) 0;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 56px;
}

.section-header h2 {
    font-size: 2.4rem;
    margin-bottom: 14px;
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.08rem;
}

/* Features */
.features {
    background: var(--color-bg-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.feature-card {
    padding: 30px;
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(43, 34, 80, 0.1);
    border-color: var(--color-primary);
}

.feature-icon {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-light);
    border-radius: var(--border-radius-md);
    margin-bottom: 18px;
}

.feature-icon svg {
    width: 26px;
    height: 26px;
    color: var(--color-primary);
}

.feature-card.amber .feature-icon { background: var(--color-highlight-soft); }
.feature-card.amber .feature-icon svg { color: var(--color-highlight-dark); }
.feature-card.rust .feature-icon { background: var(--color-record-light); }
.feature-card.rust .feature-icon svg { color: var(--color-record-dark); }

.feature-card h3 {
    font-size: 1.18rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* Support levels（三档扶手） */
.levels {
    background: var(--color-bg-cream);
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    max-width: 980px;
    margin: 0 auto;
}

.level-card {
    position: relative;
    padding: 32px 28px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
}

.level-card .level-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    margin-bottom: 14px;
}

.level-card:nth-child(2) .level-tag { background: var(--color-highlight-soft); color: var(--color-highlight-dark); }
.level-card:nth-child(3) .level-tag { background: var(--color-record-light); color: var(--color-record-dark); }

.level-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.level-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.level-sample {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--color-bg-subtle);
    border-radius: var(--border-radius-md);
    font-size: 0.92rem;
    color: var(--color-text);
    font-style: italic;
}

.levels-note {
    text-align: center;
    margin-top: 34px;
    color: var(--color-text-secondary);
}

/* How it works */
.how-it-works {
    background: var(--color-bg-light);
}

.steps {
    max-width: 940px;
    margin: 0 auto;
}

.step {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
    margin-bottom: 72px;
}

.step:last-child {
    margin-bottom: 0;
}

.step:nth-child(even) {
    direction: rtl;
}

.step:nth-child(even) > * {
    direction: ltr;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}

.step-content h3 {
    font-size: 1.45rem;
    margin-bottom: 12px;
}

.step-content p {
    color: var(--color-text-secondary);
    max-width: 380px;
}

.step-meta {
    display: inline-block;
    margin-top: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--color-bg-subtle);
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.step-image {
    display: flex;
    justify-content: center;
}

.step-image .phone {
    max-width: 250px;
}

/* Screenshots */
.screenshots {
    background: var(--color-bg-cream);
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 900px;
    margin: 0 auto;
}

.screenshot-card {
    transition: var(--transition);
}

.screenshot-card:hover {
    transform: translateY(-6px);
}

.screenshot-card .caption {
    margin-top: 16px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--color-text-secondary);
}

/* Districts */
.districts {
    background: var(--color-bg-light);
}

.districts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.district-card {
    padding: 28px;
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.district-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(43, 34, 80, 0.1);
}

.district-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.district-card h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.district-level {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.district-card p {
    color: var(--color-text-secondary);
    font-size: 0.93rem;
}

/* Pricing */
.pricing {
    background: var(--color-bg-card);
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 820px;
    margin: 0 auto;
}

.pricing-card {
    position: relative;
    padding: 38px;
    background: var(--color-bg-light);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
}

.pricing-card.featured {
    border-color: var(--color-primary);
    box-shadow: 0 20px 60px rgba(4, 120, 87, 0.15);
}

.pricing-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 999px;
}

.pricing-header {
    text-align: center;
}

.pricing-header h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 6px;
}

.price .amount {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--color-text);
}

.price .period {
    color: var(--color-text-secondary);
}

/* 价格位上放的是方案名而不是数字时，字号收一档，两张卡的基线才对得上 */
.price.price-text .amount {
    font-size: 1.75rem;
}

.pricing-header p {
    color: var(--color-text-muted);
    margin-bottom: 26px;
    font-size: 0.92rem;
}

.pricing-features {
    list-style: none;
    margin-bottom: 28px;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-features li.disabled {
    color: var(--color-text-muted);
}

.pricing-features svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--color-success);
}

.pricing-features li.disabled svg {
    color: var(--color-text-muted);
}

.pricing-card .btn {
    width: 100%;
}

.pricing-note {
    max-width: 820px;
    margin: 26px auto 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.86rem;
}

/* FAQ */
.faq {
    background: var(--color-bg-cream);
}

.faq-list {
    max-width: 720px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--color-border);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-question svg {
    flex-shrink: 0;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-item.active .faq-answer {
    max-height: 320px;
}

.faq-answer p {
    padding-bottom: 22px;
    color: var(--color-text-secondary);
}

/* Download —— 用 App 里对话舞台的夜色，整页唯一的深色块 */
.download {
    background: linear-gradient(160deg, var(--color-night-top) 0%, var(--color-night-bottom) 100%);
    text-align: center;
    color: #fff;
}

.download-content {
    max-width: 620px;
    margin: 0 auto;
}

.download h2 {
    font-size: 2.4rem;
    margin-bottom: 14px;
}

.download p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 36px 0 20px;
    flex-wrap: wrap;
}

.store-badge img {
    height: 54px;
    transition: var(--transition);
}

.store-badge:hover img {
    transform: scale(1.05);
}

.store-badge.disabled {
    cursor: default;
    opacity: 0.78;
}

.store-badge.disabled:hover img {
    transform: none;
}

.download-note {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--color-bg-card);
    padding: 56px 0 28px;
    border-top: 1px solid var(--color-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 36px;
}

.footer-brand p {
    color: var(--color-text-secondary);
    margin-top: 14px;
    max-width: 300px;
    font-size: 0.95rem;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 14px;
}

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

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

.footer-links a {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

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

.footer-bottom {
    padding-top: 26px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        padding-top: 130px;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons,
    .hero-stats {
        justify-content: center;
    }

    .hero-image {
        order: -1;
        margin-bottom: 12px;
    }

    .hero-image .phone {
        max-width: 250px;
    }

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

    .screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

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

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 14px 18px;
        background: #fff;
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius-lg);
        box-shadow: 0 16px 40px rgba(43, 34, 80, 0.12);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 10px 0;
    }

    .navbar > .container > .btn {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

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

    .section-header h2,
    .download h2 {
        font-size: 1.9rem;
    }

    .features-grid,
    .levels-grid,
    .districts-grid,
    .screenshots-grid,
    .pricing-cards {
        grid-template-columns: 1fr;
    }

    .screenshots-grid {
        max-width: 300px;
    }

    .step {
        grid-template-columns: 1fr;
        gap: 28px;
        text-align: center;
    }

    .step:nth-child(even) {
        direction: ltr;
    }

    .step-number {
        margin: 0 auto 16px;
    }

    .step-content p {
        max-width: none;
        margin: 0 auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-brand p {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-lg {
        width: 100%;
    }
}
