/* ==========================================
   圣女堕落记录簿 - CSS美化样式表
   主题：神圣与堕落的交织，哥特教堂风格
   ========================================== */

/* 全局容器 */
ai {
    display: block;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Serif SC', serif;
    line-height: 1.7;
    color: #f0e6d2;
    background: 
        linear-gradient(135deg, #0c0b1a 0%, #1a1729 100%),
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 215, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* 教堂彩色玻璃窗效果 */
ai::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(120, 119, 198, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
        linear-gradient(45deg, transparent 48%, rgba(255, 215, 0, 0.03) 50%, transparent 52%);
    z-index: -1;
    animation: stainedGlass 60s linear infinite;
}

@keyframes stainedGlass {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 状态栏样式 */
.status-bar {
    margin-bottom: 28px;
    position: relative;
}

.status-bar::before {
    content: '📜';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #ffd700;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

.status-bar pre {
    background: 
        linear-gradient(135deg, rgba(28, 25, 57, 0.9) 0%, rgba(18, 16, 38, 0.9) 100%),
        url('data:image/svg+xml,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h20v20H0z" fill="none"/><path d="M5 5h2v2H5zM13 5h2v2h-2zM5 13h2v2H5zM13 13h2v2h-2z" fill="rgba(255,215,0,0.1)"/></svg>');
    border: 1px solid #7877c6;
    border-left: 4px solid #ffd700;
    border-radius: 8px;
    padding: 20px;
    color: #e6e1d5;
    font-family: 'Crimson Text', 'Noto Serif SC', serif;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: auto;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 1;
}

/* 状态栏分隔线装饰 */
.status-bar pre::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    opacity: 0.3;
}

/* 正文区域 */
.text-content {
    background: rgba(18, 16, 38, 0.7);
    border-left: 4px solid #7877c6;
    padding: 24px;
    margin-bottom: 28px;
    border-radius: 8px;
    position: relative;
    box-shadow: 
        inset 0 0 0 1px rgba(255, 215, 0, 0.05),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.text-content::before {
    content: '✝';
    position: absolute;
    right: 16px;
    top: -12px;
    font-size: 20px;
    color: rgba(255, 215, 0, 0.3);
}

text p {
    margin: 0 0 20px 0;
    text-indent: 2.2em;
    font-size: 17px;
    color: #f5f1e8;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

text p:last-child {
    margin-bottom: 0;
}

/* 对话颜色系统 */
/* 用户对话 - 金色，代表"不死者"的神秘 */
text span[style*="color:#2E86C1"] {
    color: #ffd700 !important;
    font-weight: 600;
    text-shadow: 
        0 0 6px rgba(255, 215, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    padding: 0 2px;
}

text span[style*="color:#2E86C1"]::before {
    content: '「';
    color: rgba(255, 215, 0, 0.5);
    margin-right: 2px;
}

text span[style*="color:#2E86C1"]::after {
    content: '」';
    color: rgba(255, 215, 0, 0.5);
    margin-left: 2px;
}

/* 玛丽丝对话 - 紫色，代表"圣女"的神圣与堕落的矛盾 */
text span[style*="color:#9B59B6"] {
    color: #b19cd9 !important;
    font-weight: 500;
    font-style: italic;
    text-shadow: 
        0 0 4px rgba(177, 156, 217, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
}

text span[style*="color:#9B59B6"]::before {
    content: '「';
    color: rgba(177, 156, 217, 0.5);
    margin-right: 2px;
}

text span[style*="color:#9B59B6"]::after {
    content: '」';
    color: rgba(177, 156, 217, 0.5);
    margin-left: 2px;
}

/* 心理活动 - 琥珀色，代表内心的挣扎与欲望 */
text span[style*="color:#7D6608"] {
    color: #d4a017 !important;
    font-style: italic;
    opacity: 0.85;
    text-shadow: 
        0 0 3px rgba(212, 160, 23, 0.2),
        0 1px 1px rgba(0, 0, 0, 0.3);
    background: rgba(212, 160, 23, 0.05);
    padding: 0 4px;
    border-radius: 2px;
}

/* 艾莉诺对话（后宫路线） - 粉色，代表活泼与叛逆 */
text span[style*="color:#FF1493"] {
    color: #ffb6c1 !important;
    font-weight: 500;
    text-shadow: 
        0 0 4px rgba(255, 182, 193, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 魔女塞西莉亚对话 - 深紫色 */
text span[style*="color:#9370DB"] {
    color: #9370db !important;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 
        0 0 4px rgba(147, 112, 219, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 折叠块通用样式 */
details {
    background: rgba(28, 25, 57, 0.8);
    border: 1px solid #3a3566;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

details::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

details:hover {
    border-color: #7877c6;
    box-shadow: 
        0 6px 20px rgba(120, 119, 198, 0.15),
        inset 0 0 0 1px rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

details:hover::before {
    opacity: 0.5;
}

details[open] {
    background: rgba(32, 28, 66, 0.9);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(255, 215, 0, 0.1);
}

/* 折叠标题 */
details summary {
    background: linear-gradient(90deg, rgba(58, 53, 102, 0.8) 0%, rgba(40, 36, 76, 0.8) 100%);
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: #e6d8b5;
    user-select: none;
    transition: all 0.25s ease;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    list-style: none;
}

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

details summary::after {
    content: '▼';
    font-size: 12px;
    color: #ffd700;
    margin-left: auto;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

details[open] summary::after {
    transform: rotate(180deg);
}

details summary:hover {
    background: linear-gradient(90deg, rgba(120, 119, 198, 0.3) 0%, rgba(88, 86, 154, 0.3) 100%);
    color: #fff8e1;
}

details summary:hover::after {
    opacity: 1;
}

details[open] summary {
    border-bottom-color: #3a3566;
    margin-bottom: 16px;
    background: linear-gradient(90deg, rgba(120, 119, 198, 0.4) 0%, rgba(88, 86, 154, 0.4) 100%);
}

/* 折叠内容区域 */
details section {
    padding: 20px;
    color: #e6e1d5;
    position: relative;
}

/* 代码块样式（用于状态显示） */
details pre {
    background: rgba(18, 16, 38, 0.9);
    border: 1px solid #2a2544;
    border-left: 3px solid #b19cd9;
    border-radius: 6px;
    padding: 18px;
    color: #d9d2c5;
    font-family: 'Consolas', 'Monaco', 'Cascadia Code', monospace;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    margin: 12px 0;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

details pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #b19cd9, #7877c6);
    border-radius: 3px 0 0 3px;
}

/* 分隔线装饰 */
details pre::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(177, 156, 217, 0.2), transparent);
}

/* 标题样式 */
details h4 {
    color: #ffd700;
    font-size: 15px;
    margin: 20px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3566;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
}

details h4:first-child {
    margin-top: 0;
}

details h4::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #ffd700, transparent);
}

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

details ul li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: #d9d2c5;
    border-bottom: 1px solid rgba(58, 53, 102, 0.3);
    transition: all 0.2s ease;
}

details ul li:last-child {
    border-bottom: none;
}

details ul li:hover {
    background: rgba(120, 119, 198, 0.05);
    padding-left: 28px;
}

details ul li::before {
    content: "✜";
    position: absolute;
    left: 0;
    color: #b19cd9;
    font-weight: bold;
    font-size: 14px;
    opacity: 0.7;
}

details ul ul {
    padding-left: 20px;
    margin-top: 6px;
    border-left: 1px solid rgba(58, 53, 102, 0.5);
}

details ul ul li::before {
    content: "•";
    color: #ffd700;
    font-size: 16px;
}

/* 表格样式 */
details table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    font-size: 14px;
    background: rgba(24, 21, 48, 0.7);
    border: 1px solid #3a3566;
    border-radius: 6px;
    overflow: hidden;
}

details table thead {
    background: linear-gradient(90deg, rgba(88, 86, 154, 0.8) 0%, rgba(58, 53, 102, 0.8) 100%);
}

details table th {
    padding: 14px 12px;
    text-align: left;
    color: #fff8e1;
    font-weight: 600;
    border-bottom: 2px solid #7877c6;
    position: relative;
}

details table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: rgba(255, 215, 0, 0.2);
}

details table td {
    padding: 12px;
    border-bottom: 1px solid #2a2544;
    color: #d9d2c5;
    transition: all 0.2s ease;
}

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

details table tbody tr:hover {
    background: rgba(120, 119, 198, 0.08);
}

details table tbody tr:hover td {
    color: #f0e6d2;
}

/* 段落样式 */
details p {
    margin: 12px 0;
    line-height: 1.8;
    color: #d9d2c5;
}

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

/* 行动选项面板 */
.choice-panel {
    background: 
        linear-gradient(135deg, rgba(40, 36, 76, 0.9) 0%, rgba(28, 25, 57, 0.9) 100%),
        url('data:image/svg+xml,<svg width="40" height="40" xmlns="http://www.w3.org/2000/svg"><path d="M20 0c11.046 0 20 8.954 20 20s-8.954 20-20 20S0 31.046 0 20 8.954 0 20 0zm0 4C11.163 4 4 11.163 4 20s7.163 16 16 16 16-7.163 16-16S28.837 4 20 4z" fill="rgba(255,215,0,0.05)"/></svg>');
    border: 1px solid #7877c6;
    border-top: 3px solid #ffd700;
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
    box-shadow: 
        0 8px 32px rgba(120, 119, 198, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.choice-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffd700, #b19cd9, #ffd700);
    opacity: 0.7;
}

.choice-panel pre {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #fff8e1;
    font-size: 15px;
    line-height: 1.9;
    font-family: 'Noto Serif SC', serif;
}

/* 选项列表 */
.choice-list {
    list-style: none;
    padding-left: 0;
    margin: 20px 0 0 0;
}

.choice-list li {
    margin: 16px 0;
    padding: 18px 20px;
    background: rgba(24, 21, 48, 0.6);
    border: 1px solid #3a3566;
    border-left: 4px solid #b19cd9;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.choice-list li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #b19cd9, #7877c6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.choice-list li:hover {
    background: rgba(40, 36, 76, 0.8);
    border-color: #7877c6;
    transform: translateX(8px);
    box-shadow: 
        0 4px 16px rgba(120, 119, 198, 0.2),
        inset 0 0 0 1px rgba(255, 215, 0, 0.1);
}

.choice-list li:hover::before {
    opacity: 1;
}

.choice-list li:active {
    transform: translateX(4px);
    transition: transform 0.1s ease;
}

/* 选项字母标记 */
.choice-list li::first-letter {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 8px;
    text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

/* 分隔线样式 */
hr {
    border: none;
    border-top: 1px solid #3a3566;
    margin: 24px 0;
    position: relative;
}

hr::after {
    content: '✝';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #1a1729;
    padding: 0 12px;
    color: rgba(255, 215, 0, 0.3);
    font-size: 14px;
}

/* 滚动条美化 */
ai ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

ai ::-webkit-scrollbar-track {
    background: rgba(24, 21, 48, 0.5);
    border-radius: 5px;
}

ai ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #7877c6 0%, #b19cd9 100%);
    border-radius: 5px;
    border: 2px solid rgba(24, 21, 48, 0.5);
}

ai ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #b19cd9 0%, #ffd700 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    ai {
        padding: 16px;
    }
    
    .status-bar pre,
    .choice-panel pre {
        font-size: 13px;
        padding: 16px;
    }
    
    text p {
        font-size: 16px;
    }
    
    details table {
        font-size: 13px;
    }
    
    details table th,
    details table td {
        padding: 10px 8px;
    }
    
    .choice-list li {
        padding: 16px;
        margin: 12px 0;
    }
    
    details summary {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    details section {
        padding: 16px;
    }
}

/* 动画效果 */
@keyframes parchmentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

ai {
    animation: parchmentFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

details[open] section {
    animation: contentSlideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 5px rgba(255, 215, 0, 0.2),
            inset 0 0 0 1px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow: 
            0 0 15px rgba(255, 215, 0, 0.3),
            inset 0 0 0 1px rgba(255, 215, 0, 0.2);
    }
}

.choice-list li:hover {
    animation: glowPulse 2s infinite;
}

/* 特殊标记样式 */
.emoji-icon {
    font-style: normal;
    margin-right: 8px;
    filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.5));
}

/* 数值高亮 */
details pre strong,
details table strong,
.status-bar pre strong {
    color: #ffd700;
    text-shadow: 
        0 0 6px rgba(255, 215, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    padding: 0 2px;
}

details pre strong::after,
details table strong::after,
.status-bar pre strong::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    opacity: 0.5;
}

/* 警告/危险提示 - 用于NTR路线 */
.warning {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.15) 0%, rgba(78, 0, 0, 0.15) 100%);
    border-left: 4px solid #8b0000;
    padding: 16px;
    margin: 16px 0;
    border-radius: 6px;
    color: #ffcccc;
    position: relative;
    overflow: hidden;
}

.warning::before {
    content: '⚠';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: rgba(139, 0, 0, 0.3);
}

/* 成功/完成提示 */
.success {
    background: linear-gradient(135deg, rgba(0, 100, 0, 0.15) 0%, rgba(0, 60, 0, 0.15) 100%);
    border-left: 4px solid #44ff44;
    padding: 16px;
    margin: 16px 0;
    border-radius: 6px;
    color: #ccffcc;
    position: relative;
}

.success::before {
    content: '✓';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: rgba(68, 255, 68, 0.3);
}

/* 扩展路线专属样式 */
/* 后宫路线状态栏 */
.harem-only {
    border-color: #ffb6c1;
}

.harem-only summary {
    background: linear-gradient(90deg, rgba(255, 182, 193, 0.2) 0%, rgba(255, 105, 180, 0.2) 100%);
    color: #ffebee;
}

.harem-only summary:hover {
    background: linear-gradient(90deg, rgba(255, 182, 193, 0.3) 0%, rgba(255, 105, 180, 0.3) 100%);
}

/* NTR路线状态栏 */
.ntr-only {
    border-color: #8b0000;
}

.ntr-only summary {
    background: linear-gradient(90deg, rgba(139, 0, 0, 0.2) 0%, rgba(78, 0, 0, 0.2) 100%);
    color: #ffcccc;
}

.ntr-only summary:hover {
    background: linear-gradient(90deg, rgba(139, 0, 0, 0.3) 0%, rgba(78, 0, 0, 0.3) 100%);
}

/* 堕落值高亮 */
.depravity-high {
    color: #ff4444 !important;
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.5) !important;
    animation: depravityGlow 2s infinite alternate;
}

@keyframes depravityGlow {
    from {
        text-shadow: 0 0 8px rgba(255, 68, 68, 0.5);
    }
    to {
        text-shadow: 0 0 12px rgba(255, 68, 68, 0.8), 0 0 20px rgba(255, 68, 68, 0.4);
    }
}

/* 封印符文效果 */
.seal-rune {
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #0080ff;
    animation: runePulse 3s infinite;
}

@keyframes runePulse {
    0%, 100% {
        opacity: 0.7;
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff;
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 0 15px #00ffff,
            0 0 30px #00ffff,
            0 0 45px #0080ff;
    }
}

/* 银发高亮 */
.silver-hair {
    color: #e0e0e0;
    text-shadow: 
        0 0 4px #ffffff,
        0 0 8px #ffffff,
        0 0 12px #b0b0b0;
    background: linear-gradient(90deg, transparent, rgba(224, 224, 224, 0.1), transparent);
    padding: 0 4px;
    border-radius: 2px;
}