/* Shared Styles for Navigation and Footer */

/* CSS Variables for consistent styling */
:root {
  --primary-color: #4f46e5;
  /* Indigo-600 */
  --primary-hover: #3730a3;
  --navbar-height: 64px;
  /* Standard height for navbar */
  --transition-base: all 0.3s ease;
  --shadow-base: 0 2px 10px rgba(0, 0, 0, 0.1);

  /* Z-indexes - Updated based on review */
  --z-index-tooltip: 1300;
  --z-index-modal: 1200;
  --z-index-dropdown: 1100;
  --z-index-mobile-sidebar: 1050;
  /* Mobile sidebar, should be above navbar and overlay */
  --z-index-mobile-sidebar-overlay: 1040;
  /* Overlay for mobile, below sidebar but above content & navbar */
  --z-index-navbar: 1100;
  /* Navbar, below mobile overlay and sidebar */
  --z-index-go-to-top: 1030;
  /* Keep go-to-top high */
  --z-index-sidebar: 900;
  /* Desktop sidebar, can be lower as it doesn't overlap navbar */

  /* Fallback for old names if still used, though they should be updated */
  --z-navbar: 1000;
  /* Alias for --z-index-navbar */
  --z-sidebar-overlay: 1040;
  /* Alias for --z-index-mobile-sidebar-overlay */
  --z-sidebar: 1050;
  /* Alias for --z-index-mobile-sidebar */
  --z-sidebar-toggle: 900;
  /* This might be for a desktop toggle or an old reference */
  --z-go-to-top: 1030;
  /* Alias for --z-index-go-to-top */
}
body {
  padding-top: calc(
    var(--navbar-height) + env(safe-area-inset-top)
  ); /* var(--navbar-height) */
  scroll-padding-top: calc(
    var(--navbar-height) + env(safe-area-inset-top) + 16px
  );
}

/* html,
body {
  scrollbar-width: thin;
  scrollbar-color: #a0aec0 #f1f5f9;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background-color: #a0aec0;
  border-radius: 9999px;
  border: 2px solid #f1f5f9;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background-color: #718096;
}

html.dark,
html.dark body {
  scrollbar-color: #4b5563 #1f2937;
}

html.dark::-webkit-scrollbar-track,
html.dark body::-webkit-scrollbar-track {
  background: #1f2937;
}

html.dark::-webkit-scrollbar-thumb,
html.dark body::-webkit-scrollbar-thumb {
  background-color: #4b5563;
  border-color: #1f2937;
}

html.dark::-webkit-scrollbar-thumb:hover,
html.dark body::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
} */

body:not(.docs-page) .docs-only {
  display: none !important;
}
/* Shared gradient background for hero sections */
.gradient-bg {
  background: linear-gradient(135deg, #4f46e5 0%, #1e40af 100%);
}

/* Shared filter chip styles */
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  /* Reduced padding */
  background-color: rgba(243, 244, 246, 0.7);
  /* Softer background */
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  /* Pill shape */
  font-size: 0.8rem;
  /* Slightly smaller font size */
  cursor: pointer;
  transition: var(--transition-base);
  margin-bottom: 0.25rem;
  /* Reduced vertical spacing between chips */
  justify-content: space-between;
  /* Distribute space between items */
}

.filter-chip:hover {
  background-color: #e5e7eb;
}

.filter-chip.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.filter-chip .count-badge {
  margin-left: 0.4rem;
  /* Reduced margin */
  font-size: 0.7rem;
  /* Even smaller font for count */
  color: #6b7280;
  /* Gray color for count */
}

.filter-chip.active .count-badge {
  color: rgba(255, 255, 255, 0.8);
  /* Lighter color when active */
}

/* Container for vertical chip layout */
.filter-chip-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  /* Reduced spacing between chips */
}

/* Shared button styles */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
}

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

.btn-secondary {
  background-color: #f3f4f6;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Navigation center alignment */
.nav-center {
  display: flex;
  justify-content: center;
  flex: 1;
}

@media (min-width: 1024px) {
  nav.main-navbar .nav-center {
    display: flex !important;
  }

  nav.main-navbar #nav-right-section {
    display: flex !important;
  }
}

/* 全局固定主导航栏，非docs-page页面 */
nav.main-navbar {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-navbar);
  background-color: white;
  box-shadow: var(--shadow-base);
  padding-top: env(safe-area-inset-top);
}

.mobile-nav-link.nav-active {
  background-color: rgba(79, 70, 229, 0.1) !important;
  border-left-color: var(--primary-color) !important;
  color: var(--primary-color) !important;
  font-weight: 600;
}

/* Mobile menu specific non-active link hover style */
.mobile-nav-link:not(.nav-active):hover {
  background-color: #f3f4f6 !important;
  border-left-color: #d1d5db !important;
  color: #4a5568 !important;
}

/* Ensure mobile nav links have base styles for transition */
.mobile-nav-link {
  transition: var(--transition-base);
}

/* No specific styles for mobile-sidebar-toggle here yet, or they are general button styles */

/* Styles for mobile menu button icon state */
#mobile-menu-button .fa-bars {
  transition: transform 0.3s ease;
}

#mobile-menu-button.is-active .fa-bars {
  transform: rotate(90deg);
}

/* Footer styles can be added here if needed */
/* Add any footer-specific styles that are shared across all pages */

