/* ============================================================
   Yuan Xiong — Portfolio
   共享样式表 / Shared stylesheet
   配色：纯白底 + 暖米色点缀
   ============================================================ */

/* ---------- 1. 设计变量（改这里就能全站换风格） ---------- */
:root {
  --bg:            #FFFFFF;   /* 页面底色 */
  --ink:           #1C1A17;   /* 主文字 */
  --ink-soft:      #8C857B;   /* 次要文字 / 未选中菜单 */
  --beige:         #F3EDE3;   /* 暖米色（占位块、悬停底色） */
  --beige-deep:    #DCCFBA;   /* 暖米色深一档（分割线、下划线） */
  --rule:          #E4DACA;   /* 虚线分割线 */

  --sidebar-w:     280px;     /* 侧栏宽度 */
  --gutter:        28px;      /* 作品间距 */
  --page-pad:      64px;      /* 页面内边距 */

  --font: "Jost", "Poppins", "Avenir Next", "Futura",
          "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 300;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: auto; }

/* ---------- 3. 布局骨架 ---------- */
.layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* --- 左侧固定侧栏 --- */
.sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 虚拟人物 / 头像 */
.avatar {
  width: 120px;
  margin-bottom: 46px;
}
.avatar img {
  image-rendering: pixelated;   /* 像素画头像保持锐利 */
}

.site-name {
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.12em;
  margin: 0 0 52px;
}

/* --- 导航菜单 --- */
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li { margin-bottom: 18px; }

.nav a {
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav a:hover { color: var(--ink); }

/* 当前页高亮 */
.nav a.is-active {
  color: var(--ink);
  border-bottom-color: var(--beige-deep);
}

.sidebar-foot {
  margin-top: 56px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* --- 右侧内容区 --- */
.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--page-pad) var(--page-pad) 120px;
  /* 参考图里的左右两条竖虚线 */
  border-left: 1px dashed var(--rule);
  border-right: 1px dashed var(--rule);
  margin-right: var(--page-pad);
}

/* 当前标签名称 */
.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.16em;
  margin: 0 0 56px;
}
.section-title small {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- 4. 作品网格 ---------- */
/* 瀑布流排版（用于 character-design / traditional-art）：按列连续堆叠 */
.gallery {
  column-count: 3;
  column-gap: var(--gutter);
}

/* 手动三列排版（用于 illustration）：精确控制每张图落在哪一列，不依赖浏览器自动平衡 */
.gallery--columns {
  display: flex;
  column-count: unset;
  gap: var(--gutter);
}
.gallery-col {
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  flex: 1;
  min-width: 0;
}
.gallery--columns .work {
  break-inside: unset;
  margin: 0;
}

/* 固定行优先三列网格（用于 character-design）：严格按源码顺序逐行排列 */
.gallery--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}
.gallery--grid .work {
  break-inside: unset;
  margin: 0;
}

.work {
  break-inside: avoid;
  margin: 0 0 var(--gutter);
  background: var(--beige);
}

.work img { width: 100%; display: block; }

/* GIF 动图：加一枚极轻的角标做区分 */
.work--gif { position: relative; }
.work--gif::after {
  content: "GIF";
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 0.14em;
  padding: 3px 7px;
  background: rgba(255,255,255,.86);
  color: var(--ink-soft);
}

/* ---------- 4b. Merchandise 大图轮播 ---------- */
.carousel {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  background: var(--beige);
  overflow: hidden;
}

.carousel-viewport { overflow: hidden; }

.carousel-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  transition: transform .5s cubic-bezier(.65, 0, .35, 1);
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 左右各占一半的点击/悬浮热区 */
.carousel-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: none;
  background: none;
  padding: 0 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.carousel-zone--prev { left: 0; justify-content: flex-start; }
.carousel-zone--next { right: 0; justify-content: flex-end; }

.carousel-arrow {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  opacity: 0;
  transform: scale(.92);
  transition: opacity .2s ease, transform .2s ease;
}
.carousel-zone:hover .carousel-arrow,
.carousel-zone:focus-visible .carousel-arrow {
  opacity: 1;
  transform: scale(1);
}

.carousel-counter {
  position: absolute;
  right: 20px;
  bottom: 18px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .88);
  pointer-events: none;
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.carousel-dot.is-active {
  background: var(--ink);
  transform: scale(1.3);
}

@media (max-width: 860px) {
  .carousel-slide { aspect-ratio: 1 / 1; }
  .carousel-arrow { width: 38px; height: 38px; font-size: 24px; }
}

/* ---------- 5. About 页面 ---------- */
.about {
  max-width: 620px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 2;
  color: #3A362F;
}
.about h2 {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 52px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--rule);
}
.about h2:first-of-type { margin-top: 0; }
.about p { margin: 0 0 18px; }
.about ul { margin: 0; padding-left: 18px; }
.about li { margin-bottom: 8px; }

.about-portrait {
  width: 180px;
  margin: 0 auto 44px;
  background: var(--beige);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li { margin-bottom: 10px; }
.contact-list span {
  display: inline-block;
  width: 96px;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.contact-list a { border-bottom: 1px solid var(--beige-deep); }

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1200px) {
  .gallery { column-count: 2; }
  .gallery--columns { flex-direction: column; }
  .gallery--grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  :root { --page-pad: 28px; --gutter: 18px; }

  .layout { display: block; }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 40px 28px 28px;
    border-bottom: 1px dashed var(--rule);
  }
  .avatar { width: 84px; margin-bottom: 22px; }
  .site-name { margin-bottom: 26px; font-size: 22px; }

  .nav ul { display: flex; flex-wrap: wrap; gap: 8px 22px; }
  .nav li { margin-bottom: 0; }

  .sidebar-foot { margin-top: 26px; }

  .content {
    border: none;
    margin-right: 0;
    padding-bottom: 72px;
  }
  .section-title { font-size: 24px; margin-bottom: 34px; }
}

@media (max-width: 520px) {
  .gallery { column-count: 1; }
  .gallery--grid { grid-template-columns: 1fr; }
}
