/* ============================================
 * 观鼎山首页 · 全站导航面板样式 nav.css
 * 板块：导航
 * 功能：左侧抽屉导航面板、小九宫格布局、昼夜适配
 * 标准：全站导航功能需求汇总 v2.0
 * ============================================ */

/* ---------- 导航遮罩层 ---------- */
.gds-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 1999;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gds-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- 导航面板容器 ---------- */
.gds-nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 264px;
  height: 100vh;
  background: rgba(13, 13, 26, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(90, 106, 154, 0.2);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gds-nav-panel.active {
  transform: translateX(0);
}

/* ---------- 面板头部 ---------- */
.gds-nav-panel-header {
  flex-shrink: 0;
  padding: 20px 20px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(90, 106, 154, 0.12);
}

.gds-nav-panel-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: #D4A843;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.gds-nav-panel-title::before {
  content: '✦ ';
  opacity: 0.6;
}

.gds-nav-panel-title::after {
  content: ' ✦';
  opacity: 0.6;
}

.gds-nav-panel-divider {
  width: 60px;
  height: 2px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.5), transparent);
  border-radius: 1px;
}

/* ---------- 小九宫格主体 ---------- */
.gds-nav-grid-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.gds-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

/* ---------- 单格模块 ---------- */
.gds-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 4px;
  border: 1.5px solid rgba(90, 106, 154, 0.15);
  border-radius: 12px;
  background: rgba(30, 30, 51, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  min-height: 72px;
  opacity: 0;
  transform: translateY(12px);
}

/* 递进出现动画 */
.gds-nav-panel.active .gds-nav-item {
  animation: gds-nav-item-enter 0.35s ease forwards;
}

.gds-nav-panel.active .gds-nav-item:nth-child(1) { animation-delay: 0.05s; }
.gds-nav-panel.active .gds-nav-item:nth-child(2) { animation-delay: 0.10s; }
.gds-nav-panel.active .gds-nav-item:nth-child(3) { animation-delay: 0.15s; }
.gds-nav-panel.active .gds-nav-item:nth-child(4) { animation-delay: 0.20s; }
.gds-nav-panel.active .gds-nav-item:nth-child(5) { animation-delay: 0.25s; }
.gds-nav-panel.active .gds-nav-item:nth-child(6) { animation-delay: 0.30s; }
.gds-nav-panel.active .gds-nav-item:nth-child(7) { animation-delay: 0.35s; }
.gds-nav-panel.active .gds-nav-item:nth-child(8) { animation-delay: 0.40s; }
.gds-nav-panel.active .gds-nav-item:nth-child(9) { animation-delay: 0.45s; }

@keyframes gds-nav-item-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gds-nav-item:hover {
  transform: scale(1.05);
  border-color: rgba(212, 168, 67, 0.4);
  background: rgba(212, 168, 67, 0.08);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.1);
}

.gds-nav-item:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* 模块颜色指纹边框 */
.gds-nav-item[data-color] {
  border-color: color-mix(in srgb, var(--nav-color) 30%, rgba(90, 106, 154, 0.15));
}

.gds-nav-item[data-color]:hover {
  border-color: color-mix(in srgb, var(--nav-color) 60%, rgba(212, 168, 67, 0.4));
}

/* 模块图标 */
.gds-nav-item-icon {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--nav-color) 20%, transparent));
}

/* 模块名称 */
.gds-nav-item-name {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: #c8d0e0;
  opacity: 0.85;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
  transition: color 0.2s ease;
}

.gds-nav-item:hover .gds-nav-item-name {
  color: #D4A843;
}

/* 九宫格名称后的八卦符号 */
.gds-nav-item-gua {
  font-size: 0.72rem;
  color: rgba(212, 168, 67, 0.55);
  margin-left: 2px;
  font-weight: 400;
}

/* ---------- 首页（中宫位）特殊样式 ---------- */
.gds-nav-item--home {
  border-color: rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.06);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.08);
}

