/* ==========================================================================
   STYLE 2: 现代简约 · 扁平高雅学术版 (Modern Minimalist / Clean Academic)
   ========================================================================== */

:root {
  color-scheme: light;
  --ac-bg: #f9f8f5;
  --ac-surface: #ffffff;
  --ac-sidebar: #fbfaf8;
  --ac-sidebar-border: #eeece6;
  --ac-primary: #8b1b1f; /* 核心深红 */
  --ac-primary-hover: #731417;
  --ac-primary-soft: #fbf0f1;
  --ac-orange: #d97736;
  --ac-text: #2c2a29;
  --ac-text-secondary: #595551;
  --ac-text-muted: #8c8680;
  --ac-border: #eae6df;
  --ac-border-light: #f3f0ea;
  --ac-green: #238551;
  --ac-green-soft: #eaf6ee;
  --ac-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.02);
  --ac-radius: 8px;
  --ac-radius-lg: 12px;
  
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body.theme-academic {
  margin: 0;
  background-color: var(--ac-bg);
  color: var(--ac-text);
  line-height: 1.6;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

/* 主结构 */
.academic-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* 侧边栏 */
.academic-sidebar {
  background: var(--ac-sidebar);
  border-right: 1px solid var(--ac-sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 16px 14px 12px;
  overflow-y: auto;
  z-index: 20;
}

.academic-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.brand-badge-circle {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.badge-svg {
  width: 100%;
  height: 100%;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.uni-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ac-primary);
  letter-spacing: 0.3px;
}

.uni-sub {
  font-size: 11px;
  color: var(--ac-text-muted);
}

.academic-new-chat-btn {
  background: var(--ac-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--ac-radius);
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: all 0.2s;
}

.academic-new-chat-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  fill: none;
}

.academic-new-chat-btn:hover {
  background: var(--ac-primary-hover);
}

.academic-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 6px 10px;
  margin-top: 12px;
}

.academic-search-bar svg {
  width: 14px;
  height: 14px;
  stroke: var(--ac-text-muted);
  stroke-width: 2;
  fill: none;
}

.academic-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ac-text);
  width: 100%;
}

.academic-sidebar-content {
  margin-top: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.session-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.session-section-header h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--ac-text-muted);
  margin: 0;
}

.view-all-link {
  font-size: 11px;
  color: var(--ac-text-muted);
  text-decoration: none;
}

.view-all-link:hover {
  color: var(--ac-primary);
}

.academic-tabs {
  display: flex;
  background: #eeeae3;
  padding: 2px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.academic-tabs .chat-session-view-tab {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 11.5px;
  color: var(--ac-text-secondary);
  padding: 3px 0;
  border-radius: 4px;
}

.academic-tabs .chat-session-view-tab.active {
  background: #ffffff;
  color: var(--ac-primary);
  font-weight: 700;
}

.academic-session-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.chat-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--ac-radius);
  font-size: 12.5px;
  color: var(--ac-text);
  background: transparent;
  transition: background 0.15s;
  cursor: pointer;
}

.chat-session-row:hover, .chat-session-row.active {
  background: #ffffff;
  color: var(--ac-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.academic-sidebar-tools {
  margin-top: 14px;
  border-top: 1px solid var(--ac-sidebar-border);
  padding-top: 12px;
}

.tool-section-label {
  font-size: 11px;
  color: var(--ac-text-muted);
  margin: 0 0 6px 4px;
  font-weight: 700;
}

.academic-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: transparent;
  color: #4a453e;
  border-radius: var(--ac-radius);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  transition: all 0.15s;
}

.academic-nav-item svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.academic-nav-item:hover {
  background: rgba(139, 27, 31, 0.05);
  color: var(--ac-primary);
}

.academic-nav-item.active {
  background: #ffffff;
  color: var(--ac-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  font-weight: 700;
}

/* 顶部 Topbar */
.academic-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--ac-bg);
}

.academic-header {
  position: sticky;
  top: 0;
  z-index: 15;
  background: #ffffff;
  border-bottom: 1px solid var(--ac-border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.academic-header-title h1 {
  font-size: 19px;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0;
}

.academic-header-title p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ac-text-muted);
}

