:root {
  --portal-panel: rgba(255, 253, 247, 0.92);
  --portal-panel-strong: #fffefb;
  --portal-soft-line: rgba(32, 35, 33, 0.08);
  --portal-warm-shadow: 0 18px 48px rgba(46, 41, 33, 0.1);
}

.archive-loading-stat,
.archive-loading-tabs,
.archive-loading-row {
  background: linear-gradient(90deg, rgba(120, 110, 100, .08), rgba(120, 110, 100, .16), rgba(120, 110, 100, .08));
  background-size: 200% 100%;
  animation: archive-loading-shimmer 1.2s ease-in-out infinite;
}
.archive-loading-stat { min-height: 70px; border-radius: 12px; }
.archive-loading-tabs { height: 42px; border-radius: 10px; margin: 12px 0; }
.archive-loading-row { min-height: 76px; border-radius: 12px; margin: 12px 0; }
@keyframes archive-loading-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.archive-dashboard-main,
.profile-dashboard-main,
.daoguan-dashboard-main {
  padding-bottom: 56px;
}

.archive-hero-panel,
.profile-hero-panel,
.daoguan-hero-panel {
  position: relative;
}

.archive-hero-panel::after,
.profile-hero-panel::after,
.daoguan-hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -12% -55% 40%;
  height: 180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 66%);
  pointer-events: none;
}

.archive-hero-copy,
.profile-hero-copy,
.daoguan-hero-copy {
  display: grid;
  gap: 14px;
  max-width: 720px;
  min-width: 0;
}

.archive-hero-tags,
.profile-hero-tags,
.daoguan-hero-tags,
.archive-inline-tags,
.profile-inline-tags,
.portal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-hero-tags span,
.profile-hero-tags span,
.daoguan-hero-tags span,
.archive-inline-tags span,
.profile-inline-tags span,
.portal-chip-row span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.62);
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 800;
}

.archive-dashboard-layout,
.profile-dashboard-layout,
.daoguan-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

body[data-page="profile"] .profile-dashboard-layout {
  grid-template-columns: 1fr;
}

.archive-dashboard-primary,
.archive-dashboard-side,
.profile-dashboard-primary,
.daoguan-dashboard-primary,
.profile-dashboard-side,
.daoguan-dashboard-side {
  display: grid;
  gap: 14px;
  padding: 22px 20px;
  border: 1px solid var(--portal-soft-line);
  border-radius: 18px;
  background: var(--portal-panel);
  box-shadow: var(--portal-warm-shadow);
  min-width: 0;
  overflow: hidden;
}

.archive-dashboard-side,
.profile-dashboard-side,
.daoguan-dashboard-side {
  min-width: 280px;
  padding: 24px 22px;
}

.archive-command-panel,
.archive-highlight-panel,
.archive-list-panel,
.archive-stats-panel,
.archive-categories-panel,
.archive-lottery-panel,
.profile-member-panel,
.profile-points-panel,
.profile-account-panel,
.profile-quick-panel,
.profile-signin-panel,
.profile-mall-panel,
.profile-history-panel,
.daoguan-search-panel,
.daoguan-list-panel,
.daoguan-spotlight-panel,
.daoguan-filter-panel,
.daoguan-city-panel {
  padding: 20px;
  border: 1px solid var(--portal-soft-line);
  border-radius: 18px;
  background: var(--portal-panel);
  box-shadow: var(--portal-warm-shadow);
  overflow: hidden;
  min-width: 0;
}

.archive-command-head,
.archive-list-header,
.profile-card-head,
.daoguan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.archive-command-head h3,
.archive-list-header h3,
.profile-card-head h3,
.daoguan-card-head h3 {
  margin-top: 6px;
  font-size: 24px;
}

.archive-search-bar,
.daoguan-search-bar,
.profile-inline-form {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--portal-panel-strong);
}

.archive-search-bar {
  min-height: 48px;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  background: #fffefb;
  overflow: hidden;
}

.archive-search-bar input,
.daoguan-search-bar input,
.profile-inline-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.archive-search-clear,
.profile-mini-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.archive-tab-bar,
.profile-chip-tabs,
.daoguan-chip-tabs {
  display: inline-flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px;
  border-radius: 10px;
  background: rgba(32, 35, 33, 0.06);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.archive-tab-bar::-webkit-scrollbar,
.profile-chip-tabs::-webkit-scrollbar,
.daoguan-chip-tabs::-webkit-scrollbar {
  display: none;
}

.archive-tab,
.profile-chip-tab,
.daoguan-chip-tab {
  position: relative;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  scroll-snap-align: start;
  white-space: nowrap;
}

.archive-tab.active,
.profile-chip-tab.active,
.daoguan-chip-tab.active {
  background: var(--cinnabar);
  color: #fffdf7;
  box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.24);
}

.archive-tab i,
.profile-chip-tab i,
.daoguan-chip-tab i {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--cinnabar);
  color: #fffdf7;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.archive-status-text,
.profile-panel-note,
.daoguan-panel-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.archive-stats-grid,
.profile-stats-grid,
.profile-points-grid,
.daoguan-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.archive-stats-grid div,
.profile-stats-grid div,
.profile-points-grid div,
.daoguan-spotlight-grid div {
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--portal-panel-strong);
  min-width: 0;
  overflow: hidden;
}

.archive-stats-grid strong,
.profile-stats-grid strong,
.profile-points-grid strong,
.daoguan-spotlight-grid strong {
  font-size: 17px;
  line-height: 1.1;
}

