/* ============================================================
   时光档案馆 · 二周年  —  Retro Vintage Design System
   纯原生 CSS，无外部依赖（离线可用）
   ============================================================ */

/* ---------- 0. Tokens ---------- */
:root{
  /* 配色 */
  --parchment:      #f5e6d3;
  --parchment-2:    #e8d5c0;
  --parchment-3:    #eedbc2;
  --parchment-4:    #f0dfc7;
  --saddle:         #8b4513;
  --saddle-deep:    #5c2e0a;
  --rust:           #c94c4c;
  --forest:         #2e4a3f;
  --amber:          #d4a373;
  /* 文字层级：全部满足 WCAG AA（≥4.5:1），靠字号/字距区分主次，不靠降低对比度 */
  --ink-80:         #6b3a12;   /* 正文次级   约 7.6:1 */
  --ink-70:         #7a4a1e;   /* 说明文字   约 6.1:1 */
  --ink-60:         #7a4a1e;   /* 最小号文字 约 6.1:1 */

  /* 字体 */
  --serif: Georgia, "Songti SC", "STSong", "SimSun", "Noto Serif SC",
           "Source Han Serif SC", "Times New Roman", serif;
  --heiti: "Heiti SC", "SimHei", "Microsoft YaHei", "PingFang SC", sans-serif;

  /* 阴影（棕调，绝无霓虹光晕） */
  --shadow-s: 0 2px 4px rgba(139,69,19,.10);
  --shadow-m: 0 4px 8px rgba(139,69,19,.15);
  --shadow-l: 0 8px 16px rgba(139,69,19,.18);

  /* 时间 */
  --t: 700ms;
  --ease: ease-in-out;

  /* 纸张纹理 */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23g)' opacity='0.17'/%3E%3C/svg%3E");
}

/* ---------- 1. Reset & 纸面 ---------- */
*,
*::before,
*::after{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; }

body{
  margin: 0;
  min-height: 100%;
  background-color: var(--parchment);
  color: var(--saddle);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 纸张纤维 */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--noise);
  opacity: .9;
}

/* 做旧边角（内阴影，非渐变） */
body::after{
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(92,46,10,.16),
              inset 0 0 10px rgba(92,46,10,.10);
}

.app{ position: relative; z-index: 1; }

/* hidden 属性必须优先于 .btn 的 display，否则「前往下一关」会一直露出来 */
[hidden]{ display: none !important; }

::selection{
  background: rgba(139,69,19,.22);
  color: var(--saddle-deep);
}

/* ---------- 2. 排版基础 ---------- */
.h1{
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.25;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--saddle);
}

.h2{
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.35;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--saddle);
}

.eyebrow{
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-70);
}

.sub{
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .16em;
  color: var(--ink-80);
}

.label,
.label-mini{
  display: block;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-80);
}

.label-mini{ letter-spacing: .2em; font-size: 10px; color: var(--ink-60); }

.hint{
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  letter-spacing: .06em;
  color: var(--ink-60);
}

.foot-note{
  margin: 18px 0 0;
  font-size: 11px;
  line-height: 1.8;
  letter-spacing: .14em;
  color: var(--ink-60);
  text-align: center;
}

/* ---------- 3. 布局骨架 ---------- */
.view{ display: none; }
.view.is-active{ display: block; }

.shell{
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 20px 88px;
}

@media (min-width: 768px){
  .shell{ padding: 56px 40px 104px; }
}
@media (min-width: 1200px){
  .shell{ padding-left: 64px; padding-right: 64px; }
}

.page-head{ margin-bottom: 28px; }

.head-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.head-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-topbar{
  align-items: center;
  margin-bottom: 22px;
}

/* ---------- 4. 卡片 / 角花 ---------- */
.card{
  position: relative;
  border: 2px solid var(--saddle);
  background-color: var(--parchment);
  background-image: var(--noise);
  border-radius: 0;
  padding: 28px 22px;
  box-shadow: var(--shadow-m);
}

@media (min-width: 768px){
  .card{ padding: 40px 38px; }
}

/* 角花：四角 L 形，hover 时缓慢显现 */
.corner{
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--saddle);
  opacity: .38;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.corner.tl{ top: 7px;    left: 7px;    border-top-width: 2px;    border-left-width: 2px; }
.corner.tr{ top: 7px;    right: 7px;   border-top-width: 2px;    border-right-width: 2px; }
.corner.bl{ bottom: 7px; left: 7px;    border-bottom-width: 2px; border-left-width: 2px; }
.corner.br{ bottom: 7px; right: 7px;   border-bottom-width: 2px; border-right-width: 2px; }