.academic-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* 风格切换栏 */
.academic-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f4efe9;
  padding: 3px 6px;
  border-radius: 16px;
  border: 1px solid var(--ac-border);
}

.switcher-label {
  font-size: 11px;
  color: var(--ac-text-muted);
  font-weight: 600;
  padding-left: 4px;
  text-decoration: none;
}

.style-link {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 12px;
  color: #666;
  text-decoration: none;
  font-weight: 600;
}

.style-link.active {
  background: var(--ac-primary);
  color: #ffffff;
}

.academic-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--ac-border);
  color: var(--ac-text-secondary);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}

.academic-logout-btn:hover {
  border-color: var(--ac-primary);
  color: var(--ac-primary);
}

/* 主面板网格 */
.panel-grid {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 66px);
}

.panel {
  display: none;
  width: 100%;
}

.panel.active {
  display: block;
}

.academic-chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  height: calc(100vh - 66px);
}

.academic-chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 36px 16px;
  overflow: hidden;
}

.academic-messages-flow {
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 用户提问卡片 */
.academic-user-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #f3efe8;
  padding: 12px 18px;
  border-radius: var(--ac-radius-lg);
}

.academic-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ac-orange);
  color: #ffffff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.academic-user-bubble {
  flex: 1;
}

.bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bubble-query {
  font-size: 14.5px;
  font-weight: 700;
  color: #1a1a1a;
}

.bubble-timestamp {
  font-size: 11.5px;
  color: var(--ac-text-muted);
}

/* 机器人回答主体 */
.academic-bot-item {
  padding: 4px 8px 10px;
}

.academic-bot-body {
  color: #2b2825;
}

.academic-section-h3 {
  font-size: 15px;
  font-weight: 800;
  color: #8B1B1F;
  margin: 18px 0 8px;
}

.academic-section-h3:first-child {
  margin-top: 0;
}

.academic-bot-body p {
  margin: 6px 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.academic-bullet-points {
  list-style: none;
  padding-left: 0;
  margin: 10px 0;
}

.academic-bullet-points li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 12px;
}

.academic-bullet-points li::before {
  content: "•";
  position: absolute;
  left: 4px;
  top: -1px;
  color: var(--ac-primary);
  font-size: 18px;
}

.academic-bullet-points li strong {
  color: #1a1a1a;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 2px;
}

.academic-bullet-points li p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: #555;
}

.academic-answer-footer {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid var(--ac-border);
  padding-top: 12px;
}

.academic-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--ac-text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.academic-action-btn:hover {
  background: #eae5dc;
  color: var(--ac-primary);
}

/* 输入框 */
.academic-composer {
  margin-top: 12px;
}

.academic-composer-shell {
  background: #ffffff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-lg);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.academic-attach-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--ac-border);
  display: grid;
  place-items: center;
  color: var(--ac-text-muted);
}

.academic-attach-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.2;
}

.academic-composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  resize: none;
  height: 24px;
  max-height: 120px;
}

.academic-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ac-primary);
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.academic-send-btn svg {
  width: 15px;
  height: 15px;
}

.academic-send-btn:hover {
  background: var(--ac-primary-hover);
}

/* 右侧栏独立白卡片 */
.academic-trust-sidebar {
  background: transparent;
  border-left: 1px solid var(--ac-border);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.academic-card {
  background: #ffffff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-lg);
  padding: 14px;
  box-shadow: var(--ac-card-shadow);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title-with-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
}

.academic-status-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.academic-status-pill.green {
  background: var(--ac-green-soft);
  color: var(--ac-green);
  border: 1px solid #cce8d6;
}

.academic-meta-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  color: var(--ac-text-muted);
}

.meta-row strong {
  color: var(--ac-text);
}

.source-item-card {
  display: flex;
  gap: 10px;
  background: #fbf9f6;
  border: 1px solid var(--ac-border-light);
  border-radius: var(--ac-radius);
  padding: 10px;
  margin-top: 10px;
}

.source-item-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eedfd0;
  color: #8b572a;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.source-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.source-item-badge {
  display: inline-block;
  background: #fef4e8;
  color: #b27428;
  border: 1px solid #fae1c3;
  padding: 1px 5px;
  font-size: 10.5px;
  border-radius: 4px;
  font-weight: 600;
}

