/* ============================================
   Xerath-7·欲潮之星 完整CSS·v5·class驱动版
   ============================================ */

/* ===== game-wrap 总容器 ===== */
.game-wrap {
    background: linear-gradient(160deg, #0a0510 0%, #12081a 40%, #0d0814 70%, #0a0510 100%);
    border: 1px solid #3a2c4a;
    border-radius: 10px;
    padding: 16px;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(139, 58, 92, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 0 60px rgba(0, 0, 0, 0.4);
}

.game-wrap::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 58, 92, 0.12) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.game-wrap::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(74, 44, 90, 0.15) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

/* ===== hd 头部栏 ===== */
.game-wrap hd {
    display: block;
    background: linear-gradient(135deg, #1a0d1a 0%, #2d1f2d 100%);
    border: 1px solid #4a2c4a;
    border-left: 4px solid #8b3a5c;
    padding: 12px 16px;
    margin-bottom: 12px;
    color: #e8d4e8 !important;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 13px;
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(139, 58, 92, 0.25);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.game-wrap hd::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 100% 50%, rgba(139, 58, 92, 0.15), transparent 60%);
    pointer-events: none;
}

.game-wrap hd::after {
    content: '⬢';
    position: absolute;
    top: 8px; right: 12px;
    color: rgba(139, 58, 92, 0.4);
    font-size: 18px;
    pointer-events: none;
}

/* ===== game-text 正文容器 ===== */
.game-wrap .game-text {
    display: block;
    background: linear-gradient(180deg, rgba(20, 16, 26, 0.95) 0%, rgba(26, 20, 32, 0.98) 100%);
    border: 1px solid rgba(107, 58, 92, 0.3);
    border-left: 3px solid #6b3a5c;
    padding: 24px 28px 20px 32px;
    margin: 12px 0;
    line-height: 1.95;
    border-radius: 4px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), inset 2px 0 8px rgba(139, 58, 92, 0.1);
    position: relative;
    font-family: 'Georgia', 'Noto Serif SC', 'STSong', serif;
    animation: textBreath 8s ease-in-out infinite;
}

.game-wrap .game-text::before {
    content: '❋';
    position: absolute;
    top: 8px; left: 12px;
    color: rgba(139, 58, 92, 0.35);
    font-size: 14px;
}

/* ===== 正文段落·game-p·高权重强制颜色 ===== */
.game-wrap .game-text p.game-p,
div.game-wrap div.game-text p.game-p,
.game-wrap div.game-text p.game-p {
    display: block !important;
    margin: 0 0 18px 0 !important;
    text-indent: 2em !important;
    text-align: justify !important;
    color: #d4c8c4 !important;
    line-height: 1.95 !important;
    letter-spacing: 0.5px !important;
    font-size: 15px !important;
    font-family: 'Georgia', 'Noto Serif SC', 'STSong', serif !important;
    background: transparent !important;
}

.game-wrap .game-text p.game-p:last-child {
    margin-bottom: 0 !important;
}

.game-wrap .game-text p.game-p:first-child {
    text-indent: 0 !important;
}

.game-wrap .game-text p.game-p:first-child::first-letter {
    float: left;
    font-size: 3.2em;
    line-height: 0.9;
    padding: 6px 8px 0 0;
    font-weight: bold;
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #ff8bb0, #8b3a5c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-wrap .game-text p.game-p:last-child::after {
    content: '❈';
    display: inline-block;
    margin-left: 8px;
    color: rgba(139, 58, 92, 0.5);
    font-size: 12px;
    vertical-align: super;
}

.game-wrap .game-text p.game-p::first-line {
    color: #f0e6e0;
    letter-spacing: 0.6px;
}

.game-wrap .game-text:hover p.game-p {
    color: #b0a4a0 !important;
    transition: color 0.3s ease;
}

.game-wrap .game-text:hover p.game-p:hover {
    color: #f0e6e0 !important;
}

/* 正文内的强调 */
.game-wrap .game-text b,
.game-wrap .game-text strong {
    color: #ffb8d8 !important;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 184, 216, 0.3);
}

.game-wrap .game-text i,
.game-wrap .game-text em {
    color: #c8a8d8 !important;
    font-style: italic;
}

.game-wrap .game-text u {
    color: #ff9d5a !important;
    border-bottom: 1px dashed rgba(255, 157, 90, 0.6);
    text-decoration: none;
}

