/* ============================================================
   tsingtaoAI — 具身智能数据平台
   Design System & Styles
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(255,255,255,0.03);
    --bg-card-hover: rgba(255,255,255,0.06);
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(79,172,254,0.2);
    --text-primary: #f0f4ff;
    --text-secondary: #8892b0;
    --text-muted: #5a6280;
    --accent-blue: #4facfe;
    --accent-cyan: #00f2fe;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-green: #22d3ee;
    --accent-orange: #ff8a3d;
    --gradient-primary: linear-gradient(135deg, #4facfe, #00f2fe);
    --gradient-purple: linear-gradient(135deg, #a855f7, #ec4899);
    --gradient-green: linear-gradient(135deg, #22d3ee, #34d399);
    --gradient-text: linear-gradient(135deg, #f0f4ff, #64b5f6);
    --shadow-card: 0 4px 24px rgba(0,0,0,0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --navbar-height: 64px;
    --max-width: 1200px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== Utility ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Background Effects ===== */
.bg-mesh {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(0,150,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(100,80,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 70% 60% at 50% 80%, rgba(0,200,180,0.05) 0%, transparent 50%);
}
.bg-grid {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}
.ambient-scene {
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    height: calc(100vh - 100px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.82;
    mix-blend-mode: screen;
    transition: opacity 0.5s ease;
}

/* ===== Announcement Bar ===== */
.announcement {
    background: linear-gradient(90deg, rgba(79,172,254,0.08), rgba(0,242,254,0.04));
    border-bottom: 1px solid rgba(79,172,254,0.1);
    padding: 8px 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.announcement strong { color: var(--accent-blue); }
.announcement .close-ann {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
    cursor: pointer; padding: 4px; line-height: 1;
}

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 38px; left: 0; width: 100%;
    z-index: 1000;
    padding: 12px 0;
    transition: background var(--transition), box-shadow var(--transition);
    background: transparent;
}
.navbar.ann-closed { top: 0; }
.navbar.scrolled {
    background: rgba(10,14,23,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 40px rgba(0,0,0,0.3);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 700;
    color: #fff;
}
.nav-logo .logo-icon {
    width: 34px; height: 34px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff;
}
.nav-logo .site-logo {
    width: 34px; height: 34px;
    object-fit: cover;
    background: #fff;
    border-radius: 10px;
    flex: 0 0 34px;
}
.nav-logo small {
    font-weight: 400; font-size: 0.65rem; color: var(--text-muted);
    display: block; margin-top: -2px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    font-size: 0.88rem; color: var(--text-secondary);
    transition: color var(--transition);
    position: relative;
    padding: 4px 0;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links .btn-nav-cta {
    padding: 8px 20px;
    background: var(--gradient-primary);
    color: #0a0e17 !important;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
}
.nav-links .btn-nav-cta::after { display: none; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions .lang-switch {
    display: flex; gap: 4px; font-size: 0.8rem;
}
.nav-actions .lang-switch a,
.nav-actions .lang-switch button {
    padding: 4px 8px; border-radius: 6px;
    color: var(--text-muted); transition: var(--transition);
    font-size: inherit;
}
.nav-actions .lang-switch a.active,
.nav-actions .lang-switch button.active {
    background: rgba(79,172,254,0.15); color: var(--accent-blue);
}
.nav-actions .lang-switch a:hover,
.nav-actions .lang-switch button:hover { color: var(--text-secondary); }

.btn-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); border-color: var(--border-hover); }
.btn-icon .badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent-blue); color: #fff;
    font-size: 0.65rem; display: flex; align-items: center; justify-content: center;
}

.menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    cursor: pointer; padding: 4px;
}
.menu-toggle span {
    display: block; width: 24px; height: 2px;
    background: var(--text-secondary); border-radius: 2px;
    transition: var(--transition);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius-md);
    font-size: 0.92rem; font-weight: 600;
    transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
    white-space: nowrap;
}
.btn-primary {
    background: var(--gradient-primary);
    color: #0a0e17;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(79,172,254,0.3);
}
.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.btn-ghost {
    color: var(--accent-blue);
    padding: 8px 16px;
}
.btn-ghost:hover { background: rgba(79,172,254,0.08); border-radius: var(--radius-sm); }
.btn-sm { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Section Common ===== */
html, body { overflow-x: hidden; }
.page-content {
    position: relative;
    z-index: 1;
    padding-top: 100px;
    min-height: 100vh;
}
.section { padding: 80px 0; }
.hero-home {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 88px 0 72px;
}
.hero-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 24px;
    align-items: center;
}
.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 720px;
    min-width: 0;
    left: 166px;
}
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 20px;
}
.section-label {
    display: inline-block;
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 2px;
    color: var(--accent-blue); margin-bottom: 12px;
}
.section-title {
    font-size: 2.2rem; font-weight: 700; line-height: 1.25;
    background: var(--gradient-text);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 600px;
    line-height: 1.7;
}
.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto 40px; }

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-card);
}

/* ===== Reveal Animation ===== */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero-home .reveal {
    opacity: 1;
    transform: none;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center; justify-content: center;
    padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #111827;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
    max-width: 460px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.04);
    font-size: 1.1rem;
    transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.1); }
