
:root {
  --ink: #171717;
  --muted: #76736d;
  --paper: #f3f0ea;
  --line: rgba(23, 23, 23, 0.14);
  --accent: #8b61a9;
  --accent-soft: rgba(139, 97, 169, 0.13);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { width: 100%; min-height: 100%; overflow: hidden; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.portfolio-shell {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: radial-gradient(circle at 12% 18%, rgba(219, 204, 180, 0.28), transparent 28rem), var(--paper);
}

.topbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; width: min(1320px, calc(100% - 96px)); margin: 0 auto; padding: 23px 0 20px; border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: 0.03em; }
.brand, .contact-link, .nav-links { display: flex; align-items: center; }
.brand { gap: 11px; font-weight: 700; letter-spacing: 0.08em; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.nav-links { gap: 32px; color: var(--muted); }
.nav-links a, .contact-link { transition: opacity 180ms ease; }
.nav-links a:hover, .contact-link:hover { opacity: 0.55; }
.contact-link { gap: 9px; }
.contact-link span { font-size: 16px; }
.palette-switcher { display: flex; align-items: center; gap: 3px; }
.palette-option { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 7px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; transition: border-color 180ms ease, color 180ms ease, background 180ms ease; }
.palette-option:hover, .palette-option[aria-pressed="true"] { border-color: var(--line); color: var(--ink); }
.palette-option[aria-pressed="true"] { background: rgba(255, 255, 255, 0.34); }
.palette-swatch { display: block; width: 13px; height: 13px; border: 3px solid var(--swatch-paper); border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px rgba(23, 23, 23, 0.1); }
.palette-option-label { font-size: 10px; letter-spacing: 0.03em; white-space: nowrap; }

.hero { flex: 0 0 auto; width: min(920px, calc(100% - 48px)); margin: 0 auto; padding: 26px 0 12px; text-align: center; }
.eyebrow, .section-kicker, .active-caption-label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.17em; text-transform: uppercase; }
.hero h1 { margin: 11px 0 0; font-size: clamp(2.25rem, 4.4vw, 4.6rem); font-weight: 800; letter-spacing: -0.08em; line-height: 0.92; }
.hero h1 em { display: inline-block; color: var(--accent); font-family: var(--serif); font-size: 0.88em; font-weight: 400; letter-spacing: -0.09em; }
.hero-copy { display: none; }

.works-section { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; width: min(1320px, calc(100% - 96px)); margin: 0 auto; padding: 10px 0 11px; }
.section-heading { display: flex; flex: 0 0 auto; align-items: end; justify-content: space-between; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 7px 0 0; font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.8rem); font-weight: 400; letter-spacing: -0.055em; line-height: 0.96; }
.section-note { margin: 0 0 1px; color: var(--muted); font-size: 11px; }

.desktop-stage { position: relative; display: flex; flex: 1 1 auto; min-height: 280px; justify-content: center; margin: 10px 0 5px; perspective: 1250px; perspective-origin: center center; }
.work-card, .mobile-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 18px; background: var(--card-color); color: white; box-shadow: 0 22px 48px rgba(51, 38, 23, 0.16); -webkit-tap-highlight-color: transparent; }
.work-card { position: absolute; top: 50%; left: 50%; width: 250px; height: min(55vh, 430px); transform-style: preserve-3d; transition: transform 520ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease, filter 300ms ease; }

