/* 暗夜模式 */
[data-theme="dark"] body {
  background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%) !important;
  color: #e1e5e9 !important;
}

/* 底部信息暗夜模式适配 */
[data-theme="dark"] .footer-apple-style {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .footer-apple-style:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

[data-theme="dark"] .footer-apple-content {
    color: #e1e5e9 !important;
}

[data-theme="dark"] .footer-apple-info .info-badge {
    background: rgba(0, 122, 255, 0.15) !important;
    border: 1px solid rgba(0, 122, 255, 0.25) !important;
    color: #e1e5e9 !important;
}

[data-theme="dark"] .footer-apple-status .status-badge {
    background: rgba(52, 199, 89, 0.15) !important;
    border: 1px solid rgba(52, 199, 89, 0.25) !important;
    color: #e1e5e9 !important;
}

[data-theme="dark"] .footer-apple-info .info-badge a {
    color: #58a6ff !important;
}

[data-theme="dark"] .footer-apple-info .info-badge a:hover {
    color: #79c0ff !important;
}

[data-theme="dark"] .footer-apple-status .status-badge i {
    color: #34C759 !important;
}

[data-theme="dark"] .footer-apple-status .status-value {
    color: #34C759 !important;
}

[data-theme="dark"] .footer-apple-info .info-badge:hover {
    background: rgba(0, 122, 255, 0.2) !important;
    border-color: rgba(0, 122, 255, 0.35) !important;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.25) !important;
}

[data-theme="dark"] .footer-apple-status .status-badge:hover {
    background: rgba(52, 199, 89, 0.2) !important;
    border-color: rgba(52, 199, 89, 0.35) !important;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3) !important;
}

