/**
 * 魔法使之夜 - Mahoyo Style Base
 * 型月世界观 - 深邃夜空与魔力蓝光
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&display=swap');

:root {
    /* 型月色彩系统 */
    --mahoyo-deep-night: #030810;
    --mahoyo-night-blue: #0a1628;
    --mahoyo-magic-blue: #4080e0;
    --mahoyo-light-blue: #80b8ff;
    --mahoyo-ice-blue: #c0e0ff;
    --mahoyo-white: #e8f0ff;
    --mahoyo-gold: #d4a574;
    --mahoyo-rose: #e07080;
    --mahoyo-violet: #8060c0;
    
    /* 功能色覆盖 */
    --primary-color: #4080e0;
    --primary-glow: rgba(80, 140, 255, 0.5);
    --secondary-color: #e07080;
    --accent-color: #8060c0;
    --bg-dark: #030810;
    --bg-card: rgba(10, 20, 40, 0.92);
    --card-border: rgba(80, 140, 220, 0.25);
    --text-main: #e0e8ff;
    --text-muted: #6080a0;
    --success-color: #60c090;
    --warning-color: #d4a574;
    --danger-color: #e07080;
    
    /* 字体 */
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
    --font-body: 'Noto Serif SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* 覆盖基础样式 - 纯黑背景 */
body {
    background: #000005 !important;
    background-color: #000005 !important;
    background-image: none !important;
    background-size: unset !important;
    font-family: var(--font-body) !important;
    color: var(--text-main);
    line-height: 1.8;
    letter-spacing: 0.5px;
    animation: none !important;
}

/* 移除赛博朋克扫描线和网格 */
body::before,
body::after {
    display: none !important;
    content: none !important;
    background: none !important;
    opacity: 0 !important;
}

/* 隐藏原有的粒子背景 */
.bg-particles,
.bg-particles::before,
.bg-particles::after {
    display: none !important;
    opacity: 0 !important;
}

/* 全局文字样式 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 2px;
    color: #d4a574;
}

/* 滚动条 - 型月风格 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 20, 40, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(80, 140, 220, 0.5) 0%, rgba(60, 100, 180, 0.3) 100%);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(100, 160, 240, 0.7) 0%, rgba(80, 120, 200, 0.5) 100%);
}

/* 选中文字样式 */
::selection {
    background: rgba(80, 140, 220, 0.4);
    color: #ffffff;
}

/* ========================================
   主菜单 - 魔法使之夜风格
   ======================================== */

/* 主菜单纯黑背景 */
.main-menu-root {
    background: #000005 !important;
    background-color: #000005 !important;
}

/* 游戏面板在主菜单时也是纯黑 */
.game-panel:has(.main-menu-root),
.game-panel:not(.game-started) {
    background: #000005 !important;
    background-color: #000005 !important;
}

/* 游戏开始后保持黑色动态背景 */
.game-panel.game-started {
    background: #000005 !important;
    background-color: #000005 !important;
}

/* 容器纯黑 */
.container {
    background: #000005 !important;
    background-color: #000005 !important;
}

/* 状态面板纯黑 */
.status-panel {
    background: #000005 !important;
    background-color: #000005 !important;
}

.status-panel::before {
    display: none !important;
}

/* 游戏历史区域 - 主菜单时纯黑 */
.game-panel:not(.game-started) #gameHistory {
    background: #000005 !important;
}

/* 游戏开始后，对话框区域显示壁纸（在game-xiandai.html中设置） */

/* 移除所有彩色边框线 */
.game-panel:not(.game-started)::before,
.status-panel::before {
    display: none !important;
    opacity: 0 !important;
}

.main-menu-title-cn {
    font-family: var(--font-serif) !important;
    font-size: 120px !important;
    font-weight: 700 !important;
    letter-spacing: 18px !important;
    background: linear-gradient(180deg, 
        #ffffff 0%, 
        #d0e8ff 20%,
        #80c0ff 50%, 
        #4090e0 80%,
        #2060c0 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    filter: drop-shadow(0 0 60px rgba(100, 180, 255, 1)) 
            drop-shadow(0 0 120px rgba(80, 160, 255, 0.8))
            drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)) !important;
    text-shadow: none !important;
}

.main-menu-title-en {
    font-family: 'Cinzel', 'Times New Roman', serif !important;
    font-size: 14px !important;
    letter-spacing: 6px !important;
    color: rgba(140, 180, 255, 0.45) !important;
    text-transform: uppercase !important;
    font-weight: 400 !important;
    margin-top: 24px !important;
    word-spacing: 4px !important;
}

