/* ===== 故事魔法师 1-1 ===== */
.story-wizard-page {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.story-wizard-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% center;
}

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

.story-wizard-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 32px 20px;
  overflow-y: auto;
  min-height: 0;
}

/* 顶部标题区 */
.sw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sw-title-group {
  text-align: center;
  flex: 1;
}

.sw-title {
  font-size: 44px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 3px;
  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: 8px;
}

.sw-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);
}

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

.sw-guide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(20, 26, 80, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  margin-top: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.sw-guide:hover {
  background: rgba(40, 48, 120, 0.7);
}

/* 主创作区 */
.sw-workspace {
  display: flex;
  align-items: stretch;
  gap: 28px;
  margin-bottom: 18px;
  min-height: 0;
  flex: 1.35;
}

.sw-control-panel {
  width: 52%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  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);
}

.sw-panel-title {
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.sw-panel-title .sparkle {
  color: var(--primary-gold);
  margin-left: 4px;
}

.sw-selectors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sw-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  min-width: 0;
}

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

.sw-selector:active,
.sw-selector.selected {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 209, 102, 0.5);
  transform: translateY(0) scale(0.98);
  box-shadow: 0 0 16px rgba(255, 209, 102, 0.2);
}

.sw-selector-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.sw-selector-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sw-selector-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-selector-hint {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-selector-arrow {
  font-size: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.sw-actions {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 6px;
}

.sw-btn-primary {
  flex: 1.4;
  height: 54px;
  border-radius: 28px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: #5C3D05;
  cursor: pointer;
  background: linear-gradient(180deg, #FFECB3 0%, #FFD166 35%, #F4C542 65%, #E8A838 100%);
  box-shadow:
    0 5px 0 #C97D20,
    0 8px 22px rgba(244, 197, 66, 0.45),
    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;
}

.sw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 7px 0 #C97D20,
    0 12px 28px rgba(244, 197, 66, 0.55);
}

.sw-btn-primary:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #C97D20,
    0 4px 12px rgba(244, 197, 66, 0.45);
}

.sw-btn-secondary {
  flex: 1;
  height: 54px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  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;
}

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

.sw-btn-secondary:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 rgba(35, 60, 150, 0.9),
    0 4px 12px rgba(60, 90, 200, 0.4);
}

.sw-visual {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

/* 底部三栏 */
.sw-bottom {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  gap: 16px;
  margin-bottom: 16px;
  flex: 1;
  min-height: 0;
}

.sw-card-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  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);
}

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

.sw-panel-name {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
}

.sw-panel-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.25s ease;
}

.sw-panel-more:hover {
  color: var(--primary-gold-light);
}

.sw-template-list {
  display: flex;
  gap: 10px;
}

.sw-template-card {
  flex: 1;
  min-width: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sw-template-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.sw-template-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
}

.sw-template-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sw-template-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(180deg, transparent 0%, rgba(60, 45, 120, 0.85) 100%);
  pointer-events: none;
}

.sw-template-info {
  padding: 10px;
  background: linear-gradient(180deg, rgba(60, 45, 120, 0.85) 0%, rgba(60, 45, 120, 0.55) 100%);
}

.sw-template-title {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.sw-template-tags {
  display: flex;
  gap: 6px;
}

.sw-template-tag {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.sw-template-tag.orange {
  background: rgba(245, 182, 90, 0.22);
  color: #FFE0A8;
}

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

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

.sw-recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.25s ease;
}

.sw-recent-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.sw-recent-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.sw-recent-meta {
  flex: 1;
  min-width: 0;
}

.sw-recent-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.sw-recent-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.sw-recent-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.sw-recent-date {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sw-inspiration-card {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}

.sw-inspiration-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sw-inspiration-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(10, 12, 46, 0.1) 0%, rgba(10, 12, 46, 0.55) 70%, rgba(10, 12, 46, 0.75) 100%);
}

.sw-inspiration-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
}

.sw-inspiration-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sw-inspiration-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  margin-bottom: 12px;
}

.sw-inspiration-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s ease;
}

.sw-inspiration-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* 底部提示 */
.sw-tip-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  height: 44px;
  border-radius: 22px;
  background: rgba(20, 26, 80, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--text-primary);
}

.sw-tip-bar .icon {
  font-size: 16px;
  color: var(--primary-gold-light);
}

.sw-tip-bar .star {
  margin-left: auto;
  color: var(--primary-gold);
}

/* 小屏/低高度视口下的紧凑布局，确保 1280x720 也能完整显示 */
@media (max-height: 740px) {
  .story-wizard-content {
    padding: 18px 32px 14px;
  }

  .sw-header {
    margin-bottom: 10px;
  }

  .sw-title {
    font-size: 38px;
    margin-bottom: 6px;
  }

  .sw-subtitle {
    font-size: 14px;
  }

  .sw-guide {
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 4px;
  }

  .sw-workspace {
    flex: 0 0 auto;
    min-height: 0;
    gap: 18px;
    margin-bottom: 12px;
  }

  .sw-control-panel {
    padding: 14px 16px;
    gap: 10px;
  }

  .sw-panel-title {
    font-size: 15px;
  }

  .sw-selectors {
    gap: 10px;
  }

  .sw-selector {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .sw-selector-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
  }

  .sw-selector-label {
    font-size: 14px;
  }

  .sw-selector-hint {
    font-size: 11px;
  }

  .sw-actions {
    gap: 10px;
    padding-top: 2px;
  }

  .sw-btn-primary,
  .sw-btn-secondary {
    height: 42px;
    border-radius: 22px;
    font-size: 15px;
  }

  .sw-bottom {
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
    margin-bottom: 12px;
  }

  .sw-card-panel {
    padding: 10px;
    gap: 6px;
    border-radius: 16px;
  }

  .sw-panel-name {
    font-size: 14px;
  }

  .sw-panel-more {
    font-size: 11px;
  }

  .sw-template-list {
    gap: 8px;
  }

  .sw-template-img-wrap {
    aspect-ratio: 1 / 0.62;
    border-radius: 12px;
  }

  .sw-template-info {
    padding: 5px;
  }

  .sw-template-title {
    font-size: 11px;
    margin-bottom: 2px;
  }

  .sw-template-tag {
    font-size: 9px;
    padding: 2px 5px;
  }

  .sw-recent-list {
    gap: 5px;
  }

  .sw-recent-item {
    padding: 5px;
    gap: 8px;
    border-radius: 10px;
  }

  .sw-recent-thumb {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  .sw-recent-title {
    font-size: 12px;
  }

  .sw-recent-tags {
    font-size: 10px;
  }

  .sw-recent-date {
    font-size: 11px;
  }

  .sw-inspiration-card {
    border-radius: 16px;
  }

  .sw-inspiration-content {
    padding: 8px;
  }

  .sw-inspiration-title {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .sw-inspiration-desc {
    font-size: 10px;
    margin-bottom: 5px;
  }

  .sw-inspiration-btn {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 14px;
  }

  .sw-tip-bar {
    height: 30px;
    font-size: 11px;
    padding: 0 12px;
  }
}