.card:hover .corner,
.level-card:hover .corner,
.reel:hover .corner,
.login-card:hover .corner{ opacity: 1; }

/* ---------- 5. 分隔线 ---------- */
.divider{
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 26px;
  color: var(--saddle);
}
.d-line{
  flex: 1 1 auto;
  height: 0;
  border-top: 2px solid var(--saddle);
  opacity: .45;
}
.d-glyph{
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
  opacity: .8;
}

/* ---------- 6. 表单 ---------- */
.field{ margin-bottom: 22px; }
.field .label{ margin-bottom: 8px; }

.password-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.caps-hint{
  color: var(--rust);
  font-weight: 700;
}

.input{
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: transparent;
  color: var(--saddle);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .1em;
  line-height: 1.6;
  outline: none;
  transition: background-color var(--t) var(--ease),
              border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder{
  color: rgba(122,74,30,.62);
  letter-spacing: .1em;
}

/* 聚焦：不出 outline，改用内描边 + 纸色加深（可见焦点） */
.input:focus{
  background-color: rgba(139,69,19,.05);
  box-shadow: inset 0 0 0 2px rgba(139,69,19,.38);
}

.input:hover{ background-color: rgba(139,69,19,.03); }

.input.is-invalid{
  border-color: var(--rust);
  background-color: rgba(201,76,76,.06);
}

/* 验证码一行 */
.captcha-row{
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 10px;
  align-items: stretch;
}

.captcha-input{ min-width: 0; }

.captcha-canvas{
  display: block;
  width: 140px;
  height: 48px;
  border: 2px solid var(--saddle);
  background-color: var(--parchment-4);
  border-radius: 0;
  box-shadow: inset 0 0 10px rgba(139,69,19,.14);
  cursor: pointer;
  transition: box-shadow var(--t) var(--ease);
}
.captcha-canvas:hover{ box-shadow: inset 0 0 10px rgba(139,69,19,.26); }

@media (max-width: 520px){
  .captcha-row{
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "input canvas"
      "btn   canvas";
  }
  .captcha-input{ grid-area: input; }
  .captcha-canvas{ grid-area: canvas; }
  .captcha-refresh{ grid-area: btn; justify-self: start; }
}

/* 错误提示 */
.error{
  margin: 0 0 14px;
  min-height: 0;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .06em;
  color: var(--rust);
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.error.is-shown{ opacity: 1; }

/* ---------- 7. 按钮 ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: transparent;
  color: var(--saddle);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t) var(--ease),
              color var(--t) var(--ease),
              border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease),
              opacity var(--t) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.btn-primary{
  background-color: var(--saddle);
  color: var(--parchment);
  border-color: var(--saddle);
}
/* hover 只加深现有复古色，不引入新色 */
.btn-primary:hover{
  background-color: var(--saddle-deep);
  border-color: var(--saddle-deep);
  color: var(--parchment);
}

.btn-ghost:hover{
  background-color: var(--parchment-3);
  color: var(--saddle-deep);
  border-color: var(--saddle-deep);
}

.btn:active{ opacity: .78; }

.btn:focus-visible{
  outline: 2px solid var(--saddle);
  outline-offset: 3px;
}

.btn:disabled,
.btn[disabled]{
  cursor: not-allowed;
  opacity: .5;
  background-color: transparent;
  color: var(--ink-60);
  border-color: rgba(139,69,19,.45);
}

.btn-block{ display: flex; width: 100%; }

.btn-sm{
  padding: 7px 14px;
  font-size: 11px;
  letter-spacing: .18em;
}

.link-btn{
  border: 0;
  background: transparent;
  padding: 2px 0;
  color: var(--ink-60);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .16em;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: color var(--t) var(--ease);
}
.link-btn:hover{ color: var(--saddle-deep); }
.link-btn:focus-visible{ outline: 2px solid var(--saddle); outline-offset: 3px; }

/* ---------- 8. 登录页：左放映 / 右登录 ---------- */
.login-wrap{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 34px 18px 52px;
}

/* 跨页布局：窄屏上下叠，宽屏左右分栏 */
.gate{
  display: grid;
  width: 100%;
  max-width: 1120px;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

@media (min-width: 1024px){
  .gate{ grid-template-columns: minmax(0, 1.04fr) 54px minmax(0, .96fr); }
}

/* 窄屏叠放时收窄版心，避免输入框和照片被拉成一条 */
@media (max-width: 1023px){
  .gate{ max-width: 620px; margin: 0 auto; }
}

/* 中缝：竖线 + 花饰 */
.gate-spine{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--saddle);
}
.gate-spine::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background-color: rgba(139,69,19,.42);
}
.gate-spine span{
  position: relative;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
  background-color: var(--parchment);
}

@media (min-width: 1024px){
  .gate-spine{ min-height: 0; }
  .gate-spine::before{
    left: 50%;
    right: auto;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
    margin: 0 0 0 -1px;
  }
  .gate-spine span{ padding: 12px 0; }
}

/* ---- 放影区 ---- */
.reel{
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  border: 2px solid var(--saddle);
  background-color: var(--parchment);
  background-image: var(--noise);
  box-shadow: var(--shadow-m);
}

@media (min-width: 768px){
  .reel{ padding: 26px 24px; }
}

.reel-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.reel-head .eyebrow{ margin: 0; }
.reel-count{ color: var(--ink-80); }

.reel-stage{
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  aspect-ratio: 4 / 3;
  border: 2px solid var(--saddle);
  background-color: var(--parchment-4);
  background-image: var(--noise);
  overflow: hidden;
  box-shadow: inset 0 0 26px rgba(139,69,19,.18);
}

@media (min-width: 1024px){
  /* 宽屏时让照片撑满左栏高度，与右侧表单齐平 */
  .reel-stage{ flex: 1 1 auto; aspect-ratio: auto; min-height: 300px; }
}

.reel-slide{
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  pointer-events: none;
}
.reel-slide.is-active{
  opacity: 1;
  pointer-events: auto;
}

.reel-slide img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 照片做旧 */
  filter: sepia(.35) saturate(.85) brightness(.94) contrast(.96);
}

