* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg-color: #fafafa;
  --card-bg: #ffffff;
  --text-color: #18181b;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --border-color: #e4e4e7;
  --border-light: #f4f4f5;
  --primary-color: #6d5df0;
  --primary-hover: #5b4cdb;
  --primary-light: #f3f0ff;
  --success-color: #dc2626;
  --success-light: #fef2f2;
  --warning-color: #f59e0b;
  --danger-color: #10b981;
  --danger-light: #ecfdf5;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-hover:
    0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --card-radius: 12px;
  --card-radius-sm: 8px;
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="dark"] {
  --bg-color: #09090b;
  --card-bg: #18181b;
  --text-color: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border-color: #27272a;
  --border-light: #1f1f23;
  --primary-color: #a78bfa;
  --primary-hover: #8b74e8;
  --primary-light: #1e1b4b;
  --success-color: #f87171;
  --success-light: #450a0a;
  --warning-color: #fbbf24;
  --danger-color: #34d399;
  --danger-light: #064e3b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-hover:
    0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
}
html {
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}
body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
  min-height: 100vh;
}
.header {
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 50%, #a78bfa 100%);
  color: white;
  padding: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}
.header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
}
.header .subtitle {
  font-size: 16px;
  opacity: 0.9;
  position: relative;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}
.search-bar {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base);
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-color);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.date-picker {
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-color);
  transition: border-color 0.15s ease;
}
.theme-toggle {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.theme-toggle:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(109, 93, 240, 0.3);
}
.theme-toggle:active {
  transform: translateY(0) scale(0.97);
}
/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
  background-size: 200% 100%;
}
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
/* Global loading overlay */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  backdrop-filter: blur(2px);
}
.global-loading.active {
  opacity: 1;
  visibility: visible;
}
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-text {
  color: white;
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
}
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.date-range-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range-separator {
  color: var(--text-secondary);
  font-size: 13px;
}
.search-bar .date-picker {
  min-width: 130px;
}
/* ============================================
           移动端优化 - 阶段3
           ============================================ */

/* ---- 断点变量与工具 ---- */
:root {
  --mobile-nav-height: 56px;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
           PWA 完善 - 阶段5
           ============================================ */

/* ---- HTML Splash Screen ---- */
#app-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 50%, #a78bfa 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}
#app-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash-logo {
  width: 96px;
  height: 96px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 24px;
  animation: splash-pulse 2s ease-in-out infinite;
}
@keyframes splash-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}
.splash-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.splash-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}
.splash-loader {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 32px;
}

/* ---- 离线状态提示条 ---- */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  background: var(--warning-color);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.offline-bar.visible {
  transform: translateY(0);
}
.offline-bar.online {
  background: var(--success-color);
}
.offline-bar .offline-icon {
  font-size: 14px;
}
.offline-bar .offline-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.7;
  padding: 2px 6px;
}
.offline-bar .offline-close:hover {
  opacity: 1;
}

/* ---- PWA 安装引导 ---- */
.pwa-install-toast {
  position: fixed;
  bottom: 72px;
  bottom: calc(
    var(--mobile-nav-height, 56px) + 16px + var(--safe-area-bottom, 0px)
  );
  left: 16px;
  right: 16px;
  z-index: 99999;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  will-change: transform, opacity;
}
.pwa-install-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.pwa-install-toast .pwa-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 50%, #a78bfa 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.pwa-install-toast .pwa-content {
  flex: 1;
  min-width: 0;
}
.pwa-install-toast .pwa-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 2px;
}
.pwa-install-toast .pwa-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.pwa-install-toast .pwa-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-install-toast .pwa-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.pwa-install-toast .pwa-btn-install {
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 50%, #a78bfa 100%);
  color: white;
}
.pwa-install-toast .pwa-btn-install:hover {
  opacity: 0.9;
}
.pwa-install-toast .pwa-btn-dismiss {
  background: transparent;
  color: var(--text-secondary);
}
.pwa-install-toast .pwa-btn-dismiss:hover {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ---- SW 更新提示 ---- */
.sw-update-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 99996;
  background: var(--card-bg);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.sw-update-toast.visible {
  transform: translateX(0);
}
.sw-update-toast .sw-icon {
  font-size: 20px;
}
.sw-update-toast .sw-content {
  flex: 1;
}
.sw-update-toast .sw-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
}
.sw-update-toast .sw-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.sw-update-toast .sw-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--primary-color);
  color: white;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .pwa-install-toast {
    left: auto;
    right: 24px;
    width: 380px;
    bottom: 24px;
  }
  .sw-update-toast {
    top: 24px;
    right: 24px;
  }
}

