:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.header {
  position: relative;
  text-align: center;
  margin-bottom: 32px;
}

.header-nav {
  position: absolute;
  top: 0;
  right: 0;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(139, 92, 246, 0.15)
  );
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.nav-dropdown:hover .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s ease;
  border-left: 3px solid transparent;
}

.nav-menu-item:first-child {
  border-radius: 10px 10px 0 0;
}

.nav-menu-item:last-child {
  border-radius: 0 0 10px 10px;
}

.nav-menu-item:hover {
  background: rgba(99, 102, 241, 0.05);
}

.nav-menu-item.google:hover {
  background: rgba(66, 133, 244, 0.05);
  border-left-color: #4285f4;
}

.nav-menu-item.ieee:hover {
  background: rgba(0, 121, 193, 0.05);
  border-left-color: #0079c1;
}

.nav-menu-item.semantic:hover {
  background: rgba(245, 158, 11, 0.05);
  border-left-color: #f59e0b;
}

.nav-menu-item.arxiv:hover {
  background: rgba(185, 28, 28, 0.05);
  border-left-color: #b91c1c;
}

.nav-menu-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-menu-item img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  object-fit: contain;
}

.feature-pill.clickable {
  cursor: pointer;
}

.feature-pill.clickable:active {
  transform: translateY(-1px);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px 0;
}

.header p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 700px;
  margin: 0 auto;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.feature-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.feature-pill:hover {
  border-color: var(--primary);
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(139, 92, 246, 0.15)
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.feature-pill-icon {
  font-size: 16px;
}

.feature-pill-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.feature-pill-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
}

.feature-pill:hover .feature-pill-tooltip {
  opacity: 1;
}

.warning-pill {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1),
    rgba(220, 38, 38, 0.1)
  );
  border-color: rgba(239, 68, 68, 0.3);
}

.warning-pill:hover {
  border-color: var(--danger);
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.15),
    rgba(220, 38, 38, 0.15)
  );
}

.info-pill {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1),
    rgba(5, 150, 105, 0.1)
  );
  border-color: rgba(16, 185, 129, 0.3);
}

.info-pill:hover {
  border-color: var(--success);
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15),
    rgba(5, 150, 105, 0.15)
  );
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  overflow: visible;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-section {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: stretch;
  overflow: visible;
}

.input-section > div {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.input-section > div:first-child {
  /* 左侧：textarea 区域 */
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.input-section > div:last-child {
  /* 右侧：配置区域 */
  justify-content: space-between;
}

.right-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.right-bottom {
  margin-top: 16px;
}

/* 并发数控制样式 */
.concurrency-section {
  margin-top: 12px;
}

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

.concurrency-control input[type="number"] {
  width: 70px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  background: var(--bg);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.concurrency-control input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.concurrency-control input[type="number"]::-webkit-inner-spin-button,
.concurrency-control input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

@media (max-width: 768px) {
  .input-section {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  overflow: visible;
}

.label-row label {
  margin-bottom: 0;
}

.btn-format-text {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #059669;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-format-text:hover {
  background: rgba(5, 150, 105, 0.15);
  border-color: rgba(5, 150, 105, 0.5);
}

.btn-format-text:active {
  transform: scale(0.98);
}

.format-btns {
  display: flex;
  gap: 8px;
  overflow: visible;
}

.format-btn-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-ai-format-text {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ai-format-text:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}

.btn-ai-format-text:active {
  transform: scale(0.98);
}

.btn-ai-format-text:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.format-btn-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #1e293b;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s ease,
    visibility 0.15s ease;
  z-index: 100;
  pointer-events: none;
  width: 320px;
  line-height: 1.4;
}

.format-btn-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 12px;
  border: 5px solid transparent;
  border-bottom-color: #1e293b;
}

.format-btn-wrapper:hover .format-btn-tooltip {
  opacity: 1;
  visibility: visible;
}

textarea,
input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--card-bg);
  font-family: inherit;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
  resize: vertical;
  min-height: 180px;
  flex: 1;
}

.citation-count {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
  min-height: 0;
}

.citation-count:empty {
  display: none;
}

.citation-count-num {
  font-weight: 600;
  color: var(--primary);
}

.citation-count-num.ok {
  color: var(--success);
}

.citation-count-hint {
  color: var(--warning);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: white;
  box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(79, 70, 229, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-extract {
  background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.35);
}

.btn-extract:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(6, 182, 212, 0.45);
}