/* 空位占牌 */
.reel-slot{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--saddle);
  text-align: center;
}
.reel-slot svg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.slot-label{
  position: relative;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.slot-note{
  position: relative;
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--ink-70);
}

/* 胶卷进度（每张 3 秒走完一格） */
.reel-bar{
  height: 8px;
  margin-top: 14px;
  border: 2px solid var(--saddle);
  background-color: transparent;
  overflow: hidden;
}
.reel-bar span{
  display: block;
  width: 0;
  height: 100%;
  background-color: var(--saddle);
  animation: reelFill var(--reel-ms, 3000ms) linear forwards;
}
.reel.is-paused .reel-bar span{ animation-play-state: paused; }

@keyframes reelFill{
  from{ width: 0; }
  to{ width: 100%; }
}

.reel-foot{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.reel-caption{ min-width: 0; }
.reel-title{
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--saddle);
}
.reel-note{
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-70);
}

.reel-controls{
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.reel-arrow{
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: transparent;
  color: var(--saddle);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
.reel-arrow:hover{ background-color: var(--parchment-3); color: var(--saddle-deep); }
.reel-arrow:active{ opacity: .78; }
.reel-arrow:focus-visible{ outline: 2px solid var(--saddle); outline-offset: 3px; }

.reel-dots{
  display: flex;
  gap: 7px;
  margin-top: 16px;
}
.reel-dot{
  width: 30px;
  height: 16px;
  padding: 0;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  transition: background-color var(--t) var(--ease);
}
.reel-dot:hover{ background-color: var(--parchment-3); }
.reel-dot.is-active{ background-color: var(--saddle); }
.reel-dot:focus-visible{ outline: 2px solid var(--saddle); outline-offset: 3px; }

/* ---- 登录栏 ---- */
.login-card{
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 20px 26px;
  border: 2px solid var(--saddle);
  background-color: var(--parchment);
  background-image: var(--noise);
  box-shadow: var(--shadow-m);
  animation: fadeIn 900ms ease-in-out both;
}

@media (min-width: 560px){
  .login-card{ padding: 44px 34px 30px; }
}

.login-card .divider{ margin: 20px 0 26px; }

@keyframes fadeIn{
  from{ opacity: 0; }
  to{ opacity: 1; }
}

/* ---------- 9. 过渡界面 ---------- */
.view-transition{
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background-color: var(--parchment-3);
  background-image: var(--noise);
}

#view-transition.is-active{ display: flex; }

.trans-inner{
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeIn 800ms ease-in-out both;
}

.seal{
  width: 66px;
  height: 66px;
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--saddle);
  border-radius: 0;
  color: var(--saddle);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 3px var(--parchment-3), inset 0 0 0 4px rgba(139,69,19,.55);
  animation: sealBreathe 3000ms ease-in-out infinite alternate;
}

@keyframes sealBreathe{
  from{ opacity: .62; }
  to{ opacity: 1; }
}

.trans-main{
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--saddle);
}