/* 中央卡片正面朝向用户，两侧卡片逐渐变宽、外翻，并延伸到画面边缘。 */
.work-card--2 { width: 348px; transform: translate(calc(-50% - 430px), -50%) rotateY(56deg) scaleX(1.08) scaleY(0.98); clip-path: polygon(16% 0, 100% 10%, 100% 90%, 16% 100%, 0 92%, 0 8%); opacity: 0.52; z-index: 8; }
.work-card--1 { width: 288px; transform: translate(calc(-50% - 260px), -50%) rotateY(35deg) scaleX(1.04); clip-path: polygon(7% 0, 100% 5%, 100% 95%, 7% 100%, 0 94%, 0 6%); opacity: 0.82; z-index: 9; }
.work-card-0 { width: 252px; transform: translate(-50%, -50%) scale(1.04); opacity: 1; z-index: 10; box-shadow: 0 30px 64px rgba(51, 38, 23, 0.26); }
.work-card-1 { width: 288px; transform: translate(calc(-50% + 260px), -50%) rotateY(-35deg) scaleX(1.04); clip-path: polygon(0 5%, 93% 0, 100% 6%, 100% 94%, 93% 100%, 0 95%); opacity: 0.82; z-index: 9; }
.work-card-2 { width: 348px; transform: translate(calc(-50% + 430px), -50%) rotateY(-56deg) scaleX(1.08) scaleY(0.98); clip-path: polygon(0 10%, 84% 0, 100% 8%, 100% 92%, 84% 100%, 0 90%); opacity: 0.52; z-index: 8; }
.work-card:hover { filter: brightness(1.06); }
.work-card.is-hidden { pointer-events: none; opacity: 0; }

.card-art { position: relative; display: block; flex: 1; min-height: 0; overflow: hidden; background: linear-gradient(140deg, transparent 22%, rgba(255, 255, 255, 0.16) 22.5%, transparent 23%), linear-gradient(40deg, transparent 62%, rgba(255, 255, 255, 0.1) 62.5%, transparent 63%), var(--card-color); }
.card-art::before, .card-art::after { position: absolute; content: ""; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 50%; }
.card-art::before { width: 250px; height: 250px; left: -130px; top: 80px; }
.card-art::after { width: 320px; height: 320px; right: -182px; top: -90px; }
.art-orbit { position: absolute; display: block; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 50%; transform: rotate(-27deg); }
.orbit-one { width: 210px; height: 80px; top: 122px; left: 4px; }
.orbit-two { width: 250px; height: 90px; top: 178px; left: -15px; border-color: var(--card-accent); opacity: 0.62; }
.art-mark { position: absolute; left: 24px; bottom: 36px; color: var(--card-accent); font-family: var(--serif); font-size: 36px; letter-spacing: -0.08em; }
.art-index { position: absolute; top: 22px; right: 22px; color: rgba(255, 255, 255, 0.66); font-size: 11px; letter-spacing: 0.12em; }
.card-footer { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 14px 18px 16px; background: rgba(0, 0, 0, 0.12); }
.card-footer small, .card-footer strong { display: block; }
.card-footer small { margin-bottom: 6px; color: var(--card-accent); font-size: 10px; letter-spacing: 0.08em; }
.card-footer strong { max-width: 165px; font-size: 14px; line-height: 1.25; }
.card-arrow { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, 0.36); border-radius: 50%; font-size: 16px; }
.mobile-scroller { display: none; }

