:root {
  --primary-color: #0052D9;
  --bg-color: #F2F3F5;
  --surface-color: #FFFFFF;
  --text-primary: #1D2129;
  --text-secondary: #4E5969;
  --border-color: #E5E6EB;
  
  /* Additional colors for components */
  --success-color: #00B42A;
  --warning-color: #FF7D00;
  --danger-color: #F53F3F;
  
  /* Fonts */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5715;
}
.layout {
  display: flex;
  height: 100vh;
}
/* Sidebar styles moved to theme system at bottom */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* 允许子元素滚动 */
  overflow: hidden;
}
.content-header {
  height: 48px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0; /* 防止被压缩 */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
/* Breadcrumb Navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 14px;
}

.breadcrumb-item {
  color: #6b7280;
}

.breadcrumb-clickable {
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb-clickable:hover {
  color: #3b82f6;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #d1d5db;
}

.breadcrumb-current {
  color: #1f2937;
  font-weight: 600;
}
.settings-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.settings-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
/* LLM Provider Tabs */
.llm-provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
  margin-bottom: 16px;
}
.llm-provider-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.llm-provider-tab:hover {
  color: #374151;
  background: #e5e7eb;
}
.llm-provider-tab.active {
  color: #1f2937;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.llm-provider-tab.configured {
  position: relative;
}
.llm-provider-tab.configured::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}
.llm-provider-content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.llm-provider-panel {
  min-height: 200px;
}
.llm-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 40px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.llm-model-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
}
.llm-model-item:hover {
  border-color: #3b82f6;
}
.llm-model-item.selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}
.llm-model-item.custom {
  background: #fef3c7;
  border-color: #f59e0b;
}
.llm-model-item .remove-btn {
  display: none;
  width: 14px;
  height: 14px;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  color: #9ca3af;
  cursor: pointer;
}
.llm-model-item.custom .remove-btn {
  display: inline-block;
}
.llm-model-item.custom .remove-btn:hover {
  color: #ef4444;
}
.llm-custom-model-add {
  display: flex;
  gap: 8px;
  align-items: center;
}
.llm-custom-model-add input {
  flex: 1;
  max-width: 300px;
}
.llm-no-models {
  color: #9ca3af;
  font-size: 13px;
  font-style: italic;
}

/* Legacy provider card styles - keeping for compatibility */
.llm-provider-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  margin-bottom: 10px;
}
.llm-provider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.llm-provider-body {
  display: none;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.llm-provider-card.open .llm-provider-body {
  display: block;
}
.llm-provider-toggle {
  font-size: 12px;
  color: #6b7280;
}
.alias-map-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.alias-map-row select {
  flex: 1;
  min-width: 180px;
  border-radius: 6px;
}
.alias-map-row .btn {
  border-radius: 6px;
}
.alias-map-row .alias-arrow {
  color: #9ca3af;
  font-size: 14px;
}
.status-pill {
  font-size: 12px;
  color: #6b7280;
}
.content-main {
  flex: 1 1 0;  /* flex-grow, flex-shrink, flex-basis: 0 */
  height: 0;    /* 强制使用 flex 计算的高度 */
  overflow: auto;
  padding: 16px;
  min-height: 0;
  position: relative; /* 为 judge-page 的绝对定位提供参照 */
}

/* ============================================
   Settings Page - Modern Enterprise Dashboard
   ============================================ */
.settings-page {
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.settings-page-header {
  margin-bottom: 24px;
}
.settings-page-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px;
}
.settings-page-desc {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.settings-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.settings-card-full {
  grid-column: 1 / -1;
  margin-bottom: 20px;
}
.settings-card-full:last-child {
  margin-bottom: 0;
}
.settings-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.settings-card-hint {
  font-size: 12px;
  color: #9ca3af;
}
.settings-card-body {
  padding: 20px;
}
.settings-card-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #f3f4f6;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .form-grid-2, .form-grid-4 {
    grid-template-columns: 1fr;
  }
}
.settings-page .form-group {
  margin: 0;
}
.settings-page .form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}
.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}
.settings-page input[type="text"],
.settings-page textarea,
.settings-page select {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.settings-page select {
  height: 36px;
  padding-right: 28px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.settings-page input[type="text"]:focus,
.settings-page textarea:focus,
.settings-page select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.mono-textarea {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px !important;
  line-height: 1.5;
  resize: vertical;
}
.status-indicator {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}
.status-indicator.status-ok {
  color: #059669;
}
.status-indicator.status-error {
  color: #dc2626;
}
.status-indicator.status-loading {
  color: #d97706;
}
.settings-subsection {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed #e5e7eb;
}
.settings-subsection-header {
  margin-bottom: 12px;
}
.settings-subsection-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 4px;
}
.settings-subsection-hint {
  font-size: 12px;
  color: #9ca3af;
  display: block;
}
.btn-outline {
  background: transparent;
  border: 1px dashed #d1d5db;
  color: #6b7280;
  border-radius: 8px;
}
.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
h3 {
  margin: 16px 0 8px;
  font-size: 15px;
}
.card {
  background: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
/* Basic Components Redesign */
.btn {
  padding: 5px 16px;
  border-radius: 100px; /* Pill shape */
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-weight: 400;
}

.btn:hover {
  background-color: var(--bg-color);
  border-color: #C9CDD4;
}

.btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background-color: #0046B8; /* Darker shade of primary */
  border-color: #0046B8;
  color: #fff;
}

.btn-danger {
  background: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}

.btn-danger:hover {
  background-color: #D93030;
  border-color: #D93030;
}

.btn-secondary {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-color);
}

