:root{
  --bg:#fafafa;
  --ink: rgba(0,0,0,0.78);
  --muted: rgba(0,0,0,0.34);
  --accent: #007aff;

  --paperOpacity: 0.12;
  --gridLine: rgba(0,0,0,0.05);
  --gridPx: 120px;

  --panelBg: rgba(255,255,255,0.90);
  --panelBorder: rgba(0,0,0,0.10);
  --panelShadow: 0 22px 52px rgba(0,0,0,0.18);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x:hidden;
}
::-webkit-scrollbar{ display:none; }

.paper{
  position: fixed;
  inset:0;
  pointer-events:none;
  /* 纸张纹理加强：底层贴图 + 一点污渍/折痕/拼贴感的渐变 */
  background-image:
    radial-gradient(1200px 800px at 18% 22%, rgba(0,0,0,0.06), transparent 55%),
    radial-gradient(900px 700px at 82% 70%, rgba(0,0,0,0.05), transparent 60%),
    radial-gradient(500px 380px at 70% 20%, rgba(0,0,0,0.03), transparent 58%),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.018) 0px, rgba(0,0,0,0.018) 1px, transparent 1px, transparent 22px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.012) 0px, rgba(0,0,0,0.012) 1px, transparent 1px, transparent 26px),
    url('paper-texture.png');
  background-size:
    cover,
    cover,
    cover,
    100% 100%,
    100% 100%,
    900px;
  background-position:
    center,
    center,
    center,
    center,
    center,
    0 0;
  mix-blend-mode: multiply;
  opacity: 0.22; /* ✅更强一点 */
  z-index: 1;
}

.admin-only{
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
body.admin-unlocked .admin-only{
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}


/* 顶部导航（3页分开） */
.topbar{
  position: sticky;
  top: 0;
  z-index: 120;
  padding: 22px 26px;
  background: rgba(250,250,250,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand{
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: 18px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.65);
}
.nav{
  display:flex;
  gap: 22px;
  align-items:center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav a{
  color: rgba(0,0,0,0.42);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}
.nav a:hover{ color: rgba(0,0,0,0.65); }
.nav a.active{
  color: rgba(0,0,0,0.72);
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
}

/* 工具按钮（改成中间悬浮，不参与布局） */
.controls{
  position: fixed;
  top: 92px;                 /* 在 topbar 下面一点点 */
  right: 28px;   
  left: auto;
  transform: translateX(-50%);
  z-index: 160;              /* 比 stage 高、比 modal 低就行 */

  display:flex;
  gap: 8px;
  align-items:center;
  justify-content:center;
  flex-wrap: wrap;

  padding: 10px 12px;
  background: var(--panelBg);
  border: 1px solid var(--panelBorder);
  box-shadow: var(--panelShadow);
  backdrop-filter: blur(14px);
  border-radius: 14px;
}
.topbar-spacer{ width: 320px; }

.btn{
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(10px);
  padding: 8px 10px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.78);
  cursor: pointer;
  user-select:none;
}
.btn:hover{ border-color: rgba(0,0,0,0.18); }
.btn.primary{
  border-color: rgba(0,122,255,0.35);
  color: rgba(0,122,255,0.95);
}

/* stage */
#stage-wrap{
  position: relative;
  z-index: 10;
  padding: 26px 0 80px;
  padding-right: 64px; /* 可选：保证右侧留白在 wrap 层也一致 */
}

#stage{
  position: relative;
  margin-left: auto;
  margin-right: 64px; /* 右侧留白，和 topbar padding 风格一致 */
}


/* ✅ 关键：grid layer 放在 stage 里，随滚动移动，和绝对定位的 tiles 对齐 */
.grid-layer{
  position:absolute;
  left:0; top:0;
  width: 100%;
  height: 100%;
  pointer-events:none;
  z-index: 2;
  background-image:
    linear-gradient(to right, var(--gridLine) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gridLine) 1px, transparent 1px);
  background-size: var(--gridPx) var(--gridPx);
  opacity: .65;
  mix-blend-mode: multiply;
}

/* projects / songs tiles */
.project{
  position: absolute;
  border: 1px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.45);
  box-shadow: 0 1px 2px rgba(0,0,0,0.07);
  overflow: hidden;
  will-change: transform, left, top, width, height;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, outline-color .18s ease;
  z-index: 12;
  user-select: none;
  touch-action: none;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.project:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.10);
  filter: contrast(1.05);
  z-index: 20;
}
.project.dragging{
  z-index: 90 !important;
  transition: none !important;
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}
.project.selected{
  outline-color: rgba(0,122,255,0.75);
  z-index: 50;
}
.project img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display:block;
  pointer-events:none;
  user-select:none;
}