/* 菜单按钮容器 */
.main-menu-buttons {
    background: linear-gradient(180deg, 
        rgba(20, 40, 100, 0.7) 0%, 
        rgba(15, 30, 80, 0.85) 50%,
        rgba(10, 25, 70, 0.9) 100%) !important;
    border: 1px solid rgba(80, 140, 255, 0.4) !important;
    border-radius: 4px !important;
    padding: 12px !important;
    box-shadow: 
        0 0 60px rgba(40, 100, 200, 0.4),
        inset 0 1px 0 rgba(120, 180, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3) !important;
    min-width: 380px !important;
}

.main-menu-button {
    font-family: var(--font-serif) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    letter-spacing: 4px !important;
    padding: 18px 48px !important;
    color: #c0d8ff !important;
    background: rgba(30, 60, 120, 0.4) !important;
    border: 1px solid rgba(80, 140, 220, 0.3) !important;
    border-radius: 2px !important;
    margin: 6px 0 !important;
    transition: all 0.3s ease !important;
}

.main-menu-button:hover {
    color: #ffffff !important;
    background: linear-gradient(180deg, 
        rgba(60, 100, 180, 0.6) 0%, 
        rgba(40, 80, 160, 0.8) 100%) !important;
    border-color: rgba(100, 180, 255, 0.6) !important;
    box-shadow: 
        0 0 30px rgba(80, 150, 255, 0.5),
        inset 0 1px 0 rgba(150, 200, 255, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* ========================================
   游戏面板 - 型月风格
   ======================================== */

.game-panel:not(.game-started) {
    background: linear-gradient(180deg, 
        rgba(6, 12, 24, 0.98) 0%, 
        rgba(4, 8, 18, 1) 100%) !important;
}

#gameHistory {
    padding: 50px 80px !important;
    font-family: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif !important;
    font-size: 16px !important;
    line-height: 2.2 !important;
    color: #c8d8f0 !important;
}

/* AI消息 - 小说风格排版 */
.ai-message {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 0 40px !important;
    margin-bottom: 32px !important;
    position: relative !important;
}

/* AI消息左侧装饰线 */
.ai-message::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 8px !important;
    width: 3px !important;
    height: calc(100% - 16px) !important;
    background: linear-gradient(180deg, 
        rgba(80, 160, 255, 0.6) 0%, 
        rgba(60, 120, 200, 0.3) 50%,
        rgba(80, 160, 255, 0.6) 100%) !important;
    border-radius: 2px !important;
    display: block !important;
    opacity: 1 !important;
}

/* AI图标 */
.ai-message::after {
    content: '✦' !important;
    position: absolute !important;
    left: -6px !important;
    top: 0 !important;
    font-size: 14px !important;
    color: rgba(100, 180, 255, 0.8) !important;
    display: block !important;
    opacity: 1 !important;
}

.ai-message .message-content,
.ai-message .message-text {
    font-family: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif !important;
    font-size: 16px !important;
    line-height: 2.2 !important;
    letter-spacing: 0.5px !important;
    color: #c8d8f0 !important;
    text-align: justify !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-weight: 400 !important;
}

.ai-message .message-content p,
.ai-message .message-text p {
    text-indent: 2em !important;
    margin-bottom: 1.2em !important;
}

/* 对话文字高亮 */
.ai-message .message-content em,
.ai-message .message-text em {
    color: #7eb8ff !important;
    font-style: normal !important;
}

/* 重要文字 */
.ai-message .message-content strong,
.ai-message .message-text strong {
    color: #f0c080 !important;
    font-weight: 500 !important;
}

/* 用户消息 */
.user-message {
    background: rgba(25, 45, 80, 0.5) !important;
    border: 1px solid rgba(80, 140, 200, 0.3) !important;
    border-left: 3px solid rgba(100, 160, 255, 0.6) !important;
    border-radius: 4px !important;
    padding: 16px 24px !important;
    margin-bottom: 20px !important;
}

.user-message .message-content {
    font-family: 'Noto Serif SC', 'Source Han Serif SC', serif !important;
    font-size: 15px !important;
    line-height: 1.8 !important;
    color: #a8c0e0 !important;
    background: transparent !important;
    border: none !important;
}

/* 输入区域 */
.controls,
#gameInputContainer {
    background: rgba(8, 16, 32, 0.95) !important;
    border-top: 1px solid rgba(60, 100, 160, 0.3) !important;
    padding: 24px 80px !important;
}

