/* ==========================================
   三态NTR沉浸叙事系统 - CSS美化样式表（修正版）
   主题：地下俱乐部的暧昧与背德，深夜色调
   修正：行动选项文字对比度强化
   ========================================== */

/* === 全局容器 === */
ai {
    display: block;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
    line-height: 1.8;
    color: #e8e2d6;
    background: 
        linear-gradient(160deg, #0f0d18 0%, #161322 40%, #1a1625 100%),
        radial-gradient(circle at 25% 75%, rgba(180, 120, 80, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 75% 25%, rgba(140, 100, 160, 0.05) 0%, transparent 50%);
    padding: 28px;
    border-radius: 10px;
    box-shadow: 
        0 6px 28px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(180, 140, 100, 0.08);
    position: relative;
    overflow: hidden;
}

ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.003) 2px, rgba(255,255,255,0.003) 4px);
    z-index: -1;
    pointer-events: none;
}

/* === 隐藏思维链 === */
ai > :first-child {
    display: none;
}

/* === 前置状态栏 === */
.status-bar {
    margin-bottom: 28px;
    position: relative;
}

.status-bar::before {
    content: '🌃';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    opacity: 0.6;
}

.status-bar pre {
    background: rgba(20, 18, 30, 0.92);
    border: 1px solid #3a2f40;
    border-left: 3px solid #b48850;
    border-radius: 6px;
    padding: 18px 22px;
    color: #d4cfc4;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    box-shadow: 
        0 3px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    position: relative;
    z-index: 1;
}

/* === 正文区域 === */
.text-content {
    background: rgba(18, 16, 26, 0.65);
    border-left: 3px solid #8c6a8a;
    padding: 24px 28px;
    margin-bottom: 28px;
    border-radius: 6px;
    position: relative;
    box-shadow: 
        inset 0 0 0 1px rgba(180, 140, 100, 0.04),
        0 3px 10px rgba(0, 0, 0, 0.3);
}

.text-content::before {
    content: '◆';
    position: absolute;
    right: 16px;
    top: -10px;
    font-size: 16px;
    color: rgba(180, 136, 80, 0.3);
}

.text-content p {
    margin: 0 0 18px 0;
    text-indent: 2em;
    font-size: 16px;
    color: #e8e2d6 !important; /* 初次调试可以加强制，确保生效 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    line-height: 1.85;
}

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

/* === 对话颜色系统 === */