/* hover 灰蒙版 + 白字 */
.overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.38);
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 18;
  display:flex;
  align-items:flex-end;
  padding: 14px;
  pointer-events:auto;
}
.project:hover .overlay{ opacity: 1; }
.overlay .text{ color: rgba(255,255,255,0.96); max-width: 92%; }
.overlay .t{
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.22);
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.overlay .b{
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.86);
  text-shadow: 0 2px 10px rgba(0,0,0,0.18);
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.overlay .linkHint{
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  opacity: 0.9;
}
/* overlay 只在文字区域接收事件，避免影响 hover/拖拽 */
.overlay{ pointer-events:none; }
.overlay .text{ pointer-events:auto; }
.overlay a.pill{ pointer-events:auto; }

.badge{
  position:absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.55);
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.08);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events:none;
  z-index: 22;
}
.edit-on .badge{ opacity: 1; }

.cloud{
  position:absolute;
  width: var(--gridPx);
  height: var(--gridPx);
  opacity: 0.42;
  z-index: 5;
  border: 1px solid rgba(0,0,0,0.03);
  overflow:hidden;
  background: rgba(255,255,255,0.35);
  mix-blend-mode: multiply;
  pointer-events:none;
}
.cloud img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display:block;
  filter: contrast(1.02);
  user-select:none;
  pointer-events:none;
}

/* export modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.modal.on{ display:flex; }
.panel{
  width: min(980px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 30px 70px rgba(0,0,0,0.20);
  padding: 16px;
}
.panel h3{
  margin: 0 0 10px 0;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.panel textarea{
  width: 100%;
  min-height: 360px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(250,250,250,0.85);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(0,0,0,0.78);
  resize: vertical;
}
.panel .row{
  display:flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* edit panel */
.editPanel{
  position: fixed;
  top: 86px;
  right: 16px;
  width: 340px;
  max-height: calc(100vh - 110px);
  overflow:auto;
  z-index: 150;
  background: var(--panelBg);
  border: 1px solid var(--panelBorder);
  box-shadow: var(--panelShadow);
  backdrop-filter: blur(14px);
  padding: 12px;
  display:none;
}
.editPanel.on{ display:block; }

.sectionTitle{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.70);
  margin: 10px 0 8px;
}
.field{
  display:flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.label{
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.48);
}
input[type="text"], input[type="number"], textarea{
  width: 100%;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
  padding: 9px 10px;
  font-size: 12px;
  outline: none;
}
textarea{ min-height: 62px; resize: vertical; line-height: 1.4; }
input[type="file"]{ width:100%; font-size: 12px; }

.row2{ display:flex; gap: 8px; }
.row2 > .field{ flex:1; }
.panelBtns{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}
.smallNote{
  font-size: 11px;
  color: rgba(0,0,0,0.46);
  line-height: 1.4;
  margin-top: 6px;
}

/* About page */
.aboutWrap{
  position: relative;
  z-index: 10;
  padding: 38px 0 90px;
}
.paperCard{
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 70px 76px;
  background: rgba(245,245,245,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.10);
}

.kicker{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(0,122,255,0.92);
}
.h1{
  margin: 18px 0 18px;
  font-size: 68px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: rgba(0,0,0,0.84);
}
.p{
  max-width: 720px;
  font-size: 15px;
  line-height: 1.85;
  color: rgba(0,0,0,0.55);
}
.hr{
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 34px 0;
}
@media (max-width: 820px){
  .paperCard{ padding: 44px 26px; }
  .h1{ font-size: 44px; }
}

.linksRow{ margin-top: 10px; display:flex; flex-wrap:wrap; gap:8px; }
.pill{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.38);
  color: rgba(255,255,255,0.92);
  text-decoration:none;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.pill:hover{ background: rgba(255,255,255,0.12); }
/* ===== Project overlay typography fixes (CJK thin + no ellipsis + allow newlines) ===== */

/* 统一站点字体（如果你已经有全局字体，这段会更偏“兜底”） */
:root{
  --uiFont: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
            "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC",
            "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
}

body{
  font-family: var(--uiFont);
}

/* Project 的标题/简介：统一字体 + 稍细 */
.project .overlay .t,
.project .overlay .b{
  font-family: var(--uiFont) !important;
  font-weight: 300; /* 细一点；如果不生效就用 300/400 */
}

/* 标题可以稍微更重一点点，避免太飘 */
.project .overlay .t{
  font-weight: 450;
  letter-spacing: 0.01em;
}

/* ✅ 取消省略号/截断（常见是 line-clamp 或 overflow hidden） */
.project .overlay .b{
  display: block !important;
  overflow: visible !important;
  text-overflow: clip !important;

  /* 如果你之前用了多行截断（-webkit-line-clamp），这几行会解除 */
  -webkit-line-clamp: unset !important;
  -webkit-box-orient: unset !important;
}

/* ✅ 允许自动换行 + 保留你输入的回车换行 */
.project .overlay .b{
  white-space: pre-wrap !important;   /* 保留 \n，自动换行 */
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
}


