/* =============================================================================
   ByCode8 public site styles (homepage additions + standalone public pages)
   Loaded after landing.css, so it can reuse the same design tokens.
   ============================================================================= */

.public-main {
    padding-top: 64px;
    min-height: calc(100vh - 64px);
}

/* 首页 Hero 自己处理 fixed navbar 的顶部间距，避免叠加 64px */
.public-main-home {
    padding-top: 0;
}

/* 文档页的 .docs-wrapper 自带 100px 顶部留白，主区域不再叠加 */
.public-main-docs {
    padding-top: 0;
}

.nav-menu a.active {
    color: var(--accent-light);
}

.nav-menu a.active::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    margin-top: 4px;
    border-radius: 2px;
    background: var(--gradient-1);
}

/* ---------- generic page shell ---------- */
.page-shell {
    padding: 64px 0 80px;
}

.page-hero {
    padding: 64px 0 40px;
    background: var(--gradient-hero);
}

.page-hero h1 {
    font-size: 2.35rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.page-hero p {
    max-width: 760px;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
}

.page-hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--accent-light);
    font-size: 0.82rem;
    font-weight: 600;
}

.section-more {
    margin-top: 28px;
    text-align: center;
}

.section-more a {
    color: var(--accent-light);
    font-weight: 600;
}

/* ---------- ads ---------- */
.ad-strip {
    padding: 12px 0 0;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.ad-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: 26px 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
}

/* 网格底纹：去掉图片后给卡片补一点技术感 */
.ad-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.85), transparent 68%);
    mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.85), transparent 68%);
    pointer-events: none;
}

/* 右上角光晕 */
.ad-card::after {
    content: "";
    position: absolute;
    top: -70px;
    right: -40px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.28), transparent 68%);
    pointer-events: none;
}

.ad-card > * {
    position: relative;
    z-index: 1;
}

.ad-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

.ad-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.ad-card.is-featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
    padding: 32px 36px;
}

.ad-card.is-featured .ad-title {
    font-size: 1.55rem;
}

.ad-card.is-featured .ad-subtitle {
    max-width: 54ch;
}

.ad-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.ad-badge {
    align-self: flex-start;
    padding: 4px 12px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-light);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ad-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    line-height: 1.35;
}

.ad-subtitle {
    margin: 0;
    max-width: 46ch;
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.7;
}

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--accent-light);
    font-size: 0.9rem;
    font-weight: 600;
}

.ad-arrow {
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-arrow {
    transform: translateX(4px);
}

/* 通栏卡片右侧的流程示意，全部由 div / span 组成 */
.ad-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.ad-flow-step {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.ad-flow-step.is-accent {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.16);
    color: var(--accent-light);
}

.ad-flow-arrow {
    color: var(--text-muted);
    font-style: normal;
}

.ad-side {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.ad-side img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- homepage news ---------- */
.news-home-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.news-home-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
}

.news-home-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
}

.news-home-card .news-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.news-home-card h3 {
    margin-bottom: 10px;
    font-size: 1.08rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.news-home-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-home-card .read-more {
    margin-top: auto;
    padding-top: 16px;
    color: var(--accent-light);
    font-size: 0.84rem;
    font-weight: 600;
}

.news-tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-light);
    font-size: 0.74rem;
    font-weight: 600;
}

.news-tag.is-top {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

/* ---------- friend links ---------- */
.link-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.link-cloud a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.88rem;
    transition: var(--transition);
}

.link-cloud a:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

/* ---------- news index page ---------- */
.news-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}

.news-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
}

.news-filter a {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-card);
    font-size: 0.86rem;
    transition: var(--transition);
}

.news-filter a:hover,
.news-filter a.active {
    color: #ffffff;
    border-color: transparent;
    background: var(--gradient-1);
}

.news-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.news-list-card {
    display: flex;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    transition: var(--transition);
}

.news-list-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.news-list-card h2 {
    margin: 12px 0 8px;
    font-size: 1.05rem;
    line-height: 1.55;
}

.news-list-card h2 a {
    color: var(--text-primary);
}

.news-list-card h2 a:hover {
    color: var(--accent-light);
}

.news-list-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.news-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.sidebar-card h3 {
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.sidebar-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.75;
}

.sidebar-card .btn {
    margin-top: 14px;
    width: 100%;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.86rem;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.pagination .current {
    border-color: transparent;
    background: var(--gradient-1);
    color: #ffffff;
}

/* ---------- article ---------- */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 32px;
    align-items: start;
}

