/* ===== ai724.cn — Moonshot-inspired design system ===== */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --ms-bg: #000000;
    --ms-card: #121212;
    --ms-input: #333333;
    --ms-text: #ffffff;
    --ms-muted: #737373;
    --ms-border: rgba(255, 255, 255, 0.12);
    --ms-border-soft: rgba(255, 255, 255, 0.42);
    --ms-container: 90rem;
    --ms-px: clamp(1.25rem, 4vw, 5rem);
    --ms-section-y: 5rem;
    --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: "M PLUS 1", "Noto Sans SC", sans-serif;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    font-size: 16px;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 3px; }

body {
    background: var(--ms-bg);
    color: var(--ms-text);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Custom cursor (Moonshot-style) --- */
.ms-cursor {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ms-cursor-dot,
.ms-cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    will-change: transform, left, top;
}

.ms-cursor-dot {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.ms-cursor-ring {
    width: 38px;
    height: 38px;
    border: 1.5px solid rgba(255, 255, 255, 0.88);
    border-radius: 50%;
    transition: width 0.35s ease, height 0.35s ease, border-color 0.35s ease;
}

.ms-cursor.is-hover .ms-cursor-ring {
    width: 54px;
    height: 54px;
    border-color: rgba(0, 220, 255, 0.75);
}

@media (hover: hover) and (pointer: fine) {
    body.has-custom-cursor,
    body.has-custom-cursor * {
        cursor: none !important;
    }
}

::selection {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* --- Layout --- */
.ms-container {
    width: 100%;
    max-width: var(--ms-container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ms-px);
    padding-right: var(--ms-px);
}

.ms-section {
    padding-top: var(--ms-section-y);
    padding-bottom: var(--ms-section-y);
}

.ms-section-alt {
    border-top: 1px solid var(--ms-border);
}

.ms-section-cta {
    padding-top: 8rem;
    padding-bottom: 10rem;
}

/* --- Navigation --- */
.ms-nav {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.ms-nav.scrolled {
    border-bottom-color: var(--ms-border);
    background: rgba(0, 0, 0, 0.92);
}

.ms-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 1rem;
}

.ms-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.ms-nav-links {
    flex: 1;
    justify-content: center;
}

.ms-nav-link {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
}

.ms-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.ms-nav-link.is-active {
    color: #fff;
}

.ms-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
}

.ms-menu-btn .menu-line {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ms-menu-btn .menu-line:nth-child(1),
.ms-menu-btn .menu-line:nth-child(2) { width: 1.5rem; }
.ms-menu-btn .menu-line:nth-child(3) { width: 1rem; }

.ms-menu-btn.active .menu-line:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.ms-menu-btn.active .menu-line:nth-child(2) { opacity: 0; }
.ms-menu-btn.active .menu-line:nth-child(3) { width: 1.5rem; transform: translateY(-8px) rotate(-45deg); }

.ms-mobile-menu {
    padding: 1rem var(--ms-px) 1.5rem;
    border-top: 1px solid var(--ms-border);
    background: rgba(0, 0, 0, 0.96);
}

.ms-mobile-link {
    display: block;
    padding: 0.75rem 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.ms-mobile-link.is-active,
.ms-mobile-link:hover {
    color: #fff;
}

/* --- Buttons --- */
.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.ms-btn-sm {
    padding: 0.625rem 1.125rem;
    font-size: 0.9375rem;
}

.ms-btn-outline {
    color: #fff;
    background: transparent;
    border-color: #fff;
}

.ms-btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
}

.ms-btn-muted {
    border-color: var(--ms-border-soft);
    color: rgba(255, 255, 255, 0.88);
}

.ms-btn-muted:hover {
    border-color: rgba(255, 255, 255, 0.65);
}

.ms-btn-solid {
    color: #101010;
    background: #fff;
    border-color: #fff;
}

.ms-btn-solid:hover {
    background: #e5e5e5;
}

/* --- Hero --- */
.ms-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 0 5rem;
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    background: #000;
}

/* 湛蓝地球 + 横向滚动背景字样 */
.ms-hero-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ms-earth-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.ms-globe-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.ms-hero-marquee {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    opacity: 1;
}

.ms-hero-marquee-viewport {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--marquee-y, 32%);
    width: 100%;
    overflow: hidden;
    transform: translateY(-50%) translate3d(0, var(--marquee-parallax-y, 0), 0);
    mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000 10%,
        #000 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        90deg,
        transparent 0%,
        #000 10%,
        #000 90%,
        transparent 100%
    );
}

