/* 易小红 - 小红书网页助手内容样式 */

/* 主题变量定义 - 作用于所有容器 */
.xhs-note-assistant,
.image-download-modal-overlay,
.markdown-preview-modal,
.assistant-notification,
#yixh-comment-list-modal,
.yixh-modal-overlay {
  --yixh-card-bg: #fff;
  --yixh-bg-body: #f8fafc;
  --yixh-bg-soft: #f1f5f9;
  --yixh-bg-hover: #f1f5f9;
  --yixh-text-main: #1e293b;
  --yixh-text-secondary: #475569;
  --yixh-text-meta: #94a3b8;
  --yixh-border: #e2e8f0;
  --yixh-border-light: #f1f5f9;
  --yixh-shadow: rgba(0, 0, 0, 0.1);
  --yixh-shadow-soft: rgba(0, 0, 0, 0.05);
  --yixh-selected-bg: #fff1f2;
  --yixh-primary: #ff2442;
  --yixh-primary-hover: #e01f3a;
  --yixh-primary-shadow: rgba(255, 36, 66, 0.15);
}

@media (prefers-color-scheme: dark) {
  .xhs-note-assistant,
  .image-download-modal-overlay,
  .markdown-preview-modal,
  .assistant-notification,
  #yixh-comment-list-modal,
  .yixh-modal-overlay {
    --yixh-card-bg: #1e293b;
    --yixh-bg-body: #0f172a;
    --yixh-bg-soft: #334155;
    --yixh-bg-hover: #1e293b;
    --yixh-text-main: #f1f5f9;
    --yixh-text-secondary: #94a3b8;
    --yixh-text-meta: #64748b;
    --yixh-border: #334155;
    --yixh-border-light: #1e293b;
    --yixh-shadow: rgba(0, 0, 0, 0.4);
    --yixh-shadow-soft: rgba(0, 0, 0, 0.2);
    --yixh-selected-bg: rgba(255, 36, 66, 0.15);
    --yixh-primary: #ff2442;
    --yixh-primary-hover: #e6203b;
    --yixh-primary-shadow: rgba(0, 0, 0, 0.5);
  }
}

/* 浮层布局样式 */
.xhs-note-assistant {
  position: fixed;
  right: 50px;
  top: 100px;
  width: 300px;
  z-index: 9999;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 10px 25px var(--yixh-shadow), 0 4px 10px var(--yixh-shadow-soft);
  box-sizing: border-box;
  border-radius: 12px;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  background: var(--yixh-card-bg);
}

.xhs-note-assistant.collapsed {
  transform: translateX(calc(100% + 50px));
  animation: none !important;
}

/* 文章卡片 */
.assistant-card {
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  background-color: var(--yixh-card-bg);
  border-radius: 12px;
  border: 1px solid var(--yixh-border);
}

