/* ============ 通用卡·深夜都市主题 · 空白模板配套版 ============ */

ai {
    display: block;
    padding: 14px;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(40,60,120,.15), transparent 45%),
        radial-gradient(ellipse at 85% 90%, rgba(80,55,120,.12), transparent 45%),
        linear-gradient(135deg, #111318 0%, #181c24 40%, #141820 100%);
    border: 1px solid rgba(160,160,200,.2);
    border-radius: 8px;
    box-shadow:
        inset 0 0 60px rgba(40,60,120,.07),
        inset 0 1px 0 rgba(200,210,255,.06),
        0 4px 20px rgba(0,0,0,.55);
    color: #c8ccd8;
    font-family: "Noto Serif SC","Songti SC","STSong",serif;
    line-height: 1.85;
    position: relative;
    overflow: hidden;
}

ai::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(160,180,255,.4) 20%,
        rgba(200,210,255,.65) 50%,
        rgba(160,180,255,.4) 80%,
        transparent 100%);
    pointer-events: none;
}

ai::after {
    content: "深夜";
    position: absolute;
    top: 10px; right: 14px;
    font-size: 10px;
    color: rgba(180,190,255,.3);
    letter-spacing: 4px;
    writing-mode: vertical-rl;
    font-weight: 300;
    pointer-events: none;
}

cot {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    opacity: .7;
}

cot > details {
    background: linear-gradient(135deg, rgba(15,18,28,.88) 0%, rgba(25,28,42,.88) 100%);
    border: 1px solid rgba(160,180,255,.18);
    border-left: 2px solid rgba(80,100,200,.55);
    border-radius: 4px;
    padding: 10px 14px;
    color: #a8b0c8;
    transition: all .4s ease;
}

cot > details:hover {
    border-left-color: rgba(120,150,255,.8);
    box-shadow: 0 0 18px rgba(80,100,200,.12);
}

cot > details > summary {
    cursor: pointer;
    color: #c8b888;
    font-weight: 500;
    letter-spacing: 2px;
    list-style: none;
    transition: all .4s;
}

cot > details > summary::-webkit-details-marker { display: none; }

cot > details > summary:hover {
    color: #e0d0a8;
    text-shadow: 0 0 10px rgba(220,200,140,.45);
}

cot > details[open] > summary {
    border-bottom: 1px dashed rgba(160,180,255,.25);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

statusTop, statusBottom {
    display: block;
    margin: 14px 0;
}

statusTop details, statusBottom details {
    margin: 10px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg,
        rgba(22,26,38,.78) 0%,
        rgba(28,32,48,.78) 50%,
        rgba(25,28,42,.78) 100%);
    border: 1px solid rgba(160,180,255,.15);
    border-left: 2px solid rgba(80,100,200,.65);
    border-radius: 6px;
    box-shadow:
        inset 0 1px 0 rgba(200,210,255,.05),
        0 2px 10px rgba(0,0,0,.3);
    transition: all .5s cubic-bezier(.4,0,.2,1);
    position: relative;
}

statusTop details::before, statusBottom details::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 40%; height: 100%;
    background: radial-gradient(ellipse at right, rgba(80,100,200,.07), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .5s;
    border-radius: 6px;
}

statusTop details:hover::before, statusBottom details:hover::before { opacity: 1; }

statusTop details:hover, statusBottom details:hover {
    border-left-color: rgba(120,150,255,.9);
    box-shadow:
        inset 0 1px 0 rgba(200,210,255,.08),
        0 4px 20px rgba(80,100,200,.15);
    transform: translateY(-1px);
}

statusTop summary, statusBottom summary {
    cursor: pointer;
    font-weight: 600;
    color: #c8b888;
    letter-spacing: 2.5px;
    padding: 3px 0 3px 22px;
    list-style: none;
    position: relative;
    transition: all .4s;
    font-size: 14px;
}

statusTop summary::-webkit-details-marker,
statusBottom summary::-webkit-details-marker { display: none; }

statusTop summary::before, statusBottom summary::before {
    content: "◆";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    color: rgba(120,150,255,.75);
    font-size: 10px;
    transition: all .5s cubic-bezier(.4,0,.2,1);
    text-shadow: 0 0 6px rgba(120,150,255,.4);
}

statusTop details[open] summary::before,
statusBottom details[open] summary::before {
    transform: translateY(-50%) rotate(90deg);
    color: rgba(160,190,255,1);
    text-shadow: 0 0 10px rgba(160,190,255,.7);
}

