/* ============================================================
   共享代码编辑器样式 — 三模式（深色/护眼/极简）
   由 code-editor skill 定义，供 ThemeLearn 等页面统一使用
   ============================================================ */

/* ─── 容器通用 ─── */
.code-area {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid;
}

.code-area .code-header {
  border-bottom: 1px solid;
}

.code-area .output-area {
  border-top: 1px solid;
}

.code-area .line-numbers {
  padding: 16px 12px 16px 8px;
  text-align: right;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 15px;
  line-height: 1.8;
  user-select: none;
  border-right: 1px solid;
  min-width: 36px;
  box-sizing: border-box;
}

.code-area .line-numbers div {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 15px;
  line-height: 27px;
  height: 27px;
  box-sizing: border-box;
  overflow: hidden;
}

.code-area .code-textarea {
  border: none;
  resize: none;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  font-size: 15px;
  line-height: 27px;
  outline: none;
  font-weight: 400;
  letter-spacing: 0;
  background: transparent;
  padding: 16px;
  overflow-y: auto;
  overflow-x: auto;
  box-sizing: border-box;
}

.code-area .code-textarea:focus {
  outline: none;
  box-shadow: none;
}

.code-area .tab-btn {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.5);
}

.code-area .tab-btn.active {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.code-area .tab-btn.active::before {
  content: '•';
  margin-right: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.code-area .output-pre {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.6;
}

.code-area .mode-toggle-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  font-weight: 500;
}

.code-area .lang-select {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

/* ─── 预期输出和实际输出 - 默认样式 ─── */
#content-expected span {
  color: #10b981 !important;
}

#content-expected .output-pre {
  color: #059669 !important;
}

#content-actual span {
  color: rgba(255, 255, 255, 0.7) !important;
}

#content-actual .output-pre {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================================
   深色模式（Dark Mode）
   ============================================================ */
.code-area.editor-dark {
  background: linear-gradient(180deg, #1e2228 0%, #1a1f24 50%, #162028 100%);
  border-color: rgba(80, 200, 220, 0.15);
  box-shadow: 0 0 30px rgba(80, 200, 220, 0.08), inset 0 1px 0 rgba(80, 200, 220, 0.1);
}

.code-area.editor-dark .code-header {
  background: linear-gradient(180deg, #252a30 0%, #1e2328 100%);
  border-color: rgba(80, 200, 220, 0.1);
}

.code-area.editor-dark .output-area {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(80, 200, 220, 0.08);
}

.code-area.editor-dark .line-numbers {
  background: rgba(0, 0, 0, 0.3);
  color: rgba(80, 200, 220, 0.4);
  border-color: rgba(80, 200, 220, 0.08);
}

.code-area.editor-dark .code-textarea {
  color: rgba(200, 220, 225, 0.95);
  caret-color: rgba(80, 200, 220, 0.8);
}

.code-area.editor-dark .lang-select {
  background: rgba(30, 35, 40, 0.9);
  border: 1px solid rgba(80, 200, 220, 0.2);
  color: rgba(80, 200, 220, 0.9);
}

.code-area.editor-dark .lang-select option {
  background: #1e2228;
  color: rgba(200, 220, 225, 0.9);
}

.code-area.editor-dark .mode-toggle-btn {
  background: rgba(30, 35, 40, 0.9);
  border: 1px solid rgba(80, 200, 220, 0.2);
  color: rgba(80, 200, 220, 0.9);
}

/* 深色模式 - 预期结果和实际输出使用黄色 */
.code-area.editor-dark #content-expected span {
  color: #fbbf24 !important;
}

.code-area.editor-dark #content-expected .output-pre {
  color: #f59e0b !important;
}

.code-area.editor-dark #content-actual span {
  color: #fbbf24 !important;
}

.code-area.editor-dark #content-actual .output-pre {
  color: #f59e0b !important;
}

/* ============================================================
   护眼模式（Eye-care Mode）
   ============================================================ */
.code-area.editor-eyecare {
  background: linear-gradient(180deg, #f0f4e8 0%, #e8f0d8 100%);
  border-color: rgba(180, 200, 160, 0.3);
}

.code-area.editor-eyecare .code-header {
  background: rgba(180, 200, 160, 0.3);
  border-color: rgba(180, 200, 160, 0.2);
}

.code-area.editor-eyecare .output-area {
  background: rgba(180, 200, 160, 0.2);
  border-color: rgba(180, 200, 160, 0.2);
}

.code-area.editor-eyecare .line-numbers {
  background: rgba(255, 255, 240, 0.5);
  color: rgba(0, 0, 0, 0.3);
  border-color: rgba(180, 200, 160, 0.2);
}

.code-area.editor-eyecare .code-textarea {
  color: rgba(60, 80, 60, 0.95);
  caret-color: rgba(60, 80, 60, 0.9);
}

.code-area.editor-eyecare .lang-select {
  background: #e8e8e8;
  border-color: #c0c0c0;
  color: #444;
}

.code-area.editor-eyecare .lang-select option {
  background: #f0f0f0;
  color: #444;
}

.code-area.editor-eyecare .tab-btn {
  background: transparent;
  color: rgba(60, 80, 60, 0.6);
  border-color: rgba(60, 80, 60, 0.15);
}

.code-area.editor-eyecare .tab-btn.active {
  color: rgba(60, 80, 60, 0.9);
  font-weight: 600;
}

.code-area.editor-eyecare .tab-btn.active::before {
  color: rgba(60, 80, 60, 0.9);
}

.code-area.editor-eyecare .tab-btn:hover {
  color: rgba(60, 80, 60, 0.8);
}

.code-area.editor-eyecare .code-header span,
.code-area.editor-eyecare #content-actual span {
  color: rgba(60, 80, 60, 0.7) !important;
}