.btn-extract:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.45);
}

.btn-success:active {
  transform: translateY(0);
}

.btn-copy {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(249, 115, 22, 0.35);
}

.btn-copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(249, 115, 22, 0.45);
}

.btn-copy:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.35);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.45);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-clear {
  background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(100, 116, 139, 0.35);
}

.btn-clear:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(100, 116, 139, 0.45);
}

.btn-clear:active {
  transform: translateY(0);
}

.btn-info {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.35);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(14, 165, 233, 0.45);
}

.btn-info:active {
  transform: translateY(0);
}

.btn-github {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(55, 65, 81, 0.35);
}

.btn-github:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(55, 65, 81, 0.45);
}

.btn-github:active {
  transform: translateY(0);
}

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

/* 按钮 tooltip 样式 */
.btn-tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

.btn-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  transform: none;
  background: white;
  color: #1e293b;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s ease,
    visibility 0.15s ease;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  max-width: 800px;
}

.btn-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 20px;
  transform: none;
  border: 5px solid transparent;
  border-top-color: white;
}

.btn-tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 20px;
  transform: none;
  border: 6px solid transparent;
  border-top-color: #e2e8f0;
  margin-top: 1px;
  z-index: -1;
}

.btn-tooltip-wrapper:hover .btn-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Progress Bar */
.progress-container {
  display: none;
  margin-bottom: 20px;
}

