/* ========================================
   1993三里屯大杂院 · 角色档案美化
   怀旧 · 胡同 · 人物卡牌 · 档案质感
   ======================================== */

/* 
 * ---------------------------------
 * 角色档案 details 容器
 * 延续折叠状态栏的怀旧风格
 * ---------------------------------
 */
details {
    /* 档案卡片基底 */
    background: #1e1611 !important;
    border: 3px solid #9b6b3c !important;
    border-radius: 18px 6px 18px 6px !important;
    
    /* 档案质感阴影 */
    box-shadow: 
        6px 6px 0px #0d0805,
        inset 0 0 30px rgba(140, 90, 45, 0.15),
        inset 0 2px 5px rgba(210, 160, 100, 0.08) !important;
    
    /* 内边距 */
    padding: 16px 20px !important;
    margin: 18px 0 !important;
    
    /* 文字基调 */
    color: #e8d5c0 !important;
    font-family: "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;
    line-height: 1.6 !important;
    
    /* 档案纸张纹理 */
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(180, 130, 70, 0.04) 0px,
            rgba(180, 130, 70, 0.04) 1px,
            transparent 1px,
            transparent 4px
        ),
        radial-gradient(circle at 80% 20%, rgba(200, 150, 80, 0.06) 0%, transparent 50%),
        linear-gradient(145deg, #231a14 0%, #1a120d 100%) !important;
    
    position: relative !important;
    transition: all 0.3s ease !important;
}

/* 档案展开状态 */
details[open] {
    background: #241b15 !important;
    border-color: #b87333 !important;
    box-shadow: 
        8px 8px 0px #0d0805,
        inset 0 0 40px rgba(160, 100, 50, 0.2) !important;
    padding-bottom: 20px !important;
}

/* 
 * ---------------------------------
 * summary 档案标题
 * 带档案袋绳结装饰
 * ---------------------------------
 */
details summary {
    /* 标题背景 - 仿档案袋封条 */
    background: linear-gradient(
        135deg,
        #2d2018 0%,
        #3a281e 50%,
        #2d2018 100%
    ) !important;
    border: 2px solid #a06030 !important;
    border-radius: 12px 2px 12px 2px !important;
    
    /* 文字样式 */
    color: #f0d5b5 !important;
    font-weight: 700 !important;
    font-size: 1.1em !important;
    text-transform: uppercase !important;
    letter-spacing: 3px !important;
    text-shadow: 2px 2px 0px #1a1008 !important;
    
    /* 内边距 */
    padding: 12px 20px 12px 42px !important;
    margin: -8px -8px 14px -8px !important;
    
    /* 阴影 */
    box-shadow: 
        3px 3px 0px #0d0805,
        inset 0 0 12px rgba(180, 120, 50, 0.2) !important;
    
    cursor: pointer !important;
    list-style: none !important;
    position: relative !important;
    transition: all 0.15s ease !important;
}

/* 隐藏默认三角 */
details summary::-webkit-details-marker {
    display: none !important;
}

/* 自定义折叠图标 - 档案袋绳结 */
details summary::before {
    content: "📎" !important;
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) rotate(-20deg) !important;
    font-size: 18px !important;
    filter: drop-shadow(1px 1px 0px #0d0805) !important;
    transition: transform 0.2s ease !important;
}

/* 展开时图标变化 */
details[open] summary::before {
    content: "📂" !important;
    transform: translateY(-50%) rotate(0deg) !important;
}

/* summary 悬停 */
details summary:hover {
    background: linear-gradient(
        135deg,
        #3a281e 0%,
        #4a3528 50%,
        #3a281e 100%
    ) !important;
    border-color: #c08040 !important;
    color: #f5e8d8 !important;
    transform: translate(-1px, -1px) !important;
    box-shadow: 
        4px 4px 0px #0d0805,
        inset 0 0 18px rgba(200, 140, 70, 0.25) !important;
}

/* 
 * ---------------------------------
 * 档案内容区域样式
 * ---------------------------------
 */