.trans-sub{
  margin: 10px 0 30px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--ink-70);
}

.trans-bar{
  width: 220px;
  height: 6px;
  margin: 0 auto;
  border: 2px solid var(--saddle);
  background-color: transparent;
  overflow: hidden;
}

.trans-bar span{
  display: block;
  width: 0;
  height: 100%;
  background-color: var(--saddle);
}

/* ---------- 10. 总体介绍 ---------- */
.intro-card{ max-width: 760px; margin: 0 auto; }

.intro-lead{
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: .06em;
  color: var(--saddle);
}

.placeholder-block{
  border: 2px dashed rgba(139,69,19,.55);
  padding: 22px 20px;
  margin-bottom: 26px;
  background-color: rgba(232,213,192,.28);
  transition: background-color var(--t) var(--ease);
}
.placeholder-block:hover{ background-color: rgba(232,213,192,.5); }

.ph-tag{
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-60);
}

.ph-text{
  margin: 0;
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: .05em;
  color: var(--saddle-deep);
}

.intro-meta{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 30px;
  padding: 16px 0;
  border-top: 2px solid rgba(139,69,19,.35);
  border-bottom: 2px solid rgba(139,69,19,.35);
}
.intro-meta > div{ text-align: center; }
.intro-meta .label-mini{ margin-bottom: 4px; }
.meta-val{
  margin: 0;
  font-size: 14px;
  letter-spacing: .16em;
  color: var(--saddle);
}

/* ---------- 11. 图钉板 ---------- */
.board-note{
  margin: 0;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-70);
  transition: color var(--t) var(--ease);
}
.board-note.is-fresh{ color: var(--saddle-deep); }

.progress-tag{
  display: inline-block;
  padding: 5px 12px;
  border: 2px solid var(--saddle);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--saddle);
  white-space: nowrap;
}

.level-list{
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@media (min-width: 768px){
  .level-list{ gap: 28px; }
}

/* —— 关卡卡片 —— */
.level-card{
  position: relative;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: var(--parchment);
  background-image: var(--noise);
  padding: 30px 20px 24px;
  box-shadow: var(--shadow-s);
  transition: box-shadow var(--t) var(--ease),
              background-color var(--t) var(--ease),
              border-color var(--t) var(--ease);
}

@media (min-width: 768px){
  .level-card{ padding: 34px 30px 28px; }
}

.level-card:hover{ box-shadow: var(--shadow-m); }

/* 未解锁：整体做旧压暗（但结构仍可读） */
.level-card.is-locked{
  border-color: rgba(139,69,19,.55);
  background-color: #eddfce;
}

.level-inner{
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

@media (min-width: 860px){
  .level-inner{
    grid-template-columns: 272px minmax(0, 1fr);
    gap: 32px;
  }
}

/* —— 快照 + 图钉 —— */
.snapshot-wrap{
  position: relative;
  min-width: 0;
}

.pin{
  position: absolute;
  top: -24px;
  left: calc(50% - 14px);
  width: 28px;
  height: 38px;
  z-index: 2;
  pointer-events: none;
}
@media (min-width: 860px){
  .pin{ left: calc(50% - 14px); }
}

.snapshot{
  position: relative;
  border: 2px solid var(--saddle);
  border-radius: 0;
  background-color: var(--parchment-4);
  background-image: var(--noise);
  color: var(--saddle);
  overflow: hidden;
  box-shadow: inset 0 0 26px rgba(139,69,19,.18);
  aspect-ratio: 16 / 10;
}

.snap-svg{
  display: block;
  width: 100%;
  height: 100%;
  /* 图片做旧：sepia + brightness-90 */
  filter: sepia(.35) saturate(.85) brightness(.94) contrast(.96);
  transition: filter var(--t) var(--ease);
}

.level-card:hover .snap-svg{
  filter: sepia(.28) saturate(.95) brightness(.97);
}

.snap-label{
  margin: 8px 0 0;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-70);
}

/* 锁遮罩 */
.lock-veil{
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(245,230,211,.62);
  color: var(--saddle-deep);
  border: 2px solid rgba(139,69,19,.35);
}
.lock-veil svg{ display: block; opacity: .92; }
.lock-veil span{
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
}

.level-card.is-locked .lock-veil{ display: flex; }

/* —— 右侧信息 —— */
.meta{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.lv-index{
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-70);
}

.status-tag{
  display: inline-block;
  padding: 2px 9px;
  border: 2px solid var(--saddle);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--saddle);
  white-space: nowrap;
}
.status-tag.done{
  background-color: var(--forest);
  border-color: var(--forest);
  color: var(--parchment);
}
.status-tag.locked{
  border-color: rgba(139,69,19,.45);
  color: var(--ink-60);
}