.stage-arrows { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-arrows button { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(23, 23, 23, 0.2); border-radius: 50%; background: rgba(243, 240, 234, 0.88); color: var(--ink); cursor: pointer; pointer-events: auto; box-shadow: 0 8px 24px rgba(51, 38, 23, 0.1); transition: background 180ms ease, color 180ms ease, transform 180ms ease; }
.stage-arrows button:hover { background: var(--ink); color: var(--paper); transform: scale(1.08); }

.carousel-controls { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 16px; }
.progress-dots { display: flex; gap: 0; align-items: center; }
.progress-dots button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.progress-dots button::after { width: 6px; height: 6px; border-radius: 50%; background: #c8c2b8; content: ""; transition: width 180ms ease, background 180ms ease; }
.progress-dots button.is-active::after { width: 28px; border-radius: 9px; background: var(--accent); }
.active-caption { display: grid; grid-template-columns: 82px minmax(180px, 0.7fr) minmax(260px, 1fr); flex: 0 0 auto; align-items: center; gap: 22px; max-width: 760px; margin: 11px auto 0; padding-top: 9px; border-top: 1px solid var(--line); }
.active-caption-title { font-size: 16px; font-weight: 700; }
.active-caption-description { color: var(--muted); font-size: 12px; line-height: 1.4; }
.usage-note { flex: 0 0 auto; margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 1100px) {
  .work-card--2 { transform: translate(calc(-50% - 340px), -50%) rotateY(52deg) scaleX(1.05) scaleY(0.98); }
  .work-card--1 { transform: translate(calc(-50% - 220px), -50%) rotateY(32deg) scaleX(1.03); }
  .work-card-1 { transform: translate(calc(-50% + 220px), -50%) rotateY(-32deg) scaleX(1.03); }
  .work-card-2 { transform: translate(calc(-50% + 340px), -50%) rotateY(-52deg) scaleX(1.05) scaleY(0.98); }
}

@media (max-width: 760px) {
  .topbar, .hero { width: calc(100% - 40px); }
  .topbar { padding: 18px 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 23px 0 9px; text-align: left; }
  .hero h1 { margin-top: 9px; font-size: clamp(2.1rem, 10vw, 3.5rem); }
  .works-section { width: 100%; padding: 8px 0 9px; }
  .section-heading { width: calc(100% - 40px); }
  .section-heading h2 { font-size: 1.85rem; }
  .section-note { max-width: 135px; font-size: 10px; line-height: 1.45; text-align: right; }
  .desktop-stage { display: none; }
  .mobile-scroller { display: flex; flex: 1 1 auto; align-items: center; min-height: 0; gap: 14px; overflow-x: auto; padding: 10px 20px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .mobile-scroller::-webkit-scrollbar { display: none; }
  .mobile-card { flex: 0 0 min(74vw, 290px); height: min(46svh, 330px); scroll-snap-align: center; box-shadow: 0 18px 35px rgba(51, 38, 23, 0.16); }
  .mobile-card:active { transform: scale(0.98); }
  .carousel-controls { min-height: 14px; }
  .active-caption { grid-template-columns: auto 1fr; gap: 10px; width: calc(100% - 40px); margin-top: 8px; padding-top: 8px; }
  .active-caption-description { display: none; }
  .usage-note { width: calc(100% - 40px); margin: 7px auto 0; white-space: nowrap; }
  .stage-arrows { display: none; }
}

/* 让卡片的顶部和底部共同形成连续的弧线：两侧更高、更宽，中间更短。 */
@media (min-width: 761px) {
  .desktop-stage { overflow: visible; }
  .desktop-stage::before {
    position: absolute;
    inset: 3% 3% 3%;
    content: "";
    border-top: 1px solid var(--accent-soft);
    border-bottom: 1px solid var(--accent-soft);
    border-radius: 50%;
    pointer-events: none;
  }
  .work-card { height: min(46vh, 430px); }
  .work-card--2 { width: 348px; height: min(57vh, 500px); transform: translate(calc(-50% - 430px), -50%) rotateY(56deg) scaleX(1.08) scaleY(0.98); }
  .work-card--1 { width: 288px; height: min(50vh, 460px); transform: translate(calc(-50% - 260px), -50%) rotateY(35deg) scaleX(1.05); }
  .work-card-0 { width: 252px; height: min(43vh, 385px); transform: translate(-50%, -50%) scale(1.04); }
  .work-card-1 { width: 288px; height: min(50vh, 460px); transform: translate(calc(-50% + 260px), -50%) rotateY(-35deg) scaleX(1.05); }
  .work-card-2 { width: 348px; height: min(57vh, 500px); transform: translate(calc(-50% + 430px), -50%) rotateY(-56deg) scaleX(1.08) scaleY(0.98); }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .work-card--2, .work-card-2 { width: 260px; height: min(57vh, 500px); }
  .work-card--1, .work-card-1 { width: 230px; height: min(50vh, 460px); }
  .work-card-0 { width: 210px; height: min(43vh, 385px); }
  .work-card--2 { transform: translate(calc(-50% - 300px), -50%) rotateY(52deg) scaleX(1.06) scaleY(0.98); }
  .work-card--1 { transform: translate(calc(-50% - 170px), -50%) rotateY(32deg) scaleX(1.03); }
  .work-card-1 { transform: translate(calc(-50% + 170px), -50%) rotateY(-32deg) scaleX(1.03); }
  .work-card-2 { transform: translate(calc(-50% + 300px), -50%) rotateY(-52deg) scaleX(1.06) scaleY(0.98); }
}

@media (max-width: 900px) and (min-width: 761px) {
  .work-card--2, .work-card-2 { width: 220px; height: min(57vh, 500px); }
  .work-card--1, .work-card-1 { width: 205px; height: min(50vh, 460px); }
  .work-card-0 { width: 190px; height: min(43vh, 385px); }
  .work-card--2 { transform: translate(calc(-50% - 230px), -50%) rotateY(46deg) scaleX(1.04) scaleY(0.98); }
  .work-card--1 { transform: translate(calc(-50% - 125px), -50%) rotateY(28deg) scaleX(1.02); }
  .work-card-1 { transform: translate(calc(-50% + 125px), -50%) rotateY(-28deg) scaleX(1.02); }
  .work-card-2 { transform: translate(calc(-50% + 230px), -50%) rotateY(-46deg) scaleX(1.04) scaleY(0.98); }
}

/* 参考图中的曲线关系：外侧卡片更高，中心卡片更短，形成平滑的 U 形上边缘和倒 U 形下边缘。 */
@media (min-width: 761px) {
  .work-card--2, .work-card--1, .work-card-0, .work-card-1, .work-card-2 { clip-path: none; }
  .work-card--2, .work-card-2 { height: min(57vh, 500px); }
  .work-card--1, .work-card-1 { height: min(49vh, 440px); }
  .work-card-0 { height: min(40vh, 360px); }
}

/* 视口比例：导航约占顶部 10%，卡片舞台固定占下方约 60%。 */
.portfolio-shell { height: 100svh; min-height: 520px; }
.topbar { height: 10vh; min-height: 58px; padding: 0; }
.hero { height: 7vh; min-height: 46px; padding: 0; display: flex; align-items: center; justify-content: center; gap: 15px; }
.hero .eyebrow { margin: 0; }
.hero-compact { margin: 0; font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 2.1rem); letter-spacing: -0.06em; }
.hero-compact em { color: var(--accent); font-style: italic; }
.works-section { flex: 0 0 83vh; height: 83vh; padding: 0 0 1vh; }
.section-heading { flex: 0 0 6vh; min-height: 44px; padding-bottom: 8px; }
.section-heading > div { display: flex; align-items: baseline; gap: 14px; }
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2.35rem); }
.section-heading .section-kicker { margin: 0; }
.desktop-stage { flex: 0 0 60vh; height: 60vh; min-height: 0; margin: 0; }
.work-card { height: min(58vh, 540px); }
.carousel-controls { min-height: 13px; }
.active-caption { margin-top: 7px; padding-top: 7px; }
.usage-note { margin-top: 5px; }

