/* ============================================================
   照片档案 · 纸上档案（Paper Archive）视觉系统
   隐喻：纸质相册卷宗——暖米纸底、墨黑、印章朱红
   字体：标题=思源宋体（内嵌） · 元数据=等宽 · 正文=系统黑体
   ============================================================ */
:root {
  --bg: #F6F2E9;          /* 暖米纸白 */
  --bg-2: #EFE9DC;        /* 抬升面（图片占位） */
  --bg-3: #E9E2D2;        /* 控件面 */
  --ink: #201C15;         /* 暖墨黑 */
  --dim: #8C8474;         /* 暖灰 */
  --faint: #B3AB99;       /* 极弱 */
  --line: #DCD4C2;        /* 纸色发丝线 */
  --accent: #B4483C;      /* 印章朱红 */
  --accent-ink: #FBF7EE;  /* 朱红上的纸白字 */
  --serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, 'Courier New', monospace;
  --sans: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------- 纸纹颗粒（全屏噪点层，极轻） ---------- */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .035;
  animation: grain 1.1s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- 显影动效（进场统一语言） ---------- */
@keyframes develop {
  from { opacity: 0; filter: blur(7px); transform: translateY(12px); }
  to   { opacity: 1; filter: blur(0);  transform: none; }
}
.develop { animation: develop .7s cubic-bezier(.2,.6,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 页首：竖排品牌 + 等宽导航 ---------- */
.masthead {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 26px 40px 18px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 12px; }
.brand-zh {
  font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: .34em;
  writing-mode: vertical-rl; line-height: 1.2;
}
.brand-meta {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .3em;
  color: var(--faint); writing-mode: vertical-rl; padding-top: 3px;
}
.topnav {
  display: flex; gap: 14px; align-items: baseline;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; color: var(--dim);
  padding-top: 6px;
}
.nav-sep { color: var(--faint); }
.topnav a:hover, .topnav .linkbtn:hover { color: var(--accent); }
.linkbtn { background: none; border: none; padding: 0; cursor: pointer; font: inherit; letter-spacing: inherit; color: inherit; }

/* ---------- 主体 ---------- */
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 52px 40px 110px; }
.boot {
  color: var(--faint); font-family: var(--mono); font-size: 12.5px; letter-spacing: .2em;
  padding: 90px 0; text-align: center;
}
.boot-dots { animation: blink 1.2s steps(2) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 首页：档案目录 ---------- */
.index-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: 14px;
}
.index-head h1 {
  font-family: var(--serif); font-weight: 700; font-size: 34px;
  letter-spacing: .06em; margin: 0;
}
.index-head .idx-meta { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--dim); }
.rule { border: none; border-top: 1px solid var(--line); margin: 0 0 58px; }

.album-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 72px 56px;
}
/* 交错：偶数条目下沉，打破呆板对称（用 margin，避免与显影动画的 transform 冲突） */
.album-item:nth-child(even) { margin-top: 44px; }
.album-item { display: block; }
.album-item .thumb {
  aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-2);
  border: 1px solid var(--line);
}
.album-item .thumb img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.94); transition: transform .7s cubic-bezier(.2,.6,.2,1), filter .4s ease;
}
.album-item:hover .thumb img { transform: scale(1.035); filter: saturate(1.05); }
.album-item .noimg {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--faint); font-family: var(--mono); font-size: 12px; letter-spacing: .2em;
}
.album-item .entry {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
}
.album-item .no {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--accent);
}
.album-item b {
  font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .04em;
}
.album-item .cnt {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .1em; color: var(--dim); white-space: nowrap;
}
.album-item:hover .no { color: var(--ink); }
.album-item:hover b { color: var(--accent); }

.empty {
  color: var(--dim); padding: 100px 0; text-align: center;
  font-size: 13.5px; letter-spacing: .05em;
}
.empty a { color: var(--accent); border-bottom: 1px solid var(--accent); }