.archive-stats-grid span,
.profile-stats-grid span,
.profile-points-grid span,
.daoguan-spotlight-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-category-list,
.archive-lottery-list,
.profile-account-list,
.profile-quick-list,
.profile-history-list,
.daoguan-result-list,
.daoguan-city-list {
  display: grid;
  gap: 12px;
}

.archive-lottery-list {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.archive-category-card,
.archive-lottery-card,
.profile-account-card,
.profile-quick-card,
.profile-history-card,
.daoguan-result-card,
.daoguan-city-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--portal-panel-strong);
  text-align: left;
  cursor: pointer;
}

.archive-category-card.active,
.archive-lottery-card:not(.ended),
.daoguan-city-card.active {
  border-color: rgba(var(--accent-rgb), 0.38);
  box-shadow: 0 10px 22px rgba(var(--accent-rgb), 0.08);
}

.archive-category-card strong,
.archive-lottery-card strong,
.profile-account-card strong,
.profile-quick-card strong,
.profile-history-card strong,
.daoguan-result-card strong,
.daoguan-city-card strong {
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-category-card p,
.archive-lottery-card p,
.profile-account-card p,
.profile-quick-card p,
.profile-history-card p,
.daoguan-result-card p,
.daoguan-city-card p {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.archive-category-meta,
.archive-lottery-meta,
.profile-account-meta,
.profile-quick-meta,
.profile-history-meta,
.daoguan-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  flex-wrap: wrap;
  overflow: hidden;
}

.archive-category-meta i,
.archive-lottery-meta i,
.profile-account-meta i,
.profile-quick-meta i,
.profile-history-meta i,
.daoguan-result-meta i {
  font-style: normal;
  color: var(--cinnabar);
}

.archive-highlight-card {
  min-height: 180px;
}

.archive-highlight-tonal,
.profile-member-shell,
.daoguan-hero-shell {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 242, 0.78)),
    radial-gradient(circle at 88% 22%, rgba(var(--accent-rgb), 0.18), transparent 28%),
    radial-gradient(circle at 10% 88%, rgba(var(--accent-rgb), 0.14), transparent 26%),
    var(--portal-panel-strong);
}

.archive-highlight-kicker,
.profile-member-kicker,
.daoguan-hero-kicker {
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-highlight-tonal strong,
.profile-member-shell strong,
.daoguan-hero-shell strong {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
}

.archive-highlight-tonal p,
.profile-member-shell p,
.daoguan-hero-shell p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.archive-highlight-meta,
.profile-member-meta,
.daoguan-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.archive-highlight-meta span,
.profile-member-meta span,
.daoguan-hero-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.8);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.archive-card-list,
.profile-module-stack,
.daoguan-module-stack {
  display: grid;
  gap: 12px;
}

.profile-sub-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.profile-sub-divider::before,
.profile-sub-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--portal-soft-line);
}

.archive-stream-card,
.profile-module-card,
.daoguan-module-card {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--portal-panel-strong);
  text-align: left;
  cursor: pointer;
}

.archive-stream-card.lottery {
  border-color: rgba(var(--accent-rgb), 0.2);
}

.archive-stream-mark,
.profile-module-mark,
.daoguan-module-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fffdf7;
}

.archive-stream-mark.tone-cinnabar,
.profile-module-mark.tone-cinnabar,
.profile-mobile-row-icon.tone-cinnabar,
.daoguan-module-mark.tone-cinnabar {
  background: linear-gradient(135deg, var(--accent-dark, #8b352c), var(--cinnabar));
}

.archive-stream-mark.tone-jade,
.profile-module-mark.tone-jade,
.profile-mobile-row-icon.tone-jade,
.daoguan-module-mark.tone-jade {
  background: linear-gradient(135deg, #215e50, var(--jade));
}

.archive-stream-mark.tone-gold,
.profile-module-mark.tone-gold,
.profile-mobile-row-icon.tone-gold,
.daoguan-module-mark.tone-gold {
  background: linear-gradient(135deg, var(--accent-dark, #8b352c), var(--cinnabar, #b94132));
}

.archive-stream-mark.tone-ink,
.profile-module-mark.tone-ink,
.profile-mobile-row-icon.tone-ink,
.daoguan-module-mark.tone-ink {
  background: linear-gradient(135deg, #22313d, var(--blue-ink));
}

body[data-page="profile"] .profile-module-mark,
body[data-page="profile"] .profile-mobile-row-icon,
body[data-page="profile"] .profile-account-card .archive-stream-mark,
body[data-page="profile"] .profile-history-card .archive-stream-mark {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--cinnabar, #b94132);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.10);
}

.archive-stream-body,
.profile-module-body,
.daoguan-module-body {
  display: grid;
  gap: 8px;
}

.archive-stream-head,
.profile-module-head,
.daoguan-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.archive-stream-head strong,
.profile-module-head strong,
.daoguan-module-head strong {
  font-size: 17px;
  line-height: 1.35;
}

.archive-stream-body p,
.profile-module-body p,
.daoguan-module-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.archive-stream-meta,
.profile-module-meta,
.daoguan-module-meta,
.archive-stream-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.archive-stream-meta span,
.profile-module-meta span,
.daoguan-module-meta span,
.archive-stream-pills span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-stream-badge,
.archive-pill,
.profile-pill,
.daoguan-pill,
.portal-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.archive-stream-badge,
.portal-badge {
  background: rgba(30, 111, 92, 0.12);
  color: var(--jade);
}

.archive-pill.top,
.profile-pill.top,
.daoguan-pill.top {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--cinnabar);
}

.archive-pill.new,
.profile-pill.new,
.daoguan-pill.new,
.archive-pill.hot {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--accent-dark, #8b352c);
}

.archive-pill.vip,
.profile-pill.vip,
.portal-badge.vip {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--cinnabar);
}

.portal-modal {
  width: min(720px, calc(100vw - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.portal-modal::backdrop {
  background: rgba(19, 21, 18, 0.56);
  backdrop-filter: blur(6px);
}

.portal-modal-card {
  width: 100%;
  padding: 0;
  border: 1px solid var(--portal-soft-line);
  border-radius: 20px;
  background: var(--portal-panel);
  box-shadow: 0 12px 40px rgba(19,21,18,0.18), 0 2px 8px rgba(19,21,18,0.08);
  overflow: hidden;
}

.portal-modal-head,
.portal-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
}

.portal-modal-head {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 251, 0.92);
}

.portal-modal-body {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.portal-modal-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.archive-detail-grid,
.profile-detail-grid,
.daoguan-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.archive-detail-grid div,
.profile-detail-grid div,
.daoguan-detail-grid div {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--portal-panel-strong);
}

.archive-detail-grid span,
.profile-detail-grid span,
.daoguan-detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.archive-detail-grid strong,
.profile-detail-grid strong,
.daoguan-detail-grid strong {
  font-size: 18px;
}

.archive-detail-copy,
.profile-detail-copy,
.daoguan-detail-copy {
  margin: 0;
  color: var(--ink);
  line-height: 1.8;
}

.profile-member-shell {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.profile-avatar-stack {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 240, 237, 0.84));
  color: var(--cinnabar);
  font-size: 36px;
  font-weight: 900;
}

.profile-avatar-stack #profile-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  overflow: hidden;
}

.profile-vip-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--cinnabar);
  color: #fffdf7;
  font-size: 11px;
  font-weight: 900;
}

.profile-mobile-shell {
  display: none;
}

.profile-mobile-groups {
  display: grid;
  gap: 14px;
}

.profile-mobile-group {
  padding: 6px 0;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--portal-soft-line);
  box-shadow: var(--portal-warm-shadow);
  overflow: hidden;
}