/* 展开手柄 */
.yixh-expand-handle {
  position: absolute;
  left: 0;
  top: 40px;
  width: 44px;
  height: 44px;
  background: var(--yixh-card-bg);
  border: 1px solid var(--yixh-border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: -4px 0 12px var(--yixh-shadow-soft);
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: -1;
}

.xhs-note-assistant.collapsed .yixh-expand-handle {
  visibility: visible;
  opacity: 1;
  left: -44px;
}

.handle-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 文章内容预览 */
.article-info { margin-bottom: 20px; }
.cover-image { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.article-title {
  margin: 0 0 10px 0; font-size: 16px; font-weight: 600; color: var(--yixh-text-main); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.author-info { display: flex; align-items: center; margin-bottom: 12px; }
.author-avatar { width: 22px; height: 22px; border-radius: 50%; margin-right: 10px; }
.author-name { font-size: 13px; color: var(--yixh-text-meta); font-weight: 500; }

/* 功能按钮网格 */
.functions-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.function-btn {
  padding: 12px 6px; background-color: var(--yixh-bg-body); color: var(--yixh-text-secondary); border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all 0.2s;
}
.function-btn:hover { background-color: var(--yixh-bg-soft); color: #ff2442; border-color: var(--yixh-primary-shadow); transform: translateY(-2px); box-shadow: 0 4px 12px var(--yixh-shadow-soft); }

/* --- 选项卡导航 --- */
.assistant-tabs {
  display: flex; background-color: var(--yixh-bg-soft); margin: 0 0 16px 0; padding: 4px; border-radius: 10px;
}
.assistant-tab {
  flex: 1; padding: 7px 0; text-align: center; font-size: 13px; color: var(--yixh-text-meta); cursor: pointer;
  transition: all 0.2s; font-weight: 500; border-radius: 8px;
}
.assistant-tab.active { color: #ff2442; font-weight: 600; background-color: var(--yixh-card-bg); box-shadow: 0 2px 8px var(--yixh-shadow-soft); }

.assistant-tab[data-tab="assistant-settings"] {
  flex: 0.8;
}

.tab-content {
  display: none;
}

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

/* --- 状态视图 (引导/加载) --- */
.status-view { 
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  padding: 24px 12px; text-align: center;
}
.status-icon, .loading-anim {
  width: 72px; height: 72px; background: #fff1f2; border-radius: 50%; display: flex; 
  align-items: center; justify-content: center; margin-bottom: 20px; color: #ff2442; 
  font-size: 28px; box-shadow: 0 8px 16px var(--yixh-primary-shadow);
  flex-shrink: 0; /* 强制不被压扁 */
}
.loading-anim { background: var(--yixh-card-bg); border: 3px solid var(--yixh-bg-soft); border-top-color: #ff2442; }

.status-view p { font-size: 15px; font-weight: 600; color: var(--yixh-text-main); margin-bottom: 20px; line-height: 1.5; }

.point-notice {
  display: inline-flex; align-items: center; gap: 8px; background: #fffbeb; color: #b45309; 
  padding: 8px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 13px; 
  border: 1px solid #fef3c7; font-weight: 500;
}

.auto-deduct-option {
  display: flex; align-items: center; gap: 8px; margin-bottom: 24px; font-size: 12.5px; 
  color: var(--yixh-text-secondary); cursor: pointer; user-select: none;
}
.auto-deduct-option input { width: 15px; height: 15px; accent-color: #ff2442; cursor: pointer; }

.btn-primary-small {
  background: linear-gradient(135deg, #ff2442 0%, #e6203b 100%); color: white; border: none; 
  padding: 12px 32px; border-radius: 25px; cursor: pointer; font-size: 14px; font-weight: 600; 
  transition: all 0.3s; box-shadow: 0 8px 16px -4px var(--yixh-primary-shadow);
  display: inline-block;
}
.btn-primary-small:hover { transform: translateY(-2px); box-shadow: 0 12px 20px -5px var(--yixh-primary-shadow); opacity: 0.95; }

.btn-secondary-small {
  background: var(--yixh-card-bg);
  color: var(--yixh-text-secondary);
  border: 1px solid var(--yixh-border);
  padding: 10px 24px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-secondary-small:hover {
  background: var(--yixh-bg-body);
  border-color: var(--yixh-border);
  color: var(--yixh-text-main);
}

.error-notice {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.error-notice::before {
  content: "\f05a";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  margin-right: 4px;
}

.error-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* --- 文章列表列表 --- */
.latest-articles-container {
  max-height: 560px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable; /* 预留滚动条位置，防止出现时内容左右晃动 */
}

/* 隐藏滚动条但保留功能 (针对不同浏览器) */
.latest-articles-container::-webkit-scrollbar {
  width: 5px;
}
.latest-articles-container::-webkit-scrollbar-track {
  background: transparent;
}
.latest-articles-container::-webkit-scrollbar-thumb {
  background: var(--yixh-border);
  border-radius: 10px;
}
.latest-articles-container::-webkit-scrollbar-thumb:hover {
  background: var(--yixh-text-meta);
}

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

.pagination-container {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  padding-bottom: 8px;
}

.load-more-btn {
  background: var(--yixh-card-bg);
  color: #ff2442;
  border: 1px solid #ff2442;
  padding: 8px 20px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.load-more-btn:hover {
  background: var(--yixh-bg-soft);
  transform: translateY(-1px);
}

.load-more-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.latest-article-item {
  display: flex; gap: 14px; padding: 12px; background: var(--yixh-card-bg); border: 1px solid var(--yixh-border-light); 
  border-radius: 12px; text-decoration: none; color: inherit; transition: all 0.25s;
}
.latest-article-item:hover {
  transform: translateY(-2px); border-color: #ff2442; box-shadow: 0 10px 15px -3px var(--yixh-shadow); background: var(--yixh-bg-body);
}

.mini-cover { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f8fafc; flex-shrink: 0; }
.mini-info { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.mini-title {
  font-size: 14px; font-weight: 600; color: var(--yixh-text-main); line-height: 1.4; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-meta { font-size: 11px; color: var(--yixh-text-meta); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.mini-meta::before { content: "\f017"; font-family: "Font Awesome 5 Free"; font-weight: 900; opacity: 0.6; }

/* --- 独立外挂收起按钮 (右侧竖版) --- */
.yixh-external-collapse-btn {
  position: absolute; top: 40px; right: -23px; width: 24px; height: 44px;
  background: var(--yixh-card-bg); border: 1px solid var(--yixh-border); border-left: none;
  border-radius: 0 10px 10px 0; display: flex; align-items: center;
  justify-content: center; cursor: pointer; z-index: 10001; color: var(--yixh-text-meta);
  box-shadow: 4px 0 10px var(--yixh-shadow-soft); transition: all 0.3s;
}
.yixh-external-collapse-btn:hover { color: #ff2442; width: 25px; right: -24px; background: var(--yixh-bg-body); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- 骨架屏加载效果 --- */
.yixh-skeleton {
  background: var(--yixh-bg-soft);
  background: linear-gradient(
    90deg,
    var(--yixh-bg-soft) 25%,
    var(--yixh-bg-body) 50%,
    var(--yixh-bg-soft) 75%
  );
  background-size: 200% 100%;
  animation: yixh-shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.yixh-skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background-color: var(--yixh-bg-soft);
}

.yixh-skeleton-text {
  height: 16px;
  margin-bottom: 8px;
  border-radius: 4px;
  width: 100%;
}

.yixh-skeleton-text.short {
  width: 60%;
}

@keyframes yixh-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 图片加载渐显 */
.yixh-fade-in {
  animation: yixh-fade-in 0.4s ease-out forwards;
}

@keyframes yixh-fade-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.cover-image-container {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: var(--yixh-bg-soft);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.cover-image-container.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 25%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: yixh-shimmer 1.5s infinite linear;
}

.assistant-notification {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(8px);
  color: white;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 99999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.assistant-notification::before {
  content: "\f05a";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  color: #3b82f6;
}

.assistant-notification.success::before {
  content: "\f058";
  color: #ff2442;
}

.assistant-notification.error::before {
  content: "\f06a";
  color: #ef4444;
}

.assistant-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* --- Modal Content Scoping --- */
.image-download-modal .modal-header, .modal-content .modal-header {
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.image-download-modal .modal-footer, .modal-content .modal-footer {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

/* Image Item Checkbox Animation */
@keyframes check-pop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.image-checkbox:checked + .checkbox-label::after {
  animation: check-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Scrollbar Style for Modal Body */
.modal-body::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-track {
  background: var(--yixh-bg-body);
}
.modal-body::-webkit-scrollbar-thumb {
  background: var(--yixh-border);
  border-radius: 4px;
  border: 2px solid var(--yixh-bg-body);
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--yixh-text-meta);
}

/* Hover effect for buttons in markdown modal */
.modal-footer .btn-primary:active, .modal-footer .btn-secondary:active {
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-download-modal, .modal-content {
    width: 95%;
    max-height: 90vh;
  }
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
  }
}

/* --- Modal Base Styles --- */
.image-download-modal-overlay, .markdown-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  animation: modal-backdrop-in 0.3s ease-out;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.image-download-modal, .modal-content {
  background: var(--yixh-card-bg, #fff);
  width: 90%;
  max-width: 960px;
  max-height: 85vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modal-content-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modal-content-in {
  from { transform: scale(0.95) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--yixh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--yixh-bg-soft); /* 找回头部的背景色 */
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--yixh-text-main);
}

.close-modal {
  background: var(--yixh-bg-soft);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  color: var(--yixh-text-secondary);
  font-size: 14px;
  transition: all 0.2s;
}

.close-modal:hover {
  background: #fee2e2;
  color: #ef4444;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--yixh-bg-body);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--yixh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--yixh-bg-soft); /* 找回尾部的背景色 */
}

/* --- Image Download Modal Specifics --- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.image-item {
  background: var(--yixh-card-bg);
  border-radius: 12px;
  border: 1px solid var(--yixh-border);
  overflow: hidden;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-sizing: border-box;
}

.image-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -5px var(--yixh-shadow);
  border-color: #ff2442;
}

.image-item.selected {
  border-color: #ff2442;
  border-width: 2px;
  background: var(--yixh-selected-bg);
  box-shadow: 0 0 0 1px #ff2442 inset; /* 增强边框感 */
}

.image-container {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--yixh-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.image-item:hover .thumbnail {
  transform: scale(1.05);
}

.image-checkbox-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}

.image-checkbox {
  display: none;
}

.checkbox-label {
  width: 24px;
  height: 24px;
  background: var(--yixh-card-bg);
  border: 2px solid var(--yixh-text-meta);
  border-radius: 6px;
  display: block;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.image-checkbox:checked + .checkbox-label {
  background: #ff2442;
  border-color: #ff2442;
}

.image-checkbox:checked + .checkbox-label::after {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: white;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.image-info {
  padding: 10px;
  border-top: 1px solid var(--yixh-border-light);
  display: flex;
  justify-content: center;
}

.download-single-btn {
  background: var(--yixh-bg-soft);
  color: var(--yixh-text-secondary);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.download-single-btn:hover {
  background: #ff2442;
  color: #fff;
}

.left-controls, .right-controls {
  display: flex;
  gap: 12px;
}

.select-all-btn, .deselect-all-btn {
  background: var(--yixh-card-bg); /* 改用卡片背景色，与 soft 底部形成对比 */
  border: 1px solid var(--yixh-border);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--yixh-text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px var(--yixh-shadow-soft);
}

.select-all-btn:hover, .deselect-all-btn:hover { 
  background: var(--yixh-bg-hover); 
  border-color: #ff2442;
  color: #ff2442;
  transform: translateY(-1px);
}

.batch-download-btn, .zip-download-btn {
  background: #ff2442;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px -1px var(--yixh-primary-shadow);
}

.zip-download-btn { background: #1e293b; box-shadow: 0 4px 6px -1px rgba(30, 41, 59, 0.2); }

.batch-download-btn:hover, .zip-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}

/* --- Markdown Preview Modal Specifics --- */
.markdown-preview-modal .modal-content {
  max-width: 800px;
}

.article-info-preview {
  background: var(--yixh-card-bg);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--yixh-border);
  margin-bottom: 20px;
}

.article-info-preview h4 { margin: 0 0 8px 0; color: var(--yixh-text-main); }
.article-meta { margin: 0; font-size: 13px; color: var(--yixh-text-secondary); }

.preview-container h4 { margin: 0 0 12px 0; font-size: 15px; color: var(--yixh-text-main); }

.markdown-preview {
  background: var(--yixh-bg-body);
  border-radius: 12px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  color: var(--yixh-text-main);
  font-family: 'Fira Code', 'Roboto Mono', 'Source Code Pro', monospace;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--yixh-border);
}

.markdown-preview pre { margin: 0; white-space: pre-wrap; word-break: break-all; }

.markdown-preview::-webkit-scrollbar { width: 8px; }
.markdown-preview::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary { background: #ff2442; color: white; box-shadow: 0 4px 8px -2px var(--yixh-primary-shadow); }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 8px 16px -4px var(--yixh-primary-shadow); }

.btn-secondary { 
  background: var(--yixh-card-bg); 
  color: var(--yixh-text-secondary); 
  border: 1px solid var(--yixh-border);
  box-shadow: 0 1px 2px var(--yixh-shadow-soft);
}

.btn-secondary:hover { 
  background: var(--yixh-bg-hover); 
  color: var(--yixh-text-main);
  border-color: var(--yixh-text-meta);
  transform: translateY(-1px);
}

/* --- 文章目录 --- */
.yixh-toc-container {
  max-height: 560px;
  overflow-y: auto;
  padding: 4px 12px;
  position: relative;
}

.yixh-toc-container::-webkit-scrollbar {
  width: 5px;
}
.yixh-toc-container::-webkit-scrollbar-thumb {
  background: var(--yixh-border);
  border-radius: 10px;
}

.yixh-toc-list {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.yixh-toc-item {
  list-style: none !important;
  position: relative;
  transition: all 0.2s;
}

.yixh-toc-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  color: var(--yixh-text-secondary);
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.2s;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.yixh-toc-link:hover {
  background-color: var(--yixh-bg-hover);
  color: #ff2442;
}

.yixh-toc-toggle, .yixh-toc-toggle-placeholder {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.2s;
}

.yixh-toc-toggle {
  cursor: pointer;
  color: var(--yixh-text-meta);
}

.yixh-toc-toggle:hover {
  background-color: var(--yixh-bg-soft);
  color: #ff2442;
}

.yixh-toc-toggle i {
  font-size: 9px;
  transition: transform 0.2s;
}

.yixh-toc-item.collapsed > .yixh-toc-link .yixh-toc-toggle i {
  transform: rotate(-90deg);
}

.yixh-toc-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 6px;
  color: var(--yixh-text-meta);
  margin-left: 2px;
}

.yixh-toc-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.yixh-toc-item.active > .yixh-toc-link {
  color: #ff2442 !important;
  background-color: var(--yixh-selected-bg);
  font-weight: 600;
}

.yixh-toc-item.active > .yixh-toc-link .yixh-toc-icon,
.yixh-toc-item.active > .yixh-toc-link .yixh-toc-toggle {
  color: #ff2442;
}

.yixh-toc-item.collapsed > .yixh-toc-children {
  display: none;
}

/* 层级关系线 */
.yixh-toc-children {
  position: relative;
  margin-left: 17px; /* 对齐 toggle 中心 */
  padding-left: 4px;
}

.yixh-toc-children::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 8px;
  width: 1px;
  background-color: var(--yixh-border-light);
}

/* 层级样式微调 */
.yixh-toc-level-1 > .yixh-toc-link { font-weight: 600; font-size: 14px; margin-top: 4px; padding-left: 4px; }
.yixh-toc-level-1 > .yixh-toc-link .yixh-toc-icon { font-size: 8px; }

.yixh-toc-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--yixh-text-meta);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.yixh-toc-empty i {
  font-size: 32px;
  opacity: 0.3;
}
/* --- 参数设置 --- */
.settings-group {
  margin-bottom: 20px;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--yixh-text-meta);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  padding-left: 2px;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--yixh-border-light);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--yixh-text-main);
}

.settings-desc {
  font-size: 11px;
  color: var(--yixh-text-meta);
}

/* 简约开关样式 */
.yixh-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.yixh-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.yixh-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--yixh-bg-soft);
  transition: .3s;
  border-radius: 20px;
}

.yixh-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

input:checked + .yixh-slider {
  background-color: #ff2442;
}

input:checked + .yixh-slider:before {
  transform: translateX(16px);
}

/* --- 返回顶部按钮 --- */
.yixh-back-to-top {
  position: fixed;
  right: 160px; 
  bottom: 30px; 
  height: 30px;
  padding: 0 14px;
  background: linear-gradient(135deg, #0ed66e 0%, #ff2442 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  z-index: 9999; 
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px var(--yixh-primary-shadow);
}

.yixh-back-to-top.visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.yixh-back-to-top:hover {
  transform: translateY(-3px) scale(1.05) !important;
  box-shadow: 0 6px 18px var(--yixh-primary-shadow);
}

.yixh-back-to-top i {
  transform: rotate(-45deg);
  font-size: 14px;
  display: inline-block;
  transition: transform 0.3s;
}

.yixh-back-to-top:hover i {
  transform: rotate(-45deg) translateY(-2px);
}

/* --- Video Download Modal Specifics --- */
.video-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.video-item {
  height: auto;
}

.video-preview-container {
  aspect-ratio: 4 / 3; /* 增加高度，原来是 16/9 */
  background: #0f172a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-item .thumbnail {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain; /* 适配高度缩放 */
  transition: transform 0.3s;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #475569;
  font-size: 32px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: rgba(255, 36, 66, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  opacity: 0.8;
  transition: all 0.3s;
  pointer-events: auto; /* 改为 auto 以便点击 */
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 5;
}

.video-play-overlay:hover {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
  background: #ff2442;
}

.video-preview-container iframe, .video-preview-container video {
  width: 100%;
  height: 100%;
  border: none;
}

.video-id-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  pointer-events: none;
}

/* --- YIXH Premium Modal (Brother of YIWX) --- */
.yixh-modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 20000; animation: yixh-modal-backdrop-in 0.3s ease-out;
}

@keyframes yixh-modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.yixh-modal-content {
  background: var(--yixh-card-bg); width: 90%; max-width: 960px; max-height: 85vh;
  border-radius: 20px; display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: yixh-modal-content-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes yixh-modal-content-in {
  from { transform: scale(0.95) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--yixh-border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--yixh-bg-soft);
}

.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--yixh-text-main); }

.close-modal {
  background: var(--yixh-bg-soft); border: none; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
  cursor: pointer; color: var(--yixh-text-secondary); font-size: 14px;
  transition: all 0.2s;
}
.close-modal:hover { background: #fee2e2; color: var(--yixh-primary); }

.modal-body { flex: 1; overflow-y: auto; padding: 24px; background: var(--yixh-bg-body); }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }

.image-item {
  background: var(--yixh-card-bg); border-radius: 12px; border: 1px solid var(--yixh-border);
  overflow: hidden; position: relative; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer; box-sizing: border-box;
}
.image-item:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -5px var(--yixh-shadow); border-color: var(--yixh-primary); }
.image-item.selected { border-color: var(--yixh-primary); border-width: 2px; background: var(--yixh-selected-bg); box-shadow: 0 0 0 1px var(--yixh-primary) inset; }

.image-container { aspect-ratio: 3 / 4; overflow: hidden; background: var(--yixh-bg-soft); display: flex; align-items: center; justify-content: center; }
.thumbnail { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.image-item:hover .thumbnail { transform: scale(1.05); }

.image-checkbox-container { position: absolute; top: 10px; left: 10px; z-index: 10; }
.image-checkbox { display: none; }
.checkbox-label {
  width: 24px; height: 24px; background: var(--yixh-card-bg); border: 2px solid var(--yixh-text-meta);
  border-radius: 6px; display: block; cursor: pointer; transition: all 0.2s; position: relative;
}
.image-checkbox:checked + .checkbox-label { background: var(--yixh-primary); border-color: var(--yixh-primary); }
.image-checkbox:checked + .checkbox-label::after {
  content: '\f00c'; font-family: 'Font Awesome 5 Free'; font-weight: 900;
  color: white; font-size: 12px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.image-info { padding: 10px; border-top: 1px solid var(--yixh-border-light); display: flex; justify-content: center; }

.download-single-btn {
  background: var(--yixh-bg-soft); color: var(--yixh-text-secondary); border: none;
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
}
.download-single-btn:hover { background: var(--yixh-primary); color: #fff; }

.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--yixh-border);
  display: flex; align-items: center; justify-content: space-between; background: var(--yixh-bg-soft);
}

.left-controls, .right-controls { display: flex; gap: 12px; align-items: center; }

.select-all-btn, .deselect-all-btn {
  background: var(--yixh-card-bg); border: 1px solid var(--yixh-border);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--yixh-text-secondary);
  cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 1px 2px var(--yixh-shadow-soft);
}
.select-all-btn:hover, .deselect-all-btn:hover { background: var(--yixh-bg-hover); border-color: var(--yixh-primary); color: var(--yixh-primary); transform: translateY(-1px); }

.batch-download-btn, .zip-download-btn {
  background: var(--yixh-primary); color: white; border: none; padding: 10px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: flex; align-items: center; gap: 8px;
}
.batch-download-btn:hover, .zip-download-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.batch-download-btn:hover { box-shadow: 0 4px 12px var(--yixh-primary-shadow); }
.zip-download-btn:hover { box-shadow: 0 4px 12px var(--yixh-shadow); }
.zip-download-btn { background: #475569; }
.batch-download-btn:disabled, .zip-download-btn:disabled { background: #cbd5e1; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.selected-count { font-size: 13px; color: var(--yixh-text-secondary); font-weight: 600; margin-left: 4px; }
#yixh-selected-count { color: var(--yixh-primary); }

/* Video Modal Specific Styles */
.video-preview-card {
  background: var(--yixh-bg-soft); border-radius: 12px; overflow: hidden; border: 1px solid var(--yixh-border);
  transition: all 0.3s ease;
}
.video-preview-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--yixh-shadow); }

.video-play-icon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 32px; height: 32px; background: rgba(255, 36, 66, 0.9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; box-shadow: 0 4px 15px var(--yixh-primary-shadow);
  transition: all 0.2s;
}
.video-preview-card:hover .video-play-icon { transform: translate(-50%, -50%) scale(1.1); background: var(--yixh-primary); }

.video-info-badge {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--yixh-text-secondary); background: var(--yixh-bg-body);
  padding: 8px 12px; border-radius: 8px; margin-top: 10px;
}
.video-info-badge i { color: var(--yixh-primary); }

/* --- Comment List Modal Styles --- */
.comment-row {
  transition: background-color 0.2s;
  cursor: default;
}

.comment-row:hover {
  background-color: var(--yixh-bg-soft);
}

#yixh-comment-search:focus {
  border-color: #ff2442 !important;
  box-shadow: 0 0 0 2px var(--yixh-primary-shadow);
}

.comment-table-header {
  position: sticky;
  top: 0;
  z-index: 5;
}

.comment-table-body::-webkit-scrollbar {
  width: 8px;
}

.comment-table-body::-webkit-scrollbar-track {
  background: var(--yixh-bg-body);
}

.comment-table-body::-webkit-scrollbar-thumb {
  background: var(--yixh-border);
  border-radius: 4px;
}

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

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.comment-table-body::-webkit-scrollbar-thumb:hover {
  background: var(--yixh-text-meta);
}

/* 下载封面按钮样式 */
.download-cover-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, transform 0.2s;
  z-index: 10;
}
.download-cover-btn:hover {
  background: rgba(255, 36, 66, 0.9);
  transform: scale(1.05);
}
.download-cover-btn i {
  font-size: 10px;
}

/* 搜索页面悬浮助手 */
.search-assistant {
  position: fixed;
  right: 50px;
  top: 100px;
  width: 190px;
  z-index: 9999;
}

.search-action-btn {
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 10px;
  border-width: 1px;
  border-style: solid;
  border-color: transparent;
  border-image: none;
  border-radius: 6px;
  gap: 8px;
  transition: 0.2s;
  width: 100%;
  box-sizing: border-box;
}

/* 导出按钮样式 */
.search-action-btn.export-btn {
  background-color: var(--yixh-card-bg);
  color: var(--yixh-text-secondary);
  border: 1px solid var(--yixh-border);
  font-weight: 500;
}
.search-action-btn.export-btn:hover {
  background-color: var(--yixh-bg-hover);
  border-color: var(--yixh-primary);
  color: var(--yixh-primary);
  transform: translateY(-1px);
}

/* 自动滚动加载按钮样式 */
.search-action-btn.scroll-btn {
  background-color: var(--yixh-primary);
  color: white;
  border: 1px solid var(--yixh-primary);
  font-weight: 600;
}
.search-action-btn.scroll-btn:hover {
  background-color: var(--yixh-primary-hover);
  border-color: var(--yixh-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px var(--yixh-primary-shadow);
}
.search-action-btn.scroll-btn.active {
  background-color: var(--yixh-primary-hover);
  color: white;
  border-color: var(--yixh-primary-hover);
  box-shadow: 0 4px 10px var(--yixh-primary-shadow);
}

/* 复制选项卡里的按钮样式 */
.search-action-btn.copy-btn {
  background-color: var(--yixh-bg-body);
  color: var(--yixh-text-main);
  border: 1px solid var(--yixh-border);
}
.search-action-btn.copy-btn:hover {
  background-color: var(--yixh-bg-soft);
}

/* 搜索导出模态框特定样式 */
.yixh-search-notes-table-body {
  flex: 1;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0;
}
.yixh-search-note-row {
  display: grid;
  grid-template-columns: 40px 60px 2fr 1.2fr 90px 110px 150px;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--yixh-border-light);
  align-items: center;
  font-size: 12px;
  transition: background-color 0.2s;
  box-sizing: border-box;
}
.yixh-search-note-row:hover {
  background-color: var(--yixh-bg-soft);
}
.yixh-search-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background-color: var(--yixh-bg-soft);
  border-bottom: 1px solid var(--yixh-border);
  font-size: 13px;
  color: var(--yixh-text-secondary);
  box-sizing: border-box;
}
.yixh-search-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.yixh-search-filter-group select, .yixh-search-filter-group input {
  padding: 6px 10px;
  border: 1px solid var(--yixh-border);
  border-radius: 6px;
  background: var(--yixh-card-bg);
  color: var(--yixh-text-main);
  font-size: 12.5px;
  outline: none;
}
.yixh-search-filter-group input {
  width: 150px;
}

/* View Mode Switcher */
.display-mode-btn {
  padding: 6px 10px;
  border: 1px solid var(--yixh-border);
  border-radius: 6px;
  background: var(--yixh-card-bg);
  color: var(--yixh-text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.display-mode-btn.active {
  background-color: #ff2442;
  color: #fff;
  border-color: #ff2442;
}

/* Grid view layout (图文式) */
.yixh-search-notes-grid-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
  padding: 16px;
  flex: 1;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0;
}
.yixh-search-card {
  position: relative;
  background: var(--yixh-card-bg);
  border-radius: 8px;
  border: 1px solid var(--yixh-border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 280px !important;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  box-sizing: border-box;
}
.yixh-search-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--yixh-shadow-soft);
}
.yixh-search-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4 !important;
  background-color: var(--yixh-bg-soft);
  overflow: hidden;
  display: block;
  flex-shrink: 0 !important;
}
.yixh-search-card-cover {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}
.yixh-search-card-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px !important;
  height: 18px !important;
  z-index: 10;
  cursor: pointer;
  margin: 0;
  appearance: checkbox !important;
  -webkit-appearance: checkbox !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.yixh-search-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  z-index: 10;
}
.yixh-search-card-info {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
  box-sizing: border-box;
}
.yixh-search-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--yixh-text-main);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 32px;
}
.yixh-search-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--yixh-text-secondary);
}
.yixh-search-card-author {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 65px;
}
.yixh-search-card-author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yixh-search-card-likes {
  color: #ff2442;
  font-weight: 600;
}