/* Shared Card Styles - Used across multiple pages */
/* Card description styling */
.card-description {
  max-height: 150px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Common scrollbar styling for all scrollable elements */
.card-description::-webkit-scrollbar,
.process-card-text::-webkit-scrollbar,
.method-description::-webkit-scrollbar,
.dataset-card .dataset-description::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.card-description::-webkit-scrollbar-thumb,
.process-card-text::-webkit-scrollbar-thumb,
.method-description::-webkit-scrollbar-thumb,
.dataset-card .dataset-description::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.card-description::-webkit-scrollbar-track,
.process-card-text::-webkit-scrollbar-track,
.method-description::-webkit-scrollbar-track,
.dataset-card .dataset-description::-webkit-scrollbar-track {
  background-color: #f1f5f9;
  border-radius: 3px;
}

/* Card tags area styling */
.card-tags-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Tag styles */
.card-tags-area span {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.25;
  transition: var(--transition-base);
}

/* Card footer styles */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-footer .flex {
  gap: 0.5rem;
}

/* 桌面端主导航栏链接基础样式 */
.desktop-nav-link {
  position: relative;
  color: #6b7280;
  background: transparent;
  padding: 0.25em 0.75em;
  border-radius: 0.375em;
  transition:
    color 0.2s,
    background 0.2s;
  text-decoration: none;
  border-bottom: none !important;
}

/* 悬停：蓝青色字体+下划线，无背景 */
.desktop-nav-link:hover {
  color: rgb(128, 69, 229, 1) !important;
  background: transparent !important;
  text-decoration: underline;
  text-underline-offset: 0.8em;
  text-decoration-thickness: 2px;
  text-decoration-color: rgb(128, 69, 229, 1);
}

/* 激活：主色字体+下划线+淡主色背景 */
.desktop-nav-link.nav-active {
  color: var(--primary-color) !important;
  background: rgba(55, 134, 199, 0.1);
  text-decoration: underline;
  text-underline-offset: 0.8em;
  text-decoration-thickness: 2.5px;
  text-decoration-color: var(--primary-color);
  font-weight: 600;
  border-bottom: none !important;
}

/* 兼容Home特殊激活样式 */
#navbar-placeholder a.desktop-nav-link.nav-active[href="/"],
#navbar-placeholder a.desktop-nav-link.nav-active[href="index.html"] {
  color: var(--primary-color) !important;
  font-weight: 600 !important;
  background: rgba(79, 70, 229, 0.1);
  text-decoration: underline;
  text-underline-offset: 0.8em;
  text-decoration-thickness: 2.5px;
  text-decoration-color: var(--primary-color);
  border-bottom: none !important;
  border-radius: 0.375em;
  padding: 0.25em 0.75em;
}

/* 移除旧的 .nav-active 样式，避免冲突 */
.nav-active {
  border-bottom: none !important;
  background: transparent !important;
}

/* Announcement bell and popup styles */
/* #index-only, .index-only { display: none; }
#index.html .index-only, body.index-only { display: inline-block !important; } */

/* 已去重：公告弹窗样式上方已定义，这里移除重复块 */

/* Lightbox image zoom functionality */
#lightbox-image.zoomable {
  cursor: zoom-in;
  transition: transform 0.3s ease-in-out;
}

#lightbox-image.zoomable.is-zoomed {
  cursor: zoom-out;
}

/* Announcement bell modal styles */
#nav-announcement-modal {
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
}

#nav-announcement-modal:not(.hidden) {
  display: flex;
}

#nav-announcement-modal {
  padding-top: 12vh;
}

@media (max-width: 640px) {
  #nav-announcement-modal {
    padding-top: 12vh;
  }
}

#nav-announcement-backdrop {
  z-index: 0;
}

#nav-announcement-popup {
  z-index: 10;
  max-width: 40rem;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  animation: fadeInScale 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
  #nav-announcement-popup {
    max-width: 95vw;
  }
}

#nav-announcement-popup,
#nav-announcement-popup-mobile {
  min-width: 18rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  animation: fadeInScale 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

#nav-announcement-list {
  max-height: min(60vh, 32rem);
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

#nav-announcement-badge,
#nav-announcement-badge-mobile {
  min-width: 1.25em;
  min-height: 1.25em;
  font-size: 0.75em;
  line-height: 1.25em;
  text-align: center;
  pointer-events: none;
}

/* Go to Top Button Styles - Unified for all pages */
#go-to-top-button {
  position: fixed;
  width: 48px;
  height: 48px;
  background-color: rgba(79, 70, 229, 0.3);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-base);
  transition: var(--transition-base);
  opacity: 0;
  visibility: hidden;
  z-index: var(--z-go-to-top);

  /* Mobile-first: Default to bottom right */
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom));
}

#go-to-top-button:hover {
  background-color: rgba(79, 70, 229, 0.8);
  transform: scale(1.1);
}

#go-to-top-button.show {
  opacity: 1;
  visibility: visible;
}

@media (hover: none) and (pointer: coarse) {
  .nav-icon-btn::before {
    display: none;
  }
}