.profile-mobile-row-list {
  display: grid;
}

.profile-mobile-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.profile-mobile-row + .profile-mobile-row {
  border-top: 1px solid rgba(32, 35, 33, 0.08);
}

.profile-mobile-row-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #fffdf7;
}

.profile-mobile-row-icon i {
  width: 15px;
  height: 15px;
}

.profile-mobile-row-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-mobile-row-content strong {
  font-size: 14px;
  line-height: 1.25;
  color: var(--ink);
}

.profile-mobile-row-content span {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.5;
}

.profile-mobile-arrow {
  color: var(--muted);
}

.profile-mobile-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 800;
}

/* 手机端积分卡片 */
.profile-mobile-points {
  padding: 18px 18px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--portal-soft-line);
  box-shadow: var(--portal-warm-shadow);
}

.profile-mobile-points-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.profile-mobile-points-grid > div {
  display: grid;
  gap: 4px;
  padding: 8px 4px;
}

.profile-mobile-points-grid strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.profile-mobile-points-grid strong.red { color: var(--cinnabar); }
.profile-mobile-points-grid strong.gold { color: var(--gold); }

.profile-mobile-points-grid span {
  font-size: 11px;
  color: var(--muted);
}

/* 手机端最近动态 */
.profile-mobile-history {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.94);
  border: 1px solid var(--portal-soft-line);
  box-shadow: var(--portal-warm-shadow);
}

.profile-mobile-history-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1d1f1d;
}

.profile-mobile-history-head i,
.profile-mobile-history-head svg {
  width: 18px;
  height: 18px;
  color: var(--jade);
}

.profile-mobile-history-list {
  display: grid;
  gap: 10px;
}

.profile-mobile-history-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(32, 35, 33, 0.05);
}

.profile-mobile-history-item strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.profile-mobile-history-item span {
  font-size: 12px;
  color: var(--muted);
}

.profile-mobile-history-item em {
  font-size: 11px;
  color: var(--muted-3);
  font-style: normal;
}

.profile-mobile-history-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--muted-3);
  font-size: 13px;
}

.profile-theme-switch {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.profile-theme-switch i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--cinnabar);
}

.profile-points-strip,
.profile-signin-strip,
.profile-invite-strip,
.profile-mall-strip,
.profile-daoguan-strip {
  display: grid;
  gap: 16px;
}

.profile-points-grid strong.red,
.profile-stats-grid strong.red {
  color: var(--cinnabar);
}

.profile-points-grid strong.gold,
.profile-stats-grid strong.gold {
  color: var(--cinnabar, #b94132);
}

.profile-account-list,
.profile-quick-list,
.profile-history-list {
  gap: 14px;
}

.profile-account-card,
.profile-quick-card,
.profile-history-card {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
}

.profile-account-card .archive-stream-mark,
.profile-quick-card .archive-stream-mark,
.profile-history-card .archive-stream-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.profile-account-card .archive-stream-mark i,
.profile-quick-card .archive-stream-mark i,
.profile-history-card .archive-stream-mark i {
  width: 20px;
  height: 20px;
}

.profile-account-card .profile-account-meta,
.profile-quick-card .profile-quick-meta,
.profile-history-card .profile-history-meta {
  justify-content: flex-end;
}

.profile-signin-panel .primary-button,
.profile-mall-panel .primary-button,
.profile-daoguan-panel .primary-button {
  width: 100%;
}

.profile-mall-list,
.profile-recharge-list,
.profile-invite-list {
  display: grid;
  gap: 12px;
}

.profile-mall-item,
.profile-recharge-item,
.profile-invite-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--portal-panel-strong);
}

