/* ==========================================================================
   县城旧梦 - 状态栏样式表
   适配主题：现代都市写实风格
   ========================================================================== */

/* --------------------------------------------------------------------------
   全局容器样式
   -------------------------------------------------------------------------- */
details {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #d1d9e6;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

details:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

details[open] {
    background: linear-gradient(135deg, #ffffff 0%, #e8eef5 100%);
    border-color: #4a90e2;
}

/* --------------------------------------------------------------------------
   折叠标题样式
   -------------------------------------------------------------------------- */
summary {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    list-style: none;
    user-select: none;
    position: relative;
}

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

summary::before {
    content: "▶";
    display: inline-block;
    transition: transform 0.3s ease;
    color: #4a90e2;
    font-size: 12px;
    margin-right: 8px;
    line-height: 1;
}

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

summary:hover {
    background: rgba(74, 144, 226, 0.15);
    color: #4a90e2;
}

/* --------------------------------------------------------------------------
   特殊类别选择器 - 通过data-category属性替代:contains()
   -------------------------------------------------------------------------- */

/* 当前情况样式 */
details[data-category="current-situation"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #5a67d8;
    color: #ffffff;
}

details[data-category="current-situation"] summary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

details[data-category="current-situation"] summary::before {
    color: #ffffff;
}

details[data-category="current-situation"] strong {
    color: #ffd700;
}

/* 主角信息样式 */
details[data-category="protagonist-info"] {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-color: #f39c12;
}

details[data-category="protagonist-info"] summary {
    color: #d35400;
}

details[data-category="protagonist-info"] summary::before {
    color: #e67e22;
}

/* NPC信息样式 */
details[data-category="npc-info"] {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-color: #48c9b0;
}

details[data-category="npc-info"] summary {
    color: #16a085;
}

details[data-category="npc-info"] summary::before {
    color: #1abc9c;
}

details[data-category="npc-info"] hr {
    border: none;
    border-top: 2px dashed #48c9b0;
    margin: 16px 0;
}

/* 社交网络动态样式 */
details[data-category="social-media"] {
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    border-color: #9b59b6;
}

details[data-category="social-media"] summary {
    color: #8e44ad;
}

details[data-category="social-media"] summary::before {
    color: #9b59b6;
}

/* 真相线索库样式 */
details[data-category="clues"] {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-color: #e74c3c;
}

details[data-category="clues"] summary {
    color: #c0392b;
}

details[data-category="clues"] summary::before {
    color: #e74c3c;
}

/* 记忆区样式 */
details[data-category="memories"] {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
    border-color: #9b59b6;
}

details[data-category="memories"] summary {
    color: #6c3483;
}

details[data-category="memories"] summary::before {
    color: #8e44ad;
}

/* 行动推荐样式 */
details[data-category="actions"] {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border-color: #16a085;
}

details[data-category="actions"] summary {
    color: #0e6655;
}

details[data-category="actions"] summary::before {
    color: #1abc9c;
}

details[data-category="actions"] ol {
    background: rgba(255, 255, 255, 0.5);
    padding: 16px 16px 16px 36px;
    border-radius: 8px;
    margin-top: 12px;
}

details[data-category="actions"] li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(22, 160, 133, 0.2);
    transition: all 0.2s ease;
}

details[data-category="actions"] li:last-child {
    border-bottom: none;
}

details[data-category="actions"] li:hover {
    background: rgba(22, 160, 133, 0.1);
    padding-left: 8px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   表格样式
   -------------------------------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #5a67d8;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
}

tr:hover {
    background: rgba(74, 144, 226, 0.08);
}

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

/* --------------------------------------------------------------------------
   文本样式
   -------------------------------------------------------------------------- */
strong {
    color: #2c3e50;
    font-weight: 600;
}

em {
    color: #7f8c8d;
    font-style: italic;
}

/* 列表样式 */
ul, ol {
    margin: 8px 0;
    padding-left: 24px;
}

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

/* 分隔线样式 */
hr {
    border: none;
    border-top: 2px solid #bdc3c7;
    margin: 16px 0;
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   数值显示样式 - 使用特殊的类替代contains选择器
   -------------------------------------------------------------------------- */
.value-display {
    color: #e74c3c;
    font-family: "Consolas", "Monaco", monospace;
}

/* --------------------------------------------------------------------------
   响应式设计
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    details {
        padding: 12px;
        margin: 8px 0;
    }
    
    summary {
        font-size: 16px;
        padding: 6px 10px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}

/* --------------------------------------------------------------------------
   打印样式
   -------------------------------------------------------------------------- */
@media print {
    details {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    details[open] {
        background: #fff;
    }
    
    summary::before {
        content: "";
    }
    
    /* 确保打印时所有details都是展开的 */
    details {
        display: block !important;
    }
    
    summary {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   辅助类
   -------------------------------------------------------------------------- */
.highlight {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ffc107;
}

.warning {
    color: #e74c3c;
    font-weight: bold;
}

.success {
    color: #27ae60;
    font-weight: bold;
}

.info {
    color: #3498db;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   添加展开/收起动画
   -------------------------------------------------------------------------- */
details summary ~ * {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}