/**
 * ==============================================================================
 * 🏛️ [神国漫游记 · Nexus 核心挂件通用样式库 · NEXUS CSS]
 * ==============================================================================
 */

:root {
  /* 🌟 全局公共变量 Tokens */
  --nexus-box-bg: rgba(250, 248, 245, 0.75);
  --nexus-dashed-border: #e6dfd5;
  --nexus-dashed-hover: #c4b5a0;
  --nexus-text-main: #1c1917;
  --nexus-text-sub: #44403c;
  --nexus-text-muted: #78716c;
  --nexus-radius-outer: 18px;
  --nexus-radius-inner: 12px;

  /* 暖橙主色 (用于付费主按钮与高亮) */
  --nexus-amber: #ea580c;
  --nexus-amber-line: #f97316;
  --nexus-amber-bg: rgba(254, 243, 199, 0.85);
  --nexus-amber-border: #fde68a;
  --nexus-btn-amber-bg: rgba(255, 247, 237, 0.95);
  --nexus-btn-amber-border: #fed7aa;
  --nexus-btn-amber-text: #c2410c;

  /* 翡翠绿 (用于已发布状态与备用按钮) */
  --nexus-emerald: #059669;
  --nexus-emerald-bg: rgba(209, 250, 229, 0.65);
  --nexus-emerald-border: #a7f3d0;
  --nexus-btn-green-bg: rgba(240, 253, 250, 0.95);
  --nexus-btn-green-border: #a7f3d0;
  --nexus-btn-green-text: #047857;

  /* 冷雾紫 (用于间章待认领) */
  --nexus-violet-line: #a78bfa;
  --nexus-violet-text: #7c3aed;
  --nexus-violet-bg: rgba(243, 238, 255, 0.75);
  --nexus-violet-border: #e9d5ff;

  /* 间章专属底色 */
  --chord-card-pending-bg: rgba(248, 246, 255, 0.45);
  --chord-card-published-bg: rgba(240, 253, 250, 0.45);
  --chord-tag-word-color: #0369a1;
  --chord-tag-word-bg: rgba(224, 242, 254, 0.8);
  --chord-tag-price-color: #be123c;
  --chord-tag-price-bg: rgba(255, 228, 230, 0.8);

  /* 付费专属底色 */
  --payme-panel-bg: rgba(255, 251, 235, 0.55);
}

/* 🌙 暗黑模式统一映射 */
[data-theme='dark'] {
  --nexus-box-bg: rgba(24, 24, 27, 0.45);
  --nexus-dashed-border: #3f3f46;
  --nexus-dashed-hover: #52525b;
  --nexus-text-main: #f5f5f4;
  --nexus-text-sub: #d6d3d1;
  --nexus-text-muted: #8c857b;

  --nexus-amber: #fb923c;
  --nexus-amber-line: #f97316;
  --nexus-amber-bg: rgba(234, 88, 12, 0.16);
  --nexus-amber-border: rgba(249, 115, 22, 0.3);
  --nexus-btn-amber-bg: rgba(234, 88, 12, 0.12);
  --nexus-btn-amber-border: rgba(251, 146, 60, 0.35);
  --nexus-btn-amber-text: #fb923c;

  --nexus-emerald: #34d399;
  --nexus-emerald-bg: rgba(16, 185, 129, 0.15);
  --nexus-emerald-border: rgba(16, 185, 129, 0.25);
  --nexus-btn-green-bg: rgba(16, 185, 129, 0.12);
  --nexus-btn-green-border: rgba(52, 211, 153, 0.35);
  --nexus-btn-green-text: #34d399;

  --nexus-violet-line: #8b5cf6;
  --nexus-violet-text: #c4b5fd;
  --nexus-violet-bg: rgba(139, 92, 246, 0.15);
  --nexus-violet-border: rgba(139, 92, 246, 0.25);

  --chord-card-pending-bg: rgba(30, 27, 40, 0.35);
  --chord-card-published-bg: rgba(20, 32, 30, 0.35);
  --chord-tag-word-color: #38bdf8;
  --chord-tag-word-bg: rgba(14, 165, 233, 0.16);
  --chord-tag-price-color: #fb7185;
  --chord-tag-price-bg: rgba(244, 63, 94, 0.16);

  --payme-panel-bg: rgba(36, 30, 26, 0.45);
}

/* ==============================================================================
 * 📦 模块一：公共容器与顶栏
 * ==============================================================================
 */
.nexus-chord-section,
.nexus-payme-section {
  margin: 3.5rem 0 2.5rem 0;
  padding: 1.65rem 1.4rem;
  background: var(--nexus-box-bg);
  border: 1.5px dashed var(--nexus-dashed-border);
  border-radius: var(--nexus-radius-outer);
  box-sizing: border-box;
}

.nexus-chord-header,
.nexus-payme-header {
  margin-bottom: 1.25rem;
}

.nexus-chord-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--nexus-dashed-border);
}

.nexus-chord-icon,
.nexus-payme-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.nexus-chord-main-title,
.nexus-payme-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--nexus-text-main);
  letter-spacing: 0.5px;
}

.nexus-chord-sub-title {
  font-size: 0.82rem;
  color: var(--nexus-text-muted);
  font-weight: normal;
  margin-left: 0.35rem;
}

.nexus-payme-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.nexus-payme-intro-text {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--nexus-text-sub);
}