/* Selected row/card highlighting */
.yixh-search-card.yixh-selected {
  border: 2px solid var(--yixh-primary) !important;
  background-color: var(--yixh-selected-bg) !important;
}
.yixh-search-note-row.yixh-selected {
  background-color: var(--yixh-selected-bg) !important;
}

/* Button style overrides for search modal footer */
.modal-footer .btn-small {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  height: auto !important;
}

/* Dedicated search modal body layout */
.search-modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--yixh-bg-body);
  min-height: 0;
}

/* Checkbox override to bypass custom website resets */
.note-row-cb, .card-cb {
  appearance: checkbox !important;
  -webkit-appearance: checkbox !important;
  display: inline-block !important;
  opacity: 1 !important;
  visibility: visible !important;
  width: 16px !important;
  height: 16px !important;
  cursor: pointer !important;
}

/* Adjust card footer author flex alignment */
.note-grid-card .card-author {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 80px;
}
.note-grid-card .author-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Scrollbar Style for Search Notes Container */
#yixh-search-notes-container,
.yixh-search-notes-grid-body,
.yixh-search-notes-table-body {
  scrollbar-width: auto !important;
  scrollbar-color: var(--yixh-border) var(--yixh-bg-body) !important;
}

#yixh-search-notes-container::-webkit-scrollbar,
.yixh-search-notes-grid-body::-webkit-scrollbar,
.yixh-search-notes-table-body::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
  display: block !important;
}
#yixh-search-notes-container::-webkit-scrollbar-track,
.yixh-search-notes-grid-body::-webkit-scrollbar-track,
.yixh-search-notes-table-body::-webkit-scrollbar-track {
  background: var(--yixh-bg-body) !important;
  border-radius: 4px !important;
  display: block !important;
}
#yixh-search-notes-container::-webkit-scrollbar-thumb,
.yixh-search-notes-grid-body::-webkit-scrollbar-thumb,
.yixh-search-notes-table-body::-webkit-scrollbar-thumb {
  background: var(--yixh-border) !important;
  border-radius: 4px !important;
  border: 2px solid var(--yixh-bg-body) !important;
  display: block !important;
}
#yixh-search-notes-container::-webkit-scrollbar-thumb:hover,
.yixh-search-notes-grid-body::-webkit-scrollbar-thumb:hover,
.yixh-search-notes-table-body::-webkit-scrollbar-thumb:hover {
  background: var(--yixh-text-meta) !important;
}

