/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --red: #ea4335;
  --orange: #f9ab00;
  --green: #34a853;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== 顶部导航栏 ===== */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 32px;
  line-height: 1;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.update-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}

.status-dot.fetching {
  background: var(--orange);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-refresh:hover { background: var(--primary-dark); }
.btn-refresh:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-refresh svg.spinning { animation: spin 0.8s linear infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 分类导航栏 ===== */
.category-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 65px;
  z-index: 90;
}

.category-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-inner::-webkit-scrollbar { height: 4px; }
.category-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.cat-btn:hover { color: var(--text); }

.cat-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.cat-count {
  font-size: 12px;
  background: var(--border-light);
  color: var(--text-secondary);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.cat-btn.active .cat-count {
  background: var(--primary);
  color: white;
}

/* ===== 工具栏 ===== */
.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 8px;
}

.toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.sort-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover { border-color: var(--primary); color: var(--primary); }

.sort-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.result-info {
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== 头条区域 ===== */
.headlines-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 16px;
}

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

.title-bar {
  width: 4px;
  height: 20px;
  background: var(--red);
  border-radius: 2px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 700;
}

.section-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

.headlines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
}

.headline-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.headline-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.headline-card .card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--border-light);
}

.headline-card .card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.headline-card .card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.headline-card .card-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

/* ===== 新闻列表 ===== */
.news-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  display: flex;
  gap: 16px;
  cursor: pointer;
}

.news-card:hover { box-shadow: var(--shadow-hover); }
.news-card:hover .card-title { color: var(--primary); }

.news-card.has-image { padding: 0; overflow: hidden; }
.news-card.has-image .card-content { padding: 16px 20px; flex: 1; }
.news-card.has-image .card-thumb {
  width: 140px;
  height: 100%;
  min-height: 120px;
  object-fit: cover;
  flex-shrink: 0;
}

.card-content { flex: 1; min-width: 0; }

.card-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.cat-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f0fe;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.important-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fce8e6;
  color: var(--red);
}

.source-name {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--text);
}

.card-title a { color: inherit; }
.card-title a:hover { color: var(--primary); text-decoration: none; }

.card-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.card-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.card-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.card-link:hover { text-decoration: underline; }

/* ===== 加载状态 ===== */
.loading-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.load-more-wrap {
  text-align: center;
  padding: 24px;
}

.btn-load-more {
  padding: 10px 32px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-load-more:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== 页脚 ===== */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-light);
  padding: 24px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer p {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.8;
}

.footer p.footer-beian { margin-top: 8px; }
.footer p.footer-beian:empty { display: none; }
.footer p.footer-beian a {
  color: var(--text-tertiary);
  text-decoration: none;
}
.footer p.footer-beian a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .topbar-inner { padding: 10px 16px; }
  .brand-title { font-size: 17px; }
  .brand-sub { font-size: 11px; }
  .brand-icon { font-size: 26px; }
  .update-info .status-text { display: none; }
  .btn-refresh span { display: none; }
  
  .category-inner { padding: 0 16px; }
  .cat-btn { padding: 10px 12px; font-size: 13px; }
  
  .toolbar { padding: 12px 16px 8px; }
  .toolbar-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  
  .headlines-section { padding: 8px 16px 16px; }
  .headlines-grid { grid-template-columns: 1fr; }
  
  .news-main { padding: 0 16px 32px; }
  .news-card { padding: 14px 16px; }
  .news-card.has-image .card-thumb { width: 100px; }
  .card-title { font-size: 15px; }
  .card-summary { font-size: 13px; }
}

/* ===== 次要按钮 ===== */
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f6ff;
}

/* ===== 新闻卡片操作按钮 ===== */
.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}

.card-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.card-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f6ff;
}

.card-action-btn.translated {
  color: var(--green);
  border-color: var(--green);
}

/* 翻译后的文本 */
.translated-title {
  color: var(--text);
  font-weight: 600;
}

.translation-label {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  margin-right: 4px;
}

.translated-summary {
  color: var(--text-secondary);
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  animation: slideUp 0.2s;
}

.modal-large { max-width: 800px; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
}

