:root {
  --sidebar-width: 250px;
  --sidebar-bg: #1e3a8a;
  --sidebar-fg: #fff;
  --sidebar-active: #fbbf24;
  --main-bg: #f8fafc;
  --main-fg: #1e293b;
  --card-bg: #fff;
  --card-radius: 16px;
  --card-shadow: 0 4px 20px rgba(30, 58, 138, 0.08);
  --primary: #1e40af;
  --primary-hover: #1e3a8a;
  --btn-radius: 8px;
  --btn-shadow: 0 2px 8px rgba(30, 58, 138, 0.15);
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
  --border: #e2e8f0;
  --danger: #dc2626;
  --success: #059669;
  --notice-bg: #fef3c7;
  --notice-fg: #92400e;
  --footer-bg: #1e3a8a;
  --footer-fg: #fff;
  --accent-gold: #fbbf24;
  --accent-gold-hover: #f59e0b;
}
body {
  margin: 0;
  font-family: 'Segoe UI', 'PingFang SC', 'Hiragino Sans', Arial, sans-serif;
  background: var(--main-bg);
  color: var(--main-fg);
  transition: background var(--transition), color var(--transition);
}
.layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0 0 0;
  position: sticky;
  top: 0;
  min-height: 100vh;
  z-index: 10;
  transition: width var(--transition), background var(--transition);
}
.sidebar-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--btn-shadow);
}
.sidebar-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 32px;
  text-align: center;
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
}
.sidebar-title-line1,
.sidebar-title-line2 {
  display: block;
  text-align: center;
}
.sidebar-nav {
  width: 100%;
  flex: 1;
}
.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-nav li {
  width: 100%;
}
.nav-link {
  display: block;
  width: 100%;
  padding: 14px 0 14px 32px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 1rem;
  border-left: 4px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.nav-link.active, .nav-link:hover {
  background: rgba(238,187,195,0.08);
  color: var(--sidebar-active);
  border-left: 4px solid var(--sidebar-active);
}
.sidebar-actions {
  display: flex;
  gap: 12px;
  margin: 24px 0 16px 0;
}
.sidebar-btn {
  background: none;
  border: none;
  color: var(--sidebar-fg);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background var(--transition);
}
.sidebar-btn:hover {
  background: rgba(255,255,255,0.12);
}
.main-content {
  flex: 1;
  padding: 0 0 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--main-bg);
  transition: background var(--transition);
}
.mobile-header {
  display: none;
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.1) 0%, rgba(251, 191, 36, 0.05) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--card-radius);
  margin: 32px 32px 0 32px;
  padding: 32px 40px;
  box-shadow: var(--card-shadow);
  min-height: 300px;
  position: relative;
  overflow: hidden;
}
.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('images/banner-illustration.svg') center/cover no-repeat;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}
.banner > * {
  position: relative;
  z-index: 1;
}
body.dark .banner {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.9) 0%, rgba(251, 191, 36, 0.1) 100%), url('images/banner-illustration-dark.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
body.dark .banner::before {
  background: url('images/banner-illustration-dark.svg') center/cover no-repeat;
  opacity: 0.3;
}
.banner-left {
  flex: 1;
}
.banner-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.banner-desc {
  font-size: 1.1rem;
  color: #374151;
  margin-bottom: 18px;
}
/* Uppercase key labels/titles */
#tab-overview h3,
#tab-performance [data-i18n],
#tab-portfolio [data-i18n],
#tab-dividend [data-i18n],
#tab-documents [data-i18n],
#info-table th {
  text-transform: uppercase;
}
.banner-btns {
  display: flex;
  gap: 16px;
}
.isin-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.isin-selector label {
  font-size: 0.95rem;
  color: var(--main-fg);
}
.isin-selector select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--main-fg);
}

/* 修复暗色模式下 ISIN 下拉菜单的可见性 */
body.dark #global-isin-select,
body.dark .isin-selector select {
  background: var(--card-bg) !important;
  color: var(--main-fg) !important;
  border-color: var(--border) !important;
}

body.dark #global-isin-select option,
body.dark .isin-selector select option {
  background: var(--card-bg) !important;
  color: var(--main-fg) !important;
}
.fancy-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  box-sizing: border-box;
  border-radius: var(--btn-radius);
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: var(--btn-shadow);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  outline: none;
  margin: 0;
}
.fancy-btn.primary {
  background: var(--primary);
}
.fancy-btn:hover, .fancy-btn.active {
  background: var(--primary-hover);
  box-shadow: 0 2px 12px rgba(59,130,246,0.12);
}
/* 强化 Banner 主要按钮与资料按钮的可读性与非透明背景 */
/* Banner 两个按钮统一由 CSS 变量驱动，保持一致的动态风格 */
.banner-btns #btn-apply {
  background: var(--accent) !important;
  color: #0f172a !important;
}
.banner-btns #btn-apply:hover,
.banner-btns #btn-apply.active {
  background: var(--accent-hover) !important;
  color: #0f172a !important;
}

