body {
    font-family: 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* 淺色捲軸樣式 */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f8fafc;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 深色捲軸樣式 */
.dark ::-webkit-scrollbar-track {
    background: #0f172a;
}
.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-select-none {
    user-select: none;
}

:is(#chat-container, .article-content) figcaption {
    color: #64748b;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.5rem;
}
:is(#chat-container, .article-content) h1 {
    font-size: 1.4rem;
    font-weight: bold;
}
:is(#chat-container, .article-content) :is(ul, ol) {
    list-style-position: inside;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
:is(#chat-container, .article-content) ul {list-style-type: disc;}
:is(#chat-container, .article-content) ol {list-style-type: decimal;}
:is(#chat-container, .article-content) li {margin-bottom: 0.75rem;}
:is(#chat-container, .article-content) blockquote {
    border-left: 4px solid #334155;
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    color: #cbd5e1;
}

#auth-footer.footer-dismissed #footer-disclaimer {
    display: none !important;
}
@media (max-width: 767px) {
    #auth-footer.footer-dismissed {
        display: none !important;
    }
}

/* Moved from header.php - Tailwind to CSS mapping */
.quick-reply-btn {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 700;
    color: #0369a1;
    background-color: #f0f9ff;
    border-width: 1px;
    border-color: #bae6fd;
    white-space: nowrap;
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
@media (min-width: 640px) {
    .quick-reply-btn {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
}
.dark .quick-reply-btn {
    font-weight: 500;
    color: #7dd3fc;
    background-color: rgba(12, 74, 110, 0.3);
    border-color: rgba(7, 89, 133, 0.5);
    box-shadow: none;
}
.quick-reply-btn:hover {
    background-color: #e0f2fe;
    color: #075985;
}
.dark .quick-reply-btn:hover {
    background-color: rgba(7, 89, 133, 0.5);
    color: #fff;
}
/* Back button */
.back-btn {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 700;
    color: #334155;
    background-color: #f1f5f9;
    border-width: 1px;
    border-color: #cbd5e1;
    border-radius: 9999px;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .back-btn {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
}
.dark .back-btn {
    font-weight: 500;
    color: #fff;
    background-color: rgba(45,55,72,0.5);
    border-color: #334155;
}
.back-btn:hover {
    background-color: #cbd5e1;
    color: #1a202c;
}
.dark .back-btn:hover {
    background-color: #334155;
    color: #fff;
}
/* Message container */
.message-container {
    display: flex;
    width: 100%;
}
.message-container-user {
    justify-content: flex-end;
}
.message-container-bot {
    justify-content: flex-start;
}
/* Message bubble */
.message-bubble {
    max-width: 85%;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.42857;
}
@media (min-width: 640px) {
    .message-bubble {
        max-width: 75%;
        font-size: 1rem;
    }
}
.message-bubble-user {
    background-color: #0ea5e9;
    color: #fff;
    border-bottom-right-radius: 0;
}
.message-bubble-bot {
    background-color: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 0;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
    position: relative;
}
.dark .message-bubble-bot {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
.chart-download-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: rgba(255,255,255,0.9);
    color: #475569;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    z-index: 2;
}
.chart-download-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}
.dark .chart-download-btn {
    background: rgba(30,41,59,0.9);
    border-color: #334155;
    color: #94a3b8;
}
.dark .chart-download-btn:hover {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}
/* Loading message */
.loading-msg {
    max-width: 85%;
}
@media (min-width: 640px) {
    .loading-msg {
        max-width: 75%;
    }
}

/* Quota info bubble */
.quota-info-bubble {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.quota-text {
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.5;
}
.dark .quota-text {
    color: #94a3b8;
}
