/* ============================================
   Rock Wu 作品集 — 設計系統
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
  --bg:         #2B2B2B;
  --text:       #FFFFFF;
  --accent:     #FFD68A;
  --muted:      rgba(255, 255, 255, 0.5);
  --purple:     #7145CE;
  --section-bg: rgba(255, 255, 255, 0.05);
  --font:       "PingFang TC", "Noto Sans TC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ── 液態流動背景 ──────────────────────────── */
.gradient-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform, opacity;
}

.orb-1 {
  width: 600px;
  height: 600px;
  bottom: -200px;
  left: 0%;
  background: radial-gradient(circle, rgba(113, 69, 206, 0.60) 0%, rgba(113, 69, 206, 0) 70%);
  animation: liquid1 16s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.orb-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -5%;
  background: radial-gradient(circle, rgba(255, 214, 138, 0.26) 0%, rgba(255, 214, 138, 0) 70%);
  animation: liquid2 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.orb-3 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: 35%;
  background: radial-gradient(circle, rgba(113, 69, 206, 0.22) 0%, rgba(113, 69, 206, 0) 70%);
  animation: liquid3 24s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes liquid1 {
  0%   { transform: translate(0, 0)        scale(1);    opacity: 0.84; }
  20%  { transform: translate(60px, -70px) scale(1.12); opacity: 1;    }
  40%  { transform: translate(100px, -30px) scale(0.92); opacity: 0.72; }
  60%  { transform: translate(40px, -90px) scale(1.08); opacity: 1;    }
  80%  { transform: translate(-20px, -50px) scale(1.05); opacity: 0.90; }
  100% { transform: translate(0, 0)        scale(1);    opacity: 0.84; }
}

@keyframes liquid2 {
  0%   { transform: translate(0, 0)          scale(1);    opacity: 0.72; }
  25%  { transform: translate(-80px, -60px)  scale(1.15); opacity: 1;    }
  50%  { transform: translate(-40px, -100px) scale(0.9);  opacity: 0.60; }
  75%  { transform: translate(-100px, -40px) scale(1.1);  opacity: 0.96; }
  100% { transform: translate(0, 0)          scale(1);    opacity: 0.72; }
}

@keyframes liquid3 {
  0%   { transform: translate(0, 0)         scale(1);    opacity: 0.60; }
  33%  { transform: translate(-60px, -80px) scale(1.2);  opacity: 0.96; }
  66%  { transform: translate(80px, -40px)  scale(0.85); opacity: 0.48; }
  100% { transform: translate(0, 0)         scale(1);    opacity: 0.60; }
}

.orb-4 {
  width: 420px;
  height: 420px;
  top: 5%;
  right: 15%;
  background: radial-gradient(circle, rgba(255, 90, 30, 0.54) 0%, rgba(255, 90, 30, 0) 70%);
  animation: liquid4 19s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

@keyframes liquid4 {
  0%   { transform: translate(0, 0)          scale(1);    opacity: 0.36; }
  15%  { transform: translate(-50px, 60px)   scale(1.18); opacity: 0.84; }
  35%  { transform: translate(70px, 30px)    scale(0.88); opacity: 0.30; }
  55%  { transform: translate(-30px, 90px)   scale(1.12); opacity: 0.72; }
  75%  { transform: translate(60px, -20px)   scale(0.95); opacity: 0.48; }
  90%  { transform: translate(-40px, 50px)   scale(1.08); opacity: 0.66; }
  100% { transform: translate(0, 0)          scale(1);    opacity: 0.36; }
}

/* ── 版面 ─────────────────────────────────── */
.page-content { position: relative; z-index: 1; padding-top: 50px; }

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
}

/* ── Header ───────────────────────────────── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 50px;
  background: #000;
  transition: background 0.4s ease, backdrop-filter 0.4s, transform 0.3s ease;
}

/* 手機：下滑收合、上滑展開 */
header.header-hidden { transform: translateY(-100%); }

header.scrolled {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  /* SVG 原本是白色 path，在黑色 header 上直接顯示 */
}

.header-right {
  display: flex;
  align-items: center;
  gap: 36px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: opacity 0.25s;
  position: relative;
}

.header-nav a:hover { opacity: 0.55; }

.header-nav a.active { opacity: 1; }

/* 當前頁面 — 紫色光暈 indicator */
.header-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 100px;
  background: var(--purple);
  box-shadow:
    0 0 6px 3px rgba(113, 69, 206, 0.9),
    0 0 16px 8px rgba(113, 69, 206, 0.5),
    0 0 32px 14px rgba(113, 69, 206, 0.2);
}