.game-wrap .game-text mark {
    background: linear-gradient(180deg, transparent 50%, rgba(255, 139, 176, 0.25) 50%);
    color: #ffd4e8 !important;
    padding: 0 2px;
}

.game-wrap .game-text hr {
    margin: 24px auto;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 58, 92, 0.4), rgba(255, 139, 176, 0.6), rgba(139, 58, 92, 0.4), transparent);
    border: none;
}

/* ===== details 折叠面板 ===== */
.game-wrap details {
    background: linear-gradient(135deg, #0f0a14 0%, #1a1220 100%);
    border: 1px solid #3a2c4a;
    border-radius: 6px;
    margin: 8px 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.game-wrap details:hover {
    border-color: #6b3a5c;
    box-shadow: 0 0 15px rgba(139, 58, 92, 0.2);
}

.game-wrap details[open] {
    background: linear-gradient(135deg, #14101a 0%, #1e1626 100%);
}

.game-wrap details summary {
    padding: 10px 16px;
    cursor: pointer;
    color: #e8d4e8 !important;
    font-weight: 600;
    font-size: 14px;
    background: linear-gradient(90deg, #2a1a2a 0%, #1a1220 100%);
    list-style: none;
    transition: all 0.25s ease;
    user-select: none;
}

.game-wrap details summary::-webkit-details-marker {
    display: none;
}

.game-wrap details summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s ease;
    color: #8b3a5c;
    font-size: 10px;
}

.game-wrap details[open] summary::before {
    transform: rotate(90deg);
    color: #ff8bb0;
}

.game-wrap details summary:hover {
    background: linear-gradient(90deg, #3a1f3a 0%, #2a1626 100%);
    color: #ffb8d8 !important;
}

/* ===== game-panel 面板内容容器 ===== */
.game-wrap .game-panel {
    display: block;
    padding: 6px 0;
}

.game-wrap .game-panel p,
.game-wrap details .game-panel p,
div.game-wrap details .game-panel p {
    display: block !important;
    padding: 4px 18px !important;
    color: #c8b4c8 !important;
    font-size: 13px !important;
    line-height: 1.75 !important;
    margin: 4px 0 !important;
    background: transparent !important;
}

.game-wrap .game-panel b,
.game-wrap details .game-panel b {
    color: #ff8bb0 !important;
    font-weight: 600;
}

/* 血条颜色 */
.game-wrap span[style*="color:red"],
.game-wrap span[style*="color: red"] {
    color: #ff5a7a !important;
    text-shadow: 0 0 4px rgba(255, 90, 122, 0.5);
    font-weight: bold;
}

.game-wrap span[style*="color:orange"],
.game-wrap span[style*="color: orange"] {
    color: #ff9d5a !important;
    text-shadow: 0 0 3px rgba(255, 157, 90, 0.4);
}

.game-wrap span[style*="color:green"],
.game-wrap span[style*="color: green"] {
    color: #5affaa !important;
    text-shadow: 0 0 3px rgba(90, 255, 170, 0.4);
}

/* 思维链 */
.game-wrap details.think-chain {
    background: linear-gradient(135deg, #0a0f14 0%, #121820 100%);
    border: 1px dashed #3a4a5c;
}

.game-wrap details.think-chain summary {
    background: linear-gradient(90deg, #1a2a3a 0%, #12181c 100%);
    color: #8ba8c8 !important;
    font-style: italic;
    font-size: 12px;
}

.game-wrap details.think-chain summary::before {
    color: #4a6b8b;
}

.game-wrap details.think-chain[open] summary::before {
    color: #7ba8d8;
}

.game-wrap details.think-chain p {
    color: #8ba8c8 !important;
    font-size: 12px;
    font-family: 'Consolas', monospace;
    padding: 4px 18px;
}

.game-wrap details.think-chain[open] {
    animation: softGlow 3s ease-in-out infinite;
}

/* ===== opts 选项区 ===== */
.game-wrap opts {
    display: block;
    margin-top: 18px;
    padding: 14px;
    background: linear-gradient(180deg, #14101a 0%, #0f0a14 100%);
    border: 1px solid #3a2c4a;
    border-radius: 6px;
    position: relative;
}

.game-wrap opts::before {
    content: '选择你的行动';
    display: block;
    color: #6b8a6b !important;
    font-size: 11px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #3a4a3a;
    text-transform: uppercase;
}

.game-wrap opts div[data-action="append-textinput"] {
    display: block;
    padding: 10px 16px;
    margin: 6px 0;
    background: linear-gradient(90deg, #2a1a2a 0%, #1a1220 100%);
    border: 1px solid #4a2c4a;
    border-left: 3px solid #6b3a5c;
    color: #d8c4d8 !important;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 4px;
    font-size: 13px;
    position: relative;
}

.game-wrap opts div[data-action="append-textinput"]::after {
    content: '➤';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(139, 58, 92, 0.5);
    font-size: 11px;
    transition: all 0.25s ease;
}

.game-wrap opts div[data-action="append-textinput"]:hover {
    background: linear-gradient(90deg, #3a1f3a 0%, #2a1626 100%);
    border-left-color: #ff8bb0;
    color: #ffd4e8 !important;
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(139, 58, 92, 0.3);
}

.game-wrap opts div[data-action="append-textinput"]:hover::after {
    color: #ff8bb0;
    transform: translateY(-50%) translateX(4px);
}

/* ===== 战术标签 ===== */
.game-wrap .tag-atk {
    display: inline-block;
    padding: 2px 9px;
    background: linear-gradient(90deg, #4a1a1a 0%, #6b2a2a 100%);
    border: 1px solid #8b3a3a;
    border-radius: 3px;
    color: #ffb8b8 !important;
    font-size: 11px;
    margin-left: 6px;
    font-family: 'Consolas', monospace;
}

.game-wrap .tag-def {
    display: inline-block;
    padding: 2px 9px;
    background: linear-gradient(90deg, #1a4a3a 0%, #2a6b4a 100%);
    border: 1px solid #3a8b6a;
    border-radius: 3px;
    color: #b8ffd4 !important;
    font-size: 11px;
    margin-left: 6px;
    font-family: 'Consolas', monospace;
}

.game-wrap .tag-sen {
    display: inline-block;
    padding: 2px 9px;
    background: linear-gradient(90deg, #4a1a4a 0%, #6b2a6b 100%);
    border: 1px solid #8b3a8b;
    border-radius: 3px;
    color: #ffb8ff !important;
    font-size: 11px;
    margin-left: 6px;
    font-family: 'Consolas', monospace;
}

.game-wrap .tag-run {
    display: inline-block;
    padding: 2px 9px;
    background: linear-gradient(90deg, #4a3a1a 0%, #6b5a2a 100%);
    border: 1px solid #8b7a3a;
    border-radius: 3px;
    color: #ffe8b8 !important;
    font-size: 11px;
    margin-left: 6px;
    font-family: 'Consolas', monospace;
}

/* ===== 滚动条 ===== */
.game-wrap ::-webkit-scrollbar { width: 6px; }
.game-wrap ::-webkit-scrollbar-track { background: rgba(20, 15, 25, 0.5); border-radius: 3px; }
.game-wrap ::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4a2c4a, #6b3a5c); border-radius: 3px; }
.game-wrap ::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #6b3a5c, #8b4a70); }

/* ===== 选中颜色 ===== */
.game-wrap ::selection {
    background: rgba(139, 58, 92, 0.5);
    color: #ffd4e8;
}

/* ============================================
   平台界面美化
   ============================================ */

#app, #root, .app, .chat-container, .main-container, main {
    background: linear-gradient(135deg, #0a0510 0%, #12081a 50%, #0a0510 100%) !important;
    color: #d8c4d8 !important;
    min-height: 100vh;
}

header, .header, .top-bar, .nav-bar {
    background: linear-gradient(180deg, #1a0d1a 0%, #14081a 100%) !important;
    border-bottom: 1px solid #3a2c4a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    color: #e8d4e8 !important;
}

.user-message, .message-user, .msg-user, [data-role="user"], .chat-user {
    background: linear-gradient(135deg, #2a1a3a 0%, #1a1226 100%) !important;
    border: 1px solid #4a2c5a !important;
    border-radius: 12px 12px 4px 12px !important;
    padding: 12px 16px !important;
    color: #e8d4f8 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    max-width: 85%;
    margin: 8px 8px 8px auto !important;
}

.ai-message, .message-ai, .msg-ai, .assistant-message, [data-role="assistant"], .chat-assistant {
    background: linear-gradient(135deg, #14101a 0%, #1a1420 100%) !important;
    border: 1px solid #3a2c4a !important;
    border-radius: 12px 12px 12px 4px !important;
    padding: 16px !important;
    color: #d8c4d8 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
    max-width: 95%;
    margin: 8px 8px 8px 0 !important;
}

textarea, input[type="text"] {
    background: linear-gradient(180deg, #14101a 0%, #0f0a14 100%) !important;
    border: 1px solid #4a2c4a !important;
    color: #e8d4e8 !important;
    border-radius: 6px !important;
}

textarea:focus, input[type="text"]:focus {
    outline: none !important;
    border-color: #8b3a5c !important;
    box-shadow: 0 0 0 2px rgba(139, 58, 92, 0.2) !important;
    animation: focusPulse 2s ease-in-out infinite;
}

textarea::placeholder, input::placeholder {
    color: #6a5a6a !important;
    font-style: italic;
}

button, .btn, .button, [role="button"] {
    background: linear-gradient(135deg, #4a2c4a 0%, #6b3a5c 100%) !important;
    border: 1px solid #8b3a5c !important;
    color: #ffd4e8 !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.25s ease !important;
}

button:hover, .btn:hover, .button:hover {
    background: linear-gradient(135deg, #6b3a5c 0%, #8b4a70 100%) !important;
    box-shadow: 0 4px 12px rgba(139, 58, 92, 0.4) !important;
    transform: translateY(-1px);
}

button[type="submit"], .send-button, .btn-send {
    background: linear-gradient(135deg, #8b3a5c 0%, #a94a70 100%) !important;
    border-color: #ff8bb0 !important;
    color: #ffffff !important;
}

.quick-reply-btn, .suggestion-item, .quick-reply {
    background: linear-gradient(90deg, #2a1a2a 0%, #3a1f3a 100%) !important;
    border: 1px solid #4a2c4a !important;
    color: #d8c4d8 !important;
    border-radius: 16px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
}

.quick-reply-btn:hover, .suggestion-item:hover, .quick-reply:hover {
    background: linear-gradient(90deg, #4a2c4a 0%, #6b3a5c 100%) !important;
    color: #ffb8d8 !important;
    border-color: #ff8bb0 !important;
}

a {
    color: #ff8bb0 !important;
    text-decoration: none !important;
}

a:hover {
    color: #ffb8d8 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #ffb8d8 !important;
}

::selection {
    background: rgba(139, 58, 92, 0.5);
    color: #ffd4e8;
}

/* ============================================
   动画
   ============================================ */

@keyframes textBreath {
    0%, 100% { box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), inset 2px 0 8px rgba(139, 58, 92, 0.1); }
    50% { box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.4), inset 2px 0 12px rgba(139, 58, 92, 0.2); }
}

@keyframes softGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(139, 58, 92, 0.2); }
    50% { box-shadow: 0 0 15px rgba(139, 58, 92, 0.4); }
}

@keyframes dangerText {
    0%, 100% { text-shadow: 0 0 6px rgba(255, 90, 122, 0.4); }
    50% { text-shadow: 0 0 12px rgba(255, 90, 122, 0.8); }
}

@keyframes focusPulse {
    0%, 100% { border-color: #8b3a5c; }
    50% { border-color: #ff8bb0; }
}

@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message, .user-message, .message-user, .message-ai {
    animation: messageSlideIn 0.4s ease-out;
}

/* ============================================
   移动端适配
   ============================================ */

@media (max-width: 768px) {
    .game-wrap { padding: 10px; border-radius: 6px; }
    .game-wrap hd { font-size: 12px; padding: 10px 12px; }
    .game-wrap .game-text { padding: 14px 16px 12px 18px; line-height: 1.85; }
    .game-wrap .game-text p.game-p { font-size: 14px !important; line-height: 1.85 !important; }
    .game-wrap .game-text p.game-p:first-child::first-letter { font-size: 2.8em; }
    .game-wrap details summary { padding: 10px 12px; font-size: 13px; }
    .game-wrap .game-panel p { padding: 6px 14px !important; font-size: 12px !important; }
    .game-wrap opts div[data-action="append-textinput"] { padding: 12px 14px; font-size: 13px; }
    .game-wrap .tag-atk, .game-wrap .tag-def, .game-wrap .tag-sen, .game-wrap .tag-run { font-size: 10px; padding: 2px 6px; }
    button, .btn { padding: 10px 16px !important; font-size: 14px !important; }
    .ai-message, .user-message { max-width: 92% !important; padding: 12px !important; font-size: 14px !important; }
}