.modal h2 { font-size: 1.4rem; color: var(--text-primary); margin-bottom: 8px; }
.modal p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 0.82rem; color: var(--text-secondary);
    margin-bottom: 6px; font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent-blue); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group select { cursor: pointer; }
.form-group select option { background: #111827; color: var(--text-primary); }
.form-group .error-text { font-size: 0.78rem; color: #ef4444; margin-top: 4px; display: none; }
.form-group.error input,
.form-group.error textarea { border-color: #ef4444; }
.form-group.error .error-text { display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-checkbox {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem; color: var(--text-secondary);
}
.form-checkbox input[type="checkbox"] {
    width: auto; accent-color: var(--accent-blue);
}

/* ===== Auth Tabs ===== */
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-tab {
    padding: 10px 24px; font-size: 0.9rem; color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: var(--transition); cursor: pointer;
}
.auth-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.auth-form { display: none; }
.auth-form.active { display: block; }

/* ===== Toast ===== */
.toast-container {
    position: fixed; top: 80px; right: 24px; z-index: 3000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 14px 20px; border-radius: var(--radius-md);
    background: #111827; border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.88rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: toastIn 0.3s ease;
    display: flex; align-items: center; gap: 10px;
    min-width: 280px;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent-blue); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== Back To Top ===== */
.back-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(79,172,254,0.12);
    border: 1px solid rgba(79,172,254,0.15);
    color: var(--accent-blue);
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s, transform 0.3s;
    z-index: 999; backdrop-filter: blur(8px);
    cursor: pointer;
}
.back-top.show { opacity: 1; }
.back-top:hover { transform: translateY(-3px); background: rgba(79,172,254,0.2); }

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px; margin-bottom: 40px;
}
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); max-width: 300px; margin-top: 12px; line-height: 1.7; }
.footer-col h5 { font-size: 0.8rem; color: #fff; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col a {
    display: block; font-size: 0.85rem; color: var(--text-muted);
    padding: 5px 0; transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent-blue); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.04);
    padding-top: 20px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
    font-size: 0.78rem; color: var(--text-muted);
}

/* ===== Page Loader ===== */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    z-index: 5000; background: transparent;
}
.page-loader .bar {
    height: 100%; width: 0;
    background: var(--gradient-primary);
    transition: width 0.3s;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .section-title { font-size: 1.8rem; }
}
@media (max-width: 1100px) and (min-width: 769px) {
    .hero-copy { left: 118px; }
}
@media (max-width: 768px) {
    .nav-inner { position: relative; }
    .nav-actions {
        position: absolute;
        right: 16px;
        top: 50%;
        width: 125px;
        justify-content: flex-end;
        transform: translateY(-50%);
    }
    .nav-actions .lang-switch {
        position: fixed;
        top: 51px;
        right: 52px;
    }
    .nav-actions .menu-toggle {
        position: fixed;
        top: 49px;
        right: 14px;
    }
    .nav-links {
        display: none;
        position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
        background: rgba(10,14,23,0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 24px;
        z-index: 2000;
    }
    .nav-links.open { display: flex; }
    .nav-links a { font-size: 1.2rem; }
    .menu-toggle { display: flex; z-index: 2001; }
    .menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }
    .form-row { grid-template-columns: 1fr; }
    .section { padding: 50px 0; }
    .page-content { padding-top: 80px; }
    .announcement { font-size: 0.72rem; }
    .hero-home { min-height: auto; padding: 68px 0 36px; }
    .hero-grid { grid-template-columns: 1fr; gap: 0; }
    .hero-copy { max-width: 640px; left: 0; }
    .hero-home .reveal { opacity: 1; transform: none; }
    .hero-title { font-size: 2.55rem; }
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 14px;
        margin-top: 36px;
        padding-top: 24px;
    }
    .nav-logo { min-width: 0; }
    .nav-logo > div { min-width: 0; white-space: nowrap; }
    .nav-actions { gap: 5px; flex-shrink: 0; }
    .nav-actions .auth-guest { display: none !important; }
    .nav-actions .auth-guest { gap: 4px !important; }
    .nav-actions .auth-guest .btn {
        padding: 5px 9px !important;
        font-size: 0.72rem;
    }
    .nav-logo { gap: 7px; font-size: 1.08rem; }
    .nav-logo .site-logo { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
    .nav-logo small { display: none; }
}
@media (max-width: 480px) {
    .section-title { font-size: 1.4rem; }
    .nav-actions .lang-switch { gap: 2px; font-size: 0.72rem; }
    .nav-actions .lang-switch button { padding: 4px 6px; }
    .hero-title { font-size: 2.1rem; }
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 14px;
        margin-top: 34px;
        padding-top: 22px;
    }
    .hero-stats > div > div:first-child { font-size: 1.5rem !important; }
    .hero-stats > div > div:last-child { font-size: 0.72rem !important; }
    .nav-actions .auth-guest .btn {
        padding: 4px 7px !important;
        font-size: 0.68rem;
    }
    .nav-logo { font-size: 0.98rem; }
    .nav-logo small { display: none; }
    .ambient-scene {
        top: 80px;
        height: calc(100vh - 80px);
    }
}