.lang-toggle {
  display: flex;
  align-items: center;
  height: 29px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  cursor: pointer;
  user-select: none;
}

.lang-toggle span {
  padding: 4px 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  border-radius: 100px;
  line-height: 21px;
  transition: background 0.25s, color 0.25s;
}

.lang-toggle span.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

/* ── Footer ───────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.2);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-nav { display: flex; gap: 48px; }

.footer-nav a {
  font-size: 16px;
  color: var(--text);
  transition: opacity 0.2s;
}

.footer-nav a:hover { opacity: 0.65; }

.footer-contact { display: flex; flex-direction: column; gap: 6px; }

.footer-contact-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.footer-contact a {
  font-size: 16px;
  color: var(--text);
  transition: opacity 0.2s;
}

.footer-contact a:hover { opacity: 0.65; }

/* ── 區塊標籤（小金字）─────────────────────── */
.section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Case Study 區塊 ──────────────────────── */
#case-study {
  background: var(--section-bg);
  padding: 80px 0 88px;
}

#case-study h1,
#work h1 {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
}

/* 破格手機向下延伸，手機突出卡片約 70px，再留 48px = 最少 118px */
#case-study { padding-bottom: 130px; }

/* Case Study 卡片格線（破格設計：手機向下突破卡片邊界）*/
.cs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  overflow: visible;
}

.cs-card {
  position: relative;
  aspect-ratio: 484 / 336;   /* 設計稿比例 */
  border-radius: 5px;
  overflow: visible;         /* 允許手機突破下邊界 */
  display: block;
}

/* 卡片內容容器（裁切背景 + overlay）*/
.cs-card-inner {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  overflow: hidden;
  transition: border-radius 0.52s ease, box-shadow 0.52s ease;
}

.cs-card:hover .cs-card-inner {
  border-radius: 0;
  box-shadow:
    0 8px 24px  rgba(113, 69, 206, 0.40),
    0 16px 50px rgba(113, 69, 206, 0.22),
    0 24px 80px rgba(113, 69, 206, 0.10);
}

.cs-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.cs-card:hover .cs-card-bg {
  transform: scale(1.05);
}

.cs-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

/* 手機破格：頂端距卡片頂端 15%，向下突破底部 */
.cs-card-phone {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 36%;
  height: auto;
  object-fit: contain;
  object-position: top center;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.5s ease;
}

.cs-card:hover .cs-card-phone {
  transform: translateY(6px);
}

.cs-card-content {
  position: absolute;
  bottom: 28px;
  left: 28px;
  right: 48%;   /* 保留右側手機空間（手機 36% + right 10% + 邊距）*/
  z-index: 4;
}

.cs-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-outline {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--muted);
  border-radius: 100px;
  padding: 4px 14px;
}

.cs-card-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.cs-card-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

/* ── Works 區塊 ───────────────────────────── */
#work { padding: 72px 0 88px; }

#work h1 { margin-bottom: 40px; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.work-card {
  position: relative;
  aspect-ratio: 323 / 232;
  border-radius: 5px;
  overflow: hidden;
  display: block;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: box-shadow 0.52s ease, border-radius 0.52s ease;
}

.work-card:hover {
  border-radius: 0;
  box-shadow:
    0 8px 24px  rgba(113, 69, 206, 0.40),
    0 16px 50px rgba(113, 69, 206, 0.22),
    0 24px 80px rgba(113, 69, 206, 0.10);
}

.work-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.work-card:hover .work-card-bg {
  transform: scale(1.05);
}

/* 底部局部遮罩 */
.work-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 83px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Mockup 圖片 */
.work-card-mockup {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 112%;
  width: auto;
  object-fit: contain;
  object-position: bottom right;
  z-index: 1;
  pointer-events: none;
}

/* 雙 mockup 卡片：後排偏左 */
.work-card-mockup-back {
  right: 28%;
  opacity: 0.9;
}

.work-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  z-index: 2;
}

.work-card-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.work-card-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

/* ── Lightbox ─────────────────────────────── */
.lightbox-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  padding: 24px;
}

.lightbox-backdrop.open { display: flex; }

.lightbox {
  background: #3A3A3A;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: lightboxIn 0.25s ease;
}

