/* ============================================================
   曲奇 · 个人作品集 —— 玫瑰红玻璃拟态 × 古风
   纯 CSS，无构建依赖；支持深色模式
   ============================================================ */

:root {
  --rose:        #d64570;
  --rose-deep:   #b02e55;
  --rose-soft:   #e989a4;
  --rose-mist:   rgba(214, 69, 112, .12);
  --ink:         #3d2530;
  --ink-soft:    #7a5c66;
  --paper:       #faf3ee;
  --paper-2:     #f4e7de;
  --gold:        #c9a06a;
  --glass-bg:    rgba(255, 255, 255, .55);
  --glass-brd:   rgba(214, 69, 112, .22);
  --shadow:      0 18px 50px -18px rgba(176, 46, 85, .28);
  --radius:      22px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans:  "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
html[data-mode="dark"] {
  --ink:       #f5e6ea;
  --ink-soft:  #c39aa8;
  --paper:     #1d1016;
  --paper-2:   #271521;
  --glass-bg:  rgba(64, 26, 41, .48);
  --glass-brd: rgba(233, 137, 164, .26);
  --rose-mist: rgba(233, 137, 164, .14);
  --shadow:    0 18px 50px -16px rgba(0, 0, 0, .6);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -5%,  var(--rose-mist), transparent 60%),
    radial-gradient(900px 500px  at -10% 30%, var(--rose-mist), transparent 55%),
    linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%);
  min-height: 100vh;
  line-height: 1.75;
  transition: background .5s ease, color .5s ease;
  overflow-x: hidden;
}
::selection { background: var(--rose); color: #fff7f2; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- 背景云纹 ---------- */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.cloud {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--rose-mist), transparent 70%);
  filter: blur(6px);
  animation: drift 26s ease-in-out infinite alternate;
}
.cloud-1 { width: 46vw; height: 46vw; top: -12vw; right: -10vw; }
.cloud-2 { width: 34vw; height: 34vw; bottom: -8vw; left: -8vw; animation-delay: -8s; }
.cloud-3 { width: 20vw; height: 20vw; top: 42%; left: 58%; animation-delay: -16s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-3vw, 2vw, 0) scale(1.08); }
}
.grain {
  position: absolute; inset: 0; opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-mode="dark"] .grain { mix-blend-mode: screen; opacity: .06; }