/* 基金表现时间范围按钮样式 */
.perf-btns .fancy-btn {
  background: var(--card-bg);
  color: var(--main-fg);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.perf-btns .fancy-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.perf-btns .fancy-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.2);
}
#btn-info {
  background: var(--accent) !important;
  color: #0f172a !important;
}
#btn-info:hover,
#btn-info.active {
  background: var(--accent-hover) !important;
  color: #0f172a !important;
}
.section {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin: 32px 32px 0 32px;
  padding: 32px 24px;
  transition: background var(--transition);
}
.section-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  margin-bottom: 16px;
}
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 1rem;
}
th {
  background: #f7f7fa;
  font-weight: 600;
  color: #232946;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
  text-transform: uppercase;
}
th:hover {
  background: #e0e7ff;
}
tr:last-child td {
  border-bottom: none;
}
input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--btn-radius);
  font-size: 1rem;
  margin-bottom: 12px;
  outline: none;
  transition: border var(--transition);
}
input[type="text"]:focus {
  border: 1.5px solid var(--primary);
}
.notice-bar {
  display: flex;
  align-items: flex-start;
  background: var(--notice-bg);
  color: var(--notice-fg);
  border-radius: var(--btn-radius);
  margin: 24px 32px 0 32px;
  padding: 10px 18px;
  font-size: 1rem;
  box-shadow: 0 1px 6px rgba(255,193,7,0.08);
  position: relative;
  z-index: 99; /* 保持在页面元素之上，但低于弹窗 */
  transition: all 0.3s ease;
}
.notice-bar .fa-info-circle {
  position: relative;
  z-index: 91;
  pointer-events: auto;
  flex-shrink: 0;
  margin-right: 8px;
  margin-top: 2px;
}
.notice-bar #notice-content {
  flex: 1;
  line-height: 1.6;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}
.notice-bar.collapsed {
  max-height: 40px;
  min-height: 40px;
  padding: 6px 14px;
  overflow: hidden;
  opacity: 0.9;
  transition: all 0.3s ease;
}
.notice-bar.collapsed #notice-content {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notice-bar .notice-toggle {
  position: relative;
  z-index: 91;
  cursor: pointer;
  pointer-events: auto;
  flex-shrink: 0;
  margin-left: 8px;
  margin-top: 2px;
}
.notice-bar.collapsed .notice-toggle {
  position: relative;
  z-index: 91;
  pointer-events: auto;
}
.notice-bar.collapsed .fa-info-circle {
  position: relative;
  z-index: 91;
  pointer-events: auto;
}
.notice-actions {
  margin-left: auto;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--notice-fg);
  position: relative;
  z-index: 91;
  pointer-events: auto;
}
.page-nav {
  display: flex;
  gap: 16px;
  margin: 24px 32px 0 32px;
  padding: 0;
  list-style: none;
  background: none;
}
.page-nav li {
  display: inline-block;
}
.page-nav li a {
  color: var(--main-fg);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--btn-radius);
  transition: background var(--transition), color var(--transition);
}
.page-nav li.active a, .page-nav li a:hover {
  background: var(--primary);
  color: #fff;
}
.footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  border-radius: var(--btn-radius);
  margin: 32px 32px 0 32px;
  padding: 24px 0 8px 0;
  text-align: center;
  box-shadow: var(--card-shadow);
}
.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-right: 8px;
  vertical-align: middle;
}
.footer-links a {
  color: white !important;
  margin: 0 8px;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.7;
  font-weight: normal;
  opacity: 0.95;
  transition: color var(--transition);
}
.footer-links a:hover {
  color: #fff !important;
  opacity: 1;
}
.back-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #004193 0%, #3a7bd5 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 65, 147, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: linear-gradient(135deg, #3a7bd5 0%, #004193 100%);
  box-shadow: 0 6px 25px rgba(0, 65, 147, 0.4);
  transform: translateY(-3px);
}

.back-to-top-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 15px rgba(0, 65, 147, 0.3);
}

.back-to-top-btn i {
  transition: transform 0.3s ease;
}

.back-to-top-btn:hover i {
  transform: translateY(-2px);
}

/* 暗色模式回到顶部按钮 */
body.dark .back-to-top-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #232e47;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