.profile-mall-item-head,
.profile-recharge-item-head,
.profile-invite-item-head,
.daoguan-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-mall-item p,
.profile-recharge-item p,
.profile-invite-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.profile-mall-actions,
.profile-recharge-actions,
.profile-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-inline-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.26);
  border-radius: 999px;
  background: #fffefb;
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.daoguan-topbar-note {
  color: var(--muted);
  font-size: 13px;
}

.daoguan-city-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(30, 111, 92, 0.22);
  border-radius: 999px;
  background: rgba(30, 111, 92, 0.08);
  color: var(--jade);
  font-size: 13px;
  font-weight: 900;
}

.daoguan-result-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.daoguan-result-info {
  display: grid;
  gap: 8px;
}

.daoguan-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.daoguan-result-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(30, 111, 92, 0.08);
  color: var(--jade);
  font-size: 11px;
  font-weight: 900;
}

.daoguan-result-distance {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--cinnabar);
  font-size: 12px;
  font-weight: 900;
}

.profile-daoguan-mobile-trigger {
  display: none;
}

/* Profile hero: remove outer atmosphere and stretch the member card */
.profile-hero.profile-hero-panel {
  display: block;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-hero-panel::after {
  display: none;
}

.profile-hero-panel .profile-member-shell {
  width: 100%;
  min-height: 168px;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  padding: 24px 26px;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  box-shadow: 0 20px 38px rgba(82, 44, 36, 0.12);
  color: var(--ink);
  column-gap: 18px;
}

.profile-hero-panel .profile-hero-copy {
  gap: 6px;
}

.profile-hero-panel .profile-hero-copy .eyebrow {
  color: var(--cinnabar);
}

.profile-hero-panel .profile-hero-copy h2.is-vip {
  color: var(--cinnabar);
}

.profile-hero-email {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
}

.profile-hero-expire {
  margin: 0;
  color: var(--warning);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.profile-hero-crown {
  color: var(--warning);
  font-size: 0.8em;
  vertical-align: top;
  margin-left: 6px;
}

.profile-vip-badge {
  right: -6px;
  bottom: -6px;
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
  border: 2px solid #fffdf7;
}

@media (max-width: 1180px) {
  .archive-dashboard-layout,
  .profile-dashboard-layout,
  .daoguan-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .archive-dashboard-side,
  .profile-dashboard-side,
  .daoguan-dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .profile-mobile-shell {
    display: block;
    margin: 0 0 16px;
  }

  .profile-dashboard-layout {
    display: none;
  }

  .profile-theme-switch {
    display: none;
  }

  .profile-daoguan-mobile-trigger {
    display: inline-flex;
  }

  .archive-dashboard-main,
  .profile-dashboard-main,
  .daoguan-dashboard-main {
    padding: 0 14px 96px;
  }

  .archive-dashboard-layout,
  .profile-dashboard-layout,
  .daoguan-dashboard-layout,
  .archive-dashboard-side,
  .profile-dashboard-side,
  .daoguan-dashboard-side {
    grid-template-columns: 1fr;
  }

  .archive-hero-panel,
  .profile-hero-panel,
  .daoguan-hero-panel {
    min-height: auto;
    padding: 20px 18px;
  }

  .archive-hero-panel::after,
  .profile-hero-panel::after,
  .daoguan-hero-panel::after {
    inset: auto -28% -70% 28%;
  }

  .archive-dashboard-badge {
    width: 100%;
    min-height: 120px;
  }

  .archive-command-panel,
  .archive-highlight-panel,
  .archive-list-panel,
  .archive-stats-panel,
  .archive-categories-panel,
  .archive-lottery-panel,
  .profile-member-panel,
  .profile-points-panel,
  .profile-account-panel,
  .profile-quick-panel,
  .profile-signin-panel,
  .profile-mall-panel,
  .profile-history-panel,
  .daoguan-search-panel,
  .daoguan-list-panel,
  .daoguan-spotlight-panel,
  .daoguan-filter-panel,
  .daoguan-city-panel {
    padding: 16px;
    border-radius: 18px;
    min-width: 0;
    overflow: hidden;
  }

  .archive-stats-grid,
  .profile-stats-grid,
  .profile-points-grid,
  .daoguan-spotlight-grid,
  .archive-detail-grid,
  .profile-detail-grid,
  .daoguan-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .archive-stream-card,
  .profile-module-card,
  .daoguan-module-card,
  .profile-account-card,
  .profile-quick-card,
  .profile-history-card,
  .daoguan-result-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .archive-stream-mark,
  .profile-module-mark,
  .daoguan-module-mark,
  .profile-account-card .archive-stream-mark,
  .profile-quick-card .archive-stream-mark,
  .profile-history-card .archive-stream-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .profile-member-shell {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .profile-hero.profile-hero-panel {
    margin-bottom: 14px;
  }

  .profile-hero-panel .profile-member-shell {
    min-height: 136px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 22px 20px;
    border-radius: 18px;
    column-gap: 18px;
    row-gap: 0;
    align-items: center;
  }

  .profile-hero-panel .profile-hero-copy {
    gap: 8px;
  }

  .profile-hero-panel .profile-hero-copy .eyebrow {
    font-size: 11px;
  }

  .profile-hero-panel .profile-hero-copy h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 900;
    line-height: 1.25;
  }

  .profile-hero-panel .profile-hero-copy h2.is-vip {
    color: var(--cinnabar);
  }

  .profile-hero-panel .profile-hero-email {
    font-size: 13px;
    line-height: 1.4;
  }

  .profile-hero-panel .profile-hero-expire {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
  }

  .profile-avatar-stack {
    width: 72px;
    height: 72px;
    font-size: 28px;
  }

  .profile-theme-switch,
  .profile-inline-button,
  .primary-button,
  .ghost-button {
    width: 100%;
    justify-content: center;
  }

  .portal-modal {
    width: calc(100vw - 16px);
  }

  .portal-modal-head,
  .portal-modal-actions,
  .portal-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .portal-modal-actions {
    flex-direction: column-reverse;
  }
}

@media (max-width: 540px) {
  .profile-daoguan-mobile-trigger {
    width: 100%;
    justify-content: center;
  }

  .archive-stats-grid,
  .profile-stats-grid,
  .profile-points-grid,
  .daoguan-spotlight-grid,
  .archive-detail-grid,
  .profile-detail-grid,
  .daoguan-detail-grid {
    grid-template-columns: 1fr;
  }

  .archive-stream-head,
  .profile-module-head,
  .daoguan-module-head,
  .archive-category-meta,
  .archive-lottery-meta,
  .profile-account-meta,
  .profile-quick-meta,
  .profile-history-meta,
  .daoguan-result-meta,
  .profile-mall-item-head,
  .profile-recharge-item-head,
  .profile-invite-item-head,
  .daoguan-filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .archive-command-head,
  .archive-list-header,
  .profile-card-head,
  .daoguan-card-head {
    flex-direction: column;
  }

  .lottery-modal-countdown {
    padding: 10px 12px;
  }

  .lottery-countdown-num {
    font-size: 18px;
  }

  .lottery-countdown-unit {
    min-width: 32px;
  }

  .lottery-countdown-sep {
    font-size: 16px;
    padding-bottom: 10px;
  }

  .lottery-countdown-label {
    font-size: 9px;
  }
}

/* ==================== Archive: New Card Styles + Mobile Flat List ==================== */

/* --- Resource Card (flat list row) --- */
.archive-resource-card {
  display: flex;
  align-items: center;
  padding: 16px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  gap: 12px;
  transition: background 0.15s;
  min-width: 0;
  overflow: hidden;
}

.archive-resource-card:active {
  background: var(--surface-2);
}

.archive-resource-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  background: var(--surface-2);
  color: var(--muted);
}

.archive-resource-icon.lottery {
  background: linear-gradient(135deg, rgba(var(--purple-rgb), 0.12), rgba(var(--purple-rgb), 0.20));
  color: var(--purple);
}

.archive-resource-info {
  flex: 1;
  min-width: 0;
}

.archive-resource-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  min-width: 0;
}

