/* ── 门户主页 ── */
.nav-portal-page {
  max-width: min(1100px, 100% - 24px);
  margin: 0 auto;
}

.nav-cat-panel {
  padding: clamp(14px, 3vw, 20px) clamp(14px, 3vw, 22px);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.nav-cat-row {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-cat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

a.nav-cat-row-head {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}

a.nav-cat-row-head:hover {
  color: var(--accent);
}

.nav-cat-ico,
.nav-link-ico {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.nav-cat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.nav-cat-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: #666;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav-cat-links a:hover {
  color: var(--accent);
}

.nav-cat-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  color: #999;
  text-decoration: none;
  white-space: nowrap;
}

.nav-cat-more:hover {
  color: var(--accent);
}

.nav-cat-more:hover {
  color: var(--accent);
}

/* ── 竖向列表页（更多） ── */
.nav-vlist-panel {
  padding: 0;
  overflow: hidden;
}

.nav-vlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-vlist-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.nav-vlist-item:last-child {
  border-bottom: none;
}

a.nav-vlist-link,
.nav-vlist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(14px, 3vw, 16px) clamp(14px, 3vw, 18px);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

a.nav-vlist-link:hover {
  background: rgba(10, 132, 255, 0.06);
}

.nav-vlist-ico {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-sizing: border-box;
}

.nav-vlist-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-vlist-body {
  flex: 1;
  min-width: 0;
}

.nav-vlist-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.nav-vlist-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-all;
}

.nav-vlist-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.nav-vlist-row .nav-code-value {
  flex: 1;
  margin: 0;
  font-size: 0.82rem;
}

.nav-vlist-row .nav-btn-copy {
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .nav-cat-row {
    grid-template-columns: 1fr auto;
  }

  .nav-cat-row-head {
    grid-column: 1 / -1;
  }

  .nav-cat-links {
    grid-column: 1;
  }

  .nav-cat-more {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ── 详情页 ── */
.nav-page {
  max-width: min(960px, 100% - 32px);
  margin: 0 auto;
}

.nav-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(20px, 4vw, 32px) clamp(18px, 4vw, 28px);
  gap: clamp(12px, 2.5vw, 18px);
  margin-bottom: clamp(12px, 2.5vw, 18px);
  position: relative;
}

.nav-header .hero-brand {
  justify-content: center;
}

.nav-headline {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(1.25rem, 4vw, 1.65rem);
  font-weight: 700;
  color: #1a1f2e;
  letter-spacing: 0.03em;
}

.nav-lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.nav-back {
  align-self: stretch;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.nav-back:hover {
  opacity: 0.85;
}

.nav-back-ico {
  width: 16px;
  height: 16px;
}

.nav-page-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
}

.nav-detail-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 640px) {
  .nav-detail-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.nav-detail-card {
  display: flex;
  gap: 14px;
  padding: clamp(14px, 3vw, 18px);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.55);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s, border-color 0.2s;
}

.nav-detail-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.1);
  border-color: rgba(10, 132, 255, 0.25);
}

.nav-detail-card-ico {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-sizing: border-box;
}

.nav-detail-card-ico img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-detail-card-body {
  flex: 1;
  min-width: 0;
}

.nav-detail-card-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-detail-card-desc {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.nav-detail-card-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--accent);
  word-break: break-all;
  text-decoration: none;
}

.nav-detail-card-url:hover {
  text-decoration: underline;
}

.nav-detail-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.nav-detail-card-actions .nav-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-detail-card-actions .nav-btn-copy img {
  width: 14px;
  height: 14px;
}

.nav-code-card {
  align-items: center;
}

.nav-tip-box {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(10, 132, 255, 0.07);
  border: 1px solid rgba(10, 132, 255, 0.15);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.nav-tip-box img {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.nav-tip-box a {
  color: var(--accent);
  text-decoration: none;
}

.nav-tip-box a:hover {
  text-decoration: underline;
}

.nav-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}

.nav-stack {
  max-width: 880px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-subsection {
  padding: clamp(12px, 2.5vw, 16px);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-subtitle {
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nav-link-row,
.nav-tunnel-row,
.nav-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.nav-link-row:last-child,
.nav-tunnel-row:last-child,
.nav-code-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.nav-link-row:first-child,
.nav-tunnel-row:first-child,
.nav-code-row:first-child {
  padding-top: 0;
}

.nav-item-label {
  flex: 1 1 100%;
  font-size: 0.92rem;
  font-weight: 600;
  min-width: 0;
}

@media (min-width: 540px) {
  .nav-item-label {
    flex: 0 0 auto;
    min-width: 6.5em;
  }
}

.nav-item-url {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
  text-decoration: none;
  transition: opacity 0.2s;
}

.nav-item-url:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.nav-item-note {
  flex: 1 1 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-code-value {
  flex: 1 1 auto;
  font-family: "DM Sans", ui-monospace, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
  min-width: 0;
  word-break: break-all;
}

.nav-code-value.is-masked {
  user-select: none;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
}

.nav-code-value.is-masked:hover {
  color: var(--accent);
}

.nav-code-value.is-revealed {
  font-family: "DM Sans", ui-monospace, monospace;
  letter-spacing: 0.06em;
}

.nav-code-reveal {
  flex-shrink: 0;
}

.nav-btn-copy {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid rgba(10, 132, 255, 0.28);
  background: rgba(10, 132, 255, 0.1);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s, box-shadow 0.2s;
}

.nav-btn-copy:hover {
  transform: translateY(-1px);
  background: rgba(10, 132, 255, 0.18);
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.15);
}

.nav-btn-copy.is-copied {
  background: rgba(52, 199, 89, 0.15);
  border-color: rgba(52, 199, 89, 0.35);
  color: #248a3d;
}

.nav-btn-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.nav-empty-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 密码门禁 */
.nav-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(238, 242, 249, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-gate[hidden] {
  display: none !important;
}

.nav-gate-panel {
  width: min(400px, 100%);
  padding: clamp(24px, 5vw, 32px);
  text-align: center;
}

.nav-gate-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.nav-gate-desc {
  margin: 0 0 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.nav-gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-gate-input {
  text-align: center;
  letter-spacing: 0.12em;
}

.nav-gate-error {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: #c00;
}

.nav-gate-attempts {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

#navContent[hidden] {
  display: none !important;
}

.nav-toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: rgba(26, 31, 46, 0.88);
  box-shadow: 0 8px 28px rgba(26, 31, 46, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-spring);
  z-index: 200;
}

.nav-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 768px) {
  .nav-stack,
  .nav-portal-page {
    max-width: 880px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-btn-copy,
  .nav-toast,
  .nav-detail-card {
    transition-duration: 0.01ms !important;
  }

  .nav-detail-card:hover {
    transform: none;
  }
}