.lv-title{
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .14em;
  color: var(--saddle);
}

.lv-sub{
  margin: 0;
  font-size: 12px;
  letter-spacing: .12em;
  color: var(--ink-70);
}

.difficulty-row{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}

.stars{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--saddle);
}

.star{
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.star svg{
  display: block;
  width: 18px;
  height: 18px;
}

.star-empty svg{
  fill: none;
  stroke: var(--saddle);
  stroke-width: 1.5;
  opacity: .55;
}

.star-fill{
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  overflow: hidden;
}

.star-fill svg{
  fill: var(--saddle);
  stroke: var(--saddle);
  stroke-width: 1;
}

.score{
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--ink-80);
  white-space: nowrap;
}

.lv-desc{
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 2;
  letter-spacing: .04em;
  color: var(--ink-80);
}

.enter-btn{ align-self: flex-start; margin-top: 6px; }

/* ---------- 12. 解锁动画：锁摇开 → 灰变彩 ---------- */
.level-card.is-locked .revealable,
.level-card.is-locked .pin{
  filter: grayscale(1) contrast(.92);
  opacity: .72;
}

.revealing .revealable{
  filter: grayscale(0) contrast(1);
  opacity: 1;
  transition: filter 1500ms var(--ease), opacity 1500ms var(--ease);
}

.revealing .pin{
  filter: grayscale(0) contrast(1);
  opacity: 1;
  transition: filter 1500ms var(--ease) 180ms, opacity 1500ms var(--ease) 180ms;
}

.revealing .lock-veil{
  display: flex;
  animation: lockAway 1500ms var(--ease) forwards;
}

.revealing{
  border-color: var(--saddle);
  transition: border-color 1500ms var(--ease);
}

@keyframes lockAway{
  0%   { opacity: 1;   transform: rotate(0deg); }
  12%  { opacity: 1;   transform: rotate(-8deg); }
  26%  { opacity: .96; transform: rotate(8deg); }
  40%  { opacity: .9;  transform: rotate(-6deg); }
  54%  { opacity: .82; transform: rotate(5deg); }
  68%  { opacity: .6;  transform: rotate(-3deg); }
  82%  { opacity: .3;  transform: rotate(2deg); }
  100% { opacity: 0;   transform: rotate(0deg); }
}

/* ---------- 13. 单关页面 ---------- */
.stage-card{ padding-top: 34px; }

.stage-sub{
  margin: 10px 0 0;
  font-size: 14px;
  letter-spacing: .12em;
  color: var(--ink-80);
}

.stage-frame{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  margin: 26px 0 26px;
  padding: 40px 22px;
  border: 2px dashed rgba(139,69,19,.5);
  background-color: rgba(232,213,192,.24);
  text-align: center;
  transition: background-color var(--t) var(--ease);
}

.stage-frame:hover{ background-color: rgba(232,213,192,.44); }

.stage-ph{
  margin: 0;
  font-size: 15px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--saddle);
}

.stage-ph-sub{
  margin: 0;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--ink-60);
}

.stage-actions{
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- 14. 图钉板页脚 ---------- */
.board-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 2px solid rgba(139,69,19,.3);
}
.board-foot .foot-note{ margin: 0; text-align: left; }

/* ---------- 15. 通关弹窗 ---------- */
.modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(92,46,10,.58);
}

.modal.is-open{ display: flex; }

.modal-card{
  position: relative;
  width: 100%;
  max-width: 540px;
  padding: 40px 26px 30px;
  border: 4px solid var(--saddle);
  background-color: var(--parchment);
  background-image: var(--noise);
  border-radius: 0;
  box-shadow: var(--shadow-l);
  text-align: center;
  animation: fadeIn 700ms var(--ease) both;
}

@media (min-width: 560px){
  .modal-card{ padding: 48px 42px 36px; }
}