.archive-resource-title-row strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

.archive-resource-info p {
  font-size: 13px;
  color: var(--muted-2);
  margin: 2px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-resource-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted-2);
}

/* Badge */
.archive-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}

.archive-badge.pin {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--cinnabar, #b94132);
}

.archive-badge.new {
  background: rgba(var(--accent-rgb), 0.11);
  color: var(--cinnabar, #b94132);
}

/* Download button */
.archive-download-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--cinnabar);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.archive-download-btn:active {
  opacity: 0.8;
}

/* Lottery join button */
.archive-lottery-join-btn {
  min-height: 44px;
  height: 40px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: var(--cinnabar);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.archive-lottery-join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.archive-lottery-join-btn:not(:disabled):active {
  opacity: 0.8;
}

/* 让抽奖卡片正文占满剩余空间 */
.archive-lottery-card .archive-module-body,
.archive-lottery-card .archive-stream-mark + .archive-module-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.archive-stream-mark {
  flex-shrink: 0;
}

/* --- Lottery Modal --- */
.lottery-modal-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.lottery-modal-stat {
  text-align: center;
  padding: 18px 10px 14px;
  background: linear-gradient(145deg, #fef9f2 0%, #fdf5eb 100%);
  border: 1px solid rgba(200, 160, 120, 0.25);
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(180, 130, 80, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lottery-modal-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(180, 130, 80, 0.14);
}

.lottery-modal-stat-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.lottery-modal-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #c0392b;
  line-height: 1.2;
}

/* --- Lottery Countdown --- */
.lottery-modal-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 18px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #fef5f0 0%, #fce8d9 100%);
  border: 1px solid rgba(210, 140, 80, 0.3);
  border-radius: 14px;
}

.lottery-modal-countdown.ended {
  background: linear-gradient(135deg, #f5f5f0 0%, #e8e8e0 100%);
  border-color: rgba(150, 150, 140, 0.25);
}

.lottery-countdown-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.lottery-countdown-digits {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lottery-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
}

.lottery-countdown-num {
  font-size: 24px;
  font-weight: 800;
  color: #8b3a1a;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.lottery-countdown-label {
  font-size: 10px;
  font-weight: 600;
  color: #a67c52;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lottery-countdown-sep {
  font-size: 20px;
  font-weight: 700;
  color: #c89a6a;
  padding-bottom: 14px;
}

.lottery-countdown-ended-text {
  font-size: 15px;
  font-weight: 700;
  color: #8c8c80;
  letter-spacing: 0.03em;
}

.lottery-modal-section {
  margin-top: 14px;
}

.lottery-modal-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 10px;
  padding-left: 2px;
}

.lottery-modal-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lottery-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0d6b8, #e8c49a);
  color: #7a4a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(160, 110, 60, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.15s ease;
  cursor: default;
}

.lottery-avatar:hover {
  transform: scale(1.12);
  z-index: 1;
}

