/* =========================================
   陛下信箱 · UI kit styles
   Depends on ../../colors_and_type.css for tokens.
   ========================================= */

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Layout shell ---------- */
.bx-app { min-height: 100vh; display: flex; flex-direction: column; }
.bx-main { flex: 1; padding-top: var(--header-h); }
.bx-container { max-width: var(--content-default); margin: 0 auto; padding: 0 24px; }

/* 顶部金色 banner — 用户登录,有未读批阅时 */
.bx-reply-banner {
  position: sticky; top: var(--header-h); z-index: 30;
  background: linear-gradient(90deg, var(--bronze) 0%, var(--bronze-deep) 50%, var(--bronze) 100%);
  background-size: 200% 100%;
  animation: bxBannerShimmer 6s ease-in-out infinite;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 16px rgba(164, 117, 48, 0.3);
}
@keyframes bxBannerShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.bx-reply-banner__inner {
  max-width: var(--content-default); margin: 0 auto;
  padding: 12px 24px; display: flex; align-items: center; gap: 14px;
}
.bx-reply-banner__seal {
  width: 32px; height: 32px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: #A63F2E; color: #fff;
  font-family: var(--font-serif); font-weight: 700; font-size: 16px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  animation: bxSealPulse 2s ease-in-out infinite;
}
@keyframes bxSealPulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%      { transform: scale(1.08) rotate(-6deg); }
}
.bx-reply-banner__text {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-serif);
}
.bx-reply-banner__text strong { font-weight: 600; letter-spacing: 0.04em; }
.bx-reply-banner__text .small { color: rgba(255,255,255,0.85); font-family: var(--font-sans); }
.bx-reply-banner__cta {
  background: var(--surface); color: var(--bronze-deep); border: none;
  padding: 8px 16px; border-radius: 4px;
  font-family: var(--font-sans); font-weight: 600; font-size: 13px;
  letter-spacing: 0.04em; cursor: pointer;
  transition: all 200ms var(--ease-out);
}
.bx-reply-banner__cta:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.bx-reply-banner__close {
  background: transparent; border: none; color: rgba(255,255,255,0.7);
  font-size: 24px; line-height: 1; padding: 4px 10px; cursor: pointer;
  transition: color 200ms;
}
.bx-reply-banner__close:hover { color: #fff; }
@media (max-width: 600px) {
  .bx-reply-banner__inner { padding: 10px 16px; gap: 10px; }
  .bx-reply-banner__cta { padding: 6px 12px; font-size: 12px; }
  .bx-reply-banner__text .small { display: none; }
}

/* ---------- Nav ---------- */
.bx-nav { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); background: rgba(250, 247, 242, 0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--hairline); z-index: var(--z-nav); }
.bx-nav__inner { max-width: var(--content-wide); height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 48px; }
.bx-nav__logo { padding: 0; }
.bx-nav__links { display: flex; gap: 32px; flex: 1; }
.bx-nav__link { font-family: var(--font-sans); font-size: 15px; color: var(--ink-2); padding: 4px 0; transition: color 200ms var(--ease-out); position: relative; }
.bx-nav__link:hover { color: var(--ink); }
.bx-nav__link.is-active { color: var(--bronze); }
.bx-nav__link.is-active::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); width: 20px; height: 1px; background: var(--bronze); }
.bx-nav__right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.bx-nav__burger { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.bx-nav__burger span { display: block; width: 20px; height: 1.5px; background: var(--ink); }
.bx-nav__drawer { display: none; }

.bx-user { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 999px; cursor: pointer; }
.bx-user:hover { background: var(--paper-2); }
.bx-user__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bronze-wash); color: var(--bronze); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bx-user__avatar svg { width: 26px; height: 26px; }
.bx-user__name { font-size: 14px; color: var(--ink); }
.bx-user__chev { color: var(--ink-3); font-size: 10px; }
.bx-user__menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 160px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; box-shadow: var(--sh-md); padding: 8px; display: flex; flex-direction: column; }
.bx-user__menu button { padding: 10px 12px; text-align: left; font-size: 14px; border-radius: 6px; color: var(--ink-2); }
.bx-user__menu button:hover { background: var(--paper-2); color: var(--ink); }
.bx-user__sep { height: 1px; background: var(--hairline); margin: 6px 4px; }

/* ---------- Buttons ---------- */
.bx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; font-size: 15px; font-weight: 500; border-radius: 8px; min-height: 44px; line-height: 1; transition: all 200ms var(--ease-out); white-space: nowrap; }
.bx-btn--sm { padding: 8px 16px; min-height: 36px; font-size: 14px; }
.bx-btn--lg { padding: 14px 28px; min-height: 52px; font-size: 16px; }
.bx-btn--primary { background: var(--bronze); color: #fff; }
.bx-btn--primary:hover { box-shadow: var(--sh-bronze); transform: translateY(-1px); }
.bx-btn--primary:active { transform: scale(0.98); }
.bx-btn--secondary { background: transparent; color: var(--bronze); border: 1px solid var(--bronze); }
.bx-btn--secondary:hover { background: var(--bronze-wash); border-color: var(--bronze-deep); color: var(--bronze-deep); }
.bx-btn--tertiary { background: transparent; color: var(--ink-2); min-height: auto; padding: 8px 0; }
.bx-btn--tertiary:hover { color: var(--bronze); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--bronze-line); }
.bx-btn--oauth { flex: 1; background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; padding: 10px 14px; min-height: 42px; }
.bx-btn--oauth:hover { border-color: var(--bronze-line); color: var(--bronze-deep); background: var(--bronze-wash); }
.bx-btn--oauth--douyin svg { color: #000; }
.bx-btn--oauth--wechat svg { color: #07C160; }
.bx-login__divider { position: relative; text-align: center; margin: 18px 0 14px; font-size: 12px; color: var(--ink-3); }
.bx-login__divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--hairline); }
.bx-login__divider span { position: relative; padding: 0 14px; background: var(--surface); }
.bx-login__oauth { display: flex; gap: 10px; }
.bx-btn--danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

/* ---------- Hero ---------- */
.bx-hero { max-width: 720px; margin: 0 auto; padding: 120px 24px 80px; text-align: center; }
.bx-hero .eyebrow { display: block; margin-bottom: 24px; }
.bx-hero__title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(64px, 9vw, 120px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 16px 0; }
.bx-hero__subtitle { font-family: var(--font-serif); font-size: 22px; color: var(--bronze); letter-spacing: 0.04em; margin: 0 0 32px 0; }
.bx-hero__lede { color: var(--ink-2); margin: 0 0 40px 0; }
.bx-hero__cta { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ---------- Stats strip ---------- */
.bx-stats { max-width: var(--content-default); margin: 60px auto; padding: 48px 24px; display: flex; align-items: center; justify-content: center; gap: 64px; background: var(--paper-2); border-radius: 20px; }
.bx-stats__item { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 180px; }
.bx-stats__num { display: flex; align-items: baseline; gap: 6px; }
.bx-stats__unit { font-size: 16px; color: var(--ink-3); }
.stat-num.is-bronze { color: var(--bronze); }
.bx-stats__sep { width: 1px; height: 64px; background: var(--hairline); }
/* Tablet range (iPad portrait 768/810/820 …) — the 3-across row with 180px
   items + 64px gaps doesn't fit until ~844px, so tighten gaps/margins and let
   items shrink. The ≤600 rule below still stacks them on phones. */
@media (max-width: 900px) {
  .bx-stats { gap: 28px; padding: 40px 24px; margin: 48px 24px; }
  .bx-stats__item { min-width: 0; flex: 1 1 0; }
}

/* ---------- Section heads ---------- */
.bx-section__head { margin-bottom: 40px; }
.bx-section__head .eyebrow { display: block; margin-bottom: 12px; }
.bx-section__head--center { text-align: center; }

/* ---------- Feed ---------- */
.bx-feed { max-width: var(--content-default); margin: 120px auto; padding: 0 24px; }
.bx-feed__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bx-feed__more { margin-top: 32px; text-align: center; }

.bx-letter { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--sh-sm); transition: all 200ms var(--ease-out); cursor: pointer; position: relative; }
.bx-letter:hover { box-shadow: var(--sh-md); transform: translateY(-2px); border-color: var(--bronze-line); }
/* 陛下亲赏过的奏折 — 金边 + 微光晕 + 呼吸动画 */
.bx-letter--praised {
  border-color: var(--bronze);
  background: linear-gradient(180deg, #fff 0%, rgba(201, 162, 95, 0.05) 100%);
  box-shadow: 0 0 0 1px var(--bronze-line), 0 8px 24px rgba(201, 162, 95, 0.18);
  animation: bxPraisedGlow 4s ease-in-out infinite;
}
@keyframes bxPraisedGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--bronze-line), 0 8px 24px rgba(201, 162, 95, 0.16); }
  50%      { box-shadow: 0 0 0 1px var(--bronze),     0 12px 32px rgba(201, 162, 95, 0.32); }
}
.bx-letter--praised:hover { transform: translateY(-3px); }
/* 角章 — 金黄"赏"字小印盖在右上 */
.bx-letter--praised::after {
  content: '赏';
  position: absolute; top: -8px; right: -8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bronze); color: #fff;
  font-family: var(--font-serif); font-weight: 700; font-size: 16px;
  border-radius: 4px; transform: rotate(8deg);
  box-shadow: 0 4px 10px rgba(164, 117, 48, 0.4);
  border: 1px solid var(--bronze-deep);
}
.bx-letter__head { display: flex; justify-content: space-between; align-items: center; }
.bx-letter__author { font-size: 13px; color: var(--ink-3); }
.bx-letter__tag { font-size: 11px; padding: 3px 10px; border: 1px solid var(--bronze-line); color: var(--bronze-deep); border-radius: 999px; }
.bx-letter__praise { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; background: linear-gradient(135deg, var(--bronze) 0%, var(--bronze-deep) 100%); color: #fff; border-radius: 999px; letter-spacing: 0.04em; box-shadow: 0 2px 6px rgba(164, 117, 48, 0.25); white-space: nowrap; }
.bx-letter__praise::before { content: '✦'; font-size: 10px; opacity: 0.9; }

/* ---------- Daily audience (每日觐见) ---------- */
.bx-audience { background: linear-gradient(135deg, #FBF7EF 0%, #F5EFE2 100%); border: 1px solid var(--bronze-line); border-radius: 14px; padding: 24px 28px; margin-bottom: 32px; position: relative; overflow: hidden; }
.bx-audience::before { content: ''; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(164, 117, 48, 0.08) 0%, transparent 70%); pointer-events: none; }
.bx-audience__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; position: relative; flex-wrap: wrap; }
.bx-audience__done { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bronze-deep); font-weight: 500; padding: 8px 14px; background: var(--bronze-wash); border: 1px solid var(--bronze-line); border-radius: 999px; }
.bx-audience__done svg { width: 14px; height: 14px; color: var(--bronze); }
.bx-audience__bar { height: 4px; background: rgba(164, 117, 48, 0.12); border-radius: 2px; overflow: hidden; margin-bottom: 18px; position: relative; }
.bx-audience__bar-fill { height: 100%; background: linear-gradient(90deg, var(--bronze) 0%, var(--bronze-deep) 100%); border-radius: 2px; transition: width 400ms var(--ease-out); }
.bx-audience__tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bx-audience__tier { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; transition: all 200ms var(--ease-out); }
.bx-audience__tier.is-reached { border-color: var(--bronze-line); background: var(--bronze-wash); }
.bx-audience__tier.is-claimed { opacity: 0.6; }
.bx-audience__tier-num { display: flex; align-items: baseline; gap: 4px; }
.bx-audience__tier-num .stat-num { font-size: 28px; font-family: var(--font-serif); font-weight: 700; color: var(--bronze); line-height: 1; }
.bx-audience__tier-name { font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.bx-audience__badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: 11px; color: var(--ink-3); border: 1px solid var(--hairline); background: var(--paper); letter-spacing: 0.04em; }
.bx-audience__badge--done { background: var(--bronze); color: #fff; border-color: var(--bronze); font-weight: 500; }
.bx-audience--compact { padding: 16px 20px; }
.bx-audience--compact .bx-audience__tiers { display: none; }
.bx-audience--compact .bx-audience__bar { margin-bottom: 0; }
.bx-audience__confessions { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--bronze-line); }
.bx-audience__confessions summary { font-size: 12px; color: var(--bronze-deep); cursor: pointer; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; user-select: none; }
.bx-audience__confessions summary:hover { color: var(--bronze); }
.bx-audience__confessions ol { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bx-audience__confessions li { padding: 10px 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; }
.bx-audience__confessions li p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }

