/* ==========================================================================
   风格实验室 · 结构层（layout）
   --------------------------------------------------------------------------
   为什么要和皮肤分开：
     皮肤（bauhaus.css … ai.css）只管「长什么样」——颜色、边框、阴影、字体；
     本文件只管「怎么排」——导航在哪、首屏怎么分栏、卡片什么形状。
   两套属性分开挂，转场才能做到：
     t=0s   换 data-theme  → 颜色/背景先过渡（0-1s）
     t=3s   换 data-layout → 结构在「细节替换」那一刻落位
   前缀一律 html[data-layout="<id>"]，和皮肤互不干扰。测试时给 body 加
   .show-modules 可以直接看到 4 个语义模块的边界。

   四个语义模块（转场映射用，DOM 上标 data-module）：
     nav      导航入口        .topbar
     title    主标题区        .hero__copy
     content  主内容区        .hero__art
     aux      辅助信息区      .ticker
   ========================================================================== */

/* ---------- 模块标注（按 M 键切换，只用于验证） ---------- */
body.show-modules [data-module] {
  outline: 2px dashed #ff2d95;
  outline-offset: -2px;
}
body.show-modules [data-module]::after {
  content: attr(data-module);
  position: absolute;
  z-index: 9998;
  padding: 2px 6px;
  background: #ff2d95;
  color: #fff;
  font: 700 11px/1.4 ui-monospace, monospace;
  letter-spacing: .04em;
  pointer-events: none;
}
body.show-modules [data-module="nav"]::after { left: 4px; top: 4px; }
body.show-modules [data-module="title"]::after { left: 4px; top: 4px; }
body.show-modules [data-module="content"]::after { right: 4px; top: 4px; }
body.show-modules [data-module="aux"]::after { left: 4px; bottom: 4px; }

/* 顶栏默认给右上角的播放器留出位置 */
.topbar__inner { padding-right: clamp(330px, 30vw, 424px); }

/* ==========================================================================
   01 网站原始风格 —— 顶栏横向吸附，左文右图
   ========================================================================== */
html[data-layout="collage"] .hero {
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
}

/* ==========================================================================
   02 包豪斯 —— 导航变左侧竖排导轨，首屏改为单栏居中，头像缩成背景大圆
   ========================================================================== */
html[data-layout="bauhaus"] body { padding-left: 76px; }
html[data-layout="bauhaus"] .topbar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 76px;
  z-index: 60;
  background: #ece5d3;
  border: 0;
  border-right: 3px solid #141414;
  display: block;
}
html[data-layout="bauhaus"] .topbar__inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  height: 100%;
  padding: 20px 0 18px;
}
html[data-layout="bauhaus"] .brand {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: none;
  color: #141414;
  border: 0;
  padding: 0;
  font-size: 15px;
  letter-spacing: .16em;
}
html[data-layout="bauhaus"] .topbar__inner { padding-bottom: 168px; }
html[data-layout="bauhaus"] .brand__mark { color: #141414; }
html[data-layout="bauhaus"] .brand__dot { color: #e6371e; }
html[data-layout="bauhaus"] .menu {
  flex-direction: column;
  align-items: center;
  gap: 16px;
  writing-mode: horizontal-tb;
}
html[data-layout="bauhaus"] .menu__link {
  border: 0;
  padding: 0;
  font-size: 12px;
  letter-spacing: .06em;
  writing-mode: horizontal-tb;
}
html[data-layout="bauhaus"] .menu__link--cta {
  writing-mode: vertical-rl;
  padding: 14px 5px;
  background: #e6371e;
  color: #ece5d3;
  letter-spacing: .16em;
}
html[data-layout="bauhaus"] .hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  text-align: left;
  justify-items: start;
  min-height: 82svh;
  gap: clamp(20px, 3vw, 48px);
  padding-top: clamp(36px, 5vw, 64px);
}
html[data-layout="bauhaus"] .hero__copy { width: min(100%, 640px); max-width: 640px; }
html[data-layout="bauhaus"] .hero__lead { margin-inline: 0; }
html[data-layout="bauhaus"] .hero__actions { justify-content: flex-start; }
html[data-layout="bauhaus"] .hero__art {
  position: static;
  width: 100%;
  max-width: 520px;
  opacity: 1;
  z-index: 0;
  justify-self: end;
}
html[data-layout="bauhaus"] .hero__copy { position: relative; z-index: 1; }
html[data-layout="bauhaus"] .rows__item,
html[data-layout="bauhaus"] .acc__item { border-top-width: 3px; }
html[data-layout="bauhaus"] .rows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 3px solid var(--ink);
}
html[data-layout="bauhaus"] .row {
  display: block;
  border-left: 1px solid var(--ink);
  padding: 22px 18px;
  min-height: 210px;
}
html[data-layout="bauhaus"] .row__type { display: block; margin-top: 14px; }
html[data-layout="bauhaus"] .row__go { display: none; }