/* --- Mobile: Flat list override --- */
@media (max-width: 760px) {
  /* Hide desktop-only elements on mobile */
  .archive-hero-panel,
  .archive-dashboard-side,
  .archive-highlight-panel {
    display: none !important;
  }

  .archive-dashboard-layout {
    display: block;
  }

  .archive-dashboard-primary {
    /* Keep desktop panel style on mobile */
    min-width: 0;
    overflow: hidden;
  }

  .archive-card-list {
    min-width: 0;
    overflow: hidden;
  }

  /* Tab bar: gray capsule, horizontal scroll */
  .archive-tab-bar {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: rgba(32, 35, 33, 0.06);
    border-radius: 10px;
    margin-bottom: 12px;
    scroll-snap-type: x proximity;
  }

  .archive-tab-bar::-webkit-scrollbar {
    display: none;
  }

  .archive-tab {
    flex-shrink: 0;
    padding: 0 16px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
    scroll-snap-align: start;
  }

  .archive-tab.active {
    background: var(--cinnabar);
    color: #fffdf7;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb), 0.24);
  }

  .archive-tab i {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--cinnabar);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
    font-style: normal;
    z-index: 2;
  }

  .archive-tab.active i {
    box-shadow: 0 0 0 2px var(--portal-panel-strong);
  }

  /* Search bar */
  .archive-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    background: #fffefb;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0 14px;
    margin-bottom: 12px;
    min-width: 0;
    overflow: hidden;
  }

  .archive-search-bar i {
    color: var(--muted);
    font-size: 14px;
  }

  .archive-search-bar input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
  }

  .archive-search-bar input::placeholder {
    color: var(--muted);
  }

  /* List header */
  .archive-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 4px 12px;
  }

  .archive-list-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
  }

  .archive-list-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--cinnabar);
  }

  .archive-list-meta b {
    font-weight: 700;
  }

  /* Card list */
  .archive-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  /* Resource card on mobile */
  .archive-resource-card {
    padding: 12px 4px;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
  }

  .archive-resource-icon {
    width: 34px;
    height: 34px;
    font-size: 15px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .archive-resource-info {
    min-width: 0;
    flex: 1;
  }

  .archive-resource-title-row {
    min-width: 0;
  }

  .archive-resource-title-row strong {
    font-size: 14px;
    max-width: 100%;
    display: block;
  }

  .archive-download-btn {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .archive-lottery-join-btn {
    min-height: 44px;
    height: 40px;
    padding: 0 14px;
    font-size: 12px;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .archive-lottery-card,
  .archive-category-card {
    padding: 12px 14px;
    gap: 10px;
    border-radius: 12px;
  }

  .archive-lottery-card strong,
  .archive-category-card strong {
    font-size: 14px;
  }

  .archive-lottery-card p,
  .archive-category-card p {
    font-size: 12px;
    line-height: 1.5;
  }

  .archive-lottery-meta,
  .archive-category-meta {
    font-size: 11px;
    gap: 8px;
  }

  /* Dark mode: CSS variables handle this automatically */
}

/* ==================== Daoguan Navigation ==================== */

.dg-wrap {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0 120px;
}

/* Header */
.dg-header {
  background: var(--portal-panel);
  padding: 10px 14px 12px;
  position: relative;
}

.dg-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 10px;
}
.dg-back {
  position: absolute;
  left: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--cinnabar);
  text-decoration: none;
  cursor: pointer;
}
.dg-back svg {
  width: 18px;
  height: 18px;
}
.dg-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .5px;
  color: var(--ink);
}
.dg-count {
  position: absolute;
  right: 0;
  font-size: 12px;
  color: var(--muted);
}

/* Locate + Search row */
.dg-locate-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dg-locate-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  min-width: 0;
}
.dg-locate-btn svg {
  color: var(--cinnabar);
  flex-shrink: 0;
}
.dg-locate-btn .dg-locate-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.dg-locate-btn .dg-locate-arrow {
  flex-shrink: 0;
  color: var(--muted);
}

.dg-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 8px 14px;
}
.dg-search-box svg { color: var(--muted); flex-shrink: 0; }
.dg-search-input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
  font-family: inherit;
}
.dg-search-input::placeholder { color: var(--muted); }

.dg-locate-loading {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0;
}
.dg-locate-loading.show { display: flex; }
.dg-locate-loading svg { animation: dg-spin 0.9s linear infinite; color: var(--cinnabar); }
@keyframes dg-spin { to { transform: rotate(360deg); } }

/* Sect filter bar */
.dg-sect-bar {
  margin: 10px 14px 12px;
  background: var(--portal-panel);
  border-radius: 14px;
  display: flex;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
}
.dg-sect-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 0;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.dg-sect-btn.active {
  color: var(--cinnabar);
  background: rgba(var(--accent-rgb), 0.08);
}

