ai {
    display: block;
    --bg: #111214;
    --t-main: #d4c8b8;
    --t-dim: #8a7f72;
    --red: #8b1d1d;
    --red-glow: #ff4d4d;
    --gold: #b89947;
    --gold-dim: #7a652e;
    --border: #3a3226;
    --panel: rgba(15,16,19,0.95);
    font-family: 'Noto Serif SC', 'SimSun', 'STSong', serif;
    color: var(--t-main);
    line-height: 1.6;
    font-size: 14.5px;
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

ai hd {
    display: block;
    text-align: center;
    font-size: 1.15em;
    color: var(--gold);
    padding: 30px 10px 15px;
    border-bottom: 1px solid var(--red);
    /* 纯CSS绘制：暗夜红牙飞檐与灯笼微光 SVG背景 */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%25" height="100%25" viewBox="0 0 400 60" preserveAspectRatio="none"><path d="M-20,30 Q100,60 200,20 T420,30 L420,-10 L-20,-10 Z" fill="%2308080a"/><path d="M50,-10 Q150,50 300,10 T420,40 L420,-10 Z" fill="%23131114" stroke="%238b1d1d" stroke-width="1"/><line x1="80" y1="20" x2="80" y2="45" stroke="%23b89947" stroke-width="1"/><rect x="75" y="45" width="10" height="14" rx="3" fill="%238b1d1d"/><ellipse cx="80" cy="52" rx="18" ry="22" fill="%23ff4d4d" opacity="0.25"/><line x1="320" y1="10" x2="320" y2="35" stroke="%23b89947" stroke-width="1"/><rect x="315" y="35" width="10" height="14" rx="3" fill="%238b1d1d"/><ellipse cx="320" cy="42" rx="18" ry="22" fill="%23ff4d4d" opacity="0.25"/></svg>') top center/cover no-repeat;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    margin: -12px -12px 15px -12px;
    border-radius: 6px 6px 0 0;
    font-weight: bold;
    letter-spacing: 1px;
}

ai article {
    display: block;
    padding: 0 5px 15px;
}

ai article p {
    margin-bottom: 0.8em;
    text-align: justify;
}

ai details {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px;
    margin-top: 10px;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
}

ai summary {
    color: var(--gold);
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--gold-dim);
    margin-bottom: 12px;
    font-size: 1.05em;
    transition: color 0.3s;
}

ai summary:hover { color: #fff; }
ai summary::-webkit-details-marker { display: none; }

/* 信息块排版：采用微边框隔离，极简紧凑 */
ai me, ai rep, ai npc, ai mem {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    margin-bottom: 12px;
    background: linear-gradient(90deg, rgba(20,22,26,0.8) 0%, transparent 100%);
    border-left: 2px solid var(--border);
    border-radius: 0 4px 4px 0;
}

ai npc { border-left-color: var(--gold-dim); }
ai rep { border-left-color: var(--red); }
ai me { border-left-color: var(--t-dim); }

/* 自定义字段标签 */
ai f {
    font-size: 1.1em;
    color: var(--gold);
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 1px 2px #000;
}

ai r {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 0.8em;
    vertical-align: 1px;
    box-shadow: 0 0 5px rgba(139,29,29,0.5);
}

ai d {
    display: block;
    color: var(--t-dim);
    font-size: 0.95em;
    transition: all 0.2s;
}

ai d::before {
    content: '♦';
    color: var(--gold-dim);
    margin-right: 5px;
    font-size: 0.8em;
}

ai npc d:hover {
    color: var(--t-main);
    background: rgba(139,29,29,0.15);
    padding-left: 4px;
    border-radius: 2px;
}

/* ★ 临界警示：心跳红光呼吸动画 */
ai d[danger] {
    color: #fff;
    animation: heartPulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background: rgba(139,29,29,0.1);
    padding: 2px 5px;
    border-radius: 3px;
    border-left: 2px solid var(--red-glow);
}

ai d[danger]::before { content: '⚠️'; margin-right: 6px; }

@keyframes heartPulse {
    0%, 100% { text-shadow: 0 0 5px var(--red); box-shadow: inset 0 0 0 transparent; }
    50% { text-shadow: 0 0 10px var(--red-glow), 0 0 20px var(--red); box-shadow: inset 50px 0 30px -30px rgba(255,77,77,0.3); }
}

/* ★ 行动选项：宋代画卷缓缓展开动画 */
ai act {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 15px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

ai act a {
    display: block;
    background: linear-gradient(90deg, rgba(139,29,29,0.2) 0%, rgba(20,22,26,0) 100%);
    border-left: 3px solid var(--red);
    padding: 8px 12px;
    color: var(--t-main);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    
    /* 核心动画：利用遮罩实现横向铺开 */
    animation: scrollUnroll 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

ai act a:hover {
    background: linear-gradient(90deg, var(--red) 0%, rgba(20,22,26,0) 100%);
    color: #fff;
    padding-left: 18px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* 为前6个选项依次增加动画延迟，呈现依次展开的视觉盛宴 */
ai act a:nth-child(1) { animation-delay: 0.1s; }
ai act a:nth-child(2) { animation-delay: 0.25s; }
ai act a:nth-child(3) { animation-delay: 0.4s; }
ai act a:nth-child(4) { animation-delay: 0.55s; }
ai act a:nth-child(5) { animation-delay: 0.7s; }
ai act a:nth-child(6) { animation-delay: 0.85s; }

@keyframes scrollUnroll {
    0% { clip-path: inset(0 100% 0 0); opacity: 0; transform: translateX(-15px); }
    100% { clip-path: inset(0 0 0 0); opacity: 1; transform: translateX(0); }
}