/* ========== 基础设置 ========== */

/* 隐藏滚动条但保持功能 */
::-webkit-scrollbar {
  display: none;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* ========== 无障碍类 ========== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.visually-hidden-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: 1000;
  color: white;
  background: #000;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* ========== CSS 变量定义 ========== */
[data-theme="light"] {
  --bg-primary: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --text-primary: #1f2937;
  --text-secondary: #374151;
  --text-muted: #64748b;
  --text-color: #1f2937;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --primary-color: #4f46e5;
  --hover-bg: rgba(79, 70, 229, 0.05);
  --header-bg: rgba(248, 250, 252, 0.9);
  --tag-bg: rgba(79, 70, 229, 0.1);
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-color: #f1f5f9;
  --border-color: #475569;
  --card-bg: #1e293b;
  --nav-bg: rgba(15, 23, 42, 0.95);
  --primary-color: #8b5cf6;
  --hover-bg: rgba(139, 92, 246, 0.1);
  --header-bg: rgba(30, 41, 59, 0.8);
  --tag-bg: rgba(139, 92, 246, 0.2);
  --scrollbar-track: #334155;
  --scrollbar-thumb: #64748b;
  --scrollbar-thumb-hover: #94a3b8;
}

/* ========== 全局样式 ========== */
body {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%) fixed;
  color: #1f2937;
  cursor: url('https://2025.igem.wiki/jilin-ai/static/cur_dna_32.cur'), auto;
}

