/* CSS 变量 */
:root {
    --bg-primary: #0e1525;
    --accent: #1db8b4;
    --accent-light: #6ee0d5;
    --text-primary: #f0f4f8;
    --text-secondary: #c5d0dc;
    --text-muted: #8a95a5;
}

/* 重置 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    background: #0e1525;
    line-height: 1.55;
}

/* DNA 背景 */
.dna-background {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    background: #0e1525;
}
#dnaCanvas { width: 100%; height: 100%; }

/* ============ 单屏容器 ============ */
.page {
    position: relative;
    z-index: 1;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 36px;
    overflow: hidden;
}

.page::before {
    content: ''; position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    background: radial-gradient(ellipse 70% 55% at center,
        rgba(14,21,37,0.06) 0%,
        rgba(14,21,37,0.14) 50%,
        rgba(14,21,37,0.26) 100%);
    pointer-events: none;
}

/* ============ Header ============ */
.header {
    height: auto;
    max-height: 11vh;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 2vw;
    border-bottom: 1px solid rgba(100,220,215,0.2);
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(16,24,42,0.65) 0%, rgba(16,24,42,0.35) 100%);
    backdrop-filter: blur(10px);
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { display: flex; align-items: center; }
.logo-icon svg { width: 30px; height: 30px; }

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.logo-text .highlight { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 36px; }
.nav-link {
    color: var(--text-secondary); text-decoration: none;
    font-size: 22px; font-weight: 500;
    padding: 4px 0; position: relative;
    transition: color 0.25s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.nav-link::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ============ Main Content ============ */
.main {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5vh 0;
    gap: 1.8vh;
}

/* 功能卡片网格 */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.8vh;
    flex-shrink: 0;
}

.feature-card {
    background: linear-gradient(145deg, rgba(22,32,52,0.78) 0%, rgba(16,24,42,0.6) 100%);
    border: 1px solid rgba(100,220,215,0.22);
    border-radius: 12px;
    padding: 2vh 1.5vw;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(14px);
    box-shadow: 0 3px 16px rgba(0,0,0,0.18);
}
.feature-card::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), var(--accent), transparent);
    opacity: 0; transition: opacity 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(29,184,180,0.5);
    box-shadow: 0 8px 28px rgba(29,184,180,0.18), 0 2px 10px rgba(0,0,0,0.15);
}
.feature-card:hover::before { opacity: 1; }

.card-icon {
    color: var(--accent-light);
    margin-bottom: 0.8vh;
    display: flex; justify-content: center;
}
.card-icon svg {
    width: 42px; height: 42px;
    transition: transform 0.3s ease;
}
.feature-card:hover .card-icon svg { transform: scale(1.1); }