#userInput {
    font-family: 'Noto Serif SC', 'Source Han Serif SC', serif !important;
    font-size: 15px !important;
    background: rgba(15, 28, 50, 0.8) !important;
    border: 1px solid rgba(60, 100, 160, 0.4) !important;
    border-radius: 4px !important;
    color: #d0e0ff !important;
    padding: 16px 20px !important;
    min-height: 52px !important;
}

#userInput:focus {
    border-color: rgba(100, 160, 255, 0.6) !important;
    box-shadow: 0 0 20px rgba(60, 120, 200, 0.3) !important;
    background: rgba(20, 35, 60, 0.9) !important;
}

#userInput::placeholder {
    color: rgba(100, 140, 180, 0.5) !important;
}

#sendBtn {
    font-family: var(--font-serif) !important;
    font-size: 14px !important;
    letter-spacing: 2px !important;
    background: linear-gradient(180deg, 
        rgba(50, 90, 160, 0.8) 0%, 
        rgba(35, 70, 140, 0.9) 100%) !important;
    border: 1px solid rgba(80, 140, 220, 0.5) !important;
    border-radius: 4px !important;
    color: #e0f0ff !important;
    padding: 16px 28px !important;
}

#sendBtn:hover {
    background: linear-gradient(180deg, 
        rgba(60, 110, 180, 0.9) 0%, 
        rgba(45, 90, 160, 1) 100%) !important;
    box-shadow: 0 0 25px rgba(80, 150, 255, 0.5) !important;
}

/* ========================================
   状态面板 - 型月风格
   ======================================== */

.status-panel {
    background: linear-gradient(180deg, 
        rgba(8, 16, 35, 0.98) 0%, 
        rgba(5, 10, 25, 1) 100%) !important;
    border-right: 1px solid rgba(60, 100, 160, 0.25) !important;
    font-family: var(--font-serif) !important;
}

.status-panel h3,
.status-panel .section-title {
    font-family: var(--font-serif) !important;
    color: #d4a574 !important;
    letter-spacing: 2px !important;
    border-bottom: 1px solid rgba(180, 140, 80, 0.3) !important;
}

/* ========================================
   角色创建 - 型月风格
   ======================================== */

.char-creation-container {
    background: linear-gradient(180deg, 
        rgba(6, 12, 28, 0.99) 0%, 
        rgba(4, 8, 20, 1) 100%) !important;
}

.char-creation-header {
    background: rgba(10, 20, 45, 0.8) !important;
    border-bottom: 1px solid rgba(60, 100, 160, 0.3) !important;
}

.char-creation-logo-text {
    font-family: 'Cinzel', var(--font-serif) !important;
    letter-spacing: 3px !important;
}

.char-creation-tab {
    font-family: var(--font-serif) !important;
}

.char-creation-tab.active {
    background: linear-gradient(180deg, 
        rgba(60, 100, 180, 0.6) 0%, 
        rgba(40, 80, 160, 0.8) 100%) !important;
}

.char-form-label {
    font-family: var(--font-serif) !important;
    color: var(--mahoyo-rose) !important;
}

.char-form-input,
.char-form-select,
.char-form-textarea {
    font-family: var(--font-serif) !important;
    background: rgba(12, 24, 48, 0.9) !important;
    border: 1px solid rgba(60, 100, 160, 0.4) !important;
}

.char-form-input:focus,
.char-form-select:focus,
.char-form-textarea:focus {
    border-color: rgba(100, 160, 255, 0.6) !important;
    box-shadow: 0 0 20px rgba(60, 120, 200, 0.3) !important;
}

.char-creation-next {
    font-family: var(--font-serif) !important;
    background: linear-gradient(180deg, 
        rgba(50, 90, 160, 0.8) 0%, 
        rgba(35, 70, 140, 0.9) 100%) !important;
}

.char-creation-next:hover {
    box-shadow: 0 0 30px rgba(80, 150, 255, 0.5) !important;
}

/* ========================================
   通用组件 - 型月风格
   ======================================== */

/* 按钮通用样式 */
button {
    font-family: var(--font-serif);
}

/* 卡片样式 */
.card, .panel, .modal-content {
    background: rgba(10, 20, 45, 0.95) !important;
    border: 1px solid rgba(60, 100, 160, 0.3) !important;
    border-radius: 4px !important;
}

/* 链接样式 */
a {
    color: var(--mahoyo-light-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--mahoyo-ice-blue);
    text-shadow: 0 0 10px rgba(100, 160, 255, 0.5);
}