/* ---------- 玻璃拟态 ---------- */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; border-radius: 999px; width: min(1060px, calc(100% - 28px));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-seal {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--rose), var(--rose-deep));
  color: #fff7f2; border-radius: 10px; font-size: 19px; font-weight: 700;
  box-shadow: inset 0 0 0 2px rgba(255, 247, 242, .35), 0 4px 12px -3px var(--rose);
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: 2px; }
.brand-name i { font-style: normal; font-size: 12px; color: var(--rose); letter-spacing: 3px; margin-left: 4px; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-size: 14px; letter-spacing: 1px; color: var(--ink-soft);
  padding: 6px 12px; border-radius: 999px; transition: all .25s ease;
}
.nav a:hover { color: #fff7f2; background: var(--rose); }
.mode-toggle {
  border: 1px solid var(--glass-brd); background: transparent; color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px;
  display: grid; place-items: center; transition: all .25s ease;
}
.mode-toggle:hover { background: var(--rose); color: #fff; border-color: var(--rose); }
html[data-mode="dark"] .icon-sun { display: none; }
html:not([data-mode="dark"]) .icon-moon { display: none; }

/* ---------- 卷首 ---------- */
main { position: relative; z-index: 1; }
.hero {
  min-height: 92vh; display: grid; place-items: center; text-align: center;
  padding: 120px 20px 60px;
}
.hero-kicker { letter-spacing: 8px; font-size: 14px; color: var(--rose); margin-bottom: 18px; }
.hero-title {
  font-size: clamp(38px, 7vw, 74px); font-weight: 700; letter-spacing: 4px; line-height: 1.3;
}
.hero-title em {
  font-style: normal; color: var(--rose);
  background: linear-gradient(120deg, var(--rose-soft), var(--rose-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { max-width: 560px; margin: 22px auto 30px; color: var(--ink-soft); font-size: 17px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-seal {
  margin: 46px auto 0; width: 86px; height: 86px; display: grid; place-items: center;
  border: 3px solid var(--rose-deep); border-radius: 14px; color: var(--rose-deep);
  font-size: 20px; font-weight: 700; letter-spacing: 2px; line-height: 1.2; padding: 6px;
  transform: rotate(-4deg); opacity: .85;
  box-shadow: inset 0 0 14px rgba(176, 46, 85, .18);
}
.hero-hint { margin-top: 40px; font-size: 13px; letter-spacing: 6px; color: var(--ink-soft); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- 展室 ---------- */
.room { max-width: 1080px; margin: 0 auto; padding: 72px 16px 8px; }
.room-head { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 26px; }
.room-no {
  flex: none; width: 66px; height: 66px; display: grid; place-items: center;
  font-size: 30px; font-weight: 700; color: #fff7f2;
  background: linear-gradient(150deg, var(--rose-soft), var(--rose-deep));
  border-radius: 18px; box-shadow: var(--shadow);
  position: relative;
}
.room-no::after {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(255, 247, 242, .4); border-radius: 13px;
}
.room-head h2 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: 2px; }
.room-lead { color: var(--ink-soft); margin-top: 6px; max-width: 720px; }
.card { border-radius: var(--radius); padding: clamp(16px, 3vw, 30px); }

/* 图集 */
.grid-gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
}
.grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.g-item {
  border-radius: 14px; overflow: hidden; cursor: zoom-in; position: relative;
  border: 1px solid var(--glass-brd); background: rgba(0,0,0,.03);
  transition: transform .35s ease, box-shadow .35s ease;
}
.g-item:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -14px rgba(176, 46, 85, .4); }
.g-item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.g-wide { grid-column: 1 / -1; }
.g-wide img { aspect-ratio: 21 / 9; object-fit: contain; background: rgba(0,0,0,.04); }

/* 名片：竖版正反面 + 四张横版（三段式） */
.grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cards .g-tall { grid-row: span 2; }
.grid-cards .g-tall img {
  aspect-ratio: auto; height: 100%; object-fit: contain; cursor: zoom-in;
  background: radial-gradient(circle at 50% 50%, var(--rose-mist), transparent 72%);
}
/* 补位说明格 */
.g-note {
  border-radius: 14px; border: 1px dashed var(--glass-brd);
  background: var(--rose-mist); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
}
.g-note b { color: var(--rose); font-size: 13px; letter-spacing: 3px; font-weight: 600; }
.g-note span { font-size: 13.5px; line-height: 2; color: var(--ink-soft); letter-spacing: 1px; }
.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 14px 10px;
  font-size: 13px; letter-spacing: 1px; color: #fff7f2;
  background: linear-gradient(transparent, rgba(61, 20, 35, .72));
}

/* 过程折叠 */
.process { margin-top: 18px; }
.process summary {
  cursor: pointer; font-size: 15px; letter-spacing: 2px; color: var(--rose);
  padding: 10px 4px; user-select: none;
}
.process summary::marker { content: ""; }
.process summary::before { content: "❖ "; }
.process[open] summary::before { content: "❖ "; }
.process .grid-gallery { margin-top: 10px; }

/* 图文分栏 */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 26px; align-items: center; }
.split-media { border-radius: 16px; overflow: hidden; border: 1px solid var(--glass-brd); }
.split-media img { width: 100%; transition: transform .6s ease; }
.split:hover .split-media img { transform: scale(1.03); }
.feature-list { list-style: none; margin-bottom: 22px; }
.feature-list li { padding: 7px 0 7px 26px; position: relative; color: var(--ink); }
.feature-list li::before {
  content: "◆"; position: absolute; left: 2px; top: 8px; font-size: 11px; color: var(--rose);
}
.room-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* 按钮 */
.btn {
  display: inline-block; text-decoration: none; font-size: 15px; letter-spacing: 2px;
  padding: 11px 26px; border-radius: 999px; transition: all .28s ease;
}
.btn-primary {
  color: #fff7f2; background: linear-gradient(135deg, var(--rose-soft), var(--rose-deep));
  box-shadow: 0 10px 24px -8px var(--rose);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -8px var(--rose); }
.btn-ghost { color: var(--rose); border: 1px solid var(--glass-brd); background: var(--glass-bg); }
.btn-ghost:hover { background: var(--rose); color: #fff7f2; border-color: var(--rose); }

/* 视频 */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; align-items: center; }
.v-item video {
  width: 100%; border-radius: 14px; border: 1px solid var(--glass-brd);
  background: #000; aspect-ratio: 16 / 9; object-fit: contain;
}
.v-item figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; text-align: center; letter-spacing: 1px; }
/* 竖屏作品用手机比例呈现 */
.v-item.is-vertical { justify-self: center; }
.v-item.is-vertical video {
  width: auto; max-width: 100%; max-height: 520px; aspect-ratio: 9 / 16;
  border-radius: 18px; box-shadow: 0 18px 40px -20px rgba(61, 20, 35, .5);
}
.sub-block { margin-top: 26px; padding-top: 20px; border-top: 1px dashed var(--glass-brd); }
.sub-block h3 { font-size: 19px; letter-spacing: 2px; margin-bottom: 6px; }

/* 双游戏 */
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 26px; }
.duo-item h3 { font-size: 19px; letter-spacing: 2px; margin-bottom: 12px; color: var(--rose); }
.duo-item .room-actions { margin-top: 12px; }

