* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

body {
  color: #424242;
  background-color: #fff;
  width: 100%;
  height: 100%;
}

#unity-container {
  position: absolute;
  width: 100%;
  height: 100%;
  max-width: none; /* 移除最大寬度限制 */
  max-height: none; /* 移除最大高度限制 */
  aspect-ratio: 1/1; /* 保持寬高比 */
  display: flex;
  align-items: center;
  justify-content: center;
}

#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
#unity-container.unity-mobile {
  width: 100%;
  height: 100%;
}
#unity-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: #231f20;
}
.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
}
#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
}
#unity-progress-bar-empty {
  width: 141px;
  height: 18px;
  margin-top: 10px;
  margin-left: 6.5px;
  background: url("progress-bar-empty-dark.png") no-repeat center;
}
#unity-progress-bar-full {
  width: 0%;
  height: 18px;
  margin-top: 10px;
  background: url("progress-bar-full-dark.png") no-repeat center;
}
#unity-footer {
  position: relative;
}
.unity-mobile #unity-footer {
  display: none;
}
#unity-webgl-logo {
  float: left;
  width: 204px;
  height: 38px;
  background: url("webgl-logo.png") no-repeat center;
}
#unity-build-title {
  float: right;
  margin-right: 10px;
  line-height: 38px;
  font-family: arial;
  font-size: 18px;
}
#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: white;
  padding: 10px;
  display: none;
}

/* 基本樣式設定 */

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 頂部LOGO區域 */
.header {
  padding: 16px;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  background-color: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #757575;
}

.logo-separator {
  font-size: 20px;
}

/* 主體區域 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* 3D視窗區域 */
.preview-area {
  flex: 1;
  background-color: #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
  position: relative;
}

.image-container {
  width: 100%;
  max-width: 800px;
  max-height: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bracelet-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* 保持圖片比例 */
}

/* 底部控制面板 */
.control-panel {
  background-color: #fff;
  border-top: 1px solid #eee;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  transition: all 0.3s ease; /* 平滑過渡 */
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  z-index: 10;
}

.control-panel.expanded {
  height: auto;
}

.control-panel.collapsed {
  height: 48px;
}

.collapse-handle {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.handle-bar {
  width: 64px;
  height: 4px;
  background-color: #e0e0e0;
  border-radius: 2px;
}

.panel-content {
  display: block;
}

/* 旋轉選擇器導航 */
.tab-navigator {
  position: relative;
  height: 64px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.tab-carousel {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
}

.tab-option {
  position: absolute;
  text-align: center;
}

.tab-option.prev {
  left: 50px;
  transform: translateY(-50%) scale(0.75);
  opacity: 0.5;
  font-size: 20px;
  color: #9e9e9e;
  cursor: pointer;
  top: 50%;
}

.tab-option.current {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: 300;
}

.tab-option.next {
  right: 50px;
  transform: translateY(-50%) scale(0.75);
  opacity: 0.5;
  font-size: 20px;
  color: #9e9e9e;
  cursor: pointer;
  top: 50%;
}

.indicators {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #e0e0e0;
}

.indicator.active {
  background-color: #2196f3;
}

/* 子標籤導航 */
.sub-tab-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.arrow-button {
  color: #2196f3;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0 20px;
}

.sub-tab-title {
  text-align: center;
}

.sub-tab-title h3 {
  font-size: 14px;
  font-weight: normal;
}

.subtitle {
  font-size: 12px;
  color: #9e9e9e;
  margin-top: 4px;
}

/* 選項內容區 */
.options-container {
  padding: 16px;
}

.option-grid {
  display: grid;
  gap: 8px;
  display: none;
}

.option-grid.active {
  display: grid;
}

.size-options,
.count-options {
  grid-template-columns: repeat(3, 1fr);
}

.color-options {
  grid-template-columns: repeat(4, 1fr);
}

.option-item {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.option-item.selected {
  border-color: #424242;
  background-color: #fafafa;
}

.preview-circle {
  width: 32px;
  height: 32px;
  background-color: #e0e0e0;
  border-radius: 50%;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.size-dot {
  background-color: #757575;
  border-radius: 50%;
}

.color-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.option-label {
  font-size: 14px;
}

.option-desc {
  font-size: 12px;
  color: #9e9e9e;
}

.count-label {
  font-size: 12px;
}

/* 說明文字 */
.description-text {
  padding: 8px 16px;
  text-align: center;
}

.description-text p {
  font-size: 12px;
  color: #757575;
}

/* 價格顯示 */
.price-container {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f0f0;
}

.help-button {
  width: 32px;
  height: 32px;
  background-color: #f5f5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.price-display {
  text-align: right;
}

.price-label {
  font-size: 14px;
  color: #757575;
}

.price-value {
  font-size: 20px;
  margin-left: 8px;
}

.currency {
  font-size: 14px;
}
