/* ═══════ 思维链 · 封印 ═══════ */
@keyframes seal-pulse {
    0%, 100% { border-color: rgba(140, 120, 180, 0.2); box-shadow: 0 0 8px rgba(120, 90, 160, 0.06); }
    50% { border-color: rgba(140, 120, 180, 0.45); box-shadow: 0 0 16px rgba(120, 90, 160, 0.12); }
}
details.think-chain {
    background: linear-gradient(135deg, rgba(242, 238, 250, 0.98), rgba(235, 230, 245, 0.98));
    border: 1px solid rgba(140, 120, 180, 0.2);
    border-radius: 12px;
    margin: 6px 0 14px 0;
    overflow: hidden;
    animation: seal-pulse 4s ease-in-out infinite;
    position: relative;
}
details.think-chain::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, rgba(120, 90, 170, 0.3), rgba(120, 90, 170, 0.05));
    border-radius: 3px 0 0 3px;
}
details.think-chain::after {
    content: '⛓️';
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 0.75em;
    opacity: 0.3;
    pointer-events: none;
}
details.think-chain > summary {
    pointer-events: none;
    user-select: none;
    list-style: none;
    color: rgba(100, 80, 140, 0.4);
    padding: 11px 18px;
    font-size: 0.82em;
    letter-spacing: 1.5px;
    cursor: not-allowed;
}
details.think-chain > summary::-webkit-details-marker { display: none; }
details.think-chain > *:not(summary) { display: none !important; }

/* ═══════ 顶部状态栏 ═══════ */
@keyframes top-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.top-bar {
    background: linear-gradient(90deg, rgba(248, 246, 252, 0.98), rgba(252, 248, 250, 0.98), rgba(248, 246, 252, 0.98));
    border: 1px solid rgba(180, 160, 200, 0.25);
    border-radius: 10px;
    padding: 11px 18px;
    color: #2a2a3a;
    font-size: 0.87em;
    text-align: center;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}
.top-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: top-shimmer 6s ease-in-out infinite;
    pointer-events: none;
}

/* ═══════ 正文 ═══════ */
text {
    display: block;
    line-height: 1.9;
    color: #1a1a2a;
    padding: 6px 2px;
    font-size: 1em;
}
text p {
    text-indent: 2em;
    margin: 0.65em 0;
}