/* ---------- 相册页：瀑布流 + 帧边码 ---------- */
.back {
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--dim);
}
.back:hover { color: var(--accent); }
.album-head { margin: 30px 0 46px; }
.album-head h1 {
  font-family: var(--serif); font-weight: 700; font-size: 30px;
  letter-spacing: .05em; margin: 0;
}
.album-head p {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  color: var(--dim); margin: 10px 0 0;
}
.masonry { columns: 3; column-gap: 26px; }
.shot { break-inside: avoid; margin: 0 0 30px; cursor: zoom-in; }
.shot img {
  width: 100%; height: auto; background: var(--bg-2);
  border: 1px solid var(--line);
  transition: border-color .35s ease, opacity .35s ease, box-shadow .35s ease;
}
.shot:hover img { border-color: var(--faint); box-shadow: 0 10px 30px rgba(32,28,21,.12); }
.shot .fr {
  display: flex; gap: 10px; margin-top: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--faint);
}
.shot .fr .fr-no { color: var(--dim); }
.shot:hover .fr .fr-no { color: var(--accent); }
.shot .fr .fr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 灯箱：暖纸白舞台 + 柔影 ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(246, 242, 233, .96);
  display: flex; align-items: center; justify-content: center;
}
#lightbox[hidden] { display: none; }
#lightbox:not([hidden]) .lb-stage { animation: shutter .3s cubic-bezier(.2,.7,.3,1) both; }
@keyframes shutter {
  from { opacity: 0; transform: scale(.984); }
  to   { opacity: 1; transform: none; }
}
.lb-stage { margin: 0; max-width: 92vw; }
#lb-img {
  max-width: 88vw; max-height: 76vh;
  box-shadow: 0 18px 70px rgba(32, 28, 21, .3);
}
.lb-meta {
  margin-top: 16px; text-align: center;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; color: var(--dim);
}
.lb-meta .amber { color: var(--accent); }
.lb-meta a.dl { color: var(--accent); border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.lb-meta a.dl:hover { color: var(--ink); border-color: var(--ink); }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: none; border: none; cursor: pointer;
  color: var(--dim); font-family: var(--mono); font-size: 22px; line-height: 1;
  padding: 16px 20px; transition: color .2s ease;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--accent); }