/* 位置/时间栏 */
.game-location-bar {
    font-family: var(--font-serif) !important;
    background: rgba(8, 16, 35, 0.9) !important;
    border-bottom: 1px solid rgba(180, 140, 80, 0.2) !important;
    padding: 16px 80px !important;
}

.game-location-name {
    font-family: var(--font-serif) !important;
    letter-spacing: 3px !important;
    color: #d4a574 !important;
}

.game-location-icon {
    color: #d4a574 !important;
}

.game-location-time {
    color: rgba(212, 165, 116, 0.6) !important;
}

/* ========================================
   游戏界面右上角设置按钮
   ======================================== */

.game-header-actions,
.header-actions {
    position: fixed !important;
    top: 16px !important;
    right: 20px !important;
    display: flex !important;
    gap: 12px !important;
    z-index: 100 !important;
}

.game-settings-btn,
.header-btn,
.btn-settings,
[onclick*="openConfigModal"] {
    background: rgba(15, 30, 60, 0.85) !important;
    border: 1px solid rgba(80, 140, 220, 0.4) !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    color: #a0c0e0 !important;
    font-family: var(--font-serif) !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.game-settings-btn:hover,
.header-btn:hover,
.btn-settings:hover,
[onclick*="openConfigModal"]:hover {
    background: rgba(30, 50, 90, 0.9) !important;
    border-color: rgba(100, 160, 255, 0.6) !important;
    color: #e0f0ff !important;
    box-shadow: 0 0 15px rgba(60, 120, 200, 0.4) !important;
}

/* 返回标题按钮 */
[onclick*="showMainMenu"],
.btn-back {
    background: rgba(15, 30, 60, 0.85) !important;
    border: 1px solid rgba(80, 140, 220, 0.4) !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    color: #a0c0e0 !important;
    font-family: var(--font-serif) !important;
    font-size: 13px !important;
}

[onclick*="showMainMenu"]:hover,
.btn-back:hover {
    background: rgba(30, 50, 90, 0.9) !important;
    border-color: rgba(100, 160, 255, 0.6) !important;
    color: #e0f0ff !important;
}

/* ========================================
   手机端适配
   ======================================== */

@media screen and (max-width: 768px) {
    .main-menu-title-cn {
        font-size: 56px !important;
        letter-spacing: 8px !important;
    }
    
    .main-menu-title-en {
        font-size: 10px !important;
        letter-spacing: 4px !important;
    }
    
    .main-menu-buttons {
        min-width: 300px !important;
        width: 90% !important;
    }
    
    .main-menu-button {
        font-size: 14px !important;
        padding: 14px 24px !important;
        letter-spacing: 2px !important;
    }
    
    #gameHistory {
        padding: 24px 20px !important;
    }
    
    .ai-message .message-content,
    .ai-message .message-text {
        font-size: 15px !important;
        line-height: 2.2 !important;
    }
    
    .controls,
    #gameInputContainer {
        padding: 16px 20px !important;
    }
    
    .game-location-bar {
        padding: 12px 20px !important;
    }
}

@media screen and (max-width: 480px) {
    .main-menu-title-cn {
        font-size: 42px !important;
        letter-spacing: 4px !important;
    }
    
    .ai-message .message-content,
    .ai-message .message-text {
        font-size: 14px !important;
        line-height: 2 !important;
    }
}

/* ==================== 魔法使之夜 标题样式 ==================== */
.mahoyo-title {
    font-family: 'Cinzel', 'Noto Serif SC', serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 4px;
    color: transparent;
    background: linear-gradient(
        180deg,
        #e8f4ff 0%,
        #c8e0ff 20%,
        #a0c8f0 40%,
        #80b0e8 60%,
        #6090d0 80%,
        #4070b8 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    text-shadow: 
        0 0 20px rgba(100, 160, 255, 0.4),
        0 0 40px rgba(80, 140, 240, 0.2);
    position: relative;
    padding: 0 10px;
    margin: 0;
}

/* 月光光晕效果 */
.mahoyo-title::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 200%;
    background: radial-gradient(
        ellipse at center,
        rgba(100, 160, 255, 0.15) 0%,
        rgba(80, 140, 240, 0.08) 30%,
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
    animation: mahoyo-glow 4s ease-in-out infinite;
}

/* 星尘装饰 */
.mahoyo-title::after {
    content: '✦';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(180, 210, 255, 0.8);
    animation: mahoyo-star 3s ease-in-out infinite;
}

@keyframes mahoyo-glow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes mahoyo-star {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(-50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}
