/* ==================== 全局基础样式 ==================== */
details {
    margin: 12px 0;
    padding: 0;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

details:hover {
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

details[open] {
    border-color: #ffd700;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
}

/* ==================== 折叠标题样式 ==================== */
summary {
    padding: 14px 20px;
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.05) 100%);
    cursor: pointer;
    user-select: none;
    list-style: none;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s ease;
    color: #d4af37;
    font-size: 14px;
}

/* 修复：将 &gt; 改为 > */
details[open] > summary::before {
    transform: rotate(90deg);
}

summary:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.1) 100%);
    color: #fff;
}

/* ==================== 内容区域样式 ==================== */
/* 修复：将 &gt; 改为 > */
details > *:not(summary) {
    padding: 16px 20px;
    color: #e0e0e0;
    line-height: 1.8;
    font-size: 15px;
}

/* ==================== 文本样式 ==================== */
details strong {
    color: #ffd700;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

details p {
    margin: 8px 0;
    color: #c9d1d9;
}

/* ==================== 列表样式 ==================== */
details ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

details ul li {
    padding: 8px 12px;
    margin: 6px 0;
    background: rgba(212, 175, 55, 0.08);
    border-left: 3px solid #d4af37;
    border-radius: 4px;
    transition: all 0.2s ease;
}

details ul li:hover {
    background: rgba(212, 175, 55, 0.15);
    border-left-color: #ffd700;
    transform: translateX(5px);
}

details ul li strong {
    color: #ffd700;
}

/* ==================== 分隔线样式 ==================== */
details hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #d4af37 50%, transparent 100%);
    margin: 16px 0;
    opacity: 0.5;
}

/* ==================== 表格样式 ==================== */
details table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

details table th {
    background: linear-gradient(135deg, #d4af37 0%, #b8941e 100%);
    color: #1a1a2e;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

details table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: #e0e0e0;
}

details table tr:hover {
    background: rgba(212, 175, 55, 0.1);
}

details table tr:last-child td {
    border-bottom: none;
}

/* ==================== 特殊模块样式 ==================== */

/* 当前情况 - 顶部栏特殊样式 */
details:first-child {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border-color: #ffd700;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

details:first-child summary {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 215, 0, 0.1) 100%);
    font-size: 19px;
    color: #fff;
}

/* 主角信息 - 强调样式 */
details:nth-of-type(2) {
    border-color: #ff6b6b;
}

details:nth-of-type(2) summary {
    color: #ff6b6b;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* NPC信息 - 柔和样式 */
details:nth-of-type(3) {
    border-color: #4ecdc4;
}

details:nth-of-type(3) summary {
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

/* 修行概况 - 神秘样式 */
details:nth-of-type(4) {
    border-color: #a78bfa;
}

details:nth-of-type(4) summary {
    color: #a78bfa;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* 机缘与任务 - 活力样式 */
details:nth-of-type(5) {
    border-color: #fbbf24;
}

details:nth-of-type(5) summary {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ==================== 天赋颜色标记 ==================== */
/* 改为使用类选择器替代 :has() 和 :contains() */
.talent-white {
    border-left-color: #9ca3af !important;
}

.talent-green {
    border-left-color: #10b981 !important;
}

.talent-blue {
    border-left-color: #3b82f6 !important;
}

.talent-red {
    border-left-color: #ef4444 !important;
}

.talent-gold {
    border-left-color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.1) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.2) !important;
}

/* ==================== 行动推荐特殊样式 ==================== */
/* 为最后一个details添加类名替代 :last-child */
.action-recommendation ol {
    list-style: none;
    counter-reset: action-counter;
    padding-left: 0;
}

.action-recommendation ol li {
    counter-increment: action-counter;
    padding: 12px 16px 12px 50px;
    margin: 10px 0;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-recommendation ol li::before {
    content: counter(action-counter);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.action-recommendation ol li:hover {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.1) 100%);
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    details {
        margin: 10px 0;
    }
    
    summary {
        font-size: 16px;
        padding: 12px 16px;
    }
    
    /* 修复：将 &gt; 改为 > */
    details > *:not(summary) {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    details table {
        font-size: 13px;
    }
    
    details table th,
    details table td {
        padding: 8px;
    }
}

/* ==================== 滚动条美化 ==================== */
details::-webkit-scrollbar {
    width: 8px;
}

details::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

details::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #d4af37 0%, #b8941e 100%);
    border-radius: 4px;
}

details::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 100%);
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 修复：将 &gt; 改为 > */
details[open] > *:not(summary) {
    animation: fadeIn 0.3s ease;
}

/* ==================== 特殊文本高亮 ==================== */
details em {
    color: #a78bfa;
    font-style: normal;
    background: rgba(167, 139, 250, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

details code {
    background: rgba(212, 175, 55, 0.15);
    color: #ffd700;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* ==================== 占位符提示样式 ==================== */
.placeholder-text::after {
    content: "（待填充）";
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
    margin-left: 8px;
}