/* Temple cards */
.dg-list { padding: 0 14px; display: flex; flex-direction: column; gap: 10px; }
.dg-card {
  background: var(--portal-panel);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.dg-card-top { display: flex; align-items: center; gap: 8px; }
.dg-name-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.dg-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-tag {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.dg-tag.quanzhen { background: rgba(var(--accent-rgb), 0.08); color: var(--cinnabar); }
.dg-tag.zhengyi { background: rgba(var(--blue-rgb), 0.08); color: var(--blue); }

.dg-dist {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.dg-addr-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 10px;
}
.dg-addr-icon { color: var(--muted); flex-shrink: 0; margin-top: 3px; }
.dg-addr-icon svg { width: 14px; height: 14px; }
.dg-addr {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.dg-actions { display: flex; gap: 8px; margin-top: 12px; }
.dg-btn {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s;
  font-family: inherit;
}
.dg-btn:active { transform: scale(0.96); }
.dg-btn svg { width: 14px; height: 14px; }
.dg-btn-copy { background: var(--surface-strong); color: var(--muted); }
.dg-btn-nav { background: var(--cinnabar); color: #fff; }

.dg-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 14px;
}

/* Pager */
.dg-pager {
  display: flex; justify-content: center; align-items: center;
  gap: 12px;
  padding: 20px 14px 10px;
}
.dg-pager button {
  border: none;
  background: var(--portal-panel);
  color: var(--cinnabar);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.dg-pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.dg-pager-info { font-size: 12px; color: var(--muted); }

/* ===== Archive pager (资料库分页) ===== */
.archive-pager {
  display: flex; justify-content: center; align-items: center;
  gap: 12px;
  padding: 20px 14px 10px;
}
.archive-pager button {
  border: none;
  background: var(--portal-panel);
  color: var(--cinnabar);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.archive-pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.archive-pager-info { font-size: 12px; color: var(--muted); }
.archive-pager-lottery { padding: 14px 14px 6px; }

/* ===== City picker overlay ===== */
.dg-city-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--portal-panel-strong);
  z-index: 300;
  flex-direction: column;
}
.dg-city-overlay.show { display: flex; }

.dg-city-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dg-city-back {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-strong);
  color: var(--cinnabar);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dg-city-back svg { width: 16px; height: 16px; }

.dg-city-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-strong);
  border-radius: 18px;
  padding: 8px 14px;
  margin-left: 10px;
}
.dg-city-search-wrap svg { color: var(--muted); flex-shrink: 0; }
.dg-city-search-input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  min-width: 0;
  font-family: inherit;
}
.dg-city-search-input::placeholder { color: var(--muted); }

.dg-city-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dg-city-tab {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 0;
  cursor: pointer;
  position: relative;
  font-family: inherit;
}
.dg-city-tab.active { color: var(--ink); }
.dg-city-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--cinnabar);
  border-radius: 2px;
}

.dg-city-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 20px;
}

.dg-city-section-title {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 10px;
  font-weight: 600;
}
.dg-city-recommend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dg-city-rec-btn {
  border: none;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.dg-city-rec-btn svg { width: 12px; height: 12px; color: var(--cinnabar); }

.dg-city-alpha-group { margin-top: 16px; }
.dg-city-alpha-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--line);
}
.dg-city-alpha-list { display: flex; flex-direction: column; }
.dg-city-item {
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  padding: 12px 0;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--portal-soft-line);
  font-family: inherit;
}
.dg-city-item:active { background: var(--surface-strong); }

.dg-city-index-bar {
  position: fixed;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 310;
}
.dg-city-index-letter {
  font-size: 10px;
  color: var(--muted);
  padding: 2px 4px;
  cursor: pointer;
  font-weight: 600;
}
.dg-city-index-letter:active { color: var(--cinnabar); }

/* ===== 道观导航 — 电脑端桌面布局 ===== */
@media (min-width: 761px) {
  body[data-page="daoguan"] .dg-wrap {
    max-width: none;
    padding: 0 0 40px;
  }

  body[data-page="daoguan"] .dg-header {
    border-radius: 18px;
    margin: 0 0 16px;
    padding: 16px 20px;
    background: var(--portal-panel);
    border: 1px solid var(--portal-soft-line);
    box-shadow: var(--portal-warm-shadow);
  }

  body[data-page="daoguan"] .dg-top-row {
    margin-bottom: 14px;
  }

  body[data-page="daoguan"] .dg-title {
    font-size: 20px;
  }

  body[data-page="daoguan"] .dg-sect-bar {
    margin: 0 0 16px;
    max-width: 360px;
    border-radius: 12px;
    border: 1px solid var(--portal-soft-line);
    box-shadow: none;
  }

  body[data-page="daoguan"] .dg-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  body[data-page="daoguan"] .dg-card {
    border: 1px solid var(--portal-soft-line);
    box-shadow: var(--portal-warm-shadow);
    border-radius: 16px;
    padding: 14px;
    background: var(--portal-panel);
  }

  body[data-page="daoguan"] .dg-pager {
    padding: 24px 0 10px;
  }
}

/* ========== 香谱查询 ========== */
.incense-wrap {
  max-width: none;
  margin: 0 auto;
  padding: 16px;
}