/* Desktop styles: Move to right-center, intelligently adapting to viewport width */
@media (min-width: 1024px) {
  #go-to-top-button {
    /* 
     * FINAL MODIFICATION: Use the min() function to create an adaptive position.
     * It chooses the smaller of two values:
     * 1. The ideal position: calc(50% + 40rem + 2rem) - Aligns with the main content on wide screens.
     * 2. The safe position: calc(100% - 5rem) - Prevents the button from ever going off the right edge of the screen.
     * (5rem = 3rem button width + 2rem right margin)
     */
    left: min(calc(50% + 40rem + 2rem), calc(100% - 5rem));

    /* Restore other desktop styles */
    right: auto;
    top: 85%;
    bottom: auto;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
  }

  #go-to-top-button:hover {
    /* Adjust hover transform to match the base positioning transform */
    transform: translateY(-50%) scale(1.1);
  }
}

.filter-chip {
  /* 确保内部元素可以正确对齐 */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* 元素间距 */
}

.chip-label {
  /* 标签文字 */
  font-weight: 500;
}

.count-badge {
  /* 基础徽章样式 */
  font-size: 0.75rem;
  font-weight: 600;
}

.count-inclusive {
  /* "包含" 计数的样式 */
  color: #555;
  /* 深灰色 */
}

.count-exclusive {
  /* "仅有" 计数的样式 */
  color: #059669;
  /* 绿色，表示精确 */
  cursor: pointer;
  /* 提示可以点击 */
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.count-exclusive:hover {
  background-color: #d1fae5;
  /* 悬停时浅绿色背景 */
}

/* 当整个芯片被“精确”激活时的样式 */
.filter-chip.exclusive-active {
  background-color: #ecfdf5;
  /* 浅绿色背景 */
  border-color: #10b981;
  /* 绿色边框 */
  color: #065f46;
  /* 深绿色文字 */
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  /* 外发光效果 */
}

/* 在精确激活状态下，高亮那个被点击的计数值 */
.filter-chip.exclusive-active .count-exclusive {
  background-color: #10b981;
  color: white;
}

/* --- Placeholder Switcher Animation --- */
/* This ensures the placeholder text transitions smoothly */
input::placeholder {
  transition: opacity 0.5s ease-in-out;
  opacity: 1;
}

/* This class is added via JS to trigger the fade-out effect */
input.placeholder-fade-out::placeholder {
  opacity: 0;
}

/* --- START: Docs Dropdown Button Styling (Final Version) --- */

/* --- 统一 Docs 按钮与其他导航链接的基础样式 --- */
.nav-dropdown-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  /* 关键：保持与 desktop-nav-link 完全一致的内边距 */
  padding: 0.25em 0.75em;
  border-radius: 0.375em;
  transition:
    color 0.2s,
    background 0.2s;
  color: #6b7280; /* gray-500，与普通链接默认颜色一致 */
  font-weight: 500; /* 与普通链接粗细一致 */
  font-size: 0.875rem; /* 14px，确保字号一致 */
  border: none;
  background-color: transparent;
  box-shadow: none; /* 移除原有的 box-shadow，因为它会让按钮看起来比文字大 */
  height: 100%; /* 确保高度填满 */
  line-height: 1.25rem; /* 统一行高 */
  cursor: pointer;
}

/* 箭头图标微调，防止撑大按钮 */
.nav-dropdown-button svg {
  margin-left: 4px;
  height: 16px;
  width: 16px;
  transition: transform 0.2s ease;
  color: inherit; /* 跟随文字颜色 */
  opacity: 0.7;
}

/* 悬浮样式 - 统一风格 */
.nav-dropdown-button:hover {
  color: rgb(128, 69, 229); /* 与主色调一致 */
  background: transparent;
}

/* 激活状态 (Docs页面时) - 统一风格 */
.nav-dropdown-button.nav-active,
.nav-dropdown-button[aria-expanded="true"] {
  color: var(--primary-color);
  font-weight: 600;
  background: rgba(55, 134, 199, 0.1); /* 浅色模式下的淡背景 */
}

.nav-dropdown-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* --- Dropdown Menu Items Styling (High-Visibility Final Version) --- */

/* 1. 子选项悬浮样式 (保持不变) */
#docs-menu a:hover {
  background-color: #f3f4f6;
  /* (gray-100) */
  color: var(--primary-color);
}

/* 2. 子选项激活样式 (关键的、高强度的修改) */
#docs-menu a.active-doc-link {
  /* A. 醒目的背景和文字 */
  background-color: rgba(79, 70, 229, 0.1) !important;
  color: var(--primary-color) !important;
  font-weight: 600;
  /* 加粗主标题 */

  /* B. 非常清晰的左侧指示边框 */
  border-left: 4px solid var(--primary-color);
  padding-left: calc(1rem - 4px);
  /* 调整内边距以适应加粗的边框 */
}

/* C. 将激活项内部的图标和描述文字也一并高亮 */
#docs-menu a.active-doc-link .fas,
#docs-menu a.active-doc-link .fab {
  color: var(--primary-color) !important;
  /* 图标变为主题色 */
}

#docs-menu a.active-doc-link span {
  color: var(--primary-color) !important;
  /* 描述文字也变为主题色 */
  opacity: 0.9;
}

/* 深色模式样式已移至 css/dark-mode.css */

/* --- END: Docs Dropdown Button Styling (Final Version) --- */
/* ===== Navigation Bar Icon Hover Effects ===== */

/* 1. Base container for icon buttons */
.nav-icon-btn {
  position: relative;
  /* Crucial for positioning pseudo-elements */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  /* A consistent, larger click area */
  color: #6b7280;
  /* Default icon color (gray-500) */
  border-radius: 6px;
  transition:
    color 0.2s ease-in-out,
    background-color 0.2s ease-in-out;
}

