/* ================================================================
   Onomeo 反馈系统 · feedback.css
   按 design/feedback-system-DESIGN.md 落地
   所有 class 用 .fb- 前缀、避免污染主项目命名空间
   触发方式：调用 window.feedback.xxx(opts) — 见 js/feedback.js
   ================================================================ */

/* === 4 色 token + 字体（scope 到 .fb-root）=== */
.fb-root {
  --fb-bg:           #0d1219;
  --fb-surface:      #161b24;
  --fb-surface-2:    #1f2530;
  --fb-divider:      rgba(232, 226, 213, 0.08);

  --fb-text:         #e8e2d5;
  --fb-text-dim:     #8e8a83;
  --fb-text-muted:   #5c5953;

  --fb-gold:         #c9a961;
  --fb-seal-red:     #a8392f;
  --fb-night-blue:   #3a4860;
  --fb-flame:        #d97742;

  --fb-font-display: 'Fraunces', 'Noto Serif SC', Georgia, serif;
  --fb-font-body:    'Geist', 'Noto Serif SC', system-ui, sans-serif;
  --fb-font-script:  'Caveat', 'PingFang SC', cursive;
}

/* === overlay 容器 === */
.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .5s ease;
  font-family: var(--fb-font-body);
  color: var(--fb-text);
  -webkit-font-smoothing: antialiased;
}
.fb-overlay.fb-in {
  opacity: 1;
  pointer-events: auto;
}
.fb-overlay.fb-blocking {
  background: rgba(13, 18, 25, 0.94);
  backdrop-filter: blur(10px) saturate(0.6);
  -webkit-backdrop-filter: blur(10px) saturate(0.6);
}

/* grain noise 全屏覆盖（仅 overlay 内）*/
.fb-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: 1;
}

/* ================================================================
   场景：unlock（门 + 锁 + 引子）
   ================================================================ */
.fb-unlock-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
}
.fb-unlock-door {
  position: relative;
  width: 200px;
  height: 280px;
}
.fb-unlock-door svg { width: 100%; height: 100%; display: block; }
.fb-unlock-door-left, .fb-unlock-door-right {
  transform-origin: bottom center;
  transition: transform .9s cubic-bezier(.25, .46, .45, .94);
}
.fb-unlock.opening .fb-unlock-door-left {
  transform: perspective(400px) rotateY(-32deg) translateX(-1px);
}
.fb-unlock.opening .fb-unlock-door-right {
  transform: perspective(400px) rotateY(8deg);
}
.fb-unlock-door-glow {
  position: absolute;
  inset: 8% 28% 12% 28%;
  background: radial-gradient(ellipse at center, rgba(201, 169, 97, 0.75), transparent 70%);
  opacity: 0;
  transition: opacity .7s;
  pointer-events: none;
}
.fb-unlock.opening .fb-unlock-door-glow {
  opacity: 1;
  transition-delay: .35s;
}

.fb-unlock-lock {
  position: absolute;
  top: 32%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 66px;
  z-index: 5;
}
.fb-unlock-lock-top, .fb-unlock-lock-bottom {
  position: absolute;
  inset: 0;
  transition: transform .65s cubic-bezier(.4, 0, .2, 1), opacity .6s;
}
.fb-unlock-lock svg { width: 100%; height: 100%; display: block; }
.fb-unlock.broken .fb-unlock-lock-top {
  transform: translate(-28px, 120px) rotate(-100deg);
  opacity: 0;
}
.fb-unlock.broken .fb-unlock-lock-bottom {
  transform: translate(22px, 160px) rotate(45deg);
  opacity: 0;
}

.fb-unlock-intro {
  margin-top: 32px;
  font-family: var(--fb-font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--fb-text);
  text-align: center;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s, transform .8s cubic-bezier(.25, .46, .45, .94);
  font-variation-settings: "SOFT" 50, "opsz" 22;
}
.fb-unlock-intro.fb-in {
  opacity: 1;
  transform: translateY(0);
}

.fb-unlock-tap {
  margin-top: 28px;
  font-size: 11px;
  color: var(--fb-text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  cursor: pointer;
  transition: opacity .8s, color .2s;
}
.fb-unlock-tap.fb-in { opacity: 1; }
.fb-unlock-tap:hover { color: var(--fb-gold); }

/* ================================================================
   场景：levelup（电梯翻牌 + 门关 + 便签）
   ================================================================ */
.fb-levelup-content {
  position: relative;
  z-index: 2;
  width: 460px;
  max-width: 90vw;
  height: 280px;
  background: var(--fb-bg);
  border-radius: 8px;
  overflow: hidden;
  padding: 40px;
}
.fb-levelup-row {
  display: flex;
  align-items: center;
  gap: 36px;
  justify-content: center;
  padding-top: 24px;
}
.fb-levelup-lv {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--fb-font-display);
  font-style: italic;
}
.fb-levelup-lv-lbl {
  font-size: 14px;
  color: var(--fb-text-muted);
  letter-spacing: 0.12em;
}
.fb-levelup-digit-wrap {
  position: relative;
  width: 52px;
  height: 72px;
  perspective: 240px;
}
.fb-levelup-digit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: var(--fb-gold);
  font-variation-settings: "SOFT" 30, "opsz" 60;
  backface-visibility: hidden;
  transition: transform .24s cubic-bezier(.7, 0, .3, 1);
  transform-origin: center;
  line-height: 1;
}
.fb-levelup-digit.fb-old { transform: rotateX(0deg); }
.fb-levelup-digit.fb-new { transform: rotateX(-90deg); }
.fb-levelup-digit-wrap.flipping .fb-levelup-digit.fb-old { transform: rotateX(90deg); }
.fb-levelup-digit-wrap.flipping .fb-levelup-digit.fb-new { transform: rotateX(0deg); }

