/* ETFQuest Web版基础样式
 * 本文件放置 Tailwind 无法实现的自定义样式
 * 凡 Tailwind 类名能覆盖的，优先使用 Tailwind
 */

/* ======= 基础重置 ======= */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

/* ======= 选中颜色 ======= */
::selection {
  background-color: #2563eb;
  color: #fff;
}

/* ======= 滚动条美化 (仅 Webkit) ======= */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ======= Alpine.js 防闪烁 ======= */
[x-cloak] {
  display: none !important;
}

/* ======= HTMX 过渡动画 ======= */
.htmx-swapping {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.htmx-settling {
  opacity: 1;
  transition: opacity 0.2s ease-in;
}

.htmx-request {
  opacity: 0.7;
  pointer-events: none;
}

/* 带指示器的 HTMX 请求标记 */
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
  opacity: 1;
}

/* 默认隐藏，仅 HTMX 请求时显示 */
.htmx-indicator {
  display: none;
}

/* ======= 导航高亮 ======= */
.nav-link.active {
  color: #2563eb;
  background-color: #eff6ff;
  border-radius: 0.375rem;
  font-weight: 600;
}

/* ======= 加载动画 ======= */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 更平滑的自定义 spinner */
@keyframes spin-smooth {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.animate-spin-smooth {
  animation: spin-smooth 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ======= 骨架屏 ======= */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-text:last-child {
  width: 60%;
}

/* 骨架卡片 — 用于策略列表加载占位 */
.skeleton-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.skeleton-card .skeleton-title {
  height: 1.25rem;
  width: 65%;
  margin-bottom: 1rem;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
}

.skeleton-card .skeleton-line {
  height: 0.75rem;
  width: 100%;
  margin-bottom: 0.5rem;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
}

.skeleton-card .skeleton-line-short {
  height: 0.75rem;
  width: 45%;
  background: linear-gradient(
    90deg,
    #e5e7eb 25%,
    #f3f4f6 50%,
    #e5e7eb 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.25rem;
}

/* ======= ETFQuest 桌面版工作台 ======= */
.desktop-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.desktop-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.desktop-titlebar-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.desktop-brand-mark {
  display: flex;
  width: 3rem;
  height: 3rem;
  flex: 0 0 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.desktop-titlebar h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 800;
}

.desktop-titlebar p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  line-height: 1.4;
}

.desktop-titlebar-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.75rem;
}

.desktop-version-badge,
.desktop-ghost-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.desktop-version-badge {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
}

.desktop-ghost-button {
  background: #fff;
  color: #1d4ed8;
  text-decoration: none;
}

.desktop-tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.85rem;
  padding: 0 0.25rem;
  overflow-x: auto;
  border-bottom: 1px solid #dbe3ef;
  background: #f8fafc;
}

.desktop-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  color: #4b5563;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.45rem 0.45rem 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-tab:hover {
  color: #1d4ed8;
  background: #eef4ff;
}

.desktop-tab.active {
  color: #1d4ed8;
  border-color: #dbe3ef;
  background: #fff;
}

.desktop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  margin-top: 1rem;
}