/* PWA standalone 模式微调 */
body.pwa-standalone .header {
  padding-top: env(safe-area-inset-top, 40px);
}
body.pwa-standalone .offline-bar.visible {
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}
.sort-toggle-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.sort-toggle-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ---- Tooltip 参数提示 ---- */
.stat-item,
.main-theme {
  position: relative;
  cursor: help;
}
.stat-item .tooltip-text,
.main-theme .tooltip-text {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  transform-origin: bottom center;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  text-align: center;
  max-width: 220px;
  width: max-content;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 10;
}
.stat-item .tooltip-text::after,
.main-theme .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: var(--border-color) transparent transparent transparent;
}
.stat-item:hover .tooltip-text,
.stat-item.tooltip-active .tooltip-text,
.main-theme:hover .tooltip-text,
.main-theme.tooltip-active .tooltip-text {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}
@media (max-width: 480px) {
  .stat-item .tooltip-text,
  .main-theme .tooltip-text {
    max-width: 180px;
    font-size: 11px;
    padding: 6px 10px;
  }
}
/* ---- Report Detail Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
  padding: 20px;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-container {
  background: var(--card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.modal-overlay.active .modal-container {
  transform: translateY(0) scale(1);
}
.modal-header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.4;
  flex: 1;
}
.modal-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.modal-close {
  background: var(--bg-color);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.modal-close:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}
.modal-body {
  padding: 20px 24px 24px;
}
.modal-section {
  margin-bottom: 20px;
}
.modal-section:last-child {
  margin-bottom: 0;
}
.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.modal-summary {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  padding: 16px;
  border-radius: 12px;
  border-left: 3px solid var(--primary-color);
}
.modal-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-stat {
  background: var(--bg-color);
  padding: 12px 16px;
  border-radius: 10px;
  text-align: center;
  min-width: 90px;
  flex: 1;
}
.modal-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
}
.modal-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.modal-theme {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
  background: var(--bg-color);
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid #f59e0b;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-tag {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}
.modal-market {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.modal-market-item {
  background: var(--bg-color);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.modal-market-label {
  color: var(--text-secondary);
  font-size: 11px;
}
.modal-market-value {
  font-weight: 600;
  margin-top: 2px;
}
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-container {
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }
  .modal-header {
    padding: 20px 20px 0;
  }
  .modal-body {
    padding: 16px 20px 24px;
  }
  .modal-stat-value {
    font-size: 18px;
  }
}

/* ─── Report Detail Page ─── */
.detail-page {
  min-height: 100vh;
  background: var(--bg-color);
  padding-bottom: calc(var(--mobile-nav-height, 56px) + 20px);
}
.detail-header {
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 50%, #a78bfa 100%);
  color: white;
  padding: 20px 0 30px;
  position: relative;
  overflow: hidden;
}
.detail-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
}
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
  position: relative;
  backdrop-filter: blur(4px);
}
.detail-back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-2px);
}
.detail-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  position: relative;
  word-break: break-word;
}
.detail-meta {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 8px;
  position: relative;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.detail-body {
  max-width: 960px;
  margin: -20px auto 0;
  padding: 0 20px 40px;
  position: relative;
  z-index: 2;
}
.detail-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 20px;
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base);
}
.detail-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Market Data */
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.market-item {
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  padding: 16px;
  text-align: center;
  transition: background-color var(--transition-base);
}
.market-item-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.market-item-value {
  font-size: 22px;
  font-weight: 700;
  font-family: "SF Mono", "Menlo", monospace;
  letter-spacing: -0.5px;
}
.market-item-change {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}
.market-item-change.up {
  color: var(--success-color);
}
.market-item-change.down {
  color: var(--danger-color);
}
/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.stats-item {
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  padding: 16px;
  text-align: center;
  transition: background-color var(--transition-base);
}
.stats-item-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  font-family: "SF Mono", "Menlo", monospace;
}
.stats-item-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
/* Theme Tags */
.theme-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.theme-tag {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color var(--transition-base),
    color var(--transition-base);
}
.theme-tag.primary {
  background: linear-gradient(135deg, #5b4cdb 0%, #7c5cf0 100%);
  color: white;
}
/* Summary */
.detail-summary {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-color);
  white-space: pre-line;
}
/* Themes Distribution */
.themes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  transition: background-color var(--transition-base);
}
.theme-row-name {
  font-weight: 600;
  font-size: 14px;
  min-width: 100px;
  flex-shrink: 0;
}
.theme-row-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.theme-row-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #5b4cdb, #a78bfa);
  transition: width 0.6s ease;
  min-width: 4px;
}
.theme-row-count {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 60px;
  text-align: right;
  flex-shrink: 0;
  font-family: "SF Mono", "Menlo", monospace;
}
/* Stock Table */
.stock-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--card-radius-sm);
  border: 1px solid var(--border-color);
}
.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 500px;
}
.stock-table th {
  background: var(--bg-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
  transition: background-color var(--transition-base);
}
.stock-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  color: var(--text-color);
  transition:
    border-color var(--transition-base),
    color var(--transition-base);
}
.stock-table tr:hover td {
  background: var(--bg-color);
}
.stock-code {
  font-family: "SF Mono", "Menlo", monospace;
  font-weight: 600;
  color: var(--primary-color);
}
.stock-name {
  font-weight: 500;
}
.stock-concept {
  font-size: 12px;
  color: var(--text-secondary);
}
.stock-lb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success-light);
  color: var(--success-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
/* Loading & Error */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
}
.detail-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
  padding: 20px;
}
.detail-error h3 {
  font-size: 20px;
  color: var(--text-color);
}
.detail-error p {
  color: var(--text-secondary);
  font-size: 14px;
}
.detail-error button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.detail-error button:hover {
  background: var(--primary-hover);
}
/* Seal Rate Detail */
.seal-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.seal-detail-item {
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  transition: background-color var(--transition-base);
}
.seal-detail-label {
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 2px;
}
.seal-detail-value {
  font-weight: 600;
  color: var(--text-color);
}