/* ==========================================================================
   03 瑞士国际主义 —— 十二栏网格，标题占 1-7，图占 8-13 并出血到右边
   ========================================================================== */
html[data-layout="swiss"] .topbar {
  border-bottom: 3px solid #141413;
  background: #f1f1ed;
}
html[data-layout="swiss"] .topbar__inner { padding-block: 10px; }
html[data-layout="swiss"] .menu { gap: 0; }
html[data-layout="swiss"] .menu__link {
  padding: 6px 16px;
  border-left: 1px solid #141413;
}
html[data-layout="swiss"] .hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 clamp(10px, 1.4vw, 20px);
  align-items: end;
  padding-bottom: clamp(40px, 5vw, 72px);
}
html[data-layout="swiss"] .hero__copy {
  grid-column: 1 / 8;
  align-self: end;
  padding-bottom: 8px;
}
html[data-layout="swiss"] .hero__art {
  grid-column: 8 / 13;
  justify-content: flex-end;
  margin-right: calc(-1 * var(--gutter));
}
html[data-layout="swiss"] .art { max-width: none; }
html[data-layout="swiss"] .hero__title { font-size: clamp(2.6rem, 7vw, 6rem); }
html[data-layout="swiss"] .rows { border-top: 3px solid #141413; }
html[data-layout="swiss"] .row {
  display: grid;
  grid-template-columns: 64px repeat(3, minmax(0, 1fr));
  align-items: start;
  border-bottom: 1px solid #141413;
}
html[data-layout="swiss"] .row__main { grid-column: 2 / 4; }
html[data-layout="swiss"] .row__type { grid-column: 4; text-align: left; letter-spacing: .16em; }
html[data-layout="swiss"] .row__go { grid-column: 5; }
html[data-layout="swiss"] .acc__btn { grid-template-columns: 64px minmax(0, 1fr) auto; }
html[data-layout="swiss"] .acc__plus { display: none; }

/* ==========================================================================
   04 波普 / 迷幻 —— 导航变成右下角一叠贴纸，标题整块歪着压住图
   ========================================================================== */
html[data-layout="pop"] .topbar {
  position: fixed;
  right: 24px;
  bottom: 92px;
  left: auto;
  top: auto;
  width: max-content;
  max-width: 260px;
  z-index: 62;
  background: none;
  border: 0;
  box-shadow: none;
}
html[data-layout="pop"] .topbar__inner {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding: 0;
  width: auto;
}
html[data-layout="pop"] .brand { order: 2; margin-top: 12px; }
html[data-layout="pop"] .menu {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
html[data-layout="pop"] .menu__link {
  writing-mode: horizontal-tb;
  white-space: nowrap;
  padding: 8px 16px;
  transform: rotate(-3deg);
  box-shadow: 5px 5px 0 #141414;
}
html[data-layout="pop"] .menu__link:nth-child(2n) { transform: rotate(2.5deg); }
html[data-layout="pop"] .hero__stamp { display: none; }
html[data-layout="pop"] .hero {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center;
  padding-bottom: 18vh;
}
html[data-layout="pop"] .hero__copy { transform: rotate(-2.5deg); z-index: 2; }
html[data-layout="pop"] .hero__title { font-size: clamp(3rem, 9vw, 7.6rem); }
html[data-layout="pop"] .hero__art {
  justify-content: flex-end;
  align-items: flex-end;
  margin-bottom: -6vh;
  transform: rotate(4deg);
}
html[data-layout="pop"] .rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
html[data-layout="pop"] .rows__item { border: 0; }
html[data-layout="pop"] .row {
  display: block;
  border: 3px solid #141414;
  padding: 20px;
  min-height: 190px;
  transform: rotate(-1.4deg);
}
html[data-layout="pop"] .rows__item:nth-child(2n) .row { transform: rotate(1.6deg); }
html[data-layout="pop"] .row__type { display: block; margin-top: 12px; }
html[data-layout="pop"] .row__go { display: none; }

/* ==========================================================================
   05 孟菲斯 —— 图在左文在右（唯一一个反向首屏），导航是底部中间散落的药丸
   ========================================================================== */
html[data-layout="memphis"] .topbar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  top: auto;
  transform: translateX(-50%);
  width: auto;
  z-index: 62;
  background: none;
  border: 0;
}
html[data-layout="memphis"] .topbar__inner { padding: 0; gap: 12px; }
html[data-layout="memphis"] .brand { display: none; }
html[data-layout="memphis"] .menu { gap: 10px; }
html[data-layout="memphis"] .menu__link:nth-child(1) { transform: rotate(-3deg); }
html[data-layout="memphis"] .menu__link:nth-child(2) { transform: rotate(2deg) translateY(-3px); }
html[data-layout="memphis"] .menu__link:nth-child(3) { transform: rotate(-1.5deg); }
html[data-layout="memphis"] .menu__link:nth-child(4) { transform: rotate(2.5deg) translateY(-2px); }
html[data-layout="memphis"] .hero {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 3vw, 44px);
  padding-bottom: 12vh;
}
html[data-layout="memphis"] .hero__art { order: -1; justify-content: flex-start; }
html[data-layout="memphis"] .art { transform: rotate(-3deg); }
html[data-layout="memphis"] .rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
html[data-layout="memphis"] .rows__item { border: 0; }
html[data-layout="memphis"] .row {
  display: block;
  padding: 22px;
  min-height: 200px;
  transform: rotate(-1deg);
}
html[data-layout="memphis"] .rows__item:nth-child(2n) .row { transform: rotate(1.2deg); }
html[data-layout="memphis"] .row__type { display: block; margin-top: 12px; }
html[data-layout="memphis"] .row__go { display: none; }