body.dark .back-to-top-btn:hover {
  background: linear-gradient(135deg, #ffed4e 0%, #ffd700 100%);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

/* 响应式布局 */
@media (max-width: 1024px) {
  .sidebar {
    width: 70px;
    padding: 16px 0 0 0;
  }
  .sidebar-title {
    display: none;
  }
  .sidebar-title-line1,
  .sidebar-title-line2 {
    display: none;
  }
  .sidebar-nav ul {
    text-align: center;
  }
  .nav-link {
    padding: 14px 0 14px 0;
    font-size: 0.95rem;
  }
  .main-content {
    padding: 0;
  }
  .banner, .section, .footer, .notice-bar, .page-nav {
    margin-left: 12px;
    margin-right: 12px;
  }
}
@media (max-width: 600px) {
  .layout {
    flex-direction: column;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    width: 0;
    overflow: hidden;
    background: var(--sidebar-bg);
    transition: width var(--transition);
  }
  .sidebar.open {
    width: 220px;
    padding: 24px 0 0 0;
  }
  .main-content {
    margin-left: 0;
    padding: 0;
  }
  .mobile-header {
    display: flex;
    align-items: center;
    background: var(--sidebar-bg);
    color: var(--sidebar-fg);
    padding: 12px 18px;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    z-index: 1001;
  }
  .menu-toggle {
    background: none;
    border: none;
    color: var(--sidebar-fg);
    font-size: 1.5rem;
    margin-right: 16px;
    cursor: pointer;
  }
  .banner, .section, .footer, .notice-bar, .page-nav {
    margin: 8px 4px 0 4px;
    padding: 16px 8px;
  }
  .notice-bar {
    z-index: 99;
  }
  .notice-bar .fa-info-circle,
  .notice-bar .notice-toggle {
    z-index: 99;
  }
  .banner {
    flex-direction: column;
    align-items: flex-start;
    min-height: 120px;
    padding: 16px 8px;
  }
  /* 改善移動端文字大小 */
  .banner-title {
    font-size: 1.5rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  .banner-desc {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  .page-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .page-nav li {
    font-size: 0.9rem;
    padding: 8px 12px;
    width: calc(50% - 4px);
    min-width: 120px;
    text-align: center;
    flex: 0 0 auto;
  }
  @media (max-width: 480px) {
    .page-nav li {
      width: calc(100% - 4px);
    }
  }
  /* 彈窗在移動端居中 */
  #popup-banner-mask {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .popup-card {
    width: 90vw;
    max-width: 90vw;
    margin: 0;
  }
  /* Overview responsive layout */
  @media (max-width: 1024px) {
    .overview-container { flex-direction: column !important; gap: 24px !important; }
    .overview-main-info, .overview-right-content { flex: none !important; width: 100% !important; }
  }
  /* Fund category table responsiveness */
  #class-table thead th, #class-table tbody td { font-size: 12px; line-height: 1.35; padding: 6px 8px; }
  #class-table.condensed thead th, #class-table.condensed tbody td { font-size: 10px; padding: 4px 6px !important; }
  #class-table tbody td:first-child { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (max-width: 768px) {
    #class-table thead th, #class-table tbody td { font-size: 12px; padding: 6px 8px !important; }
  }
  @media (max-width: 480px) {
    #class-table thead th, #class-table tbody td { font-size: 11px; padding: 5px 6px !important; }
  }
  /* Overview visual clarity */
  .overview-main-info table,
  .fund-category .table-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  }
  .overview-main-info table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }
  .overview-main-info table tr:nth-child(even) td { background: var(--bg-secondary); }
  /* Fund category table header + zebra */
  #class-table thead th {
    position: sticky; top: 0; z-index: 1;
    background: var(--bg-secondary);
  }
  /* Industry portfolio table header inherits default weight (not forced bold) */
  #class-table tbody tr:nth-child(even) td { background: var(--bg-secondary); }
  /* Helpful column widths for readability on desktop */
  @media (min-width: 1025px) {
    /* Balance overview columns: left wider, right narrower and capped width */
    .overview-main-info { flex: 1.6 !important; }
    .overview-right-content { flex: 0.7 !important; max-width: 560px; }
    #class-table th:nth-child(1), #class-table td:nth-child(1) { width: 150px; }
    #class-table th:nth-child(2), #class-table td:nth-child(2) { width: 220px; }
    #class-table th:nth-child(3), #class-table td:nth-child(3) { width: 130px; }
    #class-table th:nth-child(4), #class-table td:nth-child(4) { width: 120px; }
    #class-table th:nth-child(5), #class-table td:nth-child(5) { width: 140px; }
    #class-table th:nth-child(6), #class-table td:nth-child(6) { width: 150px; }
  }
  .fund-category h3 { margin: 0 0 10px 0 !important; }
  .fund-category .table-wrap { padding: 4px; max-height: 360px; max-width: 100%; overflow-x: auto; }
  /* Prevent page overflow; allow table to scroll horizontally inside wrap */
  .overview-right-content { min-width: 380px; }
  
  /* 小螢幕時基金概覽改為垂直排列 */
  .overview-container {
    flex-direction: column !important;
    gap: 24px !important;
  }
  .overview-main-info,
  .overview-right-content {
    flex: none !important;
    width: 100% !important;
  }
  /* 基金目標移到基金類別下方 */
  .fund-objective {
    order: 2;
    margin-top: 24px;
  }
  .fund-category {
    order: 1;
  }
}
/* 暗色模式 */
body.dark {
  --main-bg: #0f172a;
  --main-fg: #f1f5f9;
  --sidebar-bg: #0f172a;
  --sidebar-fg: #fbbf24;
  --sidebar-active: #fff;
  --card-bg: #1e293b;
  --footer-bg: #0f172a;
  --footer-fg: #fbbf24;
  --border: #334155;
  --notice-bg: #1e293b;
  --notice-fg: #fbbf24;
  --primary: #fbbf24;
  --primary-hover: #f59e0b;
}
body.dark .section-title, body.dark .banner-title {
  color: #fbbf24;
}
body.dark th {
  background: #1e293b;
  color: #fbbf24;
}
body.dark .fancy-btn {
  background: #fbbf24;
  color: #0f172a;
}
body.dark .fancy-btn:hover, body.dark .fancy-btn.active {
  background: #f59e0b;
  color: #0f172a;
}
body.dark .page-nav li a {
  color: #fbbf24;
}
body.dark .page-nav li.active a, body.dark .page-nav li a:hover {
  background: #fbbf24;
  color: #0f172a;
}
body.dark .notice-bar {
  background: #1e293b;
  color: #fbbf24;
}
body.dark .footer-links a {
  color: #fbbf24 !important;
  font-size: 13px;
  line-height: 1.7;
  font-weight: normal;
  opacity: 0.95;
}
body.dark .footer-links a:hover {
  color: #f59e0b !important;
  opacity: 1;
}
/* 1. Portfolio表格横向滚动优化 */
#tab-portfolio .table-wrap, #tab-dividend .table-wrap, #top10-holdings-wrap {
  overflow-x: auto;
  width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