@media (max-width: 1100px) and (min-width: 761px) {
  .work-card--2, .work-card-2 { width: 260px; }
  .work-card--1, .work-card-1 { width: 230px; }
  .work-card-0 { width: 210px; }
  .work-card--2 { transform: translate(calc(-50% - 300px), -50%) rotateY(52deg) scaleX(1.06) scaleY(0.98); }
  .work-card--1 { transform: translate(calc(-50% - 170px), -50%) rotateY(32deg) scaleX(1.03); }
  .work-card-1 { transform: translate(calc(-50% + 170px), -50%) rotateY(-32deg) scaleX(1.03); }
  .work-card-2 { transform: translate(calc(-50% + 300px), -50%) rotateY(-52deg) scaleX(1.06) scaleY(0.98); }
}

@media (max-width: 760px) {
  .topbar { height: 10svh; min-height: 54px; }
  .hero { height: 8svh; min-height: 48px; display: block; padding-top: 10px; }
  .hero .eyebrow { font-size: 9px; }
  .hero-compact { margin-top: 7px; font-size: clamp(1.3rem, 7vw, 2.1rem); }
  .works-section { flex: 0 0 82svh; height: 82svh; padding: 0 0 1svh; }
  .section-heading { flex-basis: 7svh; min-height: 46px; }
  .section-heading h2 { font-size: 1.8rem; }
  .mobile-scroller { flex: 0 0 56svh; height: 56svh; padding: 8px 20px 10px; scroll-padding-inline: 20px; overscroll-behavior-x: contain; }
  .mobile-card { height: min(52svh, 350px); }
  .carousel-controls { flex-basis: 3svh; }
  .active-caption { flex-basis: 5svh; min-height: 34px; }
  .usage-note { margin-top: 3px; }
  .palette-option { width: 30px; height: 30px; justify-content: center; padding: 0; }
  .palette-option-label { display: none; }
}

