/* ==================== bubbly AI角色互动平台 样式表 ==================== */
/* 设计：紫红渐变主题，移动优先，安全区适配，暗色模式，触摸优化 */

:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --primary: #a855f7;
    --primary-dark: #7c3aed;
    --secondary: #ec4899;
    --accent: #f43f5e;
    --gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f43f5e 100%);
    --gradient-soft: linear-gradient(135deg, #f3e8ff 0%, #fce7f3 100%);
    --bg: #ffffff;
    --bg-alt: #faf5ff;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --border: #f3e8ff;
    --shadow: 0 4px 24px rgba(168, 85, 247, 0.08);
    --shadow-hover: 0 8px 32px rgba(168, 85, 247, 0.16);
    --radius: 16px;
    --radius-sm: 10px;
    --maxw: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f0a1a;
        --bg-alt: #1a1228;
        --bg-card: #1f1530;
        --text: #f3f0ff;
        --text-light: #c4b8e0;
        --text-muted: #8b7da8;
        --border: #2d1f44;
        --gradient-soft: linear-gradient(135deg, #1a1228 0%, #2d1538 100%);
        --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 8px 32px rgba(168, 85, 247, 0.24);
    }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 12px 26px; border-radius: 999px;
    font-size: 15px; font-weight: 600; line-height: 1;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 4px 14px rgba(236, 72, 153, 0.35); }
.btn-primary:active { transform: scale(0.96); }
.btn-sm { padding: 9px 18px; font-size: 14px; min-height: 40px; }
.btn-xl { padding: 16px 40px; font-size: 17px; min-height: 52px; }

/* ==================== Header ==================== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: var(--safe-top);
}
@media (prefers-color-scheme: dark) {
    .header { background: rgba(15, 10, 26, 0.92); }
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; }
.logo-icon img { border-radius: 8px; }
.logo-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-desktop { display: none; gap: 26px; }
.nav-desktop a { font-size: 15px; color: var(--text-light); transition: color .15s; }
.nav-desktop a:hover { color: var(--primary); }
.nav-download { display: inline-flex; }

/* ==================== Hero ==================== */
.hero {
    position: relative; padding: calc(64px + var(--safe-top)) 0 48px;
    background: var(--gradient-soft); overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; top: -40%; right: -20%;
    width: 480px; height: 480px; border-radius: 50%;
    background: var(--gradient); opacity: 0.12; filter: blur(40px);
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: rgba(168, 85, 247, 0.1); color: var(--primary-dark);
}
.hero h1 {
    font-size: 1.9rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.5px;
    max-width: 640px;
}
@media (prefers-color-scheme: dark) { .hero h1 { color: var(--text); } }
.hero h1 .grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-desc { font-size: 16px; color: var(--text-light); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-stats { display: flex; gap: 28px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-stat-label { font-size: 12px; color: var(--text-muted); }
.hero-img { margin: 12px auto 0; border-radius: var(--radius); box-shadow: var(--shadow-hover); max-height: 380px; width: auto; max-width: 100%; object-fit: cover; }

/* ==================== 实时数据栏 ==================== */
.live-data {
    background: var(--gradient); color: #fff; padding: 10px 0;
}
.live-data-bar {
    display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center;
    font-size: 13px;
}
.live-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.live-ico { font-size: 14px; }
.live-item b { font-weight: 700; }

/* ==================== Section 通用 ==================== */
section { padding: 44px 0; }
.section-title { font-size: 1.6rem; font-weight: 800; text-align: center; margin-bottom: 8px; letter-spacing: -0.3px; }
.section-desc { text-align: center; color: var(--text-light); font-size: 15px; margin-bottom: 28px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ==================== 功能特色 ==================== */
.features-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.feature-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 18px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.feature-card:active { transform: scale(0.98); }
.feature-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--gradient-soft); display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p { font-size: 14px; color: var(--text-light); }

/* ==================== 角色广场 ==================== */
.characters { background: var(--bg-alt); }
.char-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.char-tab { padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-light); transition: all .15s; min-height: 40px; }
.char-tab.active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(236, 72, 153, 0.3); }
.char-tab:active { transform: scale(0.96); }
.characters-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.character-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); transition: transform .15s;
}
.character-card:active { transform: scale(0.98); }
.character-avatar { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--gradient-soft); }
.character-info { padding: 10px 12px; }
.character-name { font-size: 15px; font-weight: 700; }
.character-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }

