: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);
}

html[data-theme='night'] {
  --bg: #141617;
  --surface: #191d1b;
  --surface-strong: #242926;
  --ink: #f1eee6;
  --muted: #a2ada8;
  --line: rgba(235, 232, 223, 0.12);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.36);
  --portal-panel: rgba(24, 28, 27, 0.92);
  --portal-panel-strong: #1d2220;
  --portal-soft-line: rgba(255, 253, 247, 0.08);
  --portal-warm-shadow: 0 22px 54px rgba(0, 0, 0, 0.3);
}

html[data-theme='night'] body {
  background:
    radial-gradient(circle at 12% 18%, rgba(185, 65, 50, 0.14), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(30, 111, 92, 0.16), transparent 28%),
    var(--bg);
}

.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(185, 65, 50, 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, 2fr) minmax(220px, 0.65fr);
  gap: 18px;
  align-items: start;
}

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

.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: 24px;
  background: var(--portal-panel);
  box-shadow: var(--portal-warm-shadow);
}

.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 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: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.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: 42px;
  padding: 0 16px;
  border: 1px solid rgba(32, 35, 33, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.archive-tab.active,
.profile-chip-tab.active,
.daoguan-chip-tab.active {
  border-color: rgba(185, 65, 50, 0.55);
  color: var(--cinnabar);
}

.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: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--portal-panel-strong);
}

.archive-stats-grid strong,
.profile-stats-grid strong,
.profile-points-grid strong,
.daoguan-spotlight-grid strong {
  font-size: 20px;
}

.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;
}

.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: 24px;
  display: grid;
  gap: 16px;
}

.archive-category-card,
.archive-lottery-card,
.profile-account-card,
.profile-quick-card,
.profile-history-card,
.daoguan-result-card,
.daoguan-city-card {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  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(185, 65, 50, 0.38);
  box-shadow: 0 10px 22px rgba(185, 65, 50, 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: 16px;
}

.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(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.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: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.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: 22px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 242, 0.78)),
    radial-gradient(circle at 88% 22%, rgba(185, 65, 50, 0.18), transparent 28%),
    radial-gradient(circle at 10% 88%, rgba(181, 138, 52, 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;
}

.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: 22px;
  background: var(--portal-panel-strong);
  text-align: left;
  cursor: pointer;
}

.archive-stream-card.lottery {
  border-color: rgba(185, 65, 50, 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, #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, #9b7428, var(--gold));
}

.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));
}

.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(185, 65, 50, 0.12);
  color: var(--cinnabar);
}

.archive-pill.new,
.profile-pill.new,
.daoguan-pill.new,
.archive-pill.hot {
  background: rgba(181, 138, 52, 0.16);
  color: #8b651d;
}

.archive-pill.vip,
.profile-pill.vip,
.portal-badge.vip {
  background: rgba(185, 65, 50, 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: 28px;
  background: var(--portal-panel);
  box-shadow: var(--portal-warm-shadow);
}

.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);
}

.portal-modal-body {
  display: grid;
  gap: 16px;
  padding: 0 22px 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-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: 22px;
  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: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  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: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fffdf7;
}

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

.profile-mobile-row-content strong {
  font-size: 17px;
  line-height: 1.25;
}

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

.profile-mobile-arrow {
  color: #c0b7ad;
}

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

.profile-mobile-toggle {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(32, 35, 33, 0.12);
}

.profile-mobile-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: all 0.24s ease;
}

.profile-mobile-toggle.on {
  background: var(--jade);
}

.profile-mobile-toggle.on::after {
  left: 22px;
}

.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(185, 65, 50, 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(--gold);
}

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

.profile-account-card,
.profile-quick-card,
.profile-history-card {
  grid-template-columns: 54px 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: 54px;
  height: 54px;
}

.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(185, 65, 50, 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(185, 65, 50, 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: 28px;
  border: 1px solid rgba(185, 65, 50, 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-email {
  margin: 0;
  color: #8f8479;
  font-size: 15px;
  line-height: 1.3;
}

.profile-hero-expire {
  margin: 0;
  color: #bb6b26;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.profile-hero-crown {
  color: #f59a23;
  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;
}

html[data-theme='night'] .profile-hero-email {
  color: #b7aea4;
}

html[data-theme='night'] .profile-hero-expire {
  color: #e7a861;
}

html[data-theme='night'] .profile-vip-badge {
  border-color: #1d2220;
}

@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: 20px;
  }

  .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: 48px 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: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .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: 18px 16px;
    border-radius: 24px;
    column-gap: 14px;
  }

  .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;
  }
}

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

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

.archive-resource-card:active {
  background: #f2f2f7;
}

.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: #f3f4f6;
  color: #6b7280;
}

.archive-resource-icon.lottery {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}

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

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

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

.archive-resource-info p {
  font-size: 13px;
  color: #8e8e93;
  margin: 2px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-resource-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #8e8e93;
}

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

.archive-badge.pin {
  background: #fee2e2;
  color: #dc2626;
}

.archive-badge.new {
  background: #fee2e2;
  color: #dc2626;
}

/* Download button */
.archive-download-btn {
  width: 36px;
  height: 36px;
  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 {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  background: var(--cinnabar);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

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

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

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

.lottery-modal-stat {
  text-align: center;
  padding: 12px 8px;
  background: #f9fafb;
  border-radius: 10px;
}

.lottery-modal-stat-label {
  display: block;
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 4px;
}

.lottery-modal-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

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

.lottery-modal-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}

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

.lottery-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cinnabar);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

/* --- 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 */
  }

  /* Tab bar: gray capsule, horizontal scroll */
  .archive-tab-bar {
    display: flex;
    gap: 0;
    padding: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 12px;
  }

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

  .archive-tab {
    flex-shrink: 0;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
  }

  .archive-tab.active {
    color: var(--ink);
    font-weight: 600;
  }

  .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: 8px;
    background: var(--surface-strong);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
  }

  .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: 14px 4px;
  }

  .archive-resource-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .archive-resource-title-row strong {
    font-size: 14px;
  }

  .archive-download-btn {
    width: 32px;
    height: 32px;
  }

  .archive-lottery-join-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* 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: 20px;
  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(185, 65, 50, 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(185, 65, 50, 0.08); color: var(--cinnabar); }
.dg-tag.zhengyi { background: rgba(37, 99, 235, 0.08); color: #2563eb; }

.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); }

/* ===== 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: 20px;
  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: 20px;
  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: 20px;
    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;
  }
}
