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

details:hover {
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.25);
    transform: translateY(-2px);
}

details[open] {
    background: linear-gradient(135deg, #fff9f0 0%, #fffbf5 100%);
    border-color: #c9a961;
}

summary {
    font-weight: bold;
    font-size: 1.1em;
    color: #8b4513;
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -15px 0 -15px;
    background: linear-gradient(90deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 6px 6px 0 0;
    list-style: none;
    user-select: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

summary::before {
    content: "▶ ";
    display: inline-block;
    transition: transform 0.3s ease;
    color: #8b4513;
}

details[open] summary::before {
    transform: rotate(90deg);
}

summary:hover {
    background: linear-gradient(90deg, #f4d03f 0%, #d4af37 100%);
    padding-left: 15px;
}

/* ==================== 当前情况栏（顶部特殊样式）==================== */
details[data-type="current-situation"],
details:first-of-type {
    background: linear-gradient(135deg, #8b0000 0%, #dc143c 100%);
    border-color: #8b0000;
    color: #fff;
}

details[data-type="current-situation"] summary,
details:first-of-type summary {
    background: linear-gradient(90deg, #8b0000 0%, #a52a2a 100%);
    color: #ffd700;
}

details[data-type="current-situation"] strong,
details:first-of-type strong {
    color: #ffd700;
}

/* ==================== 主角信息栏 ==================== */
details[data-type="protagonist-info"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: #0f3460;
    color: #e8e8e8;
}

details[data-type="protagonist-info"] summary {
    background: linear-gradient(90deg, #0f3460 0%, #16213e 100%);
    color: #00d4ff;
}

details[data-type="protagonist-info"] strong {
    color: #00d4ff;
}

/* ==================== 在场人物栏（双人物系统）==================== */
details[data-type="present-character-1"] {
    background: linear-gradient(135deg, #2d1b4e 0%, #3d2963 100%);
    border: 2px solid #7b4397;
    color: #f0e6ff;
}

details[data-type="present-character-1"] summary {
    background: linear-gradient(90deg, #7b4397 0%, #dc2430 100%);
    color: #fff;
}

details[data-type="present-character-2"] {
    background: linear-gradient(135deg, #1a3a52 0%, #2c5f7c 100%);
    border: 2px solid #4a90a4;
    color: #e6f3f7;
}

details[data-type="present-character-2"] summary {
    background: linear-gradient(90deg, #4a90a4 0%, #357a8f 100%);
    color: #fff;
}

/* 女性角色详细描述特殊样式 */
details[data-type^="present-character"] .female-description {
    color: #ff69b4;
    font-weight: 600;
}

/* ==================== 其他在场人物栏 ==================== */
details[data-type="other-characters"] {
    background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
    border-color: #666;
    color: #ddd;
    padding: 6px 12px;
}

details[data-type="other-characters"] summary {
    background: linear-gradient(90deg, #666 0%, #555 100%);
    color: #fff;
    font-size: 0.95em;
}

details[data-type="other-characters"] ul {
    margin: 8px 0;
    padding-left: 20px;
}

details[data-type="other-characters"] li {
    margin: 4px 0;
    font-size: 0.9em;
}

/* ==================== 朝堂局势 & 派系动态 ==================== */
details[data-type="court-situation"] {
    background: linear-gradient(135deg, #1c1c1c 0%, #2d2d2d 100%);
    border: 2px solid #8b4513;
    color: #f5deb3;
}

details[data-type="court-situation"] summary {
    background: linear-gradient(90deg, #8b4513 0%, #a0522d 100%);
    color: #ffd700;
}

/* 派系标识颜色 */
.faction-chancellor {
    color: #dc143c;
}

.faction-emperor {
    color: #4169e1;
}

.faction-neutral {
    color: #9370db;
}

/* ==================== 任务与情报栏 ==================== */
details[data-type="missions-intelligence"] {
    background: linear-gradient(135deg, #0d3b2e 0%, #1a5c47 100%);
    border: 2px solid #2e8b57;
    color: #e0f2e9;
}

details[data-type="missions-intelligence"] summary {
    background: linear-gradient(90deg, #2e8b57 0%, #3cb371 100%);
    color: #fff;
}

/* 任务类型高亮 */
.mission-main {
    color: #ffd700;
    font-size: 1.1em;
}

.mission-side {
    color: #87ceeb;
}

.intelligence {
    color: #ff6347;
}

/* ==================== 记忆区 ==================== */
details[data-type="memory-zone"] {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid #7f8c8d;
    color: #ecf0f1;
}

details[data-type="memory-zone"] summary {
    background: linear-gradient(90deg, #7f8c8d 0%, #95a5a6 100%);
    color: #fff;
}

/* 表格美化 */
details[data-type="memory-zone"] table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
}

details[data-type="memory-zone"] th {
    background: rgba(127, 140, 141, 0.3);
    color: #ffd700;
    padding: 8px;
    border: 1px solid #7f8c8d;
    font-weight: bold;
}

details[data-type="memory-zone"] td {
    padding: 6px 8px;
    border: 1px solid #7f8c8d;
    color: #ecf0f1;
}

details[data-type="memory-zone"] tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 长期记忆与短期记忆区分 */
.memory-long {
    color: #e74c3c;
}

.memory-short {
    color: #3498db;
}

/* ==================== 行动推荐栏 ==================== */
details[data-type="action-recommendation"] {
    background: linear-gradient(135deg, #4a148c 0%, #6a1b9a 100%);
    border: 2px solid #9c27b0;
    color: #f3e5f5;
}

details[data-type="action-recommendation"] summary {
    background: linear-gradient(90deg, #9c27b0 0%, #ab47bc 100%);
    color: #fff;
}

details[data-type="action-recommendation"] ol {
    margin: 10px 0;
    padding-left: 25px;
}

details[data-type="action-recommendation"] li {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid #ce93d8;
    border-radius: 4px;
    transition: all 0.3s ease;
}

details[data-type="action-recommendation"] li:hover {
    background: rgba(255, 255, 255, 0.2);
    border-left-color: #ffd700;
    transform: translateX(5px);
    cursor: pointer;
}

/* ==================== 通用文本样式 ==================== */
details strong {
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

details hr {
    border: none;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    margin: 12px 0;
}

details ul, details ol {
    margin: 8px 0;
}

details li {
    margin: 5px 0;
    line-height: 1.6;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    details {
        margin: 8px 0;
        padding: 6px 10px;
    }
    
    summary {
        font-size: 1em;
        padding: 6px 10px;
    }
    
    details[data-type="memory-zone"] table {
        font-size: 0.85em;
    }
}

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

details[open] > *:not(summary) {
    animation: fadeIn 0.3s ease;
}

/* ==================== 特殊标记样式 ==================== */
/* 派系徽章效果 */
.faction-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 5px;
}

.faction-chancellor-badge {
    background: #dc143c;
    color: #fff;
}

.faction-emperor-badge {
    background: #4169e1;
    color: #fff;
}

.faction-neutral-badge {
    background: #9370db;
    color: #fff;
}

/* 紧急程度标识 */
.urgent-high {
    color: #ff4444 !important;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

.urgent-medium {
    color: #ffaa00 !important;
}

.urgent-low {
    color: #44ff44 !important;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}