statusTop summary:hover, statusBottom summary:hover {
    color: #e0d0a8;
    text-shadow: 0 0 8px rgba(220,200,140,.4);
    letter-spacing: 3px;
}

statusTop table, statusBottom table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
    background: rgba(12,14,22,.45);
    border: 1px solid rgba(160,180,255,.12);
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}

statusTop table::-webkit-scrollbar,
statusBottom table::-webkit-scrollbar {
    height: 4px;
    background: rgba(15,18,28,.5);
    border-radius: 2px;
}

statusTop table::-webkit-scrollbar-thumb,
statusBottom table::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #3a4080, #6878c8, #3a4080);
    border-radius: 2px;
}

statusTop th, statusBottom th {
    background: linear-gradient(135deg,
        rgba(30,40,80,.92) 0%,
        rgba(40,55,100,.92) 50%,
        rgba(35,48,90,.92) 100%);
    color: #c8d0e8;
    padding: 8px 12px;
    text-align: left;
    font-weight: 500;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(160,180,255,.18);
    border-right: 1px solid rgba(160,180,255,.08);
    white-space: nowrap;
    font-size: 12px;
}

statusTop td, statusBottom td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(160,180,255,.07);
    border-right: 1px solid rgba(160,180,255,.04);
    color: #b8bcd0;
    background: rgba(18,22,35,.32);
    transition: background .4s;
    line-height: 1.7;
    white-space: normal;
    word-break: break-all;
    min-width: 60px;
    max-width: 280px;
}

statusTop td[colspan], statusBottom td[colspan] {
    white-space: normal;
    word-break: break-all;
    max-width: 100%;
    min-width: 200px;
    background: rgba(22,28,45,.5);
    color: #b8bcd0;
    line-height: 1.9;
    padding: 10px 14px;
}

statusTop tr:last-child td, statusBottom tr:last-child td { border-bottom: none; }

statusTop tr:hover td, statusBottom tr:hover td {
    background: rgba(40,55,100,.32);
    color: #d8dcea;
}

statusBottom details p {
    margin: 8px 0;
    padding: 8px 14px;
    background: linear-gradient(90deg, rgba(80,100,200,.07) 0%, transparent 60%);
    border-left: 2px solid rgba(80,100,200,.4);
    color: #b0b8d0;
    font-size: 13px;
    line-height: 1.85;
    border-radius: 0 3px 3px 0;
    transition: all .3s;
}

statusBottom details p:hover {
    border-left-color: rgba(120,150,255,.7);
    background: linear-gradient(90deg, rgba(80,100,200,.14) 0%, transparent 60%);
}

statusBottom ol {
    margin: 10px 0 4px 0;
    padding: 0;
    counter-reset: step;
    list-style: none;
}

statusBottom ol li {
    position: relative;
    padding: 10px 14px 10px 40px;
    margin-bottom: 6px;
    background: linear-gradient(90deg, rgba(25,35,70,.6) 0%, rgba(18,22,38,.4) 100%);
    border-left: 2px solid rgba(160,180,255,.35);
    border-radius: 0 4px 4px 0;
    counter-increment: step;
    transition: all .4s cubic-bezier(.4,0,.2,1);
    color: #b8bcd0;
    font-size: 13px;
    line-height: 1.75;
}

statusBottom ol li::before {
    content: counter(step);
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: rgba(160,190,255,.9);
    font-weight: bold;
    font-size: 15px;
    font-family: "Georgia",serif;
    text-shadow: 0 0 8px rgba(160,190,255,.4);
    width: 18px; height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(80,100,200,.3) 0%, transparent 70%);
    border-radius: 50%;
}

statusBottom ol li:hover {
    background: linear-gradient(90deg, rgba(40,60,120,.7) 0%, rgba(28,35,65,.5) 100%);
    border-left-color: rgba(160,190,255,.9);
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(80,100,200,.15);
    color: #d8dcea;
}

statusBottom ul {
    margin: 10px 0 4px 0;
    padding: 0 0 0 6px;
    list-style: none;
}

statusBottom ul li {
    position: relative;
    padding: 8px 12px 8px 24px;
    margin-bottom: 5px;
    background: rgba(18,22,35,.42);
    border-left: 1px dashed rgba(120,150,255,.3);
    color: #a8aec8;
    font-size: 12.5px;
    line-height: 1.75;
    font-style: italic;
    transition: all .3s;
    border-radius: 0 2px 2px 0;
}