.desktop-panel,
.module-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.desktop-panel {
  padding: 1.25rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading.compact {
  margin-bottom: 1rem;
}

.panel-kicker {
  margin: 0 0 0.25rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 1.2rem;
  font-weight: 800;
}

.status-pill {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.78rem;
  font-weight: 800;
}

.tracking-empty {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 190px;
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.tracking-icon,
.module-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.tracking-icon {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 3.25rem;
}

.tracking-empty h3 {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
  font-weight: 800;
}

.tracking-empty p {
  margin: 0.35rem 0 0;
  color: #64748b;
  line-height: 1.55;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.action-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border-radius: 0.45rem;
  font-weight: 800;
  text-decoration: none;
}

.action-button.primary {
  background: #2563eb;
  color: #fff;
}

.action-button.secondary {
  border: 1px solid #d1d5db;
  color: #374151;
}

.service-list {
  display: grid;
  gap: 0.75rem;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #edf2f7;
  border-radius: 0.45rem;
  background: #f8fafc;
}

.service-row span {
  color: #64748b;
  font-size: 0.86rem;
}

.service-row strong {
  color: #111827;
  font-size: 0.86rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.module-card {
  display: block;
  min-height: 150px;
  padding: 1.1rem;
  color: inherit;
  text-decoration: none;
}

.module-card:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.module-code {
  min-width: 2.5rem;
  height: 2rem;
  padding: 0 0.55rem;
  font-size: 0.74rem;
}

.module-card h3 {
  margin: 0.9rem 0 0.35rem;
  color: #111827;
  font-size: 1rem;
  font-weight: 800;
}

.module-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .desktop-titlebar,
  .desktop-titlebar-main,
  .desktop-titlebar-actions {
    align-items: flex-start;
  }

  .desktop-titlebar {
    flex-direction: column;
  }

  .desktop-titlebar-actions {
    flex-wrap: wrap;
  }

  .desktop-workspace,
  .module-grid {
    grid-template-columns: 1fr;
  }
}

/* ======= ETFQuest 桌面端壳对齐版 ======= */
.desktop-app-shell {
  max-width: 1440px;
  margin: 0 auto;
  background: #f8fafc;
}

.desktop-main {
  padding: 0;
}

.desktop-app-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 112px;
  padding: 1rem 1.5rem;
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 0.125rem 0.25rem rgba(15, 23, 42, 0.16);
}

.desktop-header-left {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
}

.desktop-icon-button {
  display: inline-flex;
  width: 2.1rem;
  height: 2.1rem;
  margin-right: 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 0.25rem;
  background: transparent;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.desktop-title-block {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.desktop-title-block h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
}

.desktop-title-block p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.75rem;
  line-height: 1.4;
}

.desktop-header-right {
  display: flex;
  flex: 0 0 430px;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.desktop-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.desktop-header-row.compact {
  gap: 0.35rem;
}

.desktop-version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.desktop-account-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.6rem;
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.55);
  border-radius: 0.25rem;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.desktop-member-button,
.desktop-success-button,
.desktop-outline-button {
  min-height: 1.9rem;
  padding: 0.25rem 0.55rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.desktop-member-button {
  border: 1px solid #ffc107;
  background: #ffc107;
  color: #111827;
}

.desktop-success-button {
  border: 1px solid #198754;
  background: #198754;
  color: #ffffff;
}

.desktop-outline-button {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: transparent;
  color: #ffffff;
}

.desktop-outline-button.dark {
  border-color: #cbd5e1;
  color: #475569;
}

.desktop-reward-note {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.65rem;
  line-height: 1.2;
}

.desktop-main-tabs {
  display: flex;
  gap: 0;
  padding: 0 1rem;
  overflow-x: auto;
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.desktop-main-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 0.375rem 0.375rem 0 0;
  color: #0d6efd;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-main-tab:hover {
  background: #eef4ff;
  color: #0a58ca;
}

.desktop-main-tab.active {
  color: #495057;
  background: #ffffff;
  border-color: #dee2e6 #dee2e6 #ffffff;
}

.desktop-tab-content {
  min-height: 560px;
  padding: 1.5rem;
  background: #ffffff;
}

.desktop-route-main {
  min-height: 560px;
  padding: 1.5rem;
  background: #ffffff;
}

.desktop-tab-pane {
  display: none;
}

.desktop-tab-pane.active {
  display: block;
}

body:has(.desktop-tab-pane:target) .desktop-tab-pane.active {
  display: none;
}

body:has(.desktop-tab-pane:target) .desktop-tab-pane:target {
  display: block;
}

.desktop-loading-panel {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: #6c757d;
  text-align: center;
}

.desktop-spinner {
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.75rem;
  border: 0.25rem solid #cfe2ff;
  border-top-color: #0d6efd;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@media (max-width: 960px) {
  .desktop-app-header,
  .desktop-header-left {
    align-items: flex-start;
    flex-direction: column;
  }

  .desktop-header-right {
    flex-basis: auto;
    align-items: flex-start;
  }

  .desktop-title-block {
    text-align: left;
  }
}

/* ======= Toast 动画 (JS 动态创建的 toast 元素用) ======= */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.toast-item.toast-visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.toast-hiding {
  transform: translateX(100%);
  opacity: 0;
}

/* ======= 模态框滚动锁定 ======= */
.modal-open {
  overflow: hidden;
}

/* ======= 网页登录弹窗 ======= */
.auth-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
}

.auth-modal-positioner {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.auth-modal-card {
  position: relative;
  width: min(92vw, 430px);
  padding: 1.35rem;
  color: #172033;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.auth-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
}

.auth-modal-close:hover {
  color: #0f172a;
  background: #eef2f7;
}

.auth-modal-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 2.5rem;
}

.auth-modal-icon {
  display: flex;
  width: 2.55rem;
  height: 2.55rem;
  flex: 0 0 2.55rem;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: #16a34a;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.auth-modal-header h3 {
  margin: 0;
  color: #111827;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
}

.auth-modal-header p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.4;
}