@keyframes lightboxIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 封面圖（含 tags 疊加） */
.lightbox-cover-wrap {
  position: relative;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.lightbox-cover {
  width: 100%;
  aspect-ratio: 480 / 326;
  object-fit: cover;
  display: block;
}

/* 封面底部黑色漸層遮罩 */
.lightbox-cover-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Tags + 標題 疊在封面左下角 */
.lightbox-cover-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 20px 20px;
  z-index: 2;
}

.lightbox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lightbox-tag {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 100px;
  padding: 4px 12px;
  backdrop-filter: blur(4px);
}

/* 關閉按鈕 */
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(0, 0, 0, 0.75); }

.lightbox-close img { width: 20px; height: 20px; }

/* 標題、副標題（疊在封面圖上） */
.lightbox-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  line-height: 1.2;
}

.lightbox-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0;
}

/* 內容區 */
.lightbox-body {
  padding: 20px 20px 28px;
}

/* 角色 / 執行 */
.lightbox-meta {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0 24px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.lightbox-meta-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}

/* 關鍵數據 / 說明 / 連結 */
.lightbox-section {
  margin-bottom: 16px;
}

.lightbox-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.lightbox-section-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.65;
}

.lightbox-link {
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--muted);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

.lightbox-link:hover { color: var(--text); border-color: var(--text); }

/* ── Go-to-top ────────────────────────────── */
#go-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  pointer-events: none;
}

#go-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#go-to-top:hover { background: rgba(255, 255, 255, 0.65); }

/* ── Scroll 淡入 ──────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.cs-grid    .fade-in:nth-child(2) { transition-delay: 0.1s; }
.works-grid .fade-in:nth-child(2) { transition-delay: 0.08s; }
.works-grid .fade-in:nth-child(3) { transition-delay: 0.16s; }
.works-grid .fade-in:nth-child(4) { transition-delay: 0.06s; }
.works-grid .fade-in:nth-child(5) { transition-delay: 0.14s; }
.works-grid .fade-in:nth-child(6) { transition-delay: 0.22s; }

/* ── About 頁面 ───────────────────────────── */
.about-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 80px;
  padding: 80px 0 100px;
}

.about-left {
  position: sticky;
  top: 130px; /* header(50px) + about-layout padding-top(80px) → 剛好等於起始位置，不移動 */
  align-self: start;
}

.about-greeting {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.about-name {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);   /* 名字用 accent 金色 */
  margin-bottom: 20px;
}

.about-tagline {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 40px;
}

.contact-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);   /* Contact 標籤用 accent */
  margin-bottom: 8px;
}

.contact-links { display: flex; flex-direction: column; gap: 10px; }

.contact-links a {
  font-size: 16px;
  color: var(--text);
  transition: opacity 0.2s;
}

.contact-links a {
  text-decoration: underline;
}

.contact-links a:hover { opacity: 0.65; }

.contact-location {
  font-size: 16px;
  color: var(--text);
}

.resume-label {
  margin-top: 32px;
}

/* 右欄 */
.about-right {
  padding-top: 0;
  padding-left: 48px;
  max-width: 600px;
}

/* About me 段落 */
.about-me-section { margin-bottom: 48px; }

/* 小標籤（About me / Experience heading）*/
.section-heading-sm {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.about-me-section p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}

.about-me-section p:last-child { margin-bottom: 0; }

/* Experience */
.experience-section { margin-bottom: 0; }