#top10-holdings-wrap table {
  min-width: 900px;
}
/* 2. 侧边栏始终固定可见 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  min-height: 100vh;
  width: var(--sidebar-width);
  box-shadow: 2px 0 8px rgba(0,0,0,0.04);
}
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  overflow-x: hidden;
}
@media (max-width: 1024px) {
  .sidebar {
    width: 70px;
    min-width: 70px;
  }
  .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
  }
  /* 侧边栏窄宽度时，将底部按钮纵向排列 */
  .sidebar-bottom-actions { flex-direction: column !important; gap: 10px !important; bottom: 16px; }
  .sidebar-bottom-actions .sidebar-btn { width: 42px !important; height: 42px !important; display: inline-flex; align-items: center; justify-content: center; }
  .lang-dropdown-list { left: auto; right: 0; transform: none; }
}
@media (max-width: 600px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    min-width: 0;
    overflow: hidden;
    transition: width var(--transition);
  }
  .sidebar.open {
    width: 220px;
    min-width: 220px;
    padding: 24px 0 0 0;
  }
  .main-content {
    margin-left: 0;
    width: 100%;
  }
  /* 小屏幕时也使用纵向排列，避免重叠 */
  .sidebar-bottom-actions { flex-direction: column !important; gap: 10px !important; bottom: 12px; }
  .sidebar-bottom-actions .sidebar-btn { width: 42px !important; height: 42px !important; }
}
/* 侧边栏底部按钮样式 */
.sidebar-bottom-actions {
  position: absolute;
  left: 0;
  bottom: 24px;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 20;
}
.sidebar-bottom-actions.force-vertical { flex-direction: column !important; gap: 10px !important; }
.sidebar-bottom-actions.force-vertical .sidebar-btn { width: 42px !important; height: 42px !important; }
/* 当侧边栏变窄或折叠时，纵向排列底部按钮，防止溢出 */
.sidebar.collapsed .sidebar-bottom-actions,
.sidebar[style*="width: 70px"] .sidebar-bottom-actions,
.sidebar[style*="min-width: 70px"] .sidebar-bottom-actions {
  flex-direction: column !important;
  gap: 10px !important;
}
.sidebar.collapsed .sidebar-bottom-actions .sidebar-btn,
.sidebar[style*="width: 70px"] .sidebar-bottom-actions .sidebar-btn,
.sidebar[style*="min-width: 70px"] .sidebar-bottom-actions .sidebar-btn {
  width: 42px !important;
  height: 42px !important;
}
/* 語言下拉選擇器 */
.lang-dropdown {
  position: relative;
  display: inline-block;
}
.lang-dropdown-list {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 50px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 80px;
  padding: 8px 0;
  z-index: 1000;
}
.lang-dropdown-list.show {
  display: block;
}
.lang-dropdown-list button {
  background: none;
  border: none;
  color: inherit;
  width: 100%;
  padding: 10px 16px;
  text-align: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.lang-dropdown-list button:hover {
  background: rgba(255,255,255,0.1);
}
.lang-dropdown-list button.active {
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}

/* 配色方案下拉選擇器 - 與語言選擇器相同樣式 */
.scheme-dropdown {
  position: relative;
  display: inline-block;
}
.scheme-dropdown-list {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 50px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 160px;
  padding: 8px 0;
  z-index: 1000;
}
.scheme-dropdown-list.show {
  display: block;
}
.scheme-dropdown-list button {
  background: none;
  border: none;
  color: inherit;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.scheme-dropdown-list button:hover {
  background: rgba(255,255,255,0.1);
}
.scheme-dropdown-list button.active {
  background: rgba(255,255,255,0.15);
  font-weight: 600;
}
.scheme-dropdown-list .scheme-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}
.scheme-dropdown-list button.active .scheme-preview {
  border-color: rgba(255,255,255,0.5);
}

/* 響應式調整 */
@media (max-width: 1024px) {
  .scheme-dropdown-list {
    left: auto;
    right: 0;
    transform: none;
  }
}
/* 1. 超链接颜色适配 */
a {
  color: #222;
  transition: color 0.2s;
}
body.dark a {
  color: #ffd700;
}

/* 2. dark mode 正文文本为白色 */
body.dark, body.dark .main-content, body.dark .section, body.dark .banner, body.dark .sidebar, body.dark .section-title, body.dark .banner-title, body.dark .banner-desc, body.dark .fancy-btn, body.dark th, body.dark td, body.dark input, body.dark select, body.dark label, body.dark .nav-link, body.dark .footer, body.dark .footer-main, body.dark .footer-links, body.dark .notice-bar, body.dark .page-nav li a {
  color: #fff !important;
}

/* SweetAlert弹窗自定义样式 */
.swal-footer-popup {
  border-radius: 12px !important;
}
/* 全局放大弹窗宽度并两端对齐正文 */
.swal2-popup {
  width: min(900px, 92vw) !important;
}
.swal-footer-popup .swal2-html-container,
.swal2-html-container {
  text-align: justify !important;
  text-justify: inter-word !important;
  line-height: 1.6 !important;
}
/* SweetAlert2 暗色模式样式 */
/* 确保 SweetAlert2 永远置顶 */
.swal2-container,
.swal2-container.swal2-top,
.swal2-container.swal2-center,
.swal2-container.swal2-bottom {
  z-index: 2147483647 !important; /* 浏览器安全上限附近，确保压过任何局部 z-index */
}
.swal-title-dark {
  color: #ffd700 !important;
}
.swal-html-dark {
  color: #e6eaf3 !important;
}
body.dark .swal2-popup {
  background: #232e47 !important;
  color: #e6eaf3 !important;
}
body.dark .swal2-title {
  color: #ffd700 !important;
}
body.dark .swal2-html-container {
  color: #e6eaf3 !important;
}
body.dark .swal2-confirm {
  background: #ffd700 !important;
  color: #232e47 !important;
}
body.dark .swal2-confirm:hover {
  background: #ffed4e !important;
}
body.dark .swal2-icon {
  border-color: #ffd700 !important;
}
body.dark .swal2-icon.swal2-error {
  border-color: #ff6b6b !important;
}
body.dark .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
  background-color: #ff6b6b !important;
}
body.dark .swal2-icon.swal2-info {
  border-color: #4ecdc4 !important;
}
body.dark .swal2-icon.swal2-info [class^='swal2-info-circular-line'] {
  background-color: #4ecdc4 !important;
}

