/* Theme Workshop */
.app-shell:has(#themeWorkshopView.active) {
  background: transparent !important;
}

#themeWorkshopView {
  position: absolute !important;
  inset: 0 !important;
  z-index: 9999 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

#themeWorkshopView.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 动态渐变背景 */
.theme-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #FFE4E9 0%, #FFF0F3 25%, #FFE8F0 50%, #FFF5F7 75%, #FFE4E9 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: 0;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 浮动装饰元素 */
.theme-decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #FFB6C1, #FFC0CB);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #FFD1DC, #FFE4E9);
  bottom: 20%;
  left: -50px;
  animation-delay: -7s;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #FFE4E1, #FFF0F5);
  top: 40%;
  right: 10%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -30px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(20px, 30px) scale(1.05); }
}

/* 顶部导航 - 玻璃拟态效果 */
.theme-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.theme-back-btn,
.theme-reset-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(255, 182, 193, 0.2);
}

.theme-back-btn:hover,
.theme-reset-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 182, 193, 0.3);
}

.theme-back-btn:active,
.theme-reset-btn:active {
  transform: scale(0.95);
}

.theme-title {
  font-size: 18px;
  font-weight: 700;
  color: #FF6B8A;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.title-icon {
  font-size: 14px;
  animation: sparkle 2s ease-in-out infinite;
}

.title-icon:last-child {
  animation-delay: 1s;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* 主内容区 */
.theme-content {
  position: relative;
  z-index: 5;
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 欢迎卡片 */
.theme-welcome-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 245, 247, 0.9) 100%);
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 
    0 4px 20px rgba(255, 182, 193, 0.15),
    0 1px 3px rgba(255, 182, 193, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.theme-welcome-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-text h2 {
  font-size: 20px;
  font-weight: 700;
  color: #5A3D4A;
  margin: 0 0 6px;
}

.welcome-text p {
  font-size: 13px;
  color: #8B5A6B;
  margin: 0;
}

.welcome-illustration {
  font-size: 48px;
  filter: drop-shadow(0 4px 8px rgba(255, 182, 193, 0.3));
  animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(5deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-3px) rotate(-3deg); }
}

/* 图标网格 - 创意瀑布流布局 */
.theme-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* 图标卡片 */
.theme-app-card {
  aspect-ratio: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 250, 252, 0.95) 100%);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 
    0 2px 8px rgba(255, 182, 193, 0.1),
    0 1px 2px rgba(255, 182, 193, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.theme-app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.theme-app-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 8px 24px rgba(255, 182, 193, 0.2),
    0 2px 4px rgba(255, 182, 193, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.theme-app-card:hover::before {
  opacity: 1;
}

.theme-app-card:active {
  transform: translateY(-2px) scale(0.98);
}

/* 已自定义状态 */
.theme-app-card.custom {
  background: linear-gradient(145deg, rgba(255, 240, 243, 0.95) 0%, rgba(255, 235, 240, 0.95) 100%);
  border: 2px solid rgba(255, 182, 193, 0.4);
}

.theme-app-card.custom::after {
  content: '✨';
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  animation: sparkle 2s ease-in-out infinite;
}

/* 图标预览 */
.theme-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  transition: transform 0.3s ease;
}

.theme-app-card:hover .theme-card-icon {
  transform: scale(1.05);
}

.theme-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 图标名称 */
.theme-card-name {
  font-size: 11px;
  font-weight: 600;
  color: #5A3D4A;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.theme-app-arrow {
  font-size: 20px;
  color: #FFB6C1;
}
