/* ————— 设计体系（和谐 · 方正） —————
   暖象牙白 #f3f0ea / 深炭 #25282e / 唯一强调陶土橘 #c46e3f
   两个页面共享：首页(居中搜索+随机瓷砖背景) · 人物页(全屏方块墙)
   圆角统一 2px · 等宽数字 · 现代无衬线
*/
:root {
  --paper:      #f3f0ea;
  --panel:      rgba(243, 240, 234, 0.82);
  --ink:        #25282e;
  --ink-soft:   rgba(37, 40, 46, 0.66);
  --ink-faint:  rgba(37, 40, 46, 0.42);
  --line:       rgba(37, 40, 46, 0.1);
  --line-soft:  rgba(37, 40, 46, 0.06);
  --accent:     #c46e3f;
  --accent-soft: rgba(196, 110, 63, 0.12);

  --sans: -apple-system, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", "Menlo", monospace;

  --r: 2px;
  --tile-gap: 4px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

/* ════════ 首页 · 背景棋盘瓷砖 ════════ */
.page-landing { overflow: hidden; }

/* 中心柔光，让玻璃框更通透 */
.page-landing::before {
  content: ""; position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(60% 52% at 50% 50%, rgba(255, 255, 255, 0.5) 35%, transparent 78%);
}

.mural {
  position: fixed; inset: 0; z-index: 0;
  display: grid;
  grid-auto-rows: 96px;
  gap: 4px;
  padding: 4px;
}
.mural .mt {
  transition: transform 0.4s var(--ease), background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  cursor: pointer;
  position: relative;
}
.mural .mt.d { background: #dcd5c6; color: var(--ink); }
.mural .mt.l { background: #eae6da; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(37, 40, 46, 0.05); }
.mural .mt:hover { transform: scale(1.04); z-index: 3; box-shadow: 0 0 0 2px var(--accent); background: #fff; }

/* 抽选动画：高亮跳跃 + 中奖弹跳 */
.mural .mt.mt-hit {
  background: var(--accent); color: #fff; z-index: 7;
  transform: scale(1.14);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 12px 30px -8px rgba(196, 110, 63, 0.85);
}
.mural .mt.mt-hit .mt-num, .mural .mt.mt-hit .mt-name { color: #fff; opacity: 1; }
@keyframes winPop {
  0% { transform: scale(1.14); }
  45% { transform: scale(1.3) rotate(-2.5deg); }
  75% { transform: scale(1.12) rotate(1deg); }
  100% { transform: scale(1.18); }
}
.mural .mt.mt-win {
  background: var(--accent); color: #fff; z-index: 8;
  animation: winPop 0.55s var(--ease) both;
  box-shadow: 0 0 0 3px #fff, 0 20px 48px -8px rgba(196, 110, 63, 0.95);
}
.mural .mt.mt-win .mt-num, .mural .mt.mt-win .mt-name { color: #fff; opacity: 1; }

.draw-btn.drawing { opacity: 0.75; }
.draw-btn.drawing .draw-ico { display: inline-block; animation: drawSpin 0.7s linear infinite; }
@keyframes drawSpin { to { transform: rotate(360deg); } }
.mural .mt.mt-owner {
  background: var(--accent); color: #fff; z-index: 6;
  box-shadow: 0 12px 32px -8px rgba(196, 110, 63, 0.75), inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}
.mural .mt.mt-owner:hover { background: var(--accent); transform: scale(1.06); }
.mt-badge {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  padding: 3px 7px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.45);
}
.m-badge {
  display: inline-block;
  margin: 0 0 14px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.16em; font-weight: 600;
  padding: 8px 16px; border-radius: var(--r);
  background: rgba(196, 110, 63, 0.09);
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.m-badge[hidden] { display: none; }
.mural .mt-sway {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 8px 9px;
  transform-origin: top center;
}
.mural .mt[data-wind] .mt-sway { animation: sway 6.5s ease-in-out infinite alternate; }
@keyframes sway {
  from { transform: rotateZ(-1.5deg); }
  to   { transform: rotateZ(1.5deg); }
}
.mt-num { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; opacity: 0.4; }
.mt-name {
  font-size: 12px; font-weight: 600; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}

/* 首页 · 居中毛玻璃框 */
.stage {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  padding: 24px;
}
/* 玻璃后方的暖色光斑：让毛玻璃的磨砂感可见 */
.stage::before,
.stage::after {
  content: ""; position: absolute; z-index: 0;
  width: 360px; height: 360px; border-radius: 50%;
  pointer-events: none;
}
.stage::before {
  background: radial-gradient(circle, rgba(196, 110, 63, 0.6), transparent 66%);
  top: calc(50% - 290px); left: calc(50% - 330px);
}
.stage::after {
  background: radial-gradient(circle, rgba(203, 166, 110, 0.55), transparent 66%);
  bottom: calc(50% - 270px); right: calc(50% - 320px);
}

.stage-glass {
  pointer-events: auto; position: relative; z-index: 1;
  width: min(680px, 94vw);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 38px 40px 36px;
  background: rgba(243, 240, 234, 0.5);
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  outline: 1px solid var(--line);
  outline-offset: -7px;
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 0 rgba(37, 40, 46, 0.02),
    0 50px 100px -30px rgba(37, 40, 46, 0.55);
  text-align: center;
}

.sg-brand {
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint); letter-spacing: 0.1em;
  display: flex; align-items: center; gap: 10px;
}
.sg-brand .dot { color: var(--accent); }
.sg-brand .sg-n { color: var(--ink-soft); letter-spacing: 0.08em; }

.sg-title {
  font-size: clamp(30px, 5.4vw, 52px);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.08;
  color: var(--ink);
}
.sg-title .heroNum {
  font-family: var(--mono); font-weight: 600;
  background: linear-gradient(120deg, #e89a5f 0%, #c46e3f 60%, #a05a33 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sg-sub { font-size: 14px; color: var(--ink-soft); letter-spacing: 0.02em; }

.sg-search {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 18px;
  box-shadow: 0 10px 30px -18px rgba(37, 40, 46, 0.4);
  transition: border-color 0.25s var(--ease);
}
.sg-search:focus-within { border-color: var(--accent); }
.sg-search .s-icon { color: var(--accent); font-size: 18px; }
.sg-search input {
  flex: 1; border: none; background: transparent; outline: none; min-width: 0;
  font-size: 18px; color: var(--ink); font-family: var(--sans); letter-spacing: 0.01em;
}
.sg-search input::placeholder { color: var(--ink-faint); }

/* 大按钮：进一步探索 */
.explore {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
  background: var(--accent); color: #fff;
  border: none; font-size: 17px; font-weight: 600; letter-spacing: 0.04em;
  padding: 18px 0; border-radius: var(--r); cursor: pointer;
  box-shadow: 0 18px 40px -16px rgba(196, 110, 63, 0.55);
  transition: transform 0.3s var(--ease), filter 0.3s;
}
.explore:hover { transform: translateY(-2px) scale(1.01); filter: brightness(1.07); }
.ex-arrow { font-family: var(--mono); font-size: 18px; line-height: 1; transition: transform 0.4s var(--ease); display: inline-block; }
.explore:hover .ex-arrow { transform: translateX(6px); }

.draw-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px; font-weight: 600;
  padding: 12px 26px; border-radius: var(--r); cursor: pointer;
  transition: all 0.25s var(--ease);
}
.draw-btn:hover { border-color: var(--accent); color: var(--accent); }
.draw-ico { color: var(--accent); transition: transform 0.4s var(--ease); display: inline-block; }
.draw-btn:hover .draw-ico { transform: rotate(120deg); }

.sg-hint { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.06em; }

/* ════════ 人物页 · 背景虚化格子 ════════ */
.bg-blur {
  position: fixed; inset: 0; z-index: 0;
  filter: blur(4px) saturate(0.9);
  opacity: 0.85;
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent calc(10vw - 1px), rgba(37, 40, 46, 0.06) calc(10vw - 1px), rgba(37, 40, 46, 0.06) 10vw),
    repeating-linear-gradient(90deg, transparent 0, transparent calc(10vw - 1px), rgba(37, 40, 46, 0.06) calc(10vw - 1px), rgba(37, 40, 46, 0.06) 10vw);
}

/* 人物页 · 顶部居中搜索头 */
.head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px 18px;
  background: linear-gradient(180deg, var(--paper) 0%, rgba(243, 240, 234, 0.85) 70%, rgba(243, 240, 234, 0) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brandline { display: flex; align-items: baseline; gap: 14px; }
.brand { font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand .dot { color: var(--accent); }
.head-n { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; }

.searchwrap { width: min(500px, 92vw); }
.searchbox {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--r);
  padding: 12px 18px;
  box-shadow: 0 2px 0 rgba(37, 40, 46, 0.03), 0 18px 40px -24px rgba(37, 40, 46, 0.35);
  transition: border-color 0.25s var(--ease);
}
.searchbox:focus-within { border-color: var(--accent); }
.s-icon { color: var(--accent); font-size: 16px; line-height: 1; }
.searchbox input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 14.5px; color: var(--ink); font-family: var(--sans); letter-spacing: 0.01em;
}
.searchbox input::placeholder { color: var(--ink-faint); }

.chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  max-width: min(1080px, 94vw);
  max-height: min(34vh, 300px); overflow-y: auto;
  padding: 4px 10px; scrollbar-width: thin;
}
.chips::-webkit-scrollbar { width: 5px; }
.chips::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.chip {
  font-size: 11.5px; color: var(--ink-soft); letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.5); border: 1px solid var(--line);
  border-radius: var(--r); padding: 4px 10px; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip i {
  font-style: normal; font-family: var(--mono);
  font-size: 9.5px; opacity: 0.5; margin-left: 5px;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on i { opacity: 0.85; }
.chip-all { border-style: dashed; }

.head-line { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.08em; }

/* ════════ 人物页 · 大方块墙 ════════ */
.wall {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(var(--head-h, 210px) + 16px) 32px 70px;
}
.wall .tv {
  aspect-ratio: 1 / 1;
  opacity: var(--o, 1);
  transform: scale(var(--s, 1));
  transform-origin: center;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
  cursor: pointer;
  position: relative;
  animation: rise 0.6s var(--ease) both;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.wall .tv:hover { opacity: 1; transform: scale(1); z-index: 5; }

.tile-sway {
  position: absolute; inset: 0;
  perspective: 800px;
  transform-origin: top center;
}
.wall .tv[data-wind] .tile-sway { animation: sway 6.5s ease-in-out infinite alternate; }

.tile-flip {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.55s var(--ease);
}
.wall .tv:hover .tile-flip { transform: rotateX(-180deg); }

.face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--ink);
  color: var(--paper);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.face.back {
  transform: rotateX(180deg);
  background: var(--accent);
  justify-content: space-between;
}
.t-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; opacity: 0.6; }
.t-owner {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--accent);
}
.t-name { font-size: 26px; font-weight: 650; line-height: 1.15; letter-spacing: -0.015em; }
.t-tag {
  font-size: 14px; line-height: 1.6; letter-spacing: 0.01em; color: rgba(255, 255, 255, 0.85);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.t-facts { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11.5px; color: rgba(255, 255, 255, 0.85); }
.t-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.t-btag {
  font-size: 11.5px; color: #fff; background: rgba(255, 255, 255, 0.16);
  padding: 3px 9px; border-radius: var(--r); letter-spacing: 0.02em;
}
.t-go {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: rgba(255, 255, 255, 0.9);
  display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(255, 255, 255, 0.25); padding-top: 12px;
}
.t-go::after { content: "→"; }

.emptybar {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 15;
  font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 22px; backdrop-filter: blur(10px);
}

/* ════════ 详情 · 方角白卡（两页共用） ════════ */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(37, 40, 46, 0.5); backdrop-filter: blur(12px); animation: fade 0.3s var(--ease); }
@keyframes fade { from { opacity: 0; } }

.modal-card {
  position: relative; z-index: 1;
  width: min(860px, 100%); max-height: 90vh;
  background: #fff; border-radius: var(--r);
  display: grid; grid-template-columns: 5fr 6fr;
  animation: pop 0.35s var(--ease);
  box-shadow: 0 50px 110px -30px rgba(37, 40, 46, 0.6);
  overflow-x: hidden; overflow-y: auto;
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: var(--r);
  background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 15px; cursor: pointer; transition: all 0.25s var(--ease);
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); transform: rotate(90deg); }

.m-left {
  padding: 30px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--ink); color: var(--paper);
}
.m-avatar {
  width: 200px; height: 200px; margin-top: 16px;
  background: var(--accent);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 26px 46px -18px rgba(0, 0, 0, 0.7);
}
.m-avatar .mono { font-size: 76px; font-weight: 700; color: #fff; }
.m-num { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.55); }

.m-right { padding: 34px 38px 38px; display: flex; flex-direction: column; }
.m-name { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.m-tagline { margin-top: 12px; font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); }
.m-facts { display: flex; flex-wrap: wrap; gap: 10px 30px; margin-top: 18px; font-size: 13.5px; }
.m-facts b { font-weight: 600; color: var(--ink-faint); margin-right: 6px; font-family: var(--mono); font-size: 11px; }
.m-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.m-tags .tag {
  font-size: 12px; color: var(--accent); background: var(--accent-soft);
  padding: 4px 11px; border-radius: var(--r); font-weight: 500;
}
.m-head {
  margin-top: 24px; font-size: 11px; font-weight: 600; color: var(--ink-faint);
  letter-spacing: 0.14em; font-family: var(--mono);
  display: flex; align-items: center; gap: 10px;
}
.m-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.m-body { margin-top: 10px; font-size: 15px; line-height: 1.9; color: var(--ink-soft); white-space: pre-wrap; }
.m-intro { color: var(--ink); }
.m-intro b { color: var(--accent); font-weight: 600; }

.m-contact { margin-top: 26px; }
.m-contact .rec {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 600; padding: 12px 24px; border-radius: var(--r); text-decoration: none;
  box-shadow: 0 14px 28px -14px rgba(37, 40, 46, 0.5);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.m-contact .rec:hover { background: var(--accent); transform: translateY(-1px); }
.m-contact .none { font-size: 13px; color: var(--ink-faint); font-family: var(--mono); }

@media (max-width: 700px) {
  .stage-box { padding: 6px 6px 6px 16px; }
  #searchInput { font-size: 17px; }
  .explore { padding: 16px 0; font-size: 16px; }
  .wall { padding: 240px 18px 60px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
  .modal-card { grid-template-columns: 1fr; }
  .m-left { padding: 22px; }
  .m-avatar { width: 120px; height: 120px; margin-top: 6px; }
  .m-avatar .mono { font-size: 46px; }
  .m-right { padding: 24px 20px 28px; }
}