.ms-hero-marquee-track {
    display: flex;
    width: max-content;
    will-change: transform;
}

.ms-hero-marquee-segment {
    flex-shrink: 0;
    width: var(--segment-w, 100vw);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
    box-sizing: border-box;
}

.ms-marquee-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1.25rem, 3.5vw, 2.75rem);
    white-space: nowrap;
}

.ms-marquee-distort {
    position: relative;
    display: inline-block;
}

.ms-marquee-distort::after {
    content: '';
    position: absolute;
    inset: -6px -12px;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, 0.42) 2px,
        rgba(0, 0, 0, 0.42) 3px
    );
    pointer-events: none;
    mix-blend-mode: multiply;
    opacity: 0.55;
    z-index: 2;
}

.ms-marquee-text {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 11vw, 7.5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.03em;
    white-space: nowrap;
    user-select: none;
    color: rgba(255, 255, 255, 0.9);
    -webkit-text-stroke: 0;
    text-shadow:
        -3px 0 rgba(0, 220, 255, 0.38),
        3px 0 rgba(255, 40, 180, 0.28),
        0 0 40px rgba(0, 180, 255, 0.15);
}

.ms-char {
    display: inline-block;
    transform-origin: center center;
}

html:not(.perf-lite) .ms-char {
    will-change: transform, opacity;
}

.ms-char.is-hidden {
    opacity: 1 !important;
    visibility: visible;
}

.ms-char.is-warped {
    text-shadow:
        -4px 0 rgba(0, 255, 255, 0.55),
        4px 0 rgba(255, 50, 180, 0.45);
}

.ms-marquee-text::before,
.ms-marquee-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    color: transparent;
}

.ms-marquee-text::before {
    color: rgba(0, 255, 255, 0.32);
    transform: translateX(-4px);
    mix-blend-mode: screen;
    clip-path: inset(0 0 52% 0);
    animation: msGlitchTop 5s steps(1) infinite;
}

.ms-marquee-text::after {
    color: rgba(255, 60, 180, 0.28);
    transform: translateX(4px);
    mix-blend-mode: screen;
    clip-path: inset(48% 0 0 0);
    animation: msGlitchBottom 5s steps(1) infinite;
}

.ms-marquee-text--alt {
    font-family: var(--font-body);
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
    text-shadow:
        -2px 0 rgba(0, 200, 255, 0.32),
        2px 0 rgba(200, 80, 255, 0.22),
        0 0 32px rgba(0, 160, 255, 0.12);
}

@keyframes msGlitchTop {
    0%, 88%, 100% { transform: translateX(0); opacity: 0; }
    89% { transform: translateX(-6px); opacity: 0.85; }
    90% { transform: translateX(5px); opacity: 0.5; }
    91% { transform: translateX(-3px); opacity: 0.7; }
}

@keyframes msGlitchBottom {
    0%, 90%, 100% { transform: translateX(0); opacity: 0; }
    91% { transform: translateX(5px); opacity: 0.75; }
    92% { transform: translateX(-4px); opacity: 0.55; }
    93% { transform: translateX(2px); opacity: 0.65; }
}

/* Firefox / mobile / reduced-motion: lighter hero effects */
html.perf-lite .ms-marquee-text::before,
html.perf-lite .ms-marquee-text::after {
    animation: none !important;
    opacity: 0 !important;
}

html.perf-lite .ms-char.is-warped {
    text-shadow: inherit;
}

html.perf-lite .ms-cursor {
    display: none !important;
}

html.perf-lite .ms-hero-marquee {
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    .ms-hero-marquee-track {
        transform: none !important;
    }

    .ms-marquee-text,
    .ms-marquee-text::before,
    .ms-marquee-text::after {
        animation: none !important;
        filter: none !important;
    }

    .ms-cursor {
        display: none !important;
    }
}

.ms-hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.65;
    z-index: 3;
}

.ms-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.75rem;
    max-width: 62rem;
}

.ms-hero-kicker {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.01em;
}

.ms-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #fff;
}

.ms-hero-desc {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--ms-muted);
    max-width: 38rem;
}

.ms-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

/* --- Stats --- */
.ms-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 56rem;
}

#hero .ms-stat-grid {
    margin-top: 2.5rem;
    max-width: 62rem;
}

#hero .ms-stat-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
    .ms-stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }

    #hero .ms-stat-grid {
        margin-top: 3.5rem;
    }
}

.ms-stat-card {
    background: var(--ms-card);
    border: 1px solid var(--ms-border);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
}