/* Dark Mode: Default icon color */
html.dark .nav-icon-btn {
  color: #9ca3af;
  /* gray-400 */
}

/* 2. Icon color and background change on hover/focus */
.nav-icon-btn:hover,
.nav-icon-btn:focus-visible {
  color: var(--primary-color);
  /* Change icon color to the theme's primary color */
  background-color: rgba(79, 70, 229, 0.1);
  /* Faint primary color background */
  outline: none;
  /* Remove default focus outline */
}

/* Dark Mode: Hover icon color and background */
html.dark .nav-icon-btn:hover,
html.dark .nav-icon-btn:focus-visible {
  color: #a5b4fc;
  /* indigo-300 */
  background-color: rgba(165, 180, 252, 0.1);
}

/* 3. Underline/Highlight bar (created with ::after) */
.nav-icon-btn::after {
  content: "";
  position: absolute;
  /* Positioned below the button, adjust 'bottom' as needed */
  bottom: -2px;
  left: 50%;
  width: 75%;
  /* Width of the underline relative to the button */
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;

  /* Animation: starts scaled to 0 width, grows from center */
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode: Underline color */
html.dark .nav-icon-btn::after {
  background-color: #a5b4fc;
  /* indigo-300 */
}

/* 4. Underline appears on hover/focus */
.nav-icon-btn:hover::after,
.nav-icon-btn:focus-visible::after {
  transform: translateX(-50%) scaleX(1);
}

/* 5. Custom Tooltip (created with ::before) */
.nav-icon-btn::before {
  content: attr(data-tooltip);
  /* Fetches text from the data-tooltip attribute */
  position: absolute;
  z-index: 10;

  /* Positioned below the underline */
  bottom: -36px;
  left: 50%;

  /* Style */
  background-color: #2d3748;
  /* Dark gray, almost black */
  color: #fff;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  /* Prevent tooltip text from wrapping */

  /* Animation: fades in */
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(5px);
  /* Start slightly lower */
  pointer-events: none;
  /* Tooltip shouldn't be interactive */
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transition-delay: 0.3s;
  /* Delay before appearing */
}

/* 6. Tooltip appears on hover/focus */
.nav-icon-btn:hover::before,
.nav-icon-btn:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.info-tooltip-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ca3af;
  cursor: help;
  line-height: 1;
  vertical-align: middle;
}

.info-tooltip-btn:hover,
.info-tooltip-btn:focus,
.info-tooltip-btn:focus-visible {
  color: var(--primary-color);
  outline: none;
}

html.dark .info-tooltip-btn {
  color: rgba(203, 213, 225, 0.85);
}

html.dark .info-tooltip-btn:hover,
html.dark .info-tooltip-btn:focus,
html.dark .info-tooltip-btn:focus-visible {
  color: #a5b4fc;
}

.info-tooltip-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  z-index: var(--z-index-tooltip);
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  max-width: 260px;
  min-width: 180px;
  white-space: normal;
  text-align: left;
  background-color: #111827;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

.info-tooltip-btn::after {
  content: "";
  position: absolute;
  z-index: var(--z-index-tooltip);
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #111827 transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.info-tooltip-btn:hover::before,
.info-tooltip-btn:focus::before,
.info-tooltip-btn:focus-visible::before,
.info-tooltip-btn:hover::after,
.info-tooltip-btn:focus::after,
.info-tooltip-btn:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.info-tooltip-btn:hover::before,
.info-tooltip-btn:focus::before,
.info-tooltip-btn:focus-visible::before {
  transform: translateX(-50%) translateY(0);
}

/* ============================================= */
/* ===== START: 灯箱图片尺寸问题修复 ===== */
/* ============================================= */

/* 
 * 选取灯箱弹窗内的图片元素 
 */
#lightbox-image {
  /* 
   * 核心规则：
   * 设置图片的最大宽度为视口（屏幕可见区域）宽度的 90%。
   * 这样可以保证图片两侧总有至少 10% 的留白，不会紧贴屏幕边缘。
  */
  max-width: 90vw;

  /* 
   * 核心规则：
   * 设置图片的最大高度为视口（屏幕可见区域）高度的 90%。
   * 这样可以保证图片顶部和底部也有舒适的留白。
  */
  max-height: 85vh;

  /* 
   * 确保图片在自己的“盒子”里完整显示，这有助于处理各种比例。
   * 这是一个很好的保险措施。
  */
  object-fit: contain;

  /* 
   * (可选，但强烈推荐) 添加过渡效果。
   * 这会让你在缩放图片或切换图片时，尺寸变化变得平滑，而不是生硬地跳变。
  */
  transition: transform 0.3s ease;
}

/* ============================================= */
/* ===== END: 灯箱图片尺寸问题修复 ===== */
/* ============================================= */
/* ============================================= */
/* ===== 新增：分页控件样式 (含深色模式) ===== */
/* ============================================= */

/* --- 页码输入框 --- */
#page-input {
  /* 基础样式 */
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  /* Tailwind gray-300 */
  color: #374151;
  /* Tailwind gray-700 */
  border-radius: 0.375rem;
  /* Tailwind rounded-md */
  padding: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition:
    border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
}

