body {
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1em 0;
}

/* 主模块容器 */
.m1, .m2 {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 800px;
    width: calc(100% - 2em);
    margin: .5em auto;
    background-color: #f8f9fa;
    color: #444444;
    border: 2px solid #a3b1f1;
    border-radius: 15px;
    padding: 15px;
    box-sizing: border-box;
    box-shadow: 0 8px 25px rgba(163, 177, 241, 0.3);
    font-size: 14px;
    line-height: 1.6;
}

/* 折叠面板 (蓝色) */
.det {
    margin-bottom: 12px;
    border: 1px solid #c5d0ff;
    border-radius: 8px;
    background: #ffffff;
    overflow: visible; /* 必须为visible，否则小窗口会被遮挡 */
}

summary {
    cursor: pointer;
    list-style: none;
    background: linear-gradient(to right, #eef2ff, #ffffff);
    padding: 12px 15px;
    font-weight: bold;
    color: #435ebe;
    display: flex;
    align-items: center;
    transition: background .3s;
}
summary::-webkit-details-marker { display: none; }
summary:hover { background: #dbe2ff; }
summary::before {
    content: '▶';
    margin-right: 8px;
    font-size: .8em;
    color: #7c8eeb;
    transition: transform .3s;
}
.det[open] > summary::before { transform: rotate(90deg); }

/* 林芷鱼状态标题高亮 */
summary.phl {
    background: #eef2ff;
    border-left: 4px solid #435ebe;
    color: #2c3e9c;
}
summary.phl::before { content: '👑'; font-size: 1em; color: inherit; }

.con { padding: 15px; border-top: 1px dashed #a3b1f1; }

/* 剧情与环境 */
.grd { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.itm {
    display: flex; align-items: baseline; background: #f5f7ff;
    padding: 8px 12px; border-radius: 6px; border-left: 3px solid #a3b1f1;
    font-size: .95em;
}
.itm .key { font-weight: bold; color: #435ebe; margin-right: 8px; flex-shrink: 0; }
.pap {
    background: rgba(255, 255, 255, 0.8); padding: 15px 18px; border-radius: 6px;
    box-shadow: 0 2px 8px rgba(163, 177, 241, 0.15); margin: 15px 0;
    border-left: 3px solid #7c8eeb; font-size: 1.05em; color: #333;
}
.dvi { height: 1px; background: linear-gradient(to right, transparent, #a3b1f1, transparent); margin: 15px 0; }

/* 状态指数 */
.cst { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 15px 0; }
.sti { font-size: .95em; font-weight: bold; color: #435ebe; background: #eef2ff; padding: 10px 12px; border-radius: 8px; border: 1px solid #dbe2ff; }
.dtx { display: block; font-size: .85em; color: #777; font-weight: normal; margin-top: 4px; }

/* ----------------------------------------------------------- */
/* --- 敏感带状态：竖长型弹出窗口逻辑 (模仿完美显示逻辑) --- */
/* ----------------------------------------------------------- */

.etz { text-align: center; color: #435ebe; font-size: .95em; margin: 20px 0 12px 0; font-weight: bold; letter-spacing: 1px; }

.etc {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 保持两列，方便点击 */
    gap: 15px 10px;
    justify-items: center;
    padding-bottom: 10px;
}

/* 核心：包裹层相对定位 */
.ebw {
    position: relative;
    display: block;
    width: 100%;
}

/* 标签样式 (蓝色) */
.tag {
    display: inline-block;
    width: 90%;
    padding: 8px 0;
    text-align: center;
    background: #ffffff;
    border: 1px solid #435ebe;
    color: #435ebe;
    border-radius: 20px;
    font-size: .9em;
    font-weight: bold;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 5px rgba(67, 94, 190, 0.1);
}

.ebw:hover .tag, .ebw:focus-within .tag {
    background: #435ebe;
    color: #ffffff;
    transform: translateY(-2px);
}

/* 竖长型小窗口 (高度 > 长度) */
.bub {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    /* 定位逻辑：在标签正上方 */
    bottom: 110%; 
    left: 50%;
    transform: translateX(-50%);
    
    /* 模仿长宽比：限制宽度使高度自然增加 */
    width: 180px; 
    min-height: 120px; /* 确保竖长感 */
    background: #ffffff;
    border: 2px solid #435ebe;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(67, 94, 190, 0.25);
    z-index: 999;
    transition: all 0.2s ease;
    pointer-events: none;
    word-wrap: break-word;
    text-align: left;
}

/* 气泡尖角 */
.bub::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #435ebe transparent transparent transparent;
}

/* 触发显示 */
.ebw:hover .bub, .ebw:focus-within .bub {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
    pointer-events: auto;
}

/* 窗口内文字 */
.bhd { font-weight: bold; color: #2c3e9c; border-bottom: 1px dashed #a3b1f1; padding-bottom: 6px; margin-bottom: 6px; font-size: 1.05em; }
.bst { font-size: 0.85em; color: #7c8eeb; font-weight: bold; margin-bottom: 6px; display: block; }
.bde { font-size: 0.9em; color: #555; line-height: 1.5; }

/* ----------------------------------------------------------- */

/* Action Area Title */
.m2 { counter-reset: option-counter; }
.m2 .act { 
    text-align: center; color: #435ebe; font-weight: bold;
    margin-top: 20px; margin-bottom: 15px; font-size: 1.1em;
    padding: 10px 0; border-top: 1px dashed #a3b1f1; border-bottom: 1px dashed #a3b1f1;
}

/* pre as button container, scoped to m2 */
.m2 pre {
    position: relative !important; margin: 12px 0 !important; overflow: hidden !important;
    border-radius: 12px !important; background: transparent !important; border: none !important;
    box-shadow: none !important; padding: 0 !important; min-height: 55px;
}
/* Hide header container's visual parts */
.m2 pre div[class*="border-b"] {
    position: absolute !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important; border: none !important;
    background: transparent !important; padding: 0 !important; margin: 0 !important;
    z-index: 2; pointer-events: none;
}
.m2 pre div[class*="border-b"] > div:first-child { display: none !important; }

/* Copy button transparent overlay */
.m2 pre div[data-tooltip-id] {
    position: absolute !important; top: 0; left: 0; width: 100% !important; height: 100% !important;
    margin: 0 !important; padding: 0 !important; display: block !important; cursor: pointer !important;
    background: transparent !important; border: none !important; pointer-events: auto; z-index: 3;
}
.m2 pre div[data-tooltip-id] .style_copyIcon__GJL9e { display: none !important; }

/* Code content area, styled as option button */
.m2 pre div[node="[object Object]"] {
    position: relative; z-index: 1; display: block !important; pointer-events: none;
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%) !important;
    border: 1px solid #a3b1f1 !important; 
    box-shadow: 0 4px 12px rgba(163, 177, 241, 0.2), inset 0 1px 0 rgba(255,255,255,0.8) !important;
    color: #444444 !important; font-family: "Kosugi Maru", sans-serif !important;
    font-size: 1.05em !important; padding: 15px 20px 15px 65px !important; 
    margin: 0 !important; border-radius: 12px !important; min-height: 55px;
    white-space: pre-wrap; word-break: break-word; transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1); 
    counter-increment: option-counter;
}

/* Option Letter (A, B, C...) */
.m2 pre div[node="[object Object]"]::before {
    content: counter(option-counter, upper-alpha); display: flex; align-items: center; justify-content: center;
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; background: linear-gradient(45deg, #7c8eeb 0%, #435ebe 100%); 
    color: #fff; border-radius: 50%; font-size: 1.1em; font-weight: bold;
    border: 2px solid rgba(255,255,255,0.8); box-shadow: 0 2px 6px rgba(67, 94, 190, 0.3); z-index: 2;
}
.m2 pre div[node="[object Object]"] code {
    display: block; color: inherit !important; background: transparent !important;
    padding: 0 !important; margin: 0 !important; font-family: inherit !important;
    font-size: inherit !important; white-space: pre-wrap;
}

/* Hover effect */
.m2 pre:hover div[node="[object Object]"] {
    transform: translateY(-4px); box-shadow: 0 8px 20px rgba(163, 177, 241, 0.3), inset 0 1px 0 rgba(255,255,255,0.9) !important; 
    background: linear-gradient(135deg, #eef2ff 0%, #dbe2ff 100%) !important; border-color: #7c8eeb !important; color: #2c3e9c !important;
}
/* Active effect (on press) */
.m2 pre:active div[node="[object Object]"] {
    transform: translateY(1px) !important; box-shadow: 0 1px 4px rgba(163, 177, 241, 0.2), inset 0 2px 4px rgba(0,0,0,0.05) !important; 
    background: linear-gradient(135deg, #dbe2ff 0%, #c5d0ff 100%) !important; border-color: #435ebe !important;
}

/* SELECT/COPIED Box Styling */
.m2 pre div[node="[object Object]"]::after {
    content: 'SELECT'; position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    padding: 6px 12px; background-color: rgba(67, 94, 190, 0.85); color: white; font-size: 0.8em;
    font-weight: bold; border-radius: 6px; opacity: 0; transition: all 0.2s ease-out; pointer-events: none; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); letter-spacing: 0.5px; border: 1px solid rgba(255, 255, 255, 0.3);
}
.m2 pre:hover div[node="[object Object]"]::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.m2 pre div[data-tooltip-id]:active + div[node="[object Object]"]::after {
    content: 'COPIED!'; background-color: #435ebe; opacity: 1; transform: translateY(-50%) translateX(0) scale(1.05); box-shadow: 0 3px 8px rgba(67, 94, 190, 0.4);
}

/* Click overlay hint */
.m2 pre div[data-tooltip-id]::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(45deg, rgba(67, 94, 190, 0.1), rgba(67, 94, 190, 0.1) 10px, rgba(124, 142, 235, 0.15) 10px, rgba(124, 142, 235, 0.15) 20px);
    display: flex; align-items: center; justify-content: center; color: white; font-size: 1.6em; font-weight: bold;
    opacity: 0; transition: opacity 0.1s; pointer-events: none; z-index: 4; border-radius: 12px; text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.m2 pre div[data-tooltip-id]:active::after { content: '✔ 已复制'; opacity: 1; }

/* 移动端适配：确保不溢出 */
@media (max-width: 600px) {
    .m1, .m2 { width: 100%; border-radius: 0; padding: 10px; }
    
    /* 手机端如果标签靠边，调整气泡不超出屏幕 */
    .bub {
        width: 160px; /* 手机端稍微缩窄，增加竖长感 */
        max-width: 45vw;
    }
}