@import url("style3.css?v=20261008-pagination-2");

/* V4 · 朱红暖金问答版，视觉基线来自 yunnan_minzu_ai_qa_demo.html */
body.theme-ai-heritage {
  --palace-red-deep: #66120e;
  --palace-red: #7c1912;
  --palace-red-light: #9d2418;
  --palace-gold: #bd8b4a;
  --palace-gold-light: #f2d7bd;
  --palace-gold-subtle: #fff5e8;
  --palace-bg: #f8f5ef;
  --palace-surface: #fffdf9;
  --palace-text: #201b18;
  --palace-text-muted: #85796e;
  --palace-border: #eadfd3;
  --palace-border-gold: #dfc7b4;
  --palace-radius: 10px;
  --palace-radius-lg: 18px;
  background:
    radial-gradient(circle at 60% 0%, rgba(189,139,74,.08), transparent 30%),
    linear-gradient(180deg, #fbf8f3 0%, #f6f2eb 100%);
}

.theme-ai-heritage .palace-shell { grid-template-columns: 320px minmax(0, 1fr); }
.theme-ai-heritage .palace-sidebar {
  padding: 22px 20px 18px;
  background:
    radial-gradient(circle at 10% 15%, rgba(255,220,164,.11), transparent 22%),
    linear-gradient(180deg, #8c1f16 0%, #7c1912 52%, #66120e 100%);
  box-shadow: none;
  overflow: hidden auto;
}
.theme-ai-heritage .palace-sidebar::before {
  content: "";
  position: absolute;
  left: -50px;
  right: -10px;
  bottom: -10px;
  height: 240px;
  opacity: .2;
  pointer-events: none;
  background: center bottom / cover no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 220'%3E%3Cg fill='none' stroke='%23e9be7c' stroke-width='2'%3E%3Cpath d='M0 190L45 168l32 12 41-28 28 17 46-55 44 55 31-21 40 25 42-45 54 52 48-22 49 24'/%3E%3Cpath d='M0 204L55 186l38 11 45-26 54 38 50-24 51 19 44-28 51 22 62-17 50 17' opacity='.65'/%3E%3Cpath d='M330 188v-45h88v45M342 143l32-22 32 22M358 161h32M348 177h52'/%3E%3C/g%3E%3C/svg%3E");
}
.theme-ai-heritage .sidebar-top-branding,
.theme-ai-heritage .palace-sidebar-body,
.theme-ai-heritage .palace-sidebar-footer { position: relative; z-index: 1; }
.theme-ai-heritage .palace-brand { display: block; margin-bottom: 22px; }
.theme-ai-heritage .palace-brand .university-logo { width: 205px; max-height: 70px; object-fit: contain; object-position: left center; }
.theme-ai-heritage .site-logo-crop { position: relative; width: min(100%, 224px); height: 82px; overflow: hidden; border-radius: 8px; background: #fff; }
.theme-ai-heritage .site-logo { position: absolute; top: 50%; left: 0; display: block; width: 100%; height: auto; transform: translateY(-50%); }
.theme-ai-heritage .palace-brand .palace-sub { display: block; margin-top: 5px; color: #f2d7bd; font-size: 12px; letter-spacing: .08em; }
.theme-ai-heritage .palace-new-chat-btn { min-height: 46px; border-color: rgba(255,219,174,.7); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); font-size: 15px; }
.theme-ai-heritage .palace-new-chat-btn:hover { background: rgba(255,255,255,.11); border-color: #ffe3b6; }
.theme-ai-heritage .palace-search-box { min-height: 42px; background: rgba(55,5,4,.12); border-color: rgba(255,225,190,.24); }
.theme-ai-heritage .palace-time-tabs { padding: 3px; background: rgba(255,255,255,.06); border-color: transparent; border-radius: 9px; }
.theme-ai-heritage .palace-tab { padding: 6px 2px; color: #edcfc4; }
.theme-ai-heritage .palace-tab.active { background: #f7e9da; color: #8c2418; }
.theme-ai-heritage .palace-session-list { max-height: none; gap: 4px; }
.theme-ai-heritage .chat-session { padding: 10px 11px; border: 1px solid transparent; border-radius: 10px; }
.theme-ai-heritage .chat-session.active,
.theme-ai-heritage .chat-session:hover { background: linear-gradient(90deg, rgba(255,226,187,.16), rgba(255,255,255,.05)); border-color: rgba(255,213,164,.14); border-left-color: rgba(255,213,164,.14); }
.theme-ai-heritage .palace-sidebar-footer { border-top-color: rgba(255,225,190,.17); }
.theme-ai-heritage .palace-nav-btn { min-height: 38px; padding: 9px 10px; border-radius: 9px; font-size: 13px; }
.theme-ai-heritage .palace-nav-btn.active { border-left: 0; background: rgba(255,237,216,.12); }
.theme-ai-heritage .palace-gold-architecture { opacity: .28; }

.theme-ai-heritage .palace-workspace {
  background:
    linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,.1)),
    radial-gradient(circle at 40% 0%, rgba(193,142,76,.07), transparent 35%);
}
.theme-ai-heritage .palace-header { min-height: 72px; padding: 0 28px 0 30px; background: rgba(255,253,249,.9); border-bottom: 1px solid var(--palace-border); backdrop-filter: blur(12px); }
.theme-ai-heritage .palace-header-title h1 { font-size: 23px; letter-spacing: .02em; }
.theme-ai-heritage .palace-gold-pill { background: transparent; border: 0; padding: 0; color: var(--palace-text-muted); font-size: 13px; }
.theme-ai-heritage .palace-switcher { border-radius: 12px; background: #f7f0e8; }
.theme-ai-heritage .palace-logout-btn { padding: 9px 14px; border-radius: 10px; color: #7f281d; background: #fffaf4; border-color: #e2c9b3; }
.theme-ai-heritage .palace-chat-shell { grid-template-columns: minmax(0, 1fr) 350px; height: calc(100vh - 72px); }
.theme-ai-heritage .palace-chat-main { padding: 24px 26px 18px; }
.theme-ai-heritage .palace-messages-flow { max-width: 980px; width: 100%; margin: 0 auto; padding-right: 8px; }
.theme-ai-heritage .empty-chat { border: 1px solid #ead7c6; border-radius: 18px; background: linear-gradient(90deg, #fffaf3, #f8f1e9); box-shadow: 0 12px 30px rgba(75,43,25,.07); padding: 32px; }
.theme-ai-heritage .chat-message.user .message-content { background: linear-gradient(90deg, #fffaf3, #f8f1e9); border: 1px solid #ead7c6; border-radius: 14px; padding: 14px 16px; }
.theme-ai-heritage .chat-message.assistant { background: rgba(255,253,249,.96); border: 1px solid #e8ddd2; border-radius: 16px; padding: 18px 22px 16px; box-shadow: 0 12px 30px rgba(75,43,25,.07), 0 2px 8px rgba(75,43,25,.04); }
.theme-ai-heritage .message-avatar { background: linear-gradient(145deg, #ae2d1d, #7c150f); }
.theme-ai-heritage .chat-message.assistant .message-avatar { background: linear-gradient(145deg, #9d2418, #b88b50); }
.theme-ai-heritage .markdown-body h1,
.theme-ai-heritage .markdown-body h2,
.theme-ai-heritage .markdown-body h3 { color: #9d2418; }
.theme-ai-heritage .palace-composer-shell { min-height: 68px; border-radius: 18px; border-color: #dfc7b4; background: #fffdf9; box-shadow: 0 12px 28px rgba(75,43,25,.08); }
.theme-ai-heritage .palace-send-btn { background: linear-gradient(145deg, #ae2d1d, #74170f); box-shadow: 0 6px 14px rgba(130,31,19,.2); }
.theme-ai-heritage .palace-trust-panel { padding: 22px 18px 80px; background: rgba(250,247,241,.72); border-left-color: #eadfd3; }
.theme-ai-heritage .palace-card { border-radius: 18px; border-color: #eadfd3; background: rgba(255,253,249,.96); box-shadow: 0 12px 30px rgba(75,43,25,.06); }
.theme-ai-heritage .palace-badge-complete { border-radius: 10px; background: #edf6ee; color: #2f7c5b; }
@media (max-width: 1200px) {
  .theme-ai-heritage .palace-shell { grid-template-columns: 280px minmax(0, 1fr); }
  .theme-ai-heritage .palace-chat-shell { grid-template-columns: minmax(0, 1fr) 310px; }
}

@media (max-width: 820px) {
  .theme-ai-heritage .palace-shell { display: block; }
  .theme-ai-heritage .palace-sidebar { width: min(88vw, 320px); }
  .theme-ai-heritage .palace-header { min-height: 68px; padding: 10px 14px; }
  .theme-ai-heritage .palace-header-title { display: block; }
  .theme-ai-heritage .palace-header-title h1 { font-size: 17px; }
  .theme-ai-heritage .palace-gold-pill { display: block; font-size: 11px; }
  .theme-ai-heritage .palace-chat-shell { height: auto; min-height: calc(100vh - 68px); }
  .theme-ai-heritage .palace-chat-main { padding: 16px 12px; }
  .theme-ai-heritage .palace-trust-panel { padding: 0 12px 110px; background: transparent; }
}

@media (max-width: 480px) {
  .theme-ai-heritage .palace-gold-pill,
  .theme-ai-heritage .switcher-label { display: none; }
  .theme-ai-heritage .palace-header-actions { gap: 6px; }
  .theme-ai-heritage .palace-switcher { gap: 1px; padding: 2px; }
  .theme-ai-heritage .style-link { padding: 3px 5px; font-size: 10px; }
  .theme-ai-heritage .palace-logout-btn { padding: 7px; }
  .theme-ai-heritage .palace-logout-btn span { display: none; }
  .theme-ai-heritage .chat-message.assistant { padding: 15px 14px; }
}
