:root{
  --bg: #f5f2f3;
  --card: rgba(255,255,255,.7);
  --card-strong: rgba(255,255,255,.9);
  --text: #1e1e1e;
  --muted: rgba(0,0,0,.5);
  --border: rgba(0,0,0,.08);
  --shadow: 0 18px 50px rgba(0,0,0,.12);
  --shadow-soft: 0 12px 35px rgba(0,0,0,.10);
  --radius: 18px;
  --accent: #ff4d4f;
  --accent-2: #ff7a7d;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, "Noto Sans TC", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% 0%, rgba(255,120,125,.35), rgba(255,120,125,0) 60%),
              linear-gradient(180deg, #f6f2f3, #f0f0f2);
}

.app{ max-width: 1320px; margin: 0 auto; padding: 18px 18px 26px; }

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap: 14px;
  padding: 8px 2px 18px;
}
.brand{ display:flex; align-items:center; gap: 10px; }
.dot{ width:22px; height:22px; border-radius: 999px; background:#2b2b2b; }
.brand-text{ font-weight:700; letter-spacing:.2px; }

.segmented{
  display:flex; gap: 6px;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
}
.seg{
  border:0; background:transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight:600;
  color: rgba(0,0,0,.55);
  cursor:pointer;
}
.seg.is-active{
  background: rgba(255,255,255,.95);
  color: #111;
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
}

.grid{
  display:grid;
  grid-template-columns: 240px 1fr 360px;
  gap: 18px;
  align-items:stretch;
}

.panel{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  overflow:hidden;
}

.left{ padding: 16px; display:flex; flex-direction:column; }
.pose-list{ display:flex; flex-direction:column; gap: 10px; padding: 6px; }

.pose{
  border:1px solid transparent;
  background: rgba(255,255,255,.75);
  padding: 14px 14px;
  border-radius: 14px;
  text-align:left;
  font-weight:600;
  color: rgba(0,0,0,.75);
  cursor:pointer;
  display:flex; align-items:center; gap: 10px;
}
.pose .radio{
  width:14px; height:14px; border-radius: 999px;
  border: 2px solid rgba(255,77,79,.35);
  position:relative;
  background: rgba(255,255,255,.9);
}
.pose.is-active{
  border-color: rgba(255,77,79,.22);
  box-shadow: 0 12px 22px rgba(0,0,0,.06);
}
.pose.is-active .radio::after{
  content:"";
  position:absolute; inset:3px;
  border-radius:999px;
  background: var(--accent);
}

.left-bottom{ margin-top:auto; padding: 10px 6px 2px; }

.stage-card{
  background: var(--card-strong);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
  min-height: 560px;
  display:flex;
  flex-direction:column;
}
.stage-inner{
  flex:1;
  padding: 26px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  position: relative;
  overflow: hidden; /* ✅ 讓裁切在舞台做，不在 character 做 */
}
/*.stage-inner::before{
  content:"";
  position:absolute;
  inset:-160px -180px auto -180px;
  height: 520px;
  background: radial-gradient(240px 240px at 50% 50%, rgba(255,77,79,.14), rgba(255,77,79,0) 70%);
  pointer-events:none;
}*/

.character{
  position: relative;
  width: 450px;
  aspect-ratio: 1 / 1.8;          /* ✅ 這是你原本 720x440 的概念，但更彈性 */
  border-radius: 22px;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 20px 40px rgba(0,0,0,.10);
  overflow: visible;              /* ✅ 不要在這裡裁切，避免切腳 */
  transform: translateY(0px);
  transition: transform .22s ease;
}

.layer{
  position:absolute;
  left: 50%;
  top: 15%;
  width: 100%;        /* ✅ 關鍵：基準寬跟容器走 */
  max-width: 100%;    /* ✅ 你想要的做法 */
  height: auto;
  transform-origin: 50% 50%;
  user-select:none;
  pointer-events:none;
  will-change: transform, opacity;
}

.layer-head{ z-index: 40; }
.layer-legs{ z-index: 10; }
.layer-body{ z-index: 20; }
.layer-acc { z-index: 30; }

.character.head-behind .layer-head{ z-index: 40; } /* 頭在後 */




.cta{
  border:0;
  margin: -10px auto 18px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight:700;
  color:#fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 26px rgba(255,77,79,.25);
  cursor:pointer;
}

.right{ padding: 16px; }

.panel-head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 12px;
}
.title{ font-size: 20px; font-weight: 800; }