.nexus-payme-intro-text a {
  color: var(--nexus-btn-amber-text) !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* ==============================================================================
 * 📜 模块二：间章专属卡片 (Saga Board)
 * ==============================================================================
 */
.nexus-chord-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nexus-chord-card {
  border: 1px solid var(--nexus-dashed-border);
  border-radius: var(--nexus-radius-inner);
  padding: 1.25rem 1.4rem;
  transition: all 0.25s ease;
}

.nexus-chord-card:hover {
  border-color: var(--nexus-dashed-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -3px rgba(0, 0, 0, 0.05);
}

.nexus-chord-card.is-pending {
  background: var(--chord-card-pending-bg);
  border-left: 3.5px solid var(--nexus-violet-line);
}

.nexus-chord-card.is-published {
  background: var(--chord-card-published-bg);
  border-left: 3.5px solid var(--nexus-emerald);
  opacity: 0.92;
}

.nexus-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nexus-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nexus-text-main);
  line-height: 1.4;
  letter-spacing: 0.3px;
}

.nexus-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  line-height: 1.2;
}

.badge-pending {
  background: var(--nexus-violet-bg);
  color: var(--nexus-violet-text);
  border: 1px solid var(--nexus-violet-border);
}

.nexus-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nexus-violet-line);
  animation: nexus-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes nexus-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.badge-published {
  background: var(--nexus-emerald-bg);
  color: var(--nexus-emerald);
  border: 1px solid var(--nexus-emerald-border);
}

.nexus-badge-svg {
  width: 0.8rem;
  height: 0.8rem;
}

.nexus-card-desc {
  margin: 0 0 1rem 0;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--nexus-text-sub);
  letter-spacing: 0.2px;
}

.nexus-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--nexus-dashed-border);
}

.nexus-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.nexus-tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-weight: 500;
  line-height: 1.3;
}

.tag-word {
  background: var(--chord-tag-word-bg);
  color: var(--chord-tag-word-color);
}

.tag-price {
  background: var(--chord-tag-price-bg);
  color: var(--chord-tag-price-color);
}

.nexus-tag-svg {
  width: 0.85rem;
  height: 0.85rem;
}

.nexus-read-action {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--nexus-emerald) !important;
  text-decoration: none !important;
  margin-left: auto;
  transition: transform 0.15s ease;
}

.nexus-read-action:hover {
  transform: translateX(2px);
}

.nexus-action-svg {
  width: 0.9rem;
  height: 0.9rem;
}

/* ==============================================================================
 * 🔓 模块三：付费专属密卷面板 (Payme)
 * ==============================================================================
 */
.nexus-payme-dossier-panel {
  background: var(--payme-panel-bg);
  border: 1px solid var(--nexus-dashed-border);
  border-left: 4px solid var(--nexus-amber-line);
  border-radius: var(--nexus-radius-inner);
  padding: 0.2rem 1.25rem;
  margin: 1.35rem 0;
}

.nexus-payme-dossier-row {
  padding: 0.75rem 0;
  font-size: 0.92rem;
  color: var(--nexus-text-sub);
  line-height: 1.8;
}

.nexus-payme-dossier-row:not(:last-child) {
  border-bottom: 1px dashed var(--nexus-dashed-border);
}

.nexus-payme-arrow {
  color: var(--nexus-btn-amber-text);
  font-weight: 700;
  margin-right: 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

.nexus-payme-label {
  font-weight: 700;
  color: var(--nexus-text-main);
  display: inline-block;
  vertical-align: middle;
}

.nexus-payme-word-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  background: var(--nexus-amber-line);
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  margin: 0 0.35rem;
  font-size: 0.86rem;
  line-height: 1.2;
}

.nexus-payme-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  background: var(--nexus-amber-bg);
  color: var(--nexus-btn-amber-text);
  border: 1px solid var(--nexus-amber-border);
  padding: 0.15rem 0.55rem;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.2px;
  margin: 0.15rem 0.25rem 0.15rem 0;
}

.nexus-payme-memo {
  margin-top: 1.25rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--nexus-text-muted);
  text-align: center;
  line-height: 1.6;
}

/* ==============================================================================
 * 🔘 模块四：通用指引大按钮 (Actions)
 * ==============================================================================
 */
.nexus-chord-footer-action,
.nexus-payme-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.nexus-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.25;
  text-decoration: none !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.btn-amber {
  background: var(--nexus-btn-amber-bg);
  border: 1px solid var(--nexus-btn-amber-border);
  color: var(--nexus-btn-amber-text) !important;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.05);
}

.btn-amber:hover {
  background: #ea580c;
  border-color: #ea580c;
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 16px rgba(234, 88, 12, 0.25);
}

.btn-green {
  background: var(--nexus-btn-green-bg);
  border: 1px solid var(--nexus-btn-green-border);
  color: var(--nexus-btn-green-text) !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.05);
}

.btn-green:hover {
  background: #059669;
  border-color: #059669;
  color: #ffffff !important;
  transform: translateY(-1.5px);
  box-shadow: 0 5px 16px rgba(5, 150, 105, 0.25);
}

.nexus-btn-svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.nexus-btn:hover .nexus-btn-svg {
  transform: translateX(4px);
}

/* 📱 移动端自适应 */
@media (max-width: 640px) {
  .nexus-chord-section,
  .nexus-payme-section {
    padding: 1.25rem 0.9rem;
    margin: 2.2rem -0.5rem 1.2rem -0.5rem;
    border-radius: 14px;
  }

  .nexus-btn {
    font-size: 0.98rem;
    letter-spacing: 1.5px;
    padding: 0.52rem 0.85rem;
  }
}