/* --- 页码输入框 交互样式 (聚焦) --- */
#page-input:focus {
  outline: none;
  border-color: #6366f1;
  /* Tailwind indigo-500 */
  /* 模拟 Tailwind 的 ring 效果 */
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* --- 深色模式：页码输入框 --- */
html.dark #page-input {
  background-color: #374151;
  /* Tailwind gray-700 */
  border-color: #4b5563;
  /* Tailwind gray-600 */
  color: #d1d5db;
  /* Tailwind gray-300 */

  /* 这是一个关键属性，它会告诉浏览器
     输入框的内部（包括上下箭头）应该使用深色主题，
     这会自动将箭头变为白色。*/
  color-scheme: dark;
}

/* --- 深色模式：页码输入框 交互样式 (聚焦) --- */
html.dark #page-input:focus {
  border-color: #818cf8;
  /* Tailwind indigo-400 */
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.4);
}

/* --- 分页按钮 (First, Previous, Next, Last) --- */
/* 
  按钮已经使用了 Tailwind 类，这里只添加深色模式的样式。
  我们通过选择器选取所有这些按钮。
*/
#first-page-btn,
#prev-page-btn,
#next-page-btn,
#last-page-btn {
  /* 默认禁用状态下的样式 */
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s;
}

/* --- 深色模式：分页按钮 --- */
html.dark #first-page-btn,
html.dark #prev-page-btn,
html.dark #next-page-btn,
html.dark #last-page-btn {
  background-color: #374151;
  /* Tailwind gray-700 */
  border-color: #4b5563;
  /* Tailwind gray-600 */
  color: #d1d5db;
  /* Tailwind gray-300 */
}

/* --- 深色模式：分页按钮 悬浮样式 --- */
html.dark #first-page-btn:hover:not(:disabled),
html.dark #prev-page-btn:hover:not(:disabled),
html.dark #next-page-btn:hover:not(:disabled),
html.dark #last-page-btn:hover:not(:disabled) {
  background-color: #4b5563;
  /* Tailwind gray-600 */
}

/* --- 深色模式：分页按钮 禁用样式 --- */
html.dark #first-page-btn:disabled,
html.dark #prev-page-btn:disabled,
html.dark #next-page-btn:disabled,
html.dark #last-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- 周围的文本 (Showing, Page, of) --- */
/* 
  这些文本使用了 text-gray-700 类，我们为它添加深色模式的对应样式。
  这样可以确保所有地方的这类文本在深色模式下都正确显示。
*/
html.dark .text-gray-700 {
  color: #d1d5db;
  /* Tailwind gray-300 */
}

/* ========================================================== */
/* ===== 卡片内 'View Details' 下拉菜单 (最终修复版 v2) ===== */
/* ========================================================== */

.card {
  overflow: visible !important;
}

.details-dropdown {
  position: relative;
  display: inline-block;
}

.details-dropdown-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s ease;
}

.details-dropdown-toggle:hover {
  color: #6366f1;
}

.details-dropdown-toggle i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.details-dropdown-toggle.open i {
  transform: rotate(180deg);
}

.details-dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 100;
  background-color: white;
  border-radius: 0.375rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
  width: 100%;
  min-width: 250px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s 0.2s;
}

.details-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s;
}

/* --- 菜单项<a>标签的样式 --- */
.details-dropdown-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #374151;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
  text-decoration: none;

  /* 关键：<a>标签只负责定位，不再截断文本 */
  position: relative;
}

.details-dropdown-menu a:hover {
  background-color: #f3f4f6;
  color: #111827;
}

/* --- 新增：内部<span>的样式，它负责截断文本 --- */
.details-link-text {
  display: block;
  /* 确保它表现得像一个块级元素 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 悬停提示 Tooltip (样式不变，但现在可以正常工作了) --- */
.details-dropdown-menu a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1f2937;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
  transition-delay: 0.4s;
  margin-bottom: 8px;
}

.details-dropdown-menu a::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
  transition-delay: 0.4s;
  margin-bottom: -2px;
}

.details-dropdown-menu a:hover::after,
.details-dropdown-menu a:hover::before {
  opacity: 1;
  visibility: visible;
}

/* --- 深色模式 (样式不变) --- */
html.dark .details-dropdown-menu {
  background-color: #374151;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 2px 4px -2px rgba(0, 0, 0, 0.4);
}

html.dark .details-dropdown-menu a {
  color: #d1d5db;
}

html.dark .details-dropdown-menu a:hover {
  background-color: #4b5563;
  color: #ffffff;
}

html.dark .details-dropdown-menu a::after {
  background-color: #e5e7eb;
  color: #1f2937;
}

html.dark .details-dropdown-menu a::before {
  border-top-color: #e5e7eb;
}

/* ========================================================== */
/* ===== 卡片图片布局最终解决方案 (适应所有比例) ===== */
/* ========================================================== */

.card .card-image-container {
  /* 1. 保持容器有固定的高度，确保所有卡片顶部对齐 */
  /* (这个高度值在 style_methods.css 或 style_datasets.css 中定义，例如 height: 150px) */

  /* 2. 为容器设置一个背景色，用于填充图片未覆盖的区域 */
  background-color: #f9fafb;
  /* Tailwind gray-50 */

  /* 3. 使用 Flexbox 将内部的图片垂直和水平居中 */
  display: flex;
  justify-content: center;
  align-items: center;

  /* 4. 确保图片不会溢出容器的圆角 */
  overflow: hidden;
}