statusBottom ul li::before {
    content: "◐";
    position: absolute;
    left: 8px; top: 8px;
    color: rgba(120,150,255,.55);
    font-size: 10px;
    text-shadow: 0 0 4px rgba(120,150,255,.35);
}

statusBottom ul li:hover {
    background: rgba(30,40,75,.6);
    border-left-style: solid;
    border-left-color: rgba(160,190,255,.8);
    color: #c8cce0;
    padding-left: 28px;
}

statusBottom details details {
    margin: 8px 0;
    background: rgba(15,18,28,.5);
    border-left-color: rgba(160,180,255,.28);
}

statusBottom details details summary {
    color: #a8a888;
    font-size: 13px;
    letter-spacing: 2px;
}

/* ============ 正文卷轴·深蓝黑底·去闪版 ============ */

@keyframes scrollFadeIn {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes sealPulse {
    0%,100% {
        box-shadow:
            0 3px 12px rgba(80,100,200,.5),
            inset 0 0 8px rgba(180,200,255,.12);
    }
    50% {
        box-shadow:
            0 5px 16px rgba(80,100,200,.7),
            inset 0 0 12px rgba(180,200,255,.2);
    }
}

article.scroll-body {
    display: block !important;
    position: relative;
    margin: 28px 4px 30px 4px;
    padding: 26px 22px 30px;
    background: #0e1018;
    border-radius: 6px;
    border: 1px solid rgba(160,180,255,.18);
    border-left: 2px solid rgba(80,100,200,.55);
    border-right: 2px solid rgba(80,100,200,.55);
    box-shadow:
        0 8px 32px rgba(0,0,0,.55),
        0 2px 8px rgba(80,100,200,.1),
        inset 0 1px 0 rgba(200,210,255,.03);
    animation: scrollFadeIn .7s ease-out;
    overflow: hidden;
    will-change: opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

article.scroll-body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(80,100,200,.45) 15%,
        rgba(120,160,255,.85) 50%,
        rgba(80,100,200,.45) 85%,
        transparent 100%);
    box-shadow: 0 0 10px rgba(120,160,255,.38);
    pointer-events: none;
    z-index: 3;
}

article.scroll-body::after {
    content: "夜\A未\A竟";
    white-space: pre;
    position: absolute;
    top: 18px; right: 24px;
    font-size: 10px;
    color: rgba(120,160,255,.5);
    line-height: 1.6;
    font-family: "STZhongsong","楷体",serif;
    text-align: center;
    padding: 6px 5px;
    border: 1px solid rgba(120,160,255,.3);
    border-radius: 1px;
    pointer-events: none;
    z-index: 2;
    background: rgba(14,16,24,.6);
}

article.scroll-body p {
    position: relative;
    margin: 0;
    padding: 12px 20px;
    text-indent: 2em;
    color: #c8ccd8;
    line-height: 2.1;
    font-family: "Noto Serif SC","STKaiti","楷体",serif;
    font-size: 15px;
    letter-spacing: .6px;
    text-align: justify;
    z-index: 1;
    background: transparent;
    border-bottom: 1px solid rgba(160,180,255,.05);
}

article.scroll-body p:last-child {
    border-bottom: none;
    padding-bottom: 26px;
}

article.scroll-body > p:first-child {
    padding-top: 30px;
    padding-left: 24px;
    padding-right: 24px;
}