.incense-header {
  position: sticky;
  top: 0;
  z-index: 50;
  margin-bottom: 16px;
  padding: 8px 0;
  background: var(--bg, #f4f3ee);
  backdrop-filter: blur(8px);
}

.incense-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.incense-back {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--portal-panel-strong, #fffefb);
  box-shadow: 0 4px 12px rgba(33, 36, 31, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.incense-back:active {
  background: rgba(var(--accent-rgb), 0.12);
}

.incense-back i,
.incense-back svg {
  width: 20px;
  height: 20px;
  color: var(--ink, #221f1b);
}

.incense-title {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink, #221f1b);
  margin: 0;
  text-align: center;
}

.incense-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #8a8580);
  flex-shrink: 0;
  white-space: nowrap;
}

/* 上香步骤 + 看香18诀入口 */
.incense-top-sections {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.incense-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink, #221f1b);
  margin-bottom: 12px;
}

/* 上香步骤卡片 - 与全站板块统一 */
.incense-steps-card {
  padding: 20px;
  border: 1px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
  border-radius: 18px;
  background: var(--portal-panel, rgba(255, 253, 247, 0.92));
  box-shadow: var(--portal-warm-shadow, 0 18px 48px rgba(46, 41, 33, 0.1));
}

.incense-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.incense-step-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.6;
}

.incense-step-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--cinnabar, #b94132);
  flex-shrink: 0;
}

.incense-step-desc {
  font-size: 13px;
  color: var(--ink, #221f1b);
}

/* 看香18诀 + 供香礼仪 入口对（一排两列） */
.incense-entry-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-self: start;
}

.incense-entry-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
  border-radius: 18px;
  background: var(--portal-panel, rgba(255, 253, 247, 0.92));
  box-shadow: var(--portal-warm-shadow, 0 18px 48px rgba(46, 41, 33, 0.1));
  transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.incense-entry-item:hover {
  border-color: var(--cinnabar, var(--accent-light, #c95c4c));
  transform: translateY(-2px);
}

.incense-entry-item:active {
  transform: translateY(0);
}

.incense-entry-item-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.incense-entry-item-text span {
  font-size: 12px;
  color: var(--muted, #8a8580);
  margin-bottom: 4px;
}

.incense-entry-item-text strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--cinnabar, #b94132);
  line-height: 1.2;
}

/* 看香18诀入口 */
.incense-18-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.incense-18-entry:hover {
  box-shadow: 0 12px 28px rgba(var(--accent-rgb), 0.14);
}

.incense-18-entry-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e6f5c, #2a8a72);
  color: #fffdf7;
  flex-shrink: 0;
}

.incense-18-entry-icon i,
.incense-18-entry-icon svg {
  width: 24px;
  height: 24px;
}

.incense-18-entry-text {
  flex: 1;
  min-width: 0;
}

.incense-18-entry-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #221f1b);
  margin-bottom: 2px;
}

.incense-18-entry-desc {
  font-size: 12px;
  color: var(--muted, #8a8580);
}

.incense-18-entry-arrow {
  width: 20px;
  height: 20px;
  color: var(--muted, #8a8580);
  flex-shrink: 0;
}

/* 搜索框 */
.incense-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--portal-panel-strong, #fffefb);
  border: 1px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(33, 36, 31, 0.04);
}

.incense-search-wrap i,
.incense-search-wrap svg {
  width: 18px;
  height: 18px;
  color: var(--muted, #8a8580);
  flex-shrink: 0;
}

.incense-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink, #221f1b);
}

/* 香谱卡片网格 */
.incense-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.incense-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px 10px;
  background: var(--portal-panel-strong, #fffefb);
  border: 1px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(33, 36, 31, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  color: inherit;
  font: inherit;
}

@media (hover: hover) {
  .incense-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.12);
  }
}

.incense-card:active {
  transform: translateY(0);
}

.incense-card-icon {
  width: 100%;
  aspect-ratio: 74 / 106;
  margin-bottom: 8px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(var(--accent-rgb), 0.06);
}

.incense-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.incense-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--cinnabar, #b94132);
  background: rgba(var(--accent-rgb), 0.08);
}

.incense-svg {
  width: 100%;
  height: 100%;
}

.incense-card-name {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink, #221f1b);
  line-height: 1.3;
  margin-bottom: 2px;
  word-break: break-all;
}

.incense-card-id {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted, #8a8580);
}

.incense-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-size: 14px;
  color: var(--muted, #8a8580);
}

/* 供香礼仪 */
.incense-etiquette-card {
  padding: 20px;
  margin-bottom: 20px;
}

.incense-etiquette-item {
  padding: 12px 0;
  border-bottom: 0.5px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
}

.incense-etiquette-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.incense-etiquette-item:first-child {
  padding-top: 0;
}

.incense-etiquette-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--cinnabar, #b94132);
  margin-bottom: 4px;
}

.incense-etiquette-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted, #8a8580);
}

/* 底部声明 */
.incense-disclaimer {
  text-align: center;
  padding: 20px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted, #8a8580);
  background: rgba(var(--accent-rgb), 0.05);
  border-radius: 14px;
}

/* 弹窗 */
.incense-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(33, 36, 31, 0.5);
  backdrop-filter: blur(4px);
}

.incense-modal-overlay.show {
  display: flex;
}

.incense-modal {
  width: min(440px, 90vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #fffefb;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(33, 36, 31, 0.2);
  overflow: hidden;
}

.incense-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 0.5px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
  flex-shrink: 0;
}

.incense-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--ink, #221f1b);
}

.incense-modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.08);
  cursor: pointer;
}

.incense-modal-close i,
.incense-modal-close svg {
  width: 18px;
  height: 18px;
  color: var(--muted, #8a8580);
}

.incense-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.incense-modal-section {
  margin-bottom: 18px;
}

.incense-modal-section:last-child {
  margin-bottom: 0;
}

.incense-modal-section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--cinnabar, #b94132);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--portal-soft-line, rgba(32, 35, 33, 0.08));
}

.incense-modal-section-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink, #221f1b);
  white-space: pre-wrap;
}

/* 看香18诀卡片 */
.incense-18-list {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.incense-18-card {
  padding: 18px;
}

.incense-18-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.incense-18-card-num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cinnabar, #b94132);
  color: #fffdf7;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}

.incense-18-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink, #221f1b);
}

.incense-18-card-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted, #8a8580);
}

/* 手机端：香谱查询 */
@media (max-width: 760px) {
  .incense-top-sections {
    grid-template-columns: 1fr;
  }

  .incense-entry-pair {
    grid-template-columns: 1fr 1fr;
  }

  .incense-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .incense-card {
    padding: 10px 6px 8px;
  }

  .incense-card-icon {
    border-radius: 8px;
  }

  .incense-card-name {
    font-size: 11px;
  }

  .incense-title {
    font-size: 18px;
  }
}