/* Global loader */
#global-loader { position: fixed; inset: 0; background: var(--main-bg, #ffffff); display: flex; align-items: center; justify-content: center; z-index: 2147483646; flex-direction: column; }
#global-loader.hidden { display: none; }
.global-spinner { position: relative; width: 64px; height: 64px; border: 6px solid rgba(0,0,0,0.12); border-top-color: var(--accent, #004193); border-radius: 50%; animation: spin 1s linear infinite; }
.global-spinner .spinner-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.loader-full-logo { height: 44px; margin-bottom: 12px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
#global-loader-company-name { font-size: 18px; font-weight: 700; color: #1e293b; margin: 8px 0 16px 0; text-align: center; }
#global-loader-text { margin-top: 12px; font-size: 14px; color: #334155; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
body.dark #global-loader { background: #0b1220; }
body.dark #global-loader-company-name { color: #ffffff; }
body.dark #global-loader-text { color: #e6eaf3; }
#global-loader-enter-btn { margin-top: 20px; padding: 12px 32px; font-size: 14px; font-weight: 600; color: #fff; background: var(--accent, #004193); border: none; border-radius: 8px; cursor: pointer; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,65,147,0.3); }
#global-loader-enter-btn:hover { background: var(--accent-hover, #0052b3); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,65,147,0.4); }
#global-loader-enter-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,65,147,0.3); }
#global-loader-enter-btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
#global-loader-enter-btn:disabled:hover { transform: none; background: var(--accent, #004193); box-shadow: 0 2px 8px rgba(0,65,147,0.3); }
body.dark #global-loader-enter-btn { background: var(--accent, #004193); box-shadow: 0 2px 8px rgba(0,65,147,0.5); }
body.dark #global-loader-enter-btn:hover { background: var(--accent-hover, #0052b3); box-shadow: 0 4px 12px rgba(0,65,147,0.6); }
body.dark #global-loader-enter-btn:disabled { opacity: 0.5; }
body.dark #global-loader-enter-btn:disabled:hover { transform: none; background: var(--accent, #004193); box-shadow: 0 2px 8px rgba(0,65,147,0.5); }
/* 隐藏加载文本和旋转器 */
#global-loader.loaded #global-loader-text,
#global-loader.loaded .global-spinner,
#global-loader.loaded .spinner-logo { display: none; }

/* Historical performance chart sizing */
#historical-performance-chart { height: 360px !important; max-height: 390px; }

/* 风险提示弹窗暗色模式可见性 */
#popup-banner-mask .popup-card { background: #fff; color: #0f172a; }
body.dark #popup-banner-mask .popup-card { background: #232e47; color: #e6eaf3 !important; }
body.dark #popup-banner-mask .popup-card a { color: #ffd700 !important; }
#popup-banner-mask .popup-banner-close { color: #475569; }
body.dark #popup-banner-mask .popup-banner-close { color: #e6eaf3 !important; }
/* Remove any top space inside popup card and make the ad image stick to top */
#popup-banner-mask .popup-card { padding-top: 0 !important; border: 0 !important; line-height: 0; }
#popup-banner-mask .popup-card .swal2-html-container { line-height: 1.5 !important; }
#popup-banner-mask img#popup-ad-img { display: block; margin: 0 !important; padding: 0 !important; border: 0 !important; width: 100% !important; height: clamp(180px, 35vh, 320px) !important; object-fit: cover !important; }

/* 強制禁用彈窗 - 通過配置控制 */
body.popup-disabled #popup-banner-mask {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
/* 风险提示弹窗内容居中 */
#popup-banner-mask .popup-card { text-align: center; }
#popup-banner-mask .popup-card .swal2-html-container { text-align: center !important; }

/* 弹窗居中显示 */
#popup-banner-mask {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  transition: opacity 0.3s ease-in-out !important;
}
#popup-banner-mask .popup-card {
  transition: transform 0.3s ease-in-out !important;
}

/* 弹窗在小屏幕上的样式 */
@media (max-width: 600px) {
  #popup-banner-mask {
    padding: 16px !important;
  }
  #popup-banner-mask .popup-card {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 !important;
    padding: 20px 16px 50px 16px !important;
  }
  #popup-banner-mask img#popup-ad-img {
    height: clamp(120px, 25vh, 200px) !important;
    object-fit: cover !important;
    border-radius: 12px 12px 0 0 !important;
  }
  #popup-banner-mask .swal2-html-container {
    padding: 20px 16px 16px 16px !important;
    font-size: 14px !important;
  }
  #popup-banner-mask .swal2-styled {
    margin: 16px auto 8px auto !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
  }
  #popup-banner-mask #popup-autoclose-hint {
    margin-top: 12px !important;
    margin-bottom: 8px !important;
  }
  #popup-banner-mask .swal2-title {
    font-size: 18px !important;
  }
  #popup-banner-mask .popup-banner-close {
    color: #666 !important;
    transition: color 0.2s !important;
  }
  #popup-banner-mask .popup-banner-close:hover {
    color: #333 !important;
  }
  #popup-banner-mask .popup-banner-close:active {
    color: #000 !important;
  }
}