.article-card {
    padding: 34px 38px 42px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.article-card h1 {
    margin-bottom: 16px;
    font-size: 1.75rem;
    line-height: 1.45;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.article-summary {
    margin: 22px 0 0;
    padding: 14px 18px;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.8;
}

.article-content {
    margin-top: 26px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.95;
}

.article-content p {
    margin: 0 0 16px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 26px 0 12px;
    color: var(--text-primary);
}

.article-content strong {
    color: var(--text-primary);
}

.article-content a {
    color: var(--accent-light);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.article-content blockquote {
    margin: 0 0 16px;
    padding: 12px 18px;
    border-left: 3px solid var(--border-color);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
}

.article-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.article-nav a {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
}

.article-nav a:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.article-nav span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.74rem;
}

/* ---------- single page ---------- */
.single-page-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 38px 42px 46px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.single-page-cover {
    display: block;
    width: 100%;
    margin-bottom: 28px;
    border-radius: var(--radius);
}

.single-page-card h1 {
    margin-bottom: 12px;
    font-size: 1.9rem;
}

.single-page-card .subtitle {
    margin-bottom: 26px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---------- guestbook ---------- */
.guestbook-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 28px;
    align-items: start;
}

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

.form-card h2 {
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.form-card .form-hint {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.7;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
    min-height: 130px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.checkbox-row input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.form-message {
    margin-bottom: 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    line-height: 1.6;
}

.form-message.ok {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.form-message.error {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message-card {
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

.message-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.message-head strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.message-head span {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.message-subject {
    margin-bottom: 8px;
    color: var(--accent-light);
    font-size: 0.86rem;
    font-weight: 600;
}

.message-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-reply {
    margin-top: 14px;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: rgba(139, 92, 246, 0.08);
}

.message-reply strong {
    display: block;
    margin-bottom: 6px;
    color: var(--accent-light);
    font-size: 0.8rem;
}

.message-reply div {
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.empty-state {
    padding: 56px 20px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
}

.empty-state .icon {
    display: block;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

/* ---------- guestbook account state ---------- */
.guestbook-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(139, 92, 246, 0.07);
}

.guestbook-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gradient-1);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.guestbook-identity-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.guestbook-identity-text strong {
    color: var(--text-primary);
    font-size: 0.94rem;
}

.guestbook-identity-text span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guestbook-identity-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 0.74rem;
    font-weight: 600;
}

.guestbook-login-card {
    text-align: center;
}

.guestbook-lock {
    margin-bottom: 12px;
    font-size: 2rem;
}

.guestbook-login-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.7;
}

.message-user-tag {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
    .news-home-grid,
    .news-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-page-layout,
    .article-layout,
    .guestbook-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .news-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .ad-card.is-featured {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .ad-flow {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 42px 0 56px;
    }

    .page-hero {
        padding: 44px 0 28px;
    }

    .page-hero h1,
    .single-page-card h1 {
        font-size: 1.65rem;
    }

    .news-home-grid,
    .news-list,
    .news-sidebar,
    .form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-card,
    .single-page-card,
    .form-card {
        padding: 24px 20px 30px;
    }

    .article-nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .ad-card,
    .ad-card.is-featured {
        padding: 22px 20px;
        gap: 12px;
    }

    .ad-card.is-featured .ad-title {
        font-size: 1.32rem;
    }

    .ad-flow {
        gap: 8px;
    }

    .ad-flow-step {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

/* =============================================================================
   Hero background: ER-model tech artwork
   ============================================================================= */

.hero {
    display: flex;
    align-items: center;
    min-height: 780px;
    padding: 150px 0 110px;
    background: #05070f;
    isolation: isolate;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/res/images/hero/er-tech-bg.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 1;
    filter: brightness(1.1) saturate(1.15);
    transform: scale(1.02);
    pointer-events: none;
}

.hero-grid {
    position: absolute;
    inset: -18% -12% -34%;
    z-index: 0;
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.24) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.24) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 70%);
    transform: perspective(620px) rotateX(58deg) translateY(13%);
    opacity: 0.55;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}

.hero-er-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.er-lines-base path {
    fill: none;
    stroke: #8b5cf6;
    stroke-width: 2.4;
    stroke-opacity: 0.42;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.55));
}

.er-current path {
    fill: none;
    stroke: #a5f3fc;
    stroke-width: 3.6;
    stroke-linecap: round;
    stroke-dasharray: 8 92;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 5px rgba(103, 232, 249, 0.95)) drop-shadow(0 0 12px rgba(34, 211, 238, 0.55));
    animation: erCurrentRun 4s linear infinite;
    will-change: stroke-dashoffset;
}

.er-current path:nth-child(2) {
    animation-duration: 5.4s;
    animation-delay: -1.2s;
}

.er-current path:nth-child(3) {
    animation-duration: 4.8s;
    animation-delay: -2.4s;
}

.er-current path:nth-child(4) {
    animation-duration: 6.2s;
    animation-delay: -3.1s;
}

.er-sparks circle {
    fill: #bae6fd;
    filter: drop-shadow(0 0 5px #67e8f9) drop-shadow(0 0 10px rgba(34, 211, 238, 0.8));
}

.er-nodes circle {
    fill: #a5f3fc;
    opacity: 0.8;
    animation: erNodePulse 2.4s ease-in-out infinite;
}

.er-nodes circle:nth-child(2) { animation-delay: -0.4s; }
.er-nodes circle:nth-child(3) { animation-delay: -0.9s; }
.er-nodes circle:nth-child(4) { animation-delay: -1.3s; }
.er-nodes circle:nth-child(5) { animation-delay: -1.8s; }

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(5, 7, 15, 0.01) 0%, rgba(5, 7, 15, 0.28) 56%, rgba(5, 7, 15, 0.76) 100%),
        linear-gradient(180deg, rgba(5, 7, 15, 0.7) 0%, rgba(5, 7, 15, 0.2) 42%, #0a0e1a 100%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(115deg, transparent 35%, rgba(96, 165, 250, 0.07) 48%, rgba(139, 92, 246, 0.1) 50%, transparent 63%);
    background-size: 220% 100%;
    animation: heroSweep 9s ease-in-out infinite;
    pointer-events: none;
}

.hero .container {
    width: 100%;
    z-index: 2;
}

.hero h1,
.hero p,
.hero-badge,
.hero-actions {
    position: relative;
    z-index: 2;
}

.hero h1 {
    text-shadow: 0 4px 30px rgba(5, 7, 15, 0.7);
}

.hero p {
    text-shadow: 0 2px 16px rgba(5, 7, 15, 0.85);
}

.hero-flow {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    margin-top: 46px;
    padding: 10px 18px;
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 999px;
    background: rgba(10, 14, 26, 0.45);
    box-shadow: 0 12px 40px rgba(5, 7, 15, 0.45);
    color: var(--text-secondary);
    font-size: 0.82rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hero-flow span {
    white-space: nowrap;
}

.hero-flow i {
    color: var(--accent-light);
    font-style: normal;
    opacity: 0.8;
}

:root[data-theme="light"] .hero {
    background: #f8fafc;
}

:root[data-theme="light"] .hero-bg {
    opacity: 0.46;
    filter: saturate(1.1) brightness(1.18);
}

:root[data-theme="light"] .hero::before {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(248, 250, 252, 0.12) 0%, rgba(248, 250, 252, 0.5) 58%, rgba(248, 250, 252, 0.88) 100%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.48) 0%, rgba(248, 250, 252, 0.68) 42%, #f8fafc 100%);
}

:root[data-theme="light"] .hero-grid {
    opacity: 0.35;
}

:root[data-theme="light"] .hero::after {
    opacity: 0.6;
}

:root[data-theme="light"] .hero h1,
:root[data-theme="light"] .hero p {
    text-shadow: none;
}

:root[data-theme="light"] .hero-flow {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .hero-er-lines {
    opacity: 0.8;
}

:root[data-theme="light"] .er-lines-base path {
    stroke: #7c3aed;
    stroke-opacity: 0.28;
}

:root[data-theme="light"] .er-current path {
    stroke: #0891b2;
}

:root[data-theme="light"] .er-sparks circle {
    fill: #0e7490;
}

:root[data-theme="light"] .er-nodes circle {
    fill: #7c3aed;
}

@keyframes erCurrentRun {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -100; }
}

@keyframes erNodePulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 1; }
}

@keyframes gridMove {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 64px, 64px 0; }
}