.code-area.editor-eyecare #content-actual .output-pre {
  color: rgba(40, 60, 40, 0.85) !important;
}

.code-area.editor-eyecare .mode-toggle-btn {
  background: rgba(180, 200, 160, 0.8) !important;
  border-color: rgba(140, 160, 120, 0.3) !important;
  color: rgba(60, 80, 60, 0.9) !important;
}

.code-area.editor-eyecare .run-btn {
  background: linear-gradient(135deg, #7c3aed, #6366f1) !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3) !important;
}

.code-area.editor-eyecare .run-btn:hover {
  background: linear-gradient(135deg, #6d28d9, #4f46e5) !important;
}

/* ============================================================
   极简模式（Minimal Mode）
   ============================================================ */
.code-area.editor-minimal {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
  border-color: rgba(200, 200, 200, 0.3);
}

.code-area.editor-minimal .code-header {
  background: rgba(230, 230, 230, 0.9);
  border-color: rgba(200, 200, 200, 0.2);
}

.code-area.editor-minimal .output-area {
  background: rgba(245, 245, 245, 0.8);
  border-color: rgba(200, 200, 200, 0.2);
}

.code-area.editor-minimal .line-numbers {
  background: rgba(240, 240, 240, 0.8);
  color: rgba(0, 0, 0, 0.4);
  border-color: rgba(200, 200, 200, 0.3);
}

.code-area.editor-minimal .code-textarea {
  color: rgba(40, 40, 40, 0.8);
  caret-color: rgba(40, 40, 40, 0.9);
}

.code-area.editor-minimal .lang-select {
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  color: #333;
}

.code-area.editor-minimal .lang-select option {
  background: #f5f5f5;
  color: #333;
}

.code-area.editor-minimal .tab-btn {
  color: rgba(60, 60, 60, 0.5);
  border-color: rgba(0, 0, 0, 0.1);
}

.code-area.editor-minimal .tab-btn.active {
  color: rgba(40, 40, 40, 0.9);
  font-weight: 600;
}

.code-area.editor-minimal .tab-btn.active::before {
  color: rgba(40, 40, 40, 0.9);
}

.code-area.editor-minimal .output-pre {
  color: rgba(20, 20, 20, 0.85) !important;
}

.code-area.editor-minimal .code-header span {
  color: rgba(40, 40, 40, 0.7) !important;
}

.code-area.editor-minimal .mode-toggle-btn {
  background: rgba(240, 240, 240, 0.9);
  border: 1px solid rgba(200, 200, 200, 0.3);
  color: rgba(60, 60, 60, 0.8);
}

/* ============================================================
   运行按钮 - 根据编辑器模式调整
   ============================================================ */

/* 深色模式运行按钮 */
.code-area.editor-dark .run-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35) !important;
}

.code-area.editor-dark .run-btn:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc) !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.5) !important;
}

/* 深色模式滚动条样式 */
.code-area.editor-dark textarea::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
.code-area.editor-dark textarea::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15) !important;
  border-radius: 3px;
}
.code-area.editor-dark textarea::-webkit-scrollbar-thumb {
  background: rgba(80, 200, 220, 0.35) !important;
  border-radius: 3px;
}
.code-area.editor-dark textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(80, 200, 220, 0.55) !important;
}

.code-area.editor-dark .output-pre::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}
.code-area.editor-dark .output-pre::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15) !important;
  border-radius: 3px;
}
.code-area.editor-dark .output-pre::-webkit-scrollbar-thumb {
  background: rgba(80, 200, 220, 0.35) !important;
  border-radius: 3px;
}
.code-area.editor-dark .output-pre::-webkit-scrollbar-thumb:hover {
  background: rgba(80, 200, 220, 0.55) !important;
}

/* 护眼模式运行按钮 */
.code-area.editor-eyecare .run-btn {
  background: linear-gradient(135deg, rgba(180, 200, 120, 0.95), rgba(160, 180, 100, 0.95)) !important;
  color: rgba(40, 60, 40, 0.95) !important;
  border: 1px solid rgba(140, 160, 80, 0.4) !important;
  box-shadow: 0 2px 8px rgba(140, 160, 80, 0.3) !important;
}

.code-area.editor-eyecare .run-btn:hover {
  background: linear-gradient(135deg, rgba(160, 180, 100, 0.98), rgba(140, 160, 80, 0.98)) !important;
  box-shadow: 0 4px 12px rgba(140, 160, 80, 0.4) !important;
}

/* 极简模式运行按钮 */
.code-area.editor-minimal .run-btn {
  background: linear-gradient(135deg, rgba(180, 180, 190, 0.85), rgba(160, 160, 175, 0.85)) !important;
  color: rgba(40, 40, 50, 0.95) !important;
  border: 1px solid rgba(140, 140, 150, 0.3) !important;
  box-shadow: 0 2px 6px rgba(140, 140, 150, 0.2) !important;
}

.code-area.editor-minimal .run-btn:hover {
  background: linear-gradient(135deg, rgba(160, 160, 175, 0.9), rgba(140, 140, 155, 0.9)) !important;
  box-shadow: 0 4px 10px rgba(140, 140, 155, 0.3) !important;
}