:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #F7931A; /* Bitcoin Orange */
    --text-color: #E0E0E0;
    --text-muted: #888;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1rem;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    margin: auto;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    flex-grow: 1; /* 占据主要空间 */
}

.chat-header {
    padding: 1.5rem;
    background-color: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.chat-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.75rem;
    color: #fff;
    font-weight: 700;
}

.btc-logo {
    color: var(--primary-color);
    font-size: 2rem;
    line-height: 1;
}

.chat-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.chat-window {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 隐藏滚动条 */
.chat-window::-webkit-scrollbar {
    width: 6px;
}
.chat-window::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}
.chat-window::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1.25rem;
    border-radius: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.user-message {
    background-color: var(--primary-color);
    color: #121212;
    align-self: flex-end;
    border-bottom-right-radius: 0.5rem;
}

.bot-message {
    background-color: #333;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 0.5rem;
}

.bot-message p {
    white-space: pre-wrap; /* 保持换行 */
}

.message.loading {
    padding: 1rem 1.25rem;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #777;
    border-radius: 50%;
    animation: bounce 1.4s infinite both;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.chat-form {
    display: flex;
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background-color: var(--surface-color);
}

#message-input {
    flex-grow: 1;
    border: none;
    background-color: #333;
    color: var(--text-color);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-family);
}
#message-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

#send-button {
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    color: var(--bg-color);
    cursor: pointer;
    padding: 0.75rem;
    margin-left: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
#send-button:hover {
    background-color: #ffaa40;
}
#send-button:disabled {
    background-color: #555;
    cursor: not-allowed;
}
#send-button svg {
    width: 24px;
    height: 24px;
}

.site-footer {
    width: 100%;
    max-width: 800px;
    margin: 1.5rem auto 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.risk-disclaimer {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    text-align: left;
    line-height: 1.5;
}
.risk-disclaimer strong {
    color: #ffc107;
}

.friendly-links {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
}

.friendly-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.friendly-links a:hover {
    color: var(--primary-color);
}

/* 响应式设计 (适配手机) */
@media (max-width: 600px) {
    body {
        padding: 0.5rem;
    }
    .chat-container {
        border-radius: 0;
        height: 100%; /* 修复在某些移动浏览器上的高度问题 */
        min-height: calc(100vh - 1rem); /* 减去 body padding */
    }
    .chat-window {
        padding: 1rem;
    }
    .chat-form {
        padding: 1rem;
    }
    .message {
        font-size: 0.9rem;
    }
    .site-footer {
        padding: 0 0.5rem;
    }
}