/* 每日新闻助手 - 全屏响应式 */

:root {
  --primary: #CC0000;
  --primary-dark: #990000;
  --primary-light: #FF3333;
  --bg: #F5F5F5;
  --bg-white: #FFFFFF;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #E0E0E0;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --radius: 4px;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--primary); }

/* ========== Header ========== */
.header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: bold;
  border-radius: 4px;
}
.logo-text { font-size: 18px; font-weight: bold; color: var(--primary); }
.logo-sub { font-size: 11px; color: var(--text-muted); display: none; }

.search-bar { display: flex; gap: 6px; }
.search-bar input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 200px;
  font-size: 13px;
  outline: none;
}
.search-bar input:focus { border-color: var(--primary); }
.search-bar button {
  padding: 7px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}

/* ========== Nav ========== */
.nav { background: var(--primary); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.nav-inner {
  display: flex;
  min-width: max-content;
}
.nav a {
  color: white;
  padding: 10px 16px;
  white-space: nowrap;
  font-size: 14px;
  display: block;
  transition: background 0.2s;
}
.nav a:hover, .nav a.active { background: var(--primary-dark); color: white; }
.nav-user-link {
  color: white;
  padding: 10px 16px;
  white-space: nowrap;
  font-size: 13px;
  margin-left: auto;
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-user-link:hover { background: var(--primary-dark); color: white; }

/* ========== Container ========== */
.container {
  padding: 16px;
}

/* ========== Date Tabs ========== */
.date-tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.date-tabs::-webkit-scrollbar { display: none; }
.date-tab {
  padding: 7px 14px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.date-tab:hover { border-color: var(--primary); color: var(--primary); }
.date-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ========== Channel Filter ========== */
.channel-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.channel-filter::-webkit-scrollbar { display: none; }
.channel-tag {
  padding: 5px 12px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.channel-tag:hover { border-color: var(--primary); color: var(--primary); }
.channel-tag.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ========== News List ========== */
.news-group { margin-bottom: 20px; }
.news-group-title {
  font-size: 15px;
  font-weight: bold;
  color: var(--primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.channel-badge {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
}

/* ========== Source Tags ========== */
.source-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: normal;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.source-people { background: #CC0000; color: white; }
.source-qstheory { background: #D74339; color: white; }
.source-banyuetan { background: #1a5276; color: white; }

.news-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 10px;
}
.news-item:last-child { border-bottom: none; }

.news-item-content { flex: 1; min-width: 0; }
.news-item-title {
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 4px;
  cursor: pointer;
  display: block;
}
.news-item-title:hover { color: var(--primary); }
.news-item-summary {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.news-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-items: flex-start;
}
.btn-link {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
}
.btn-link:hover { border-color: var(--primary); color: var(--primary); }
.btn-link.primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-link.primary:hover { background: var(--primary-dark); }

/* ========== Article Detail ========== */
.article-detail {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.article-detail h1 { font-size: 22px; line-height: 1.4; margin-bottom: 12px; }
.article-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.article-content { font-size: 16px; line-height: 1.8; }
.article-content p { margin-bottom: 12px; text-indent: 2em; }

.article-actions {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-block;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #e74c3c; color: white; border: 1px solid #c0392b; }
.btn-danger:hover { background: #c0392b; }
.btn-danger:disabled { background: #e0a09a; border-color: #d4887f; opacity: 0.8; }
.stop-btn { background: #e74c3c; color: white; border: 1px solid #c0392b; border-radius: 4px; padding: 4px 12px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.stop-btn:hover { background: #c0392b; }
.stop-btn:disabled { background: #e0a09a; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn:disabled, .btn-sm:disabled { opacity: 0.5; cursor: not-allowed; }

.related-section {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.related-section h3 { font-size: 15px; color: var(--primary); margin-bottom: 10px; }

/* ========== Stats Bar ========== */
.stats-bar {
  background: var(--bg-white);
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
  font-size: 13px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: 4px; }
.stat-number { color: var(--primary); font-weight: bold; font-size: 15px; }

/* ========== Knowledge Page ========== */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.kb-card {
  background: var(--bg-white);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.kb-card:hover { transform: translateY(-2px); }
.kb-card-name { font-size: 13px; color: var(--text-light); margin-bottom: 4px; }
.kb-card-count { font-size: 20px; font-weight: bold; color: var(--primary); }

/* ========== AI Assistant ========== */
.chat-layout {
  display: flex;
  height: calc(100vh - 150px);
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Sidebar */
.chat-sidebar {
  width: 240px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  background: #fafafa;
}
.chat-sidebar-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.chat-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.chat-conv-list {
  flex: 1;
  overflow-y: auto;
}
.conv-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}
.conv-item:hover { background: #f0f0f0; }
.conv-item.active { background: #fff; border-left: 3px solid var(--primary); }
.conv-item-content {
  flex: 1;
  min-width: 0;
}
.conv-item-title {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.conv-item-delete {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.conv-item:hover .conv-item-delete { opacity: 1; }
.conv-item-delete:hover { color: #e74c3c; }

/* Main chat area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.sidebar-toggle {
  display: none;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input-wrap {
  display: flex;
  gap: 8px;
}
.chat-input-wrap textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  resize: none;
  height: 42px;
  outline: none;
  font-family: inherit;
}
.chat-input-wrap textarea:focus { border-color: var(--primary); }

/* Welcome */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-light);
}
.chat-welcome-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
}
.chat-welcome h2 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
}
.chat-welcome p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.chat-welcome-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Messages */
.chat-msg {
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold;
  flex-shrink: 0;
}
.chat-msg.user .avatar { background: var(--primary); color: white; }
.chat-msg.assistant .avatar { background: #333; color: white; }
.chat-msg .bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}
.chat-msg.user .bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant .bubble {
  background: #f0f0f0;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg .bubble p { margin-bottom: 6px; }
.chat-msg .bubble p:last-child { margin-bottom: 0; }
.chat-msg .bubble strong { font-weight: bold; }
.chat-msg .bubble em { font-style: italic; }
.chat-msg .bubble pre { background: #f5f5f5; padding: 10px; border-radius: 4px; font-size: 13px; overflow-x: auto; margin: 8px 0; }
.chat-msg .bubble code { background: #f5f5f5; padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.chat-msg .bubble hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.chat-msg .bubble .md-table,
.chat-msg .bubble table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; border: 1px solid #ddd; }
.chat-msg .bubble th { background: #f5f5f5; font-weight: 600; padding: 8px 10px; border: 1px solid #ddd; text-align: left; }
.chat-msg .bubble td { padding: 7px 10px; border: 1px solid #ddd; vertical-align: top; }
.chat-msg .bubble tr:nth-child(even) td { background: #fafafa; }
.chat-msg.user .bubble pre { background: rgba(255,255,255,0.15); }
.chat-msg.user .bubble code { background: rgba(255,255,255,0.15); }
.chat-msg.user .bubble hr { border-top-color: rgba(255,255,255,0.3); }

/* Markdown rendering classes */
.chat-msg .bubble .md-h1 { font-size: 18px; font-weight: bold; color: var(--primary); margin: 14px 0 8px; display: block; }
.chat-msg .bubble .md-h2 { font-size: 16px; font-weight: bold; color: var(--primary); margin: 12px 0 6px; display: block; }
.chat-msg .bubble .md-h3 { font-size: 15px; font-weight: bold; color: var(--primary); margin: 10px 0 4px; display: block; }
.chat-msg .bubble .md-h4 { font-size: 14px; font-weight: bold; color: var(--primary); margin: 8px 0 4px; display: block; }
.chat-msg .bubble .md-hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.chat-msg .bubble .md-blockquote { border-left: 3px solid var(--primary); padding: 6px 12px; margin: 8px 0; background: rgba(204,0,0,0.04); border-radius: 0 4px 4px 0; color: var(--text-light); }
.chat-msg .bubble .md-link { color: var(--primary); text-decoration: underline; }
.chat-msg .bubble .md-li { display: block; padding-left: 20px; position: relative; }
.chat-msg .bubble .md-code { position: relative; background: #282c34; color: #abb2bf; padding: 12px; border-radius: 6px; font-size: 13px; overflow-x: auto; margin: 8px 0; line-height: 1.5; }
.chat-msg .bubble .md-code-lang { position: absolute; top: 4px; right: 8px; font-size: 11px; color: #636d83; text-transform: uppercase; }
.chat-msg .bubble .md-inline-code { background: rgba(204,0,0,0.08); padding: 2px 6px; border-radius: 3px; font-size: 13px; font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace; }
.chat-msg .bubble .md-table,
.chat-msg .bubble table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  table-layout: auto;
}
.chat-msg .bubble .md-table thead,
.chat-msg .bubble table thead { background: #f5f5f5; }
.chat-msg .bubble .md-table th,
.chat-msg .bubble table th { background: #f5f5f5; font-weight: 600; padding: 8px 10px; border: 1px solid #ddd; text-align: left; white-space: nowrap; }
.chat-msg .bubble .md-table td,
.chat-msg .bubble table td { padding: 7px 10px; border: 1px solid #ddd; vertical-align: top; word-break: break-word; }
/* 短文本列（序号/类别等）不换行；长文本列（金句等）允许换行 */
.chat-msg .bubble .md-table td:first-child,
.chat-msg .bubble .md-table td:nth-child(2),
.chat-msg .bubble .md-table td:nth-child(3),
.chat-msg .bubble table td:first-child,
.chat-msg .bubble table td:nth-child(2),
.chat-msg .bubble table td:nth-child(3) { white-space: nowrap; }
.chat-msg .bubble .md-table tbody tr,
.chat-msg .bubble table tbody tr { border-bottom: 1px solid #eee; }
.chat-msg .bubble .md-table tbody tr:last-child,
.chat-msg .bubble table tbody tr:last-child { border-bottom: none; }
.chat-msg .bubble .md-table tr:nth-child(even) td,
.chat-msg .bubble table tr:nth-child(even) td { background: #fafafa; }
.chat-msg .bubble .md-table-wrapper { overflow-x: auto; margin: 10px 0; }
.chat-msg .bubble .md-table-wrapper table { margin: 0; }

.chat-msg.user .bubble .md-inline-code { background: rgba(255,255,255,0.2); }
.chat-msg.user .bubble .md-table th { background: rgba(255,255,255,0.2); }
.chat-msg.user .bubble .md-table tr:nth-child(even) td { background: rgba(255,255,255,0.1); }

/* Message wrapper and action buttons */
.bubble-wrapper { max-width: 75%; min-width: 0; }
.chat-msg.user .bubble-wrapper { max-width: 70%; }
.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.chat-msg:hover .msg-actions { opacity: 1; }
.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.msg-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #FFF5F5;
}
.msg-action-btn.copied,
.msg-action-btn.favorited {
  border-color: #27ae60;
  color: #27ae60;
  background: #F0FFF4;
}
.msg-action-btn.danger:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #FFF5F5;
}
.msg-action-btn svg { flex-shrink: 0; }

/* Message navigation panel - DeepSeek style */
.chat-main { position: relative; }

.msg-nav-fab {
  position: fixed; right: 16px; top: 50%; transform: translateY(-50%); z-index: 12;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.2s;
  color: #666; font-size: 14px;
}
.msg-nav-fab:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 2px 12px rgba(226,54,54,0.2); }
.msg-nav-fab.show { display: flex; }
.msg-nav-fab.open { background: var(--primary); color: #fff; border-color: var(--primary); }

.msg-nav-panel {
  position: fixed; right: 60px; top: 50%; transform: translateY(-50%); z-index: 13;
  width: 260px; max-height: 400px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  display: none; flex-direction: column; overflow: hidden;
  animation: msgNavIn 0.2s ease;
}
@keyframes msgNavIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-nav-panel.open { display: flex; }

.msg-nav-header {
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; color: #333;
}
.msg-nav-close {
  border: none; background: none; cursor: pointer; font-size: 16px;
  color: #999; padding: 2px; line-height: 1; border-radius: 4px;
}
.msg-nav-close:hover { color: #333; background: #f5f5f5; }

.msg-nav-list {
  flex: 1; overflow-y: auto; padding: 6px 0;
  scrollbar-width: thin; scrollbar-color: #ddd transparent;
}
.msg-nav-list::-webkit-scrollbar { width: 4px; }
.msg-nav-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.msg-nav-item {
  padding: 10px 16px; cursor: pointer; font-size: 13px;
  display: flex; gap: 8px; align-items: center;
  color: #666; transition: all 0.15s; position: relative;
}
.msg-nav-item:hover { background: #f8f8f8; color: #333; }
.msg-nav-item.active { background: #fff3e0; color: var(--primary); font-weight: 500; }
.msg-nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--primary);
}
.msg-nav-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px;
  background: #f0f0f0; font-size: 11px; color: #999;
  display: flex; align-items: center; justify-content: center;
}
.msg-nav-item.active .msg-nav-num { background: var(--primary); color: #fff; }
.msg-nav-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg-nav-del {
  flex-shrink: 0; width: 18px; height: 18px; border: none; background: none;
  color: #999; cursor: pointer; font-size: 14px; line-height: 18px;
  text-align: center; border-radius: 50%; opacity: 0; transition: opacity 0.2s;
}
.msg-nav-item:hover .msg-nav-del { opacity: 1; }
.msg-nav-del:hover { background: #fee; color: #e53935; }

/* ===== 朗读功能 ===== */
.tts-fab {
  position: fixed; left: 20px; bottom: 20px; width: 44px; height: 44px;
  border-radius: 50%; background: var(--primary); color: #fff;
  border: none; cursor: pointer; font-size: 20px; z-index: 100;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(226,54,54,0.3); transition: transform 0.2s;
}
.tts-fab:hover { transform: scale(1.1); }
.tts-panel {
  position: fixed; left: 20px; bottom: 80px; width: 260px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15); z-index: 101;
  display: none; flex-direction: column; overflow: hidden;
}
.tts-panel.open { display: flex; }
.tts-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.tts-panel-close {
  width: 24px; height: 24px; border: none; background: none;
  cursor: pointer; font-size: 18px; color: #999; border-radius: 50%;
}
.tts-panel-close:hover { background: #f5f5f5; color: #333; }
.tts-controls { padding: 12px 16px; }
.tts-row { margin-bottom: 12px; }
.tts-row label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.tts-select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; background: #fff;
}
.tts-range { width: 100%; accent-color: var(--primary); }
.tts-btns { display: flex; gap: 6px; }
.tts-btn {
  flex: 1; padding: 8px 0; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; cursor: pointer;
  font-size: 12px; transition: all 0.2s;
}
.tts-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.tts-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tts-btn:first-child { background: var(--primary); color: #fff; border-color: var(--primary); }
.tts-btn:first-child:hover:not(:disabled) { background: var(--primary-dark); }

/* ========== User Center ========== */
.user-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
.user-name { font-size: 18px; font-weight: 600; }
.user-joined { font-size: 13px; color: var(--text-muted); }
.user-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.user-tab { padding: 10px 20px; cursor: pointer; font-size: 14px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.user-tab:hover { color: var(--text); }
.user-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.user-section { display: none; }
.user-section.active { display: block; }
.user-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.user-card h3 { font-size: 16px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.user-form-row { margin-bottom: 14px; }
.user-form-row label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.user-form-row input { width: 100%; max-width: 360px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.user-form-row input:focus { outline: none; border-color: var(--primary); }
.user-msg { padding: 8px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 12px; display: none; }
.user-msg.success { display: block; background: #e8f5e9; color: #2e7d32; }
.user-msg.error { display: block; background: #ffebee; color: #c62828; }
.fav-list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fav-list-item:last-child { border-bottom: none; }
.fav-list-title { flex: 1; }
.fav-list-title a { font-size: 14px; color: var(--text); text-decoration: none; }
.fav-list-title a:hover { color: var(--primary); }
.fav-list-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.fav-list-del { color: var(--text-muted); cursor: pointer; padding: 4px 8px; font-size: 18px; border: none; background: none; }
.fav-list-del:hover { color: var(--primary); }
.conv-list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.conv-list-item:hover { background: #f9f9f9; }
.conv-list-item:last-child { border-bottom: none; }
.conv-list-title { flex: 1; font-size: 14px; }
.conv-list-time { font-size: 12px; color: var(--text-muted); margin-right: 12px; }
.conv-list-count { font-size: 12px; color: var(--text-muted); margin-right: 12px; }
.empty-hint { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px; }

/* TTS 消息选择列表 */
.tts-msg-title {
  font-size: 12px;
  color: #666;
  padding: 8px 16px 4px;
  border-top: 1px solid var(--border);
}
.tts-msg-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.tts-msg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.tts-msg-item:hover { background: #f5f5f5; }
.tts-msg-item.active { background: #fff3e0; }
.tts-msg-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #999;
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tts-msg-item.active .tts-msg-num { background: var(--primary); }
.tts-msg-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #555;
}
.tts-msg-item.active .tts-msg-text { color: var(--text); font-weight: 500; }

@media (max-width: 768px) {
  .msg-nav-fab { right: 12px; width: 32px; height: 32px; font-size: 12px; }
  .msg-nav-panel { right: 50px; width: 200px; max-height: 300px; }
  .tts-fab { left: 12px; bottom: 12px; width: 38px; height: 38px; font-size: 18px; }
  .tts-panel { left: 12px; bottom: 60px; width: 240px; }
}

/* Favorites header */
.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.favorites-header h3 { font-size: 16px; color: var(--primary); }

/* Favorites list */
.fav-item {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}
.fav-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.fav-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.fav-source {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.fav-time {
  font-size: 12px;
  color: var(--text-muted);
}
.fav-preview {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 10px;
}
.fav-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

/* Favorite detail view */
.fav-detail {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
}
.fav-detail-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.fav-detail .bubble {
  max-width: 100%;
  background: transparent;
  padding: 0;
}

/* Typing cursor */
.typing-cursor::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 16px;
  background: var(--primary);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.quick-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  overflow: visible;
  position: relative;
  z-index: 10;
  align-items: center;
}
.quick-actions::before {
  content: "快捷操作";
  font-size: 11px;
  color: var(--text-muted, #999);
  margin-right: 4px;
  white-space: nowrap;
}
.quick-actions .quick-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 2px;
  flex-shrink: 0;
}
.quick-btn {
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}
.quick-btn:hover { border-color: var(--primary); color: var(--primary); }
.quick-btn:active { background: var(--primary); color: white; }
.quick-btn.primary {
  background: linear-gradient(135deg, var(--primary), #e74c3c);
  color: white;
  border-color: transparent;
  font-weight: 500;
}
.quick-btn.primary:hover {
  opacity: 0.9;
  color: white;
  border-color: transparent;
}

/* ========== Quick Button Dropdown ========== */
.quick-btn-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.quick-btn-group > .quick-btn {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

.quick-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 140px;
}
.quick-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 16px;
  border: 6px solid transparent;
  border-top-color: var(--bg-white);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}
.quick-dropdown.show {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: dropdownIn 0.15s ease-out;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-dropdown .quick-btn {
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.quick-dropdown .quick-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========== Scrape Panel ========== */
.scrape-panel {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border-top: 3px solid var(--primary);
}
.scrape-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.scrape-panel-header h3 {
  color: var(--text);
  font-size: 16px;
}
.scrape-status-text {
  font-size: 13px;
  color: var(--text-muted);
}

.scrape-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.scrape-source-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.scrape-source-card:hover { border-color: var(--primary); }

.scrape-source-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}
.scrape-source-icon.source-people { background: #CC0000; }
.scrape-source-icon.source-qstheory { background: #D74339; }
.scrape-source-icon.source-banyuetan { background: #1a5276; }

.scrape-source-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.scrape-source-name { font-size: 14px; font-weight: 500; }
.scrape-source-desc { font-size: 11px; color: var(--text-muted); }

.scrape-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========== Scrape Modal ========== */
.scrape-modal {
  max-width: 560px !important;
  padding: 0 !important;
  overflow: hidden;
}
.scrape-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary);
  color: white;
}
.scrape-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
}
.scrape-modal-badge {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.scrape-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.scrape-modal-body {
  padding: 20px;
}
.scrape-progress-wrap {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 14px;
}
.scrape-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 10%;
  transition: width 0.5s ease;
  position: relative;
}
.scrape-progress-bar::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShine 1.5s ease-in-out infinite;
}
@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.scrape-modal-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-light);
}
.scrape-elapsed {
  font-family: "Courier New", Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.scrape-log-area {
  background: #1a1a2e;
  color: #a8d8a8;
  padding: 14px;
  border-radius: var(--radius);
  max-height: 300px;
  overflow-y: auto;
  font-family: "Courier New", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}
.scrape-log-area::-webkit-scrollbar { width: 5px; }
.scrape-log-area::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.scrape-log-area::-webkit-scrollbar-track { background: transparent; }

.scrape-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-white);
  padding: 20px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal h3 { margin-bottom: 12px; color: var(--primary); }
.modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.modal input:focus { border-color: var(--primary); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ========== Loading ========== */
.loading { text-align: center; padding: 30px; color: var(--text-muted); }
.loading::after {
  content: "";
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 30px; color: var(--text-muted); }

.question-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.question-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.question-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.question-type {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
}
.question-text {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--text);
}
.question-material {
  background: #FAFAFA;
  border-left: 3px solid var(--primary);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
  white-space: pre-wrap;
}
.question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option-item {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-white);
}
.option-item:hover { border-color: var(--primary); background: #FFF5F5; }
.option-item.selected { border-color: var(--primary); background: #FFE8E8; color: var(--primary); font-weight: 500; }
.option-item.correct { border-color: #27ae60; background: #E8F8F0; color: #27ae60; }
.option-item.wrong { border-color: #e74c3c; background: #FDECEC; color: #e74c3c; }

.explanation {
  margin-top: 12px;
  padding: 12px;
  background: #F0F7FF;
  border: 1px solid #B8D4F0;
  border-radius: var(--radius);
}
.explanation-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.explanation-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-light);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ========== PC 大屏 ========== */
@media (min-width: 768px) {
  .logo-sub { display: block; }
  .logo-text { font-size: 20px; }
  .search-bar input { width: 280px; }
  .container { padding: 20px 24px; }
  .article-detail { padding: 30px 40px; }
  .article-detail h1 { font-size: 26px; }
  .news-item-title { font-size: 16px; }
  .bubble-wrapper { max-width: 65%; }
  .chat-msg.user .bubble-wrapper { max-width: 60%; }
}

/* ========== 手机小屏 ========== */
@media (max-width: 480px) {
  .header-inner { padding: 8px 12px; }
  .logo-text { font-size: 16px; }
  .search-bar input { width: 140px; font-size: 12px; }
  .search-bar button { padding: 6px 10px; font-size: 12px; }
  .nav a { padding: 8px 12px; font-size: 13px; }
  .container { padding: 12px; }
  .news-item { flex-direction: column; gap: 6px; }
  .news-item-actions { flex-direction: row; }
  .article-detail { padding: 14px; }
  .article-detail h1 { font-size: 18px; }
  .article-content { font-size: 15px; }
  .scrape-modal { max-width: 95vw !important; }
  .scrape-modal .scrape-log-area { max-height: 200px; font-size: 11px; }
  .scrape-source-grid { grid-template-columns: 1fr; }
  .btn.btn-sm { padding: 5px 12px; font-size: 12px; }

  /* Chat sidebar mobile */
  .chat-layout { height: calc(100vh - 120px); }
  .chat-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 260px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }
  .chat-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .bubble-wrapper { max-width: 85%; }
  .chat-msg.user .bubble-wrapper { max-width: 80%; }
  .chat-msg .bubble { font-size: 13px; }
  .quick-actions { gap: 4px; }
  .quick-actions::before { display: none; }
  .quick-btn { padding: 4px 10px; font-size: 11px; }
  .quick-dropdown { min-width: 120px; }
  .quick-sep { height: 12px; }
  .chat-input-wrap { gap: 6px; }
  .chat-input-wrap textarea { font-size: 13px; padding: 8px 10px; }
  .chat-input-wrap button { padding: 8px 12px; font-size: 13px; }
}

/* ========== 收藏按钮 ========== */
.fav-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted, #999);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}
.fav-btn:hover {
  color: var(--primary, #1a73e8);
  background: rgba(26,115,232,0.06);
}
.fav-btn.active {
  color: #f5a623;
}
.fav-btn.active:hover {
  color: #e09000;
}

/* ========== 主题标签 ========== */
.topic-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  vertical-align: middle;
}
.topic-经济发展 { background: #FFF3E0; color: #E65100; }
.topic-民生社会 { background: #E8F5E9; color: #2E7D32; }
.topic-政治治理 { background: #FCE4EC; color: #C62828; }
.topic-生态文明 { background: #E0F2F1; color: #00695C; }
.topic-文化教育 { background: #E3F2FD; color: #1565C0; }
.topic-国际视野 { background: #F3E5F5; color: #6A1B9A; }
.topic-综合要闻 { background: #FFF8E1; color: #F57F17; }
.topic-乡村振兴 { background: #F1F8E9; color: #33691E; }

/* ========== 来源标签（已有，补充样式） ========== */
.source-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
  vertical-align: middle;
}
.source-people { background: #FFEBEE; color: #C62828; }
.source-qstheory { background: #FFF3E0; color: #E65100; }
.source-banyuetan { background: #E3F2FD; color: #1565C0; }

/* ========== 分页 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
}
.page-info {
  color: var(--text-muted, #999);
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}

/* ========== 登录提示 ========== */
.login-prompt {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted, #999);
}
.login-prompt p { margin-bottom: 12px; }

/* ========== 打印样式 ========== */
@media print {
  .header, .footer, .nav, .search-bar, .fav-btn, .btn-link,
  .msg-actions, .sidebar, .back-top, .chat-sidebar,
  .sidebar-toggle, .chat-input-wrap, .quick-actions,
  .pagination, .login-prompt, .scrape-modal,
  .btn-outline, .btn-primary { display: none !important; }
  body { background: white; font-size: 12pt; color: #000; }
  .container { max-width: 100%; padding: 0; margin: 0; }
  .article-detail { box-shadow: none; border: none; padding: 0; }
  .article-content { line-height: 1.8; }
  a { color: #000; text-decoration: underline; }
  .bubble { border: 1px solid #ccc; break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  .news-item { break-inside: avoid; }
  .stats-bar { font-size: 10pt; }
  img { max-width: 100%; height: auto; }
}

/* ========== AI 文章分析 ========== */

.ai-analyze-btn {
  background: #f0f7ff;
  color: #1976d2;
  border: 1px solid #cfe3ff;
  border-radius: 4px;
  font-size: 12px;
  padding: 2px 8px;
  cursor: pointer;
}
.ai-analyze-btn:hover { background: #e1efff; }
.ai-analyze-btn:disabled { opacity: 0.7; cursor: wait; }

.ai-view-btn {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #b8dfb8;
  border-radius: 4px;
  font-size: 12px;
  padding: 2px 8px;
  text-decoration: none;
  cursor: pointer;
}
.ai-view-btn:hover { background: #c8e6c9; }

/* AI 分析页面 */
.analysis-page {
  max-width: 800px;
  margin: 0 auto;
}
.analysis-header h1 {
  font-size: 24px;
  color: var(--text, #333);
  margin-bottom: 12px;
  line-height: 1.5;
}
.analysis-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #eee);
}
.analysis-content {
  background: var(--bg-white, #fff);
  padding: 24px;
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.06));
  margin-top: 20px;
  line-height: 1.9;
  font-size: 15px;
}
.analysis-content h3.analysis-section-title {
  margin: 20px 0 10px;
  font-size: 18px;
  color: var(--primary, #c00);
  border-left: 3px solid var(--primary, #c00);
  padding-left: 10px;
}
.analysis-content h4 {
  margin: 14px 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.analysis-content strong {
  color: var(--text, #333);
}
.analysis-content ol {
  padding-left: 24px;
  margin: 10px 0;
}
.analysis-content ul {
  padding-left: 24px;
  margin: 10px 0;
  list-style-type: disc;
}
.analysis-content p {
  margin: 8px 0;
  line-height: 1.8;
}
.analysis-content table.analysis-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
.analysis-content table.analysis-table th,
.analysis-content table.analysis-table td {
  border: 1px solid var(--border, #eee);
  padding: 8px 12px;
  text-align: left;
}
.analysis-content table.analysis-table th {
  background: #f5f5f5;
  font-weight: 600;
}
.analysis-content table.analysis-table tr:nth-child(even) {
  background: #fafafa;
}
.analysis-content li {
  margin-bottom: 10px;
  line-height: 1.7;
}

/* 分析空状态 */
.analysis-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #999);
}
.analysis-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.analysis-empty p {
  margin-bottom: 20px;
  font-size: 16px;
}

@media print {
  .ai-analyze-btn, .ai-view-btn, .analysis-actions { display: none !important; }
}
