/* ===== 角色创造师 1-3 ===== */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
}
.character-creator-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cc-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.cc-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.cc-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 30% 60%, transparent 0%, rgba(10, 12, 46, 0.25) 50%, rgba(10, 12, 46, 0.45) 100%);
  pointer-events: none;
}

.cc-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 18px;
  overflow-y: auto;
  min-height: 0;
}

/* 顶部标题区 */
.cc-header {
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.cc-title {
  font-size: 42px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 4px;
  text-shadow:
    0 0 20px rgba(123, 108, 219, 0.7),
    0 0 40px rgba(123, 108, 219, 0.45),
    0 4px 16px rgba(0, 0, 0, 0.35);
  margin-bottom: 6px;
}

.cc-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #FFF5C8;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 1px 8px rgba(244, 197, 66, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.cc-subtitle .star {
  color: #FFD166;
  font-size: 14px;
  text-shadow: 0 0 8px rgba(255, 209, 102, 0.8);
}

/* 主工作区 */
.cc-workspace {
  display: flex;
  align-items: stretch;
  gap: 18px;
  flex: 1;
  min-height: 0;
  margin-bottom: 14px;
}

/* 左侧角色预览 */
.cc-preview-panel {
  width: 30%;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(60, 40, 140, 0.55) 0%, rgba(30, 30, 110, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 60px rgba(150, 120, 255, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.cc-preview-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.cc-view-tabs {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3;
}

.cc-view-tab {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cc-view-tab .tab-icon {
  font-size: 16px;
}

.cc-view-tab.active,
.cc-view-tab:hover {
  background: rgba(123, 108, 219, 0.55);
  border-color: rgba(255, 209, 102, 0.45);
  color: #FFF5C8;
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.25);
}

.cc-preview-stage {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  padding: 16px 0 0;
  min-height: 0;
  overflow: hidden;
  perspective: 900px;
}
.cc-preview-stage .wv-studio-veil { z-index: 8; }
.cc-preview-stage .wv-studio-video { z-index: 7; border-radius: 18px; }

.cc-preview-stage::after {
  content: '';
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 14%;
  background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.45) 0%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: 1;
}

.cc-preview-img {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 108%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s ease;
}

.cc-preview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  z-index: 3;
}

.cc-zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.cc-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cc-zoom-btn:hover {
  background: rgba(123, 108, 219, 0.55);
  border-color: rgba(255, 209, 102, 0.4);
  color: #FFF5C8;
}

.cc-zoom-track {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  position: relative;
}

.cc-zoom-thumb {
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FFD166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.7);
  pointer-events: none;
}

.cc-zoom-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-rotate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cc-rotate-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* 中间定制面板 */
.cc-custom-panel {
  flex: 1;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(30, 38, 110, 0.72) 0%, rgba(18, 24, 80, 0.72) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-y: auto;
}

.cc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.cc-row-label {
  width: 56px;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.cc-row-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cc-photo-content {
  flex-wrap: nowrap;
  min-width: 0;
}

.cc-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cc-photo-button {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 209, 102, .48);
  border-radius: 18px;
  color: #fff5c8;
  background: rgba(123, 108, 219, .48);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}

.cc-photo-button:hover,
.cc-photo-button:focus-visible {
  transform: translateY(-2px);
  background: rgba(123, 108, 219, .72);
  outline: 2px solid rgba(255, 209, 102, .65);
  outline-offset: 2px;
}

.cc-photo-button.is-uploading {
  pointer-events: none;
  opacity: .72;
}

.cc-photo-preview {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 209, 102, .72);
}

.cc-photo-status {
  min-width: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  line-height: 1.35;
}

/* 性别切换 */
.cc-gender-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc-gender-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cc-gender-btn:hover {
  background: rgba(123, 108, 219, 0.55);
  border-color: rgba(255, 209, 102, 0.4);
  color: #FFF5C8;
}

.cc-gender-btn.active {
  background: linear-gradient(135deg, rgba(232, 121, 168, 0.75) 0%, rgba(123, 108, 219, 0.75) 100%);
  border-color: rgba(255, 209, 102, 0.5);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.25);
}

/* 选项格 */
.cc-option {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
  position: relative;
}

.cc-option:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.cc-option.selected {
  border-color: rgba(255, 209, 102, 0.7);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
  background: rgba(123, 108, 219, 0.35);
}

.cc-option.selected::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: #FFD166;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cc-option-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.cc-option-img.hair-style {
  width: 500%;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: cover;
  transform: none;
}

.cc-option-img.dress {
  padding: 2px;
}

.cc-option-img.wing {
  padding: 6px;
}

.cc-option-img.accessory {
  padding: 8px;
}

.cc-option.none {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  border-style: dashed;
}

/* 发色 */
.cc-color-option {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.25);
}

.cc-color-option:hover {
  transform: scale(1.08);
}