/* ==========================================================================
   06 早期网页 / Y2K —— 顶栏伪装成窗口标题条，首屏整体装进一个窗口
   ========================================================================== */
html[data-layout="y2k"] .topbar {
  position: relative;
  border: 3px outset var(--y2k-silver, #c0c0c0);
  border-bottom-width: 2px;
  margin: 6px var(--gutter) 0;
  max-width: none;
}
html[data-layout="y2k"] .topbar::before {
  content: "我的个人主页 - Microsoft Internet Explorer";
  display: block;
  padding: 3px 8px;
  background: #00007b;
  color: #fff;
  font: 700 12px/1.5 "MS Gothic", "SimSun", monospace;
  letter-spacing: .02em;
}
html[data-layout="y2k"] .hero {
  border: 3px outset var(--y2k-silver, #c0c0c0);
  margin: 10px var(--gutter) 0;
  max-width: none;
  background: rgba(0, 4, 63, .55);
}
html[data-layout="y2k"] .rows {
  border: 2px inset var(--y2k-silver, #c0c0c0);
  padding: 8px;
}
html[data-layout="y2k"] .row { border-bottom: 1px dashed #808080; }
html[data-layout="y2k"] .acc__item { border: 2px groove var(--y2k-silver, #c0c0c0); margin-bottom: 6px; }

/* ==========================================================================
   07 拟物化 —— 导航做成便签顶上的索引标签，首屏是一整张横线便签
   ========================================================================== */
html[data-layout="skeuo"] .topbar {
  position: relative;
  max-width: none;
  background: none;
  border: 0;
  padding-left: clamp(28px, 6vw, 92px);
  padding-top: 14px;
}
html[data-layout="skeuo"] .topbar__inner {
  align-items: flex-end;
  padding-right: clamp(330px, 30vw, 424px);
}
html[data-layout="skeuo"] .brand {
  border-radius: 10px 10px 0 0;
  padding: 8px 16px 6px;
  margin-bottom: -1px;
}
html[data-layout="skeuo"] .menu { gap: 6px; align-items: flex-end; }
html[data-layout="skeuo"] .menu__link {
  border-radius: 10px 10px 0 0;
  padding: 8px 16px 6px;
  margin-bottom: -1px;
}
html[data-layout="skeuo"] .hero {
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(40, 20, 0, .38);
}
html[data-layout="skeuo"] .rows {
  background: #fdf6e3;
  border-radius: 12px;
  padding: 10px 18px;
  box-shadow: 0 10px 24px rgba(40, 20, 0, .26), inset 0 1px 0 #fff;
}
html[data-layout="skeuo"] .acc__item { border-radius: 10px; margin-bottom: 10px; }

/* ==========================================================================
   08 扁平化 —— 导航变底部应用栏，首屏标题超大、图改成四宫格瓦片
   ========================================================================== */
html[data-layout="flat"] body { padding-bottom: 76px; }
html[data-layout="flat"] .topbar__inner { padding-left: 128px; }
html[data-layout="flat"] .topbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 62;
  background: #fff;
  border: 0;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -1px 6px rgba(0, 0, 0, .06);
}
html[data-layout="flat"] .topbar__inner {
  max-width: 720px;
  margin-inline: auto;
  padding: 0;
  justify-content: space-around;
}
html[data-layout="flat"] .brand { display: none; }
html[data-layout="flat"] .menu { width: 100%; justify-content: space-around; }
html[data-layout="flat"] .menu__link {
  flex: 1;
  text-align: center;
  padding: 18px 6px;
  border: 0;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: none;
}
html[data-layout="flat"] .hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: center;
}
html[data-layout="flat"] .hero__title { font-size: clamp(3rem, 9vw, 7.4rem); }
html[data-layout="flat"] .hero__art { justify-content: flex-end; }
html[data-layout="flat"] .art {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  aspect-ratio: 1 / 1.02;
}
html[data-layout="flat"] .rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
html[data-layout="flat"] .rows__item { border: 0; }
html[data-layout="flat"] .row {
  display: block;
  padding: 20px;
  min-height: 176px;
}
html[data-layout="flat"] .row__type { display: block; margin-top: 10px; }
html[data-layout="flat"] .row__go { display: none; }

/* ==========================================================================
   09 玻璃拟态 —— 导航缩成中间悬浮胶囊，首屏单栏居中
   ========================================================================== */
html[data-layout="glass"] .topbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  top: auto;
  transform: translateX(-50%);
  width: auto;
  max-width: none;
  z-index: 62;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(74, 63, 130, .22);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}
html[data-layout="glass"] .topbar__inner {
  padding: 6px 8px 6px 18px;
  gap: 14px;
}
html[data-layout="glass"] .brand { background: none; border: 0; padding: 0; }
html[data-layout="glass"] .menu { gap: 4px; }
html[data-layout="glass"] .menu__link {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
}
html[data-layout="glass"] .hero {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  text-align: center;
  min-height: auto;
  padding-bottom: clamp(120px, 16vh, 180px);
}
html[data-layout="glass"] .hero__copy { width: min(100%, 760px); justify-self: center; }
html[data-layout="glass"] .hero__title { font-size: clamp(2.6rem, 6.4vw, 5rem); }
html[data-layout="glass"] .hero__lead { margin-inline: auto; }
html[data-layout="glass"] .hero__actions { justify-content: center; }
html[data-layout="glass"] .hero__art { margin-top: clamp(16px, 2.4vw, 28px); width: min(100%, 380px); }
html[data-layout="glass"] .rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
html[data-layout="glass"] .rows__item { border: 0; }
html[data-layout="glass"] .row { display: block; padding: 24px; min-height: 184px; }

/* ==========================================================================
   10 AI 时代 —— 导航是顶部居中的命令条，首屏球体出血到右上
   ========================================================================== */
html[data-layout="ai"] .topbar {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: auto;
  max-width: none;
  z-index: 62;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(120, 130, 190, .22);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(90, 100, 180, .16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
html[data-layout="ai"] .topbar__inner { padding: 5px 8px 5px 16px; gap: 12px; }
html[data-layout="ai"] .brand { background: none; border: 0; padding: 0; }
html[data-layout="ai"] .menu { gap: 2px; }
html[data-layout="ai"] .menu__link { border: 0; border-radius: 999px; padding: 6px 12px; }
html[data-layout="ai"] .hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  padding-top: clamp(84px, 9vw, 128px);
}
html[data-layout="ai"] .hero__art {
  justify-content: flex-end;
  margin-right: calc(-1 * clamp(20px, 6vw, 90px));
}
html[data-layout="ai"] .art { max-width: 620px; }
html[data-layout="ai"] .hero__title { font-size: clamp(3rem, 8.4vw, 7rem); }
html[data-layout="ai"] .rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
html[data-layout="ai"] .rows__item { border: 0; }
html[data-layout="ai"] .row { display: block; padding: 26px; min-height: 190px; }

/* ---------- 窄屏：所有「固定家具」退化成贴边，避免盖住内容 ---------- */
@media (max-width: 860px) {
  html[data-layout="bauhaus"] body { padding-left: 0; }
  html[data-layout="bauhaus"] .topbar {
    position: static;
    width: auto;
    display: block;
    padding: 12px var(--gutter);
  }
  html[data-layout="bauhaus"] .topbar__inner { flex-direction: row; height: auto; }
  html[data-layout="bauhaus"] .brand,
  html[data-layout="bauhaus"] .menu { writing-mode: horizontal-tb; transform: none; }
  html[data-layout="bauhaus"] .menu { flex-direction: row; }
  html[data-layout="bauhaus"] .hero { text-align: left; justify-items: start; }
  html[data-layout="bauhaus"] .hero__lead,
  html[data-layout="bauhaus"] .hero__actions { margin-inline: 0; justify-content: flex-start; }
  html[data-layout="bauhaus"] .hero__art { position: static; width: 100%; max-width: none; opacity: 1; }
  html[data-layout="bauhaus"] .rows { grid-template-columns: 1fr; }
  html[data-layout="bauhaus"] .row { border-left: 0; min-height: 0; }

  html[data-layout="pop"] .topbar,
  html[data-layout="memphis"] .topbar,
  html[data-layout="glass"] .topbar,
  html[data-layout="ai"] .topbar {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    bottom: auto;
    margin: 0;
    border-radius: 0;
    display: block;
  }
  html[data-layout="pop"] .topbar__inner,
  html[data-layout="memphis"] .topbar__inner,
  html[data-layout="glass"] .topbar__inner,
  html[data-layout="ai"] .topbar__inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px var(--gutter);
  }
  html[data-layout="pop"] .menu,
  html[data-layout="memphis"] .menu,
  html[data-layout="glass"] .menu,
  html[data-layout="ai"] .menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  html[data-layout="pop"] .menu__link,
  html[data-layout="memphis"] .menu__link { transform: none; }
  html[data-layout="memphis"] .brand,
  html[data-layout="flat"] .brand { display: inline-flex; }

  html[data-layout="swiss"] .hero { grid-template-columns: 1fr; }
  html[data-layout="swiss"] .hero__copy,
  html[data-layout="swiss"] .hero__art { grid-column: 1 / -1; }
  html[data-layout="swiss"] .hero__art { justify-content: center; margin-right: 0; }
  html[data-layout="swiss"] .row { grid-template-columns: 44px minmax(0, 1fr); }
  html[data-layout="swiss"] .row__type,
  html[data-layout="swiss"] .row__go { grid-column: 2; text-align: left; }

  html[data-layout="pop"] .rows,
  html[data-layout="memphis"] .rows,
  html[data-layout="flat"] .rows,
  html[data-layout="glass"] .rows,
  html[data-layout="ai"] .rows { grid-template-columns: 1fr; }
  html[data-layout="pop"] .hero,
  html[data-layout="memphis"] .hero,
  html[data-layout="flat"] .hero,
  html[data-layout="ai"] .hero { grid-template-columns: 1fr; }
  html[data-layout="memphis"] .hero__art { order: 0; }
  html[data-layout="pop"] .hero__copy { transform: none; }
  html[data-layout="pop"] .hero__art { transform: none; margin-bottom: 0; }
  html[data-layout="flat"] body { padding-bottom: 64px; }
  html[data-layout="flat"] .topbar__inner { padding-left: 128px; }
html[data-layout="flat"] .topbar { position: fixed; left: 0; right: 0; bottom: 0; }
  html[data-layout="flat"] .topbar__inner { padding: 0; }
}

/* 手机上播放器挪到顶栏下面一行，导航恢复原来的边距 */
@media (max-width: 720px) {
  html[data-layout] .topbar__inner { padding-right: 0; }
}

/* 手机上：首屏回到单栏，装饰件收掉 */
@media (max-width: 860px) {
  html[data-layout] .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    padding-bottom: 72px;
  }
  html[data-layout] .hero__copy {
    width: 100% !important;
    max-width: none !important;
  }
  html[data-layout] .hero__art {
    position: static !important;
    width: min(100%, 340px) !important;
    max-width: 340px !important;
    margin: 18px auto 0 !important;
    transform: none !important;
    justify-self: center !important;
    order: 0;
  }
  html[data-layout] .hero__stamp { display: none !important; }
  html[data-layout] .art { transform: none !important; }
}