#yixh-download-confirm-modal .yixh-modal-content,
#yixh-download-confirm-modal .modal-body {
  overflow: visible !important;
}

#yixh-download-confirm-modal .modal-header {
  border-top-left-radius: 16px !important;
  border-top-right-radius: 16px !important;
}

/* 下载确认弹窗 - 频控警示与悬浮提示气泡 */
.yixh-dl-warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  position: relative;
}

.yixh-dl-warning-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: #ef4444;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.yixh-dl-warning-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
}

.yixh-dl-warning-icon {
  font-size: 16px;
  color: #ef4444;
  flex-shrink: 0;
}

.yixh-dl-warning-count {
  font-weight: 700;
  font-size: 16px;
  color: #ef4444;
}

.yixh-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.12);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: #ef4444;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
}

.yixh-tooltip-wrapper:hover,
.yixh-tooltip-wrapper.active {
  background: rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.yixh-tooltip-trigger-icon {
  font-size: 13px;
}

.yixh-freq-tooltip-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--yixh-card-bg);
  border: 1px solid var(--yixh-border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
  z-index: 22000;
  pointer-events: none;
  text-align: left;
  color: var(--yixh-text-main);
  box-sizing: border-box;
}

.yixh-freq-tooltip-popover::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: var(--yixh-card-bg);
  border-left: 1px solid var(--yixh-border);
  border-top: 1px solid var(--yixh-border);
  transform: rotate(45deg);
}