details > *:not(summary) {
    padding: 6px 12px !important;
    margin: 6px 0 !important;
    position: relative !important;
    z-index: 2 !important;
}

/* 档案内的分隔线装饰 */
details hr,
details .divider {
    border: none !important;
    height: 1px !important;
    background: linear-gradient(
        90deg,
        transparent,
        #b87333 20%,
        #d4a76a 50%,
        #b87333 80%,
        transparent
    ) !important;
    margin: 16px 0 !important;
    opacity: 0.5 !important;
}

/* 
 * ---------------------------------
 * 人物档案卡片头
 * 🪪 表情符号样式
 * ---------------------------------
 */
details p:has(> 🪪),
details div:has(> 🪪) {
    font-size: 1.2em !important;
    font-weight: 700 !important;
    color: #d4a76a !important;
    text-shadow: 1px 1px 0px #1a1008 !important;
    border-bottom: 2px dashed rgba(184, 115, 51, 0.4) !important;
    padding-bottom: 8px !important;
    margin-bottom: 12px !important;
}

/* 
 * ---------------------------------
 * 分类标题样式
 * 🔸**基本信息** 等
 * ---------------------------------
 */
details strong,
details b {
    color: #e0b880 !important;
    font-weight: 700 !important;
    text-shadow: 1px 1px 0px #1a1008 !important;
}

/* 分类标题（带🔸的） */
details p:has(🔸),
details div:has(🔸) {
    color: #d4a76a !important;
    font-weight: 600 !important;
    letter-spacing: 1px !important;
    border-left: 3px solid #b87333 !important;
    padding-left: 12px !important;
    margin: 14px 0 8px 0 !important;
}

/* 
 * ---------------------------------
 * 列表项样式
 * - **姓名:** {{值}}
 * ---------------------------------
 */
details li,
details ul li {
    color: #dcc8b2 !important;
    margin: 6px 0 !important;
    padding-left: 8px !important;
    list-style-type: none !important;
    position: relative !important;
}

details li::before {
    content: "◈" !important;
    position: absolute !important;
    left: -12px !important;
    color: #b87333 !important;
    font-size: 12px !important;
    opacity: 0.7 !important;
}

details ul {
    padding-left: 24px !important;
    margin: 8px 0 !important;
}

/* 
 * ---------------------------------
 * 代码/数值样式
 * `{{数值}}` 反引号内容
 * ---------------------------------
 */