.auth-modal-steps {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.15rem;
  padding: 0.85rem;
  background: #f8fafc;
  border-radius: 14px;
}

.auth-modal-steps div {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-modal-steps span {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.risk-modal-card {
  width: min(92vw, 500px);
}

.risk-modal-notice {
  margin: 1.1rem 0 0;
  padding: 0.95rem;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.risk-modal-message {
  margin: 0.85rem 0 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.risk-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.15rem;
  flex-wrap: wrap;
}

.community-modal-card {
  width: min(92vw, 520px);
}

.community-image-panel {
  margin-top: 1.15rem;
  text-align: center;
}

.community-image-panel img {
  display: block;
  width: min(100%, 320px);
  max-height: 62vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.community-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.community-image-panel[hidden] {
  display: none;
}

.community-image-grid figure {
  margin: 0;
}

.community-image-grid img {
  width: 100%;
}

.community-image-grid figcaption {
  margin-top: 0.45rem;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-code-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #d8e0ea;
  border-radius: 16px;
}

.auth-code-container {
  display: flex;
  min-height: 154px;
  align-items: center;
  justify-content: center;
}

.auth-loading-state,
.auth-error-state {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 0.9rem;
  text-align: center;
}

.auth-error-state {
  margin: 0;
  color: #b91c1c;
}

.auth-code-content {
  width: 100%;
  text-align: center;
}

.auth-copy-code-button {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
}

.auth-copy-code-button:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.28);
  outline-offset: 4px;
  border-radius: 12px;
}

.auth-code-label {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.auth-code-digits {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.38rem;
  margin-top: 0.75rem;
}

.auth-code-digit {
  display: flex;
  aspect-ratio: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
  color: #0d6efd;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: clamp(1.35rem, 5vw, 2rem);
  font-weight: 850;
  line-height: 1;
}

.auth-code-copy-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-copy-code-button:hover .auth-code-digit {
  color: #0753c7;
  background: #dbeafe;
  border-color: #93c5fd;
}

.auth-code-expiry {
  margin-top: 0.75rem;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-status-text {
  margin: 0.8rem 0 0;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

/* ======= 移动端触摸优化 ======= */
@media (hover: none) and (pointer: coarse) {
  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 768px) {
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .auth-modal-positioner {
    align-items: flex-start;
    padding: 1rem;
    padding-top: 7vh;
  }

  .auth-modal-card {
    width: 100%;
    padding: 1.1rem;
  }

  .community-image-grid {
    grid-template-columns: 1fr;
  }

  .auth-code-panel {
    padding: 0.8rem;
  }

  .auth-code-digits {
    gap: 0.25rem;
  }
}

/* ======= 夜间模式 ======= */
[data-bs-theme="dark"] {
  color-scheme: dark;
}

[data-bs-theme="dark"] body {
  background: #1a1d23;
  color: #e9ecef;
}

[data-bs-theme="dark"] #app {
  background: #1a1d23;
}

/* 选中颜色 */
[data-bs-theme="dark"] ::selection {
  background-color: #5b9bd5;
  color: #111827;
}

/* 滚动条 */
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #495057;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #6c757d;
}

/* 应用壳 */
[data-bs-theme="dark"] .desktop-app-shell {
  background: #1a1d23;
}

/* 顶栏 */
[data-bs-theme="dark"] .desktop-app-header {
  background: #0b5ed7;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
}

/* 标签导航 */
[data-bs-theme="dark"] .desktop-main-tabs {
  background: #212529;
  border-bottom-color: #3a3d42;
}

[data-bs-theme="dark"] .desktop-main-tab {
  color: #8bb9fe;
}

[data-bs-theme="dark"] .desktop-main-tab:hover {
  background: #2b3035;
  color: #9ec5fe;
}

[data-bs-theme="dark"] .desktop-main-tab.active {
  color: #e9ecef;
  background: #1a1d23;
  border-color: #3a3d42 #3a3d42 #1a1d23;
}

/* 内容区 */
[data-bs-theme="dark"] .desktop-tab-content,
[data-bs-theme="dark"] .desktop-route-main {
  background: #1a1d23;
}

/* 面板 */
[data-bs-theme="dark"] .desktop-panel,
[data-bs-theme="dark"] .module-card {
  background: #212529;
  border-color: #3a3d42;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .module-card:hover {
  border-color: #5b9bd5;
}

[data-bs-theme="dark"] .panel-heading h2,
[data-bs-theme="dark"] .module-card h3 {
  color: #e9ecef;
}

[data-bs-theme="dark"] .panel-heading h2 {
  color: #f8f9fa;
}

[data-bs-theme="dark"] .panel-kicker {
  color: #adb5bd;
}

[data-bs-theme="dark"] .status-pill {
  background: rgba(25, 135, 84, 0.18);
  color: #75b798;
}

/* 策略追踪空态 */
[data-bs-theme="dark"] .tracking-empty {
  background: #212529;
  border-color: #495057;
}

[data-bs-theme="dark"] .tracking-empty h3 {
  color: #e9ecef;
}

[data-bs-theme="dark"] .tracking-empty p {
  color: #adb5bd;
}

[data-bs-theme="dark"] .tracking-icon,
[data-bs-theme="dark"] .module-code {
  background: rgba(13, 110, 253, 0.15);
  color: #8bb9fe;
}

/* 服务行 */
[data-bs-theme="dark"] .service-row {
  background: #2b3035;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .service-row strong {
  color: #e9ecef;
}

[data-bs-theme="dark"] .service-row span {
  color: #adb5bd;
}

/* 按钮 */
[data-bs-theme="dark"] .action-button.secondary {
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .desktop-loading-panel {
  color: #adb5bd;
}

/* 旧版桌面样式（策略页面等） */
[data-bs-theme="dark"] .desktop-shell {
  color: #e9ecef;
}

[data-bs-theme="dark"] .desktop-tabs {
  background: #212529;
  border-bottom-color: #3a3d42;
}

[data-bs-theme="dark"] .desktop-tab {
  color: #adb5bd;
}

[data-bs-theme="dark"] .desktop-tab:hover {
  color: #8bb9fe;
  background: #2b3035;
}

[data-bs-theme="dark"] .desktop-tab.active {
  color: #8bb9fe;
  background: #1a1d23;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .desktop-titlebar {
  background: #0b5ed7;
}

/* 骨架屏 */
[data-bs-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #343a40 25%, #495057 50%, #343a40 75%);
}

[data-bs-theme="dark"] .skeleton-text {
  background: linear-gradient(90deg, #343a40 25%, #495057 50%, #343a40 75%);
}

[data-bs-theme="dark"] .skeleton-card {
  background: #212529;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .skeleton-card .skeleton-title,
[data-bs-theme="dark"] .skeleton-card .skeleton-line,
[data-bs-theme="dark"] .skeleton-card .skeleton-line-short {
  background: linear-gradient(90deg, #343a40 25%, #495057 50%, #343a40 75%);
}

/* 导航高亮 */
[data-bs-theme="dark"] .nav-link.active {
  color: #8bb9fe;
  background-color: rgba(13, 110, 253, 0.15);
}

/* 旋转器 */
[data-bs-theme="dark"] .desktop-spinner {
  border-color: #343a40;
  border-top-color: #0d6efd;
}

/* 模态框 */
[data-bs-theme="dark"] .modal-content {
  background: #212529;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .auth-modal-card,
[data-bs-theme="dark"] .auth-code-panel {
  color: #e5e7eb;
  background: #1f2937;
  border-color: #374151;
}

[data-bs-theme="dark"] .auth-modal-header h3 {
  color: #f8fafc;
}

[data-bs-theme="dark"] .auth-modal-header p,
[data-bs-theme="dark"] .auth-modal-steps div,
[data-bs-theme="dark"] .auth-status-text,
[data-bs-theme="dark"] .auth-code-label,
[data-bs-theme="dark"] .auth-code-expiry,
[data-bs-theme="dark"] .auth-loading-state,
[data-bs-theme="dark"] .risk-modal-message {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .auth-modal-close,
[data-bs-theme="dark"] .auth-modal-steps,
[data-bs-theme="dark"] .risk-modal-notice {
  background: #111827;
  border-color: #374151;
}

[data-bs-theme="dark"] .risk-modal-notice {
  color: #e5e7eb;
}

[data-bs-theme="dark"] .community-image-grid figcaption {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .auth-modal-close {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .auth-code-digit {
  color: #93c5fd;
  background: #172554;
  border-color: #1d4ed8;
}

[data-bs-theme="dark"] .auth-code-copy-hint {
  color: #93c5fd;
}

[data-bs-theme="dark"] .auth-copy-code-button:hover .auth-code-digit {
  color: #bfdbfe;
  background: #1e3a8a;
  border-color: #2563eb;
}

[data-bs-theme="dark"] .modal-header {
  border-bottom-color: #3a3d42;
}

[data-bs-theme="dark"] .modal-footer {
  border-top-color: #3a3d42;
}

/* 表单 */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2b3035;
  border-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2b3035;
  border-color: #5b9bd5;
  color: #e9ecef;
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6c757d;
}

[data-bs-theme="dark"] .input-group-text {
  background-color: #343a40;
  border-color: #495057;
  color: #adb5bd;
}

/* 表格 */
[data-bs-theme="dark"] .table {
  color: #e9ecef;
}

[data-bs-theme="dark"] .table-light {
  background-color: #2b3035;
  color: #e9ecef;
}

/* 卡片 */
[data-bs-theme="dark"] .card {
  background-color: #212529;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .card-header {
  background-color: #2b3035;
  border-bottom-color: #3a3d42;
}

[data-bs-theme="dark"] .card-footer {
  background-color: #2b3035;
  border-top-color: #3a3d42;
}

[data-bs-theme="dark"] .bg-white {
  background-color: #212529 !important;
}

[data-bs-theme="dark"] .bg-light {
  background-color: #2b3035 !important;
}

[data-bs-theme="dark"] .bg-gray-50 {
  background-color: #1a1d23 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #e9ecef !important;
}

[data-bs-theme="dark"] .text-gray-600,
[data-bs-theme="dark"] .text-gray-700 {
  color: #adb5bd !important;
}

[data-bs-theme="dark"] .text-gray-900 {
  color: #f8f9fa !important;
}

[data-bs-theme="dark"] .border-gray-200,
[data-bs-theme="dark"] .border {
  border-color: #3a3d42 !important;
}

[data-bs-theme="dark"] .shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #212529;
  border-color: #3a3d42;
  color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #212529;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .dropdown-item {
  color: #e9ecef;
}

[data-bs-theme="dark"] .dropdown-item:hover {
  background-color: #2b3035;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .dropdown-divider {
  border-top-color: #3a3d42;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  color: #adb5bd;
  border-color: #6c757d;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: #495057;
  color: #e9ecef;
}

[data-bs-theme="dark"] .btn-outline-primary {
  color: #8bb9fe;
  border-color: #8bb9fe;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: #0d6efd;
  color: #fff;
}

[data-bs-theme="dark"] .badge {
  background: rgba(255, 255, 255, 0.1);
  color: #adb5bd;
}

[data-bs-theme="dark"] hr {
  border-color: #3a3d42;
}