.card .card-image-container img {
  display: block;

  /* 5. 核心修复：设置图片的最大尺寸，而不是固定尺寸 */
  max-width: 100%;
  max-height: 100%;

  /* 
   * 6. 使用 object-fit: contain;
   * 这会确保图片在保持自身宽高比的前提下，完整地缩放以适应容器。
   * 它不会被裁剪，也不会被拉伸。
  */
  object-fit: contain;

  /* 7. 移除之前可能添加的固定宽高，让 max-width/height 和 object-fit 生效 */
  width: auto;
  height: auto;
}

/* --- 深色模式下的背景色 --- */
html.dark .card .card-image-container {
  background-color: #1f2937;
  /* Tailwind gray-800 */
}

/* ===== STYLES FOR SINGLE-VIEW & CAROUSEL LAYOUT ===== */

/* Chapter Content "Stage" */
.chapter-content {
  display: none;
  /* Hide all chapters by default */
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.chapter-content.active {
  display: block;
  /* Show the active chapter */
  opacity: 1;
}

/* Carousel Container */
.carousel-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 2rem;
}

html.dark .carousel-container {
  border-color: #374151;
  background: #1f2937;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1rem;
  /* Internal padding for content */
}

/* Carousel Buttons */
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid #d1d5db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 20px;
  z-index: 10;
}

.carousel-button:hover {
  background-color: white;
}

.carousel-button.prev {
  left: -50px;
}

/* Position outside the container for a cleaner look */
.carousel-button.next {
  right: -50px;
}

.carousel-button:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

/* Carousel Navigation Dots */
.carousel-nav {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.carousel-indicator {
  border: none;
  background: #d1d5db;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carousel-indicator.active {
  background: #4f46e5;
}
/* =========================================
   3.1版 Hero Section (修复版：灵动流体 + 完美过渡)
   ========================================= */

/* 1. 基础容器：背景色优化 */
.hero-section {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  background-color: #ffffff;
  padding-bottom: 3rem;
  transition: background-color 0.3s ease;
}
/* 添加一个伪元素来制作渐变遮罩 */
.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px; /* 控制渐变的高度，越高越柔和 */

  /* 浅色模式：从透明渐变到纯白 */
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 1) 100%
  );

  /* 防止遮挡下方的交互（如果有按钮在边缘的话） */
  pointer-events: none;
  z-index: -1; /* 放在内容之下，但在背景 Blob 之上 */
}
/* 深色模式适配 */
html.dark .hero-section::after {
  /* 这里的颜色 #111827 需要和你深色模式的网页背景色一致 (bg-gray-900) */
  background: linear-gradient(to bottom, rgba(17, 24, 39, 0) 0%, #111827 100%);
}

/* =========================================
   3.2版 Hero Blob (大尺寸填充版 - 消除空隙)
   ========================================= */

/* 1. 基础 Blob 设置：增加模糊度以适应更大尺寸 */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.7;
  animation: blob-bounce 15s infinite ease-in-out;
  z-index: 0;
  transition:
    background-color 0.3s ease,
    opacity 0.3s ease;
  will-change: transform, opacity;
}

.hero-section.paused-animation .hero-blob {
  animation-play-state: paused;
}

/* 2. 浅色模式：大幅增加尺寸和重叠度 */
.blob-1 {
  /* 左上 -> 覆盖左侧大半区域 */
  top: -30%;
  left: -20%;
  width: 800px;
  height: 800px;
  background: #ccfbf1; /* Teal-100 */
  animation-delay: 0s;
}

.blob-2 {
  /* 右上 -> 覆盖右侧大半区域 */
  top: -30%;
  right: -20%;
  width: 720px;
  height: 720px;
  background: #e0e7ff; /* Indigo-100 */
  animation-delay: 2s;
}

.blob-3 {
  /* 底部 -> 托底，填补中间下方的空隙 */
  bottom: -40%;
  left: 10%; /* 居中偏左 */
  width: 900px;
  height: 680px;
  background: #ffe4e6; /* Rose-100 */
  opacity: 0.5;
  animation-delay: 4s;
}

.hero-section.hero-variant-home .blob-1 {
  top: -34%;
  left: -8%;
  width: 860px;
  height: 860px;
}
.hero-section.hero-variant-home .blob-2 {
  top: -28%;
  right: -14%;
  width: 780px;
  height: 780px;
}
.hero-section.hero-variant-home .blob-3 {
  bottom: -44%;
  left: 28%;
  width: 980px;
  height: 720px;
}

.hero-section.hero-variant-datasets .blob-1 {
  top: -26%;
  left: 2%;
  width: 760px;
  height: 760px;
  background: #ccfbf1;
}
.hero-section.hero-variant-datasets .blob-2 {
  top: -40%;
  right: -6%;
  width: 820px;
  height: 820px;
  background: #e0e7ff;
}
.hero-section.hero-variant-datasets .blob-3 {
  bottom: -46%;
  left: 12%;
  width: 980px;
  height: 720px;
  background: #cffafe;
}

.hero-section.hero-variant-methods .blob-1 {
  top: -38%;
  left: -16%;
  width: 900px;
  height: 900px;
  background: #ede9fe;
}
.hero-section.hero-variant-methods .blob-2 {
  top: -24%;
  right: 6%;
  width: 700px;
  height: 700px;
  background: #fce7f3;
}
.hero-section.hero-variant-methods .blob-3 {
  bottom: -42%;
  left: 34%;
  width: 980px;
  height: 720px;
  background: #ffedd5;
}