.fb-levelup-xp-wrap {
  flex: 0 0 200px;
}
.fb-levelup-xp-bar {
  height: 6px;
  background: var(--fb-surface-2);
  border-radius: 1px;
  overflow: hidden;
}
.fb-levelup-xp-fill {
  height: 100%;
  background: var(--fb-gold);
  width: 95%;
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}
.fb-levelup-xp-text {
  font-size: 12px;
  color: var(--fb-text-dim);
  margin-top: 8px;
  letter-spacing: 0.04em;
}

.fb-levelup-door-top, .fb-levelup-door-bot {
  position: absolute;
  left: 0; right: 0;
  height: 52%;
  background: #050507;
  z-index: 10;
  pointer-events: none;
  transition: transform .5s cubic-bezier(.7, 0, .3, 1);
}
.fb-levelup-door-top { top: 0; transform: translateY(-100%); }
.fb-levelup-door-bot { bottom: 0; transform: translateY(100%); }
.fb-levelup-door-top.closed,
.fb-levelup-door-bot.closed { transform: translateY(0); }

.fb-levelup-note {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.82) rotate(-2deg);
  z-index: 15;
  opacity: 0;
  transition: opacity .4s, transform .5s cubic-bezier(.2, .7, .3, 1);
  pointer-events: none;
}
.fb-levelup-note.fb-in {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(-2deg);
}
.fb-levelup-note-paper {
  background: #f0e6d2;
  color: #2a201a;
  padding: 26px 38px 28px;
  border-radius: 2px;
  font-family: var(--fb-font-script);
  text-align: center;
  box-shadow:
    0 12px 32px rgba(0,0,0,0.5),
    0 2px 4px rgba(0,0,0,0.3);
  min-width: 220px;
}
.fb-levelup-note-line1 {
  font-size: 24px;
  margin-bottom: 4px;
  line-height: 1.2;
}
.fb-levelup-note-line2 {
  font-size: 19px;
  color: #5a4634;
  line-height: 1.2;
}
.fb-levelup-tap {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--fb-font-body);
  font-size: 11px;
  color: var(--fb-text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  cursor: pointer;
  transition: opacity .8s, color .2s;
  z-index: 20;
}
.fb-levelup-tap.fb-in { opacity: 1; }
.fb-levelup-tap:hover { color: var(--fb-gold); }

/* ================================================================
   场景：daily-done（日转夜 + 远处钟）
   ================================================================ */
.fb-daily-done {
  background: rgba(13, 18, 25, 0);
  transition: background 2s linear, opacity .5s ease;
}
.fb-daily-done.fb-in {
  background: rgba(13, 18, 25, 0.92);
}
.fb-daily-done-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
  padding: 0 32px;
  text-align: center;
}
.fb-daily-done-bigline {
  font-family: var(--fb-font-display);
  font-style: italic;
  font-size: 36px;
  color: var(--fb-text);
  font-variation-settings: "SOFT" 60, "opsz" 36;
  margin-bottom: 22px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.1s, transform 1.2s cubic-bezier(.25, .46, .45, .94);
}
.fb-daily-done.show-bigline .fb-daily-done-bigline {
  opacity: 1;
  transform: translateY(0);
}
.fb-daily-done-quote {
  font-family: var(--fb-font-script);
  font-size: 20px;
  color: var(--fb-text-dim);
  line-height: 1.5;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1s, transform 1.1s cubic-bezier(.25, .46, .45, .94);
}
.fb-daily-done.show-quote .fb-daily-done-quote {
  opacity: 1;
  transform: translateY(0);
}
.fb-daily-done-tomorrow {
  font-family: var(--fb-font-body);
  font-size: 13px;
  color: var(--fb-text-muted);
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 1s;
}
.fb-daily-done.show-tomorrow .fb-daily-done-tomorrow {
  opacity: 1;
}
.fb-daily-done-tap {
  margin-top: 40px;
  font-size: 11px;
  color: var(--fb-text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  cursor: pointer;
  transition: opacity .8s, color .2s;
}
.fb-daily-done.show-tap .fb-daily-done-tap {
  opacity: 1;
}
.fb-daily-done-tap:hover { color: var(--fb-gold); }

/* ================================================================
   响应式
   ================================================================ */
@media (max-width: 540px) {
  .fb-unlock-door { width: 160px; height: 220px; }
  .fb-unlock-lock { width: 42px; height: 54px; }
  .fb-unlock-intro { font-size: 19px; }
  .fb-levelup-content { padding: 28px 20px; height: 240px; }
  .fb-levelup-row { gap: 20px; }
  .fb-levelup-digit { font-size: 48px; }
  .fb-daily-done-bigline { font-size: 28px; }
  .fb-daily-done-quote { font-size: 17px; }
}

/* === prefers-reduced-motion 退化为瞬时 === */
@media (prefers-reduced-motion: reduce) {
  .fb-overlay,
  .fb-overlay *,
  .fb-overlay *::before,
  .fb-overlay *::after {
    transition-duration: 0.01s !important;
    animation-duration: 0.01s !important;
  }
}
