/* ========== TRPG 面板主容器 ========== */
.trpg-panel {
    max-width: 720px;
    margin: 8px auto;
    padding: 18px 16px;
    background: #1a1c23;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(226, 176, 74, 0.1);
    font-family: "Noto Serif SC", "Source Han Serif SC", "STSong", "Songti SC", "SimSun", Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.7;
    color: #c8ccd4;
    box-sizing: border-box;
    letter-spacing: 0.02em;
    border: 1px solid #2a2d37;
}

/* ========== 可折叠区域通用 ========== */
.trpg-section {
    border: 1px solid #2a2d37;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #21232b;
    overflow: hidden;
    transition: all 0.2s ease;
}

.trpg-section[open] {
    box-shadow: 0 0 15px rgba(226, 176, 74, 0.15);
}

.trpg-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.04em;
    background: #282b34;
    transition: background 0.2s ease;
    border-bottom: 1px solid transparent;
}

.trpg-section__header::-webkit-details-marker {
    display: none;
}

.trpg-section__header:hover {
    background: #303440;
}

.trpg-section[open] .trpg-section__header {
    border-bottom-color: #3a3f4b;
}

.trpg-section__icon {
    font-size: 18px;
    margin-right: 8px;
    color: #e2b04a;
}

.trpg-section__title-text {
    flex: 1;
    color: #e0e2e8;
}

.trpg-section__toggle-icon {
    font-size: 14px;
    color: #8a8f9a;
    transition: transform 0.3s ease;
}

.trpg-section[open] .trpg-section__toggle-icon {
    transform: rotate(180deg);
}

.trpg-section__body {
    padding: 16px;
    background: #21232b;
}

/* ========== 标题区域样式 ========== */
.trpg-section--title .trpg-section__header {
    background: linear-gradient(135deg, #2d2535 0%, #1f1c2a 100%);
    border-bottom: 1px solid #4a3f5a;
}

/* ========== 正文内容区（不可折叠） ========== */
.trpg-body {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #282b34;
    border-left: 4px solid #e2b04a;
    border-radius: 6px 10px 10px 6px;
    font-size: 16px;
    line-height: 1.85;
    color: #e8eaed;
    border-top: 1px solid #3a3f4b;
    border-right: 1px solid #3a3f4b;
    border-bottom: 1px solid #3a3f4b;
}

.trpg-body__label {
    font-weight: 700;
    color: #e2b04a;
    margin-bottom: 8px;
    font-size: 15px;
}

.trpg-body p {
    margin: 0;
}

/* ========== 网格布局 ========== */
.trpg-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ========== 字段行 ========== */
.trpg-field {
    display: flex;
    align-items: baseline;
    padding: 6px 0;
    font-size: 15px;
    line-height: 1.6;
    border-bottom: 1px solid #2a2d37;
    gap: 6px;
    flex-wrap: wrap;
}

.trpg-field:last-child {
    border-bottom: none;
}

.trpg-field__label {
    color: #a0a5ae;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.trpg-field__value {
    color: #f0f1f5;
    font-weight: 500;
    word-break: break-word;
}

/* 血量高亮 */
.trpg-field--highlight {
    background: rgba(224, 108, 117, 0.1);
    border-radius: 4px;
    padding: 5px 8px;
    margin: 2px -4px;
}

.trpg-field__value--hp {
    color: #e06c75;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(224, 108, 117, 0.4);
}

/* 状态字段 */
.trpg-field--status .trpg-field__value {
    color: #98c379;
    font-weight: 600;
}

/* 数值型字段组（人物/地形/概念） */
.trpg-field-group {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid #2a2d37;
}

.trpg-field--inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #282b34;
    border-radius: 6px;
    border-bottom: none;
    font-size: 14px;
    border: 1px solid #3a3f4b;
}

.trpg-field__value--num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    background: #3a3f4b;
    border-radius: 13px;
    font-weight: 700;
    font-size: 15px;
    color: #e2b04a;
}

/* 珍宝字段 */
.trpg-field--treasure .trpg-field__value {
    color: #e2b04a;
    font-weight: 600;
}