.group{ margin-top: 12px; }
.group-title{
  font-size: 13px;
  font-weight: 800;
  color: rgba(0,0,0,.6);
  margin: 10px 2px 8px;
}

.carousel{
  display:flex; 
  gap: 10px;
  align-items: stretch;
}

.car-btn{
  width: 58px;
  height: 58px;
  border-radius: 16px;
  border: 0;
  background: #ff2d2d; /* 更鮮豔的紅 */
  color: #fff;         /* icon 白色 */
  font-size: 22px;
  font-weight: 900;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow: 0 12px 22px rgba(255,45,45,.22);
}

.car-btn:hover{ filter: brightness(1.03); }
.car-btn:active{ transform: translateY(1px); }

.car-btn:disabled{
  opacity: .35;
  cursor: not-allowed;
  box-shadow: none;
}
.car-viewport{
  flex:1;
  border-radius: 14px;
}
.track{
  display:flex;
  gap: 0;
  align-items: stretch;
  padding: 0;
  transform: translateX(0px);
  transition: transform .12s ease;

}
.thumb{
  flex: 0 0 100%;
  width: 100%;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.92);
  cursor:pointer;
  overflow:hidden;
  padding: 8px 10px;
  display:flex;
  align-items:center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 18px rgba(0,0,0,.08);
}
.thumb img{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display:block;
}

.thumb-wide{
  width: 100%;
  height: 58px;           /* 跟你的 car-btn 一樣高就很像參考站 */
  border-radius: 16px;
}

.thumb-wide img{
  width: 100%;
  height: 100%;
  object-fit: contain;     /* 保留完整造型，不要切到 */
}

/* 可選：加一個文字位（如果你沒有文字也沒關係） */
.thumb .label{
  font-weight: 800;
  color: rgba(0,0,0,.7);
  font-size: 13px;
}
.thumb.is-active{
  border-color: transparent;
  box-shadow: 0px 4px 20px rgba(255, 77, 79, .14);
}


.divider{
  height:1px;
  background: rgba(0,0,0,.08);
  margin: 14px 0;
}

.tuning-title{
  font-weight: 800;
  margin-bottom: 10px;
}

.chips{ display:flex; gap: 8px; margin-bottom: 10px; }
.chip{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.82);
  padding: 8px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 700;
  color: rgba(0,0,0,.6);
}
.chip.is-active{
  border-color: rgba(255,77,79,.35);
  color: #111;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
}

.slider{
  display:grid;
  grid-template-columns: 64px 1fr 46px;
  align-items:center;
  gap: 10px;
  margin: 10px 0;
}
.slider label{ font-weight:800; color: rgba(0,0,0,.6); }
.slider input[type="range"]{ width:100%; }

.actions{ display:flex; gap: 10px; margin-top: 12px; }

.btn{
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
  padding: 10px 14px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
}
.btn-ghost{ background: rgba(255,255,255,.75); border-radius: 999px; padding: 10px 16px; }
.btn-soft{ background: rgba(255,255,255,.70); }
.btn-primary{
  border:0;
  color:#fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 22px rgba(255,77,79,.22);
}

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(0,0,0,.55);
  line-height: 1.5;
}

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.78);
  color:#fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(-6px); }

@media (max-width: 1120px){
  .grid{ grid-template-columns: 1fr; }
  .stage-card{ min-height: 520px; }
  .character{ width: 100%; max-width: 760px; }
}

.empty-item{
  width:100%;
  height: 58px;
  border-radius: 14px;
  border: 1px dashed rgba(0,0,0,.12);
  background: rgba(255,255,255,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  color: rgba(0,0,0,.45);
}
.car-btn:disabled{
  opacity:.35;
  cursor:not-allowed;
}
