/* 容器：羊皮纸质感底色与SVG噪点滤镜 */
ai {
    display: block;
    background-color: #e8d7c1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.12'/%3E%3C/svg%3E");
    color: #3e2a14;
    font-family: "Georgia", "Times New Roman", serif;
    padding: 15px;
    border-radius: 12px;
    box-shadow: inset 0 0 40px rgba(139, 105, 65, 0.2), 0 4px 15px rgba(0,0,0,0.1);
    line-height: 1.6;
    font-size: 14px;
}

/* 折叠模块按钮：深灰玻璃质感 */
ai details summary {
    background: rgba(50, 52, 56, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #dcb388; /* 浅棕色字体 */
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    list-style: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2), inset 0 1px 1px rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}
ai details summary::-webkit-details-marker {
    display: none;
}
ai details summary:hover {
    background: rgba(65, 68, 73, 0.9);
    color: #f0cba3;
}

/* 展开后的模块背景：与聊天背景一致，加圆角边框 */
ai details[open] {
    background: rgba(232, 215, 193, 0.6); /* 浅棕色半透明，融合底色 */
    border: 1px solid rgba(139, 105, 65, 0.4);
    border-radius: 8px;
    padding-bottom: 12px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 10px rgba(139, 105, 65, 0.1);
}
ai details[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 12px;
    box-shadow: none;
}

/* 思维链内部排版 */
ai cot {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 12px;
}
ai q {
    display: block;
    color: #8b4513;
    font-weight: bold;
    font-size: 13px;
    border-left: 3px solid #8b4513;
    padding-left: 6px;
}
ai a {
    display: block;
    color: #5a4634;
    font-size: 13px;
    background: rgba(255,255,255,0.3);
    padding: 6px 10px;
    border-radius: 4px;
}

/* 顶部信息栏 */
ai info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    border-top: 1px dashed rgba(139, 105, 65, 0.4);
    border-bottom: 1px dashed rgba(139, 105, 65, 0.4);
    margin: 10px 0 15px 0;
}
ai info d {
    background: rgba(255, 255, 255, 0.4);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* 正文排版 */
ai article {
    display: block;
    font-size: 15px;
    text-align: justify;
    padding: 0 5px;
    margin-bottom: 15px;
}
ai article p {
    margin-bottom: 12px;
    text-indent: 2em;
}

/* 状态栏分区设计 */
ai p[t] {
    position: relative;
    padding: 25px 12px 10px;
    margin: 15px 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(139, 105, 65, 0.2);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
ai p[t]::before {
    content: attr(t);
    position: absolute;
    top: -10px;
    left: 10px;
    background: #5a4634;
    color: #e8d7c1;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
ai p[t] d {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    padding-bottom: 4px;
    border-bottom: 1px dotted rgba(139, 105, 65, 0.3);
}
ai p[t] d:last-child {
    border-bottom: none;
}

/* Markdown表格与列表美化 */
ai table {
    width: 95%;
    margin: 10px auto;
    border-collapse: collapse;
    font-size: 13px;
    background: rgba(255,255,255,0.3);
}
ai th, ai td {
    border: 1px solid rgba(139, 105, 65, 0.5);
    padding: 6px 10px;
    text-align: left;
}
ai th {
    background: rgba(139, 105, 65, 0.2);
    color: #3e2a14;
}
ai ul {
    padding-left: 20px;
    margin: 10px 15px;
}
ai li {
    margin-bottom: 8px;
    font-size: 14px;
}