/* 广告弹窗特殊样式 */
#popup-banner-mask .swal2-styled {
  background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
  color: white !important;
  border: none !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  font-weight: bold !important;
  transition: all 0.3s ease !important;
}
#popup-banner-mask .swal2-styled:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3) !important;
}

#popup-banner-mask .swal2-html-container img {
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Desktop popup image optimization */
#popup-banner-mask img#popup-ad-img {
  max-height: 400px !important;
  min-height: 180px !important;
  object-position: center !important;
}

/* 弹窗关闭按钮悬停效果 */
#popup-close-btn:hover {
  transform: translateX(-50%) scale(1.05) !important;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3) !important;
}

/* 弹窗内容间距优化 */
#popup-banner-mask .swal2-html-container {
  padding: 20px 20px 0 20px !important;
}

#popup-banner-mask #popup-ad-text {
  margin-bottom: 8px !important;
  font-weight: 500 !important;
}

#popup-banner-mask .swal2-styled {
  margin: 16px auto 8px auto !important;
}

#popup-banner-mask #popup-autoclose-hint {
  margin-top: 12px !important;
  margin-bottom: 8px !important;
  line-height: 1.4 !important;
}

/* 加载页面风险提示样式 */
#global-loader-risk-warning {
  border: 1px solid #ddd !important;
  border-radius: 8px !important;
  padding: 12px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
  text-align: left !important;
}

#global-loader-risk-warning:hover {
  border-color: #1e40af !important;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2) !important;
}

/* 加粗加载页面风险提示的标题 */
#global-loader-risk-warning b {
  font-weight: bold !important;
  color: #1e40af !important;
  font-size: 14px !important;
}

/* 为所有表格添加描边并统一风格 */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
}
table th,
table td {
  padding: 8px;
  border: 1px solid var(--border);
  vertical-align: top;
}

/* Fund Performance section mobile styles */
@media (max-width: 600px) {
  #tab-performance .section-title {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  
  #global-isin-filter-wrap {
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-top: 8px !important;
  }
  
  #global-isin-filter-wrap label {
    font-size: 13px !important;
  }
  
  #global-isin-select {
    min-width: 120px !important;
    font-size: 13px !important;
  }
  
  /* 修复暗色模式下 ISIN 下拉菜单的可见性 */
  body.dark #global-isin-select {
    background: var(--card-bg) !important;
    color: var(--main-fg) !important;
    border-color: var(--border) !important;
  }
  
  body.dark #global-isin-select option {
    background: var(--card-bg) !important;
    color: var(--main-fg) !important;
  }
  
  /* Fund Performance filters mobile optimization */
  .perf-filter {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
  
  .perf-filter > div {
    width: 100% !important;
  }
  
  .perf-filter input[type="date"] {
    width: 100% !important;
    min-width: auto !important;
  }
  
  .perf-btns {
    justify-content: center !important;
    gap: 8px !important;
  }
  
  .perf-btns .fancy-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    min-width: 60px !important;
  }
}