.source-item-hint {
  font-size: 11.5px;
  color: #888;
  margin: 4px 0 0;
}

.view-all-sources-link {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--ac-text-muted);
  text-decoration: none;
  margin-top: 10px;
  font-weight: 600;
}

.view-all-sources-link:hover {
  color: var(--ac-primary);
}

.academic-muted-text {
  font-size: 12px;
  color: var(--ac-text-muted);
  margin: 8px 0 0;
}

.academic-tag-chip {
  display: inline-block;
  background: #ebf5ee;
  color: #217454;
  border: 1px solid #c9ebd4;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-pill {
  background: #f5ebe6;
  color: #8B1B1F;
  border: 1px solid #eed0c5;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* 辅助面板通用样式 */
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--ac-border);
  padding-bottom: 14px;
}

.panel-heading h2 {
  font-size: 20px;
  color: var(--ac-primary);
  margin: 0 0 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  background: #ffffff;
  padding: 20px;
  border-radius: var(--ac-radius);
  border: 1px solid var(--ac-border);
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
}

.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--ac-border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fdfbf7;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.form-grid label.checkline {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
}

.academic-btn-primary {
  background: var(--ac-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--ac-radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}

.academic-btn-outline {
  background: #ffffff;
  border: 1px solid var(--ac-border);
  color: var(--ac-text-secondary);
  border-radius: var(--ac-radius);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-top: 16px;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  font-size: 13px;
}

.table-wrap th, .table-wrap td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ac-border-light);
}

.table-wrap th {
  background: #f9f8f5;
  color: var(--ac-text-muted);
  font-weight: 700;
}

