/* =============================================================
   心灯祈福 · 通用组件（导航 / 按钮 / 弹窗 / toast / loading / 灯卡）
   ============================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(10, 18, 38, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
}

.topbar .nav {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 14px;
}

.topbar .nav a {
  color: var(--text-sub);
  transition: color 0.2s;
}

.topbar .nav a.active,
.topbar .nav a:hover {
  color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 15px;
  transition: transform 0.15s, opacity 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #3a2410;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, 0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, #16244b 0%, #0f1a38 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg {
  max-width: 680px;
}

.modal-title {
  font-size: 18px;
  color: var(--gold);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 22px;
  color: var(--text-sub);
  background: none;
  line-height: 1;
}

/* toast */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast-item {
  background: rgba(20, 30, 60, 0.95);
  color: var(--text-main);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* loading */
.loading {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
}

.loading::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 灯卡 */
.lamp-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.lamp-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.lamp-card .type {
  color: var(--gold);
  font-weight: 600;
}

.lamp-card .wish {
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 8px;
}

.lamp-card .meta {
  color: var(--text-sub);
  font-size: 12px;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.tag-gold { color: var(--gold); border-color: rgba(255, 180, 92, 0.5); }
.tag-green { color: var(--green); border-color: rgba(88, 214, 163, 0.5); }
.tag-red { color: var(--red); border-color: rgba(255, 107, 122, 0.5); }
.tag-gray { color: var(--text-sub); }

/* 分页 */
.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.pager button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--gold);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
}

.pager button[disabled] {
  opacity: 0.4;
}

.pager .info {
  color: var(--text-sub);
  font-size: 13px;
}

/* 空状态 */
.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 48px 0;
  font-size: 14px;
}