.ms-stat-value {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 500;
    line-height: 1.1;
    color: #fff;
    margin-bottom: 0.5rem;
}

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

/* --- Section headers --- */
.ms-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.ms-section-head-stack {
    flex-direction: column;
    align-items: flex-start;
}

.ms-section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #fff;
    margin-bottom: 0.75rem;
}

.ms-section-desc {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--ms-muted);
    max-width: 62rem;
}

/* --- Cards --- */
.ms-card-grid {
    display: grid;
    gap: 1.5rem;
}

.ms-card-grid-2 {
    grid-template-columns: 1fr;
}

.ms-card-grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .ms-card-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ms-card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ms-card {
    background: var(--ms-card);
    border: 1px solid var(--ms-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.ms-card:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.ms-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.88);
}

.ms-card-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: #fff;
    margin-bottom: 0.5rem;
}

.ms-card-sub {
    font-size: 0.875rem;
    color: var(--ms-muted);
    margin-bottom: 0.75rem;
}

.ms-card-body {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--ms-muted);
    margin-bottom: 1rem;
}

.ms-card-link {
    font-size: 0.9375rem;
    color: #fff;
    text-decoration: none;
    opacity: 0.88;
    transition: opacity 0.2s ease;
}

.ms-card-link:hover {
    opacity: 1;
}

/* --- CTA --- */
.ms-cta-inner {
    text-align: center;
    max-width: 40rem;
}

.ms-cta-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.ms-cta-desc {
    font-size: 1.125rem;
    color: var(--ms-muted);
    line-height: 1.75;
    margin-bottom: 2rem;
}

/* --- Page header (inner pages) --- */
.ms-page-hero {
    padding-top: 5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--ms-border);
}

.ms-page-kicker {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--ms-muted);
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

.ms-page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.ms-page-desc {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--ms-muted);
    max-width: 42rem;
}

/* --- Footer --- */
.ms-footer {
    border-top: 1px solid var(--ms-border);
    padding: 3rem 0;
}

.ms-footer-copy {
    text-align: center;
    font-size: 0.875rem;
    color: var(--ms-muted);
    line-height: 1.6;
}

/* --- Forms --- */
.ms-input,
.ms-textarea {
    width: 100%;
    background: var(--ms-input);
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: #fff;
    outline: none;
    transition: border-color 0.2s ease;
}

.ms-input:focus,
.ms-textarea:focus {
    border-color: rgba(255, 255, 255, 0.35);
}

.ms-textarea {
    min-height: 8rem;
    resize: vertical;
}

.ms-label {
    display: block;
    font-size: 0.875rem;
    color: var(--ms-muted);
    margin-bottom: 0.5rem;
}

/* --- Prose --- */
.prose-content {
    color: var(--ms-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.prose-content h1, .prose-content h2, .prose-content h3,
.prose-content h4, .prose-content h5, .prose-content h6 {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 500;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.prose-content a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose-content blockquote {
    border-left: 3px solid var(--ms-border-soft);
    padding-left: 1rem;
    margin: 1.5em 0;
    color: #a3a3a3;
}

.prose-content code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15em 0.4em;
    border-radius: 0.25em;
    font-size: 0.9em;
}

.prose-content pre {
    background: var(--ms-card);
    border: 1px solid var(--ms-border);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Scroll reveal fallback --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Legacy class aliases (inner pages) --- */
.text-section-desc,
.text-body-sm,
.text-lead {
    color: var(--ms-muted);
}

.text-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

.page-header {
    padding-top: 5rem;
    padding-bottom: 3rem;
}

.section-block {
    padding-top: var(--ms-section-y);
    padding-bottom: var(--ms-section-y);
}

@media (max-width: 768px) {
    .ms-hero {
        min-height: auto;
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .ms-hero-marquee-viewport {
        mask-image: linear-gradient(
            90deg,
            transparent 0%,
            #000 6%,
            #000 94%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            90deg,
            transparent 0%,
            #000 6%,
            #000 94%,
            transparent 100%
        );
    }

    .ms-marquee-text {
        font-size: clamp(2.25rem, 14vw, 3.25rem);
    }

    .ms-marquee-text--alt {
        font-size: clamp(1.85rem, 11vw, 2.75rem);
        letter-spacing: 0.02em;
    }

    .ms-marquee-distort::after {
        opacity: 0.35;
    }

    .ms-section-cta {
        padding-top: 5rem;
        padding-bottom: 6rem;
    }
}