.gds-nav-item--home .gds-nav-item-name {
  color: #D4A843;
  font-weight: 700;
}

.gds-nav-item--home:hover {
  border-color: rgba(212, 168, 67, 0.6);
  background: rgba(212, 168, 67, 0.12);
  box-shadow: 0 0 24px rgba(212, 168, 67, 0.2);
}

/* ---------- 当前模块高亮态 ---------- */
.gds-nav-item.active {
  border-color: rgba(212, 168, 67, 0.6) !important;
  background: rgba(212, 168, 67, 0.12) !important;
  box-shadow:
    0 0 16px rgba(212, 168, 67, 0.2),
    inset 0 0 20px rgba(212, 168, 67, 0.05) !important;
}

.gds-nav-item.active .gds-nav-item-name {
  color: #D4A843 !important;
  opacity: 1;
}

.gds-nav-item.active .gds-nav-item-icon {
  filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.4));
}

/* 高亮态呼吸光晕 */
.gds-nav-item.active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  border: 1.5px solid rgba(212, 168, 67, 0.2);
  animation: gds-nav-active-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gds-nav-active-pulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.04);
  }
}

/* ---------- 菜单模式：宫间星/更多→ 同级展开项 ---------- */
.gds-nav-menu-item--expand {
  margin-top: 4px;
}

.gds-nav-menu-sub {
  list-style: none;
  margin: 0;
  padding: 2px 0 4px 34px;
  display: none;
}

.gds-nav-menu-sub.open {
  display: block;
}

.gds-nav-menu-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: #c8d0e0;
  opacity: 0.7;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.gds-nav-menu-sub-item:hover {
  background: rgba(212, 168, 67, 0.08);
  color: #D4A843;
  opacity: 0.95;
}

