/* 全局样式 */
@import './fonts.css';

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

/* 全局变量与断点 */
:root {
    --bp-lg: 1200px;
    --bp-md: 980px;
    --bp-sm: 640px;
    --base-font-size: 16px;
    --space-sm: 8px;
    --space-md: 16px;
    --container-padding: 24px;
}

body {
    font-family: 'Alibaba PuHuiTi', 'Alibaba PuHuiTi Subset', 'Noto Sans SC', sans-serif;
    background: linear-gradient(45deg, #729CA7,#D1D4D8);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

body.story-active .left-panel,
body.story-active .grid-view,
body.story-active .container {
    opacity: 0.08;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.story-active .left-panel {
    opacity: 1;
    pointer-events: all;
    z-index: 1510;
    transition: z-index 0s 0s;
}

body.story-active .top-link-btn {
    opacity: 0;
    pointer-events: all;
    z-index: 1520;
    animation: top-link-btn-reveal 0.45s ease forwards;
}

.container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: clamp(16px, 5vw, 80px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    z-index: 45;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 左侧面板 - 固定在左上角，始终可见 */
.left-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    pointer-events: all;
    transition: z-index 0s 0.45s;
}

.logo-section {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-areas:
        "logo title";
    column-gap: 16px;
    row-gap: 4px;
    align-items: start;
}

.logo-img {
    grid-area: logo;
    width: clamp(80px, 20vw, 360px);
    height: auto;
    object-fit: contain;
    transition: width 0.45s ease;
}

.platform-title {
    grid-area: title;
    font-size: clamp(20px, 3.6vw, 40px);
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 1px;
    line-height: 1.3;
    margin: clamp(12px, 3.5vw, 55px) 0 0 0;
    transition: font-size 0.45s ease, margin 0.45s ease;
}

body.zoomed-out .platform-content {
    max-height: 120px;
    opacity: 1;
    transform: translateY(0);
    margin-top: clamp(8px, 2.5vw, 40px);
}

/* 网格视图 - 全屏显示在后面 */
.grid-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 40;
    pointer-events: all;
}

#svg-container {
    width: 100%;
    height: 100%;
}

/* 右侧参数面板 */
.right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: opacity 0.3s ease;
    padding: clamp(12px, 2.5vw, 30px);
    margin-right: 5%;
}

.params-title {
    font-size: clamp(16px, 2.5vw, 30px);
    font-weight: 700;
    color: #fff;
    align-items: flex-start;
    width: 100%;
}

.divider {
    width: 100%;
    height: 1pt;
    background: #e8e8e8;
    margin:10px 0;
}

.params-card {
    display: flex;
    flex-direction: row;
    background: transparent;
    border-radius: 16px;
    margin-bottom: 20px;
    min-width: 0;
    width: 100%;
    font-size: clamp(16px, 2.5vw, 30px);
    font-weight: 700;
    text-align: center;
    gap: clamp(10px, 2.5vw, 80px);
}

.param-item {
    flex: 1;
    text-align: center;
}

.param-label {
    font-size: clamp(12px, 1.6vw, 20px);
    font-weight: 500;
    min-width: 100px;
    color: #777777;
}

.param-value {
    font-size: clamp(14px, 1.9vw, 30px);
    font-weight: 700;
    color: #00ffe1;
    margin-top: 15px;
}

.tooltip-container {
    position: fixed;
    background: #D1D4D8;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tooltip-container strong {
    color: #00ffe1;
    display: block;
    margin-bottom: 4px;
    font-size: clamp(12px, 1.5vw, 16px);
}

/* 初始量子比特弹窗 */
.qubit-popup {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

.qubit-popup.is-open {
    opacity: 1;
    pointer-events: all;
}

.qubit-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 12, 20, 0.54);
    backdrop-filter: blur(12px);
}

.qubit-popup__card {
    position: relative;
    width: min(640px, calc(100vw - 32px));
    max-height: min(82vh, 760px);
    overflow: auto;
    border-radius: 28px;
    padding: 28px 28px 24px;
    background: linear-gradient(135deg,#f9f8f7 50%, #d1d4d8 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    color: rgb(29, 29, 31);
    transform: translateY(14px) scale(0.96);
    transition: transform 0.26s ease, opacity 0.26s ease;
}

.qubit-popup.is-open .qubit-popup__card {
    transform: translateY(0) scale(1);
}

.qubit-popup__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgb(29, 29, 31);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.qubit-popup__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 224, 201, 0.14);
    color: #00695d;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.qubit-popup__title {
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.08;
    margin-bottom: 14px;
}