@keyframes heroSweep {
    0%, 100% { background-position: 130% 0; opacity: 0; }
    40% { opacity: 1; }
    70% { background-position: -30% 0; opacity: 0; }
}

@media (max-width: 768px) {
    .hero {
        min-height: 0;
        padding: 118px 0 76px;
    }

    .hero-bg {
        opacity: 0.62;
        background-position: 62% center;
    }

    .hero-grid {
        opacity: 0.4;
    }

    .hero-er-lines {
        opacity: 0.58;
    }

    .hero-flow {
        margin-top: 34px;
        font-size: 0.74rem;
    }
}

@media (max-width: 480px) {
    .navbar .logo {
        gap: 8px;
        font-size: 1.1rem;
    }

    .navbar .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-actions .btn-outline {
        display: none;
    }

    .nav-actions .btn-primary {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .nav-actions .theme-toggle {
        width: 34px;
        height: 34px;
    }

    .hero {
        padding: 100px 0 64px;
    }

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

    .hero p {
        font-size: 0.95rem;
    }

    .hero-actions {
        gap: 10px;
    }

    .hero-actions .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .hero-flow {
        width: 100%;
        justify-content: center;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-bg,
    .hero-grid,
    .hero::after {
        animation: none;
    }

    .hero-er-lines .er-current path,
    .hero-er-lines .er-nodes circle {
        animation: none;
    }

    .hero-er-lines .er-sparks {
        display: none;
    }
}

/* =============================================================================
   Hero split layout: text left, ER model visual right
   ============================================================================= */

.hero {
    display: flex;
    align-items: center;
    min-height: 760px;
    padding: 132px 0 96px;
    background: #05070f;
    text-align: left;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 78% 42%, rgba(99, 102, 241, 0.18), transparent 38%),
        radial-gradient(circle at 12% 18%, rgba(139, 92, 246, 0.12), transparent 42%),
        #05070f;
    pointer-events: none;
}

.hero .container {
    width: 100%;
    z-index: 2;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    gap: 56px;
    align-items: center;
}

.hero-copy {
    min-width: 0;
    text-align: left;
}

.hero h1 {
    font-size: 3.15rem;
    line-height: 1.18;
    margin-bottom: 22px;
}

.hero p {
    max-width: 580px;
    margin: 0 0 32px;
    font-size: 1.08rem;
    line-height: 1.8;
    text-align: left;
}

.hero-badge {
    margin-bottom: 22px;
}

.hero-actions {
    justify-content: flex-start;
}

.hero-flow {
    margin-top: 34px;
}

.hero-visual {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
    margin-left: auto;
}

.hero-visual-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 20px;
    background: #05070f;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 0 70px rgba(99, 102, 241, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hero-model-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.12) saturate(1.15);
}