.editor-panel {
  background: #ffffff;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Runtime-rendered workbench content */
.academic-brand {
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
}

.academic-brand .university-logo {
  display: block;
  width: min(100%, 188px);
  height: 66px;
  object-fit: contain;
  object-position: left center;
}

.site-logo-crop {
  position: relative;
  width: min(100%, 224px);
  height: 82px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
}

.site-logo {
  position: absolute;
  top: 50%;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  transform: translateY(-50%);
}

.academic-brand .uni-sub {
  padding-left: 2px;
  color: var(--ac-text-secondary);
}

.chat-session-row {
  position: relative;
  padding: 0;
  cursor: default;
}

.chat-session {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 30px 8px 9px;
  border: 0;
  border-radius: var(--ac-radius);
  background: transparent;
  color: var(--ac-text-secondary);
  text-align: left;
}

.chat-session > span:last-child {
  overflow: hidden;
  color: var(--ac-text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session.active,
.chat-session:hover {
  background: #fff;
  color: var(--ac-primary);
  box-shadow: 0 1px 4px rgba(73, 45, 31, 0.07);
}

.chat-session-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.chat-session-title-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-session-pin {
  flex: none;
  color: var(--ac-primary);
  font-size: 9px;
}

.chat-session-menu-button {
  position: absolute;
  top: 8px;
  right: 5px;
  width: 24px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ac-text-muted);
}

.chat-session-action-menu {
  position: fixed;
  z-index: 90;
  min-width: 116px;
  padding: 5px;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(57, 37, 29, 0.16);
}

.chat-session-action-menu[hidden] { display: none; }
.chat-session-action-menu button {
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}
.chat-session-action-menu button:hover { background: var(--ac-primary-soft); color: var(--ac-primary); }

.academic-messages-flow.is-empty {
  display: grid;
  place-items: center;
}

.empty-chat {
  max-width: 520px;
  text-align: center;
}

.empty-chat h3 { margin: 0 0 4px; color: var(--ac-primary); }
.empty-chat p { margin: 0; color: var(--ac-text-muted); }
.prompt-suggestions { display: grid; gap: 8px; margin-top: 18px; }
.prompt-suggestion {
  padding: 10px 14px;
  border: 1px solid var(--ac-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ac-text-secondary);
  text-align: left;
}
.prompt-suggestion:hover { border-color: #d8b9ae; color: var(--ac-primary); }

.chat-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

.chat-message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.chat-message.user .message-avatar {
  grid-column: 2;
}

.chat-message.user .message-content {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
  max-width: min(620px, 100%);
  padding: 12px 16px;
  border: 1px solid #ebe3d9;
  border-radius: 12px;
  background: #f4efe8;
  overflow-wrap: anywhere;
}

.message-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dda065;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.chat-message.assistant .message-avatar { background: var(--ac-primary); }
.message-content { min-width: 0; overflow-wrap: anywhere; }
.message-content > p { margin: 4px 0; font-weight: 650; }
.chat-message.user .message-content > p { margin: 0; }
.markdown-body { color: #302d2a; font-size: 14px; line-height: 1.85; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--ac-primary); }
.markdown-body p { margin: 7px 0 12px; }
.markdown-body li { margin: 5px 0; }
.message-actions { display: flex; gap: 8px; margin-top: 12px; }
.chat-message.user .message-actions { justify-content: flex-end; }
.message-actions button {
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ac-text-muted);
  font-size: 12px;
}
.message-actions button:hover { background: #eee8df; color: var(--ac-primary); }
.thinking-indicator { display: flex; gap: 8px; color: var(--ac-primary); font-weight: 650; }
.thinking-ellipsis span { animation: academic-pulse 1.2s infinite; }
@keyframes academic-pulse { 50% { opacity: .25; } }

.academic-data-list,
.related-list { margin: 10px 0 0; padding-left: 18px; color: var(--ac-text-secondary); font-size: 12px; }
.academic-data-list li, .related-list li { margin: 6px 0; }
.academic-data-list p { margin: 3px 0; color: var(--ac-text-muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  padding: 2px 8px;
  border: 1px solid #d6e9dc;
  border-radius: 999px;
  background: #edf7f0;
  color: #247453;
  font-size: 11px;
}
.related-question-button { border: 0; background: transparent; color: var(--ac-primary); text-align: left; }
.academic-answer-tools { display: flex; gap: 6px; margin-top: 12px; }

.academic-review-card summary { color: var(--ac-primary); cursor: pointer; font-size: 13px; font-weight: 750; }
.answer-review-form { display: grid; gap: 9px; margin-top: 12px; }
.answer-review-decision { display: flex; gap: 12px; margin: 0; border: 0; padding: 0; font-size: 12px; }
.answer-review-decision legend { margin-bottom: 5px; color: var(--ac-text-muted); }
.answer-review-form textarea { width: 100%; border: 1px solid var(--ac-border); border-radius: 7px; padding: 8px; resize: vertical; }
.answer-review-feedback { min-height: 18px; color: var(--ac-text-muted); font-size: 11px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.mobile-only { display: none; }

@media (max-width: 1080px) {
  .academic-chat-shell { grid-template-columns: minmax(0, 1fr) 290px; }
  .academic-chat-main { padding-inline: 22px; }
  .academic-switcher .switcher-label { display: none; }
}

@media (max-width: 820px) {
  .academic-shell { display: block; }
  .academic-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 12px 0 36px rgba(40, 28, 21, .16);
  }
  body.sidebar-open .academic-sidebar { transform: translateX(0); }
  body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 18; background: rgba(29, 20, 16, .24); }
  .academic-workspace { min-height: 100vh; }
  .academic-header { padding: 10px 14px; gap: 10px; }
  .academic-header-title { flex: 1; min-width: 0; }
  .academic-header-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  .academic-header-title p { display: none; }
  .mobile-only { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--ac-border); border-radius: 8px; background: #fff; }
  .mobile-only svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
  .academic-switcher { display: none; }
  .academic-chat-shell { display: block; height: auto; }
  .academic-chat-main { min-height: calc(100vh - 57px); padding: 16px 14px 12px; }
  .academic-messages-flow { min-height: 46vh; overflow: visible; padding-right: 0; }
  .academic-trust-sidebar { border: 0; padding: 0 14px 18px; overflow: visible; }
  .panel-grid { min-height: auto; }
  .panel:not(.academic-chat-panel) { padding: 18px 14px; }
  .split-view { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .academic-header-actions { gap: 6px; }
  .academic-logout-btn span { display: none; }
  .academic-logout-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
  .chat-message { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 28px; height: 28px; }
  .chat-message.user .message-content { padding: 10px 12px; }
  .academic-answer-tools { display: grid; grid-template-columns: 1fr 1fr; }
}