/* 林汐对话（原 #e74c3c）—— 亮珊瑚红 */
text span[style*="color:#e74c3c"] {
    color: #f0a0a2 !important;
    font-weight: 500;
    text-shadow: 
        0 0 5px rgba(240, 160, 162, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 其他男性对话（原 #5b7a9a）—— 冷钢蓝 */
text span[style*="color:#5b7a9a"] {
    color: #a0b8c8 !important;
    font-weight: 400;
    text-shadow: 
        0 0 4px rgba(160, 184, 200, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 林汐心理活动（原 #9b59b6）—— 亮雾紫 */
text span[style*="color:#9b59b6"] {
    color: #d4b8dc !important;
    font-style: italic;
    opacity: 0.9;
    text-shadow: 
        0 0 4px rgba(212, 184, 220, 0.25),
        0 1px 1px rgba(0, 0, 0, 0.35);
    background: rgba(212, 184, 220, 0.08);
    padding: 0 4px;
    border-radius: 2px;
}

/* === 折叠块通用样式 === */
details {
    background: rgba(22, 20, 32, 0.8);
    border: 1px solid #2f2538;
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

details:hover {
    border-color: #4a3a52;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

details[open] {
    background: rgba(26, 22, 36, 0.92);
    border-color: #5a4858;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

details summary {
    background: linear-gradient(90deg, rgba(40, 32, 46, 0.85) 0%, rgba(30, 24, 36, 0.85) 100%);
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #d4c8b0;
    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: #b48850;
    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(70, 55, 80, 0.35) 0%, rgba(50, 40, 58, 0.35) 100%);
    color: #f0e6d2;
}

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

details[open] summary {
    border-bottom-color: #3a2f40;
    margin-bottom: 16px;
    background: linear-gradient(90deg, rgba(90, 68, 100, 0.45) 0%, rgba(60, 46, 70, 0.45) 100%);
}

details section {
    padding: 18px 22px;
    color: #d4cfc4;
    position: relative;
}

details pre {
    background: rgba(16, 14, 24, 0.9);
    border: 1px solid #2f2538;
    border-left: 3px solid #8c6a8a;
    border-radius: 5px;
    padding: 16px 20px;
    color: #cfc8b8;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 13.5px;
    line-height: 1.7;
    overflow-x: auto;
    margin: 10px 0;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.25);
}

/* === 标题样式 === */
details h4 {
    color: #e0c878;
    font-size: 14.5px;
    margin: 18px 0 10px 0;
    padding-bottom: 7px;
    border-bottom: 1px solid #3a2f40;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
}

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

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

/* === 表格样式 === */
details table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0;
    font-size: 13.5px;
    background: rgba(20, 18, 30, 0.7);
    border: 1px solid #2f2538;
    border-radius: 5px;
    overflow: hidden;
}

details table thead {
    background: linear-gradient(90deg, rgba(65, 50, 75, 0.8) 0%, rgba(42, 32, 50, 0.8) 100%);
}

details table th {
    padding: 12px 10px;
    text-align: left;
    color: #f0e6d2;
    font-weight: 600;
    border-bottom: 2px solid #6a4e6e;
}

details table td {
    padding: 10px;
    border-bottom: 1px solid #2a2032;
    color: #d4cfc4;
    transition: all 0.2s ease;
}

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

details table tbody tr:hover {
    background: rgba(140, 106, 138, 0.06);
}

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

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

details ul li {
    padding: 7px 0 7px 22px;
    position: relative;
    color: #d4cfc4;
    border-bottom: 1px solid rgba(47, 37, 56, 0.35);
    transition: all 0.2s ease;
}

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

details ul li:hover {
    background: rgba(140, 106, 138, 0.04);
    padding-left: 26px;
}

details ul li::before {
    content: "◇";
    position: absolute;
    left: 0;
    color: #8c6a8a;
    font-size: 13px;
    opacity: 0.7;
}

/* === 【核心修正】行动选项面板 === */
.choice-panel {
    background: 
        linear-gradient(145deg, rgba(32, 26, 40, 0.92) 0%, rgba(22, 18, 30, 0.92) 100%);
    border: 1px solid #4a3a52;
    border-top: 2px solid #c49860;
    border-radius: 8px;
    padding: 22px 26px;
    margin-top: 30px;
    box-shadow: 
        0 6px 24px rgba(100, 70, 110, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
}

/* 选项面板内所有文字强制亮色 */
.choice-panel,
.choice-panel * {
    color: #ede4d2 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

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

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

/* 单选选项条目 */
.choice-list li {
    margin: 14px 0;
    padding: 16px 22px;
    background: rgba(28, 22, 36, 0.65);
    border: 1px solid #4a3a52;
    border-left: 4px solid #a078a0;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    color: #f0e6d2 !important;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.7;
}

.choice-list li:hover {
    background: rgba(40, 30, 48, 0.8);
    border-color: #b48850;
    border-left-color: #d4b868;
    transform: translateX(6px);
    color: #fff8e8 !important;
    box-shadow: 
        0 4px 16px rgba(140, 100, 60, 0.2),
        inset 0 0 0 1px rgba(212, 184, 104, 0.1);
}

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

/* 选项编号/字母高亮 */
.choice-list li strong,
.choice-list li b {
    color: #e0c878 !important;
    text-shadow: 0 0 6px rgba(224, 200, 120, 0.35);
}

/* === 段落文本通用 === */
details p {
    margin: 10px 0;
    line-height: 1.8;
    color: #e0d8c8;
}

/* === 强调/数值高亮 === */
details strong,
.status-bar pre strong {
    color: #e0c878;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(224, 200, 120, 0.25);
}

/* === NTR场景专属面板（暗红氛围） === */
.ntr-scene-only {
    border-color: #7a3048 !important;
    background: rgba(28, 18, 24, 0.85) !important;
}

.ntr-scene-only summary {
    background: linear-gradient(90deg, rgba(100, 30, 48, 0.45) 0%, rgba(70, 20, 35, 0.45) 100%) !important;
    color: #e8c8c8 !important;
}

.ntr-scene-only summary:hover {
    background: linear-gradient(90deg, rgba(120, 40, 58, 0.55) 0%, rgba(85, 25, 42, 0.55) 100%) !important;
}

/* === 颜色辅助类 === */
.highlight-gold {
    color: #e0c878 !important;
}

.highlight-coral {
    color: #f0a0a2 !important;
}

.highlight-purple {
    color: #d4b8dc !important;
}

/* === 滚动条 === */
ai ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

ai ::-webkit-scrollbar-track {
    background: rgba(20, 18, 30, 0.5);
    border-radius: 4px;
}

ai ::-webkit-scrollbar-thumb {
    background: #4a3a52;
    border-radius: 4px;
    border: 1px solid rgba(20, 18, 30, 0.5);
}

ai ::-webkit-scrollbar-thumb:hover {
    background: #6a5068;
}

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

/* === 动画 === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

ai {
    animation: fadeInUp 0.5s ease;
}

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

details[open] section {
    animation: slideIn 0.35s ease;
}