/* 头部名片区域 */
[data-theme="dark"] .profile-card {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .profile-name {
  color: #ffffff !important;
  background: linear-gradient(45deg, #58a6ff, #7dd3fc) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

[data-theme="dark"] .profile-slogan {
  color: #8e8e93 !important;
}

[data-theme="dark"] .profile-desc,
[data-theme="dark"] .profile-edu {
  color: #8e8e93 !important;
}

[data-theme="dark"] .social-text {
  color: #8e8e93 !important;
}

/* 导航标签 */
[data-theme="dark"] .nav-tabs .nav-link {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #8e8e93 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
  background: linear-gradient(45deg, #007aff, #0a84ff) !important;
  color: #ffffff !important;
}

/* 内容卡片 */
[data-theme="dark"] .content-card {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .content-card h2,
[data-theme="dark"] .content-card h3 {
  color: #ffffff !important;
}

[data-theme="dark"] .content-card p {
  color: #e1e5e9 !important;
}

[data-theme="dark"] .content-card li {
  color: #e1e5e9 !important;
}

/* 时间轴 */
[data-theme="dark"] .horizontal-timeline .timeline-item {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .year-label {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .activity-item {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .activity-item h4 {
  color: #ffffff !important;
  background: rgba(88, 166, 255, 0.2) !important;
}

[data-theme="dark"] .activity-item p {
  color: #e1e5e9 !important;
}

/* 联系方式 */
[data-theme="dark"] .contact-item {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e1e5e9 !important;
}

[data-theme="dark"] .contact-details h3 {
  color: #ffffff !important;
}

[data-theme="dark"] .contact-details p,
[data-theme="dark"] .contact-username {
  color: #e1e5e9 !important;
}

[data-theme="dark"] .contact-icon i {
  color: #58a6ff !important;
}

/* 搜索功能 */
[data-theme="dark"] .search-container {
  position: relative !important;
  z-index: 100 !important;
}

[data-theme="dark"] .search-input-wrapper {
  background: rgba(28, 28, 30, 0.9) !important;
  border: 2px solid rgba(88, 166, 255, 0.2) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

[data-theme="dark"] .search-input-wrapper:focus-within {
  border-color: #58a6ff !important;
  box-shadow: 0 8px 30px rgba(88, 166, 255, 0.4), 0 0 0 4px rgba(88, 166, 255, 0.1) !important;
}

[data-theme="dark"] .search-input {
  background: transparent !important;
  color: #ffffff !important;
}

[data-theme="dark"] .search-input::placeholder {
  color: #8e8e93 !important;
}

[data-theme="dark"] .search-button {
  color: #58a6ff !important;
}

[data-theme="dark"] .search-button:hover {
  background: rgba(88, 166, 255, 0.1) !important;
}

[data-theme="dark"] .clear-search-button {
  color: #8e8e93 !important;
}

[data-theme="dark"] .clear-search-button:hover {
  background: rgba(255, 71, 87, 0.1) !important;
  color: #ff4757 !important;
}

[data-theme="dark"] .search-results {
  background: rgba(28, 28, 30, 0.95) !important;
  border: 2px solid rgba(88, 166, 255, 0.3) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 8px 25px rgba(88, 166, 255, 0.2) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
}

[data-theme="dark"] .search-results-header {
  background: rgba(88, 166, 255, 0.1) !important;
  border-bottom: 2px solid rgba(88, 166, 255, 0.2) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

[data-theme="dark"] .search-results-count {
  color: #8e8e93 !important;
}

[data-theme="dark"] .search-result-item {
  color: #e1e5e9 !important;
  border-left: 4px solid transparent !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin: 2px 0 !important;
  border-radius: 8px !important;
}

[data-theme="dark"] .search-result-item:hover {
  background: rgba(88, 166, 255, 0.15) !important;
  border-left-color: #58a6ff !important;
  box-shadow: inset 0 0 20px rgba(88, 166, 255, 0.1) !important;
  transform: translateX(5px) !important;
}

[data-theme="dark"] .search-result-title {
  color: #ffffff !important;
}

[data-theme="dark"] .search-result-category {
  background: linear-gradient(135deg, #58a6ff, #0056b3) !important;
  color: white !important;
}

[data-theme="dark"] .search-result-content {
  color: #8e8e93 !important;
}

[data-theme="dark"] .search-result-meta {
  color: #6e6e73 !important;
}

[data-theme="dark"] .search-highlight {
  background: rgba(88, 166, 255, 0.3) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .search-no-results {
  color: #8e8e93 !important;
}

[data-theme="dark"] .search-no-results i {
  color: #48484a !important;
}

[data-theme="dark"] .search-suggestions {
  background: rgba(88, 166, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 15px !important;
  margin: 10px !important;
  border: 1px solid rgba(88, 166, 255, 0.2) !important;
}

[data-theme="dark"] .search-suggestions-title {
  color: #58a6ff !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
}

[data-theme="dark"] .search-suggestion-tag {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #e1e5e9 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .search-suggestion-tag:hover {
  background: linear-gradient(135deg, #58a6ff, #0056b3) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3) !important;
  transform: translateY(-2px) !important;
}

/* 二维码弹窗暗夜模式 */
[data-theme="dark"] .qr-popup-standalone {
  background: rgba(28, 28, 30, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .qr-popup-standalone p {
  color: #e1e5e9 !important;
}

[data-theme="dark"] .qr-popup {
  background: rgba(28, 28, 30, 0.95) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .qr-popup p {
  color: #e1e5e9 !important;
}

[data-theme="dark"] .contact-item:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(88, 166, 255, 0.3) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .contact-icon {
  background: rgba(88, 166, 255, 0.15) !important;
  border: 2px solid rgba(88, 166, 255, 0.2) !important;
}

[data-theme="dark"] .contact-item:hover .contact-icon {
  background: linear-gradient(45deg, #58a6ff, #0056b3) !important;
  border-color: #58a6ff !important;
  box-shadow: 0 0 20px rgba(88, 166, 255, 0.4) !important;
}

[data-theme="dark"] .contact-item:hover .contact-icon i {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
}

[data-theme="dark"] .contact-username {
  color: #8e8e93 !important;
}

/* 社交媒体图标暗夜模式优化 */
[data-theme="dark"] .profile-social a {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #58a6ff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .profile-social a::before {
  background: linear-gradient(45deg, #58a6ff, #0056b3) !important;
}

[data-theme="dark"] .profile-social a:hover {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 8px 20px rgba(88, 166, 255, 0.3) !important;
  border-color: rgba(88, 166, 255, 0.4) !important;
}

/* Gitee图标特殊处理 */
[data-theme="dark"] .gitee-link img {
  filter: brightness(1.2) contrast(1.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 4px !important;
}

[data-theme="dark"] .profile-social a:hover .gitee-link img {
  filter: brightness(1.5) contrast(1.2) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)) !important;
  border-color: rgba(88, 166, 255, 0.4) !important;
}

/* 个人介绍页面引言框暗夜模式 */
[data-theme="dark"] .content-body blockquote {
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.1), transparent) !important;
  border-left-color: #58a6ff !important;
}

[data-theme="dark"] .content-body blockquote::before {
  color: rgba(88, 166, 255, 0.15) !important;
}

[data-theme="dark"] .content-body blockquote p {
  color: #ffffff !important;
}

[data-theme="dark"] .content-body blockquote:hover {
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.15), transparent) !important;
}

/* 返回顶部按钮暗夜模式 */
[data-theme="dark"] .back-to-top,
[data-theme="dark"] #backToTop {
  background: rgba(28, 28, 30, 0.95) !important;
  color: #58a6ff !important;
  border: 1px solid rgba(88, 166, 255, 0.4) !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.6),
    0 2px 10px rgba(88, 166, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
}

[data-theme="dark"] .back-to-top::before,
[data-theme="dark"] #backToTop::before {
  background: linear-gradient(45deg, #58a6ff, #007aff) !important;
  border-radius: 14px !important;
}

[data-theme="dark"] .back-to-top:hover,
[data-theme="dark"] #backToTop:hover {
  color: #ffffff !important;
  background: rgba(28, 28, 30, 0.98) !important;
  border-color: #58a6ff !important;
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.7),
    0 4px 20px rgba(88, 166, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .back-to-top:hover::before,
[data-theme="dark"] #backToTop:hover::before {
  width: 100% !important;
}

[data-theme="dark"] .back-to-top i,
[data-theme="dark"] #backToTop i {
  color: #58a6ff !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  z-index: 2 !important;
}

[data-theme="dark"] .back-to-top:hover i,
[data-theme="dark"] #backToTop:hover i {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6) !important;
  transform: translateY(-1px) !important;
}

/* 时间轴导航按钮暗夜模式 */
[data-theme="dark"] .timeline-nav-button {
  background: rgba(28, 28, 30, 0.95) !important;
  color: #58a6ff !important;
  border: 1px solid rgba(88, 166, 255, 0.4) !important;
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.5),
    0 2px 8px rgba(88, 166, 255, 0.3) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
}

[data-theme="dark"] .timeline-nav-button:hover {
  background: linear-gradient(45deg, #58a6ff, #007aff) !important;
  color: #ffffff !important;
  border-color: #58a6ff !important;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.6),
    0 4px 15px rgba(88, 166, 255, 0.5) !important;
  transform: translateY(-50%) scale(1.15) !important;
}

[data-theme="dark"] .timeline-nav-button:active {
  transform: translateY(-50%) scale(1.05) !important;
  background: linear-gradient(45deg, #007aff, #0056b3) !important;
}

[data-theme="dark"] .timeline-nav-button:disabled {
  background: rgba(28, 28, 30, 0.6) !important;
  color: rgba(88, 166, 255, 0.4) !important;
  border-color: rgba(88, 166, 255, 0.2) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  opacity: 0.5 !important;
}


/* 主题切换按钮 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #1d1d1f;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1000;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.theme-toggle:active {
  transform: scale(0.95);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* 图标切换动画 */
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  transition: all 0.3s ease;
  position: absolute;
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
}

[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 平滑过渡动画 - 仅针对特定元素 */
body,
.profile-card,
.content-card,
.nav-tabs .nav-link,
.contact-item,
.activity-item,
.timeline-item,
.search-input-wrapper,
.search-results,
.footer-apple-style {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 移动端适配 */
@media (max-width: 767px) {
  .theme-toggle {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}