.exp-entry {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.exp-entry:last-child { border-bottom: none; }

.exp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.exp-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* 公司名稱 + 職位/年份同行 */
.exp-company-line {
  margin-bottom: 8px;
  line-height: 1.4;
}

.exp-company {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.exp-role-date {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}

.exp-bullets { display: flex; flex-direction: column; gap: 6px; }

.exp-bullets li {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  padding-left: 14px;
  position: relative;
  line-height: 1.55;
}

.exp-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* 展開按鈕 */
.exp-expand-btn {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  transition: color 0.2s;
}

.exp-expand-btn:hover { color: var(--text); }

.exp-hidden {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.55s ease;
}

.exp-hidden.open { max-height: 1000px; }

.exp-hidden .exp-entry:first-child { margin-top: 36px; }

/* ── Case Study 內頁 ──────────────────────── */

/* Hero 外層 wrap：margin-top -50px 延伸至 header 下方，height 補回 50px 保持可見高度不變 */
.cs-hero-wrap {
  position: relative;
  margin-top: -50px;
  height: calc(70vh + 50px);
  z-index: 2;
  display: flex;
  align-items: flex-end;
}

/* 背景裁切層（只裁 bg + overlay）*/
.cs-hero {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.cs-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  transform: scale(1.05);
}

.cs-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

/* 主手機（右側）：從 wrap 頂端延伸，破出底部 */
.cs-hero-phone {
  position: absolute;
  top: 10%;
  right: 10%;
  height: 112%;
  width: auto;
  z-index: 5;
  pointer-events: none;
}

/* 副手機（左側）：稍低起點，與主手機有重疊 */
.cs-hero-phone-secondary {
  position: absolute;
  top: 16%;
  right: 24%;
  height: 96%;
  width: auto;
  z-index: 4;
  pointer-events: none;
  opacity: 0.92;
}

/* 1000px 內容容器：phones + 文字皆受此約束，bg 仍全寬 */
.cs-hero-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
}

/* hero 底部內容：tags → subtitle → title（meta 已移出）*/
.cs-hero-content {
  position: relative;
  z-index: 3;
  padding: 0 40px 32px;
  max-width: 55%;
}

/* Role / Team / Release 獨立區塊 */
.cs-info {
  position: relative;
  z-index: 1;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cs-info-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 48px 48px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.cs-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cs-hero-sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.cs-hero-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 28px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Role / Team / Release（hero 底部分隔線後）*/
.cs-hero-meta {
  display: grid;
  grid-template-columns: 200px auto auto;
  gap: 0 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.cs-hero-meta-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

.cs-hero-meta-value {
  font-size: 16px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.8;
}

.cs-hero-meta-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-hero-meta-list li {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
  padding-left: 12px;
  position: relative;
  line-height: 1.6;
}

.cs-hero-meta-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* 主要內容容器 */
.cs-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 48px 120px;
}

/* 通用段落區塊 */
.cs-section {
  margin-bottom: 80px;
}

.cs-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
}

.cs-section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 24px;
}

.cs-section p {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.85;
  margin-bottom: 20px;
}

.cs-section p:last-child { margin-bottom: 0; }

/* 強制讓 section label 顏色不被 .cs-section p 覆蓋（提升 specificity）*/
.cs-section p.cs-section-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 12px;
}

/* accent inline span */
.accent { color: var(--accent); }

/* 段落窄版：限制直接子層文字寬度並置中 */
.cs-section--narrow > p,
.cs-section--narrow > h2 {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* stats row 與 focus tags 也縮進置中 */
.cs-section--narrow > .cs-stats-row {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.cs-section--narrow > .cs-focus-tags {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
}

/* 兩欄通用 grid */
.cs-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

/* 三欄通用 grid */
.cs-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* 圖文兩欄：圖右較窄 */
.cs-row-2-img-right  { grid-template-columns: 3fr 2fr; }
/* 圖文兩欄：圖左較窄（1:2） */
.cs-row-2-img-left   { grid-template-columns: 1fr 2fr; }

/* 設計重點 pill 標籤 */
.cs-focus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 0;
}

.cs-focus-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 18px;
}

/* 研究數字 4 格 */
.cs-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 28px 0 0;
}

.cs-stat-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cs-stat-box-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.4;
}

/* 付款流程比較 */
.cs-flow-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
}

.cs-flow-col-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 16px;
}

.cs-flow-col-label-accent {
  color: var(--accent);
  border-color: var(--accent);
}

.cs-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-flow-step {
  font-size: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 16px;
  text-align: center;
}

.cs-flow-step.removed {
  color: rgba(255, 90, 80, 0.9);
  background: rgba(220, 50, 50, 0.12);
  border: 1px solid rgba(255, 80, 70, 0.35);
}

.cs-flow-step.new {
  color: var(--accent);
  background: rgba(255, 214, 138, 0.1);
  border: 1px solid rgba(255, 214, 138, 0.3);
}

/* 流程圖步驟之間的箭頭（獨立 div 避免 ::before 跑進 box 內）*/
.cs-flow-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 4px 0;
  flex-shrink: 0;
}

/* 流程圖 + 右側手機截圖：流程兩欄合佔 1/3，截圖佔 2/3 */
.cs-flow-with-screens {
  display: grid;
  grid-template-columns: 1fr 1fr 4fr;
  gap: 24px;
  align-items: start;
  margin-top: 32px;
}
.cs-flow-screens {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.cs-flow-screens img {
  flex: 1;
  width: 0;
  min-width: 0;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  border-radius: 16px;
}

/* Stat icon */
.cs-stat-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  display: block;
}