/* ---------- Comments ---------- */
.bx-comments { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--hairline); }
.bx-comments__head { margin-bottom: 28px; }
.bx-comments__head h3 { margin: 0 0 4px; }
.bx-comments__list { list-style: none; margin: 0 0 32px; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.bx-comment { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; }
.bx-comment--emperor { background: linear-gradient(135deg, rgba(164, 117, 48, 0.06) 0%, rgba(164, 117, 48, 0.02) 100%); border-color: var(--bronze-line); box-shadow: 0 2px 8px rgba(164, 117, 48, 0.06); }
.bx-comment__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); flex-shrink: 0; overflow: hidden; }
.bx-comment--emperor .bx-comment__avatar { background: var(--bronze-wash); color: var(--bronze); border: 1px solid var(--bronze-line); }
.bx-comment__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.bx-comment__name { font-size: 14px; font-weight: 500; color: var(--ink); font-family: var(--font-serif); }
.bx-comment--emperor .bx-comment__name { color: var(--bronze); font-size: 15px; }
.bx-comment__badge { display: inline-block; font-size: 9px; letter-spacing: 0.14em; font-weight: 600; padding: 2px 8px; background: var(--bronze); color: #fff; border-radius: 3px; }
.bx-comment__date { font-size: 12px; color: var(--ink-3); margin-left: auto; font-family: var(--font-num); }
.bx-comment__text { margin: 0; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap; font-family: var(--font-serif); word-wrap: break-word; overflow-wrap: break-word; }
.bx-comment--emperor .bx-comment__text { color: var(--ink); }
.bx-comments__composer { background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 16px; }
.bx-comments__composer textarea { width: 100%; border: none; background: transparent; resize: vertical; font-family: var(--font-serif); font-size: 14.5px; line-height: 1.7; color: var(--ink); outline: none; min-height: 72px; }
.bx-comments__composer-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--hairline); margin-top: 10px; }
.bx-letter__title { font-family: var(--font-serif); font-size: 20px; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.3; }
.bx-letter__excerpt { font-size: 14px; line-height: 1.75; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bx-letter__foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; margin-top: auto; border-top: 1px solid var(--hairline); font-size: 13px; }
.bx-letter__date { color: var(--ink-3); font-family: var(--font-num); }
.bx-letter__act { color: var(--bronze); }
.bx-letter__share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 4px;
  color: var(--ink-3); background: transparent; border: 1px solid transparent;
  transition: all 180ms var(--ease-out);
}
.bx-letter__share-btn:hover {
  color: var(--bronze); background: var(--bronze-wash); border-color: var(--bronze-line);
}

/* ---------- Steps ---------- */
.bx-steps { max-width: var(--content-default); margin: 120px auto; padding: 0 24px; }
.bx-steps__row { display: flex; align-items: flex-start; gap: 24px; }
.bx-step { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; }
.bx-step__icon { width: 56px; height: 56px; color: var(--bronze); margin-bottom: 8px; }
.bx-step__icon svg { width: 100%; height: 100%; }
.bx-step__n { font-family: var(--font-serif); font-size: 14px; color: var(--bronze); letter-spacing: 0.12em; }
.bx-step__title { font-family: var(--font-serif); font-size: 24px; font-weight: 600; color: var(--ink); margin: 4px 0 8px 0; }
.bx-step__desc { font-size: 14px; color: var(--ink-2); line-height: 1.75; margin: 0; }
.bx-step__line { flex: 0 0 48px; height: 1px; background: var(--hairline); margin-top: 56px; }

/* ---------- CTA block ---------- */
.bx-cta-block { text-align: center; padding: 80px 24px 120px; max-width: 640px; margin: 0 auto; }
.bx-divider { display: block; width: 200px; height: 24px; margin: 0 auto 32px; }
.bx-cta-block__title { font-family: var(--font-serif); font-size: clamp(40px, 5vw, 56px); font-weight: 600; color: var(--ink); margin: 0 0 32px 0; letter-spacing: -0.02em; }

/* ---------- Footer ---------- */
.bx-footer { background: var(--paper-2); border-top: 1px solid var(--hairline); }
.bx-footer__inner { max-width: var(--content-wide); margin: 0 auto; padding: 56px 24px 32px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.bx-footer__col { display: flex; flex-direction: column; gap: 10px; }
.bx-footer__col h5 { font-family: var(--font-sans); font-size: 12px; font-weight: 600; color: var(--ink); letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 8px 0; }
.bx-footer__col a { font-size: 14px; color: var(--ink-2); }
.bx-footer__col a:hover { color: var(--bronze); }
.bx-footer__tag { font-family: var(--font-serif); font-size: 14px; color: var(--ink-3); margin: 0; }
.bx-footer__small { font-size: 12px; color: var(--ink-3); margin: 4px 0 0 0; }
.bx-footer__bar { border-top: 1px solid var(--hairline); padding: 20px 24px; text-align: center; font-size: 12px; color: var(--ink-3); }
.bx-footer__icp { display: block; margin-top: 6px; color: var(--ink-3); }
.bx-footer__icp:hover { color: var(--bronze); }

/* ---------- Page heads ---------- */
.bx-page { max-width: var(--content-default); margin: 0 auto; padding: 48px 24px 96px; }
.bx-page__head { text-align: center; margin-bottom: 48px; }
.bx-page__head .eyebrow { display: block; margin-bottom: 12px; }
.bx-page__head .h1 { margin: 0 0 12px 0; }
.bx-page__head .subtitle { margin: 0 0 8px 0; }

/* ---------- Modal ---------- */
.bx-modal { position: fixed; inset: 0; background: rgba(28, 28, 28, 0.3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); padding: 24px; }
.bx-modal__card { background: var(--surface); border-radius: 20px; width: 100%; max-width: 480px; padding: 40px 32px; position: relative; box-shadow: var(--sh-xl); }
.bx-modal__close { position: absolute; top: 16px; right: 20px; width: 32px; height: 32px; font-size: 24px; color: var(--ink-3); border-radius: 50%; }
.bx-modal__close:hover { background: var(--paper-2); color: var(--ink); }
.bx-modal__title { text-align: center; margin: 0 0 8px 0; }
.bx-modal__note { text-align: center; margin: 0 0 24px 0; }
.bx-modal__alt { text-align: center; margin-top: 8px; }
.bx-modal__alt a { color: var(--bronze); text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Tabs ---------- */
.bx-tabs { display: flex; background: var(--paper-2); border-radius: 8px; padding: 4px; gap: 4px; margin-bottom: 24px; }
.bx-tabs--lg { max-width: 420px; margin: 0 auto 32px; }
.bx-tab { flex: 1; padding: 10px 16px; border-radius: 6px; font-size: 14px; color: var(--ink-3); transition: all 200ms var(--ease-out); }
.bx-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-sm); }

/* ---------- Form fields ---------- */
.bx-form { display: flex; flex-direction: column; gap: 16px; }
.bx-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.bx-field__lbl { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: 0.04em; }
.bx-field input, .bx-field textarea, .bx-field select { padding: 12px; font-family: var(--font-sans); font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--hairline); border-radius: 4px; outline: none; transition: all 200ms var(--ease-out); width: 100%; }
.bx-field input:focus, .bx-field textarea:focus, .bx-field select:focus { border-color: var(--bronze); border-bottom-width: 2px; transform: translateY(-1px); }
.bx-field textarea { resize: vertical; font-family: var(--font-serif); line-height: 1.75; min-height: 200px; }
.bx-field__counter { position: absolute; right: 12px; bottom: 12px; font-family: var(--font-num); font-size: 11px; color: var(--ink-3); pointer-events: none; }
.bx-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.bx-radio-group { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.bx-radio-group .bx-field__lbl { margin-bottom: 4px; }
.bx-radio { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }

/* ---------- Compose layout ---------- */
.bx-compose { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: flex-start; }
.bx-compose__main { display: flex; flex-direction: column; gap: 20px; }
.bx-compose__actions { display: flex; gap: 16px; margin-top: 16px; }
.bx-compose__aside { background: var(--paper-2); border-radius: 12px; padding: 24px; border: 1px solid var(--hairline); }
.bx-compose__aside h4 { margin: 0 0 16px 0; font-family: var(--font-serif); }
.bx-compose__aside ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.bx-compose__aside li { font-size: 13px; color: var(--ink-2); line-height: 1.7; padding-left: 14px; position: relative; }
.bx-compose__aside li::before { content: '·'; position: absolute; left: 4px; color: var(--bronze); }

/* ---------- Letter detail images ---------- */
.bx-detail__images { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 24px 0 32px; }
.bx-detail__images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); background: var(--paper-2); }

/* ---------- Image upload ---------- */
.bx-upload { border: 1.5px dashed var(--hairline); border-radius: 10px; background: var(--paper-2); padding: 20px; cursor: pointer; transition: all 200ms var(--ease-out); }
.bx-upload:hover { border-color: var(--bronze-line); background: var(--bronze-wash); }
.bx-upload.is-full { cursor: default; background: var(--paper-2); }
.bx-upload.is-full:hover { border-color: var(--hairline); background: var(--paper-2); }
.bx-upload__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px 12px; color: var(--ink-3); }
.bx-upload__empty svg { color: var(--bronze); opacity: 0.75; }
.bx-upload__hint { font-size: 14px; color: var(--ink-2); }
.bx-upload__hint strong { color: var(--bronze); font-weight: 600; }
.bx-upload__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.bx-upload__tile { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--surface); border: 1px solid var(--hairline); }
.bx-upload__tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bx-upload__tile--add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); border-style: dashed; font-size: 22px; cursor: pointer; transition: all 200ms var(--ease-out); }
.bx-upload__tile--add:hover { color: var(--bronze); border-color: var(--bronze-line); }
.bx-upload__tile--add .small { font-size: 11px; }
.bx-upload__remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20, 18, 16, 0.72); color: #fff; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 150ms var(--ease-out); }
.bx-upload__remove:hover { background: var(--danger); }
.bx-upload__count { margin-top: 10px; text-align: right; color: var(--ink-3); }