.gds-nav-menu-sub-lock {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* 未开发子项（加锁） */
.gds-nav-menu-sub-item--locked {
  cursor: not-allowed;
  opacity: 0.35;
}

.gds-nav-menu-sub-item--locked:hover {
  background: transparent;
  color: #c8d0e0;
  opacity: 0.45;
}

/* 展开箭头旋转 */
.gds-nav-menu-item--expand.open .gds-nav-menu-arrow {
  transform: rotate(90deg);
}

.gds-nav-menu-num--expand {
  font-size: 0.7rem;
  color: rgba(212, 168, 67, 0.5);
}

/* ---------- 九宫格模式：宫间星/更多→ 同级展开项 ---------- */
.gds-nav-grid-expand {
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gds-nav-grid-expand-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1.5px solid rgba(90, 106, 154, 0.15);
  border-radius: 10px;
  background: rgba(30, 30, 51, 0.3);
  color: #c8d0e0;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gds-nav-grid-expand-link:hover {
  border-color: rgba(212, 168, 67, 0.4);
  background: rgba(212, 168, 67, 0.08);
  color: #D4A843;
}

.gds-nav-grid-expand-arrow {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.gds-nav-grid-expand.open .gds-nav-grid-expand-arrow {
  transform: rotate(90deg);
}

.gds-nav-grid-expand-sub {
  display: none;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 2px 4px 0;
}

.gds-nav-grid-expand-sub.open {
  display: flex;
}

.gds-nav-grid-expand-sub-item {
  font-size: 0.62rem;
  color: #c8d0e0;
  opacity: 0.6;
  padding: 2px 6px;
  border: 1px solid rgba(90, 106, 154, 0.12);
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.gds-nav-grid-expand-sub-item:hover {
  opacity: 0.9;
  color: #D4A843;
  border-color: rgba(212, 168, 67, 0.3);
}

.gds-nav-grid-expand-sub-item--locked {
  cursor: not-allowed;
  opacity: 0.3;
}

.gds-nav-grid-expand-sub-item--locked:hover {
  opacity: 0.4;
  color: #c8d0e0;
  border-color: rgba(90, 106, 154, 0.12);
}

/* ---------- 关闭按钮（面板内右上角） ---------- */
.gds-nav-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(90, 106, 154, 0.2);
  border-radius: 50%;
  background: rgba(30, 30, 51, 0.4);
  color: #c8d0e0;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  line-height: 1;
  padding: 0;
  opacity: 0.5;
}

.gds-nav-close-btn:hover {
  background: rgba(212, 168, 67, 0.15);
  border-color: rgba(212, 168, 67, 0.4);
  color: #D4A843;
  opacity: 1;
  transform: scale(1.1);
}

/* ============================================
 * 昼模式适配
 * ============================================ */
[data-theme="light"] .gds-nav-panel {
  background: rgba(250, 246, 238, 0.96);
  border-color: rgba(192, 168, 106, 0.2);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .gds-nav-panel-title {
  color: #8B6914;
}

[data-theme="light"] .gds-nav-panel-divider {
  background: linear-gradient(90deg, transparent, rgba(139, 105, 20, 0.4), transparent);
}

[data-theme="light"] .gds-nav-item {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(192, 168, 106, 0.15);
}

[data-theme="light"] .gds-nav-item-name {
  color: #2c2416;
}

[data-theme="light"] .gds-nav-item:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: rgba(192, 168, 106, 0.4);
}

[data-theme="light"] .gds-nav-item--home {
  border-color: rgba(139, 105, 20, 0.3);
  background: rgba(212, 168, 67, 0.08);
}

[data-theme="light"] .gds-nav-item--home .gds-nav-item-name {
  color: #8B6914;
}

[data-theme="light"] .gds-nav-item.active {
  border-color: rgba(139, 105, 20, 0.5) !important;
  background: rgba(212, 168, 67, 0.15) !important;
  box-shadow: 0 0 12px rgba(139, 105, 20, 0.15) !important;
}

[data-theme="light"] .gds-nav-item.active .gds-nav-item-name {
  color: #8B6914 !important;
}

[data-theme="light"] .gds-nav-close-btn {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(192, 168, 106, 0.2);
  color: #2c2416;
}

[data-theme="light"] .gds-nav-close-btn:hover {
  background: rgba(212, 168, 67, 0.2);
  border-color: rgba(139, 105, 20, 0.4);
  color: #8B6914;
}

[data-theme="light"] .gds-nav-menu-sub-item {
  color: #2c2416;
}

[data-theme="light"] .gds-nav-menu-sub-item:hover {
  background: rgba(212, 168, 67, 0.12);
  color: #8B6914;
}

[data-theme="light"] .gds-nav-menu-sub-item--locked:hover {
  background: transparent;
  color: #2c2416;
}

[data-theme="light"] .gds-nav-grid-expand-link {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(192, 168, 106, 0.15);
  color: #2c2416;
}

[data-theme="light"] .gds-nav-grid-expand-link:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: rgba(192, 168, 106, 0.4);
  color: #8B6914;
}

[data-theme="light"] .gds-nav-grid-expand-sub-item {
  color: #2c2416;
  border-color: rgba(192, 168, 106, 0.15);
}

[data-theme="light"] .gds-nav-grid-expand-sub-item:hover {
  color: #8B6914;
  border-color: rgba(139, 105, 20, 0.3);
}

[data-theme="light"] .gds-nav-grid-expand-sub-item--locked:hover {
  color: #2c2416;
  border-color: rgba(192, 168, 106, 0.15);
}

[data-theme="light"] .gds-nav-menu-gua {
  color: rgba(139, 105, 20, 0.55);
}

[data-theme="light"] .gds-nav-item-gua {
  color: rgba(139, 105, 20, 0.55);
}

[data-theme="light"] .gds-nav-panel-header {
  border-color: rgba(192, 168, 106, 0.15);
}

/* ============================================
 * 响应式
 * ============================================ */
@media (max-width: 768px) {
  .gds-nav-panel {
    width: 80%;
    max-width: 340px;
  }
  .gds-nav-grid {
    max-width: 260px;
    gap: 6px;
  }
  .gds-nav-item {
    min-height: 66px;
    padding: 10px 4px;
  }
  .gds-nav-item-icon {
    font-size: 1.3rem;
  }
  .gds-nav-item-name {
    font-size: 0.68rem;
  }
}

@media (max-width: 480px) {
  .gds-nav-panel {
    width: 100%;
    max-width: 100%;
  }
  .gds-nav-grid {
    max-width: 280px;
    gap: 8px;
  }
  .gds-nav-item {
    min-height: 72px;
    padding: 12px 4px;
    border-radius: 10px;
  }
  .gds-nav-item-icon {
    font-size: 1.4rem;
  }
  .gds-nav-item-name {
    font-size: 0.72rem;
  }
  .gds-nav-panel-header {
    padding: 16px 16px 12px;
  }
  .gds-nav-panel-title {
    font-size: 1rem;
  }
}

/* ---------- 导航按钮打开态图标切换 ---------- */
#gds-btn-nav.open {
  background: rgba(212, 168, 67, 0.15);
  border-color: rgba(212, 168, 67, 0.3);
}