/* 配色方案预览颜色 - 用於下拉選單 */
.scheme-preview.blue-gold { background: linear-gradient(45deg, #1e40af, #fbbf24); }
.scheme-preview.green-nature { background: linear-gradient(45deg, #059669, #10b981); }
.scheme-preview.purple-elegant { background: linear-gradient(45deg, #7c3aed, #a855f7); }
.scheme-preview.red-energy { background: linear-gradient(45deg, #dc2626, #ea580c); }
.scheme-preview.blue-business { background: linear-gradient(45deg, #1e3a8a, #3b82f6); }
.scheme-preview.orange-warm { background: linear-gradient(45deg, #ea580c, #f59e0b); }
.scheme-preview.mint-fresh { background: linear-gradient(45deg, #10b981, #34d399); }
.scheme-preview.gray-elegant { background: linear-gradient(45deg, #6b7280, #9ca3af); }

/* 配色方案CSS变量定义 */
/* 方案1: 现代金融蓝金配色 (默认) */
.scheme-blue-gold {
  --primary: #1e40af;
  --primary-hover: #1e3a8a;
  --accent: #fbbf24;
  --accent-hover: #f59e0b;
  --bg-light: #f8fafc;
  --bg-dark: #0f172a;
  --card-light: #fff;
  --card-dark: #1e293b;
  --text-light: #1e293b;
  --text-dark: #ffffff;
  --text-dark-secondary: #cbd5e1;
  --sidebar-light: #1e3a8a;
  --sidebar-dark: #0f172a;
  --border-light: #e2e8f0;
  --border-dark: #334155;
}

/* 方案2: 自然绿意配色 */
.scheme-green-nature {
  --primary: #059669;
  --primary-hover: #047857;
  --accent: #10b981;
  --accent-hover: #059669;
  --bg-light: #f0fdf4;
  --bg-dark: #064e3b;
  --card-light: #fff;
  --card-dark: #065f46;
  --text-light: #064e3b;
  --text-dark: #ffffff;
  --text-dark-secondary: #a7f3d0;
  --sidebar-light: #047857;
  --sidebar-dark: #064e3b;
  --border-light: #bbf7d0;
  --border-dark: #065f46;
}

/* 方案3: 优雅紫韵配色 */
.scheme-purple-elegant {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --accent: #a855f7;
  --accent-hover: #9333ea;
  --bg-light: #faf5ff;
  --bg-dark: #2e1065;
  --card-light: #fff;
  --card-dark: #4c1d95;
  --text-light: #2e1065;
  --text-dark: #ffffff;
  --text-dark-secondary: #c4b5fd;
  --sidebar-light: #6d28d9;
  --sidebar-dark: #2e1065;
  --border-light: #ddd6fe;
  --border-dark: #4c1d95;
}
/* 方案4: 活力红橙配色 */
.scheme-red-energy {
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --bg-light: #fef2f2;
  --bg-dark: #450a0a;
  --card-light: #fff;
  --card-dark: #7f1d1d;
  --text-light: #450a0a;
  --text-dark: #ffffff;
  --text-dark-secondary: #fca5a5;
  --sidebar-light: #b91c1c;
  --sidebar-dark: #450a0a;
  --border-light: #fecaca;
  --border-dark: #7f1d1d;
}

/* 方案5: 商务深蓝配色 */
.scheme-blue-business {
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --bg-light: #f1f5f9;
  --bg-dark: #0f172a;
  --card-light: #fff;
  --card-dark: #1e293b;
  --text-light: #0f172a;
  --text-dark: #ffffff;
  --text-dark-secondary: #94a3b8;
  --sidebar-light: #1e40af;
  --sidebar-dark: #0f172a;
  --border-light: #cbd5e1;
  --border-dark: #334155;
}

/* 方案6: 温暖橙棕配色 */
.scheme-orange-warm {
  --primary: #ea580c;
  --primary-hover: #c2410c;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --bg-light: #fff7ed;
  --bg-dark: #451a03;
  --card-light: #fff;
  --card-dark: #7c2d12;
  --text-light: #451a03;
  --text-dark: #ffffff;
  --text-dark-secondary: #fed7aa;
  --sidebar-light: #c2410c;
  --sidebar-dark: #451a03;
  --border-light: #fed7aa;
  --border-dark: #7c2d12;
}

/* 方案7: 清新薄荷配色 */
.scheme-mint-fresh {
  --primary: #10b981;
  --primary-hover: #059669;
  --accent: #34d399;
  --accent-hover: #10b981;
  --bg-light: #ecfdf5;
  --bg-dark: #064e3b;
  --card-light: #fff;
  --card-dark: #065f46;
  --text-light: #064e3b;
  --text-dark: #ffffff;
  --text-dark-secondary: #6ee7b7;
  --sidebar-light: #059669;
  --sidebar-dark: #064e3b;
  --border-light: #a7f3d0;
  --border-dark: #065f46;
}

/* 方案8: 优雅灰紫配色 */
.scheme-gray-elegant {
  --primary: #6b7280;
  --primary-hover: #4b5563;
  --accent: #9ca3af;
  --accent-hover: #6b7280;
  --bg-light: #f9fafb;
  --bg-dark: #1f2937;
  --card-light: #fff;
  --card-dark: #374151;
  --text-light: #1f2937;
  --text-dark: #ffffff;
  --text-dark-secondary: #d1d5db;
  --sidebar-light: #4b5563;
  --sidebar-dark: #1f2937;
  --border-light: #e5e7eb;
  --border-dark: #374151;
}
/* 应用配色方案到现有CSS变量 */
.scheme-blue-gold,
.scheme-green-nature,
.scheme-purple-elegant,
.scheme-red-energy,
.scheme-blue-business,
.scheme-orange-warm,
.scheme-mint-fresh,
.scheme-gray-elegant {
  --sidebar-bg: var(--sidebar-light);
  --main-bg: var(--bg-light);
  --main-fg: var(--text-light);
  --card-bg: var(--card-light);
  --primary: var(--primary);
  --primary-hover: var(--primary-hover);
  --border: var(--border-light);
}

/* 暗色模式下的配色方案应用 */
body.dark.scheme-blue-gold,
body.dark.scheme-green-nature,
body.dark.scheme-purple-elegant,
body.dark.scheme-red-energy,
body.dark.scheme-blue-business,
body.dark.scheme-orange-warm,
body.dark.scheme-mint-fresh,
body.dark.scheme-gray-elegant {
  --sidebar-bg: var(--sidebar-dark);
  --main-bg: var(--bg-dark);
  --main-fg: var(--text-dark);
  --card-bg: var(--card-dark);
  --border: var(--border-dark);
}

/* 暗色模式文本可见性优化 */
body.dark p {
  color: var(--text-dark-secondary);
}

body.dark .section p {
  color: var(--text-dark-secondary);
}

body.dark ul li {
  color: var(--text-dark-secondary);
}

body.dark .nav-link {
  color: var(--text-dark-secondary);
}

body.dark .nav-link:hover,
body.dark .nav-link.active {
  color: var(--accent);
}

body.dark .sidebar-title {
  color: var(--text-dark);
}

body.dark .btn {
  color: #fff;
}

body.dark .btn.accent {
  color: var(--text-dark);
}

body.dark .banner-title {
  color: var(--text-dark);
}

body.dark .banner-desc {
  color: var(--text-dark-secondary);
}

body.dark .section-title {
  color: var(--text-dark);
}

/* 按钮文本颜色保护 - 确保在所有配色方案中都可见 */
/* 亮色模式：深色文字，暗色模式：浅色文字 */
.fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info) {
  color: #1e293b !important; /* 深色文字，适合浅色背景 */
}

.fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info):hover, 
.fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info).active {
  color: #1e293b !important; /* 深色文字，适合浅色背景 */
}

.fancy-btn:not(:disabled):not([disabled]).primary:not(#btn-apply):not(#btn-info) {
  color: #1e293b !important; /* 深色文字，适合浅色背景 */
}

/* 暗色模式下的按钮文本颜色 */
body.dark .fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info) {
  color: #ffffff !important; /* 白色文字，适合深色背景 */
}

body.dark .fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info):hover, 
body.dark .fancy-btn:not(:disabled):not([disabled]):not(#btn-apply):not(#btn-info).active {
  color: #ffffff !important; /* 白色文字，适合深色背景 */
}

body.dark .fancy-btn:not(:disabled):not([disabled]).primary:not(#btn-apply):not(#btn-info) {
  color: #ffffff !important; /* 白色文字，适合深色背景 */
}

/* 禁用状态的按钮样式 */
.fancy-btn:disabled,
.fancy-btn[disabled] {
  background: #e5e7eb !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
}

.fancy-btn:disabled:hover,
.fancy-btn[disabled]:hover {
  background: #e5e7eb !important;
  color: #334155 !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
}

/* 暗色模式下的禁用状态 */
body.dark .fancy-btn:disabled,
body.dark .fancy-btn[disabled] {
  background: #374151 !important;
  color: #cbd5e1 !important;
  border: 1px solid #475569 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
}

body.dark .fancy-btn:disabled:hover,
body.dark .fancy-btn[disabled]:hover {
  background: #374151 !important;
  color: #cbd5e1 !important;
  border-color: #475569 !important;
  box-shadow: none !important;
}

/* 确保分页按钮在所有状态下都可见 - 最高优先级 */
button.fancy-btn[disabled],
button.fancy-btn:disabled,
.fancy-btn[disabled],
.fancy-btn:disabled,
.fancy-btn[disabled] *,
.fancy-btn[disabled]::before,
.fancy-btn[disabled]::after {
  color: #334155 !important;
  background: #e5e7eb !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
  text-shadow: none !important;
  font-size: 1rem !important;
  padding: 10px 24px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  outline: none !important;
}

button.fancy-btn[disabled]:hover,
button.fancy-btn:disabled:hover,
.fancy-btn[disabled]:hover,
.fancy-btn:disabled:hover {
  color: #334155 !important;
  background: #e5e7eb !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
}

body.dark button.fancy-btn[disabled],
body.dark button.fancy-btn:disabled,
body.dark .fancy-btn[disabled],
body.dark .fancy-btn:disabled,
body.dark .fancy-btn[disabled] *,
body.dark .fancy-btn[disabled]::before,
body.dark .fancy-btn[disabled]::after {
  color: #cbd5e1 !important;
  background: #374151 !important;
  border: 1px solid #475569 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
  text-shadow: none !important;
  font-size: 1rem !important;
  padding: 10px 24px !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  outline: none !important;
}

body.dark button.fancy-btn[disabled]:hover,
body.dark button.fancy-btn:disabled:hover,
body.dark .fancy-btn[disabled]:hover,
body.dark .fancy-btn:disabled:hover {
  color: #cbd5e1 !important;
  background: #374151 !important;
  border-color: #475569 !important;
  box-shadow: none !important;
}

/* 针对所有配色方案的禁用按钮强制样式 - 最高优先级 */
.scheme-blue-gold button.fancy-btn[disabled],
.scheme-green-nature button.fancy-btn[disabled],
.scheme-purple-elegant button.fancy-btn[disabled],
.scheme-red-energy button.fancy-btn[disabled],
.scheme-blue-business button.fancy-btn[disabled],
.scheme-orange-warm button.fancy-btn[disabled],
.scheme-mint-fresh button.fancy-btn[disabled],
.scheme-gray-elegant button.fancy-btn[disabled],
.scheme-blue-gold .fancy-btn[disabled],
.scheme-green-nature .fancy-btn[disabled],
.scheme-purple-elegant .fancy-btn[disabled],
.scheme-red-energy .fancy-btn[disabled],
.scheme-blue-business .fancy-btn[disabled],
.scheme-orange-warm .fancy-btn[disabled],
.scheme-mint-fresh .fancy-btn[disabled],
.scheme-gray-elegant .fancy-btn[disabled] {
  color: #334155 !important;
  background: #e5e7eb !important;
  border: 1px solid #cbd5e1 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
  text-shadow: none !important;
}
body.dark.scheme-blue-gold button.fancy-btn[disabled],
body.dark.scheme-green-nature button.fancy-btn[disabled],
body.dark.scheme-purple-elegant button.fancy-btn[disabled],
body.dark.scheme-red-energy button.fancy-btn[disabled],
body.dark.scheme-blue-business button.fancy-btn[disabled],
body.dark.scheme-orange-warm button.fancy-btn[disabled],
body.dark.scheme-mint-fresh button.fancy-btn[disabled],
body.dark.scheme-gray-elegant button.fancy-btn[disabled],
body.dark.scheme-blue-gold .fancy-btn[disabled],
body.dark.scheme-green-nature .fancy-btn[disabled],
body.dark.scheme-purple-elegant .fancy-btn[disabled],
body.dark.scheme-red-energy .fancy-btn[disabled],
body.dark.scheme-blue-business .fancy-btn[disabled],
body.dark.scheme-orange-warm .fancy-btn[disabled],
body.dark.scheme-mint-fresh .fancy-btn[disabled],
body.dark.scheme-gray-elegant .fancy-btn[disabled] {
  color: #cbd5e1 !important;
  background: #374151 !important;
  border: 1px solid #475569 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  font-weight: normal !important;
  text-shadow: none !important;
}