.tab-btn {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== 来源列表 ===== */
.sources-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f5f5f7;
  border-radius: var(--radius-sm);
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.source-item:hover { border-color: var(--border); }

.source-info { flex: 1; min-width: 0; }

.source-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.source-url {
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 500px;
}

.source-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.source-badge.builtin { background: #e8f0fe; color: var(--primary); }
.source-badge.custom { background: #e6f4ea; color: var(--green); }

.source-weight {
  font-size: 12px;
  color: var(--text-tertiary);
}

.btn-delete-source {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete-source:hover {
  background: #fce8e6;
  border-color: var(--red);
}

/* ===== 搜���框 ===== */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-box input:focus { border-color: var(--primary); }

.btn-search {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-search:hover { background: var(--primary-dark); }

.search-hint {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #f5f5f7;
  border-radius: var(--radius-sm);
}

.search-hint p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.direct-add {
  display: flex;
  gap: 8px;
}

.direct-add input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.direct-add input:focus { border-color: var(--primary); }

.btn-add-direct {
  padding: 8px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add-direct:hover { filter: brightness(0.9); }

/* ===== 搜索结果 ===== */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-hint {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 30px;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}

.search-result-item:hover { border-color: var(--border); }

.search-result-info { flex: 1; min-width: 0; }

.search-result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.search-result-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.search-result-meta .lang-tag {
  background: var(--border-light);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.search-result-actions {
  flex-shrink: 0;
}

.btn-add-source {
  padding: 6px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add-source:hover { background: var(--primary-dark); }

.btn-add-source.added {
  background: var(--green);
  cursor: default;
}

.btn-add-source.exists {
  background: var(--border);
  color: var(--text-tertiary);
  cursor: default;
}

/* ===== 分析报告 ===== */
.analyze-report { font-size: 14px; }

.analyze-section {
  margin-bottom: 24px;
}

.analyze-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analyze-section h3 .section-icon {
  font-size: 18px;
}

.analyze-event-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 12px 16px;
  background: #f0f6ff;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  line-height: 1.5;
}

.analyze-event-title a {
  font-size: 13px;
  font-weight: 400;
  margin-left: 8px;
}

.analyze-origin {
  padding: 12px 16px;
  background: #fff8e1;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--orange);
}

.analyze-origin .origin-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.analyze-origin .origin-source {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.analyze-origin .origin-time {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.analyze-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.timeline-item:hover { background: var(--bg); }

.timeline-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  width: 120px;
}

.timeline-content { flex: 1; min-width: 0; }

.timeline-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.media-coverage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.media-coverage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.media-coverage-item .media-name {
  font-size: 13px;
  font-weight: 500;
}

.media-coverage-item .media-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.media-coverage-bar {
  flex: 1;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  margin: 0 12px;
  overflow: hidden;
}

.media-coverage-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

.factors-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.factor-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #fef7e0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.factor-item .factor-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.analyze-note {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: 16px;
}

.external-refs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.external-ref-item {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.external-ref-item a {
  font-weight: 600;
}

.external-ref-item p {
  color: var(--text-secondary);
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

@media (max-width: 768px) {
  .modal { max-width: 100%; max-height: 95vh; }
  .modal-body { padding: 16px; }
  .direct-add { flex-wrap: wrap; }
  .direct-add input { width: 100%; }
  .analyze-stats { grid-template-columns: repeat(2, 1fr); }
  .timeline-time { width: 80px; font-size: 11px; }
  .guestbook-form { flex-direction: column; }
  .guestbook-form input, .guestbook-form textarea { width: 100%; }
  .topbar-actions .btn-secondary span, .topbar-actions .btn-refresh span { display: none; }
}

/* ===== 留言板 ===== */
.guestbook-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 40px;
}

.guestbook-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.guestbook-form input {
  width: 160px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.guestbook-form input:focus { border-color: var(--primary); }

.guestbook-form textarea {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}

.guestbook-form textarea:focus { border-color: var(--primary); }

.btn-submit-guestbook {
  padding: 10px 24px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
}

.btn-submit-guestbook:hover { filter: brightness(0.9); }
.btn-submit-guestbook:disabled { opacity: 0.6; cursor: not-allowed; }

.guestbook-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guestbook-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
}

.guestbook-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.guestbook-content-wrap { flex: 1; min-width: 0; }

.guestbook-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.guestbook-nick {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.guestbook-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.guestbook-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.guestbook-delete {
  flex-shrink: 0;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--red);
  font-size: 12px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s;
}

.guestbook-delete:hover {
  background: #fce8e6;
  border-color: var(--red);
}

/* ===== 管理员 ===== */
.badge-count {
  display: inline-block;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

.admin-login-form input:focus { border-color: var(--primary); }

.btn-admin-login {
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-admin-login:hover { background: var(--primary-dark); }

/* 管理员已登录状态 */
.btn-secondary.admin-active {
  border-color: var(--green);
  color: var(--green);
  background: #e6f4ea;
}

/* ===== 来源申请表单 ===== */
.request-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.request-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.request-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.request-field input, .request-field textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

.request-field input:focus, .request-field textarea:focus { border-color: var(--primary); }
.request-field input[readonly] { background: var(--bg); color: var(--text-secondary); }

.btn-submit-request {
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit-request:hover { background: var(--primary-dark); }

/* ===== 审批��表 ===== */
.request-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.request-info { flex: 1; min-width: 0; }

.request-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.request-url {
  font-size: 12px;
  color: var(--text-tertiary);
  word-break: break-all;
  margin-bottom: 4px;
}

.request-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.request-reason {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 4px;
  line-height: 1.5;
}

.request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-approve, .btn-reject {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s;
}

.btn-approve {
  background: var(--green);
  color: white;
}

.btn-reject {
  background: var(--border);
  color: var(--text-secondary);
}

.btn-approve:hover { filter: brightness(0.9); }
.btn-reject:hover { background: var(--red); color: white; }

/* ===== 顶部搜索栏 ===== */
.search-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
}

.search-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 10px 38px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input-wrap input:focus { border-color: var(--primary); }

.search-clear {
  position: absolute;
  right: 10px;
  background: var(--border-light);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 16px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover { background: var(--border); }

.btn-search-go {
  padding: 10px 22px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-search-go:hover { background: var(--primary-dark); }

/* ===== 视图头部（搜索/收藏） ===== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f0f6ff;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.view-header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.view-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.view-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-back-news {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.btn-back-news:hover { background: var(--primary); color: white; }

/* ===== 收藏按钮 ===== */
.card-action-btn.favorited {
  color: #f9ab00;
  border-color: #f9ab00;
  background: #fff8e1;
}

.fav-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* 关注关键词高亮 */
.highlight-kw {
  background: #fff3cd;
  color: #856404;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: 0 0 0 1px #ffe69c;
}
}

/* ===== 事件可视化 ===== */
.viz-input-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.viz-input-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}

.viz-input-bar input:focus { border-color: var(--primary); }

.viz-type-group {
  display: flex;
  gap: 4px;
}

.viz-type-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.viz-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.viz-type-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.btn-viz-go {
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-viz-go:hover { background: var(--primary-dark); }
.btn-viz-go:disabled { opacity: 0.6; cursor: not-allowed; }

.viz-result {
  min-height: 400px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.viz-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}

.viz-chart-container {
  width: 100%;
  height: 600px;
}

.viz-timeline-info {
  padding: 12px 16px;
  background: #f0f6ff;
  font-size: 13px;
  color: var(--text-secondary);
}

.viz-branch-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.viz-branch {
  border-left: 3px solid var(--primary);
  padding-left: 16px;
}

.viz-branch-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.viz-branch-count {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.viz-branch-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.viz-branch-item {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}

.viz-branch-time {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
  width: 140px;
}

.viz-branch-content {
  flex: 1;
}

.viz-branch-source {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.viz-branch-title-text {
  font-size: 13px;
  color: var(--text);
  margin-top: 2px;
}

.viz-mermaid {
  display: flex;
  justify-content: center;
  padding: 20px;
  overflow-x: auto;
}

.viz-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-tertiary);
}
