:root {
  color-scheme: light dark;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background-color: #0f172a;
  color: #e2e8f0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(147, 51, 234, 0.25));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
  white-space: nowrap;
}

.settings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 0.4rem;
}

.compact-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.compact-label span {
  white-space: nowrap;
  min-width: fit-content;
}

.compact-label input {
  width: 200px;
}

input,
button,
select {
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(226, 232, 240, 0.2);
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
}

button {
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.3);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  overflow: hidden;
}

.content-layout {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  min-height: 0;
  overflow: hidden;
}

.filters {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  flex-shrink: 0;
}

.task-manager {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.4);
  flex-shrink: 0;
}

.task-header {
  margin-bottom: 1rem;
}

.task-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f1f5f9;
}

.task-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-mode-selector {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  background: rgba(2, 6, 23, 0.4);
  border-radius: 0.5rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: background 0.15s ease;
}

.radio-label:hover {
  background: rgba(59, 130, 246, 0.1);
}

.radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.task-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.task-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-primary {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.5);
  color: #f1f5f9;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
}

.btn-primary:hover {
  background: rgba(59, 130, 246, 0.4);
  border-color: rgba(59, 130, 246, 0.7);
}

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

.btn-secondary {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  padding: 0.6rem 1.25rem;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.3);
  border-color: rgba(148, 163, 184, 0.4);
}

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

.task-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.task-result-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.task-result-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.task-result-content {
  color: #e2e8f0;
}

.task-result-content h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  color: #f1f5f9;
}

.task-result-content h4 {
  margin: 1rem 0 0.5rem 0;
  font-size: 1rem;
  color: #cbd5e1;
}

.task-result-content p {
  margin: 0.5rem 0;
  line-height: 1.6;
}

.task-result-loading {
  color: rgba(226, 232, 240, 0.7);
  text-align: center;
  padding: 1rem;
}

.task-preview {
  margin-top: 1rem;
  overflow-x: auto;
}

.task-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: rgba(2, 6, 23, 0.4);
  border-radius: 0.5rem;
  overflow: hidden;
}

.task-preview table th,
.task-preview table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
}

.task-preview table th {
  background: rgba(15, 23, 42, 0.6);
  font-weight: 600;
  color: #cbd5e1;
}

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

.task-preview table tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

.results {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.table-container {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

#resultsTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#resultsTable th,
#resultsTable td {
  padding: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  white-space: nowrap;
  text-align: left;
}

#resultsTable th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  z-index: 1;
}

#resultsTable tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

#resultsTable tbody tr:hover,
#resultsTable tbody tr.active {
  background: rgba(59, 130, 246, 0.18);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.right-panel {
  width: 800px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  min-height: 0;
  overflow: hidden;
}

.video-panel {
  width: 350px;
  height: calc(100vh - 250px);
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.video-panel-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-header {
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.video-placeholder {
  padding: 3rem 1rem;
  text-align: center;
  color: rgba(226, 232, 240, 0.5);
  font-size: 0.9rem;
}

.detail-panel {
  flex: 1;
  width: 0;
  height: calc(100vh - 250px);
  min-width: 0;
  min-height: 0;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.detail-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.video-container {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  flex-shrink: 0;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 177.78%; /* 9:16 aspect ratio for TikTok videos */
  background: rgba(2, 6, 23, 0.6);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

.video-wrapper video {
  object-fit: contain;
}

.video-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.video-links a {
  color: rgba(59, 130, 246, 0.9);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.video-links a:hover {
  color: rgba(59, 130, 246, 1);
  text-decoration: underline;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.tab-button {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(226, 232, 240, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.tab-button:hover {
  color: rgba(226, 232, 240, 0.9);
  background: rgba(59, 130, 246, 0.1);
}

.tab-button.active {
  color: rgba(59, 130, 246, 0.9);
  border-bottom-color: rgba(59, 130, 246, 0.9);
  background: transparent;
}

.tab-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-pane {
  display: none;
}

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

.markdown-content {
  background: rgba(2, 6, 23, 0.6);
  border-radius: 0.75rem;
  padding: 1.5rem;
  line-height: 1.8;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.markdown-content h2 {
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #f1f5f9;
  border-bottom: 2px solid rgba(59, 130, 246, 0.3);
  padding-bottom: 0.5rem;
}

.markdown-content h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #cbd5e1;
}

.markdown-content h4 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #cbd5e1;
}

.markdown-content p {
  margin: 0.75rem 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.markdown-content li {
  margin: 0.5rem 0;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.markdown-content table th,
.markdown-content table td {
  padding: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.markdown-content table th {
  background: rgba(59, 130, 246, 0.15);
  font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
  background: rgba(148, 163, 184, 0.05);
}

.markdown-content hr {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  margin: 1.5rem 0;
}

.markdown-content code {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85em;
  color: #fbbf24;
}

.markdown-content strong {
  color: #f1f5f9;
  font-weight: 600;
}

.markdown-content em {
  font-style: italic;
  color: #cbd5e1;
}

/* 质量评级与优质度优化样式 */
.quality-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.quality-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(2, 6, 23, 0.6);
  border-radius: 0.5rem;
  border-left: 3px solid rgba(148, 163, 184, 0.3);
}

.quality-metric.good {
  border-left-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.05);
}

.quality-metric.medium {
  border-left-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.05);
}

.quality-metric.poor {
  border-left-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.05);
}

.metric-label {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.7);
  font-weight: 500;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.metric-note {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.6);
  font-weight: normal;
  margin-left: 0.25rem;
}

.quality-missing {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(251, 191, 36, 0.1);
  border-left: 3px solid rgba(251, 191, 36, 0.6);
  border-radius: 0.5rem;
}

.quality-missing strong {
  color: #fbbf24;
  margin-right: 0.5rem;
}

.missing-items {
  color: #e2e8f0;
}

.quality-details {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quality-section {
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.quality-section.quality-positive {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.quality-section.quality-negative {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.quality-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
}

.quality-section.quality-positive h4 {
  color: #86efac;
}

.quality-section.quality-negative h4 {
  color: #fca5a5;
}

.quality-list {
  margin: 0;
  padding-left: 1.5rem;
  list-style: none;
}

.quality-list li {
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  background: rgba(2, 6, 23, 0.4);
  border-radius: 0.375rem;
  color: #e2e8f0;
  line-height: 1.5;
}

.quality-list li.penalty-item {
  background: rgba(239, 68, 68, 0.15);
  border-left: 2px solid rgba(239, 68, 68, 0.5);
  padding-left: 1rem;
}

@media (max-width: 1024px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .app-header h1 {
    font-size: 1.1rem;
  }
  
  .settings {
    width: 100%;
    justify-content: flex-start;
  }
  
  .compact-label input {
    width: 150px;
  }
  
  .content-layout {
    flex-direction: column;
  }
  
  .right-panel {
    width: 100%;
    flex-direction: column;
  }
  
  .video-panel {
    width: 100%;
    height: auto;
    max-height: 50vh;
  }
  
  .detail-panel {
    height: auto;
    max-height: 50vh;
  }
}

footer {
  padding: 1rem 1.5rem 1.5rem;
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.6);
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.toast {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: rgba(15, 118, 110, 0.85);
  color: #f8fafc;
  padding: 0.6rem 1rem;
  border-radius: 0.6rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.3);
}

.toast-error {
  background: rgba(220, 38, 38, 0.85);
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