.btn-success {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}

.btn-success:hover {
  background: #009A22;
  border-color: #009A22;
}

.btn-sm {
  padding: 2px 12px;
  font-size: 12px;
  height: 24px;
}

.btn + .btn {
  margin-left: 8px;
}

.btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
}
th {
  background: var(--bg-color);
  font-weight: 500;
  color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  font-size: 14px;
  transition: border-color 0.2s;
  background-color: var(--surface-color);
  color: var(--text-primary);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

input, select {
  height: 32px;
  line-height: 1.4;
  padding-top: 0;
  padding-bottom: 0;
}

select {
  padding: 6px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea {
  height: auto;
  padding: 8px 12px;
  resize: vertical;
  min-height: 60px;
}

label {
  display: block;
  font-size: 14px;
  margin: 8px 0 4px;
  color: var(--text-primary);
}

.kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kpi-card {
  flex: 1;
  min-width: 150px;
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.kpi-label { font-size: 12px; color: #6b7280; }
.kpi-value { font-size: 18px; font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
  border: 1px solid transparent;
}

.badge-green { background: #E8FFEA; color: #00B42A; border-color: #00B42A; }
.badge-yellow { background: #FFF7E8; color: #FF7D00; border-color: #FF7D00; }
.badge-red { background: #FFECE8; color: #F53F3F; border-color: #F53F3F; }
.badge-blue { background: #E8F3FF; color: #0052D9; border-color: #0052D9; }
.badge-gray { background: #F2F3F5; color: #4E5969; border-color: #E5E6EB; }

.flex-row { display: flex; gap: 12px; }
.flex-1 { flex: 1; }

.progress-bar-bg {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  background: #22c55e;
  height: 100%;
  width: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.modal-backdrop#rubricPreviewModalBackdrop {
  z-index: 1200;
}
.modal-backdrop#judgeResultModalBackdrop {
  z-index: 1200;
}
.modal {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  width: 600px;
  max-height: 80vh;
  overflow: auto;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  z-index: 200;
}
.drawer {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 520px;
  max-width: 90vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}
.drawer-header,
.drawer-footer {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-footer {
  border-bottom: none;
  border-top: 1px solid #e5e7eb;
  gap: 8px;
}
.drawer-title {
  font-weight: 600;
}
.drawer-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}
.drawer-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
}
.progress-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #111827;
  background: #e5e7eb;
}
.progress-status.running { background: #dbeafe; color: #1d4ed8; }
.progress-status.done { background: #bbf7d0; color: #15803d; }
.progress-status.failed { background: #fecaca; color: #991b1b; }
.progress-status.queued { background: #fef3c7; color: #92400e; }
.progress-status.stalled { background: #e5e7eb; color: #374151; }
.progress-status.cancelled { background: #e2e8f0; color: #475569; }
.response-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.response-panel {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px;
  min-height: 140px;
}
.response-title {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}
.response-content {
  font-size: 13px;
  white-space: pre-wrap;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.tab-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.tab-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.tab-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.tab-panel {
  margin-top: 8px;
}
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-lg { height: 10px; }
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  transition: width 0.2s ease;
}
.progress-count {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}
.batch-fetch-estimate {
  background: #f1f5f9;
  border: 1px dashed #cbd5f5;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #334155;
  margin-top: 8px;
}
.batch-model-list {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
}
.batch-model-group {
  margin-bottom: 8px;
}
.batch-model-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
}
.batch-model-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-title { font-weight: 600; }
.close {
  cursor: pointer;
  font-size: 18px;
}

.judge-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 12px;
}
.rubric-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 0;
}
.rubric-title { font-size: 13px; font-weight: 500; }
.rubric-meta { font-size: 11px; color: #6b7280; }
.rubric-actions { margin-top: 4px; font-size: 12px; }

.model-card {
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
}
.model-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}
.model-card-body {
  font-size: 13px;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
}

.tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 11px;
  margin-right: 4px;
}

/* Rubric 管理样式 */
.rubric-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.rubric-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.rubric-section-title {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}
.rubric-list {
  max-height: 300px;
  overflow-y: auto;
}
.rubric-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 3px solid #2563eb;
}
.rubric-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.rubric-item-id {
  font-weight: 600;
  color: #2563eb;
  font-size: 13px;
}
.rubric-item-criterion {
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
  line-height: 1.5;
}
.rubric-item-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rubric-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #e5e7eb;
  color: #374151;
}
.rubric-tag-type {
  background: #dbeafe;
  color: #1d4ed8;
}
.rubric-tag-priority {
  background: #fef3c7;
  color: #92400e;
}
.rubric-empty {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 13px;
}
.rubric-form {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.rubric-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.rubric-form label {
  font-size: 12px;
  color: #374151;
  margin-bottom: 4px;
}
.rubric-json-import {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.toast-msg {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s;
}
.toast-msg.show {
  opacity: 1;
}

/* 模型回复管理样式 */
.response-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}
.response-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.response-table th, .response-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
}
.response-table th {
  background: #f3f4f6;
  font-weight: 500;
}
.response-empty {
  text-align: center;
  padding: 20px;
  color: #9ca3af;
  font-size: 13px;
}
.response-form {
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.response-json-import {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.judge-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.judge-badge-done {
  background: #bbf7d0;
  color: #166534;
}
.judge-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

/* 回复详情模态框样式 */
.response-detail-modal {
  width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}
.response-content-box {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}
.judge-result-section {
  margin-top: 16px;
}
.judge-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.judge-result-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 3px solid #9ca3af;
}
.judge-result-item.judge-yes {
  border-left-color: #22c55e;
}
.judge-result-item.judge-no {
  border-left-color: #ef4444;
}
.judge-result-item.judge-partial {
  border-left-color: #f59e0b;
}
.judge-result-item.judge-na {
  border-left-color: #6b7280;
}
.judge-result-criterion {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.judge-result-judgment {
  font-size: 13px;
  margin-bottom: 4px;
}
.judge-result-analysis {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}
.judge-history-item {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
}
.judge-history-item:hover {
  background: #e5e7eb;
}
.judge-loading {
  text-align: center;
  padding: 20px;
  color: #6b7280;
}

/* GSB 按钮样式 */
.gsb-btn {
  transition: all 0.2s;
}
.gsb-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.gsb-btn[data-score="2"].active { background: #16a34a; border-color: #16a34a; }
.gsb-btn[data-score="1"].active { background: #65a30d; border-color: #65a30d; }
.gsb-btn[data-score="0"].active { background: #6b7280; border-color: #6b7280; }
.gsb-btn[data-score="-1"].active { background: #ea580c; border-color: #ea580c; }
.gsb-btn[data-score="-2"].active { background: #dc2626; border-color: #dc2626; }

/* 标注 Rubric 项样式 */
.annotation-rubric-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 3px solid #e5e7eb;
}
.annotation-rubric-item.judge-yes { border-left-color: #22c55e; }
.annotation-rubric-item.judge-no { border-left-color: #ef4444; }
.annotation-rubric-item.judge-partial { border-left-color: #f59e0b; }
.annotation-rubric-criterion {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}
.annotation-rubric-llm {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #e5e7eb;
  border-radius: 4px;
}
.annotation-rubric-human {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rubric-human-label {
  font-size: 12px;
  color: #374151;
  flex-shrink: 0;
}

/* Selectable Tiles for Yes/No/Partial - Pill Style */
.rubric-toggle-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.rubric-toggle-tile {
  flex: 1;
  padding: 4px 12px;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  background: var(--surface-color);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
  text-align: center;
}

.rubric-toggle-tile:hover {
  background: var(--bg-color);
}

/* Yes Tile - Selected */
.rubric-toggle-tile.rubric-toggle-yes.selected {
  background: #E8FFEA;
  border-color: #00B42A;
  color: #00B42A;
  font-weight: 600;
}

/* No Tile - Selected */
.rubric-toggle-tile.rubric-toggle-no.selected {
  background: #FFECE8;
  border-color: #F53F3F;
  color: #F53F3F;
  font-weight: 600;
}

/* Partial Tile - Selected */
.rubric-toggle-tile.rubric-toggle-partial.selected {
  background: #FFF7E8;
  border-color: #FF7D00;
  color: #FF7D00;
  font-weight: 600;
}
.annotation-rubric-comment {
  margin-top: 8px;
}
.annotation-rubric-comment input {
  font-size: 12px;
  padding: 4px 8px;
}

/* 任务状态徽章 */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
}
.status-draft { background: #e5e7eb; color: #374151; }
.status-judging { background: #dbeafe; color: #1d4ed8; }
.status-annotating { background: #fef3c7; color: #92400e; }
.status-completed { background: #bbf7d0; color: #166534; }

.llm-provider-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.llm-provider-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.llm-provider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(to right, #f8fafc, #fff);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: background 0.15s;
}
.llm-provider-card.expanded .llm-provider-header {
  border-bottom-color: #e5e7eb;
  background: #f8fafc;
}
.llm-provider-title {
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}
.llm-provider-title::before {
  content: '🏢';
  font-size: 14px;
}
.llm-provider-toggle {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
}
.llm-provider-toggle::after {
  content: '▼';
  font-size: 10px;
  transition: transform 0.2s;
}
.llm-provider-card.expanded .llm-provider-toggle::after {
  transform: rotate(180deg);
}
.llm-provider-body {
  display: none;
  padding: 16px;
  background: #fafbfc;
}
.llm-provider-card.expanded .llm-provider-body {
  display: block;
}
.llm-provider-body .form-grid-2 {
  margin-bottom: 12px;
}
.llm-provider-body label {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}
/* Additional settings page styles */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .form-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}
.settings-card-hint-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f0f9ff;
  border-radius: 8px;
  font-size: 12px;
  color: #0369a1;
  border-left: 3px solid #0ea5e9;
}

/* ============================================
   Sidebar Theme System
   ============================================ */
:root {
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #475569;
  --sidebar-header-text: #1E293B;
  --sidebar-header-border: #E2E8F0;
  --sidebar-item-hover: #F1F5F9;
  --sidebar-item-active-bg: #EFF6FF;
  --sidebar-item-active-text: #2563EB;
  --sidebar-section-title: #94A3B8;
  --sidebar-border-right: #E2E8F0;
  --sidebar-footer-border: #F1F5F9;
}

[data-sidebar-theme="dark"] {
  --sidebar-bg: #0F172A;
  --sidebar-text: #CBD5E1;
  --sidebar-header-text: #F8FAFC;
  --sidebar-header-border: #1E293B;
  --sidebar-item-hover: #1E293B;
  --sidebar-item-active-bg: rgba(255, 255, 255, 0.1);
  --sidebar-item-active-text: #FFFFFF;
  --sidebar-section-title: #64748B;
  --sidebar-border-right: transparent;
  --sidebar-footer-border: #1E293B;
}

.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border-right);
  transition: all 0.3s ease;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.sidebar.hidden {
  width: 0;
  min-width: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--sidebar-header-text);
  border-bottom: 1px solid var(--sidebar-header-border);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-header span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.hidden .sidebar-header,
.sidebar.hidden .nav-section-title,
.sidebar.hidden .nav-item,
.sidebar.hidden .sidebar-footer {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
  opacity: 0.7;
}

.sidebar-toggle-btn:hover {
  opacity: 1;
  background: var(--sidebar-item-hover);
}

.sidebar.hidden .sidebar-toggle-btn {
  display: none;
}

.sidebar-show-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 11px;
  min-width: 24px;
  height: 24px;
  flex-shrink: 0;
  order: -1; /* 确保在最左边 */
}

.sidebar-show-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.nav-section-title {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sidebar-section-title);
  transition: all 0.3s ease;
}

.nav-item {
  padding: 10px 16px;
  margin: 2px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-text);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.nav-item:hover {
  background: var(--sidebar-item-hover);
}

.nav-item.active {
  background: var(--sidebar-item-active-bg);
  color: var(--sidebar-item-active-text);
}

/* Sidebar Footer & Theme Toggle */
.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--sidebar-footer-border);
  transition: all 0.3s ease;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.theme-toggle:hover {
  background: var(--sidebar-item-hover);
}

.theme-toggle-track {
  width: 40px;
  height: 20px;
  background: #E2E8F0;
  border-radius: 20px;
  position: relative;
  transition: background 0.3s;
}

[data-sidebar-theme="dark"] .theme-toggle-track {
  background: #334155;
}

.theme-toggle-thumb {
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

[data-sidebar-theme="dark"] .theme-toggle-thumb {
  transform: translateX(20px);
}

.theme-icon {
  font-size: 10px;
  position: absolute;
  transition: opacity 0.2s;
}

.theme-icon.moon { opacity: 0; }
[data-sidebar-theme="dark"] .theme-icon.sun { opacity: 0; }
[data-sidebar-theme="dark"] .theme-icon.moon { opacity: 1; }

.theme-label {
  font-size: 13px;
  font-weight: 500;
}

/* Sidebar Header Tools */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}
#questionHeaderTools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

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

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-color);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.btn-help {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  background: #ffe4ec;
  color: #d63384;
}
.btn-help:hover {
  background: #ffccd9;
}
.btn-help-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.question-collector-frame {
  width: 100%;
  height: calc(100vh - 110px);
  border: none;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
#view-questions {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* ============================================
   Progress Management - High-End Dashboard
   ============================================ */
.progress-page {
  padding: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.page-header-desc {
  font-size: 14px;
  color: #64748b;
  margin: 4px 0 0;
}

.dashboard-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.dashboard-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-card .card-title {
  font-weight: 600;
  color: #1e293b;
}

.dashboard-card .card-hint {
  font-size: 12px;
  color: #94a3b8;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th {
  background: #f8fafc;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.dashboard-table td {
  padding: 16px 20px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

.dashboard-table tr:hover td {
  background-color: #f8fafc;
}

/* ID Column - Monospace */
.col-id {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: #94a3b8;
}

/* Task Name - Bold */
.col-task-name {
  font-weight: 600;
  color: #0f172a;
}

/* Modern Progress Bar */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress-percentage {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.progress-raw {
  font-size: 11px;
  color: #94a3b8;
}

.progress-track {
  height: 10px;
  background-color: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 999px;
  width: 0;
  transition: width 1s ease-out;
}

/* Soft Status Badges */
.status-pill-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill-modern::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill-modern.running {
  background-color: #eff6ff;
  color: #1d4ed8;
}
.status-pill-modern.running::before { background-color: #3b82f6; }

.status-pill-modern.done {
  background-color: #ecfdf5;
  color: #047857;
}
.status-pill-modern.done::before { background-color: #10b981; }

.status-pill-modern.failed {
  background-color: #fef2f2;
  color: #991b1b;
}
.status-pill-modern.failed::before { background-color: #ef4444; }

.status-pill-modern.queued {
  background-color: #fffbeb;
  color: #92400e;
}
.status-pill-modern.queued::before { background-color: #f59e0b; }

.status-pill-modern.stalled {
  background-color: #f8fafc;
  color: #475569;
}
.status-pill-modern.stalled::before { background-color: #94a3b8; }

.status-pill-modern.cancelled {
  background-color: #f1f5f9;
  color: #475569;
}
.status-pill-modern.cancelled::before { background-color: #64748b; }

/* ============================================
   Task Annotation - IDE Split View
   ============================================ */
.judge-page {
  /* 不要用 !important 覆盖 display，否则无法隐藏 */
  flex-direction: column;
  /* 使用固定定位 + 视口高度，确保填满屏幕 */
  position: fixed;
  top: 48px;
  left: 220px;
  right: 0;
  bottom: 0;
  width: calc(100vw - 220px);
  height: calc(100vh - 48px);
  background: #f1f5f9;
  padding: 0 !important;
  margin: 0;
  overflow: hidden;
  z-index: 100;
  transition: left 0.3s ease, width 0.3s ease;
}

/* 当 judge-page 显示时（JS 设置 display: block），改为 flex */
.judge-page[style*="display: block"],
.judge-page[style*="display:block"] {
  display: flex !important;
}

/* Sidebar 隐藏时，judge-page 扩展到全宽 */
.sidebar.hidden ~ .content .judge-page,
body:has(.sidebar.hidden) .judge-page {
  left: 0;
  width: 100vw;
}

/* 适配小屏幕/侧边栏折叠 */
@media (max-width: 768px) {
  .judge-page {
    left: 0;
    width: 100vw;
  }
}

/* Slim Header */
.judge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  position: relative;
}

.judge-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.judge-header-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.judge-header-title > span:first-child {
  font-weight: 600;
  font-size: 15px;
  color: #1e293b;
}

.judge-header-sub {
  font-size: 12px;
  color: #64748b;
}

.judge-header-center {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.font-size-label {
  font-size: 12px;
  color: #64748b;
  margin-right: 4px;
}

.judge-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.judge-header-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.progress-mini-bar {
  width: 80px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: 3px;
  transition: width 0.3s;
}

/* Jump to Question Control */
.judge-jump-control {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  padding-right: 12px;
  border-right: 1px solid #e2e8f0;
}

.judge-jump-control input[type="number"] {
  width: 50px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
}

.judge-jump-control input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.judge-jump-control input[type="number"]::-webkit-inner-spin-button,
.judge-jump-control input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#jumpTotalQuestions {
  font-size: 12px;
  color: #6b7280;
  min-width: 30px;
}

/* Font Size Control */
#currentFontSize {
  font-size: 12px;
  color: #475569;
  min-width: 20px;
  text-align: center;
}

.btn-icon {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: #64748b;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Main Workspace */
.judge-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0; /* 允许内部面板滚动 */
}

/* Panes */
.judge-pane {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 0; /* 允许内部滚动 */
}

/* Left Pane: Reference Context - Light Gray/Blue background */
.judge-pane-prompt {
  width: 28%;
  min-width: 250px;
  min-height: 0;
  background: #f8fafc;
}

.judge-pane-prompt .pane-header {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

/* Middle Pane: Active Workspace - Elevated white with shadow */
.judge-pane-response {
  flex: 1;
  min-width: 300px;
  min-height: 0;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 10;
  position: relative;
}

/* Right Pane: Grading Panel */
.judge-pane-grading {
  width: 320px;
  min-width: 260px;
  background: #f8fafc;
  min-height: 0;
}

.judge-pane-grading .pane-header {
  background: #f1f5f9;
  border-bottom-color: #e2e8f0;
}

/* Pane Resizers (draggable dividers) - Enhanced visibility */
.pane-resizer {
  width: 8px;
  background: linear-gradient(90deg, #cbd5e1 0%, #e2e8f0 50%, #cbd5e1 100%);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
  border-left: 1px solid #94a3b8;
  border-right: 1px solid #94a3b8;
}

.pane-resizer:hover,
.pane-resizer.dragging {
  background: linear-gradient(90deg, #93c5fd 0%, #3b82f6 50%, #93c5fd 100%);
  border-color: #3b82f6;
}

/* Drag handle indicator */
.pane-resizer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  background: repeating-linear-gradient(
    0deg,
    #64748b 0px,
    #64748b 2px,
    transparent 2px,
    transparent 6px
  );
  border-radius: 2px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.pane-resizer:hover::before,
.pane-resizer.dragging::before {
  opacity: 1;
  background: repeating-linear-gradient(
    0deg,
    #fff 0px,
    #fff 2px,
    transparent 2px,
    transparent 6px
  );
}

/* Prevent text selection while dragging */
.judge-workspace.resizing {
  user-select: none;
  cursor: col-resize;
}

.judge-workspace.resizing .judge-pane {
  pointer-events: none;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
}

.pane-title {
  font-weight: 600;
  font-size: 13px;
  color: #1e293b;
}

.pane-meta {
  font-size: 11px;
  color: #94a3b8;
}

.pane-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-copy {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  color: #64748b;
  transition: all 0.15s;
}

.btn-copy:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-copy.copied {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.pane-content {
  flex: 1 1 0;  /* flex-grow, flex-shrink, flex-basis: 0 */
  overflow-y: auto;
  padding: 0;
  min-height: 0;
  height: 0; /* 强制使用 flex 计算的高度 */
}

.pane-inner {
  max-width: none;
  margin: 0;
  padding: 16px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 13px;
  line-height: 1.6;
}

/* Markdown 渲染内容约束 */
.pane-inner pre {
  overflow-x: auto;
  max-width: 100%;
}

.pane-inner img {
  max-width: 100%;
  height: auto;
}

/* 表格需要保持 display: table 以正确对齐列，用包裹容器处理溢出 */
.pane-inner table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  margin: 0.5em 0;
}

/* 确保表格在窄容器中可以横向滚动 */
.pane-inner .table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.pane-inner table th,
.pane-inner table td {
  border: 1px solid #e5e7eb;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.pane-inner table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
}

.pane-inner table tr:nth-child(even) {
  background: #fafafa;
}

.judge-pane-grading .pane-inner {
  max-width: none;
  padding: 16px;
}

/* Response Tabs - Pill Style */
.response-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-color);
  padding: 4px;
  border-radius: 100px;
}

.response-tab {
  padding: 4px 16px;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.3, 0, 0.5, 1);
}

.response-tab:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.05);
}

.response-tab.active {
  background: var(--surface-color);
  color: var(--primary-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

.response-tab.graded::after {
  content: '✓';
  margin-left: 6px;
  font-size: 11px;
  color: var(--success-color);
}

/* Response Select (模型数量 > 4 时的下拉框样式) */
.response-select-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-color);
  padding: 4px 12px;
  border-radius: 8px;
}

.response-select {
  padding: 6px 32px 6px 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: var(--surface-color);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.response-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.response-select.graded {
  border-color: var(--success-color);
  background-color: #f0fdf4;
}

.response-select optgroup {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 0;
}

.response-select option {
  font-weight: 400;
  color: var(--text-primary);
  padding: 4px 8px;
}

.response-progress-mini {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Vertical Step Indicator */
.response-step-indicator {
  position: absolute;
  right: 328px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 10;
}

.step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.step-dot:hover {
  transform: scale(1.2);
}

.step-dot.current {
  background: #fff;
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.step-dot.graded {
  background: #22c55e;
}

.step-dot[title]::after {
  content: attr(title);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.step-dot:hover::after {
  opacity: 1;
}

/* Baseline Compare */
.baseline-compare-area {
  margin-bottom: 16px;
  padding-bottom: 16px;
}

.baseline-label {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.baseline-text {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  max-height: 200px;
  overflow-y: auto;
}

.response-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.response-divider::before,
.response-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.response-divider span {
  padding: 0 12px;
}

.current-response-label {
  font-size: 12px;
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 8px;
}

.response-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* 任务标注页面的 Markdown 渲染样式 */
.judge-pane-response .pane-inner p {
  margin: 0 0 0.1em 0;
}

.judge-pane-response .pane-inner h1, 
.judge-pane-response .pane-inner h2, 
.judge-pane-response .pane-inner h3, 
.judge-pane-response .pane-inner h4, 
.judge-pane-response .pane-inner h5, 
.judge-pane-response .pane-inner h6 {
  margin: 0.1em 0 0.1em 0;
  line-height: 1;
}

.judge-pane-response .pane-inner h1 { font-size: 1.4em; }
.judge-pane-response .pane-inner h2 { font-size: 1.25em; }
.judge-pane-response .pane-inner h3 { font-size: 1.1em; }

.judge-pane-response .pane-inner ul, 
.judge-pane-response .pane-inner ol {
  margin: 0 !important;
  padding-left: 1em;
}

.judge-pane-response .response-text ul, 
.judge-pane-response .response-text ol,
.judge-pane-response .prose-content ul, 
.judge-pane-response .prose-content ol {
  margin: 0 !important;
  padding-left: 1em;
}

.judge-pane-response .pane-inner li {
  margin: 0;
}

.judge-pane-response .pane-inner li p {
  margin: 0;
}

.judge-pane-response .pane-inner blockquote {
  margin: 0.2em 0;
  padding: 0.5em 1em;
  border-left: 3px solid #d1d5db;
  background: #f9fafb;
}

.judge-pane-response .pane-inner code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

.pane-inner pre code {
  background: none;
  padding: 0;
}

/* Eval Tabs & Sections */
.eval-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
}

.eval-tab {
  flex: 1;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}

.eval-tab.active {
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.eval-section {
  margin-bottom: 16px;
}

/* Compact Rubric List */
.rubric-list-compact {
  max-height: calc(100vh - 400px);
  overflow-y: auto;
}

.annotation-rubric-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

/* LLM Judge 展开/折叠 */
.annotation-rubric-llm {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  line-height: 1.5;
}

.llm-judge-label {
  color: #374151;
}

.llm-analysis-short,
.llm-analysis-full {
  color: #6b7280;
}

.llm-analysis-full {
  white-space: pre-wrap;
  word-break: break-word;
}

.llm-toggle-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
  margin-left: 4px;
}

.llm-toggle-btn:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* 思考内容折叠/展开 */
.response-reasoning-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

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

.response-reasoning-title {
  font-weight: 600;
  color: #374151;
  font-size: 13px;
}

.response-reasoning-content {
  background: #f9fafb;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
}

.reasoning-toggle-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 11px;
  padding: 0 4px;
}

.reasoning-toggle-btn:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Modal Tab切换 */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 0 16px;
  margin: 0;
}

.modal-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: -1px;
}

.modal-tab:hover {
  color: #374151;
  background: #f3f4f6;
}

.modal-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #fff;
}

.modal-tab-content {
  display: none;
}

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

/* 确保查看Tab内容正确显示 */
#collectorDetailViewTab.active {
  display: block;
}

#collectorDetailEditTab.active {
  display: block;
}

/* 移除modal-body的顶部padding，让detail-nav紧贴modal-tabs */
#collectorDetailModalBody {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* 回复内容区域样式 */
.response-content-area {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}

.response-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.response-model-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.response-content-body {
  min-height: 100px;
  max-height: 600px;
  overflow-y: auto;
}

/* GSB Compact */
.gsb-models-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.gsb-model-box {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

.gsb-model-box.baseline { background: #f1f5f9; }
.gsb-model-box.current { background: #eff6ff; }

.gsb-model-label {
  font-size: 10px;
  color: #64748b;
  margin-bottom: 2px;
}

.gsb-model-name {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.gsb-vs {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.gsb-score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.gsb-score-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  transition: all 0.15s;
}

.gsb-score-btn span {
  font-size: 9px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
}

.gsb-score-btn:hover {
  background: #f8fafc;
  border-color: #2563eb;
}

.gsb-score-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.gsb-score-btn.active span { color: rgba(255,255,255,0.8); }

/* Comment */
.eval-comment {
  margin-top: 12px;
}

.eval-comment label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.eval-comment textarea {
  width: 100%;
  min-height: 60px;
  border-radius: 6px;
  font-size: 12px;
  resize: none;
}

/* Grading Actions */
.grading-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.grading-actions .btn {
  flex: 1;
  padding: 10px;
  font-size: 12px;
  border-radius: 8px;
}

.grading-actions .btn-primary {
  flex: 2;
}

/* 模型 Checkbox 选择器 */
.model-checkbox-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.model-checkbox-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.model-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-checkbox-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.model-checkbox-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.model-checkbox-item input[type="checkbox"] {
  margin: 0;
}

/* Coverage Progress Bar */
.coverage-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
  cursor: default;
}

.coverage-percent {
  font-size: 13px;
  font-weight: 600;
  min-width: 42px;
  text-align: right;
}

.coverage-percent.progress-low {
  color: #ea580c;
}

.coverage-percent.progress-medium {
  color: #2563eb;
}

.coverage-percent.progress-high {
  color: #16a34a;
}

.coverage-bar {
  flex: 1;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.coverage-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.coverage-bar-fill.progress-low {
  background: linear-gradient(90deg, #fdba74, #f97316);
}

.coverage-bar-fill.progress-medium {
  background: linear-gradient(90deg, #93c5fd, #3b82f6);
}

.coverage-bar-fill.progress-high {
  background: linear-gradient(90deg, #86efac, #22c55e);
}

/* Dropdown Menu Styles */
.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item:active {
  background: #e5e7eb;
}

/* Rubric Editable Styles */
.annotation-rubric-criterion-editable {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
}

.annotation-rubric-criterion-editable .rubric-id {
  font-weight: 600;
  color: #374151;
  flex-shrink: 0;
  line-height: 1.5;
}

.annotation-rubric-criterion-editable .rubric-criterion-text {
  flex: 1;
  font-weight: 600;
  color: #374151;
  line-height: 1.5;
}

.annotation-rubric-criterion-editable .rubric-criterion-input {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  font-size: 13px;
  background: #fefce8;
  transition: border-color 0.15s, background 0.15s;
}

.annotation-rubric-criterion-editable .rubric-criterion-input:focus {
  outline: none;
  border-color: #d97706;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.annotation-rubric-criterion-editable .rubric-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.annotation-rubric-criterion-editable .rubric-edit-btn:hover {
  background: #f3f4f6;
}

/* Mermaid 图表样式 */
.mermaid {
  background: #fafbfc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  overflow-x: auto;
  text-align: center;
}

.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Mermaid 图表在深色模式下的样式 */
[data-theme="dark"] .mermaid,
.dark-theme .mermaid {
  background: #1e293b;
  border-color: #334155;
}

/* Mermaid 渲染错误提示 */
.mermaid[data-processed="error"] {
  background: #fef2f2;
  border-color: #fecaca;
}

/* ==================== 模型选择分组样式 ==================== */

/* 模型筛选独占整行区域 */
.model-filter-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.model-filter-section h3 {
  margin-bottom: 8px;
}

/* 模型选择容器 - 不限制高度 */
.model-checkbox-container {
  /* 不设置 max-height，让内容自然展开 */
}

.model-checkbox-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.model-checkbox-grouped {
  /* 移除高度限制，让模态框自身滚动 */
  padding-right: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.model-group {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  /* grid 布局下不需要 margin-bottom，由 gap 控制 */
}

.model-group-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.model-group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
}

.model-group-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color, #2563eb);
}

.model-group-count {
  font-weight: 400;
  color: #6b7280;
  font-size: 12px;
}

.model-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.model-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s;
  font-size: 13px;
  color: #374151;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.model-checkbox-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.model-checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--primary-color, #2563eb);
  flex-shrink: 0;
}

.model-checkbox-item input[type="checkbox"]:checked + span {
  color: var(--primary-color, #2563eb);
  font-weight: 500;
}

.model-checkbox-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* 深色模式适配 */
[data-theme="dark"] .model-group,
.dark-theme .model-group {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .model-group-header,
.dark-theme .model-group-header {
  border-color: #334155;
}

[data-theme="dark"] .model-group-toggle,
.dark-theme .model-group-toggle {
  color: #e2e8f0;
}

[data-theme="dark"] .model-group-count,
.dark-theme .model-group-count {
  color: #94a3b8;
}

[data-theme="dark"] .model-checkbox-item,
.dark-theme .model-checkbox-item {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="dark"] .model-checkbox-item:hover,
.dark-theme .model-checkbox-item:hover {
  background: #1e293b;
  border-color: #475569;
}