/* ---------- Success ---------- */
.bx-success { max-width: 520px; margin: 120px auto; padding: 0 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bx-success__stamp { animation: stamp 600ms var(--ease-seal); }
@keyframes stamp { 0% { transform: scale(2) rotate(-8deg); opacity: 0; } 60% { transform: scale(0.95) rotate(-3deg); opacity: 1; } 100% { transform: scale(1) rotate(-3deg); opacity: 1; } }
.bx-success__wait { margin: 0; }
.bx-success__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }

/* ---------- Ceremony (投稿成功仪式感 · 全屏古风卷轴) ---------- */
.bx-ceremony {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; overflow: hidden;
}
.bx-ceremony__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 25%, rgba(201, 162, 95, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 75%, rgba(166, 63, 46, 0.12) 0%, transparent 50%),
    linear-gradient(170deg, #F7F0E0 0%, #ECE0C8 60%, #F7F0E0 100%);
  z-index: -1;
}
/* 卷轴主体 */
.bx-ceremony__scroll {
  position: relative; width: 100%; max-width: 560px;
  background: linear-gradient(180deg, #FAF7F2 0%, #F4ECD8 100%);
  border: 1px solid var(--bronze-line);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(76, 47, 18, 0.18), 0 0 0 1px rgba(139, 107, 58, 0.06);
  transform: scaleY(0.02); opacity: 0;
  transform-origin: center;
  animation: ceremonyOpen 700ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 80ms;
}
@keyframes ceremonyOpen {
  0%   { transform: scaleY(0.02); opacity: 0; }
  20%  { opacity: 1; }
  60%  { transform: scaleY(1.02); }
  100% { transform: scaleY(1); opacity: 1; }
}
/* 卷轴上下两端的木轴 */
.bx-ceremony__scroll-rod {
  height: 14px; background: linear-gradient(180deg, #6F4E2A 0%, #4A3318 50%, #6F4E2A 100%);
  border-radius: 7px; margin: 0 -16px;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15), 0 4px 10px rgba(0,0,0,0.18);
}
.bx-ceremony__scroll-rod--top    { margin-bottom: -2px; }
.bx-ceremony__scroll-rod--bottom { margin-top: -2px; }
.bx-ceremony__scroll-paper {
  padding: 60px 48px 80px; position: relative; min-height: 380px;
  text-align: center;
}
/* 印章 — 从天而降盖在中央 */
.bx-ceremony__seal {
  display: inline-block; transform: translateY(-200px) scale(2.4) rotate(-15deg); opacity: 0;
  transition: none;
}
.bx-ceremony__seal.is-down {
  animation: ceremonySeal 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes ceremonySeal {
  0%   { transform: translateY(-200px) scale(2.4) rotate(-15deg); opacity: 0; }
  60%  { opacity: 1; }
  80%  { transform: translateY(0) scale(0.9) rotate(-3deg); }
  100% { transform: translateY(0) scale(1) rotate(-3deg); opacity: 1; }
}
/* 文字逐段淡入 */
.bx-ceremony__text { opacity: 0; transform: translateY(8px); transition: all 600ms var(--ease-out); margin-top: 20px; }
.bx-ceremony__text.is-in { opacity: 1; transform: translateY(0); }
.bx-ceremony__h1 {
  font-family: var(--font-serif); font-size: clamp(24px, 4vw, 32px);
  font-weight: 600; color: var(--ink); margin: 0 0 12px; letter-spacing: 0.04em;
}
.bx-ceremony__sub {
  font-family: var(--font-serif); font-size: 15px; color: var(--ink-3);
  margin: 0 0 28px; letter-spacing: 0.06em;
}
.bx-ceremony__id {
  display: inline-flex; align-items: baseline; gap: 14px; padding: 12px 24px;
  background: rgba(201, 162, 95, 0.12); border: 1px solid var(--bronze-line); border-radius: 4px;
}
.bx-ceremony__id-label {
  font-family: var(--font-serif); font-size: 14px; color: var(--bronze); letter-spacing: 0.2em;
}
.bx-ceremony__id-num {
  font-family: var(--font-num); font-size: 36px; font-weight: 700; color: var(--bronze);
  line-height: 1;
}
/* 粒子(金色光点从印章飘起) */
.bx-ceremony__particles {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.bx-ceremony__particle {
  position: absolute; bottom: 30%; width: 6px; height: 6px;
  background: radial-gradient(circle, rgba(201,162,95,0.95) 0%, rgba(201,162,95,0) 70%);
  border-radius: 50%; opacity: 0;
  animation: ceremonyParticle 4s ease-out infinite;
}
@keyframes ceremonyParticle {
  0%   { opacity: 0; transform: translateY(0) scale(0.4); }
  20%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-260px) translateX(calc(var(--i, 0) * 4px - 24px)) scale(1.2); }
}
/* 按钮组 */
.bx-ceremony__cta {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-top: 36px;
  opacity: 0; transform: translateY(8px); transition: all 600ms var(--ease-out);
}
.bx-ceremony__cta.is-in { opacity: 1; transform: translateY(0); }

@media (max-width: 600px) {
  .bx-ceremony__scroll-paper { padding: 40px 28px 56px; min-height: 320px; }
  .bx-ceremony__id-num { font-size: 28px; }
  .bx-ceremony__h1 { font-size: 22px; }
}

/* ---------- Filter / chips ---------- */
.bx-filter { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.bx-filter__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.bx-chip { padding: 6px 14px; border-radius: 999px; background: transparent; border: 1px solid var(--hairline); font-size: 13px; color: var(--ink-2); transition: all 200ms var(--ease-out); }
.bx-chip:hover { border-color: var(--bronze-line); color: var(--bronze-deep); }
.bx-chip.is-active { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.bx-search { padding: 10px 14px; font-family: var(--font-sans); font-size: 14px; border: 1px solid var(--hairline); border-radius: 4px; background: var(--surface); min-width: 240px; outline: none; }
.bx-search:focus { border-color: var(--bronze); }

/* ---------- Letter detail ---------- */
.bx-detail { max-width: var(--content-narrow); margin: 0 auto; padding: 48px 24px 96px; }
.bx-crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 32px; }
.bx-crumb a:hover { color: var(--bronze); }
.bx-crumb span { color: var(--ink-2); }
.bx-detail__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.bx-detail__title { font-family: var(--font-serif); font-size: clamp(32px, 4.5vw, 48px); font-weight: 600; color: var(--ink); margin: 0 0 16px 0; letter-spacing: -0.02em; line-height: 1.2; }
.bx-detail__byline { display: flex; gap: 10px; font-size: 14px; color: var(--ink-3); margin-bottom: 32px; }
.bx-detail__body { margin: 32px 0; }
.bx-detail__body p { margin: 0 0 20px 0; font-family: var(--font-serif); font-size: 18px; line-height: 2; color: var(--ink); word-wrap: break-word; overflow-wrap: break-word; }
/* 朕曰块 — 仪式感升级:浮现入场 + 顶部金线 + 右下角印章 */
.bx-reply {
  background: linear-gradient(180deg, #fff 0%, rgba(201, 162, 95, 0.04) 100%);
  border: 1px solid var(--bronze);
  border-radius: 12px;
  padding: 36px 36px 56px;
  margin: 48px 0;
  box-shadow: 0 0 0 1px var(--bronze-line), 0 12px 36px rgba(201, 162, 95, 0.18);
  position: relative;
  animation: bxReplyAppear 800ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bxReplyAppear {
  0%   { opacity: 0; transform: translateY(20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
/* 顶部金线 */
.bx-reply::before {
  content: '';
  position: absolute; top: -1px; left: 32px; right: 32px;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--bronze) 20%, var(--bronze) 80%, transparent 100%);
  border-radius: 0 0 2px 2px;
}
/* 右下角红色印章 — 滴墨般落下 */
.bx-reply::after {
  content: '御\\A批';
  white-space: pre;
  position: absolute; bottom: 16px; right: 16px;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: #A63F2E; color: #FAF7F2;
  font-family: var(--font-serif); font-weight: 700; font-size: 18px;
  line-height: 1.05; letter-spacing: 0.1em;
  border-radius: 4px;
  border: 1px solid #7A2E1F;
  box-shadow: 0 6px 16px rgba(166, 63, 46, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: rotate(-6deg);
  animation: bxReplyStamp 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 400ms backwards;
}
@keyframes bxReplyStamp {
  0%   { opacity: 0; transform: translateY(-200px) rotate(-30deg) scale(2.4); }
  60%  { opacity: 1; }
  80%  { transform: translateY(0) rotate(-3deg) scale(0.85); }
  100% { transform: translateY(0) rotate(-6deg) scale(1); }
}
.bx-reply__label { margin-bottom: 12px; }
.bx-reply h3 { margin: 0 0 16px 0; color: var(--bronze-deep); font-family: var(--font-serif); letter-spacing: 0.08em; }
.bx-reply .serif-body {
  font-family: var(--font-serif);
  font-size: 19px; line-height: 2.05;
  color: var(--ink);
  padding-right: 60px;     /* 给右下印章让位 */
  word-wrap: break-word; overflow-wrap: break-word;
}
.bx-detail__foot { display: flex; gap: 8px; padding-top: 24px; margin-top: 48px; border-top: 1px solid var(--hairline); }
.bx-icon-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 13px; color: var(--ink-2); border-radius: 6px; border: 1px solid var(--hairline); }
.bx-icon-btn:hover { border-color: var(--bronze-line); color: var(--bronze); }
.bx-seal-mini { display: inline-block; width: 12px; height: 12px; background: var(--bronze); border-radius: 1px; }

/* ---------- Rank page ---------- */
.bx-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
.bx-podium__card { background: var(--surface); border: 1px solid var(--bronze-line); border-radius: 16px; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--sh-sm); }
.bx-podium__card--0 { border-width: 2px; box-shadow: var(--sh-md); background: linear-gradient(180deg, var(--bronze-wash) 0%, #fff 40%); }
.bx-podium__rank { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--bronze); letter-spacing: 0.2em; margin-bottom: 4px; }
.bx-podium__avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--bronze-wash); color: var(--bronze); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.bx-podium__avatar svg { width: 56px; height: 56px; }
.bx-podium__card h3 { margin: 0; }
.rank-badge { font-family: var(--font-serif); font-size: 12px; padding: 3px 12px; border: 1px solid var(--bronze); color: var(--bronze); border-radius: 2px; letter-spacing: 0.12em; }
.bx-podium__num { display: flex; align-items: baseline; gap: 6px; margin: 8px 0; }
.bx-podium__num .stat-num { font-size: 40px; }
.bx-ranklist { max-width: 720px; margin: 0 auto; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bx-ranklist li { display: grid; grid-template-columns: 32px 40px 1fr auto auto auto; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); }
.bx-ranklist__n { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink-3); text-align: center; }
.bx-ranklist__av { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); color: var(--ink-3); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.bx-ranklist__av svg { width: 32px; height: 32px; }
.bx-ranklist__name { font-size: 15px; color: var(--ink); font-weight: 500; }
.bx-ranklist__count { font-family: var(--font-num); font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Track page ---------- */
.bx-track { max-width: 560px; margin: 0 auto; }
.bx-track__input { display: flex; gap: 12px; margin-bottom: 32px; }
.bx-track__input input { flex: 1; padding: 14px 18px; font-family: var(--font-serif); font-size: 18px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); outline: none; }
.bx-track__input input:focus { border-color: var(--bronze); }
.bx-track__result { padding: 40px 32px; border-radius: 16px; background: var(--surface); border: 1px solid var(--hairline); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.bx-track__result--muted { background: var(--paper-2); color: var(--ink-3); }
.bx-track__result--soft  { background: var(--bronze-wash); border-color: var(--bronze-line); }
.bx-track__result--deep  { background: var(--surface); border: 2px solid var(--bronze); }
.bx-track__result--full  { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.bx-track__result--full .h3, .bx-track__result--full .eyebrow, .bx-track__result--full .body { color: #fff; }
.bx-track__result--none { background: var(--paper-2); }
.bx-progress { width: 100%; height: 4px; background: var(--hairline); border-radius: 999px; overflow: hidden; }
.bx-progress__bar { height: 100%; background: var(--bronze); transition: width 500ms var(--ease-out); }
.bx-track__result--full .bx-progress { background: rgba(255,255,255,0.3); }
.bx-track__result--full .bx-progress__bar { background: var(--surface); }

/* ---------- Account / Me page ---------- */
.bx-me-hero { position: relative; display: flex; gap: 28px; align-items: center; padding: 40px; background: linear-gradient(180deg, var(--bronze-wash) 0%, #fff 100%); border: 1px solid var(--bronze-line); border-radius: 20px; margin-bottom: 32px; }
.bx-me-hero__logout { position: absolute; top: 20px; right: 24px; font-size: 13px; color: var(--ink-3); padding: 6px 10px; border-radius: 6px; }
.bx-me-hero__logout:hover { color: var(--bronze); text-decoration: underline; text-underline-offset: 4px; }
.bx-me-hero__avatar { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; border: 2px solid var(--bronze); background: var(--surface); flex-shrink: 0; }
.bx-me-hero__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bx-me-hero__avatar--sm { width: 56px; height: 56px; border-width: 1px; }
.bx-me-hero__info { display: flex; flex-direction: column; gap: 8px; }
.bx-me-hero__name { margin: 4px 0 2px 0; }
.bx-me-hero__sub { margin: 0; }

.bx-me-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.bx-me-stats__item { padding: 20px 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; }
.bx-me-stats__item .eyebrow { display: block; color: var(--ink-3); letter-spacing: 0.08em; }
.bx-me-stats__num { display: flex; align-items: baseline; gap: 6px; }
.bx-me-stats__num .stat-num { font-size: 40px; }

.bx-me-list { display: flex; flex-direction: column; gap: 8px; }
.bx-me-row { display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 20px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; transition: all 200ms var(--ease-out); position: relative; }
.bx-me-row:hover { border-color: var(--bronze-line); box-shadow: var(--sh-sm); }
/* 陛下亲赏过的奏折 — 金边光晕呼吸 */
.bx-me-row--praised {
  border-color: var(--bronze);
  background: linear-gradient(90deg, #fff 0%, rgba(201, 162, 95, 0.05) 100%);
  box-shadow: 0 0 0 1px var(--bronze-line), 0 6px 18px rgba(201, 162, 95, 0.18);
  animation: bxPraisedGlow 4s ease-in-out infinite;
}
/* 已被陛下评了的(朕曰) — 左侧金条 + 标记 */
.bx-me-row--has-reply { border-left: 3px solid var(--bronze); padding-left: 17px; }
.bx-me-row__reply-mark {
  display: inline-block; margin-left: 10px; padding: 2px 8px;
  background: var(--bronze); color: #fff;
  font-family: var(--font-serif); font-size: 11px; letter-spacing: 0.1em;
  border-radius: 3px; vertical-align: middle;
  animation: bxReplyMarkPulse 1.8s ease-in-out infinite;
}
@keyframes bxReplyMarkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 95, 0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(201, 162, 95, 0); }
}
.bx-me-row__id { font-family: var(--font-serif); font-size: 15px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bx-me-row__main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bx-me-row__title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--ink); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-me-row__meta { display: flex; gap: 10px; align-items: center; }
.bx-me-row__meta .small { color: var(--ink-3); font-family: var(--font-num); }
.bx-me-row__acts { display: flex; gap: 6px; }
.status { font-family: var(--font-sans); font-size: 12px; padding: 4px 10px; border-radius: 4px; white-space: nowrap; }
.s-pending { background: #F6ECD2; color: #C89B3C; }
.s-review  { background: #E7EBF0; color: #6C7A8E; }
.s-read    { background: #F1E8D7; color: #8E6F3E; }
.s-done    { background: #EDF1E4; color: #6B8E5A; }
.s-reject  { background: var(--paper-2); color: var(--ink-3); }
.bx-icon-btn--danger { color: var(--danger); border-color: transparent; }
.bx-icon-btn--danger:hover { border-color: var(--danger); color: var(--danger); }

.bx-empty { text-align: center; padding: 80px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; background: var(--paper-2); border-radius: 16px; }
.bx-empty h3 { margin: 0; color: var(--ink-2); }
.bx-empty p { margin: 0; }

.bx-settings { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.bx-setting-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--hairline); }
.bx-setting-row:last-child { border-bottom: none; }
.bx-setting-row--danger { background: #FDF7F6; }
.bx-setting-row__info h4 { margin: 0 0 4px 0; font-family: var(--font-serif); }
.bx-setting-row__info p { margin: 0; }
.bx-setting-row__ctrl { display: flex; gap: 12px; align-items: center; }
.bx-setting-row__ctrl input { padding: 10px 14px; font-family: var(--font-sans); font-size: 14px; border: 1px solid var(--hairline); border-radius: 4px; outline: none; min-width: 240px; }
.bx-setting-row__ctrl input:focus { border-color: var(--bronze); }

.bx-confirm { max-width: 440px; text-align: center; }
.bx-confirm .eyebrow { display: block; }
.bx-confirm .serif-body { margin: 0 0 28px 0; color: var(--ink-2); }
.bx-confirm__acts { display: flex; gap: 12px; justify-content: center; }

/* =========================================
   Public editorial pages (About / Rules / FAQ)
   ========================================= */
.bx-editorial { max-width: 720px; margin: 0 auto; padding: 64px 24px 96px; }
.bx-editorial__head { text-align: center; margin-bottom: 56px; }
.bx-editorial__head .eyebrow { display: block; margin-bottom: 14px; }
.bx-editorial__head .h1 { margin: 0 0 12px 0; }
.bx-editorial__head .subtitle { margin: 0; }
.bx-editorial__sec { padding: 40px 0; }
.bx-editorial__sec-title { margin: 0 0 24px 0; font-weight: 600; }
.bx-editorial__prose p { font-family: var(--font-serif); font-size: 17px; line-height: 2; color: var(--ink); margin: 0 0 18px 0; text-indent: 2em; }
.bx-editorial__prose p:last-child { margin-bottom: 0; }
.bx-editorial__closing { text-align: center; padding: 64px 0 0; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.bx-editorial__closing .serif-body { color: var(--ink); margin: 0; }
.bx-editorial__cta { text-align: center; padding: 80px 0 0; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.bx-editorial__cta .h2 { margin: 0; }

/* About · accounts */
.bx-about__sub { margin: 0 0 16px 0; font-family: var(--font-serif); font-weight: 500; }
.bx-about__foot { margin: 20px 0 0 0; color: var(--ink-3); text-align: center; }
.bx-about__accounts { display: flex; flex-direction: column; gap: 16px; }
.bx-about__accounts--wide { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) {
  .bx-about__accounts--wide { grid-template-columns: 1fr; }
}
.bx-acct-card { display: flex; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; align-items: center; transition: all 200ms var(--ease-out); }
.bx-acct-card:hover { border-color: var(--bronze-line); box-shadow: var(--sh-sm); }
.bx-acct-card__qr { width: 84px; height: 84px; border: 1px solid var(--hairline); padding: 6px; background: var(--surface); flex-shrink: 0; }
.bx-acct-card__qr svg { display: block; }
.bx-acct-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.bx-acct-card__row { display: flex; align-items: center; gap: 10px; }
.bx-acct-card__body h3 { margin: 0; font-size: 22px; }
.bx-acct-card__body .small { margin: 0; }
.bx-acct-card__body .bx-btn { align-self: flex-start; margin-top: 6px; }

/* Oath */
.bx-oath { padding: 48px 0; }
.bx-oath__frame { padding: 56px 40px; background: linear-gradient(180deg, #fff 0%, var(--bronze-wash) 100%); border: 1px solid var(--bronze-line); border-radius: 16px; text-align: center; position: relative; }
.bx-oath__frame::before, .bx-oath__frame::after { content: ''; position: absolute; width: 24px; height: 24px; border: 1.5px solid var(--bronze); }
.bx-oath__frame::before { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.bx-oath__frame::after  { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.bx-oath__frame .eyebrow { display: block; margin-bottom: 28px; }
.bx-oath__text { font-family: var(--font-serif); font-size: clamp(20px, 2.4vw, 26px); font-weight: 500; line-height: 2; color: var(--ink); margin: 0 0 32px 0; letter-spacing: 0.04em; }
.bx-oath__sig { display: flex; align-items: center; justify-content: center; gap: 14px; }
.bx-oath__seal { transform: rotate(-4deg); }

/* =========================================
   Accordion (Rules / FAQ)
   ========================================= */
.bx-accordion { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--hairline); }
.bx-acc { border-bottom: 1px solid var(--hairline); }
.bx-acc__head { display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px 4px; text-align: left; transition: color 200ms var(--ease-out); }
.bx-acc__head:hover { color: var(--bronze); }
.bx-acc__n { font-family: var(--font-serif); font-size: 14px; color: var(--bronze); letter-spacing: 0.1em; flex-shrink: 0; }
.bx-acc__t { font-family: var(--font-serif); font-size: 19px; font-weight: 500; color: var(--ink); flex: 1; }
.bx-acc__q { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--ink); flex: 1; line-height: 1.5; }
.bx-acc__chev { font-size: 20px; color: var(--bronze); width: 20px; text-align: center; flex-shrink: 0; }
.bx-acc.is-open .bx-acc__t, .bx-acc.is-open .bx-acc__q { color: var(--bronze-deep); }
.bx-acc__body { padding: 0 4px 24px 4px; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bx-acc__body li { font-size: 15px; line-height: 1.85; color: var(--ink-2); padding-left: 18px; position: relative; }
.bx-acc__body li::before { content: '·'; position: absolute; left: 6px; color: var(--bronze); font-weight: 700; }
.bx-acc__a { padding: 0 4px 20px 4px; }
.bx-acc__a p { font-family: var(--font-sans); font-size: 15px; line-height: 1.85; color: var(--ink-2); margin: 0; }

/* =========================================
   FAQ layout
   ========================================= */
.bx-faq { max-width: 1040px; }
.bx-faq__layout { display: grid; grid-template-columns: 200px 1fr; gap: 64px; align-items: flex-start; }
.bx-faq__side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.bx-faq__nav { padding: 10px 14px; font-size: 14px; color: var(--ink-3); border-left: 2px solid transparent; transition: all 200ms var(--ease-out); }
.bx-faq__nav:hover { color: var(--ink); }
.bx-faq__nav.is-active { color: var(--bronze); border-left-color: var(--bronze); }
.bx-faq__main { min-width: 0; }
.bx-faq__group { margin-bottom: 48px; scroll-margin-top: 96px; }
.bx-faq__group-t { margin: 0 0 20px 0; font-family: var(--font-serif); color: var(--bronze-deep); font-size: 22px; font-weight: 600; }
.bx-faq__tail { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--hairline); text-align: center; }
.bx-qr-line { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }
.bx-qr-line--lg { gap: 20px; margin: 24px 0; }
.bx-qr-line svg { border: 1px solid var(--hairline); padding: 6px; background: var(--surface); }

/* =========================================
   404
   ========================================= */
.bx-404 { max-width: 560px; margin: 80px auto; padding: 0 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bx-404__art { position: relative; margin-bottom: 24px; }
.bx-404__art svg { width: 320px; height: 160px; }
.bx-404__num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-serif); font-size: 72px; font-weight: 700; color: var(--bronze); letter-spacing: -0.04em; background: var(--paper); padding: 0 16px; mix-blend-mode: multiply; opacity: 0.92; }
.bx-404 .h1 { margin: 0; }
.bx-404 .subtitle { margin: 0; }
.bx-404__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.bx-404__note { margin-top: 16px; }

/* =========================================
   Forgot Password
   ========================================= */
.bx-fp { display: flex; justify-content: center; padding: 80px 24px; }
.bx-fp__card { max-width: 480px; width: 100%; padding: 48px 40px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; text-align: center; box-shadow: var(--sh-sm); }
.bx-fp__card .h1 { margin: 0 0 8px 0; }
.bx-fp__sub { margin: 0 0 32px 0; }
.bx-fp__form { text-align: left; margin-top: 8px; }
.bx-fp__form .bx-field__lbl { display: inline-flex; align-items: center; gap: 6px; }
.bx-fp__form .bx-btn { margin-top: 8px; }
.bx-fp__link { text-align: center; font-size: 14px; color: var(--bronze); padding: 8px; margin-top: 8px; }
.bx-fp__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.bx-fp__stamp { display: flex; justify-content: center; margin-bottom: 24px; animation: stamp 600ms var(--ease-seal); }
.bx-fp__msg { margin: 0 0 16px 0; }
.bx-req-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--bronze); }

/* =========================================
   Toast
   ========================================= */
.bx-toast-host { position: fixed; top: calc(var(--header-h) + 16px); right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: var(--z-toast); pointer-events: none; }
.bx-toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px 14px 16px; min-width: 280px; max-width: 420px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: var(--sh-md); pointer-events: auto; animation: toastIn 220ms var(--ease-out); }
.bx-toast.is-leaving { animation: toastOut 220ms var(--ease-out) forwards; }
.bx-toast__icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.bx-toast__msg { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--ink); flex: 1; }
.bx-toast__close { color: var(--ink-3); font-size: 18px; padding: 0 4px; line-height: 1; }
.bx-toast__close:hover { color: var(--ink); }
.bx-toast--success { background: var(--bronze-wash); border-color: var(--bronze-line); }
.bx-toast--error   { background: var(--danger-bg);  border-color: #E6B7B3; }
.bx-toast--info    { background: var(--info-bg);    border-color: #C8D1DD; }
.bx-toast--warning { background: var(--warning-bg); border-color: #E8D28A; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-8px); } }

/* =========================================
   Loading · spinner, skeleton, top bar
   ========================================= */
.bx-spinner-seal { display: inline-block; animation: sealSpin 1.5s linear infinite; transform-origin: 50% 50%; }
@keyframes sealSpin { to { transform: rotate(360deg); } }
.bx-spin-ring { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.bx-loading-overlay { position: fixed; inset: 0; background: rgba(250,247,242,0.85); backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; z-index: var(--z-modal); }
.bx-loading-overlay__text { font-family: var(--font-serif); font-size: 16px; color: var(--ink-2); letter-spacing: 0.08em; }
.bx-topbar { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: transparent; z-index: calc(var(--z-toast) + 1); }
.bx-topbar__bar { height: 100%; width: 30%; background: var(--bronze); animation: topbarSlide 1.2s var(--ease-in-out) infinite; }
@keyframes topbarSlide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.bx-skel { background: var(--paper-2); border-radius: 4px; animation: skelPulse 1.4s ease-in-out infinite; }
@keyframes skelPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.bx-skel--line { height: 14px; }
.bx-skel--title { height: 22px; }
.bx-skel--tag { height: 20px; width: 64px; border-radius: 999px; }

/* =========================================
   Empty state (enhanced)
   ========================================= */
.bx-empty--full { min-height: 60vh; justify-content: center; }
.bx-empty__icon { width: 120px; height: 120px; color: var(--ink-4); margin-bottom: 8px; }
.bx-empty__icon svg { width: 100%; height: 100%; }
.bx-empty h2 { font-family: var(--font-serif); font-size: 28px; color: var(--ink); margin: 0; font-weight: 500; }

/* =========================================
   Form states
   ========================================= */
.bx-field--success input { border-color: var(--success); padding-right: 40px; }
.bx-field--success::after { content: '✓'; position: absolute; right: 14px; top: 38px; color: var(--success); font-weight: 600; pointer-events: none; }
.bx-field--error input, .bx-field--error textarea { border-color: var(--danger); background: #FEF9F8; }
.bx-field__error { font-size: 12px; color: var(--danger); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.bx-field__error::before { content: '!'; display: inline-flex; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; font-family: var(--font-sans); }
.bx-field input:disabled, .bx-field textarea:disabled { background: var(--paper-2); color: var(--ink-4); cursor: not-allowed; }

/* =========================================
   Preview demo chrome (shared by preview/*.html)
   ========================================= */
.pv-root { max-width: 1040px; margin: 0 auto; padding: 48px 24px 96px; }
.pv-head { margin-bottom: 48px; border-bottom: 1px solid var(--hairline); padding-bottom: 24px; }
.pv-head .eyebrow { display: block; margin-bottom: 8px; }
.pv-head h1 { margin: 0 0 8px 0; }
.pv-head p { margin: 0; max-width: 640px; }
.pv-section { margin-bottom: 64px; }
.pv-section__h { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); margin: 0 0 8px 0; }
.pv-section__note { font-size: 13px; color: var(--ink-3); margin: 0 0 20px 0; }
.pv-grid { display: grid; gap: 16px; }
.pv-grid--2 { grid-template-columns: repeat(2, 1fr); }
.pv-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pv-grid--4 { grid-template-columns: repeat(4, 1fr); }
.pv-tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.pv-tile__label { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.pv-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pv-stage { background: var(--paper-2); border: 1px dashed var(--hairline); border-radius: 12px; padding: 32px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; min-height: 160px; position: relative; }
.pv-code { background: var(--paper-2); padding: 2px 8px; border-radius: 4px; font-family: 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--bronze-deep); }

/* ===== Editorial pages (About/Rules/FAQ) ===== */
.bx-editorial { max-width: 720px; margin: 0 auto; padding: 64px 24px 96px; }
.bx-editorial__head { text-align: center; margin-bottom: 56px; }
.bx-editorial__head .eyebrow { display: block; margin-bottom: 14px; }
.bx-editorial__head .h1 { margin: 0 0 12px 0; }
.bx-editorial__head .subtitle { margin: 0; }
.bx-editorial__sec { padding: 40px 0; }
.bx-editorial__sec-title { margin: 0 0 24px 0; font-weight: 600; }
.bx-editorial__prose p { font-family: var(--font-serif); font-size: 17px; line-height: 2; color: var(--ink); margin: 0 0 18px 0; text-indent: 2em; }
.bx-editorial__prose p:last-child { margin-bottom: 0; }
.bx-editorial__closing { text-align: center; padding: 64px 0 0; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.bx-editorial__closing .serif-body { color: var(--ink); margin: 0; }
.bx-editorial__cta { text-align: center; padding: 80px 0 0; display: flex; flex-direction: column; align-items: center; gap: 32px; }
.bx-editorial__cta .h2 { margin: 0; }
.bx-acct-card { display: flex; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; align-items: center; transition: all 200ms var(--ease-out); }
.bx-acct-card:hover { border-color: var(--bronze-line); box-shadow: var(--sh-sm); }
.bx-acct-card__qr { width: 84px; height: 84px; border: 1px solid var(--hairline); padding: 6px; background: var(--surface); flex-shrink: 0; }
.bx-acct-card__qr svg { display: block; }
.bx-acct-card__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.bx-acct-card__row { display: flex; align-items: center; gap: 10px; }
.bx-acct-card__body h3 { margin: 0; font-size: 22px; }
.bx-acct-card__body .small { margin: 0; }
.bx-acct-card__body .bx-btn { align-self: flex-start; margin-top: 6px; }
.bx-oath { padding: 48px 0; }
.bx-oath__frame { padding: 56px 40px; background: linear-gradient(180deg, #fff 0%, var(--bronze-wash) 100%); border: 1px solid var(--bronze-line); border-radius: 16px; text-align: center; position: relative; }
.bx-oath__frame::before, .bx-oath__frame::after { content: ''; position: absolute; width: 24px; height: 24px; border: 1.5px solid var(--bronze); }
.bx-oath__frame::before { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.bx-oath__frame::after  { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.bx-oath__frame .eyebrow { display: block; margin-bottom: 28px; }
.bx-oath__text { font-family: var(--font-serif); font-size: clamp(20px, 2.4vw, 26px); font-weight: 500; line-height: 2; color: var(--ink); margin: 0 0 32px 0; letter-spacing: 0.04em; }
.bx-oath__sig { display: flex; align-items: center; justify-content: center; gap: 14px; }
.bx-oath__seal { transform: rotate(-4deg); }

/* ===== Accordion ===== */
.bx-accordion { display: flex; flex-direction: column; border-top: 1px solid var(--hairline); }
.bx-acc { border-bottom: 1px solid var(--hairline); }
.bx-acc__head { display: flex; align-items: center; gap: 16px; width: 100%; padding: 20px 4px; text-align: left; transition: color 200ms var(--ease-out); }
.bx-acc__head:hover { color: var(--bronze); }
.bx-acc__n { font-family: var(--font-serif); font-size: 14px; color: var(--bronze); letter-spacing: 0.1em; flex-shrink: 0; }
.bx-acc__t { font-family: var(--font-serif); font-size: 19px; font-weight: 500; color: var(--ink); flex: 1; }
.bx-acc__q { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--ink); flex: 1; line-height: 1.5; }
.bx-acc__chev { font-size: 20px; color: var(--bronze); width: 20px; text-align: center; flex-shrink: 0; }
.bx-acc.is-open .bx-acc__t, .bx-acc.is-open .bx-acc__q { color: var(--bronze-deep); }
.bx-acc__body { padding: 0 4px 24px 4px; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.bx-acc__body li { font-size: 15px; line-height: 1.85; color: var(--ink-2); padding-left: 18px; position: relative; }
.bx-acc__body li::before { content: '·'; position: absolute; left: 6px; color: var(--bronze); font-weight: 700; }
.bx-acc__a { padding: 0 4px 20px 4px; }
.bx-acc__a p { font-family: var(--font-sans); font-size: 15px; line-height: 1.85; color: var(--ink-2); margin: 0; }

/* ===== FAQ ===== */
.bx-faq { max-width: 1040px; }
.bx-faq__layout { display: grid; grid-template-columns: 200px 1fr; gap: 64px; align-items: flex-start; }
.bx-faq__side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.bx-faq__nav { padding: 10px 14px; font-size: 14px; color: var(--ink-3); border-left: 2px solid transparent; transition: all 200ms var(--ease-out); }
.bx-faq__nav:hover { color: var(--ink); }
.bx-faq__nav.is-active { color: var(--bronze); border-left-color: var(--bronze); }
.bx-faq__main { min-width: 0; }
.bx-faq__group { margin-bottom: 48px; scroll-margin-top: 96px; }
.bx-faq__group-t { margin: 0 0 20px 0; font-family: var(--font-serif); color: var(--bronze-deep); font-size: 22px; font-weight: 600; }
.bx-faq__tail { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--hairline); text-align: center; }
.bx-qr-line { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; }
.bx-qr-line--lg { gap: 20px; margin: 24px 0; }
.bx-qr-line svg { border: 1px solid var(--hairline); padding: 6px; background: var(--surface); }

/* ===== 404 ===== */
.bx-404 { max-width: 560px; margin: 80px auto; padding: 0 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bx-404__art { position: relative; margin-bottom: 24px; }
.bx-404__art svg { width: 320px; height: 160px; }
.bx-404__num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: var(--font-serif); font-size: 72px; font-weight: 700; color: var(--bronze); letter-spacing: -0.04em; background: var(--paper); padding: 0 16px; mix-blend-mode: multiply; opacity: 0.92; }
.bx-404 .h1, .bx-404 .subtitle { margin: 0; }
.bx-404__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.bx-404__note { margin-top: 16px; }

/* ===== Forgot Password ===== */
.bx-fp { display: flex; justify-content: center; padding: 80px 24px; }
.bx-fp__card { max-width: 480px; width: 100%; padding: 48px 40px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px; text-align: center; box-shadow: var(--sh-sm); }
.bx-fp__card .h1 { margin: 0 0 8px 0; }
.bx-fp__sub { margin: 0 0 32px 0; }
.bx-fp__form { text-align: left; margin-top: 8px; }
.bx-fp__form .bx-field__lbl { display: inline-flex; align-items: center; gap: 6px; }
.bx-fp__form .bx-btn { margin-top: 8px; }
.bx-fp__link { text-align: center; font-size: 14px; color: var(--bronze); padding: 8px; margin-top: 8px; }
.bx-fp__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.bx-fp__stamp { display: flex; justify-content: center; margin-bottom: 24px; animation: stamp 600ms var(--ease-seal); }
.bx-fp__msg { margin: 0 0 16px 0; }
.bx-req-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--bronze); }

/* ===== Toast ===== */
.bx-toast-host { position: fixed; top: calc(var(--header-h) + 16px); right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: var(--z-toast); pointer-events: none; }
.bx-toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px 14px 16px; min-width: 280px; max-width: 420px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; box-shadow: var(--sh-md); pointer-events: auto; animation: toastIn 220ms var(--ease-out); }
.bx-toast.is-leaving { animation: toastOut 220ms var(--ease-out) forwards; }
.bx-toast__icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; }
.bx-toast__msg { font-family: var(--font-sans); font-size: 14px; line-height: 1.5; color: var(--ink); flex: 1; }
.bx-toast__close { color: var(--ink-3); font-size: 18px; padding: 0 4px; line-height: 1; }
.bx-toast__close:hover { color: var(--ink); }
.bx-toast--success { background: var(--bronze-wash); border-color: var(--bronze-line); }
.bx-toast--error   { background: var(--danger-bg);  border-color: #E6B7B3; }
.bx-toast--info    { background: var(--info-bg);    border-color: #C8D1DD; }
.bx-toast--warning { background: var(--warning-bg); border-color: #E8D28A; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(-8px); } }

/* ===== Loading ===== */
.bx-spinner-seal { display: inline-block; animation: sealSpin 1.5s linear infinite; transform-origin: 50% 50%; }
@keyframes sealSpin { to { transform: rotate(360deg); } }
.bx-spin-ring { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.bx-loading-overlay { position: fixed; inset: 0; background: rgba(250,247,242,0.85); backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; z-index: var(--z-modal); }
.bx-loading-overlay__text { font-family: var(--font-serif); font-size: 16px; color: var(--ink-2); letter-spacing: 0.08em; }
.bx-topbar { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: transparent; z-index: calc(var(--z-toast) + 1); }
.bx-topbar__bar { height: 100%; width: 30%; background: var(--bronze); animation: topbarSlide 1.2s var(--ease-in-out) infinite; }
@keyframes topbarSlide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.bx-skel { background: var(--paper-2); border-radius: 4px; animation: skelPulse 1.4s ease-in-out infinite; }
@keyframes skelPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }
.bx-skel--line { height: 14px; }
.bx-skel--title { height: 22px; }
.bx-skel--tag { height: 20px; width: 64px; border-radius: 999px; }

/* ===== Empty ===== */
.bx-empty--full { min-height: 60vh; justify-content: center; }
.bx-empty__icon { width: 120px; height: 120px; color: var(--ink-4); margin-bottom: 8px; }
.bx-empty__icon svg { width: 100%; height: 100%; }
.bx-empty h2 { font-family: var(--font-serif); font-size: 28px; color: var(--ink); margin: 0; font-weight: 500; }

/* ===== Form states ===== */
.bx-field--success input { border-color: var(--success); padding-right: 40px; }
.bx-field--success::after { content: '✓'; position: absolute; right: 14px; top: 38px; color: var(--success); font-weight: 600; pointer-events: none; }
.bx-field--error input, .bx-field--error textarea { border-color: var(--danger); background: #FEF9F8; }
.bx-field__error { font-size: 12px; color: var(--danger); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.bx-field__error::before { content: '!'; display: inline-flex; width: 14px; height: 14px; border-radius: 50%; background: var(--danger); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; font-family: var(--font-sans); }
.bx-field input:disabled, .bx-field textarea:disabled { background: var(--paper-2); color: var(--ink-4); cursor: not-allowed; }

/* ===== Preview chrome ===== */
.pv-root { max-width: 1040px; margin: 0 auto; padding: 48px 24px 96px; }
.pv-head { margin-bottom: 48px; border-bottom: 1px solid var(--hairline); padding-bottom: 24px; }
.pv-head .eyebrow { display: block; margin-bottom: 8px; }
.pv-head h1 { margin: 0 0 8px 0; }
.pv-head p { margin: 0; max-width: 640px; }
.pv-section { margin-bottom: 64px; }
.pv-section__h { font-family: var(--font-serif); font-size: 22px; font-weight: 500; color: var(--ink); margin: 0 0 8px 0; }
.pv-section__note { font-size: 13px; color: var(--ink-3); margin: 0 0 20px 0; }
.pv-grid { display: grid; gap: 16px; }
.pv-grid--2 { grid-template-columns: repeat(2, 1fr); }
.pv-grid--3 { grid-template-columns: repeat(3, 1fr); }
.pv-grid--4 { grid-template-columns: repeat(4, 1fr); }
.pv-tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.pv-tile__label { font-family: var(--font-sans); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.pv-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pv-stage { background: var(--paper-2); border: 1px dashed var(--hairline); border-radius: 12px; padding: 32px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: center; min-height: 160px; position: relative; }
.pv-code { background: var(--paper-2); padding: 2px 8px; border-radius: 4px; font-family: 'SF Mono', Menlo, monospace; font-size: 12px; color: var(--bronze-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .bx-feed__grid { grid-template-columns: repeat(2, 1fr); }
  .bx-podium { grid-template-columns: repeat(3, 1fr); }
  .bx-compose { grid-template-columns: 1fr; }
  .bx-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
  .bx-nav__links { display: none; }
  .bx-nav__burger { display: flex; }
  .bx-user__name { display: none; }
  /* declutter the top bar — login, search and theme all live in the drawer on
     mobile, so they don't compete for space (when logged in, theme+search+bell+
     avatar+burger would otherwise overflow a narrow phone). Keep bell + avatar
     + burger only. */
  .bx-nav__right > .bx-btn--secondary { display: none; }
  /* parent-scoped so these beat the later base `.bx-nav__iconbtn{display:inline-flex}`
     rule (equal specificity would otherwise lose on source order). */
  .bx-nav__right .bx-nav__iconbtn--theme,
  .bx-nav__right .bx-nav__iconbtn--search { display: none; }
  .bx-user .bx-user__chev { display: none; }
  .bx-nav__right { gap: 8px; }
  /* desktop gap/padding (48/24) is too wide for small phones (≤320 the logo +
     right cluster wouldn't fit) — tighten so nothing clips. */
  .bx-nav__inner { gap: 16px; padding: 0 16px; }
  .bx-nav__drawer { display: flex; flex-direction: column; padding: 16px; gap: 8px; background: var(--paper); border-bottom: 1px solid var(--hairline); }
  .bx-nav__drawer-item { padding: 14px 16px; text-align: left; font-size: 15px; border-radius: 8px; color: var(--ink-2); }
  .bx-nav__drawer-item:hover { background: var(--paper-2); }
  .bx-hero { padding: 80px 20px 60px; }
  .bx-stats { flex-direction: column; gap: 32px; padding: 40px 20px; margin: 40px 16px; }
  .bx-stats__sep { display: none; }
  .bx-feed__grid { grid-template-columns: 1fr; }
  .bx-feed, .bx-steps { margin: 80px auto; }
  .bx-steps__row { flex-direction: column; gap: 8px; }
  .bx-step__line { width: 1px; height: 32px; margin: 0 auto; flex: 0 0 32px; }
  .bx-footer__inner { grid-template-columns: 1fr; gap: 32px; }
  .bx-podium { grid-template-columns: 1fr; }
  .bx-filter { flex-direction: column; align-items: stretch; }
  .bx-search { min-width: 0; width: 100%; }
  .bx-ranklist li { grid-template-columns: 28px 36px 1fr auto; gap: 10px; font-size: 13px; }
  .bx-ranklist li .rank-badge, .bx-ranklist li .bx-btn { display: none; }
  .bx-track__input { flex-direction: column; }
  .bx-me-hero { flex-direction: column; text-align: center; padding: 28px 20px; }
  .bx-me-hero__logout { position: static; margin-bottom: 8px; align-self: flex-end; }
  .bx-me-stats { grid-template-columns: repeat(2, 1fr); }
  .bx-me-row { grid-template-columns: 48px 1fr; gap: 10px; }
  .bx-me-row .status, .bx-me-row__acts { grid-column: 2; }
  .bx-setting-row { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .bx-setting-row__ctrl input { min-width: 0; width: 100%; flex: 1; }
  .bx-editorial { padding: 40px 20px 64px; }
  .bx-faq__layout { grid-template-columns: 1fr; gap: 24px; }
  .bx-faq__side { position: static; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--hairline); padding-bottom: 0; gap: 0; }
  .bx-faq__nav { border-left: none; border-bottom: 2px solid transparent; padding: 10px 14px; white-space: nowrap; }
  .bx-faq__nav.is-active { border-left-color: transparent; border-bottom-color: var(--bronze); }
  .bx-oath__frame { padding: 40px 24px; }
  .bx-404__art svg { width: 240px; height: 120px; }
  .bx-404__num { font-size: 56px; }
  .bx-fp__card { padding: 36px 24px; }
  .bx-toast-host { top: auto; bottom: 16px; left: 16px; right: 16px; }
  .bx-toast { min-width: 0; max-width: none; }
  .pv-grid--2, .pv-grid--3, .pv-grid--4 { grid-template-columns: 1fr; }
}


/* =========================================
   New user-feature styles (P0 + P1 features)
   ========================================= */

/* Nav icon buttons (search, bell) */
.bx-nav__iconbtn { position: relative; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--ink-2); transition: all 200ms var(--ease-out); }
.bx-nav__iconbtn:hover { background: var(--paper-2); color: var(--ink); }
.bx-nav__iconbtn svg { width: 20px; height: 20px; }
.bx-nav__iconbtn-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; background: var(--bronze); color: #fff; font-size: 10px; font-weight: 600; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--paper); }

/* Mobile drawer active state */
.bx-nav__drawer-item.is-active { color: var(--bronze); background: var(--bronze-wash); }

/* ---------- Reading progress ---------- */
.bx-reading-progress { position: fixed; top: var(--header-h); left: 0; right: 0; height: 2px; background: transparent; z-index: calc(var(--z-nav) - 1); pointer-events: none; }
.bx-reading-progress > div { height: 100%; background: linear-gradient(90deg, var(--bronze), var(--bronze-deep)); transition: width 120ms linear; }

/* ---------- Password strength ---------- */
.bx-pw-strength { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.bx-pw-strength__bars { display: flex; gap: 3px; flex: 1; }
.bx-pw-strength__bar { flex: 1; height: 3px; background: var(--hairline); border-radius: 2px; transition: background 200ms; }
.bx-pw-strength__bar.lv-1 { background: #C9502E; }
.bx-pw-strength__bar.lv-2 { background: #C9A25F; }
.bx-pw-strength__bar.lv-3 { background: #5B8F6E; }
.bx-pw-strength__lbl { font-size: 12px; color: var(--ink-3); font-feature-settings: "tnum"; white-space: nowrap; }

/* Forgot-pw inline link */
.bx-field { position: relative; }
.bx-field__counter { position: absolute; right: 2px; bottom: -20px; font-size: 11px; color: var(--ink-3); font-feature-settings: "tnum"; }

/* Field error state */
.bx-field--err input, .bx-field--err textarea, .bx-field--err select { border-color: #C9502E; }
.bx-field__err { display: block; margin-top: 6px; font-size: 12px; color: #C9502E; }
.bx-field .req { color: #C9502E; }

/* ---------- Draft recover banner ---------- */
.bx-draft-recover { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: linear-gradient(135deg, var(--bronze-wash), #F7F0E0); border: 1px solid var(--bronze-line); border-radius: 10px; margin-bottom: 24px; animation: bxSlideDown 300ms var(--ease-out); }
.bx-draft-recover__icon { font-size: 26px; line-height: 1; }
@keyframes bxSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Like / save icon buttons ---------- */
.bx-icon-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--hairline); color: var(--ink-2); font-size: 14px; transition: all 200ms var(--ease-out); background: var(--surface); }
.bx-icon-btn:hover { border-color: var(--bronze); color: var(--bronze); }
.bx-icon-btn.is-active { background: var(--bronze-wash); border-color: var(--bronze); color: var(--bronze-deep); }
.bx-icon-btn.is-liked { background: #FBEDE6; border-color: #C9502E; color: #C9502E; }
.bx-icon-btn__ic { display: inline-flex; width: 18px; height: 18px; }
.bx-icon-btn__ic svg { width: 100%; height: 100%; }
.bx-icon-btn.is-burst .bx-icon-btn__ic { animation: bxHeartPop 500ms var(--ease-out); }
@keyframes bxHeartPop { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 70% { transform: scale(0.85); } 100% { transform: scale(1); } }
.bx-like-burst { position: absolute; inset: 0; pointer-events: none; }
.bx-like-burst > span { position: absolute; left: 28px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: #C9502E; animation: bxLikeParticle 700ms ease-out forwards; }
.bx-like-burst > span:nth-child(1) { --dx: -8px; --dy: -16px; }
.bx-like-burst > span:nth-child(2) { --dx: 10px; --dy: -18px; background: #E8976E; }
.bx-like-burst > span:nth-child(3) { --dx: 16px; --dy: -6px; background: var(--bronze); }
.bx-like-burst > span:nth-child(4) { --dx: 14px; --dy: 10px; background: #C9502E; }
.bx-like-burst > span:nth-child(5) { --dx: -10px; --dy: 12px; background: #E8976E; }
.bx-like-burst > span:nth-child(6) { --dx: -16px; --dy: 2px; background: var(--bronze); }
@keyframes bxLikeParticle { 0% { opacity: 1; transform: translate(0, 0) scale(0.5); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1); } }

/* ---------- Share modal ---------- */
.bx-share { max-width: 640px; width: 92vw; max-height: 92vh; overflow-y: auto; }
.bx-share__tabs { display: flex; gap: 4px; background: var(--paper-2); padding: 4px; border-radius: 10px; margin: 20px 0 24px; }
.bx-share__tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); border-radius: 8px; transition: all 200ms; }
.bx-share__tab svg { width: 18px; height: 18px; }
.bx-share__tab:hover { color: var(--ink); }
.bx-share__tab.is-active { background: var(--surface); color: var(--bronze); box-shadow: var(--sh-sm); }
.bx-share__panel { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bx-share__canvas { width: 100%; max-width: 480px; aspect-ratio: 7 / 9; border-radius: 8px; box-shadow: var(--sh-md); background: var(--paper-2); }
.bx-share__actions { display: flex; gap: 12px; }
.bx-share__panel--link { padding: 20px 0; align-items: stretch; }
.bx-share__link { display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 8px; }
.bx-share__link code { flex: 1; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-share__panel--qr { padding: 20px 0; }
.bx-share__qr { position: relative; width: 220px; height: 220px; padding: 14px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; display: grid; grid-template-columns: repeat(21, 1fr); gap: 0; }
.bx-share__qr > span { background: var(--ink); }
.bx-share__qr-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; background: var(--bronze); color: #fff; font-family: var(--font-serif); font-size: 22px; font-weight: 600; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 3px solid #fff; }

/* ---------- Notifications ---------- */
.bx-notif-backdrop { position: fixed; inset: 0; z-index: 80; }
.bx-notif-panel { position: fixed; top: calc(var(--header-h) + 8px); right: 24px; width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - var(--header-h) - 32px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 81; display: flex; flex-direction: column; animation: bxSlideDown 240ms var(--ease-out); }
.bx-notif-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.bx-notif-panel__head .h4 { margin: 0; }
.bx-notif-panel__list { overflow-y: auto; }
.bx-notif-empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.bx-notif-item { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); cursor: pointer; transition: background 150ms; position: relative; }
.bx-notif-item:hover { background: var(--paper-2); }
.bx-notif-item:last-child { border-bottom: 0; }
.bx-notif-item.is-read { opacity: 0.55; }
.bx-notif-item__dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; }
.bx-notif-item__dot--read   { background: var(--bronze); }
.bx-notif-item__dot--rank   { background: #5B8F6E; }
.bx-notif-item__dot--video  { background: #9A6AC0; }
.bx-notif-item__dot--notice { background: var(--ink-2); }
.bx-notif-item__body h5 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.bx-notif-item__body p { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.bx-notif-item__time { font-size: 11px; color: var(--ink-3); }

/* ---------- Global search modal ---------- */
.bx-search-modal { position: fixed; inset: 0; background: rgba(42, 35, 23, 0.4); backdrop-filter: blur(6px); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.bx-search-modal__card { width: 640px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--sh-lg); overflow: hidden; animation: bxFadeIn 200ms var(--ease-out); }
@keyframes bxFadeIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.bx-search-modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.bx-search-modal__head svg { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.bx-search-modal__head input { flex: 1; border: none; outline: none; font-size: 16px; font-family: inherit; background: transparent; color: var(--ink); }
.bx-search-modal__head kbd { font-family: var(--font-sans); font-size: 11px; color: var(--ink-3); padding: 2px 6px; border: 1px solid var(--hairline); border-radius: 4px; background: var(--paper-2); }
.bx-search-modal__results { max-height: 50vh; overflow-y: auto; }
.bx-search-modal__tip { padding: 28px 18px; text-align: center; color: var(--ink-3); font-size: 13px; margin: 0; }
.bx-search-modal__item { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; cursor: pointer; border-bottom: 1px solid var(--hairline); transition: background 150ms; }
.bx-search-modal__item:hover { background: var(--paper-2); }
.bx-search-modal__item:last-child { border-bottom: 0; }
.bx-search-modal__label { font-size: 14px; color: var(--ink); }
.bx-search-modal__kind { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Public profile ---------- */
.bx-pubprofile { display: flex; align-items: center; gap: 24px; padding: 40px 0 24px; }
.bx-pubprofile__avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--bronze-wash); color: var(--bronze); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bx-pubprofile__avatar svg { width: 72px; height: 72px; }
.bx-pubprofile__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px; background: var(--paper-2); border: 1px solid var(--hairline); border-radius: 12px; }
.bx-pubprofile__stats > div { text-align: center; display: flex; flex-direction: column; gap: 6px; }

/* ---------- My drafts row ---------- */
.bx-me-row--draft { background: linear-gradient(180deg, #fff, var(--paper-2)); border-style: dashed; }
.bx-me-row--draft .bx-me-row__id { background: var(--bronze-wash); color: var(--bronze); font-family: var(--font-serif); }

/* Tab count suffix */
.bx-tab__n { color: var(--ink-3); font-size: 12px; font-weight: 400; }

/* Filter sub variant */
.bx-filter--sub { margin-bottom: 20px; padding-top: 12px; }
.bx-filter--sub .bx-filter__tags { width: 100%; overflow-x: auto; padding-bottom: 4px; }

/* Submit success stamp anim */
.bx-success__stamp--anim { animation: bxStampDrop 500ms var(--ease-out); transform-origin: center; }
@keyframes bxStampDrop { 0% { opacity: 0; transform: scale(2) rotate(-12deg); } 60% { opacity: 1; transform: scale(0.9) rotate(-3deg); } 80% { transform: scale(1.05) rotate(0deg); } 100% { opacity: 1; transform: scale(1) rotate(0deg); } }

/* Mobile */
@media (max-width: 640px) {
  .bx-notif-panel { right: 8px; left: 8px; width: auto; }
  .bx-pubprofile { flex-direction: column; text-align: center; gap: 16px; }
  .bx-pubprofile__stats { grid-template-columns: 1fr; gap: 12px; }
  .bx-share__tab span { display: none; }
  .bx-search-modal { padding-top: 8vh; }
}

/* =====================================================
   投票模块 (.bx-poll-*) — 008_polls.sql
===================================================== */

/* ---------- 列表页 ---------- */
.bx-poll-list { padding: 32px 0 80px; }
.bx-poll-list__head { text-align: center; margin: 24px 0 32px; }
.bx-poll-list__head h1 { margin: 8px 0 6px; }
.bx-poll-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.bx-poll-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bx-poll-card:hover {
  transform: translateY(-2px);
  border-color: var(--bronze);
  box-shadow: 0 8px 22px rgba(184, 147, 90, 0.14);
}
.bx-poll-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
}
.bx-poll-card__type {
  background: var(--bronze-wash);
  color: var(--bronze-deep);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.bx-poll-card__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  line-height: 1.4;
}
.bx-poll-card__desc {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bx-poll-card__foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  border-top: 1px dashed var(--hairline);
  padding-top: 10px;
}
.bx-poll-card__code {
  font-family: var(--font-num);
  letter-spacing: 0.12em;
  color: var(--bronze-deep);
}

/* ---------- 详情页 ---------- */
.bx-poll-detail { padding: 32px 0 80px; max-width: 720px; }
.bx-poll-detail__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.bx-poll-detail__back {
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px 6px 0;
}
.bx-poll-detail__back:hover { color: var(--bronze-deep); }
.bx-poll-detail__code {
  font-size: 13px;
  color: var(--ink-3);
}
.bx-poll-detail__code strong {
  font-family: var(--font-num);
  color: var(--bronze-deep);
  letter-spacing: 0.16em;
  font-size: 16px;
  margin-left: 6px;
}
.bx-poll-detail__head {
  text-align: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--hairline);
}
.bx-poll-detail__title { margin: 8px 0 12px; }
.bx-poll-detail__desc { color: var(--ink-2); margin: 8px 0 16px; }
.bx-poll-detail__meta {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
.bx-poll-detail__ended-tag {
  background: var(--paper-2);
  color: var(--ink-2);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
}
.bx-poll-detail__pending-tag {
  background: var(--warning-bg);
  color: var(--warning);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
}

/* ---------- 倒计时 ---------- */
.bx-poll-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bronze-wash);
  border: 1px solid var(--bronze-line);
  border-radius: 999px;
  font-family: var(--font-num);
  color: var(--bronze-deep);
}
.bx-poll-countdown__lbl {
  font-family: var(--font-serif);
  font-size: 12px;
  margin-right: 4px;
  opacity: 0.7;
}
.bx-poll-countdown__num {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: center;
}
.bx-poll-countdown__sep { font-size: 16px; opacity: 0.6; }
.bx-poll-countdown.is-urgent {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: var(--danger);
  animation: bx-poll-pulse 1s ease-in-out infinite;
}
.bx-poll-countdown.is-zero {
  opacity: 0.5;
  animation: none;
}
@keyframes bx-poll-pulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(180, 90, 90, 0.3); }
  50%      { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(180, 90, 90, 0); }
}

/* ---------- 二元投票:左右对垒 ---------- */
.bx-poll-binary {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
  margin: 0 auto;
  position: relative;
}
.bx-poll-side {
  border: 2px solid var(--hairline);
  border-radius: 6px;
  padding: 32px 24px;
  text-align: center;
  background: var(--paper);
  transition: all 0.24s ease;
}
.bx-poll-side--left  { border-radius: 8px 0 0 8px; }
.bx-poll-side--right { border-radius: 0 8px 8px 0; border-left: none; }
.bx-poll-side.is-mine    { background: var(--bronze-wash); border-color: var(--bronze); }
.bx-poll-side.is-winner  { background: linear-gradient(180deg, var(--bronze-wash) 0%, var(--paper) 80%); border-color: var(--bronze-deep); box-shadow: inset 0 0 0 1px var(--bronze-deep); }
.bx-poll-side__inner { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.bx-poll-side__text {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.bx-poll-side__pct {
  font-family: var(--font-num);
  font-size: 56px;
  font-weight: 700;
  color: var(--bronze-deep);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}
.bx-poll-side__pct span {
  font-size: 24px;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 2px;
}
.bx-poll-side__count {
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-num);
}
.bx-poll-side__cta { margin-top: 16px; min-width: 140px; }
.bx-poll-side__mine-tag {
  display: inline-block;
  background: var(--bronze);
  color: white;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  margin-top: 8px;
}
.bx-poll-side__winner-tag {
  display: inline-block;
  background: var(--bronze-deep);
  color: white;
  padding: 6px 16px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.12em;
  margin-top: 8px;
}
.bx-poll-binary__vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--bronze-deep);
  background: var(--paper-2);
  padding: 0 16px;
  border-top: 2px solid var(--hairline);
  border-bottom: 2px solid var(--hairline);
  position: relative;
}
.bx-poll-binary__vs::before,
.bx-poll-binary__vs::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 30%;
  background: var(--bronze-line);
  left: 50%;
}
.bx-poll-binary__vs::before { top: 0; }
.bx-poll-binary__vs::after  { bottom: 0; }

/* ---------- 多选投票:垂直列表 ---------- */
.bx-poll-multi { display: flex; flex-direction: column; gap: 14px; }
.bx-poll-row {
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 18px 20px;
  background: var(--paper);
  transition: border-color 0.16s ease, background 0.24s ease;
}
.bx-poll-row.is-mine    { border-color: var(--bronze); background: var(--bronze-wash); }
.bx-poll-row.is-winner  { border-color: var(--bronze-deep); }
.bx-poll-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.bx-poll-row__text {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}
.bx-poll-row__pct {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 600;
  color: var(--bronze-deep);
  font-variant-numeric: tabular-nums;
}
.bx-poll-row__pct small {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 1px;
}
.bx-poll-row__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.bx-poll-row__tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.bx-poll-row__tag--mine { background: var(--bronze); color: white; }
.bx-poll-row__tag--win  { background: var(--bronze-deep); color: white; font-family: var(--font-serif); }

/* ---------- 进度条 ---------- */
.bx-poll-bar {
  height: 8px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
}
.bx-poll-bar__fill {
  height: 100%;
  background: var(--bronze);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.bx-poll-bar.is-highlight .bx-poll-bar__fill { background: var(--bronze-deep); }

/* ---------- 错误 / 登录提示 ---------- */
.bx-poll-error {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-size: 13px;
  border-radius: 0 4px 4px 0;
}
.bx-poll-loginhint {
  margin-top: 24px;
  padding: 14px 20px;
  text-align: center;
  background: var(--bronze-wash);
  border: 1px dashed var(--bronze);
  border-radius: 6px;
  color: var(--bronze-deep);
  cursor: pointer;
  font-family: var(--font-serif);
  transition: background 0.16s ease;
}
.bx-poll-loginhint:hover { background: var(--bronze-line); }
.bx-poll-pending {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}

/* ---------- 移动端适配(< 600px,粉丝多用手机)---------- */
@media (max-width: 600px) {
  .bx-poll-binary {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .bx-poll-side {
    border-radius: 8px !important;
    border: 2px solid var(--hairline);
    padding: 24px 16px;
  }
  .bx-poll-side--right { border-left: 2px solid var(--hairline); }
  .bx-poll-side__pct { font-size: 44px; }
  .bx-poll-side__text { font-size: 20px; }
  .bx-poll-binary__vs {
    border: none;
    background: transparent;
    color: var(--ink-3);
    padding: 0;
    height: auto;
  }
  .bx-poll-binary__vs::before,
  .bx-poll-binary__vs::after { display: none; }

  .bx-poll-detail { padding: 24px 16px 60px; }
  .bx-poll-detail__head { padding-bottom: 18px; margin-bottom: 24px; }
  .bx-poll-row { padding: 14px 16px; }
  .bx-poll-row__text { font-size: 16px; }
  .bx-poll-row__pct  { font-size: 20px; }
  .bx-poll-row__foot { flex-wrap: wrap; gap: 8px; }

  .bx-poll-list__grid { grid-template-columns: 1fr; gap: 14px; }
  .bx-poll-card { padding: 16px; }
}

/* =========================================
   违规词检测提示条 (写信 / 评论共用)
   ========================================= */
.bx-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.bx-comments__composer textarea.is-err { outline: 1px solid var(--danger); outline-offset: 4px; border-radius: 6px; }

.bx-sensitive { margin: 14px 0 4px; display: flex; flex-direction: column; gap: 12px; }
.bx-sensitive__block,
.bx-sensitive__warn { border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.6; }
.bx-sensitive__block { background: var(--danger-bg); border: 1px solid #E6B7B3; color: #8A3A3A; }
.bx-sensitive__warn  { background: var(--warning-bg); border: 1px solid #E8D28A; color: #7A5E1E; }
.bx-sensitive__head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.bx-sensitive__dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.bx-sensitive__dot--warn { background: var(--warning); }
.bx-sensitive__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bx-sensitive__chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.bx-sensitive__chip--block { background: var(--surface); border: 1px solid #E6B7B3; color: var(--danger); }
.bx-sensitive__chip--warn  { background: var(--surface); border: 1px solid #E8D28A; color: var(--warning); }
.bx-sensitive__hint { margin: 10px 0 0; font-size: 12px; opacity: 0.85; }

/* =========================================
   移动端 / 触屏增强 (附加,不改动已有断点)
   ========================================= */
/* 图片/视频永不撑破容器 —— 手机上奏折配图、头像最常见的破版来源 */
img, video { max-width: 100%; height: auto; }

/* 触屏上取消「悬浮位移」,避免首次轻点只触发 hover 的黏滞感与抖动 */
@media (hover: none) {
  .bx-letter:hover { transform: none; }
  .bx-btn--primary:hover, .bx-btn--secondary:hover { transform: none; }
}

/* 手机上把最小的可点元素提到 ≥40px,符合触控标准 */
@media (max-width: 640px) {
  .bx-modal__close { width: 40px; height: 40px; }
  .bx-upload__remove { width: 28px; height: 28px; }
  .bx-nav__burger { padding: 10px 12px; }
  .bx-modal__card { padding: 28px 20px; }
}

/* ==========================================================================
   Dark mode · targeted overrides
   The bulk of dark theming comes from the remapped tokens (--surface, --paper*,
   --ink*, semantic -bg). These selectors had hardcoded light gradients / pills /
   white QR backgrounds that the token remap can't reach.
   ========================================================================== */
/* 朕曰 御批卡片 — keep it special, just in dark bronze */
:root[data-theme="dark"] .bx-reply { background: linear-gradient(180deg, var(--paper-3) 0%, rgba(201, 163, 104, 0.08) 100%); }
/* subtle hover / featured gradients on cards & rows */
:root[data-theme="dark"] .bx-letter:hover,
:root[data-theme="dark"] .bx-me-row:hover { background: linear-gradient(180deg, var(--paper-3) 0%, rgba(201, 163, 104, 0.06) 100%); }
:root[data-theme="dark"] .bx-podium__card--0 { background: linear-gradient(180deg, var(--bronze-wash) 0%, var(--surface) 40%); }
:root[data-theme="dark"] .bx-me-hero { background: linear-gradient(180deg, var(--bronze-wash) 0%, var(--surface) 100%); }
:root[data-theme="dark"] .bx-oath__frame { background: linear-gradient(180deg, var(--surface) 0%, var(--bronze-wash) 100%); }
:root[data-theme="dark"] .bx-me-row--draft { background: linear-gradient(180deg, var(--surface), var(--paper-2)); }
:root[data-theme="dark"] .bx-draft-recover { background: linear-gradient(135deg, var(--bronze-wash), var(--paper-3)); }
/* status pills — dark tints, hues stay legible */
:root[data-theme="dark"] .s-pending { background: var(--warning-bg); color: var(--warning); }
:root[data-theme="dark"] .s-review  { background: var(--info-bg);    color: var(--info); }
:root[data-theme="dark"] .s-read    { background: var(--bronze-wash); color: var(--bronze-soft); }
:root[data-theme="dark"] .s-done    { background: var(--success-bg);  color: var(--success); }
:root[data-theme="dark"] .bx-setting-row--danger { background: var(--danger-bg); }
:root[data-theme="dark"] .bx-icon-btn.is-liked { background: rgba(208, 122, 122, 0.16); border-color: var(--danger); color: var(--danger); }
/* QR codes MUST stay on white to remain scannable, even in dark mode */
:root[data-theme="dark"] .bx-acct-card__qr,
:root[data-theme="dark"] .bx-qr-line svg,
:root[data-theme="dark"] .bx-share__qr-bg { background: #fff; }
