/* 芯火村 · 登录弹窗 / 页面守卫 / 顶栏登录状态 */

/* ---------- 弹窗 ---------- */
.xh-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.xh-auth-modal[hidden] { display: none; }

.xh-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, .72);
  backdrop-filter: blur(6px);
}

.xh-auth-panel {
  position: relative;
  width: min(100%, 400px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 38px 32px 26px;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(255, 231, 166, .06), rgba(12, 14, 20, .9)),
    rgba(14, 16, 22, .96);
  border: 1px solid rgba(218, 156, 65, .35);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
  animation: xh-auth-pop .28s cubic-bezier(.22, 1, .36, 1);
}

@keyframes xh-auth-pop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.xh-auth-x {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  color: rgba(247, 229, 195, .5);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
}

.xh-auth-x:hover { color: rgba(247, 229, 195, .9); }

.xh-auth-eyebrow {
  margin-bottom: 12px;
  color: var(--xh-faint, rgba(247, 229, 195, .45));
  font-size: 11px;
  letter-spacing: 3px;
}

.xh-auth-title {
  margin: 0 0 6px;
  color: var(--xh-gold, #f4c879);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 2px;
}

.xh-auth-desc {
  margin: 0 0 22px;
  color: var(--xh-muted, rgba(247, 229, 195, .7));
  font-size: 13px;
}

.xh-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid rgba(218, 156, 65, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.xh-auth-tabs button {
  min-height: 38px;
  color: var(--xh-muted, rgba(247, 229, 195, .65));
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 0;
  border-radius: 9px;
  background: transparent;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}

.xh-auth-tabs button.is-active {
  color: var(--xh-on-gold, #2a1707);
  font-weight: 700;
  background: linear-gradient(135deg, #f4c879, #d7a95f);
  box-shadow: 0 4px 12px rgba(215, 169, 95, .16);
}

.xh-auth-panel form[hidden] { display: none; }

.xh-auth-panel input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  margin-bottom: 12px;
  color: var(--xh-text, #f7e5c3);
  font: inherit;
  letter-spacing: 1px;
  text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(218, 156, 65, .3);
  border-radius: 12px;
  box-sizing: border-box;
}

.xh-auth-panel input:focus {
  border-color: rgba(244, 200, 121, .6);
  outline: none;
}

.xh-auth-submit {
  width: 100%;
  min-height: 46px;
  color: var(--xh-on-gold, #2a1707);
  font: inherit;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  background: linear-gradient(135deg, #f4c879, #d7a95f);
  border: none;
  border-radius: 12px;
}

.xh-auth-submit:hover { filter: brightness(1.07); }
.xh-auth-submit:disabled { opacity: .55; cursor: wait; }

.xh-auth-hint {
  margin: 12px 0 0;
  color: var(--xh-faint, rgba(247, 229, 195, .45));
  font-size: 12px;
}

.xh-auth-hint.error, .xh-auth-hint.is-error { color: #ff8a3d; }

.xh-auth-tabs[hidden] { display: none; }
.xh-auth-link { display: block; margin: 10px auto 0; padding: 6px 8px; border: 0; background: none; color: var(--xh-gold, #f4c879); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.xh-auth-link:hover, .xh-auth-link:focus-visible { color: #ffe0a5; }

/* 灵感工坊在原邀请码弹窗上增加邮箱创作者入口。 */
.xh-workshop-auth { z-index: 220; }
.xh-workshop-auth-panel { width: min(100%, 440px); max-height: min(44rem, 92vh); overflow: auto; text-align: left; }
.xh-workshop-auth-panel .xh-auth-eyebrow, .xh-workshop-auth-panel .xh-auth-title, .xh-workshop-auth-panel .xh-auth-desc { text-align: center; }
/* 登录面板常驻；下方「注册」是与登录同宽的描边按钮，邀请码绑定作为更弱的文字入口 */
.xh-workshop-switch { display: grid; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(218, 156, 65, .22); }
.xh-workshop-register { width: 100%; min-height: 46px; border: 1px solid rgba(244, 200, 121, .55); border-radius: 12px; color: var(--xh-gold, #f4c879); background: rgba(244, 200, 121, .08); font: inherit; font-weight: 700; letter-spacing: 1px; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.xh-workshop-register:hover, .xh-workshop-register:focus-visible { border-color: rgba(255, 218, 143, .8); background: rgba(244, 200, 121, .16); }
.xh-workshop-back { width: 100%; margin-top: 10px; }
/* 点遮罩不关闭（只有 × 能关），遮罩不再显示手型 */
.xh-workshop-auth .xh-auth-backdrop { cursor: default; }
.xh-workshop-auth-panel form { display: grid; gap: 12px; }
.xh-workshop-auth-panel label { display: grid; gap: 6px; color: var(--xh-muted, rgba(247, 229, 195, .75)); font-size: 13px; }
.xh-workshop-auth-panel input, .xh-workshop-auth-panel textarea { width: 100%; box-sizing: border-box; padding: 0 14px; color: var(--xh-text, #f7e5c3); font: inherit; background: rgba(255, 255, 255, .04); border: 1px solid rgba(218, 156, 65, .3); border-radius: 12px; }
.xh-workshop-auth-panel input { min-height: 46px; }
.xh-workshop-auth-panel textarea { min-height: 76px; padding-block: 12px; resize: vertical; }
.xh-workshop-success { padding: 10px 0 4px; text-align: center; }
.xh-workshop-success-mark { display: inline-grid; width: 58px; height: 58px; place-items: center; border: 1px solid rgba(244, 200, 121, .72); border-radius: 50%; color: #2a1707; font-size: 31px; font-weight: 800; background: linear-gradient(135deg, #f4c879, #d7a95f); box-shadow: 0 8px 28px rgba(215, 169, 95, .24); }
.xh-workshop-success h3 { margin: 18px 0 8px; color: var(--xh-gold, #f4c879); font-size: 21px; }
.xh-workshop-success p { margin: 0 0 22px; color: var(--xh-muted, rgba(247, 229, 195, .75)); font-size: 13px; }
.xh-workshop-demo { margin: 0; padding: 9px 12px; border: 1px dashed rgba(244, 200, 121, .55); border-radius: 10px; color: var(--xh-gold, #f4c879); background: rgba(244, 200, 121, .08); font-size: 12px; text-align: center; }
.xh-workshop-quiet { min-height: 36px; border: 0; color: var(--xh-gold, #f4c879); background: transparent; font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
body[data-workshop-auth] .xh-auth-menu .xh-auth-menu-item { width: 100%; text-align: left; }

@media (max-width: 760px) {
  .xh-workshop-auth { align-items: end; padding: 10px; }
  .xh-workshop-auth-panel { width: 100%; max-height: calc(100dvh - 20px); padding: 32px 20px 22px; }
}

/* ---------- 灵感工坊 · 个人中心浮层（复用登录弹窗玻璃面板视觉） ---------- */
.xh-workshop-profile { z-index: 220; }
.xh-profile-panel { width: min(100%, 460px); }
.xh-profile-card { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 6px 14px; padding: 16px; margin: 0 0 18px; border: 1px solid rgba(218, 156, 65, .26); border-radius: 14px; background: rgba(255, 255, 255, .03); }
.xh-profile-avatar { display: grid; place-items: center; width: 52px; height: 52px; grid-row: span 2; color: var(--xh-gold, #f4c879); font-size: 22px; line-height: 1; border: 1px solid rgba(244, 200, 121, .55); border-radius: 50%; background: rgba(255, 236, 184, .16); box-shadow: inset 0 0 12px rgba(255, 246, 207, .14); }
.xh-profile-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.xh-profile-name { overflow: hidden; color: var(--xh-cream, #fff1d2); font-size: 17px; letter-spacing: 1px; text-overflow: ellipsis; white-space: nowrap; }
.xh-profile-role { flex: none; padding: 1px 10px; color: var(--xh-gold, #f4c879); font-size: 12px; letter-spacing: 1px; border: 1px solid rgba(244, 200, 121, .4); border-radius: 999px; background: rgba(244, 200, 121, .08); }
.xh-profile-bio { grid-column: 2 / -1; margin: 0; color: var(--xh-muted, rgba(247, 229, 195, .75)); font-size: 13px; line-height: 1.7; }
.xh-profile-bio.is-empty { color: var(--xh-faint, rgba(247, 229, 195, .45)); }
.xh-profile-card [data-profile-edit] { grid-column: 3; grid-row: 1; justify-self: end; }
.xh-profile-form { margin: 0 0 18px; }
.xh-profile-form-actions { display: flex; align-items: center; gap: 10px; }
.xh-profile-form-actions .xh-auth-submit { flex: 1; }
.xh-profile-section { padding: 14px 0 0; margin: 0 0 14px; border-top: 1px solid rgba(218, 156, 65, .22); }
.xh-profile-label { margin: 0 0 8px; color: var(--xh-gold, #f4c879); font-size: 12.5px; font-weight: 600; letter-spacing: 2px; }
.xh-profile-line { margin: 0 0 10px; color: var(--xh-muted, rgba(247, 229, 195, .75)); font-size: 13px; line-height: 1.7; }
.xh-profile-line b { color: var(--xh-text, #f7e5c3); font-weight: 600; }
.xh-profile-bind { display: grid; gap: 12px; }
.xh-profile-logout { min-height: 40px; padding: 0 16px; color: rgba(247, 229, 195, .62); font: inherit; font-size: 13px; cursor: pointer; background: rgba(255, 255, 255, .02); border: 1px solid rgba(218, 156, 65, .3); border-radius: 12px; transition: all .2s ease; }
.xh-profile-logout:hover { color: #ffd98c; border-color: rgba(244, 200, 121, .55); background: rgba(200, 168, 75, .07); }
/* 我的报名 / 微信申请审核：条目行 */
.xh-profile-signup, .xh-profile-request { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin: 0 0 8px; border: 1px solid rgba(218, 156, 65, .22); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.xh-profile-signup > div, .xh-profile-request > div:first-child { display: grid; gap: 3px; min-width: 0; }
.xh-profile-signup b, .xh-profile-request b { color: var(--xh-text, #f7e5c3); font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xh-profile-signup span, .xh-profile-request span { color: var(--xh-muted, rgba(247, 229, 195, .6)); font-size: 12px; }
.xh-profile-locked { flex: none; color: var(--xh-faint, rgba(247, 229, 195, .45)); font-size: 12px; }
.xh-profile-locked.is-approved { color: var(--xh-success, #7dc290); }
.xh-profile-mini-btn { flex: none; min-height: 32px; padding: 0 14px; color: rgba(247, 229, 195, .72); font: inherit; font-size: 12.5px; cursor: pointer; background: rgba(255, 255, 255, .03); border: 1px solid rgba(218, 156, 65, .32); border-radius: 999px; transition: all .18s ease; }
.xh-profile-mini-btn:hover { color: #ffd98c; border-color: rgba(244, 200, 121, .55); }
.xh-profile-mini-btn:disabled { opacity: .5; cursor: wait; }
.xh-profile-mini-btn.is-primary { color: var(--xh-on-gold, #2a1707); font-weight: 700; background: linear-gradient(135deg, #f4c879, #d7a95f); border: none; }
.xh-profile-request-actions { display: flex; gap: 8px; }
.xh-profile-qr { display: block; width: 180px; max-width: 100%; margin: 4px 0 6px; padding: 8px; background: #fff; border: 1px solid rgba(218, 156, 65, .4); border-radius: 12px; }

/* ---------- 入村公告屏（登录成功后展示，复用登录弹窗视觉） ---------- */
.xh-notice-panel {
  width: min(100%, 520px);
  text-align: left;
}

.xh-notice-panel .xh-auth-title,
.xh-notice-panel .xh-auth-eyebrow {
  text-align: center;
}

.xh-notice-panel .xh-auth-desc {
  text-align: center;
}

.xh-notice-panel .xh-auth-desc span {
  color: var(--xh-gold, #f4c879);
}

.xh-notice-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.xh-notice-list li {
  padding: 12px 16px;
  color: var(--xh-muted, rgba(247, 229, 195, .75));
  font-size: 13.5px;
  line-height: 1.8;
  border: 1px solid rgba(218, 156, 65, .22);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.xh-notice-list b {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 10px;
  color: var(--xh-gold, #f4c879);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 1px;
  border: 1px solid rgba(244, 200, 121, .4);
  border-radius: 999px;
  background: rgba(244, 200, 121, .08);
}

/* 首次入村寄语 */
.xh-welcome-panel {
  width: min(100%, 560px);
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  scrollbar-width: thin;
  scrollbar-color: rgba(244, 200, 121, .35) transparent;
}

.xh-welcome-panel .xh-auth-eyebrow,
.xh-welcome-panel .xh-auth-title {
  text-align: center;
}

.xh-welcome-body {
  margin: 18px 0 22px;
}

.xh-welcome-body p {
  margin: 0 0 14px;
  color: var(--xh-muted, rgba(247, 229, 195, .78));
  font-size: 14px;
  line-height: 1.9;
}

.xh-welcome-body p b {
  color: var(--xh-gold, #f4c879);
  font-weight: 600;
}

.xh-welcome-body span {
  color: var(--xh-gold, #f4c879);
}

.xh-welcome-close {
  padding-top: 6px;
  color: var(--xh-cream, #fff1d2) !important;
  font-family: var(--xh-font-kai, "STKaiti", "KaiTi", serif);
  font-size: 15px !important;
  text-align: center;
}

/* 「想认识你」区块 */
.xh-notice-meet {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 200, 121, .35);
  border-radius: 12px;
  background: rgba(244, 200, 121, .06);
}

.xh-notice-meet .meet-head {
  margin: 0 0 8px;
  color: var(--xh-gold, #f4c879);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
}

.xh-notice-meet .meet-head + a {
  margin-top: 0;
}

.xh-notice-meet a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  margin: 4px 0;
  font-size: 13px;
  text-decoration: none;
  border-radius: 8px;
  transition: background .18s ease;
}

.xh-notice-meet a:hover {
  background: rgba(244, 200, 121, .1);
}

.xh-notice-meet a b {
  color: var(--xh-cream, #fff1d2);
  font-weight: 600;
}

.xh-notice-meet a span {
  color: var(--xh-muted, rgba(247, 229, 195, .7));
  font-size: 12px;
}

.xh-notice-meet a em {
  margin-left: auto;
  color: var(--xh-gold, #f4c879);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.xh-notice-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

/* ---------- 页面守卫遮罩 ---------- */
.xh-auth-blocker {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, .66);
  backdrop-filter: blur(14px);
}

.xh-auth-blocker-panel {
  width: min(100%, 380px);
  padding: 40px 34px 34px;
  text-align: center;
  background:
    linear-gradient(160deg, rgba(255, 231, 166, .06), rgba(12, 14, 20, .88)),
    rgba(14, 16, 22, .94);
  border: 1px solid rgba(218, 156, 65, .32);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.xh-auth-lock {
  display: inline-block;
  width: 34px;
  height: 26px;
  margin-bottom: 16px;
  border: 2px solid rgba(244, 200, 121, .8);
  border-radius: 6px;
  position: relative;
}

.xh-auth-lock::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 18px;
  height: 14px;
  border: 2px solid rgba(244, 200, 121, .8);
  border-bottom: none;
  border-radius: 9px 9px 0 0;
  transform: translateX(-50%);
}

.xh-auth-blocker-panel h2 {
  margin: 0 0 10px;
  color: var(--xh-gold, #f4c879);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 2px;
}

.xh-auth-blocker-panel p {
  margin: 0 0 24px;
  color: var(--xh-muted, rgba(247, 229, 195, .7));
  font-size: 13px;
  line-height: 1.8;
}

/* 未登录时锁住页面滚动 */
body.xh-auth-locked { overflow: hidden; }

/* ---------- 顶栏登录状态：账号区 + 下拉菜单 ---------- */
.xh-auth-user {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.xh-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 6px;
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: border-color .2s ease, background .2s ease;
}

.xh-auth-trigger:hover,
.xh-auth-user.is-open .xh-auth-trigger {
  background: rgba(200, 168, 75, .07);
  border-color: rgba(218, 156, 65, .32);
}

/* 首字圆章：与顶栏 brand-mark 同一套圆形语言 */
.xh-auth-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--xh-gold, #f4c879);
  font-size: 14px;
  line-height: 1;
  border: 1px solid rgba(244, 200, 121, .55);
  border-radius: 50%;
  background: rgba(255, 236, 184, .16);
  box-shadow: inset 0 0 10px rgba(255, 246, 207, .14);
}

.xh-auth-name {
  max-width: 8em;
  overflow: hidden;
  color: var(--xh-gold, #f4c879);
  font-size: 14px;
  letter-spacing: 1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xh-auth-caret {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1px solid rgba(244, 200, 121, .7);
  border-bottom: 1px solid rgba(244, 200, 121, .7);
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.xh-auth-user.is-open .xh-auth-caret {
  margin-top: 2px;
  transform: rotate(-135deg);
}

.xh-auth-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 214px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  border: 1px solid rgba(244, 200, 121, .28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 19, 15, .97), rgba(28, 24, 16, .97));
  box-shadow: 0 18px 46px rgba(0, 0, 0, .5);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.xh-auth-user.is-open .xh-auth-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.xh-auth-menu-head {
  padding: 8px 12px 12px;
  border-bottom: 1px solid rgba(244, 200, 121, .16);
}

.xh-auth-menu-name {
  display: block;
  color: var(--xh-gold, #f4c879);
  font-size: 15px;
  letter-spacing: 1px;
}

.xh-auth-menu-no {
  display: block;
  margin-top: 4px;
  color: rgba(247, 229, 195, .5);
  font-size: 12px;
  letter-spacing: .5px;
}

.xh-auth-menu-item {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  color: rgba(247, 229, 195, .78);
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transition: color .16s ease, background .16s ease;
}

.xh-auth-menu-item:hover {
  color: #ffd98c;
  background: rgba(200, 168, 75, .1);
}

.xh-auth-menu-item.is-logout {
  margin-top: 8px;
  padding-top: 12px;
  color: rgba(247, 229, 195, .52);
  border-top: 1px solid rgba(244, 200, 121, .16);
  border-radius: 0 0 10px 10px;
}

.xh-auth-menu-item.is-logout:hover {
  color: rgba(247, 229, 195, .9);
  background: rgba(255, 255, 255, .04);
}

button.login-button {
  font: inherit;
  cursor: pointer;
}

/* ---------- 注册 / 登录分离 ---------- */
.xh-auth-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.register-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 20px;
  white-space: nowrap;
  font-size: 14px;
  color: rgba(247, 229, 195, .8);
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(218, 156, 65, .32);
  border-radius: 999px;
  background: transparent;
  transition: all .2s ease;
}

.register-button:hover {
  color: #ffd98c;
  border-color: rgba(244, 200, 121, .55);
  background: rgba(200, 168, 75, .07);
}

/* 遮罩上的「返回首页」出口 */
.xh-auth-back-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  color: rgba(247, 229, 195, .7);
  font-size: 14px;
  text-decoration: none;
  border: 1px solid rgba(218, 156, 65, .3);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  transition: all .2s ease;
  box-sizing: border-box;
}

.xh-auth-back-home:hover {
  color: #ffd98c;
  border-color: rgba(244, 200, 121, .55);
  background: rgba(200, 168, 75, .07);
}

.xh-auth-register {
  margin: 14px 0 0;
  color: var(--xh-faint, rgba(247, 229, 195, .45));
  font-size: 12.5px;
}

.xh-auth-register a {
  color: var(--xh-gold, #f4c879);
  text-decoration: none;
}

.xh-auth-register a:hover {
  text-decoration: underline;
}
