/* =========================================
   1. Topic page shell
========================================= */
.topic-page-shell {
    min-height: 100vh;
    background-color: #fcfcfc;
    color: #2a241e;
}

/* Topic 页内容区域 */
.topic-main {
    height: calc(100vh - 90px);
    overflow: hidden;
    position: relative;
}

/* =========================================
   2. 导航栏：强制恢复主站风格
========================================= */
.topic-page-shell .site-header,
.topic-page-shell .top-nav,
.topic-page-shell .top-nav a,
.topic-page-shell .lang-wrap,
.topic-page-shell .lang-switch,
.topic-page-shell .lang-current {
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Noto Sans SC", sans-serif;
}

.topic-page-shell .top-nav {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 300;
}

/* =========================================
   3. 整体舞台：允许中部重叠
========================================= */
.layout-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: visible;
}

/* =========================================
   4. 左侧文字区域
   占视觉宽度约 60%，并向中部伸出
========================================= */
.text-panel {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;

    width: 60%;
    padding-left: 21vw;
    padding-right: 4vw;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;

    font-family: Georgia, "Noto Serif SC",  "Times New Roman", serif;
}

#story-title,
#story-content {
    opacity: 1;
    transition: opacity 0.8s ease;
}

.text-fade-out {
    opacity: 0 !important;
}

.quote-text {
    color: #5a5148;
    border-left: 1.5px solid #c9b8a6;
    padding-left: 14px;
    margin-top: 18px;
}

.text-panel h2,
#story-title {
    margin: 0 0 18px;
    color: #1f1b17;
    font-size: clamp(1.9rem, 2.6vw, 2.8rem);
    line-height: 1.06;
    font-weight: 500;
    letter-spacing: -0.02em;
    max-width: 500px;
}

.text-panel p,
#story-content {
    margin: 0;
    color: #5f5448;
    font-size: clamp(1rem, 1.15vw, 1.18rem);
    line-height: 1.9;
    max-width: 420px;
}

/* assets/topic/topic.css */

/* 针对引导性斜体字的样式 */
.intro-italic {
    display: block;      /* 确保它自成一行 */
    font-style: italic;
    color: #7c848d;      /* 颜色调浅一点，增加层次感 */
    margin-top: 8px;     /* 微调与上方文字的间距 */
}


/* =========================================
   5. 右侧 SVG 区域
   占视觉宽度约 55%，并向左进入中部
========================================= */
.svg-panel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;

    width: 55%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

/* 关键：
   让 SVG 本体显著放大，并略向左偏，
   解决“占位大但真正内容小”的问题
*/
.svg-panel svg {
    width: 125%;
    height: 125%;
    transform: translateX(-5%) scale(1.18);
    transform-origin: center center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.svg-panel:hover svg {
    transform: translateX(-5%) scale(1.24);
}

/* =========================================
   6. 呼吸信标（提示光标）
========================================= */
.hint-beacon {
    position: fixed;
    left: 0;
    top: 0;
    width: 60px;
    height: 60px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 1s ease;
    transform: translate(-50%, -50%);
}

.beacon-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    background-color: #8a959c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.82;
}

.beacon-outer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 52px;
    border: 1.5px solid #8a959c;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }
    80%, 100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* =========================================
   7. SVG 图层状态管理
========================================= */
#brain, #spine, #neuron {
    opacity: 0;
    transition: opacity 0.8s ease;
}

#left_arm_x5F_lift,
#right_leg_x5F_lift,
#heart, #lung {
    opacity: 0;
}

#left_arm, #right_leg,
#left_arm_x5F_lift, #right_leg_x5F_lift,
#heart, #lung, #outline {
    transition: opacity 2s ease-in-out;
}