.hero-visual-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(5, 7, 15, 0.04) 0%, rgba(5, 7, 15, 0.22) 55%, rgba(5, 7, 15, 0.72) 100%),
        radial-gradient(ellipse at center, transparent 45%, rgba(5, 7, 15, 0.45) 100%);
    pointer-events: none;
}

.hero-visual-frame .hero-er-lines {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
}

.hero-visual-label {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 999px;
    background: rgba(8, 12, 24, 0.7);
    color: #c4b5fd;
    font-family: Consolas, "Microsoft YaHei", sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-visual-label .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.9);
    animation: erNodePulse 2s ease-in-out infinite;
}

.hero-visual-caption {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 13px;
    border-left: 2px solid var(--accent);
    border-radius: 0 8px 8px 0;
    background: rgba(8, 12, 24, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-visual-caption strong {
    color: #f8fafc;
    font-size: 0.82rem;
}

.hero-visual-caption span {
    color: #94a3b8;
    font-size: 0.72rem;
}

:root[data-theme="light"] .hero {
    background: #f8fafc;
}

:root[data-theme="light"] .hero::before {
    background:
        radial-gradient(circle at 78% 42%, rgba(139, 92, 246, 0.12), transparent 38%),
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.08), transparent 42%),
        #f8fafc;
}

:root[data-theme="light"] .hero-visual-frame {
    border-color: rgba(124, 58, 237, 0.25);
    box-shadow:
        0 30px 80px rgba(15, 23, 42, 0.16),
        0 0 60px rgba(124, 58, 237, 0.1);
}

:root[data-theme="light"] .hero-visual-label {
    background: rgba(255, 255, 255, 0.72);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.25);
}

:root[data-theme="light"] .hero-visual-caption {
    background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .hero-visual-caption strong {
    color: #0f172a;
}

:root[data-theme="light"] .hero-visual-caption span {
    color: #475569;
}

@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 42px;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero-visual {
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 0;
        padding: 110px 0 64px;
    }

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

    .hero p {
        font-size: 1rem;
    }

    .hero-actions {
        gap: 12px;
    }

    .hero-flow {
        margin-top: 28px;
    }

    .hero-visual-frame {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .hero-visual-label {
        top: 10px;
        left: 10px;
        font-size: 0.62rem;
    }

    .hero-visual-caption {
        left: 10px;
        bottom: 10px;
        padding: 7px 10px;
    }
}

/* Unboxed ER model visual: no card, just the artwork floating on the hero */
.hero-visual {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    aspect-ratio: 1000 / 820;
    background: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 62%, rgba(0, 0, 0, 0.86) 80%, transparent 100%);
    mask-image: radial-gradient(ellipse at 50% 50%, #000 62%, rgba(0, 0, 0, 0.86) 80%, transparent 100%);
}

.hero-model-image {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.08) saturate(1.1);
    pointer-events: none;
}

.hero-visual .hero-er-lines {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
}

@media (max-width: 1024px) {
    .hero-visual {
        max-width: 720px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .hero-visual {
        max-width: 100%;
    }
}

/* CTA buttons are centered, unlike the left-aligned hero actions */
.cta-box .hero-actions {
    justify-content: center;
}

/* ICP filing link in the shared footer */
.footer-bottom .footer-icp {
    color: inherit;
    text-decoration: none;
}

.footer-bottom .footer-icp:hover {
    color: var(--accent-light);
    text-decoration: underline;
}