/* ==================== 使用教程 ==================== */
.tutorial-steps { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tutorial-step {
    display: flex; gap: 14px; align-items: flex-start;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.step-num {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    background: var(--gradient); color: #fff; font-weight: 800; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
}
.step-content { flex: 1; min-width: 0; }
.step-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.step-desc { font-size: 14px; color: var(--text-light); }

/* ==================== 对比表 ==================== */
.comparison { background: var(--bg-alt); }
.comparison-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); }
.comparison-table { width: 100%; min-width: 420px; border-collapse: collapse; background: var(--bg-card); }
.comparison-table th, .comparison-table td { padding: 12px 10px; text-align: center; font-size: 13px; border-bottom: 1px solid var(--border); }
.comparison-table th { background: var(--gradient-soft); font-weight: 700; }
.comparison-table .col-feature { text-align: left; font-weight: 600; }
.comparison-table .comparison-highlight { background: rgba(168, 85, 247, 0.06); color: var(--primary-dark); font-weight: 700; }
.comparison-table td:not(.comparison-highlight):not(.col-feature) { color: var(--text-light); }

/* ==================== 用户评价 ==================== */
.reviews-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.review-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: transform .15s;
}
.review-card:active { transform: scale(0.98); }
.review-stars { color: #fbbf24; font-size: 14px; margin-bottom: 8px; letter-spacing: 2px; }
.review-text { font-size: 14px; color: var(--text); margin-bottom: 12px; line-height: 1.65; }
.review-user { display: flex; align-items: center; gap: 10px; }
.review-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.review-name { font-size: 14px; font-weight: 600; }
.review-meta { font-size: 12px; color: var(--text-muted); }

/* ==================== 长尾内容 ==================== */
.longtail { background: var(--bg-alt); }
.longtail-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); font-size: 14px; color: var(--text-light); line-height: 1.8; }
.longtail-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.longtail-content h3:first-child { margin-top: 0; }
.longtail-content p { margin-bottom: 10px; }

/* ==================== FAQ ==================== */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow); }
.faq-question {
    width: 100%; padding: 16px 18px; text-align: left; font-size: 15px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    color: var(--text); min-height: 44px;
}
.faq-icon { flex-shrink: 0; font-size: 20px; color: var(--primary); transition: transform .2s; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-answer-inner { padding: 0 18px 16px; font-size: 14px; color: var(--text-light); line-height: 1.7; }

/* ==================== 关键词云 ==================== */
.keywords { background: var(--bg-alt); }
.keyword-cloud { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 760px; margin: 0 auto; }
.keyword-tag { padding: 6px 14px; border-radius: 999px; font-size: 13px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-light); }

/* ==================== 大家还在搜 ==================== */
.related-searches { background: var(--bg-card); }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 760px; margin: 0 auto; }
.related-item {
    display: flex; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--bg-alt); border: 1px solid var(--border); font-size: 14px; color: var(--text);
    transition: transform .15s, box-shadow .15s; min-height: 44px; touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.related-item::before { content: "🔍"; margin-right: 8px; font-size: 13px; opacity: 0.7; }
.related-item:active { transform: scale(0.97); }