.progress-container.active {
  display: block;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Summary Stats */
.summary {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.summary.active {
  display: grid;
}

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

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card.total .stat-value {
  color: var(--primary);
}
.stat-card.high .stat-value {
  color: var(--success);
}
.stat-card.medium .stat-value {
  color: var(--warning);
}
.stat-card.low .stat-value {
  color: var(--danger);
}

/* Result Items */
.result-item {
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  position: relative;
}

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

.result-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  border-radius: 12px;
  background: var(--card-bg);
}

.result-item.expanded .result-header {
  border-radius: 12px 12px 0 0;
}

.result-header:hover {
  background: var(--bg);
}

.result-index {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.result-title {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-score {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-score::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-score.high {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.result-score.high::before {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.result-score.medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.result-score.medium::before {
  background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.result-score.low {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.result-score.low::before {
  background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.result-toggle {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.result-item.expanded .result-toggle {
  transform: rotate(180deg);
}

.result-details {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  background: var(--card-bg);
}

.result-item.expanded .result-details {
  display: block;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.detail-label {
  color: var(--text-muted);
}

.detail-value {
  color: var(--text);
  word-break: break-word;
}

.detail-value a {
  color: var(--primary);
  text-decoration: none;
}

.detail-value a:hover {
  text-decoration: underline;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.source-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-badge.openalex {
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.12) 0%,
    rgba(129, 140, 248, 0.12) 100%
  );
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.source-badge.openalex::before {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  box-shadow: 0 0 6px rgba(79, 70, 229, 0.4);
}

.source-badge.crossref {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.12) 0%,
    rgba(251, 191, 36, 0.12) 100%
  );
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.source-badge.crossref::before {
  background: linear-gradient(135deg, var(--warning) 0%, #fbbf24 100%);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.score-tooltip-wrapper:hover .source-badge {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 格式胶囊样式 */
.format-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 8px;
}

/* Tooltip 样式 */
.score-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: help;
  padding: 4px 0;
}

.score-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  transform: translateX(0);
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 1000;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.1);
  min-width: 240px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.score-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 24px;
  transform: translateX(0);
  border: 8px solid transparent;
  border-top-color: #334155;
}

.score-tooltip-wrapper:hover .score-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-4px);
}

.score-tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 8px;
}

.score-tooltip-row.score-tooltip-header {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.score-tooltip-row.score-tooltip-header .score-tooltip-value {
  background: transparent;
  font-size: 10px;
}

.score-tooltip-row.score-tooltip-total {
  border-bottom: none;
  padding-top: 10px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.score-tooltip-row:last-child {
  border-bottom: none;
}

.score-tooltip-label {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.score-tooltip-value {
  font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.score-tooltip-value.good {
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
}

.score-tooltip-value.medium {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.score-tooltip-value.bad {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.score-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.score-inline {
  font-size: 12px;
  color: #0891b2;
  font-weight: 500;
  background: rgba(8, 145, 178, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(8, 145, 178, 0.3);
}

.score-inline.ai {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

/* 折叠头部的 tooltip 特殊定位 */
.result-score-wrapper {
  padding: 0;
}

.result-score-wrapper .score-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.result-score-wrapper .score-tooltip::after {
  left: auto;
  right: 24px;
}

.result-score-wrapper:hover .result-score {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

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

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

.processing-item {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.processing-item-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width 0.3s ease;
  opacity: 0.6;
}

.processing-item-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.processing-item-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: pulse 1.5s ease-in-out infinite;
}

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

.processing-item-text {
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}

/* Verdict bar */
.verdict-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.verdict-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.verdict-segment.active.high {
  background: var(--success);
}
.verdict-segment.active.medium {
  background: var(--warning);
}
.verdict-segment.active.low {
  background: var(--danger);
}

/* Detail actions */
.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 9px 18px;
  font-size: 13px;
  gap: 6px;
  border-radius: 10px;
}

.export-section {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.export-section.active {
  display: flex;
}

.export-selector {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  border: 2px solid var(--success);
  box-shadow: 0 4px 12px 0 rgba(16, 185, 129, 0.15);
}

.export-option {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text-muted);
  user-select: none;
  position: relative;
}

.export-option:hover {
  color: var(--text);
  background: rgba(16, 185, 129, 0.1);
}

.export-option.active {
  background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  color: white;
  box-shadow: 0 2px 8px 0 rgba(16, 185, 129, 0.3);
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3000;
  box-shadow: 0 8px 24px 0 rgba(79, 70, 229, 0.4);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 图标按钮 */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.icon-btn:active {
  transform: translateY(0);
}

.helper-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* 弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

/* 抽屉样式 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 2001;
  display: flex;
  flex-direction: column;
}

.drawer-overlay.show .drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  color: white;
}

.drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

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

.score-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.score-table th,
.score-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.score-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
}

.score-table tr:last-child td {
  border-bottom: none;
}

.score-table .weight {
  color: var(--primary);
  font-weight: 600;
}

.score-table .enable-col {
  text-align: center;
  width: 60px;
}

.score-table .enable-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.score-table .enable-col input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.score-table tr.field-disabled td {
  opacity: 0.4;
  text-decoration: line-through;
}

.score-table tr.field-disabled td.enable-col {
  opacity: 1;
  text-decoration: none;
}

.verdict-table {
  margin-top: 20px;
}

.verdict-table .high {
  color: var(--success);
}
.verdict-table .medium {
  color: var(--warning);
}
.verdict-table .low {
  color: var(--danger);
}

.formula-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}

.formula-box code {
  color: var(--primary);
  font-weight: 600;
}

/* 双列布局 */
.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .sources-grid {
    grid-template-columns: 1fr;
  }
}

.source-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--border);
}

.source-card h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.source-card .detail-grid {
  font-size: 12px;
}

.source-card .detail-label {
  font-size: 11px;
}

.link-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
}

.link-badge:hover {
  background: rgba(79, 70, 229, 0.15);
  transform: translateY(-1px);
  text-decoration: none;
}

.link-badge svg {
  width: 12px;
  height: 12px;
}

/* 格式示例样式 */
.format-example {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.format-example:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.format-example h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: var(--text);
}

.example-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.example-box:last-child {
  margin-bottom: 0;
}

.example-box code {
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* AI 配置相关样式 */
.ai-config-section {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.05) 0%,
    rgba(167, 139, 250, 0.05) 100%
  );
}

.ai-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-config-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-config-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 5px;
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-config-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
}

.ai-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

.ai-option input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ai-option label {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.ai-option input[type="checkbox"]:disabled + label {
  cursor: not-allowed;
  opacity: 0.6;
}

.ai-option-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.ai-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.ai-score-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  color: white;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

/* 配置区域底部的状态框（与齿轮按钮对齐） */
.ai-config-footer .ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  margin: 0;
}

.ai-config-footer .ai-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.ai-config-footer .ai-status.configured .ai-status-dot {
  background: #22c55e;
}

.ai-config-footer .ai-status.not-configured .ai-status-dot {
  background: #f59e0b;
}

.ai-config-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-config-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-config-form label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.ai-config-form input,
.ai-config-form select {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--card-bg);
}

.ai-config-form input:focus,
.ai-config-form select:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ai-config-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ai-config-form .form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.ai-config-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ai-status.configured {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.ai-status.not-configured {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ai-status.configured .ai-status-dot {
  background: var(--success);
}

.ai-status.not-configured .ai-status-dot {
  background: var(--warning);
}