.lb-close { top: 14px; right: 20px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- 管理 ---------- */
.login { max-width: 340px; margin: 96px 0 0; }
.section-title {
  font-family: var(--mono); font-size: 12px; letter-spacing: .26em;
  color: var(--accent); margin: 0 0 10px;
}
.hint { color: var(--dim); font-size: 12.5px; margin: 0 0 20px; letter-spacing: .04em; }
input[type=text], input[type=password] {
  display: block; width: 100%; background: #FCFAF4; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0; padding: 12px 14px;
  font: 13.5px/1.5 var(--sans); margin-bottom: 12px;
}
input::placeholder { color: var(--faint); }
input:focus { border-color: var(--accent); outline: none; }
.btn {
  background: var(--accent); color: var(--accent-ink); border: none; border-radius: 0;
  padding: 12px 30px; cursor: pointer;
  font: 600 13px var(--mono); letter-spacing: .18em;
  transition: background .2s ease;
}
.btn:hover { background: #9C3D32; }
.btn:disabled { opacity: .4; cursor: wait; }
.mini {
  background: none; border: 1px solid var(--line); color: var(--dim);
  border-radius: 0; padding: 6px 14px; cursor: pointer;
  font: 12px var(--mono); letter-spacing: .1em; white-space: nowrap;
  transition: color .2s ease, border-color .2s ease;
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini.danger:hover { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }

.newform { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 64px; }
.newform input { flex: 1; min-width: 160px; margin-bottom: 0; }

.album-rows { border-top: 1px solid var(--line); }
.arow {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 8px; border-bottom: 1px solid var(--line);
}
.arow.active { background: #FCFAF4; box-shadow: inset 2px 0 0 var(--accent); }
.arow .nm { font-family: var(--serif); font-weight: 700; font-size: 15.5px; letter-spacing: .03em; }
.arow .ct { color: var(--dim); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; }
.arow .ops { display: flex; gap: 8px; margin-left: auto; }

.work { margin-top: 64px; }
.drop {
  border: 1px dashed var(--faint); background: var(--bg-2); padding: 40px 16px;
  text-align: center; color: var(--dim); font-size: 13.5px; cursor: pointer;
  letter-spacing: .06em; transition: border-color .25s ease, color .25s ease;
}
.drop:hover { border-color: var(--accent); color: var(--ink); }
.drop.drag { border-color: var(--accent); color: var(--accent); background: var(--bg-3); }
.up-status {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  color: var(--dim); min-height: 20px; margin: 12px 0 0;
}
.negs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 14px; margin-top: 22px;
}
.neg { position: relative; background: var(--bg-2); border: 1px solid var(--line); }
.neg img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.neg .x {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px;
  background: rgba(252, 250, 244, .9); border: 1px solid var(--line); color: var(--dim);
  font: 12px var(--mono); line-height: 1; cursor: pointer;
}
.neg .x:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #FCFAF4; color: var(--ink); border: 1px solid var(--accent);
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em;
  padding: 11px 22px; z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.toast.show { opacity: 1; }

/* ---------- 页脚：版权边码 ---------- */
.colophon {
  color: var(--faint); font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
  text-align: center; padding: 24px; border-top: 1px solid var(--line);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .masonry { columns: 2; }
  #app { padding: 40px 26px 80px; }
  .masthead { padding: 22px 26px 16px; }
}
@media (max-width: 640px) {
  .album-grid { grid-template-columns: 1fr; gap: 48px; }
  .album-item:nth-child(even) { transform: none; }
  .masonry { columns: 1; }
  #app { padding: 30px 18px 64px; }
  .masthead { padding: 18px 18px 14px; }
  .brand-zh { writing-mode: horizontal-tb; font-size: 18px; letter-spacing: .22em; }
  .brand { flex-direction: column; gap: 2px; }
  .brand-meta { writing-mode: horizontal-tb; }
  .topnav { gap: 10px; }
  .arow { flex-wrap: wrap; }
  .arow .ops { margin-left: 0; }
}

/* ============================================================
   共享：顶部「目录」下拉 · 跨页过渡 · 大厅牌格
   ============================================================ */

/* ---------- 当前页导航态 ---------- */
.topnav .current { color: var(--ink); }

/* ---------- 顶部导航：目录下拉 ---------- */
.navdrop { position: relative; }
.navdrop-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: inherit; line-height: 1.4;
  display: inline-flex; align-items: baseline; gap: 5px;
}
.navdrop-btn .caret {
  font-size: 9px; color: var(--faint);
  transition: transform .22s ease, color .22s ease;
}
.navdrop.open .navdrop-btn, .navdrop-btn:hover { color: var(--accent); }
.navdrop.open .caret { transform: rotate(180deg); color: var(--accent); }
.navdrop-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 130;
  min-width: 246px; padding: 8px 0;
  background: #FCFAF4; border: 1px solid var(--line);
  box-shadow: 0 16px 44px rgba(32, 28, 21, .14);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.navdrop-menu::before {
  content: ''; position: absolute; top: -7px; right: 30px;
  width: 12px; height: 12px; background: #FCFAF4;
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.navdrop.open .navdrop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
@media (hover: hover) and (pointer: fine) {
  .navdrop:hover .navdrop-menu { opacity: 1; visibility: visible; transform: translateY(0); }
  .navdrop:hover .caret { color: var(--accent); }
}
.navdrop-menu a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 20px; color: var(--ink);
  transition: background .18s ease;
}
.navdrop-menu a .nd-zh {
  font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .08em;
  transition: color .18s ease;
}
.navdrop-menu a .nd-en {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  letter-spacing: .2em; color: var(--faint); white-space: nowrap;
}
.navdrop-menu a:hover { background: var(--bg-2); }
.navdrop-menu a:hover .nd-zh { color: var(--accent); }
.navdrop-menu a.current { box-shadow: inset 2px 0 0 var(--accent); }
@media (max-width: 640px) {
  .navdrop-menu { right: -6px; min-width: 222px; }
  .navdrop-menu a { padding: 11px 16px; }
}

/* ---------- 跨页淡入淡出（纸页翻动的余味） ---------- */
body { transition: opacity .24s ease, transform .24s ease, filter .24s ease; }
body.page-leaving { opacity: 0; transform: translateY(10px); filter: blur(3px); }
.page-enter { animation: develop .55s cubic-bezier(.2, .6, .2, 1) both; }

/* ---------- 大厅：站点牌格（lobby tiles） ---------- */
.lobby-lead {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  color: var(--dim); margin: 0 0 46px;
}
.lobby-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.lobby-grid > * { animation: develop .7s cubic-bezier(.2, .6, .2, 1) both; }
.lobby-grid > *:nth-child(2) { animation-delay: .09s; }
.lobby-grid > *:nth-child(3) { animation-delay: .18s; }
.lobby-grid > *:nth-child(4) { animation-delay: .27s; }
.tile {
  position: relative; display: flex; flex-direction: column;
  min-height: 316px; padding: 26px 24px 24px;
  background: #FCFAF4; border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .3s ease, box-shadow .3s ease, transform .35s cubic-bezier(.2, .6, .2, 1);
}
.tile:hover {
  border-color: var(--accent);
  box-shadow: 0 18px 50px rgba(32, 28, 21, .12);
  transform: translateY(-5px);
}
.tile .tile-top {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  color: var(--dim); position: relative;
}
.tile .tile-no { color: var(--accent); }
.tile .tile-tag {
  border: 1px solid var(--line); padding: 2px 9px;
  transition: border-color .25s ease, color .25s ease;
}
.tile:hover .tile-tag { border-color: var(--accent); color: var(--accent); }
.tile .tile-body { position: relative; margin-top: auto; padding-top: 26px; }
.tile .tile-zh {
  font-family: var(--serif); font-weight: 700; font-size: 27px;
  letter-spacing: .05em; line-height: 1.25; transition: color .25s ease;
}
.tile:hover .tile-zh { color: var(--accent); }
.tile .tile-en {
  font-family: var(--mono); font-size: 10px; letter-spacing: .3em;
  color: var(--faint); margin-top: 9px;
}
.tile .tile-desc {
  color: var(--dim); font-size: 13px; letter-spacing: .04em;
  margin-top: 14px;
}
.tile .tile-go {
  margin-top: 20px; font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .2em; color: var(--dim);
  display: flex; align-items: center; gap: 9px;
  transition: color .25s ease;
}
.tile:hover .tile-go { color: var(--accent); }
.tile .tile-go .arrow { transition: transform .3s cubic-bezier(.2, .6, .2, 1); }
.tile:hover .tile-go .arrow { transform: translateX(6px); }
.tile .tile-glyph {
  position: absolute; right: -8px; bottom: -34px;
  font-family: var(--serif); font-weight: 700;
  font-size: 186px; line-height: 1; color: var(--ink); opacity: .05;
  pointer-events: none; user-select: none;
  transition: opacity .35s ease, color .35s ease, transform .5s cubic-bezier(.2, .6, .2, 1);
}
.tile:hover .tile-glyph { opacity: .13; color: var(--accent); transform: translateY(-7px) scale(1.04); }
.tile.disabled { background: var(--bg-2); opacity: .6; pointer-events: none; }
.tile.disabled .tile-tag { border-style: dashed; }
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .tile { min-height: 262px; padding: 22px 20px; }
  .tile .tile-glyph { font-size: 150px; }
}
@media (max-width: 640px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .tile .tile-glyph { font-size: 132px; bottom: -26px; }
}