/* ==================== 更新日志 ==================== */
.changelog { background: var(--bg-alt); }
.changelog-list { max-width: 720px; margin: 0 auto; }
.changelog-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.changelog-version { font-size: 14px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.changelog-version time { font-weight: 400; color: var(--text-muted); font-size: 12px; margin-left: 8px; }
.changelog-item p { font-size: 14px; color: var(--text-light); line-height: 1.65; }

@media (min-width: 768px) {
    .related-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ==================== CTA ==================== */
.cta { padding: 48px 0; }
.cta-card { background: var(--gradient); border-radius: var(--radius); padding: 36px 24px; text-align: center; color: #fff; box-shadow: var(--shadow-hover); }
.cta-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.cta-desc { font-size: 15px; opacity: 0.95; margin-bottom: 20px; }
.cta-btn { display: inline-flex; align-items: center; gap: 6px; padding: 14px 36px; border-radius: 999px; background: #fff; color: var(--primary-dark); font-weight: 700; font-size: 16px; min-height: 48px; transition: transform .15s; }
.cta-btn:active { transform: scale(0.96); }

/* ==================== Footer ==================== */
.footer { background: var(--bg-alt); padding: 36px 0 calc(76px + var(--safe-bottom)); border-top: 1px solid var(--border); }
.footer-inner { text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 20px; margin-bottom: 10px; }
.footer-desc { font-size: 13px; color: var(--text-light); max-width: 480px; margin: 0 auto 16px; }
.footer-nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.footer-nav a { font-size: 13px; color: var(--text-light); }
.footer-update { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.footer-copyright { font-size: 12px; color: var(--text-muted); }

/* ==================== 移动端底部导航 ==================== */
.mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    display: flex; background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom);
}
@media (prefers-color-scheme: dark) { .mobile-nav { background: rgba(15, 10, 26, 0.96); } }
.mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0; font-size: 11px; color: var(--text-muted);
    min-height: 44px; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.mobile-nav-icon { font-size: 18px; }
.mobile-nav-download { color: var(--primary); font-weight: 700; }

/* ==================== 悬浮下载按钮 ==================== */
.fab {
    position: fixed; right: 14px; bottom: calc(72px + var(--safe-bottom)); z-index: 98;
    width: 52px; height: 52px; border-radius: 50%; background: var(--gradient); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4); transition: transform .15s;
}
.fab:active { transform: scale(0.9); }

/* ==================== 下载页 ==================== */
.download-hero { background: var(--gradient-soft); padding: calc(48px + var(--safe-top)) 0 40px; }
.download-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 20px; text-align: center; box-shadow: var(--shadow-hover); max-width: 520px; margin: 0 auto; }
.download-logo { margin: 0 auto 14px; }
.download-card .section-title { margin-bottom: 6px; }
.download-actions { margin: 18px 0; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.recent-dl { font-size: 13px; color: var(--text-light); }
.recent-dl b { color: var(--primary-dark); font-weight: 700; }
.download-info { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; font-size: 13px; color: var(--text-light); }

.platforms-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.platform-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 18px; text-align: center; box-shadow: var(--shadow); }
.platform-icon { font-size: 36px; margin-bottom: 8px; }
.platform-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.platform-desc { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }

/* ==================== 响应式 ==================== */
@media (min-width: 576px) {
    .hero h1 { font-size: 2.2rem; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .reviews-grid { grid-template-columns: repeat(2, 1fr); }
    .platforms-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    body { font-size: 16px; }
    .container { padding: 0 24px; }
    .nav-desktop { display: flex; }
    .hero { padding: calc(80px + var(--safe-top)) 0 60px; }
    .hero h1 { font-size: 2.6rem; }
    .hero-desc { font-size: 18px; }
    section { padding: 60px 0; }
    .section-title { font-size: 2rem; }
    .section-desc { font-size: 16px; margin-bottom: 36px; }
    .features-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .characters-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
    .tutorial-steps { grid-template-columns: repeat(2, 1fr); }
    .reviews-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
    .live-data-bar { font-size: 14px; gap: 10px 28px; }
    .footer { padding: 40px 0 40px; }
    .mobile-nav { display: none; }
    .fab { display: none; }
}

@media (min-width: 1024px) {
    .hero-inner { gap: 22px; }
    .hero h1 { font-size: 3rem; }
    .features-grid { grid-template-columns: repeat(4, 1fr); }
    .characters-grid { grid-template-columns: repeat(4, 1fr); }
    .tutorial-steps { grid-template-columns: repeat(4, 1fr); }
    .review-card { padding: 22px; }
}

@media (min-width: 1280px) {
    .characters-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ==================== 小屏优化 ==================== */
@media (max-width: 375px) {
    .hero h1 { font-size: 1.65rem; }
    .section-title { font-size: 1.4rem; }
    .hero-stats { gap: 18px; }
    .hero-stat-num { font-size: 1.25rem; }
    .characters-grid { gap: 10px; }
    .character-info { padding: 8px 10px; }
    .character-name { font-size: 14px; }
    .character-desc { font-size: 11px; }
    .live-data-bar { font-size: 12px; gap: 6px 14px; }
    .mobile-nav-icon { font-size: 16px; }
    .fab { width: 48px; height: 48px; font-size: 20px; bottom: calc(68px + var(--safe-bottom)); }
}

/* ==================== 无障碍 ==================== */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
    .hero { padding: calc(48px + var(--safe-top)) 0 32px; }
    .hero h1 { font-size: 1.8rem; }
    .hero-img { max-height: 280px; }
}