article.scroll-body > p:first-child::before {
    content: "夜";
    position: absolute;
    top: -14px; left: 20px;
    width: 34px; height: 34px;
    background: radial-gradient(circle at 30% 30%, #6888d8 0%, #3a4880 55%, #1a2048 100%);
    color: #e8eaf8;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transform: rotate(-8deg);
    font-family: "STZhongsong","楷体",serif;
    text-indent: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    animation: sealPulse 4s ease-in-out infinite;
    z-index: 3;
    border: 1px solid rgba(180,200,255,.2);
}

article.scroll-body > p:first-child::first-letter {
    font-size: 34px;
    font-weight: 500;
    color: #a8c0e8;
    float: left;
    line-height: 1.05;
    margin: 4px 10px 0 0;
    padding: 4px 10px;
    font-family: "STZhongsong","楷体",serif;
    text-shadow: 0 2px 4px rgba(80,100,200,.45), 0 0 12px rgba(120,160,255,.22);
    border: 1px solid rgba(120,160,255,.32);
    background: rgba(80,100,200,.1);
    border-radius: 3px;
}

article.scroll-body > p:not(:last-child)::after {
    content: "· ◆ ·";
    display: block;
    text-align: center;
    color: rgba(120,160,255,.3);
    letter-spacing: 10px;
    margin-top: 10px;
    font-size: 11px;
    text-indent: 0;
    font-weight: 300;
}

article.scroll-body > p:last-child::after {
    content: "· 夜 语 未 竟 ·";
    display: block;
    text-align: right;
    margin-top: 14px;
    padding-right: 8px;
    font-size: 11px;
    color: rgba(120,160,255,.5);
    letter-spacing: 6px;
    font-family: "STZhongsong","楷体",serif;
    text-indent: 0;
    border-top: 1px dashed rgba(120,160,255,.18);
    padding-top: 10px;
    font-style: italic;
}

article.scroll-body p:hover { color: #e0e4f0; }

/* ============ loading 动画 ============ */

@keyframes dotPulse {
    0%,60%,100% { transform: scale(.8) translateY(0); opacity: .4; }
    30%          { transform: scale(1.1) translateY(-3px); opacity: 1; }
}

.loading,.loading-bubble,.chat-loading,.message-loading,
.ai-loading,[class*="loading"] .bubble,[class*="Loading"],
.typing-indicator,.thinking {
    position: relative !important;
    display: inline-block !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, #0e1018 0%, #181c2a 60%, #0e1018 100%) !important;
    border: 1px solid rgba(160,180,255,.25) !important;
    border-left: 2px solid rgba(80,100,200,.65) !important;
    border-right: 2px solid rgba(80,100,200,.65) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(200,210,255,.04) !important;
    color: #c8b888 !important;
    font-family: "STZhongsong","楷体",serif !important;
    font-size: 12px !important;
    letter-spacing: 5px !important;
    min-width: 100px !important;
    text-align: center !important;
    animation: scrollFadeIn .6s ease-out !important;
}

.loading::before,.loading-bubble::before,.chat-loading::before,
.message-loading::before,.ai-loading::before,
.typing-indicator::before,.thinking::before {
    content: "执 笔 · 落 墨";
    display: inline-block;
    color: #c8b888;
    font-weight: 500;
    margin-right: 10px;
    text-shadow: 0 0 8px rgba(200,180,120,.35);
}

.loading::after,.loading-bubble::after,.chat-loading::after,
.message-loading::after,.ai-loading::after,
.typing-indicator::after,.thinking::after {
    content: "◆◆◆";
    display: inline-block;
    color: rgba(120,160,255,.9);
    letter-spacing: 5px;
    animation: dotPulse 1.6s infinite ease-in-out;
    font-size: 10px;
    text-shadow: 0 0 6px rgba(120,160,255,.6);
}

/* ============ 移动端适配 ============ */

@media screen and (max-width:600px) {
    ai { padding: 10px; }
    ai::after { font-size: 9px; top: 8px; right: 10px; }

    article.scroll-body {
        margin: 22px 2px 26px;
        padding: 20px 14px 24px;
    }
    article.scroll-body::after {
        font-size: 9px; top: 12px; right: 14px; padding: 4px 3px;
    }
    article.scroll-body p {
        font-size: 13.5px; line-height: 1.95; padding: 10px 14px;
    }
    article.scroll-body > p:first-child { padding: 24px 16px 12px; }
    article.scroll-body > p:first-child::before {
        width: 28px; height: 28px; font-size: 15px; left: 14px; top: -12px;
    }
    article.scroll-body > p:first-child::first-letter {
        font-size: 28px; padding: 3px 8px;
    }
    article.scroll-body > p:last-child::after { letter-spacing: 4px; font-size: 10px; }
    article.scroll-body > p:not(:last-child)::after { letter-spacing: 6px; }

    statusTop table, statusBottom table { font-size: 11.5px; }
    statusTop th, statusBottom th { padding: 6px 8px; font-size: 11px; letter-spacing: 1px; }
    statusTop td, statusBottom td { padding: 6px 8px; }
    statusTop summary, statusBottom summary { font-size: 13px; letter-spacing: 2px; }

    statusBottom ol li { padding: 8px 12px 8px 34px; font-size: 12px; }
    statusBottom ol li::before { font-size: 13px; left: 10px; }

    [class*="loading"],.thinking,.typing-indicator {
        padding: 10px 18px !important;
        font-size: 11px !important;
        letter-spacing: 3px !important;
    }
}