/* ═══════ 状态栏通用 ═══════ */
details.status {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(180, 180, 210, 0.3);
    border-radius: 12px;
    margin: 6px 0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    position: relative;
}
details.status::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    border-radius: 3px 0 0 3px;
    transition: opacity 0.3s;
}
details.status:hover {
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}
details.status > summary {
    padding: 12px 16px 12px 14px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9em;
    list-style: none;
    transition: all 0.25s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
details.status > summary::-webkit-details-marker { display: none; }
details.status > summary::before {
    content: '▸';
    color: rgba(130, 130, 170, 0.4);
    font-size: 0.8em;
    transition: all 0.3s ease;
    display: inline-block;
    margin-right: 4px;
    flex-shrink: 0;
}
details.status[open] > summary::before {
    content: '▾';
    color: rgba(130, 130, 170, 0.65);
}
details.status > summary:hover {
    background: rgba(0, 0, 0, 0.015);
}
details.status[open] > summary {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
details.status > .content {
    padding: 14px 18px;
    font-size: 0.86em;
    line-height: 1.85;
    white-space: pre-line;
    word-break: break-word;
    color: #2e2e48;
}

/* ═══════ 数值进度条 ═══════ */
.bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    white-space: nowrap;
}
.bar-label {
    font-size: 0.82em;
    font-weight: 700;
    min-width: 82px;
    color: #3a3a5a;
}
.bar-track {
    flex: 1;
    height: 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
.bar-track::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.15), transparent);
    pointer-events: none;
    border-radius: 8px 8px 0 0;
}
.bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s ease;
    position: relative;
}
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.25), transparent);
    border-radius: 8px 8px 0 0;
}
.hp-fill {
    background: linear-gradient(90deg, #48b860, #3aaa50);
    box-shadow: 0 0 8px rgba(60, 170, 80, 0.2);
}
.san-fill {
    background: linear-gradient(90deg, #4088d8, #50a0e8);
    box-shadow: 0 0 8px rgba(60, 130, 210, 0.2);
}
.cor-fill {
    background: linear-gradient(90deg, #9050c8, #b060d8);
    box-shadow: 0 0 8px rgba(150, 80, 200, 0.2);
}
.lust-fill {
    background: linear-gradient(90deg, #d06088, #e080a0);
    box-shadow: 0 0 8px rgba(210, 100, 140, 0.2);
}
.bar-val {
    font-size: 0.78em;
    font-weight: 700;
    color: #6a6a88;
    min-width: 52px;
    text-align: right;
}
@keyframes bar-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.hp-danger .hp-fill {
    background: linear-gradient(90deg, #d04040, #e06050) !important;
    box-shadow: 0 0 10px rgba(210, 60, 60, 0.3) !important;
    animation: bar-danger 1.2s ease-in-out infinite;
}
.san-danger .san-fill {
    background: linear-gradient(90deg, #d0a030, #e0b040) !important;
    box-shadow: 0 0 10px rgba(210, 160, 50, 0.3) !important;
    animation: bar-danger 1.5s ease-in-out infinite;
}
.cor-danger .cor-fill {
    background: linear-gradient(90deg, #c03060, #e04070) !important;
    box-shadow: 0 0 12px rgba(200, 50, 90, 0.35) !important;
    animation: bar-danger 1s ease-in-out infinite;
}

/* ═══════ 主角状态栏 ═══════ */
details.st-player {
    border-color: rgba(70, 120, 200, 0.2);
}
details.st-player::before {
    background: linear-gradient(to bottom, rgba(70, 120, 200, 0.6), rgba(70, 120, 200, 0.15));
}
details.st-player:hover {
    border-color: rgba(70, 120, 200, 0.35);
    box-shadow: 0 3px 16px rgba(70, 120, 200, 0.08);
}
details.st-player > summary {
    color: #2a4a78;
}
details.st-player[open] > summary {
    background: rgba(70, 120, 200, 0.03);
    border-bottom-color: rgba(70, 120, 200, 0.1);
}

/* ═══════ NPC状态栏 ═══════ */
details.st-npc {
    border-color: rgba(180, 100, 140, 0.2);
}
details.st-npc::before {
    background: linear-gradient(to bottom, rgba(180, 100, 140, 0.55), rgba(180, 100, 140, 0.12));
}
details.st-npc:hover {
    border-color: rgba(180, 100, 140, 0.35);
    box-shadow: 0 3px 16px rgba(180, 100, 140, 0.07);
}
details.st-npc > summary {
    color: #6a3050;
}
details.st-npc[open] > summary {
    background: rgba(180, 100, 140, 0.03);
    border-bottom-color: rgba(180, 100, 140, 0.1);
}

/* ═══════ 据点状态栏 ═══════ */
details.st-base {
    border-color: rgba(180, 140, 60, 0.22);
}
details.st-base::before {
    background: linear-gradient(to bottom, rgba(180, 140, 60, 0.55), rgba(180, 140, 60, 0.12));
}
details.st-base:hover {
    border-color: rgba(180, 140, 60, 0.38);
    box-shadow: 0 3px 16px rgba(180, 140, 60, 0.07);
}
details.st-base > summary {
    color: #6a5020;
}
details.st-base[open] > summary {
    background: rgba(180, 140, 60, 0.03);
    border-bottom-color: rgba(180, 140, 60, 0.1);
}

/* ═══════ 物资状态栏 ═══════ */
details.st-supply {
    border-color: rgba(60, 150, 80, 0.22);
}
details.st-supply::before {
    background: linear-gradient(to bottom, rgba(60, 150, 80, 0.55), rgba(60, 150, 80, 0.12));
}
details.st-supply:hover {
    border-color: rgba(60, 150, 80, 0.38);
    box-shadow: 0 3px 16px rgba(60, 150, 80, 0.07);
}
details.st-supply > summary {
    color: #1a5a2a;
}
details.st-supply[open] > summary {
    background: rgba(60, 150, 80, 0.03);
    border-bottom-color: rgba(60, 150, 80, 0.1);
}

/* ═══════ 推荐行动 ═══════ */
@keyframes action-glow {
    0%, 100% { border-color: rgba(60, 140, 75, 0.2); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03); }
    50% { border-color: rgba(60, 140, 75, 0.4); box-shadow: 0 2px 12px rgba(60, 140, 75, 0.06); }
}
.actions {
    background: linear-gradient(135deg, rgba(242, 252, 244, 0.96), rgba(238, 250, 240, 0.96));
    border: 1px solid rgba(60, 140, 75, 0.2);
    border-radius: 12px;
    padding: 14px 18px;
    margin: 6px 0;
    color: #1a4a28;
    font-size: 0.88em;
    line-height: 2.1;
    white-space: pre-line;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
    animation: action-glow 5s ease-in-out infinite;
    position: relative;
}
.actions::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, rgba(60, 150, 80, 0.5), rgba(60, 150, 80, 0.1));
    border-radius: 3px 0 0 3px;
}

/* ═══════ 记忆区 ═══════ */
details.memory {
    background: linear-gradient(135deg, rgba(250, 244, 255, 0.97), rgba(246, 240, 254, 0.97));
    border: 1px solid rgba(150, 110, 190, 0.22);
    border-radius: 12px;
    margin: 6px 0;
    overflow: hidden;
    box-shadow: 0 1px 8px rgba(120, 80, 160, 0.05);
    position: relative;
}
details.memory::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, rgba(140, 90, 190, 0.5), rgba(140, 90, 190, 0.08));
    border-radius: 3px 0 0 3px;
}
details.memory > summary {
    padding: 12px 16px;
    color: #4a3068;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9em;
    list-style: none;
    transition: all 0.25s ease;
    user-select: none;
}
details.memory > summary::-webkit-details-marker { display: none; }
details.memory > summary::before {
    content: '▸ ';
    color: rgba(130, 90, 170, 0.45);
    font-size: 0.8em;
}
details.memory[open] > summary::before {
    content: '▾ ';
    color: rgba(130, 90, 170, 0.65);
}
details.memory > summary:hover {
    background: rgba(140, 100, 180, 0.04);
}
details.memory[open] > summary {
    border-bottom: 1px solid rgba(150, 110, 190, 0.12);
    background: rgba(140, 100, 180, 0.03);
}
details.memory > .content {
    padding: 14px 16px;
    color: #3a2e50;
    font-size: 0.84em;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
details.memory > .content > p {
    color: #4a3068;
    font-weight: 700;
    font-size: 0.95em;
    margin: 14px 0 6px 0;
    text-indent: 0;
    letter-spacing: 0.5px;
}
details.memory > .content > p:first-child {
    margin-top: 2px;
}

/* ═══════ 记忆表格 ═══════ */
.mem-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84em;
    color: #2e2e48;
    margin: 4px 0 12px 0;
    min-width: 420px;
}
.mem-table th {
    background: rgba(230, 218, 248, 0.5);
    color: #3a2860;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid rgba(150, 110, 190, 0.2);
    font-weight: 700;
    font-size: 0.88em;
    white-space: nowrap;
}
.mem-table td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(180, 160, 210, 0.12);
    vertical-align: top;
    word-break: break-word;
}
.mem-table tr:nth-child(even) td {
    background: rgba(248, 242, 255, 0.4);
}
.mem-table tr:hover td {
    background: rgba(238, 228, 252, 0.3);
}

/* ═══════ 响应式 ═══════ */
@media screen and (max-width: 480px) {
    details.status > .content,
    details.memory > .content {
        padding: 10px 12px;
        font-size: 0.83em;
    }
    .bar-label {
        min-width: 70px;
        font-size: 0.75em;
    }
    .bar-track {
        height: 13px;
    }
    .bar-val {
        font-size: 0.72em;
        min-width: 44px;
    }
    .mem-table {
        font-size: 0.78em;
        min-width: 360px;
    }
    .mem-table th, .mem-table td {
        padding: 5px 7px;
    }
    .top-bar {
        font-size: 0.82em;
        padding: 8px 12px;
    }
    .actions {
        font-size: 0.85em;
        padding: 10px 14px;
    }
    details.status > summary {
        font-size: 0.85em;
        padding: 10px 12px;
    }
    details.status:hover {
        transform: none;
    }
}