/* 用户明确要求：黑体加粗 */
.modal-title{
  margin: 0;
  font-family: var(--heiti);
  font-size: clamp(21px, 4.2vw, 30px);
  font-weight: 900;
  line-height: 1.5;
  letter-spacing: .04em;
  color: #1c1208;
}

.modal-words{
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: .05em;
  color: var(--saddle-deep);
}

.modal-note{
  margin: 0 0 26px;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-60);
}

/* ---------- 16. 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 17. 小屏微调 ---------- */
@media (max-width: 480px){
  .shell{ padding: 30px 16px 70px; }
  .card{ padding: 26px 18px; }
  .stage-card{ padding: 26px 16px; }
  .level-card{ padding: 26px 16px 20px; }
  .intro-meta{ grid-template-columns: 1fr; gap: 10px; }
  .intro-meta > div{ text-align: left; }
  .head-row{ align-items: flex-start; }
  .lv-desc{ font-size: 13px; }
  .trans-bar{ width: 180px; }
}

/* ============================================================
   登录页：手写便签贴纸 + 委员会文件入口
   ============================================================ */
#view-login{ position:relative; }

.file-link{
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  letter-spacing: .08em;
  color: rgba(92,46,10,.62);
}
.file-link a{
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(139,69,19,.45);
  padding-bottom: 2px;
}
.file-link a:hover{ color: #5c2e0a; border-bottom-color: rgba(92,46,10,.8); }
.file-link a:focus-visible{ outline: 2px solid var(--saddle, #8b4513); outline-offset: 3px; }

.login-stickers{
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.login-stickers .sticker{
  position: absolute;
  display: block;
  filter: drop-shadow(0 10px 16px rgba(92,46,10,.20));
}
.login-stickers .sticker img{ display: block; width: 100%; height: auto; }

/* 左栏 */
.login-stickers .st-a{ left: 12px;  top: 2.4vh;  width: 148px; transform: rotate(-7deg); }
.login-stickers .st-b{ left: 4px;   top: 41vh;   width: 112px; transform: rotate(5deg); }
.login-stickers .st-c{ left: 14px;  bottom: 4vh; width: 150px; transform: rotate(-4deg); }
/* 右栏 */
.login-stickers .st-d{ right: 8px;  top: 3.2vh;  width: 176px; transform: rotate(3deg); }
.login-stickers .st-e{ right: 6px;  top: 41vh;   width: 148px; transform: rotate(-3deg); }
/* 底部中间 */
.login-stickers .st-f{ left: 50%; bottom: 10px; width: 118px; transform: translateX(-50%) rotate(2deg); }
/* 红头文件：可点 */
.login-stickers .st-doc{
  right: 12px; bottom: 3.2vh; width: 132px;
  transform: rotate(-5deg);
  pointer-events: auto;
  text-decoration: none;
  transition: transform .45s cubic-bezier(.2,.75,.25,1), filter .45s ease;
}
.login-stickers .st-doc:hover{
  transform: rotate(-2deg) translateY(-4px);
  filter: drop-shadow(0 16px 22px rgba(92,46,10,.26));
}
.login-stickers .st-doc:focus-visible{ outline: 2px solid #c94c4c; outline-offset: 6px; }

@media (max-width: 1280px){
  .login-stickers .st-a{ width: 120px; }
  .login-stickers .st-c{ width: 122px; }
  .login-stickers .st-d{ width: 146px; }
  .login-stickers .st-e{ display: none; }
  .login-stickers .st-b{ display: none; }
  .login-stickers .st-doc{ width: 112px; }
}
@media (max-height: 760px){
  .login-stickers .st-f{ display: none; }
  .login-stickers .st-b{ display: none; }
}
@media (max-width: 1100px){
  .login-stickers{ display: none; }
}
@media (prefers-reduced-motion: reduce){
  .login-stickers .st-doc{ transition: none; }
}

/* ---------- 登录页：托住两页档案的书 ---------- */
.login-wrap{ position: relative; }
.gate{ position: relative; }
.login-book{
  position: absolute;
  left: -18px;
  right: -18px;
  bottom: -84px;
  height: 210px;
  z-index: 0;
  pointer-events: none;
}
.login-book svg{ display: block; width: 100%; height: 100%; }
.reel, .login-card{ position: relative; z-index: 2; }
.gate-spine{ z-index: 3; background-color: var(--parchment); }
@media (min-width: 1024px){
  .login-wrap{ padding-bottom: 150px; }
}
@media (max-width: 1023px){
  .login-book{ display: none; }
  .login-wrap{ padding-bottom: 52px; }
}