/* 英雄单位字段 */
.trpg-field--hero {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed #3a3f4b;
}

/* ========== 分隔线（国家信息中珍宝与历史进程之间） ========== */
.trpg-divider {
    height: 1px;
    margin: 10px 0;
    background: linear-gradient(to right, transparent, #3a3f4b 20%, #3a3f4b 80%, transparent);
    border: none;
}

/* 历史进程字段 */
.trpg-field--history .trpg-field__label {
    color: #c678dd;
    font-weight: 700;
}

/* ========== 记忆模块（内部容器） ========== */
.trpg-memory {
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    background: #282b34;
    border: 1px solid #3a3f4b;
}

.trpg-memory:last-child {
    margin-bottom: 0;
}

.trpg-memory__header {
    font-weight: 700;
    margin-bottom: 8px;
    color: #d1b06b;
    font-size: 15px;
}

.trpg-memory__content {
    font-size: 15px;
    line-height: 1.7;
    color: #bcc0c8;
}

/* 短期记忆栏 */
.trpg-memory--short {
    border-left: 3px solid #e2b04a;
}

/* 长期记忆 */
.trpg-memory--long {
    border-left: 3px solid #61afef;
}

/* 永久记忆 */
.trpg-memory--perm {
    border-left: 3px solid #c678dd;
}

/* ========== 高亮项目（点击浮窗效果） ========== */
.highlight-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
    vertical-align: middle;
}

.highlight-item__name {
    background: linear-gradient(135deg, #3a3f4b 0%, #2a2d37 100%);
    border: 1px solid #5a5f6b;
    color: #e2b04a;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.highlight-item__name::-webkit-details-marker {
    display: none;
}

.highlight-item__name:hover {
    background: #4a4f5c;
    border-color: #e2b04a;
    box-shadow: 0 0 10px rgba(226, 176, 74, 0.3);
    color: #ffd580;
}

.highlight-item__name::after {
    content: "📋";
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.highlight-item[open] .highlight-item__name::after {
    transform: rotate(180deg);
}

/* 浮窗提示框 */
.highlight-item__tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: #2a2d37;
    border: 1px solid #e2b04a;
    padding: 8px 14px;
    border-radius: 8px;
    width: max-content;
    max-width: 220px;
    z-index: 20;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    font-size: 14px;
    line-height: 1.6;
    color: #f0f1f5;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-weight: 500;
}

.highlight-item__tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #e2b04a transparent transparent transparent;
}

.highlight-item[open] .highlight-item__tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ========== 响应式调整 ========== */
@media (max-width: 560px) {
    .trpg-panel {
        padding: 12px 10px;
        font-size: 15px;
        border-radius: 10px;
        margin: 4px 2px;
    }

    .trpg-section__header {
        font-size: 16px;
        padding: 10px 12px;
    }

    .trpg-body {
        padding: 12px 14px;
        font-size: 15px;
    }

    .trpg-section__body {
        padding: 12px;
    }

    .trpg-field {
        font-size: 14px;
        padding: 4px 0;
    }

    .trpg-field__label {
        font-size: 13px;
    }

    .trpg-field-group {
        gap: 6px;
    }

    .trpg-field--inline {
        font-size: 13px;
        padding: 3px 8px;
    }

    .trpg-field__value--num {
        min-width: 24px;
        height: 24px;
        font-size: 13px;
    }

    .trpg-memory {
        padding: 10px;
    }

    .trpg-memory__header {
        font-size: 14px;
    }

    .highlight-item__name {
        font-size: 13px;
        padding: 2px 8px;
    }

    .highlight-item__tooltip {
        max-width: 180px;
        font-size: 13px;
    }
}

/* ========== 滚动条美化（对视力友好） ========== */
.trpg-panel {
    scrollbar-width: thin;
    scrollbar-color: #3a3f4b #1a1c23;
}

.trpg-panel::-webkit-scrollbar {
    width: 6px;
}

.trpg-panel::-webkit-scrollbar-track {
    background: #1a1c23;
}

.trpg-panel::-webkit-scrollbar-thumb {
    background: #3a3f4b;
    border-radius: 3px;
}