/* ========== 校园风格全局CSS ========== */
/* 
   色调体系：
   【主色】奶油白 #fdfaf5（纸张底色）
   【强调色】暖杏橘 #c97d4a（沈蜜的温柔氛围）
   【对比色】青蓝灰 #6b8a9a（林晓夏的少年气质）
   【中性色】浅灰绿 #b0b8a4 / 深棕褐 #4a3c2d
   【点缀色】淡金 #d4a574（阳光暖意）/ 黑板绿 #2e4036
   参考氛围：午后阳光穿过树叶洒在课桌上的感觉
*/

/* === 全局容器 === */
ai {
    display: block;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Serif SC', serif;
    line-height: 1.8;
    color: #3a3028;
    background: 
        /* 最底层：柔和米白底 - 上午带凉意的暖白 */
        linear-gradient(175deg, #fdfaf3 0%, #f7f0e4 40%, #fef9f2 100%),
        /* 第二层：淡抹茶绿底调，模拟窗外树叶反光 - 上午树叶的冷绿 */
        radial-gradient(ellipse at 85% 15%, rgba(150, 170, 140, 0.13) 0%, transparent 55%),
        /* 第三层：淡灰蓝底调，模拟窗外天空漫反射 - 上午天空的淡蓝 */
        radial-gradient(ellipse at 5% 90%, rgba(140, 160, 180, 0.09) 0%, transparent 55%),
        /* 第四层：极其克制的暖色光斑，模拟阳光穿过树叶的极小光晕 - 上午阳光偏冷白 */
        radial-gradient(circle at 70% 30%, rgba(220, 200, 160, 0.08) 0%, transparent 35%),
        /* 第五层：笔记本横格线纹理 */
        repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(180, 170, 150, 0.07) 27px, rgba(180, 170, 150, 0.07) 28px);
    padding: 28px;
    border-radius: 10px;
    box-shadow: 
        /* 外阴影：课桌边缘的自然投影 */
        0 4px 20px rgba(60, 50, 30, 0.15),
        0 1px 3px rgba(60, 50, 30, 0.08),
        /* 内边框：极淡的灰蓝，像纸张边缘的阴影 */
        inset 0 0 0 1px rgba(140, 150, 160, 0.12);
    position: relative;
    overflow: hidden;
    /* 可选：添加极淡的纸张纹理噪点 */
    /* 如果不需要纹理可以注释掉下面这行 */
    /* background-image: url('data:image/svg+xml,...'); 纸张噪点太复杂，先跳过 */
}

ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        /* 模拟午后阳光从右上角洒入的暖光带 */
        linear-gradient(135deg, rgba(255, 245, 225, 0.5) 0%, transparent 45%),
        /* 桌面轻微的横向木纹 */
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(160, 140, 110, 0.03) 3px, rgba(160, 140, 110, 0.03) 5px);
    z-index: -1;
    pointer-events: none;
}

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

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

.status-bar::before {
    content: '🍂'; /* 或 📋 便签板emoji，但🍂更有校园秋天的温柔感 */
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    opacity: 0.5;
}