#gds-btn-nav.open .gds-nav-hamburger span {
  background: rgba(212, 168, 67, 0.8);
}

/* 昼模式导航按钮打开态 */
[data-theme="light"] #gds-btn-nav.open {
  background: rgba(212, 168, 67, 0.2);
}

[data-theme="light"] #gds-btn-nav.open .gds-nav-hamburger span {
  background: rgba(139, 105, 20, 0.8);
}

/* ============================================
 * 菜单模式（首页使用）
 * ============================================ */

.gds-nav-panel--menu .gds-nav-grid-wrap {
  display: none;
}

.gds-nav-menu-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 8px 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.gds-nav-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gds-nav-menu-item {
  border-radius: 8px;
  transition: background 0.2s ease;
}

.gds-nav-menu-item:hover {
  background: rgba(212, 168, 67, 0.08);
}

.gds-nav-menu-item.active {
  background: rgba(212, 168, 67, 0.12);
}

.gds-nav-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #c8d0e0;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  transition: color 0.2s ease;
  position: relative;
}

.gds-nav-menu-item:hover .gds-nav-menu-link {
  color: #D4A843;
}

.gds-nav-menu-item.active .gds-nav-menu-link {
  color: #D4A843;
  font-weight: 700;
}

.gds-nav-menu-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.gds-nav-menu-name {
  flex: 1;
}

/* 菜单模式名称后的八卦符号 */
.gds-nav-menu-gua {
  font-size: 0.85rem;
  color: rgba(212, 168, 67, 0.55);
  margin-right: 6px;
  font-weight: 400;
}

/* 后天数字（右端） */
.gds-nav-menu-num {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(212, 168, 67, 0.5);
  margin-right: 6px;
  min-width: 18px;
  text-align: center;
  transition: color 0.2s ease;
}

.gds-nav-menu-item:hover .gds-nav-menu-num,
.gds-nav-menu-item.active .gds-nav-menu-num {
  color: rgba(212, 168, 67, 0.9);
}

.gds-nav-menu-arrow {
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  color: rgba(212, 168, 67, 0.6);
}

.gds-nav-menu-item:hover .gds-nav-menu-arrow,
.gds-nav-menu-item.active .gds-nav-menu-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* 菜单模式 - 昼模式 */
[data-theme="light"] .gds-nav-menu-link {
  color: #2c2416;
}

[data-theme="light"] .gds-nav-menu-item:hover {
  background: rgba(212, 168, 67, 0.1);
}

[data-theme="light"] .gds-nav-menu-item:hover .gds-nav-menu-link,
[data-theme="light"] .gds-nav-menu-item.active .gds-nav-menu-link {
  color: #8B6914;
}

[data-theme="light"] .gds-nav-menu-item.active {
  background: rgba(212, 168, 67, 0.15);
}

[data-theme="light"] .gds-nav-menu-arrow {
  color: rgba(139, 105, 20, 0.6);
}