.cc-color-option.selected {
  border-color: #FFD166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cc-color-option.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.cc-color-1 { background-image: url('/assets/modules/1-3/ui/color-1.png'); }
.cc-color-2 { background-image: url('/assets/modules/1-3/ui/color-2.png'); }
.cc-color-3 { background-image: url('/assets/modules/1-3/ui/color-3.png'); }
.cc-color-4 { background-image: url('/assets/modules/1-3/ui/color-4.png'); }
.cc-color-5 { background-image: url('/assets/modules/1-3/ui/color-5.png'); }
.cc-color-6 { background-image: url('/assets/modules/1-3/ui/color-6.png'); }

/* 个性标签 */
.cc-tags-row {
  align-items: flex-start;
  flex-wrap: wrap;
}

.cc-tags-row .cc-row-content {
  gap: 8px;
}

.cc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cc-tag:hover {
  background: rgba(255, 255, 255, 0.14);
}

.cc-tag.selected {
  background: rgba(123, 108, 219, 0.55);
  border-color: rgba(255, 209, 102, 0.45);
  color: #FFF5C8;
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.2);
}

.cc-tag-hint {
  width: 100%;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* 右侧边栏 */
.cc-side-panel {
  width: 25%;
  min-width: 250px;
  max-width: 310px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-side-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(30, 38, 110, 0.68) 0%, rgba(18, 24, 80, 0.68) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cc-side-card.gallery {
  flex: 1.2;
  min-height: 0;
}

.cc-side-card.styles {
  flex: 1;
  min-height: 0;
}

.cc-side-card.tags {
  flex: 0 0 auto;
}

.cc-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-side-title {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.3px;
}

.cc-side-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  background: none;
  border: none;
}

.cc-side-action:hover {
  color: #FFE5A0;
}

.cc-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.cc-gallery-card {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
}

.cc-gallery-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.cc-gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cc-styles-list {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.cc-style-card {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.cc-style-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.cc-style-img-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.cc-style-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cc-style-date {
  padding: 5px 0;
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.15);
}

.cc-style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-style-tag {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.cc-style-tag.pink {
  background: rgba(232, 121, 168, 0.22);
  color: #FFD1E3;
}

.cc-style-tag.purple {
  background: rgba(123, 108, 219, 0.22);
  color: #D4C9FF;
}

.cc-style-tag.blue {
  background: rgba(91, 159, 232, 0.22);
  color: #B8D9FF;
}

.cc-style-tag.green {
  background: rgba(129, 199, 132, 0.22);
  color: #C8F6C8;
}

.cc-style-tag.gold {
  background: rgba(245, 182, 90, 0.22);
  color: #FFE0A8;
}

.cc-style-tag:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* 底部操作区 */
.cc-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cc-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

.cc-btn-random {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  height: 52px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(110, 140, 245, 0.82) 0%, rgba(75, 105, 220, 0.88) 50%, rgba(55, 85, 195, 0.92) 100%);
  box-shadow:
    0 5px 0 rgba(35, 60, 150, 0.9),
    0 8px 22px rgba(60, 90, 200, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
}

.cc-btn-random:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 rgba(35, 60, 150, 0.9),
    0 12px 28px rgba(60, 90, 200, 0.5);
}

.cc-btn-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 48px;
  height: 58px;
  border-radius: 32px;
  border: none;
  font-size: 20px;
  font-weight: 800;
  color: #5C3D05;
  cursor: pointer;
  background: linear-gradient(180deg, #FFECB3 0%, #FFD166 35%, #F4C542 65%, #E8A838 100%);
  box-shadow:
    0 6px 0 #C97D20,
    0 10px 28px rgba(244, 197, 66, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.25s ease;
}

.cc-btn-generate:hover {
  transform: translateY(-3px);
  box-shadow:
    0 9px 0 #C97D20,
    0 16px 36px rgba(244, 197, 66, 0.6);
}

.cc-tip {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cc-tip .heart {
  color: #E879A8;
}

/* 滚动条 */
.cc-custom-panel::-webkit-scrollbar,
.cc-content::-webkit-scrollbar {
  width: 5px;
}

.cc-custom-panel::-webkit-scrollbar-track,
.cc-content::-webkit-scrollbar-track {
  background: transparent;
}

.cc-custom-panel::-webkit-scrollbar-thumb,
.cc-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* 响应式 */
@media (max-width: 1300px) {
  .cc-workspace {
    gap: 14px;
  }

  .cc-preview-panel {
    min-width: 230px;
  }

  .cc-side-panel {
    min-width: 210px;
  }

  .cc-option {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 1150px) {
  .cc-workspace {
    flex-wrap: wrap;
  }

  .cc-preview-panel {
    width: 38%;
    max-width: none;
    order: 1;
  }

  .cc-custom-panel {
    width: 58%;
    order: 2;
    min-width: 300px;
  }

  .cc-side-panel {
    width: 100%;
    max-width: none;
    order: 3;
    flex-direction: row;
  }

  .cc-side-card.gallery,
  .cc-side-card.styles,
  .cc-side-card.tags {
    flex: 1;
  }
}