/* 保密聲明（footer 上方置中）*/
.cs-disclaimer {
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  padding: 24px 16px 40px;
}

/* App Store / Google Play 徽章 */
.cs-store-badges {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.cs-store-badges img {
  height: 36px;
  width: auto;
}

/* Result 裝飾 icon（coin/wine）*/
.cs-metric-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  margin-bottom: 0;
}

/* Result 區塊：左（深色卡片）+ 右（反思文字）兩欄 */
.cs-result-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 64px;
  align-items: start;
}

/* 卡片內標題（比 cs-section-title 小）*/
.cs-result-card .cs-section-title {
  font-size: 24px;
  margin-bottom: 0;
}

/* 左欄：深色卡片 */
.cs-result-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 28px 28px 32px;
}

/* 卡片內：裝飾圖片 + 數字堆疊 */
.cs-result-inner {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 24px;
}

.cs-result-deco {
  width: 160px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.cs-metric-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-metric-item {
  text-align: center;
}

.cs-metric-num {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.cs-metric-context {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 6px;
  line-height: 1.5;
}

/* 台電 V1 亮點 — 整體深色卡片容器 */
.cs-v1-wrapper {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 28px 32px 32px;
  margin-top: 24px;
}

/* 台電 V1 亮點卡片 */
.cs-v1-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cs-v1-card {
  background: none;
  border-radius: 0;
  padding: 0;
}

.cs-v1-card .cs-v1-card-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 36px 0;
  margin: 0;
}

.cs-v1-card-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin-bottom: 16px;
}

.cs-v1-card p:not(.cs-v1-card-title) {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
  text-align: center;
}

/* 台電 V1 上線後成長 */
.cs-v1-result {
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 28px 0 0;
  text-align: center;
}

.cs-v1-result-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 16px;
  text-align: center;
}

.cs-v1-result .cs-v1-result-line {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
}

.cs-v1-but {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 20px;
  text-align: center;
}

/* 台電 Problem 兩欄 */
.cs-problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.cs-problem-item {
  margin-bottom: 32px;
}

.cs-problem-item:last-child { margin-bottom: 0; }

.cs-problem-item .cs-problem-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

/* 台電 設計重點（右欄 pill 標籤）*/
.cs-focus-pills {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-focus-pill {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 20px;
  display: block;
}

/* 台電設計區：圖 + 圖示 + 文字 */
.cs-design-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  margin-bottom: 80px;
}

.cs-design-row-reverse { direction: rtl; }
.cs-design-row-reverse > * { direction: ltr; }

.cs-design-phone {
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

.cs-design-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 20px;
  display: block;
}

.cs-design-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

/* 兩支手機交疊（連續登入區塊） */
.cs-phones-overlap {
  position: relative;
  height: 580px;
}
.cs-phone-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  border-radius: 20px;
  z-index: 1;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.cs-phone-front {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 240px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

.cs-design-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 16px;
}

.cs-design-body {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
}

.cs-design-level-icons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

/* 台電 result 4 大數字 */
.cs-section--result-bg {
  position: relative;
  padding-top: 48px;
  padding-bottom: 48px;
}
.cs-section--result-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  z-index: 0;
}
.cs-section--result-bg > * {
  position: relative;
  z-index: 1;
}

/* 窄版內容容器（800px），用於台電 case study */
.cs-content--narrow {
  max-width: 900px;
}

/* 讓特定區塊突破 800px 限制，擴展至 1200px */
.cs-section--breakout {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, calc(100vw - 48px));
}

.cs-result-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-top: 24px;
}

.cs-result-4 > div {
  text-align: center;
}

.cs-result-4 .cs-result-4-num {
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.cs-result-4 .cs-result-4-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.1;
  margin: 0;
}

/* 圖片通用 */
.cs-img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

/* 比較兩欄（V1 vs V2）等寬 */
.cs-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}

.cs-compare-grid .cs-img {
  width: 100%;
  height: 420px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.cs-compare-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 12px;
}