.yixh-tooltip-wrapper:hover .yixh-freq-tooltip-popover,
.yixh-tooltip-wrapper.active .yixh-freq-tooltip-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.yixh-popover-header {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--yixh-text-main);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--yixh-border);
  display: flex;
  align-items: center;
}

.yixh-popover-card {
  margin-bottom: 10px;
  background: var(--yixh-bg-body);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--yixh-border);
}

.yixh-popover-card:last-child {
  margin-bottom: 0;
}

.yixh-popover-title {
  font-size: 13px;
  color: var(--yixh-text-main);
  margin-bottom: 6px;
  line-height: 1.4;
  font-weight: 600;
}

.yixh-popover-badge {
  color: #ef4444;
  font-weight: 600;
}

.yixh-popover-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  font-size: 12px;
  color: var(--yixh-text-secondary);
  line-height: 1.6;
}

.yixh-popover-list li {
  margin-bottom: 3px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.yixh-popover-list li:last-child {
  margin-bottom: 0;
}

/* Competitor Monitor Button in Note Assistant */
.author-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.yixh-monitor-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 36, 66, 0.08);
  color: #ff2442;
  border: 1px solid rgba(255, 36, 66, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
  margin-left: auto;
  outline: none;
}

.yixh-monitor-btn:hover {
  background: #ff2442;
  color: #ffffff;
  border-color: #ff2442;
  box-shadow: 0 2px 8px rgba(255, 36, 66, 0.3);
}

.yixh-monitor-btn.monitored {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.yixh-monitor-btn.monitored:hover {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Competitor Dashboard Modal Styles */
.yixh-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.yixh-dashboard-card {
  background: var(--yixh-bg-soft);
  border: 1px solid var(--yixh-border);
  border-radius: 10px;
  padding: 12px 14px;
}

.yixh-dashboard-card .card-label {
  font-size: 11px;
  color: var(--yixh-text-meta);
  margin-bottom: 4px;
}

.yixh-dashboard-card .card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--yixh-text-main);
}




