/* ============================================================
   know.css —— 聊天页（index.html）与后台（admin.html）共用样式
   页面级规则用 body.chat-page / body.admin-page 作用域区分
   ============================================================ */

/* ---------- 公共 ---------- */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.brand { font-size: 18px; letter-spacing: 1px; }
table td, table th { font-size: 13px; }
.site-foot { text-align: center; padding: 15px 0 26px; font-size: 13px; color: #98a2b3; }
.site-foot a { color: #7a8aa0; text-decoration: none; }
.site-foot a:hover { color: #2b6cb0; text-decoration: underline; }

/* ---------- 聊天页 index.html ---------- */
body.chat-page { background: #eef1f5; margin: 0; height: 100vh; display: flex; flex-direction: column; }
.chat-head { background: linear-gradient(135deg, #a4b9cd, #72afef 55%, #538bd3); color: #fff; }
.chat-inner { max-width: 720px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.chat-head-in { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 0; }
@media (max-width: 752px) { .chat-inner { padding-left: 16px; padding-right: 16px; } }
.msg { display: flex; margin-bottom: 14px; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.msg.user .bubble { background: #2b6cb0; color: #fff; border-bottom-right-radius: 2px; }
.msg.bot .bubble { background: #fff; color: #333; border-bottom-left-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
/* Markdown 渲染样式 */
.bubble.md { white-space: normal; }
.bubble.md p { margin-bottom: .5rem; }
.bubble.md p:last-child { margin-bottom: 0; }
.bubble.md pre { background: #f5f7fa; border-radius: 6px; padding: 10px; overflow-x: auto; font-size: 13px; margin: .5rem 0; }
.bubble.md code { background: #f0f2f5; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.bubble.md pre code { background: none; padding: 0; }
.bubble.md table { border-collapse: collapse; margin: .5rem 0; font-size: 13px; }
.bubble.md th, .bubble.md td { border: 1px solid #dee2e6; padding: 4px 8px; }
.bubble.md blockquote { border-left: 3px solid #ccc; margin: .5rem 0; padding-left: 10px; color: #666; }
.bubble.md ul, .bubble.md ol { margin-bottom: .5rem; padding-left: 1.4rem; }
.src { display: block; margin-top: 6px; font-size: 12px; color: #999; }
.dot { animation: blink 1.2s infinite; }
.chat-page h1, .chat-page h2, .chat-page h3, .chat-page h4 { font-size: 1.2rem; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- 后台 admin.html ---------- */
body.admin-page { background: #f4f6f9; }
.tabbar { display: flex; flex-wrap: wrap; list-style: none; padding-left: 0; margin-bottom: 1rem; border-bottom: 1px solid #e0e4ea; }
.tabbar .nav-item { margin: 0 0 -1px 0; }
.tabbar .nav-link { display: block; padding: 9px 18px; font-size: 14px; color: #666; background: none; border: 1px solid transparent; border-radius: 6px 6px 0 0; margin-bottom: -1px; }
.tabbar .nav-link:hover { color: #2b6cb0; text-decoration: none; }
.tabbar .nav-link.active { color: #2b6cb0; font-weight: 600; background: #fff; border-color: #e0e4ea; border-bottom-color: #fff; }
.admin-head { background: linear-gradient(135deg, #a4b9cd, #72afef 55%, #538bd3); padding: .8rem 0; }
.admin-head .container { display: flex; align-items: center; justify-content: space-between; }
.admin-head .brand { font-size: 18px; letter-spacing: 1px; color: #fff; }
.admin-head .small { color: rgba(255,255,255,.85); }
.login-box { max-width: 380px; margin: 12vh auto 0; }
.stat-num { font-size: 28px; font-weight: 700; color: #2b6cb0; }
#msg { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 9999; min-width: 300px; display: none; }
#dm-body { font-family: Consolas, Menlo, monospace; font-size: 13px; height: 52vh; }
#dm-preview { height: 52vh; overflow: auto; font-size: 14px; background: #fff; }
#dm-preview pre { background: #f6f8fa; padding: 8px 10px; border-radius: 4px; font-size: 12.5px; }
#dm-preview code { color: #c7254e; }
#dm-preview table { border-collapse: collapse; }
#dm-preview table td, #dm-preview table th { border: 1px solid #dee2e6; padding: 4px 8px; }
.modal-body { padding-bottom: .5rem; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager .btn { margin-left: 0 !important; }