.cs-compare-label-accent {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── RWD ──────────────────────────────────── */
@media (max-width: 1100px) {
  .container    { padding: 0 48px; }
  .header-inner { padding: 0 48px; }
  .footer-inner { padding: 0 48px; }
  .cs-grid      { gap: 20px; }
  .cs-hero-content  { padding: 0 48px 36px; }
  .cs-info-inner    { padding: 32px 48px; gap: 32px; }
  .cs-content       { padding: 60px 48px 80px; }
  .cs-metrics-4     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .container    { padding: 0 32px; }
  .header-inner { padding: 0 32px; }
  .footer-inner { padding: 0 32px; }

  .cs-grid    { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: repeat(2, 1fr); }

  .about-layout {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 60px 0;
  }
  .about-left  { position: static; text-align: center; }
  .about-right { padding-left: 0; max-width: 100%; }
  .contact-links { justify-content: center; }

  /* Case Study 內頁 RWD */
  .cs-hero-wrap         { height: calc(65vh + 50px); }
  .cs-hero-phone        { height: 112%; right: 10%; top: 10%; }
  .cs-hero-phone-secondary { height: 96%; right: 24%; top: 16%; }
  .cs-hero-content      { padding: 0 24px 28px; }
  .cs-info-inner        { padding: 36px 24px 40px; gap: 16px; }
  .cs-content           { padding: 48px 24px 60px; }
  .cs-row-2, .cs-row-2-img-right, .cs-row-2-img-left { grid-template-columns: 1fr; gap: 40px; }
  .cs-compare-grid      { grid-template-columns: 1fr; }
  .cs-design-row        { grid-template-columns: 1fr; }
  .cs-phones-overlap    { height: 380px; }
  .cs-result-row        { grid-template-columns: 1fr; gap: 48px; }
  .cs-result-4          { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .cs-v1-wrapper        { padding: 20px 16px 24px; }
  .cs-v1-grid           { grid-template-columns: 1fr; }
  .cs-problem-grid      { grid-template-columns: 1fr; gap: 40px; }
  .cs-flow-compare      { grid-template-columns: 1fr; }
  .cs-flow-with-screens { grid-template-columns: 1fr 1fr; }
  .cs-flow-screens      { display: none; }
}

/* ── Mobile Menu Button ───────────────────── */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ── Mobile Menu Overlay ─────────────────── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 200;
  flex-direction: column;
}
.mobile-menu.open { display: flex; }

.mobile-menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 50px;
  flex-shrink: 0;
}
.mobile-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-close img { width: 20px; height: 20px; }

.mobile-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow-y: auto;
}
.mobile-nav a {
  display: block;
  padding: 20px 24px;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s;
}
.mobile-nav a.active {
  color: var(--text);
  border-left: 3px solid var(--purple);
  padding-left: 21px;
}

.mobile-menu-bottom {
  padding: 24px 20px;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .container    { padding: 0 20px; }
  .header-inner { padding: 0 20px; }
  .footer-inner { padding: 20px; height: auto; flex-direction: column; gap: 24px; }
  .header-right { display: none; }
  .menu-btn     { display: flex; }

  #case-study h1,
  #work h1,
  .about-greeting,
  .about-name   { font-size: 36px; }

  .works-grid   { grid-template-columns: 1fr; }
  /* aspect-ratio 搭配固定 height 會算出過寬的 width，強制 100% 修正靠右偏移 */
  .cs-card      { height: 260px; width: 100%; aspect-ratio: auto; }
  /* phone mockup 維持桌面版右側定位關係 */
  .cs-card-phone { width: 30%; top: 15%; right: 10%; transform: none; }
  .cs-card:hover .cs-card-phone { transform: translateY(6px); }
  .cs-card-content { right: 48%; }
  .lightbox-body { padding: 18px 20px 24px; }
  .lightbox-title { font-size: 22px; }

  /* Case Study 內頁 small RWD */
  .cs-hero-wrap         { height: calc(55vh + 50px); min-height: 350px; }
  .cs-hero-title        { font-size: 32px; }
  .cs-hero-phone        { height: 110%; right: 8%; top: 10%; }
  .cs-hero-phone-secondary { display: none; }
  .cs-hero-content      { padding: 0 16px 20px; max-width: 55%; }
  .cs-info-inner        { flex-direction: column; align-items: flex-start; padding: calc(12vh + 16px) 20px 32px; gap: 20px; }
  .cs-content           { padding: 36px 16px 48px; }
  .cs-result-row        { gap: 36px; }
  .cs-result-inner      { flex-direction: column; }
  .cs-result-deco       { width: 80px; }
  .cs-section-title     { font-size: 24px; }
  .cs-result-4          { grid-template-columns: repeat(2, 1fr); }
  .cs-result-4 .cs-result-4-num { font-size: 36px; }
  .cs-metric-num        { font-size: 48px; }
  .cs-v1-result-line    { font-size: 18px; }
  .cs-stats-row         { grid-template-columns: repeat(2, 1fr); }
}