.qubit-popup__lead {
    font-size: clamp(14px, 2vw, 18px);
    line-height: 1.7;
    color: rgba(29, 29, 31, 0.84);
    margin-bottom: 22px;
}

.qubit-popup__section {
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    margin-top: 16px;
}

.qubit-popup__section h3 {
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00695d;
    margin-bottom: 12px;
}

.qubit-popup__section p,
.qubit-popup__section li {
    font-size: clamp(14px, 1.8vw, 17px);
    line-height: 1.7;
    color: rgba(29, 29, 31, 0.9);
}

.qubit-popup__section ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.qubit-popup__section li {
    position: relative;
    padding-left: 18px;
}

.qubit-popup__section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.8em;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #00695d;
    transform: translateY(-50%);
}

/* 顶部跳转按钮 */
.top-link-btn {
    position: fixed;
    top: 5%;
    right: 4%;
    color: white;
    padding: 0px 0 0px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(12px, 2.5vw, 28px);
    font-weight: 600;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    z-index: 998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes top-link-btn-reveal {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.top-link-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.top-link-btn-icon {
    width: 30px;
    height: auto;
    padding-top: 2px;
    transition: transform 0.3s ease;
}

/* 第二页内容 */
.story-page {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 4vw, 48px);
    background: linear-gradient(45deg, #729CA7,#D1D4D8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

body.story-active .left-panel .logo-img {
    width: clamp(100px, 20vw, 360px);
}

body.story-active .left-panel .platform-title {
    font-size: clamp(16px, 4vw, 40px);
}

@media (max-width: 980px) {
    body.story-active .left-panel {
        top: 14px;
        left: 14px;
    }

    body.story-active .left-panel .logo-img {
        width: 120px;
    }

    body.story-active .left-panel .platform-title {
        margin-top: 10px;
        font-size: 16px;
    }
}

.story-page.active {
    opacity: 1;
    pointer-events: all;
}

.story-page-inner {
    width: 100%;
    color: #fff;
}


/* Hero 风格（第二页） */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Alibaba PuHuiTi', 'Alibaba PuHuiTi Subset','Noto Sans SC', sans-serif;
}

.hero-content {
    text-align: center;
    max-width: 90%;
    padding: 48px 24px;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease 0.08s, transform 0.55s ease 0.08s;
}

.story-page.active .hero-content {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-size: clamp(30px, 6vw, 60px);
    line-height: 1.02;
    font-weight: 400;
    margin: 6px 0 28px 0;
    color: #ffffff;
    letter-spacing: 0.09em;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease 0.18s, transform 0.45s ease 0.18s;
}

.story-page.active .hero-title {
    opacity: 1;
    transform: translateY(0);
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.story-card {
    min-height: 260px;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(12px);
}

.story-card-kicker {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.16em;
    color: #00bea7;
    margin-bottom: 18px;
}

.story-card h2 {
    font-size: 28px;
    margin-bottom: 14px;
}

.story-card p {
    font-size: 17px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
}

.story-card-accent {
    background: linear-gradient(160deg, rgba(0, 190, 167, 0.24), rgba(255, 255, 255, 0.08));
}

.story-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
    padding: 14px 22px;
    border-radius: 999px;
    background: #00bea7;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(0, 190, 167, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 190, 167, 0.42);
}

@media (max-width: 980px) {
    .story-page {
        padding: 24px;
    }

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

    .story-card {
        min-height: auto;
    }
}

/* CTA 样式 */
.hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 27px;
    padding: 20px 38px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    font-size: 28px;
    font-weight: 600;
    box-shadow: 0 12px 30px rgba(255, 255, 255, 0.5);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition:
        opacity 0.45s ease 0.3s,
        transform 0.45s ease 0.3s,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.story-page.active .hero-cta {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-cta:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.18);
}

.hero-cta-icon {
    width: 60px;
    margin-right: -8px;
    height: auto;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
}

@media (max-width: 980px) {
    .hero-title { font-size: clamp(26px, 8vw, 46px); }
    .hero-cta { font-size: 18px; padding: 14px 22px; }
}



/* 左侧中部页面指示条 */
.page-indicator {
    position: fixed;
    left: clamp(10px, 2vw, 24px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 1600;
    pointer-events: auto;
}

.page-indicator-item {
    width: 30px;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.page-indicator-item:hover {
    transform: scale(1.08);
}

.page-indicator-shape {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    transition:
        height 0.32s ease,
        width 0.32s ease,
        background-color 0.32s ease,
        box-shadow 0.32s ease,
        transform 0.32s ease,
        opacity 0.32s ease;
    transform-origin: center center;
}

.page-indicator-item.is-active .page-indicator-shape {
    width: 4px;
    height: 32px;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.page-indicator-item:not(.is-active) .page-indicator-shape {
    opacity: 0.78;
}

body.stage-0 .page-indicator-item[data-stage="0"],
body.stage-1 .page-indicator-item[data-stage="1"],
body.stage-2 .page-indicator-item[data-stage="2"] {
    opacity: 1;
}

body.stage-0 .page-indicator-item[data-stage="0"] .page-indicator-shape,
body.stage-1 .page-indicator-item[data-stage="1"] .page-indicator-shape,
body.stage-2 .page-indicator-item[data-stage="2"] .page-indicator-shape {
    width: 4px;
    height: 60px;
    opacity: 1;
}

body.stage-0 .page-indicator-item:not([data-stage="0"]) .page-indicator-shape,
body.stage-1 .page-indicator-item:not([data-stage="1"]) .page-indicator-shape,
body.stage-2 .page-indicator-item:not([data-stage="2"]) .page-indicator-shape {
    width: 6px;
    height: 6px;
}

.page-indicator-item:focus-visible {
    outline: none;
}

.page-indicator-item:focus-visible .page-indicator-shape {
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12);
}

body.story-active .page-indicator {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive tweaks for small screens */
@media (max-width: 640px) {
    :root {
        --page-padding: 16px;
    }

    body {
        overflow: hidden; /* 保持隐藏，避免双滚动条 */
    }

    .container {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        height: auto;
        max-height: 38vh;
        padding: 16px var(--page-padding);
        justify-content: center;
        pointer-events: none;
        background: linear-gradient(to top, rgba(0,0,0,0.35), transparent);
    }

    .right-panel {
        width: 100%;
        max-width: 400px;
        pointer-events: all;
    }

    .logo-img {
        width: clamp(52px, 18vw, 160px);
    }

    .platform-title {
        font-size: clamp(14px, 4vw, 20px);
        margin-top: 8px;
    }

    .params-card {
        flex-direction: row;
        gap: clamp(8px, 3vw, 24px);
        font-size: clamp(14px, 3.5vw, 18px);
        margin-bottom: 12px;
    }

    .param-item {
        flex: 1;
    }

    .param-label {
        font-size: clamp(11px, 2.8vw, 14px);
        min-width: auto;
    }

    .param-value {
        font-size: clamp(13px, 3.2vw, 18px);
        margin-top: 6px;
    }

    .params-title {
        font-size: clamp(13px, 3.2vw, 16px);
    }

    .top-link-btn {
        right: 4%;
        top: 12px;
        padding: 6px 10px;
        font-size: 14px;
    }

    /* 竖屏下页面指示器移到右上角水平排列 */
    .page-indicator {
        left: auto;
        right: clamp(80px, 22vw, 140px);
        top: 14px;
        transform: none;
        flex-direction: row;
        gap: 10px;
    }

    .page-indicator-item {
        width: 24px;
        height: 24px;
    }

    /* 竖屏下激活态为水平条 */
    body.stage-0 .page-indicator-item[data-stage="0"] .page-indicator-shape,
    body.stage-1 .page-indicator-item[data-stage="1"] .page-indicator-shape,
    body.stage-2 .page-indicator-item[data-stage="2"] .page-indicator-shape {
        width: 24px;
        height: 4px;
    }

    /* story-page 移动端适配 */
    .hero-content {
        padding: 24px 16px;
    }

    .hero-title {
        font-size: clamp(22px, 7vw, 36px);
        letter-spacing: 0.04em;
    }

    .hero-cta {
        font-size: 16px;
        padding: 12px 24px;
    }

    .hero-cta-icon {
        width: 36px;
    }

    /* 弹窗移动端适配 */
    .qubit-popup__card {
        border-radius: 20px;
        padding: 20px 18px 18px;
        max-height: 85vh;
    }

    .qubit-popup__title {
        font-size: clamp(20px, 5.5vw, 28px);
    }

    .qubit-popup__lead {
        font-size: 14px;
    }

    .qubit-popup__section p,
    .qubit-popup__section li {
        font-size: 14px;
    }

    /* When drawer is open, reduce visible grid area to avoid being covered by bottom sheet */
    body.drawer-open .grid-view {
        bottom: 60vh; /* same as .drawer height */
        height: calc(100% - 60vh);
    }

    body.drawer-open #svg-container {
        height: 100%;
    }
}
