/* 易经算卦小助手 - 中国传统文化风格CSS */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 传统中国色彩 */
    --primary-color: #8B0000; /* 深红 */
    --secondary-color: #D4AF37; /* 金色 */
    --background-dark: #1a1a2e; /* 深蓝黑 */
    --background-light: #16213e; /* 深蓝 */
    --text-light: #f5f5f5;
    --text-muted: #b0b0b0;
    --accent-color: #c9a227; /* 亮金 */
    --border-color: #333;
    --success-color: #2e7d32;
    --warning-color: #f57c00;
    --error-color: #c62828;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-light) 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 30px;
    position: relative;
}

.header::before {
    content: '☰ ☷ ☵ ☲ ☴ ☳ ☶ ☱';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: var(--secondary-color);
    letter-spacing: 20px;
    opacity: 0.6;
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-symbol {
    font-size: 48px;
    color: var(--secondary-color);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 5px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 10px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 30px;
    flex: 1;
    margin-bottom: 30px;
}

/* 侧边栏样式 */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.avatar-container {
    text-align: center;
    margin-bottom: 25px;
}

.avatar-frame {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.avatar-name {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.avatar-title {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.introduction, .rules {
    margin-bottom: 25px;
}

.introduction h3, .rules h3 {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

.introduction p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.7;
}

.rules ul {
    list-style: none;
    padding-left: 0;
}

.rules li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rules li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* 对话区域样式 */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 500px;
}

.message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 15px;
    position: relative;
    line-height: 1.6;
}

.bot-message .message-content {
    background: linear-gradient(135deg, #2a2a4a 0%, #1a1a3a 100%);
    border: 1px solid var(--secondary-color);
    border-bottom-left-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6b0000 100%);
    border: 1px solid var(--secondary-color);
    border-bottom-right-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* 卦象结果样式 */
.divination-result {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
}

.hexagram-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.hexagram-name {
    font-size: 2rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.hexagram-symbol {
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.hexagram-info {
    margin-bottom: 15px;
}

.hexagram-info p {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--secondary-color);
}

.line-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

/* 输入区域样式 */
.input-area {
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#messageInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

#messageInput::placeholder {
    color: var(--text-muted);
}

.send-btn {
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #6b0000 100%);
    border: 2px solid var(--secondary-color);
    border-radius: 25px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: linear-gradient(135deg, #a50000 0%, #8b0000 100%);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-2px);
}

.send-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.input-hints {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 0;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .logo-symbol {
        font-size: 36px;
    }
    
    .sidebar {
        padding: 15px;
    }
    
    .avatar-frame {
        width: 120px;
        height: 120px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 15px;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .send-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .hexagram-name {
        font-size: 1.5rem;
    }
    
    .hexagram-symbol {
        font-size: 2rem;
    }
}