.hero-section.hero-variant-benchmarks .blob-1 {
  top: -34%;
  left: -2%;
  width: 860px;
  height: 860px;
  background: #dbeafe;
}
.hero-section.hero-variant-benchmarks .blob-2 {
  top: -36%;
  right: -2%;
  width: 860px;
  height: 860px;
  background: #cffafe;
}
.hero-section.hero-variant-benchmarks .blob-3 {
  bottom: -40%;
  left: 18%;
  width: 980px;
  height: 720px;
  background: #fef3c7;
}

.hero-section.hero-variant-docs .hero-blob {
  opacity: 0.6;
}
.hero-section.hero-variant-docs .blob-1 {
  top: -20%;
  left: 20%;
  width: 820px;
  height: 820px;
  background: #ffe4e6;
}
.hero-section.hero-variant-docs .blob-2 {
  bottom: -20%;
  right: 20%;
  width: 820px;
  height: 820px;
  background: #ccfbf1;
}

html.dark .hero-section.hero-variant-home::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    780px circle at 34% 36%,
    rgba(15, 23, 42, 0.7),
    rgba(15, 23, 42, 0) 70%
  );
}

html.dark .hero-section.hero-variant-home .hero-noise {
  opacity: 0.02;
}

html.dark .hero-section.hero-variant-home .hero-badge {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(99, 102, 241, 0.45);
  color: #e2e8f0;
}

html.dark .hero-section.hero-variant-home .hero-secondary-btn {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
}

html.dark .hero-section.hero-variant-datasets::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(
      700px circle at 16% 24%,
      rgba(20, 184, 166, 0.28),
      rgba(20, 184, 166, 0) 65%
    ),
    radial-gradient(
      760px circle at 86% 20%,
      rgba(99, 102, 241, 0.26),
      rgba(99, 102, 241, 0) 65%
    ),
    radial-gradient(
      900px circle at 55% 92%,
      rgba(56, 189, 248, 0.16),
      rgba(56, 189, 248, 0) 70%
    );
}

html.dark .hero-section.hero-variant-datasets .hero-noise {
  opacity: 0.02;
}

html.dark .hero-section.hero-variant-datasets .blob-1 {
  background: #0f766e;
  opacity: 0.34;
}
html.dark .hero-section.hero-variant-datasets .blob-2 {
  background: #3730a3;
  opacity: 0.32;
}
html.dark .hero-section.hero-variant-datasets .blob-3 {
  background: #0284c7;
  opacity: 0.18;
}

html.dark .hero-section.hero-variant-datasets .hero-glass-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.55);
}

html.dark .hero-section.hero-variant-methods .blob-1 {
  background: #5b21b6;
}
html.dark .hero-section.hero-variant-methods .blob-2 {
  background: #9d174d;
}
html.dark .hero-section.hero-variant-methods .blob-3 {
  background: #9a3412;
  opacity: 0.22;
}

html.dark .hero-section.hero-variant-benchmarks .blob-1 {
  background: #1d4ed8;
}
html.dark .hero-section.hero-variant-benchmarks .blob-2 {
  background: #0e7490;
}
html.dark .hero-section.hero-variant-benchmarks .blob-3 {
  background: #b45309;
  opacity: 0.2;
}

html.dark .hero-section.hero-variant-docs .blob-1 {
  background: #9f1239;
  opacity: 0.28;
}
html.dark .hero-section.hero-variant-docs .blob-2 {
  background: #0f766e;
  opacity: 0.32;
}

/* 3. 深色模式：对应调整，保持深邃但有色彩 */
html.dark .hero-blob {
  opacity: 0.45;
}

html.dark .blob-1 {
  background: #0f766e; /* Teal-700 (更深一点) */
}
html.dark .blob-2 {
  background: #3730a3; /* Indigo-800 */
}
html.dark .blob-3 {
  background: #9f1239; /* Rose-800 */
  opacity: 0.25;
}

/* 4. 动画微调：增加移动幅度，填补动态空隙 */

/* 3. 噪点优化 (大幅降低透明度) */
.hero-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
}

/* 4. 玻璃卡片 (增强对比度) */
.hero-glass-card {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 100%;
  will-change: transform;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* 深色：适配 dark-mode.css 的色调 */
html.dark .hero-glass-card {
  background: rgba(30, 41, 59, 0.4); /* Slate-800 变种 */
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.hero-glass-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.4); /* Indigo highlight */
  box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.15);
}

html.dark .hero-glass-card:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.5);
}

/* 卡片文字颜色 */
.card-title {
  color: #0f172a;
  font-weight: 700;
  transition: color 0.3s ease;
}
.card-desc {
  color: #475569;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

html.dark .card-title {
  color: #f1f5f9;
}
html.dark .card-desc {
  color: #94a3b8;
}

/* 1. 基础容器：背景色优化 + 底部边框 */
.hero-section {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: #ffffff;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
  border-bottom: 1px solid transparent;
}

/* 深色模式：增加底部微光边框，解决去掉波浪线后的生硬感 */
html.dark .hero-section {
  background-color: #0f172a; /* Slate-900 */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); /* 5%透明度的白线 */
}
/* =========================================
   Hero Entrance Animations (错峰入场)
   ========================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px); /* 从下方20px处开始 */
  }
  to {
    opacity: 1;
    transform: translateY(0); /* 回到原位 */
  }
}

.animate-enter {
  opacity: 0; /* 初始状态必须隐藏，防止闪烁 */
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; /* 使用优雅的贝塞尔曲线 */
}