.card-title {
    font-size: clamp(16px, 2vh, 20px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4vh;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

.card-desc {
    font-size: clamp(13px, 1.5vh, 15px);
    color: var(--text-secondary);
    margin-bottom: 1.2vh;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.33);
}

.btn-card {
    background: linear-gradient(135deg, #156a66 0%, #159895 50%, #1ab5af 100%);
    color: var(--text-primary);
    border: none;
    padding: 0.7vh 2vw;
    border-radius: 6px;
    font-size: clamp(13px, 1.5vh, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}
.btn-card:hover {
    background: linear-gradient(135deg, #159895 0%, #1ab5af 50%, #156a66 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(21,152,149,0.35);
}

/* 公司介绍 */
.intro {
    max-width: 1000px; width: 100%;
    margin: 0 auto;
    padding: 1vh 2vw;
    background: rgba(16,24,42,0.45);
    border-radius: 10px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(100,220,215,0.1);
    flex-shrink: 0;
}

.intro-text {
    font-size: clamp(14px, 1.7vh, 17px);
    color: rgba(200,218,235,0.95);
    line-height: 1.7;
    text-align: left;
    text-indent: 2em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ============ Footer - 左侧文字 + 右侧双二维码 ============ */
.footer {
    flex-shrink: 0;
    border-top: 1px solid rgba(100,220,215,0.18);
    padding: 1.5vh 2vw 1vh;
    background: linear-gradient(180deg, rgba(16,24,42,0.55) 0%, rgba(14,22,38,0.65) 100%);
    backdrop-filter: blur(12px);
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3vw;
    margin-bottom: 0.8vh;
}

/* 左侧：联系我们 + 友情链接 */
.footer-info {
    flex: 1;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 0.6vh 3vw;
    align-items: start;
}

.contact-col, .link-col { display: flex; flex-direction: column; gap: 0.3vh; }

.footer-title {
    font-size: clamp(15px, 1.85vh, 19px);
    font-weight: 700;
    color: rgba(210,225,238,0.95);
    margin-bottom: 0.4vh;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.contact-col p {
    font-size: clamp(13px, 1.5vh, 16.5px);
    color: rgba(175,195,218,0.85);
    line-height: 1.65;
    white-space: nowrap;
}

.link-col a {
    font-size: clamp(13px, 1.55vh, 16.5px);
    color: rgba(100,200,220,0.9);
    text-decoration: none;
    transition: color 0.25s ease;
}
.link-col a:hover { color: var(--accent); text-decoration: underline; }

/* 右侧：两个相邻二维码（标题在二维码下方） */
.footer-qr {
    display: flex;
    align-items: flex-start;
    gap: 1.5vw;
    flex-shrink: 0;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3vh;
}

.qr-img {
    width: clamp(66px, 9vh, 92px);
    height: clamp(66px, 9vh, 92px);
    border-radius: 6px;
    background: #fff;
    padding: 3px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.28), 0 0 0 1px rgba(80,200,195,0.1);
}
.qr-img:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(21,152,149,0.22), 0 0 0 1px rgba(80,200,195,0.25);
}

.qr-name {
    font-size: clamp(11px, 1.25vh, 14px);
    color: rgba(155,180,200,0.85);
    text-align: center;
    display: block;
}

/* 版权行 */
.copyright {
    font-size: clamp(11px, 1.2vh, 13.5px);
    color: rgba(150,175,200,0.7);
    text-align: center;
    padding-top: 0.6vh;
    border-top: 1px solid rgba(80,200,195,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.copyright a {
    color: rgba(130,180,210,0.75);
    text-decoration: none;
    transition: color 0.25s ease;
}
.copyright a:hover { color: var(--accent); text-decoration: underline; }

/* ============ 真 3D 伯小豪 数字人向导 ============ */
#three-guide-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* 让画布透明穿透 */
    z-index: 999;
}

.guide-speech-bubble {
    position: fixed;
    pointer-events: auto;
    background: rgba(14, 24, 38, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(21, 152, 149, 0.4);
    border-radius: 12px 12px 12px 0;
    padding: 1.5vh 1.5vw;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 15px rgba(21, 152, 149, 0.2);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s ease;
    color: var(--text-primary);
    font-size: clamp(13px, 1.5vh, 15px);
    line-height: 1.6;
    z-index: 1000;
}

.guide-speech-bubble.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.guide-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 20px;
    border-width: 10px 0 0 10px;
    border-style: solid;
    border-color: rgba(21, 152, 149, 0.4) transparent transparent transparent;
}

.close-guide {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}
.close-guide:hover { color: var(--text-primary); }

/* ============ 2D 降级版伯小豪 ============ */
.fallback-guide {
    position: fixed;
    right: 3vw;
    bottom: 2vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transform: translateX(120%);
    transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.fallback-guide.active {
    transform: translateX(0);
}
.fallback-bubble {
    margin-bottom: 10px;
    margin-right: 20px;
}
.fallback-img {
    width: clamp(100px, 12vh, 150px);
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    animation: fallbackFloat 3s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.fallback-img:hover {
    transform: scale(1.05);
}
@keyframes fallbackFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============ 响应式 ============ */
@media (max-height: 700px) {
    .header { min-height: 42px; padding: 4px 0; }
    .logo-icon svg { width: 24px; height: 24px; }
    .logo-text { font-size: 17px; }
    .nav { gap: 18px; }
    .nav-link { font-size: 13px; }
    .main { gap: 1.2vh; padding: 1vh 0; }
    .features { gap: 1.2vh; }
    .card-icon svg { width: 34px; height: 34px; }
    .btn-card { padding: 0.5vh 1.5vw; font-size: clamp(12px, 1.3vh, 14px); }
    .intro { padding: 0.7vh 1.5vw; }
    .intro-text { line-height: 1.5; }
    .footer { padding: 0.8vh 0 0.6vh; }
    .qr-img { width: clamp(54px, 7vh, 74px); height: clamp(54px, 7vh, 74px); }
    .footer-main { gap: 2.5vw; }
}

@media (max-width: 768px) {
    .page { padding: 0 18px; }
    .nav { display: none; }
    .features { grid-template-columns: 1fr; gap: 12px; }
    .footer-main { flex-direction: column; gap: 14px; text-align: center; }
    .footer-info { grid-template-columns: 1fr; gap: 6px; }
    .footer-qr { justify-content: center; }
    .footer-info p { white-space: normal; }
}

@media (max-width: 768px) and (max-height: 800px) {
    html, body { overflow-y: auto; }
    .page { height: auto; min-height: 100vh; max-height: none; padding: 18px; overflow: visible; }
    .main { flex: none; }
}