/* ─── Candidates Section ─── */
.candidates-section {
  margin-top: 8px;
}
.candidate-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-color);
  margin: 16px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.candidate-group-title:first-child {
  margin-top: 0;
}
.candidate-group-title .group-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.candidate-group-title .badge-formal {
  background: var(--primary-light);
  color: var(--primary-color);
}
.candidate-group-title .badge-watch {
  background: var(--success-light);
  color: var(--success-color);
}
.candidate-group-title .badge-signal {
  background: var(--border-light);
  color: var(--text-secondary);
}
.candidate-table-wrap {
  overflow-x: auto;
}
.candidate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.candidate-table th {
  background: var(--bg-color);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.candidate-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.candidate-table tr:hover td {
  background: var(--bg-color);
}
.candidate-rank {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 14px;
}
.candidate-stars {
  color: #f59e0b;
  font-size: 13px;
  letter-spacing: 1px;
}
.candidate-price {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 13px;
}
.candidate-change {
  font-family: "SF Mono", Monaco, monospace;
  font-weight: 600;
}
.candidate-change.up {
  color: var(--success-color);
}
.candidate-change.down {
  color: var(--danger-color);
}
.candidate-lb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--success-light);
  color: var(--success-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.candidate-catalyst {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.candidate-seal {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: "SF Mono", Monaco, monospace;
}
.candidate-net {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  font-weight: 600;
}
.candidate-net.up {
  color: var(--success-color);
}
.candidate-net.down {
  color: var(--danger-color);
}
.candidate-track-score {
  font-size: 11px;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.candidate-track-details {
  font-size: 11px;
  color: var(--text-tertiary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.candidate-comment {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

/* ─── Tooltip for overflow text ─── */
[title] {
  cursor: help;
}

/* ─── Global Tooltip ─── */
.global-tooltip {
  position: fixed;
  z-index: 99999;
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 280px;
  word-break: break-word;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0.95;
}

/* ─── Candidate track pending ─── */
.candidate-track-pending {
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-color);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: help;
}

/* ─── Comment click cursor ─── */
.candidate-comment {
  cursor: pointer;
}

/* ─── Logic expand button ─── */
.logic-expand-btn {
  text-align: center;
  padding: 10px;
  color: var(--primary-color);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
  border-radius: var(--card-radius-sm);
  transition: background-color var(--transition-base);
}
.logic-expand-btn:hover {
  background: var(--primary-light);
}

/* ─── Sectors Table ─── */
.sectors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sectors-table th {
  background: var(--bg-color);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 12px;
  padding: 8px 10px;
  text-align: left;
}
.sectors-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
}
.sectors-table tr:hover td {
  background: var(--bg-color);
}
.sector-change {
  font-family: "SF Mono", Monaco, monospace;
  font-weight: 600;
}
.sector-change.up {
  color: var(--success-color);
}
.sector-change.down {
  color: var(--danger-color);
}
.sector-net {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 13px;
  font-weight: 600;
}
.sector-net.up {
  color: var(--success-color);
}
.sector-net.down {
  color: var(--danger-color);
}

/* ─── Verification ─── */
.verification-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.verify-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  transition: background-color var(--transition-base);
}
.verify-status {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.verify-body {
  flex: 1;
  min-width: 0;
}
.verify-stock {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-color);
}
.verify-prediction {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.verify-result {
  font-size: 12px;
  color: var(--text-color);
  margin-top: 2px;
}
.verify-conclusion {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: var(--card-radius-sm);
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 500;
}

/* ─── Logic Updates ─── */
.logic-version {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.logic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.logic-item {
  padding: 12px;
  background: var(--bg-color);
  border-radius: var(--card-radius-sm);
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color var(--transition-base);
}
.logic-item:hover {
  background: var(--border-light);
}

/* ─── Tomorrow Focus ─── */
.tomorrow-focus-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-color);
  white-space: pre-line;
}

/* ─── Responsive Candidates ─── */
@media (max-width: 768px) {
  .candidate-table th,
  .candidate-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
  .candidate-catalyst,
  .candidate-track-details {
    max-width: 100px;
  }
  .candidate-comment {
    max-width: 140px;
  }
  /* 隐藏非关键列：价格(4)、封板(8)、净流入(9)、跟踪评分(11) */
  .candidate-table th:nth-child(4),
  .candidate-table td:nth-child(4),
  .candidate-table th:nth-child(8),
  .candidate-table td:nth-child(8),
  .candidate-table th:nth-child(9),
  .candidate-table td:nth-child(9),
  .candidate-table th:nth-child(11),
  .candidate-table td:nth-child(11) {
    display: none;
  }
}
@media (max-width: 480px) {
  /* 小屏再隐藏星级(3)、连板(6)，保留排名/代码/涨幅/题材/评语 */
  .candidate-table th:nth-child(3),
  .candidate-table td:nth-child(3),
  .candidate-table th:nth-child(6),
  .candidate-table td:nth-child(6) {
    display: none;
  }
}
/* Responsive */
@media (max-width: 640px) {
  .detail-header {
    padding: 16px 0 24px;
  }
  .detail-title {
    font-size: 18px;
  }
  .detail-body {
    padding: 0 12px 30px;
    margin-top: -12px;
  }
  .detail-card {
    padding: 16px;
    margin-bottom: 12px;
  }
  .market-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .market-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }
  .market-item-value {
    font-size: 18px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-item-value {
    font-size: 22px;
  }
  .theme-row {
    padding: 10px;
  }
  .theme-row-name {
    min-width: 80px;
    font-size: 13px;
  }
  .stock-table th,
  .stock-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ===== non-critical.css merged ===== */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}
.report-card {
  background: var(--card-bg);
  border-radius: 0; /* parent .swipe-card-wrap handles clip */
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base),
    background-color var(--transition-base);
  cursor: pointer;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  user-select: none;
}
.report-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: var(--primary-light);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.5s ease,
    height 0.5s ease;
  pointer-events: none;
}
.report-card:active::after {
  width: 300px;
  height: 300px;
}
.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}
.report-card:active {
  transform: scale(0.995);
  transition: transform 0.1s ease;
}
.report-card .date {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}
.report-card .title {
  font-size: 17px;
  font-weight: 650;
  line-height: 1.45;
  margin-bottom: 10px;
  color: var(--text-color);
  letter-spacing: -0.01em;
  transition: color var(--transition-base);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.report-card .main-theme {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.report-card .stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.stat-item {
  text-align: center;
  padding: 10px 6px;
  background: var(--success-light);
  border-radius: var(--card-radius-sm);
  color: var(--success-color);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.4;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}
.report-card:hover .stat-item {
  border-color: rgba(220, 38, 38, 0.15);
}
.stat-item.down {
  background: var(--danger-light);
  color: var(--danger-color);
}
.report-card:hover .stat-item.down {
  border-color: rgba(16, 185, 129, 0.15);
}
.report-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tag {
  background: var(--primary-light);
  color: var(--primary-color);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.15s ease;
}
.report-card:hover .tag {
  transform: translateY(-1px);
}
.report-card .desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color var(--transition-base);
}
.skeleton-card {
  background: var(--card-bg);
  border-radius: 0; /* parent .swipe-card-wrap handles clip */
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-base);
}
.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
}
.skeleton-line.short {
  width: 40%;
}
.skeleton-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}
.skeleton-stat {
  height: 36px;
  border-radius: 4px;
}
/* Load more indicator */
.load-more-indicator {
  text-align: center;
  padding: 24px 0;
  color: var(--text-secondary);
}
.load-more-indicator .loading-spinner {
  width: 28px;
  height: 28px;
  border-width: 2px;
  margin: 0 auto;
}
.load-more-indicator p {
  margin-top: 10px;
  font-size: 13px;
}
.all-loaded {
  text-align: center;
  padding: 20px 0;
  color: var(--text-secondary);
  font-size: 13px;
}
/* Toast notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 400px;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.toast.leaving {
  animation: toast-out 0.3s ease forwards;
}
.toast-success {
  background: rgba(220, 38, 38, 0.92);
}
.toast-error {
  background: rgba(16, 185, 129, 0.92);
}
.toast-warning {
  background: rgba(230, 162, 60, 0.9);
}
.toast-info {
  background: rgba(109, 93, 240, 0.92);
}
@keyframes toast-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  transition: color var(--transition-base);
}
.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.6;
}
.empty-state h3 {
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--text-color);
  transition: color var(--transition-base);
}
.empty-state p {
  font-size: 14px;
}
/* Network error state */
.error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.error-state button {
  margin-top: 16px;
  padding: 10px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.error-state button:hover {
  background: var(--primary-hover);
}
.footer {
  text-align: center;
  padding: 30px 0;
  color: var(--text-secondary);
  font-size: 14px;
  border-top: 1px solid var(--border-color);
  margin-top: 50px;
  transition:
    color var(--transition-base),
    border-color var(--transition-base);
}
/* Theme shortcut hint */
.shortcut-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition:
    opacity 0.3s ease,
    background-color var(--transition-base),
    color var(--transition-base);
  pointer-events: none;
  z-index: 100;
}
.shortcut-hint.show {
  opacity: 1;
}
/* Filter bar */
.filter-bar {
  background: var(--card-bg);
  padding: 16px 20px;
  border-radius: 0; /* parent .swipe-card-wrap handles clip */
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base);
}
.filter-section {
  margin-bottom: 12px;
}
.filter-section:last-child {
  margin-bottom: 0;
}
.filter-section-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-bg);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.quick-filter-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  color: var(--primary-color);
  transform: translateY(-1px);
}
.quick-filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}
.tag-chip {
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-bg);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.tag-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.tag-chip.active {
  background: var(--primary-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
  font-weight: 600;
}
.filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.filter-reset-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.filter-reset-btn:hover {
  border-color: var(--danger-color);
  color: var(--danger-color);
}
.filter-summary {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}
.filter-summary span {
  color: var(--primary-color);
  font-weight: 600;
}
/* Scrollbar styling for tag cloud */
.tag-cloud::-webkit-scrollbar {
  width: 4px;
}
.tag-cloud::-webkit-scrollbar-track {
  background: transparent;
}
.tag-cloud::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}
/* ---- 移动端底部导航栏 ---- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--mobile-nav-height) + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base);
}
.mobile-nav-inner {
  display: flex;
  height: var(--mobile-nav-height);
  align-items: center;
  justify-content: space-around;
}
.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}
.mobile-nav-item:active {
  opacity: 0.6;
}
.mobile-nav-item.active {
  color: var(--primary-color);
}
.mobile-nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 2px;
}
.mobile-nav-item .nav-label {
  font-size: 10px;
  line-height: 1.2;
}
.mobile-nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger-color);
  color: white;
  font-size: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
/* ---- 横向滚动标签 ---- */
.tag-cloud-mobile {
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 8px;
  padding: 2px 0 6px;
  white-space: nowrap;
}
.tag-cloud-mobile::-webkit-scrollbar {
  display: none;
}
.tag-cloud-mobile .tag-chip {
  display: inline-flex;
  flex-shrink: 0;
}
/* ---- 滑动卡片容器 ---- */
.swipe-card-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0; /* parent .swipe-card-wrap handles clip */
  touch-action: pan-y;
}
.swipe-card-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  z-index: 1;
}
.swipe-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  color: white;
  font-size: 13px;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.swipe-action-btn .action-icon {
  font-size: 20px;
}
.swipe-action-btn.favorite {
  background: #f59e0b;
}
.swipe-action-btn.favorite.is-fav {
  background: #d97706;
}
.swipe-action-btn.delete {
  background: var(--danger-color);
}
.swipe-action-btn.share {
  background: var(--primary-color);
}
.swipe-card-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  border-radius: 0; /* parent .swipe-card-wrap handles clip */
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.swipe-card-wrap.is-swiped {
  z-index: 10;
}
.swipe-card-wrap.is-swiped .swipe-card-content {
  transform: translateX(-72px);
}
/* ---- 下拉刷新 ---- */
.pull-refresh-wrap {
  position: relative;
  overflow: hidden;
}
.pull-refresh-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 12px;
  height: 60px;
  transform: translateY(-100%);
  transition: transform 0.2s ease;
  z-index: 10;
  pointer-events: none;
}
.pull-refresh-indicator.visible {
  transform: translateY(0);
}
.pull-refresh-indicator .refresh-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.pull-refresh-indicator .refresh-text {
  margin-left: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
/* ---- 收藏指示器 ---- */
.fav-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 20px;
  color: #f59e0b;
  z-index: 3;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.fav-indicator.show {
  opacity: 1;
  transform: scale(1);
}
.report-card.is-favorite .fav-indicator {
  opacity: 1;
  transform: scale(1);
}
/* ---- 移动端卡片样式优化 ---- */
@media (max-width: 767px) {
  .report-card {
    padding: 14px;
    border-radius: 12px;
  }
  .report-card .title {
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  .report-card .stats {
    gap: 6px;
    margin-bottom: 10px;
  }
  .stat-item {
    padding: 6px 0;
    font-size: 12px;
  }
  .report-card .main-theme {
    font-size: 12px;
    padding: 3px 6px;
    margin-bottom: 8px;
  }
  .report-card .tags {
    gap: 4px;
    margin-bottom: 8px;
  }
  .tag {
    font-size: 11px;
    padding: 2px 5px;
  }
  .report-card .desc {
    font-size: 12px;
    line-height: 1.5;
  }
  .report-card .date {
    font-size: 12px;
    margin-bottom: 8px;
  }
}
/* ============================================
           响应式断点系统 (xs, sm, md, lg)
           ============================================ */

/* ---- xs: < 480px (小屏手机) ---- */
@media (max-width: 479px) {
  .header {
    padding: 24px 0;
  }
  .header h1 {
    font-size: 22px;
  }
  .header .subtitle {
    font-size: 13px;
  }
  .container {
    padding: 12px;
    padding-bottom: calc(12px + var(--mobile-nav-height));
  }
  .search-bar {
    padding: 12px;
    gap: 10px;
    margin-bottom: 16px;
    border-radius: 12px;
  }
  .search-input,
  .date-picker {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px; /* 防止iOS缩放 */
  }
  .date-range-wrap {
    width: 100%;
  }
  .theme-toggle {
    width: 100%;
    padding: 10px;
    font-size: 14px;
  }
  .reports-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .filter-bar {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 12px;
  }
  .quick-filter-group {
    gap: 6px;
  }
  .quick-filter-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .filter-actions {
    margin-top: 8px;
    padding-top: 8px;
  }
  .footer {
    padding: 20px 0;
    font-size: 12px;
    margin-bottom: var(--mobile-nav-height);
  }
  .toast-container {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .toast {
    max-width: 100%;
    font-size: 13px;
    padding: 10px 14px;
  }
  .mobile-nav {
    display: block;
  }
  .tag-cloud {
    display: none;
  }
  .tag-cloud-mobile {
    display: flex;
  }
  .shortcut-hint {
    display: none;
  }
  .load-more-indicator {
    padding: 16px 0;
  }
  .all-loaded {
    padding: 14px 0;
    font-size: 12px;
  }
}
/* ---- sm: 480px - 767px (大屏手机) ---- */
@media (min-width: 480px) and (max-width: 767px) {
  .header {
    padding: 30px 0;
  }
  .header h1 {
    font-size: 26px;
  }
  .container {
    padding: 16px;
    padding-bottom: calc(16px + var(--mobile-nav-height));
  }
  .search-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 10px;
    margin-bottom: 18px;
  }
  .search-input,
  .date-picker,
  .theme-toggle {
    width: 100%;
  }
  .reports-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .filter-bar {
    padding: 14px;
    margin-bottom: 14px;
  }
  .footer {
    margin-bottom: var(--mobile-nav-height);
  }
  .toast-container {
    left: 12px;
    right: 12px;
  }
  .toast {
    max-width: 100%;
  }
  .mobile-nav {
    display: block;
  }
  .tag-cloud {
    display: none;
  }
  .tag-cloud-mobile {
    display: flex;
  }
  .shortcut-hint {
    display: none;
  }
}
/* ---- md: 768px - 1023px (平板) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    padding: 24px 20px;
  }
  .reports-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .header h1 {
    font-size: 30px;
  }
  .search-bar {
    flex-wrap: wrap;
  }
  .mobile-nav {
    display: none;
  }
  .tag-cloud {
    display: flex;
  }
  .tag-cloud-mobile {
    display: none;
  }
}
/* ---- lg: >= 1024px (桌面) ---- */
@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
  .tag-cloud {
    display: flex;
  }
  .tag-cloud-mobile {
    display: none;
  }
}
/* ---- 通用移动端优化 (< 768px) ---- */
@media (max-width: 767px) {
  /* 移除hover效果，避免移动端残留 */
  .report-card:hover {
    transform: none;
    box-shadow: var(--shadow);
  }
  .report-card:hover .stat-item,
  .report-card:hover .tag {
    transform: none;
  }
  .theme-toggle:hover,
  .quick-filter-btn:hover,
  .tag-chip:hover,
  .filter-reset-btn:hover,
  .error-state button:hover {
    transform: none;
  }
  /* 增强active反馈 */
  .report-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  }
  .quick-filter-btn:active {
    opacity: 0.7;
  }
  .tag-chip:active {
    opacity: 0.7;
  }
}
/* ---- 桌面端：操作按钮直接显示为卡片底部操作栏 ---- */
@media (hover: hover) and (pointer: fine) {
  /* Desktop: inline action buttons, no swipe */
  .swipe-card-wrap {
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition:
      transform var(--transition-base),
      box-shadow var(--transition-base);
  }
  .swipe-card-wrap:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
  .swipe-card-actions {
    order: 2;
    position: relative;
    top: auto;
    bottom: auto;
    right: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
    z-index: auto;
  }
  .swipe-card-content {
    order: 1;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    transform: none !important;
    height: auto;
  }
  .swipe-card-content .report-card:hover {
    transform: none;
  }
  .swipe-card-wrap.is-swiped {
    z-index: auto;
  }
  .swipe-action-btn {
    width: auto;
    min-width: unset;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    flex-direction: row;
    gap: 5px;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
  }
  .swipe-action-btn:hover {
    background: var(--border-light);
    border-color: var(--border-color);
  }
  .swipe-action-btn.favorite {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
  }
  .swipe-action-btn.favorite:hover {
    background: rgba(245, 158, 11, 0.18);
    border-color: #f59e0b;
  }
  .swipe-action-btn.favorite.is-fav {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
  }
  .swipe-action-btn .action-icon {
    font-size: 14px;
  }
}