/* 延迟控制类 */
.enter-delay-100 {
  animation-delay: 0.1s;
}
.enter-delay-200 {
  animation-delay: 0.2s;
}
.enter-delay-300 {
  animation-delay: 0.3s;
}
.enter-delay-400 {
  animation-delay: 0.4s;
}
.enter-delay-500 {
  animation-delay: 0.5s;
}
.enter-delay-600 {
  animation-delay: 0.6s;
}

/* 减少动态模式适配 (无障碍) */
@media (prefers-reduced-motion: reduce) {
  .animate-enter {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .hero-blob {
    animation: none;
  }
}

.feedback-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.18);
  color: #111827;
  box-shadow: var(--shadow-base);
  cursor: pointer;
  z-index: 1030;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

html.dark .feedback-fab {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.4);
  color: #e5e7eb;
}

.feedback-fab:hover {
  background: rgba(79, 70, 229, 0.45);
  transform: scale(1.06);
}

html.dark .feedback-fab:hover {
  background: rgba(99, 102, 241, 0.45);
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-index-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.feedback-modal.hidden {
  display: none;
}

.feedback-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.feedback-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  background: #ffffff;
  color: #111827;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  padding: 16px;
}

html.dark .feedback-panel {
  background: #111827;
  color: #e5e7eb;
  border-color: rgba(229, 231, 235, 0.12);
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

html.dark .feedback-header {
  border-bottom-color: rgba(229, 231, 235, 0.12);
}

.feedback-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.feedback-close {
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
}

html.dark .feedback-close {
  border-color: rgba(229, 231, 235, 0.16);
}

.feedback-close:hover {
  background: rgba(17, 24, 39, 0.06);
}

html.dark .feedback-close:hover {
  background: rgba(229, 231, 235, 0.08);
}

.feedback-form {
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.feedback-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feedback-row input,
.feedback-row select,
.feedback-row textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #ffffff;
  color: inherit;
  padding: 10px 12px;
  outline: none;
  transition: var(--transition-base);
}

html.dark .feedback-row input,
html.dark .feedback-row select,
html.dark .feedback-row textarea {
  border-color: rgba(229, 231, 235, 0.16);
  background: rgba(17, 24, 39, 0.5);
}

.feedback-row textarea {
  min-height: 110px;
  resize: vertical;
}

.feedback-row input:focus,
.feedback-row select:focus,
.feedback-row textarea:focus {
  border-color: rgba(79, 70, 229, 0.65);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.feedback-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feedback-star {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: transparent;
  cursor: pointer;
  transition: var(--transition-base);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(17, 24, 39, 0.55);
}

html.dark .feedback-star {
  border-color: rgba(229, 231, 235, 0.16);
  color: rgba(229, 231, 235, 0.55);
}

.feedback-star.is-active {
  color: rgba(245, 158, 11, 1);
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.12);
}

.feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  padding-top: 6px;
}

.feedback-status {
  font-size: 0.9rem;
  line-height: 1.3;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(17, 24, 39, 0.04);
}

html.dark .feedback-status {
  border-color: rgba(229, 231, 235, 0.12);
  background: rgba(229, 231, 235, 0.06);
}

.feedback-status.is-error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.feedback-status.is-success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

html.feedback-pick-active,
html.feedback-pick-active body {
  cursor: crosshair;
}

.feedback-pick-highlight {
  outline: 3px solid rgba(79, 70, 229, 0.95) !important;
  outline-offset: 2px !important;
}

html.dark .feedback-pick-highlight {
  outline-color: rgba(99, 102, 241, 0.95) !important;
}

.feedback-location-box {
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(17, 24, 39, 0.03);
  display: grid;
  gap: 6px;
}

html.dark .feedback-location-box {
  border-color: rgba(229, 231, 235, 0.14);
  background: rgba(229, 231, 235, 0.06);
}

.feedback-location-meta {
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.7);
  word-break: break-word;
}

html.dark .feedback-location-meta {
  color: rgba(229, 231, 235, 0.7);
}

.feedback-location-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.feedback-picker-hint {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(720px, calc(100vw - 32px));
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

html.dark .feedback-picker-hint {
  background: rgba(17, 24, 39, 0.96);
  border-color: rgba(99, 102, 241, 0.4);
}

.feedback-picker-hint.hidden {
  display: none;
}

.feedback-picker-text {
  font-size: 0.95rem;
  line-height: 1.35;
}

.feedback-picker-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.feedback-pick-overlay {
  position: fixed;
  inset: 0;
  z-index: 1999;
  pointer-events: none;
}

.feedback-pick-overlay.hidden {
  display: none;
}

.feedback-pick-box {
  position: fixed;
  border: 3px solid rgba(79, 70, 229, 0.95);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.18);
}

html.dark .feedback-pick-box {
  border-color: rgba(99, 102, 241, 0.95);
  box-shadow: 0 0 0 9999px rgba(2, 6, 23, 0.35);
}

.feedback-pick-label {
  position: fixed;
  max-width: min(680px, calc(100vw - 32px));
  border-radius: 12px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(255, 255, 255, 0.98);
  color: #111827;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.3;
  word-break: break-word;
}

html.dark .feedback-pick-label {
  background: rgba(17, 24, 39, 0.98);
  color: #e5e7eb;
  border-color: rgba(99, 102, 241, 0.4);
}