details code,
details pre {
    background: rgba(40, 25, 18, 0.7) !important;
    border: 1px solid #8b5a2b !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    color: #f0c898 !important;
    font-family: "Courier New", monospace !important;
    font-size: 0.9em !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* 
 * ---------------------------------
 * 心声引用样式
 * ‘*{{内心独白}}*’
 * ---------------------------------
 */
details em {
    color: #c8a880 !important;
    font-style: italic !important;
    background: rgba(60, 40, 25, 0.25) !important;
    padding: 2px 8px !important;
    border-radius: 8px 2px 8px 2px !important;
    border-left: 3px solid #a06030 !important;
    display: inline-block !important;
}

/* 心声段落特殊样式 */
details p:has(em) {
    background: rgba(30, 20, 15, 0.4) !important;
    border-radius: 10px 3px 10px 3px !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(160, 100, 40, 0.25) !important;
}

/* 
 * ---------------------------------
 * NPC档案分隔样式
 * ---
 * ---------------------------------
 */
details hr + p:has(🪪),
details hr + div:has(🪪) {
    margin-top: 20px !important;
    border-top: 2px solid rgba(184, 115, 51, 0.3) !important;
    padding-top: 16px !important;
}

/* 
 * ---------------------------------
 * 生理状态标签样式
 * 【即时状态】等
 * ---------------------------------
 */
details strong:has(+ em),
details b:has(+ em) {
    color: #c08050 !important;
}

/* 
 * ---------------------------------
 * 档案边角装饰
 * 档案袋封蜡/印章效果
 * ---------------------------------
 */
details::after {
    content: "📋 档案室 · 春风里胡同3号院 📋" !important;
    position: absolute !important;
    bottom: 6px !important;
    right: 20px !important;
    font-size: 10px !important;
    color: #9b6b3c !important;
    opacity: 0.35 !important;
    font-family: "Courier New", monospace !important;
    letter-spacing: 2px !important;
    pointer-events: none !important;
    text-transform: uppercase !important;
    text-shadow: 0 0 3px black !important;
    z-index: 1 !important;
}

/* 左侧档案标签装饰 */
details > :first-child::before {
    content: "" !important;
    position: absolute !important;
    left: -6px !important;
    top: 20px !important;
    bottom: 20px !important;
    width: 3px !important;
    background: linear-gradient(
        to bottom,
        transparent,
        #b87333 20%,
        #d4a76a 50%,
        #b87333 80%,
        transparent
    ) !important;
    opacity: 0.4 !important;
    border-radius: 2px !important;
}

/* 
 * ---------------------------------
 * 移动端适配
 * ---------------------------------
 */
@media (max-width: 600px) {
    details {
        padding: 12px 14px !important;
        margin: 14px 0 !important;
        border-radius: 14px 4px 14px 4px !important;
        box-shadow: 4px 4px 0px #0d0805 !important;
    }
    
    details summary {
        padding: 10px 14px 10px 38px !important;
        font-size: 1em !important;
        letter-spacing: 2px !important;
        margin: -6px -6px 12px -6px !important;
    }
    
    details summary::before {
        left: 12px !important;
        font-size: 16px !important;
    }
    
    details::after {
        font-size: 8px !important;
        bottom: 4px !important;
        right: 10px !important;
        letter-spacing: 1px !important;
    }
    
    details > *:not(summary) {
        padding: 4px 8px !important;
    }
    
    details p:has(🔸),
    details div:has(🔸) {
        padding-left: 10px !important;
        margin: 10px 0 6px 0 !important;
        font-size: 0.95em !important;
    }
    
    details li {
        font-size: 0.9em !important;
        margin: 4px 0 !important;
    }
    
    details code,
    details pre {
        font-size: 0.85em !important;
        padding: 1px 6px !important;
    }
    
    details em {
        font-size: 0.9em !important;
    }
}

/* 超小屏幕 */
@media (max-width: 400px) {
    details {
        padding: 10px 10px !important;
    }
    
    details summary {
        padding: 8px 10px 8px 34px !important;
        font-size: 0.9em !important;
        letter-spacing: 1px !important;
    }
    
    details summary::before {
        left: 10px !important;
        font-size: 14px !important;
    }
    
    details::after {
        display: none !important;
    }
    
    details > :first-child::before {
        display: none !important;
    }
}

/* 
 * ---------------------------------
 * 特定内容颜色微调
 * 确保可读性
 * ---------------------------------
 */

/* 基本信息、能力知识等区域强制浅色文字 */
details p,
details div,
details span,
details li {
    color: #dcc8b2 !important;
}

/* 数值强调 */
details [class*="数值"],
details [class*="value"] {
    color: #e8c090 !important;
    font-weight: 600 !important;
}

/* 天赋等级 */
details :contains("【") {
    color: #d4a76a !important;
}

/* 
 * ---------------------------------
 * 档案间分隔线
 * 多个档案之间的---
 * ---------------------------------
 */
details hr {
    border: none !important;
    height: 2px !important;
    background: repeating-linear-gradient(
        90deg,
        #b87333 0px,
        #b87333 4px,
        transparent 4px,
        transparent 8px
    ) !important;
    margin: 20px 0 !important;
    opacity: 0.4 !important;
}

/* 
 * ---------------------------------
 * 打印/档案质感增强
 * 模拟老式打字机效果
 * ---------------------------------
 */
details {
    /* 轻微噪点 */
    position: relative !important;
}

details::before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="1" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.04 0"/></filter><rect width="100" height="100" filter="url(%23noise)"/></svg>') !important;
    opacity: 0.3 !important;
    pointer-events: none !important;
    z-index: 0 !important;
    border-radius: inherit !important;
}

/* 确保内容在噪点上层 */
details > * {
    position: relative !important;
    z-index: 2 !important;
}