.st-static {
    fill: none;
    stroke: #000;
    stroke-width: 4px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.shiver-layer {
    fill: none;
    stroke: #000;
    stroke-width: 5px;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: url(#electric-surge);
    mask: url(#shiver-mask);
    pointer-events: none;
}

.flow-line {
    fill: none !important;
    stroke: #000 !important;
    stroke-width: 2.5px !important;
    stroke-linecap: round !important;
    opacity: 0;
}

.active-heart { opacity: 1 !important; animation: heartbeat 1s infinite; }
.active-lung { opacity: 1 !important; animation: breathe 3s infinite ease-in-out; }
.anim-limb-default { animation: fadeDefault 1s infinite; }
.anim-limb-lift { animation: fadeLift 1s infinite; }

@keyframes heartbeat {
    0% { transform: scale(1); }
    34% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes fadeDefault {
    0% { opacity: 1; }
    34% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeLift {
    0% { opacity: 0; }
    34% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#heart {
    stroke-linejoin: round;
}

/* =========================================
   8. 响应式
========================================= */
@media (max-width: 1100px) {
    .text-panel {
        width: 58%;
        padding-left: 6vw;
        padding-right: 3vw;
    }

    .svg-panel {
        width: 58%;
    }

    .svg-panel svg {
        width: 130%;
        height: 130%;
        transform: translateX(-12%) scale(1.12);
    }
}

@media (max-width: 900px) {
    .topic-main {
        height: auto;
        min-height: calc(100vh - 90px);
        overflow: visible;
        padding-bottom: 40px;
    }

    .layout-container {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .text-panel,
    .svg-panel {
        position: static;
        transform: none;
        width: 100%;
        height: auto;
    }

    .text-panel {
        padding: 28px 24px 0;
    }

    .svg-panel {
        min-height: 52vh;
    }

    .svg-panel svg {
        width: 100%;
        height: auto;
        transform: scale(1.05);
    }
}

@media (max-width: 900px) {
  .topic-main {
    height: auto;
    min-height: calc(100vh - 90px);
    overflow: visible;
  }

  .layout-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: calc(100vh - 90px);
  }

  .text-panel {
    flex: none;
    width: 100%;
    padding: 28px 24px 20px;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .text-panel h2,
  #story-title {
    max-width: 100%;
    font-size: clamp(1.5rem, 6vw, 2.1rem);
    line-height: 1.12;
    margin-bottom: 14px;
  }

  .text-panel p,
  #story-content {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.8;
  }

  .quote-text {
    margin-top: 14px;
    padding-left: 12px;
  }

  .svg-panel {
    width: 100%;
    min-height: 52vh;
    padding: 0 8px 20px;
    overflow: hidden;
  }

  .svg-panel svg {
    width: 100%;
    height: auto;
    transform: scale(1);
    transform-origin: center center;
  }

  .svg-panel:hover svg {
    transform: scale(1);
  }

  .hint-beacon {
    width: 42px;
    height: 42px;
  }

  .beacon-inner {
    width: 10px;
    height: 10px;
  }

  .beacon-outer {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 560px) {
  .text-panel {
    padding: 22px 18px 16px;
  }

  .svg-panel {
    min-height: 46vh;
    padding: 0 4px 16px;
  }

  .text-panel h2,
  #story-title {
    font-size: 1.35rem;
  }

  .text-panel p,
  #story-content {
    font-size: 0.95rem;
    line-height: 1.75;
  }
}

@media (max-width: 640px) {
  .topic-page-shell .site-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  .topic-page-shell .top-nav {
    gap: 12px;
    font-size: 8px;
    letter-spacing: 0.12em;
    flex-wrap: wrap;
    justify-content: center;
  }

  .topic-page-shell .lang-wrap {
    margin-left: 10px;
    gap: 8px;
  }

  /* 手机版主舞台 */
  .topic-main {
    height: calc(100svh - 72px);
    min-height: calc(100svh - 72px);
    overflow: hidden;
    padding: 0;
    position: relative;
  }

  .layout-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
  }

  /* 文字区域：改成固定距离，而不是 top: 25% */
  .text-panel {
    position: absolute;
    top: 2.7rem;
    left: 0;
    width: 100%;
    padding: 0 24px;
    transform: none;
    z-index: 3;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .text-panel h2,
  #story-title {
    max-width: 92%;
    font-size: 1.35rem;
    line-height: 1.12;
    margin: 0 0 0.75rem;
  }

  .text-panel p,
  #story-content {
    max-width: 92%;
    font-size: 0.95rem;
    line-height: 1.72;
  }

  .quote-text {
    margin-top: 12px;
    padding-left: 10px;
  }

  /* SVG：不再 bottom 锚定，改成从上往下固定摆放 */
/* topic.css */

@media (max-width: 640px) {
  /* 1. 扩大 SVG 容器的高度，或者改为自适应 */
  .svg-panel {
    position: absolute;
    top: 19rem; 
    left: 0;
    width: 100%;
    height: 40vh; /* 将固定的 19rem 改为相对屏幕高度的 40vh 或更大 */
    min-height: 300px; /* 设定一个最小保证值 */
    overflow: visible; /* 允许溢出显示，防止切断 */
    z-index: 1;
    
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  /* 2. 调整 SVG 的缩放中心 */
  .svg-panel svg {
    width: 100%;
    height: auto;
    /* 如果缩放 1.8 倍导致切断，尝试减小缩放或调整位移 */
    transform: translateY(0) scale(1.7); 
    transform-origin: center top; 
  }
}

  .svg-panel:hover svg {
    transform: translateY(0) scale(1.8);
  }

  .svg-panel svg {
  -webkit-tap-highlight-color: transparent;
}

  .hint-beacon {
    width: 42px;
    height: 42px;
  }

  .beacon-inner {
    width: 10px;
    height: 10px;
  }

  .beacon-outer {
    width: 36px;
    height: 36px;
  }
}