.status-bar pre {
    background: rgba(252, 250, 245, 0.9);
    border: 1px solid rgba(180, 160, 140, 0.3);
    border-left: 3px solid #c97d4a;  /* 暖杏橘强调 */
    border-radius: 6px;
    padding: 18px 22px;
    color: #3a3028;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    overflow-x: auto;
    box-shadow: 
        0 2px 8px rgba(80, 60, 40, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
}

/* === 正文区域 === */
.text-content {
    background: rgba(254, 251, 245, 0.8);
    border-left: 3px solid #6b8a9a;  /* 青蓝灰对比 */
    padding: 24px 28px;
    margin-bottom: 28px;
    border-radius: 6px;
    position: relative;
    box-shadow: 
        inset 0 0 0 1px rgba(140, 150, 160, 0.06),
        0 2px 8px rgba(80, 60, 40, 0.06);
}

.text-content::before {
    content: '◆';
    position: absolute;
    right: 16px;
    top: -10px;
    font-size: 14px;
    color: rgba(180, 160, 140, 0.25);
}

.text-content p {
    margin: 0 0 18px 0;
    text-indent: 2em;
    font-size: 16px;
    color: #3a3028 !important;
    text-shadow: none;
    line-height: 1.85;
}

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

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

/* 沈蜜的对话——暖枫叶色 #e07b5a（温柔、自然、青梅竹马的熟稔） */
text span[style*="color:#e88ca5"],
span[style*="color:#e88ca5"] {
    color: #e07b5a !important;
    font-weight: 500;
    text-shadow: none;
    background: rgba(224, 123, 90, 0.06);
    padding: 0 2px;
    border-radius: 2px;
}

/* 林晓夏的对话——青蓝灰 #7b9aaa（少年气、疏离但不过分冷） */
text span[style*="color:#d4a76a"],
span[style*="color:#d4a76a"] {
    color: #7b9aaa !important;
    font-weight: 500;
    text-shadow: none;
    background: rgba(123, 154, 170, 0.06);
    padding: 0 2px;
    border-radius: 2px;
}

/* 林晓夏内心独白（模式B雌化状态下的脆弱面）——暖灰绿 #8a9a8a */
text span[style*="color:#b8a9c9"],
span[style*="color:#b8a9c9"] {
    color: #8a9a8a !important;
    font-style: italic;
    opacity: 0.88;
    text-shadow: none;
    background: rgba(138, 154, 138, 0.08);
    padding: 0 4px;
    border-radius: 2px;
}

/* 林晓夏常规心理活动（非雌化状态的想法）——淡灰绿 #9aaa9a */
span[style*="color:#c0b0c0"] {
    color: #9aaa9a !important;
    font-style: italic;
    opacity: 0.85;
}

/* === 折叠块通用样式 === */
details {
    background: rgba(252, 250, 245, 0.75);
    border: 1px solid rgba(180, 160, 140, 0.2);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

details:hover {
    border-color: rgba(180, 160, 140, 0.35);
    box-shadow: 0 4px 14px rgba(80, 60, 40, 0.08);
    transform: translateY(-1px);
}

details[open] {
    background: rgba(254, 251, 245, 0.92);
    border-color: rgba(180, 160, 140, 0.4);
    box-shadow: 0 4px 16px rgba(80, 60, 40, 0.1);
}

details summary {
    background: linear-gradient(90deg, rgba(245, 240, 230, 0.8) 0%, rgba(250, 247, 238, 0.8) 100%);
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: #3a3028;
    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: #c97d4a;
    margin-left: auto;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

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

details summary:hover {
    background: linear-gradient(90deg, rgba(240, 235, 220, 0.9) 0%, rgba(248, 243, 230, 0.9) 100%);
    color: #1a1814;
}

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

details[open] summary {
    border-bottom-color: rgba(180, 160, 140, 0.3);
    margin-bottom: 16px;
    background: linear-gradient(90deg, rgba(235, 225, 210, 0.9) 0%, rgba(245, 238, 222, 0.9) 100%);
}

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

details pre {
    background: rgba(250, 247, 240, 0.85);
    border: 1px solid rgba(180, 160, 140, 0.2);
    border-left: 3px solid #b0b8a4;  /* 浅灰绿 */
    border-radius: 5px;
    padding: 16px 20px;
    color: #3a3028;
    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 2px rgba(0, 0, 0, 0.04),
        0 1px 4px rgba(80, 60, 40, 0.04);
}

/* === 标题样式 === */
details h4 {
    color: #c97d4a;
    font-size: 14.5px;
    margin: 18px 0 10px 0;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(180, 160, 140, 0.3);
    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, #c97d4a, transparent);
}

/* === 表格样式 === */
details table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 14px 0;
    font-size: 13.5px;
    background: rgba(252, 249, 242, 0.6);
    border: 1px solid rgba(180, 160, 140, 0.18);
    border-radius: 5px;
    overflow: hidden;
}

details table thead {
    background: linear-gradient(90deg, rgba(235, 225, 210, 0.7) 0%, rgba(242, 235, 220, 0.7) 100%);
}

details table th {
    padding: 12px 10px;
    text-align: left;
    color: #3a3028;
    font-weight: 600;
    border-bottom: 2px solid rgba(201, 125, 74, 0.3);
}

details table td {
    padding: 10px;
    border-bottom: 1px solid rgba(200, 190, 170, 0.3);
    color: #3a3028;
    transition: all 0.2s ease;
}

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

details table tbody tr:hover {
    background: rgba(201, 125, 74, 0.04);
}

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

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

details ul li {
    padding: 7px 0 7px 22px;
    position: relative;
    color: #3a3028;
    border-bottom: 1px solid rgba(200, 190, 170, 0.25);
    transition: all 0.2s ease;
}

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

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

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

/* === 行动选项面板 === */
.choice-panel {
    background: 
        linear-gradient(145deg, rgba(252, 249, 242, 0.9) 0%, rgba(248, 243, 234, 0.9) 100%);
    border: 1px solid rgba(180, 160, 140, 0.3);
    border-top: 2px solid #c97d4a;
    border-radius: 8px;
    padding: 22px 26px;
    margin-top: 30px;
    box-shadow: 
        0 4px 16px rgba(100, 70, 40, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    position: relative;
}

.choice-panel,
.choice-panel * {
    color: #3a3028 !important;
    text-shadow: none !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(252, 249, 242, 0.6);
    border: 1px solid rgba(180, 160, 140, 0.2);
    border-left: 4px solid #6b8a9a;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    color: #3a3028 !important;
    font-weight: 500;
    text-shadow: none;
    line-height: 1.7;
}

.choice-list li:hover {
    background: rgba(250, 245, 235, 0.85);
    border-color: #c97d4a;
    border-left-color: #c97d4a;
    transform: translateX(6px);
    color: #1a1814 !important;
    box-shadow: 
        0 4px 12px rgba(160, 120, 80, 0.12),
        inset 0 0 0 1px rgba(201, 125, 74, 0.08);
}

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

.choice-list li strong,
.choice-list li b {
    color: #c97d4a !important;
}

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

/* === 强调/数值高亮 === */
details strong,
.status-bar pre strong {
    color: #c97d4a;
    font-weight: 600;
}

/* === 记忆区计时器（小提示条） === */
.memory-timer {
    background: rgba(200, 190, 170, 0.15);
    border-left: 3px solid #b0b8a4;
    padding: 8px 14px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 13px;
    color: #5a5040;
}

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

.highlight-pink {
    color: #e07b5a !important;  /* 沈蜜暖枫叶色 */
}

.highlight-purple {
    color: #6b8a9a !important;  /* 林晓夏青蓝灰 */
}

/* === 滚动条：浅色主题 === */
ai ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

ai ::-webkit-scrollbar-track {
    background: rgba(240, 235, 225, 0.4);
    border-radius: 4px;
}

ai ::-webkit-scrollbar-thumb {
    background: rgba(180, 160, 140, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(200, 190, 170, 0.3);
}

ai ::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 140, 120, 0.45);
}

/* === 响应式 === */
@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;
}