/* 深色主题全局应用 */
[data-theme="dark"] body {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* ========== 字体和文本样式 ========== */
h1, h2, h3, h4, h5, h6 {
  color: #1f2937;
  font-weight: 700;
  letter-spacing: 0.01em;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, 
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .content-section h1,
[data-theme="dark"] .content-section h2,
[data-theme="dark"] .content-section h3,
[data-theme="dark"] .content-section h4,
[data-theme="dark"] .content-section h5,
[data-theme="dark"] .content-section h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .content-section h2 {
  border-bottom-color: #3b82f6 !important;
}

[data-theme="dark"] * h1,
[data-theme="dark"] * h2,
[data-theme="dark"] * h3,
[data-theme="dark"] * h4,
[data-theme="dark"] * h5,
[data-theme="dark"] * h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] h1[id],
[data-theme="dark"] h2[id],
[data-theme="dark"] h3[id],
[data-theme="dark"] h4[id],
[data-theme="dark"] h5[id],
[data-theme="dark"] h6[id] {
  color: var(--text-primary) !important;
}

[data-theme="dark"] p, [data-theme="dark"] li {
  color: var(--text-secondary);
}

/* Footer深色主题专用样式 */
[data-theme="dark"] .modern-footer {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .modern-footer .footer-title,
[data-theme="dark"] .modern-footer .partners-title,
[data-theme="dark"] .modern-footer .links-title {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .modern-footer .footer-links a,
[data-theme="dark"] .modern-footer .contact-link,
[data-theme="dark"] .modern-footer .friendly-link {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .modern-footer .team-description {
  color: #cbd5e1 !important;
}

/* 暗色模式下的alert样式 */
[data-theme="dark"] .alert {
  background-color: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(71, 85, 105, 0.5) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .alert-success {
  background-color: rgba(22, 101, 52, 0.3) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: #bbf7d0 !important;
}

[data-theme="dark"] .alert-info {
  background-color: rgba(8, 47, 73, 0.3) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  color: #bfdbfe !important;
}

[data-theme="dark"] .alert-warning {
  background-color: rgba(120, 53, 15, 0.3) !important;
  border-color: rgba(251, 146, 60, 0.3) !important;
  color: #fed7aa !important;
}

[data-theme="dark"] .alert-danger {
  background-color: rgba(127, 29, 29, 0.3) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fecaca !important;
}

/* 暗色模式下的bd-callout样式 */
[data-theme="dark"] .bd-callout {
  background: rgba(30, 41, 59, 0.6) !important;
  border-color: rgba(71, 85, 105, 0.5) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .bd-callout-info {
  border-left-color: #3b82f6 !important;
  background: rgba(30, 58, 138, 0.2) !important;
}

[data-theme="dark"] .bd-callout-warning {
  border-left-color: #8b5cf6 !important;
  background: rgba(109, 40, 217, 0.2) !important;
}

[data-theme="dark"] .bd-callout-danger {
  border-left-color: #9333ea !important;
  background: rgba(147, 51, 234, 0.2) !important;
}

/* 暗色模式下的Bootstrap组件样式 */
[data-theme="dark"] .card {
  --bs-card-bg: rgba(30, 41, 59, 0.8) !important;
  --bs-card-border-color: rgba(71, 85, 105, 0.5) !important;
  --bs-card-color: #e2e8f0 !important;
  background-color: var(--bs-card-bg) !important;
  border-color: var(--bs-card-border-color) !important;
  color: var(--bs-card-color) !important;
}

[data-theme="dark"] .card-header {
  background-color: rgba(51, 65, 85, 0.8) !important;
  border-bottom-color: rgba(71, 85, 105, 0.5) !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .card-body {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .card-footer {
  background-color: rgba(51, 65, 85, 0.8) !important;
  border-top-color: rgba(71, 85, 105, 0.5) !important;
  color: #e2e8f0 !important;
}

/* Ensure footer has spacing from main content */
.modern-footer {
  padding-top: 2.5rem;
}

[data-theme="dark"] .table {
  --bs-table-bg: transparent !important;
  --bs-table-color: #e2e8f0 !important;
  --bs-table-border-color: rgba(71, 85, 105, 0.5) !important;
  --bs-table-striped-bg: rgba(51, 65, 85, 0.3) !important;
  --bs-table-hover-bg: rgba(71, 85, 105, 0.3) !important;
}

[data-theme="dark"] .table thead th {
  border-bottom-color: rgba(71, 85, 105, 0.8) !important;
  color: #f1f5f9 !important;
}

/* 暗色模式下的文本颜色适配 */
[data-theme="dark"] .text-dark {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .text-white {
  color: #f1f5f9 !important;
}

/* 暗色模式下的Bootstrap颜色类适配 */
[data-theme="dark"] .bg-warning {
  background-color: rgba(217, 119, 6, 0.8) !important;
}

[data-theme="dark"] .bg-warning .text-dark {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bg-primary {
  background-color: rgba(59, 130, 246, 0.8) !important;
}

[data-theme="dark"] .bg-secondary {
  background-color: rgba(107, 114, 128, 0.8) !important;
}

[data-theme="dark"] .bg-success {
  background-color: rgba(34, 197, 94, 0.8) !important;
}

[data-theme="dark"] .border-warning {
  border-color: rgba(217, 119, 6, 0.6) !important;
}

[data-theme="dark"] .border-primary {
  border-color: rgba(59, 130, 246, 0.6) !important;
}

[data-theme="dark"] .border-secondary {
  border-color: rgba(107, 114, 128, 0.6) !important;
}

[data-theme="dark"] .border-success {
  border-color: rgba(34, 197, 94, 0.6) !important;
}

.lead, .text-muted {
  color: #6b7280 !important;
}

.text-white-50 {
  color: #9ca3af !important;
}

.text-brand {
  color: #3b82f6 !important;
}

.text-secondary { 
  color: #6b7280 !important; 
}

.text-accent { 
  color: #8b5cf6 !important; 
}

.text-purple {
  color: #c084fc !important;
}

.text-blue {
  color: #60a5fa !important;
}

.text-yellow {
  color: #fbbf24 !important;
}

/* ========== 光标样式 ========== */
a, button, [role="button"], .btn, .cursor-pointer, .navbar-brand, .back-to-top-btn {
  cursor: url('https://2025.igem.wiki/jilin-ai/static/cur_trna_32.cur'), pointer;
}

/* ========== 辅助类 ========== */
.bg-purple {
  background-color: rgba(192, 132, 252, 0.2) !important;
}

.bg-info {
  background-color: rgba(96, 165, 250, 0.2) !important;
}

/* 间距类已在 components.css 中定义，避免重复 */

.gap-2 {
  gap: 0.5rem;
}

/* ========== callout 区块渐变边框 ========== */
.bd-callout {
  padding: 1.25rem; 
  margin-top: 1.25rem; 
  margin-bottom: 1.25rem;
  border: 1px solid #e0e7ff; 
  border-left-width: .25rem; 
  border-radius: .25rem;
  background: rgba(236, 239, 255, 0.7);
}

.bd-callout-info { 
  border-left-color: #3b82f6 
}

.bd-callout-warning { 
  border-left-color: #8b5cf6 
}

.bd-callout-danger { 
  border-left-color: #9333ea 
}