/* 尾声 */
.footer { text-align: center; padding: 90px 20px 60px; }
.footer-seal {
  width: 76px; height: 76px; margin: 0 auto 18px; display: grid; place-items: center;
  border: 3px solid var(--rose-deep); border-radius: 12px; color: var(--rose-deep);
  font-size: 17px; font-weight: 700; letter-spacing: 2px; line-height: 1.2;
  transform: rotate(3deg); opacity: .8;
}
.footer-name { font-size: 24px; font-weight: 700; letter-spacing: 4px; }
.footer a { color: var(--rose); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; letter-spacing: 1px; }

/* ---------- 纯 CSS 示意（取代对话截图） ---------- */
.viz {
  position: relative; margin: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--glass-brd);
  background: linear-gradient(150deg, rgba(255, 255, 255, .58), rgba(214, 69, 112, .10));
  aspect-ratio: 4 / 3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
html[data-mode="dark"] .viz {
  background: linear-gradient(150deg, rgba(255, 255, 255, .07), rgba(233, 137, 164, .10));
}
.viz::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .34), transparent 42%);
}

/* 情绪天气：四格 */
.viz-mood { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.viz-tile {
  position: relative; border-radius: 12px; display: grid; place-items: center; gap: 4px;
  color: #fff7f2; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 10px 22px -14px rgba(61, 20, 35, .55);
}
.viz-tile::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .35), transparent 55%);
}
.viz-glyph { font-size: 30px; line-height: 1; filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .28)); }
.viz-tile i { font-style: normal; font-size: 12.5px; letter-spacing: 2px; opacity: .95; }
.t-joy   { background: linear-gradient(155deg, #ffd7a8, #f7a072 55%, #d9673f); }
.t-rage  { background: linear-gradient(155deg, #ffb08a, #e0503f 58%, #8f1c2b); }
.t-sad   { background: linear-gradient(155deg, #bfd4e4, #7d97b8 58%, #465d79); }
.t-shock { background: linear-gradient(155deg, #cbb6f0, #8a6fc0 58%, #453577); }

/* 三维展厅：透视展墙 */
.viz-hall { perspective: 900px; }
.hall {
  position: absolute; inset: 11% 9%; transform-style: preserve-3d;
  transform: rotateY(-17deg) rotateX(9deg);
}
.hall-frame {
  position: absolute; width: 29%; height: 26%; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; letter-spacing: 1.5px;
  color: var(--ink); text-align: center; padding: 4px;
  border: 1px solid rgba(214, 69, 112, .5);
  background: linear-gradient(150deg, rgba(255, 255, 255, .92), rgba(214, 69, 112, .22));
  box-shadow: 0 14px 28px -16px rgba(176, 46, 85, .6), inset 0 1px 0 rgba(255, 255, 255, .8);
}
html[data-mode="dark"] .hall-frame {
  background: linear-gradient(150deg, rgba(255, 255, 255, .13), rgba(233, 137, 164, .16));
  border-color: rgba(233, 137, 164, .32);
}
.hall-frame:nth-child(1) { left: 1%;  top: 10%; transform: translateZ(64px); }
.hall-frame:nth-child(2) { left: 34%; top: 2%;  transform: translateZ(18px); }
.hall-frame:nth-child(3) { left: 67%; top: 14%; transform: translateZ(-24px); }
.hall-frame:nth-child(4) { left: 6%;  top: 60%; transform: translateZ(38px); }
.hall-frame:nth-child(5) { left: 38%; top: 56%; transform: translateZ(-6px); }
.hall-frame:nth-child(6) { left: 69%; top: 64%; transform: translateZ(-44px); }
.hall::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -12%; height: 40%;
  background: radial-gradient(ellipse at 50% 0%, rgba(214, 69, 112, .22), transparent 70%);
}

/* 手势：取景框 */
.viz-gesture { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.cam {
  position: relative; flex: 1; border-radius: 12px;
  border: 1px dashed rgba(214, 69, 112, .45);
  background: radial-gradient(circle at 50% 46%, rgba(214, 69, 112, .20), transparent 62%);
  display: grid; place-items: center; align-content: center; gap: 4px;
}
.cam-corner { position: absolute; width: 16px; height: 16px; border: 2px solid var(--rose); }
.c1 { left: 8px;  top: 8px;    border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.c2 { right: 8px; top: 8px;    border-left: 0;  border-bottom: 0; border-radius: 0 6px 0 0; }
.c3 { left: 8px;  bottom: 8px; border-right: 0; border-top: 0;    border-radius: 0 0 0 6px; }
.c4 { right: 8px; bottom: 8px; border-left: 0;  border-top: 0;    border-radius: 0 0 6px 0; }
.cam-hand { font-size: 42px; line-height: 1; animation: bob 3.4s ease-in-out infinite; }
.cam-tip { font-size: 12px; letter-spacing: 2px; color: var(--ink-soft); }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-chips span {
  font-size: 12.5px; letter-spacing: 1px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--glass-brd); background: rgba(255, 255, 255, .42); color: var(--ink);
}
html[data-mode="dark"] .g-chips span { background: rgba(255, 255, 255, .08); }

/* ---------- 随笔 ---------- */
.essay { max-width: 880px; margin: 0 auto; padding: clamp(24px, 4vw, 54px) clamp(20px, 5vw, 70px); }
.essay-kicker { letter-spacing: 5px; font-size: 12.5px; color: var(--rose); margin-bottom: 22px; }
.essay p { margin-bottom: 18px; font-size: 16.8px; line-height: 1.95; }
.essay-lead {
  font-size: clamp(18px, 2.2vw, 21px); font-weight: 600; color: var(--ink);
  padding-left: 18px; border-left: 3px solid var(--rose); margin-bottom: 22px;
}
.essay strong { color: var(--rose-deep); }
html[data-mode="dark"] .essay strong { color: var(--rose-soft); }
.essay-sec { margin-top: 34px; }
.essay-no {
  display: inline-block; font-size: 12px; letter-spacing: 3px; color: #fff7f2;
  background: linear-gradient(145deg, var(--rose-soft), var(--rose-deep));
  padding: 3px 11px; border-radius: 999px; margin-bottom: 10px;
  box-shadow: 0 6px 16px -8px var(--rose);
}
.essay-sec h3 { font-size: clamp(19px, 2.4vw, 23px); letter-spacing: 1px; margin-bottom: 10px; }
.essay-sec p { color: var(--ink); }
.essay-note {
  margin: 30px 0 18px; padding: 14px 18px; border-left: 3px solid var(--rose);
  background: var(--rose-mist); border-radius: 0 10px 10px 0; color: var(--ink-soft);
}
.essay-quote {
  margin: 26px 0; padding: 24px 10px; text-align: center;
  font-size: clamp(18px, 2.6vw, 25px); font-weight: 600; letter-spacing: 1px; line-height: 1.7;
  color: var(--rose-deep);
  border-top: 1px dashed var(--glass-brd); border-bottom: 1px dashed var(--glass-brd);
}
html[data-mode="dark"] .essay-quote { color: var(--rose-soft); }
.essay-sign { text-align: right; font-size: 13.5px; letter-spacing: 1px; color: var(--ink-soft); margin: 26px 0 0; }
.essay-sign a { color: var(--rose); text-decoration: none; }
.essay-sign a:hover { text-decoration: underline; }

@media (max-width: 620px) {
  .viz-glyph { font-size: 24px; }
  .hall-frame { font-size: 10px; }
  .cam-hand { font-size: 34px; }
}

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(30, 8, 16, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: min(92vw, 1200px); max-height: 84vh; border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
  transform: scale(.94); transition: transform .3s ease;
}
.lightbox.is-open img { transform: scale(1); }
.lb-cap { position: absolute; bottom: 26px; color: #fff7f2; font-size: 14px; letter-spacing: 2px; }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .08); color: #fff7f2;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 50%; cursor: pointer;
  width: 46px; height: 46px; font-size: 22px; display: grid; place-items: center; transition: all .25s;
}
.lightbox button:hover { background: var(--rose); }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .3, 1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .grid-cards { grid-template-columns: 1fr; }
  .grid-cards .g-tall { grid-row: span 1; }
  .grid-cards .g-tall img { aspect-ratio: auto; height: auto; }
  .nav { display: none; }
  .room-head { flex-direction: row; gap: 14px; }
  .room-no { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; }
  .hero { min-height: 84vh; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