/* 交互优化：明确的焦点状态、稳定的触控反馈，以及不依赖 hover 的访问路径。 */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .work-card:hover { filter: brightness(1.06); }
}

@media (hover: none) {
  .work-card:hover { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 分类入口与作品介绍保持紧凑，让选择和内容始终贴近卡片舞台。 */
.section-heading-main { display: flex; align-items: baseline; gap: 18px; min-width: 0; }
.section-heading-copy { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.category-shortcuts { display: flex; align-items: center; gap: 3px; }
.topbar { justify-content: flex-start; }
.topbar-categories { margin-left: 18px; }
.topbar .nav-links { margin-left: auto; }
.topbar .palette-switcher { margin-left: 18px; }
.topbar .contact-link { margin-left: 24px; }
.category-shortcuts button { min-height: 28px; padding: 4px 10px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; letter-spacing: 0.05em; transition: background 180ms ease, border-color 180ms ease, color 180ms ease; }
.category-shortcuts button:hover { border-color: var(--line); color: var(--ink); }
.category-shortcuts button.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }

.active-caption--top { margin: 0 auto 7px; padding-top: 0; padding-bottom: 7px; border-top: 0; border-bottom: 1px solid var(--line); }


.card-image { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; }
.card-art.has-image::before, .card-art.has-image::after { z-index: 1; }
.art-orbit, .art-mark, .art-index { z-index: 2; }

@media (max-width: 760px) {
  .topbar { justify-content: flex-start; gap: 0; }
  .topbar-categories { margin-left: 10px; }
  .topbar .nav-links, .topbar .palette-switcher { display: none; }
  .topbar .contact-link { margin-left: auto; }
  .section-heading { align-items: flex-start; }
  .section-heading-main { flex-direction: column; align-items: flex-start; gap: 5px; }
  .section-heading-copy { gap: 10px; }
  .category-shortcuts button { min-height: 26px; padding-inline: 8px; }
  .active-caption--top { margin-top: 0; margin-bottom: 6px; padding-bottom: 6px; }
  .active-caption--top .active-caption-description { display: block; grid-column: 1 / -1; font-size: 10px; line-height: 1.25; }
}

/* 图片区域保持原图 3:4 比例，卡片底部信息区单独计算高度。 */
.card-art {
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
}

@media (min-width: 761px) {
  .work-card {
    height: auto;
  }
}

@media (max-width: 760px) {
  .mobile-card {
    height: auto;
    flex-basis: min(74vw, 290px, calc((56svh - 84px) * 0.75));
  }
}
