/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body.sa-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #faf9f6;
  color: #2c2c2c;
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ 左侧窄导航 ============ */
.sa-side {
  width: 80px;
  background: #f5f3ee;
  border-right: 1px solid #ebe7dd;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 20px;
  flex-shrink: 0;
}

.sa-side-logo {
  color: #8a8578;
  margin-bottom: 36px;
  opacity: 0.75;
}

.sa-side-nav {
  flex: 1;
  width: 100%;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.sa-side-nav::-webkit-scrollbar { width: 0; }

.sa-side-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 4px;
  border-radius: 12px;
  text-decoration: none;
  color: #8a8578;
  transition: all 0.18s ease;
  cursor: pointer;
}
.sa-side-item svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sa-side-item span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}
.sa-side-item:hover {
  background: #ebe7dd;
  color: #5a5648;
}
.sa-side-item.active {
  background: #e8e4d8;
  color: #2c2c2c;
}
.sa-side-item.active svg {
  stroke: #8a7a5c;
}

.sa-side-footer {
  width: 100%;
  padding: 0 10px;
  border-top: 1px solid #ebe7dd;
  padding-top: 12px;
  margin-top: 12px;
}

/* ============ 主区域 ============ */
.sa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
}

/* 顶栏 */
.sa-header {
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px;
  border-bottom: 1px solid #f0ede5;
  flex-shrink: 0;
  background: #ffffff;
}
.sa-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sa-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f5f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a7a5c;
}
.sa-header-icon svg {
  width: 18px;
  height: 18px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sa-header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #2c2c2c;
}
.sa-header-link {
  font-size: 13px;
  color: #8a8578;
  text-decoration: none;
  transition: color 0.18s;
}
.sa-header-link:hover { color: #2c2c2c; }

/* Body */
.sa-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 60px;
  scroll-behavior: smooth;
}
.sa-body::-webkit-scrollbar { width: 6px; }
.sa-body::-webkit-scrollbar-thumb {
  background: #e8e4d8;
  border-radius: 3px;
}

/* Hero */
.sa-hero {
  max-width: 720px;
  margin: 100px auto 0;
  text-align: center;
  transition: opacity 0.3s;
}
.sa-hero-title {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #2c2c2c;
  margin-bottom: 22px;
  line-height: 1.18;
}
.sa-hero-desc {
  font-size: 15px;
  color: #8a8578;
  margin-bottom: 14px;
  line-height: 1.65;
  font-weight: 400;
}
.sa-hero-hint {
  font-size: 13px;
  color: #b5b0a3;
  line-height: 1.65;
  font-weight: 400;
}

/* 消息区 */
.sa-messages {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.sa-msg {
  display: flex;
  gap: 14px;
  animation: saMsgIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes saMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.sa-msg-user {
  justify-content: flex-end;
}
.sa-msg-user .sa-msg-bubble {
  background: #2c2c2c;
  color: #ffffff;
  padding: 13px 20px;
  border-radius: 20px 20px 6px 20px;
  max-width: 70%;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
}
.sa-msg-ai {
  justify-content: flex-start;
}
.sa-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f5f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  color: #8a7a5c;
}
.sa-msg-ai .sa-msg-bubble {
  background: #faf9f6;
  color: #2c2c2c;
  padding: 15px 20px;
  border-radius: 6px 20px 20px 20px;
  max-width: 78%;
  font-size: 15px;
  line-height: 1.75;
  word-break: break-word;
  font-weight: 400;
}
.sa-msg-bubble code {
  background: #ebe7dd;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: #5a5648;
}
.sa-msg-bubble strong { font-weight: 600; }
.sa-cursor {
  display: inline-block;
  width: 6px;
  height: 15px;
  background: #8a7a5c;
  margin-left: 3px;
  border-radius: 1px;
  animation: saBlink 1.1s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes saBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* ============ 底部输入区 ============ */
.sa-composer {
  flex-shrink: 0;
  padding: 16px 60px 28px;
  background: #ffffff;
  border-top: none;
}
.sa-composer-box {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 22px;
  padding: 10px 12px 10px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sa-composer-box:focus-within {
  border-color: #d6cfc0;
  box-shadow: 0 2px 12px rgba(138, 122, 92, 0.06);
}
.sa-composer-upload {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8578;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s;
}
.sa-composer-upload:hover {
  background: #f5f3ee;
  color: #5a5648;
}
.sa-composer-upload svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sa-composer-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #2c2c2c;
  line-height: 1.6;
  resize: none;
  padding: 9px 0;
  max-height: 180px;
  font-family: inherit;
  font-weight: 400;
}
.sa-composer-input::placeholder {
  color: #b5b0a3;
}
.sa-composer-send {
  padding: 10px 18px;
  background: #8a7a5c;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.sa-composer-send:hover:not(:disabled) {
  background: #736650;
  transform: translateY(-1px);
}
.sa-composer-send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.sa-composer-bar {
  max-width: 780px;
  margin: 14px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #8a8578;
}
.sa-composer-left {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 18px;
  font-size: 12.5px;
  color: #8a8578;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.sa-chip:hover {
  border-color: #d6cfc0;
  color: #2c2c2c;
}
.sa-chip svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sa-select {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 18px;
  font-size: 12.5px;
  color: #8a8578;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s;
}
.sa-select:hover { border-color: #d6cfc0; }
.sa-composer-cost {
  font-size: 12.5px;
  color: #b5b0a3;
}

/* 空状态占位 */
.sa-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #b5b0a3;
  font-size: 14px;
}

/* 菜单分割线 */
.sa-side-divider {
  height: 1px;
  background: #ebe7dd;
  margin: 8px 12px;
  opacity: 0.8;
}

/* 菜单分割线 - 强制不被压缩 */
.sa-side-nav > .sa-side-divider,
.sa-side-divider {
  height: 1px !important;
  min-height: 1px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  align-self: center;
  width: 60% !important;
  background: #ebe7dd !important;
  margin: 8px 0 !important;
  opacity: 0.8;
  display: block;
}

/* 菜单分割线 - 最终版 */
.sa-side-nav > .sa-side-divider,
.sa-side-divider {
  height: 1px !important;
  min-height: 1px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  align-self: center;
  width: 70% !important;
  background: #d6cfc0 !important;
  margin: 8px 0 !important;
  opacity: 1;
  display: block;
}

/* ============ 二级栏（会话列表） ============ */
.sa-sub {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #f0ede5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sa-sub-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sa-sub-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8a7a5c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  flex-shrink: 0;
}
.sa-sub-title {
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2c;
  letter-spacing: -0.01em;
}
.sa-sub-new {
  margin: 8px 16px;
  padding: 12px 16px;
  background: #faf9f6;
  border: 1px solid #ebe7dd;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #5a5648;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  font-weight: 500;
}
.sa-sub-new:hover {
  background: #f5f3ee;
  border-color: #d6cfc0;
}
.sa-sub-label {
  padding: 16px 20px 8px;
  font-size: 12px;
  color: #b5b0a3;
  letter-spacing: 0.02em;
}
.sa-sub-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}
.sa-sub-list::-webkit-scrollbar { width: 4px; }
.sa-sub-list::-webkit-scrollbar-thumb { background: #e8e4d8; border-radius: 2px; }
.sa-sub-item {
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sa-sub-item:hover { background: #faf9f6; }
.sa-sub-item.active { background: #f5f3ee; }
.sa-sub-item-content {
  flex: 1;
  min-width: 0;
}
.sa-sub-item-title {
  font-size: 13.5px;
  color: #2c2c2c;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.sa-sub-item-time {
  font-size: 11px;
  color: #b5b0a3;
}
.sa-sub-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s;
}
.sa-sub-item:hover .sa-sub-item-actions { opacity: 1; }
.sa-sub-item-actions button {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #8a8578;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.sa-sub-item-actions button:hover {
  background: #ebe7dd;
  color: #2c2c2c;
}
.sa-sub-item-actions svg {
  width: 14px;
  height: 14px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ 顶栏右侧 ============ */
.sa-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sa-header-icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #8a8578;
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.sa-header-icon-btn:hover {
  background: #f5f3ee;
  color: #2c2c2c;
}
.sa-header-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sa-header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #ebe7dd;
  border-radius: 20px;
  font-size: 13.5px;
  color: #5a5648;
  cursor: pointer;
  transition: all 0.18s;
}
.sa-header-user:hover {
  border-color: #d6cfc0;
  background: #faf9f6;
}

/* ============ 底部输入区（双行） ============ */
.sa-composer-bar {
  max-width: 780px;
  margin: 12px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #8a8578;
}
.sa-composer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sa-composer-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #8a7a5c;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.sa-composer-circle:hover:not(:disabled) {
  background: #736650;
  transform: translateY(-1px);
}
.sa-composer-circle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 输入区参考素材按钮改为圆形加号 */
.sa-composer-upload {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px dashed #d6cfc0;
  background: #faf9f6;
  color: #8a8578;
}
.sa-composer-upload:hover {
  border-color: #8a7a5c;
  color: #5a5648;
  background: #f5f3ee;
}
.sa-composer-upload svg {
  width: 20px;
  height: 20px;
  stroke-linecap: round;
}

/* ============ 对话框放大 ============ */
.sa-composer {
  padding: 24px 60px 32px;
}
.sa-composer-box {
  max-width: 900px;
  padding: 16px 20px 16px 18px;
  border-radius: 26px;
  gap: 14px;
}
.sa-composer-input {
  font-size: 15.5px;
  line-height: 1.65;
  padding: 12px 4px;
  min-height: 60px;
}
.sa-composer-bar {
  max-width: 900px;
  margin: 14px auto 0;
}
.sa-composer-upload {
  width: 48px;
  height: 48px;
  border-radius: 16px;
}
.sa-composer-send {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 18px;
}
.sa-composer-circle {
  width: 44px;
  height: 44px;
}

/* ============ 字体复刻 ============ */
body.sa-app {
  font-family: var(--font-sans);
}

/* 标题用宋体，更有书卷气 */
.sa-hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 42px;
  color: #2c2c2c;
  line-height: 1.35;
}

.sa-sub-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.sa-header-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.01em;
}

/* 大标题下描述字体 */
.sa-hero-desc {
  font-size: 15.5px;
  color: #8a8578;
  letter-spacing: 0.01em;
}

.sa-hero-hint {
  font-size: 13.5px;
  color: #b5b0a3;
  letter-spacing: 0.01em;
}

/* ============ 素材选择器 ============ */
.material-picker {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mpIn 0.2s ease;
}
@keyframes mpIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.material-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}
.material-picker-content {
  position: relative;
  z-index: 1;
  width: 90vw;
  max-width: 720px;
  max-height: 80vh;
  background: #fff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.material-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #f0ede5;
}
.material-picker-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2c;
}
.material-picker-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #8a8578;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
}
.material-picker-close:hover {
  background: #f5f3ee;
  color: #2c2c2c;
}
.material-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.material-picker-loading,
.material-picker-empty {
  text-align: center;
  padding: 60px 20px;
  color: #b5b0a3;
  font-size: 14px;
}
.material-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.material-picker-item {
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.18s;
  background: #faf9f6;
}
.material-picker-item:hover {
  border-color: #8a7a5c;
  transform: translateY(-2px);
}
.material-picker-item img,
.material-picker-item video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.material-picker-name {
  padding: 8px 10px;
  font-size: 12px;
  color: #5a5648;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 素材卡片结构调整 */
.mat-card {
  position: relative;
}
.mat-media {
  position: relative;
  cursor: pointer;
}
.mat-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #fff;
}
.mat-name-row .mat-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #5a5648;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0;
}
.mat-delete {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.18s;
}
.mat-delete:hover {
  background: #fde8e8;
  color: #c66;
}
.mat-delete svg {
  width: 14px;
  height: 14px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 已选素材条 */
.selected-materials-bar {
  max-width: 900px;
  margin: 0 auto 10px;
  display: flex;
  gap: 10px;
  padding: 0 8px;
  flex-wrap: wrap;
}
.selected-material {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ebe7dd;
  background: #faf9f6;
}
.selected-material img,
.selected-material video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.selected-material-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.selected-material-remove:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* ============ 电商生图布局 ============ */
.ecom-main {
  display: flex;
  flex-direction: column;
}
.ecom-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  overflow: hidden;
  background: #faf9f6;
}
@media (max-width: 1024px) {
  .ecom-layout { grid-template-columns: 1fr; }
}

/* ============ 左侧参数面板 ============ */
.ecom-panel {
  background: #ffffff;
  border-right: 1px solid #f0ede5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ecom-panel-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f5f3ee;
}
.ecom-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f5f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.ecom-app-info { flex: 1; min-width: 0; }
.ecom-app-title {
  font-size: 17px;
  font-weight: 600;
  color: #2c2c2c;
  margin-bottom: 2px;
}
.ecom-app-desc {
  font-size: 12.5px;
  color: #8a8578;
}
.ecom-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}
.ecom-close:hover { background: #f5f3ee; color: #2c2c2c; }
.ecom-close svg { width: 18px; height: 18px; stroke-linecap: round; }

/* Body 可滚动 */
.ecom-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.ecom-panel-body::-webkit-scrollbar { width: 4px; }
.ecom-panel-body::-webkit-scrollbar-thumb { background: #e8e4d8; border-radius: 2px; }

.ecom-section { display: flex; flex-direction: column; gap: 10px; }

.ecom-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #5a5648;
}
.ecom-label svg {
  width: 16px; height: 16px;
  stroke-linecap: round; stroke-linejoin: round;
  color: #8a8578;
}
.ecom-required { color: #c66; margin-left: 2px; }

/* 分段控件 */
.ecom-segment {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #faf9f6;
  border: 1px solid #f0ede5;
  border-radius: 12px;
}
.ecom-seg-item {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #8a8578;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.18s;
  font-family: inherit;
}
.ecom-seg-item:hover { color: #5a5648; }
.ecom-seg-item.active {
  background: #ffffff;
  color: #2c2c2c;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 下拉 */
.ecom-select-wrap { position: relative; }
.ecom-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 10px;
  font-size: 13.5px;
  color: #2c2c2c;
  cursor: pointer;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8578' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color 0.18s;
}
.ecom-select:hover, .ecom-select:focus { border-color: #d6cfc0; }

/* 上传区 */
.ecom-upload {
  padding: 28px 20px;
  background: #faf9f6;
  border: 1px dashed #d6cfc0;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
}
.ecom-upload:hover, .ecom-upload.dragover {
  background: #f5f3ee;
  border-color: #8a7a5c;
}
.ecom-upload-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #ebe7dd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8578;
}
.ecom-upload-icon svg { width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; }
.ecom-upload-title {
  font-size: 14px;
  font-weight: 500;
  color: #2c2c2c;
  margin-bottom: 4px;
}
.ecom-upload-sub {
  font-size: 12px;
  color: #b5b0a3;
  margin-bottom: 8px;
}
.ecom-upload-link {
  border: none;
  background: transparent;
  color: #4a7ab8;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.ecom-upload-link:hover { text-decoration: underline; }

.ecom-upload-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ecom-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #ebe7dd;
  background: #faf9f6;
}
.ecom-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ecom-thumb-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ecom-hint {
  font-size: 12px;
  color: #b5b0a3;
  line-height: 1.6;
}
.ecom-hint span { color: #8a8578; }

/* textarea */
.ecom-textarea {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 10px;
  font-size: 13.5px;
  color: #2c2c2c;
  font-family: inherit;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.18s;
}
.ecom-textarea:focus { border-color: #d6cfc0; }
.ecom-textarea::placeholder { color: #b5b0a3; }

.ecom-textarea-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ecom-ai-optimize {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #ebe7dd;
  border-radius: 16px;
  font-size: 12px;
  color: #8a8578;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.ecom-ai-optimize:hover { border-color: #d6cfc0; color: #5a5648; }
.ecom-ai-optimize svg { width: 12px; height: 12px; stroke-linecap: round; }
.ecom-count { font-size: 12px; color: #b5b0a3; }

/* 参数网格 */
.ecom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ecom-field { display: flex; flex-direction: column; gap: 6px; }
.ecom-field label {
  font-size: 12.5px;
  color: #8a8578;
  font-weight: 500;
}

/* 生成数量 */
.ecom-section-count {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.ecom-count-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #5a5648;
}
.ecom-count-control {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ecom-count-btn {
  width: 32px; height: 32px;
  border: 1px solid #ebe7dd;
  border-radius: 8px;
  background: #ffffff;
  color: #5a5648;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all 0.18s;
}
.ecom-count-btn:hover { border-color: #d6cfc0; background: #faf9f6; }
.ecom-count-value {
  font-size: 15px;
  font-weight: 600;
  color: #2c2c2c;
  min-width: 24px;
  text-align: center;
}

/* 底部固定 */
.ecom-panel-footer {
  padding: 16px 20px 20px;
  border-top: 1px solid #f5f3ee;
  background: #ffffff;
}
.ecom-cost {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  color: #8a8578;
}
.ecom-cost-value { color: #8a7a5c; font-weight: 500; }
.ecom-submit {
  width: 100%;
  padding: 14px;
  background: #8a7a5c;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s;
  letter-spacing: 0.02em;
}
.ecom-submit:hover { background: #736650; transform: translateY(-1px); }
.ecom-submit svg { stroke-linecap: round; stroke-linejoin: round; }
.ecom-footnote {
  margin-top: 10px;
  font-size: 11.5px;
  color: #b5b0a3;
  text-align: center;
}

/* ============ 右侧结果区 ============ */
.ecom-result {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #faf9f6;
}
.ecom-result-header {
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0ede5;
  background: #faf9f6;
}
.ecom-result-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #f5f3ee;
  border-radius: 16px;
  font-size: 12.5px;
  color: #8a8578;
}
.ecom-result-tag svg { stroke-linecap: round; stroke-linejoin: round; }
.ecom-result-link {
  font-size: 13px;
  color: #8a8578;
  text-decoration: none;
}
.ecom-result-link:hover { color: #2c2c2c; }

.ecom-result-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.ecom-result-placeholder {
  text-align: center;
  max-width: 500px;
}
.ecom-placeholder-img {
  width: 220px;
  height: 180px;
  margin: 0 auto 32px;
  background: #f5f3ee;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ecom-placeholder-img svg { width: 120px; height: 120px; }
.ecom-placeholder-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  color: #2c2c2c;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}
.ecom-placeholder-desc {
  font-size: 14px;
  color: #8a8578;
  line-height: 1.7;
}

/* ============ 全局统一（覆盖硬编码） ============ */
body.sa-app {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
}

/* 所有 SVG 统一 */
svg {
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 统一边框颜色 */
.sa-side, .sa-sub, .sa-header, .sa-composer,
.ecom-panel, .ecom-result-header {
  border-color: var(--c-border-light);
}

/* 统一次级背景 */
.sa-sub-new, .ecom-upload, .ecom-result-header {
  background: var(--c-bg-subtle);
}

/* 统一主色按钮 */
.sa-composer-send, .ecom-submit, .sa-composer-circle, .cta-btn {
  background: var(--c-primary);
}
.sa-composer-send:hover:not(:disabled),
.ecom-submit:hover,
.sa-composer-circle:hover:not(:disabled) {
  background: var(--c-primary-hover);
}

/* 统一文字色 */
.sa-sub-item-title, .sa-hero-title, .ecom-app-title, .sa-header-title,
.ecom-placeholder-title, .ecom-upload-title, .ecom-seg-item.active {
  color: var(--c-text);
}
.sa-side-item, .sa-sub-label, .sa-hero-desc, .ecom-app-desc,
.ecom-label, .ecom-hint, .ecom-cost, .ecom-upload-sub,
.sa-composer-cost, .ecom-count, .ecom-footnote {
  color: var(--c-text-muted);
}
.sa-sub-item-time, .ecom-hint, .ecom-placeholder-desc,
.sa-composer-input::placeholder, .ecom-textarea::placeholder {
  color: var(--c-text-hint);
}

/* 统一字号 */
.sa-side-item span { font-size: var(--fs-xs); }
.sa-sub-item-title { font-size: var(--fs-base); }
.sa-sub-item-time { font-size: var(--fs-xs); }
.sa-hero-desc { font-size: var(--fs-lg); }
.sa-hero-hint { font-size: var(--fs-base); }
.sa-composer-input, .ecom-textarea { font-size: var(--fs-md); }
.sa-composer-send { font-size: var(--fs-md); }
.ecom-label { font-size: var(--fs-base); }
.ecom-seg-item { font-size: var(--fs-base); }
.ecom-select { font-size: var(--fs-base); }
.ecom-upload-title { font-size: var(--fs-md); }
.ecom-upload-sub { font-size: var(--fs-sm); }
.ecom-hint { font-size: var(--fs-sm); }
.ecom-field label { font-size: var(--fs-sm); }

/* 统一标题字体（衬线） */
.sa-hero-title,
.sa-header-title,
.sa-sub-title,
.ecom-placeholder-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 统一圆角 */
.sa-composer-box { border-radius: var(--r-xl); }
.ecom-upload, .ecom-textarea, .ecom-segment { border-radius: var(--r-lg); }
.ecom-select, .ecom-thumb { border-radius: var(--r-md); }

/* ============ 视频结果卡片 ============ */
.video-results {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.video-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #f0ede5;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
}
.video-card:hover {
  box-shadow: 0 8px 32px rgba(138, 122, 92, 0.08);
}
.video-card-player {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
}
.video-card-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}
.video-card-info {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.video-card-meta {
  flex: 1;
  min-width: 0;
}
.video-card-title {
  font-size: 14px;
  font-weight: 500;
  color: #2c2c2c;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-card-desc {
  font-size: 12px;
  color: #b5b0a3;
}
.video-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid #ebe7dd;
  background: #ffffff;
  color: #5a5648;
  transition: all 0.18s;
  text-decoration: none;
}
.video-btn:hover {
  border-color: #d6cfc0;
  background: #faf9f6;
  color: #2c2c2c;
}
.video-btn svg {
  width: 14px;
  height: 14px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.video-btn-primary {
  background: #8a7a5c;
  color: #fff;
  border-color: #8a7a5c;
}
.video-btn-primary:hover {
  background: #736650;
  border-color: #736650;
  color: #fff;
}

/* 空状态 */
.video-empty {
  text-align: center;
  color: #b5b0a3;
  font-size: 14px;
  padding: 60px 20px;
}

/* ============ 爆款复刻专用 ============ */
.ecom-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  font-family: var(--font-serif);
  letter-spacing: 0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border-subtle);
}
.ecom-section-subtitle {
  font-size: 14px;
  font-weight: 600;
  border-bottom: none;
  padding-bottom: 0;
}

/* 视频上传区 */
.ecom-upload-video {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-subtle);
}
.ecom-upload-video-hint {
  font-size: 14px;
  color: var(--c-text-muted);
}
.ecom-upload-link-btn {
  display: inline-block;
  padding: 8px 16px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  margin-top: -4px;
}
.ecom-upload-link-btn:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text-secondary);
}
.ecom-thumb-video {
  aspect-ratio: 16 / 9;
  grid-column: span 2;
}

/* 折叠面板 */
.ecom-collapse {
  border-top: 1px solid var(--c-border-subtle);
  border-bottom: 1px solid var(--c-border-subtle);
  padding: 4px 0;
}
.ecom-collapse-header {
  width: 100%;
  padding: 14px 0;
  border: none;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  cursor: pointer;
  font-family: inherit;
  transition: color 0.18s;
}
.ecom-collapse-header:hover { color: var(--c-text-secondary); }
.ecom-collapse-header svg {
  width: 16px; height: 16px;
  stroke-linecap: round;
  transition: transform 0.25s;
}
.ecom-collapse-header.open svg { transform: rotate(90deg); }
.ecom-collapse-body {
  padding: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 输入框 */
.ecom-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--c-text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s;
}
.ecom-input:focus { border-color: var(--c-border-strong); }
.ecom-input::placeholder { color: var(--c-text-hint); }

/* 快捷模板 */
.ecom-hint-label {
  font-size: 12.5px;
  color: var(--c-text-muted);
  margin-bottom: 0;
}
.ecom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ecom-tag {
  padding: 7px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  background: var(--c-bg);
  color: var(--c-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.ecom-tag:hover {
  border-color: var(--c-border-strong);
  background: var(--c-bg-subtle);
}
.ecom-tag.active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* 右侧播放器占位 */
.ecom-placeholder-video {
  background: var(--c-bg);
  border: 1.5px solid var(--c-primary);
  border-radius: 20px;
}


/* 素材库视频卡片 16:9 */
.mat-card video {
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
}

/* 素材选择器：视频 16:9，图片 1:1 */
.material-picker-item video {
  aspect-ratio: 16 / 9 !important;
  object-fit: cover !important;
}
.material-picker-item img {
  aspect-ratio: 1 !important;
  object-fit: cover !important;
}

/* 视频缩略图 16:9 */
.ecom-thumb-video {
  aspect-ratio: 16 / 9;
  grid-column: span 2;
}
.ecom-thumb-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ 视频弹层：约束尺寸，防止溢出 ============ */
.video-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 40px !important;
  box-sizing: border-box !important;
}

.video-modal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  cursor: pointer !important;
}

.video-modal-content {
  position: relative !important;
  z-index: 1 !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
}

.video-modal-content video {
  max-width: 90vw !important;
  max-height: 80vh !important;
  width: auto !important;
  height: auto !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6) !important;
  background: #000 !important;
  display: block !important;
  object-fit: contain !important;
}

.video-modal-info {
  color: #fff !important;
  text-align: center !important;
  max-width: 90vw !important;
}
.video-modal-info h3 {
  font-size: 16px !important;
  font-weight: 600 !important;
  margin-bottom: 4px !important;
}
.video-modal-info p {
  font-size: 12.5px !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

.video-modal-close {
  position: absolute !important;
  top: -44px !important;
  right: 0 !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: none !important;
  color: #fff !important;
  font-size: 22px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  transition: background 0.18s !important;
}
.video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

body.modal-open {
  overflow: hidden !important;
}

/* ============ 图片结果网格 ============ */
.image-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #faf9f6;
  border: 1px solid #f0ede5;
  transition: all 0.2s;
}
.image-card:hover {
  box-shadow: 0 8px 24px rgba(138, 122, 92, 0.1);
  transform: translateY(-2px);
}
.image-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
}
.image-card-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}
.image-card:hover .image-card-actions { opacity: 1; }
.image-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.18s;
}
.image-btn:hover { background: rgba(0, 0, 0, 0.85); }
.image-btn svg { width: 14px; height: 14px; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   创作台最终字体统一（最高优先级）
   ============================================================ */

/* 全局：默认无衬线 */
body.sa-app,
body.sa-app *,
.sa-app button,
.sa-app input,
.sa-app textarea,
.sa-app select {
  font-family: var(--font-sans) !important;
}

/* 所有标题：衬线 */
body.sa-app h1,
body.sa-app h2,
body.sa-app h3,
body.sa-app h4,
.sa-hero-title,
.sa-header-title,
.sa-sub-title,
.ecom-app-title,
.ecom-placeholder-title,
.ecom-section-title,
.ecom-section-subtitle,
.material-picker-header h3,
.video-modal-info h3,
.works-empty h2 {
  font-family: var(--font-serif) !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em;
}

/* 代码块：等宽 */
body.sa-app code,
body.sa-app pre {
  font-family: var(--font-mono) !important;
}

/* ============ 侧栏用户菜单 ============ */
.side-user-menu {
  position: fixed;
  z-index: 9998;
  background: #ffffff;
  border: 1px solid #ebe7dd;
  border-radius: 14px;
  padding: 8px;
  min-width: 200px;
  box-shadow: 0 12px 40px rgba(60, 50, 30, 0.12);
  animation: userMenuIn 0.18s ease;
}
@keyframes userMenuIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.side-user-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f5f3ee;
  margin-bottom: 6px;
}
.side-user-menu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #8a7a5c;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
.side-user-menu-info {
  flex: 1;
  min-width: 0;
}
.side-user-menu-name {
  font-size: 13.5px;
  font-weight: 500;
  color: #2c2c2c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-user-menu-role {
  font-size: 11.5px;
  color: #b5b0a3;
  margin-top: 2px;
}

.side-user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #5a5648;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: background 0.15s;
}
.side-user-menu-item:hover {
  background: #faf9f6;
}
.side-user-menu-item svg {
  width: 15px;
  height: 15px;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #8a8578;
}
.side-user-menu-danger {
  color: #c66;
}
.side-user-menu-danger:hover {
  background: #fdecec;
}
.side-user-menu-danger svg {
  color: #c66;
}


/* ============ 登录弹窗 ============ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.auth-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border-radius: 24px;
  padding: 40px 40px 32px;
  box-shadow: 0 24px 80px rgba(60, 50, 30, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
  max-height: 90vh;
  overflow-y: auto;
  animation: authIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes authIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.18s;
}
.auth-close:hover { background: #f5f3ee; color: #5a5648; }
.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: #f5f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo svg { width: 48px; height: 48px; }
.auth-logo img { width: 48px; height: 48px; object-fit: contain; }
.auth-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 26px;
  font-weight: 600;
  color: #2c2c2c;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: 13.5px;
  color: #8a8578;
  text-align: center;
  margin-bottom: 28px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-field label {
  font-size: 13px;
  font-weight: 500;
  color: #5a5648;
}
.auth-field input {
  width: 100%;
  padding: 13px 16px;
  background: #faf9f6;
  border: 1px solid #ebe7dd;
  border-radius: 12px;
  font-size: 14px;
  color: #2c2c2c;
  font-family: inherit;
  outline: none;
  transition: all 0.18s;
  box-sizing: border-box;
}
.auth-field input:focus { background: #ffffff; border-color: #d6cfc0; }
.auth-field input::placeholder { color: #b5b0a3; }
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 44px; }
.auth-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.auth-eye:hover { color: #5a5648; }
.auth-eye svg { width: 18px; height: 18px; }
.auth-remember, .auth-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #8a8578;
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}
.auth-remember input,
.auth-agreement input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #8a7a5c;
  cursor: pointer;
  flex-shrink: 0;
}
.auth-agreement a { color: #4a7ab8; text-decoration: none; }
.auth-agreement a:hover { text-decoration: underline; }
.auth-error { color: #c66; font-size: 12.5px; min-height: 18px; text-align: center; }
.auth-submit {
  width: 100%;
  padding: 14px;
  background: #8a7a5c;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  margin-top: 4px;
}
.auth-submit:hover:not(:disabled) { background: #736650; transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ 协议弹窗 ============ */
.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 25, 15, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.legal-modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(60, 50, 30, 0.2);
}
.legal-modal-header {
  padding: 24px 32px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f0ede5;
  flex-shrink: 0;
}
.legal-modal-header h2 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
  font-weight: 600;
  color: #2c2c2c;
}
.legal-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.legal-modal-close:hover { background: #f5f3ee; color: #5a5648; }
.legal-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  font-size: 14px;
  line-height: 1.85;
  color: #5a5648;
  text-align: justify;
}
.legal-modal-body::-webkit-scrollbar { width: 6px; }
.legal-modal-body::-webkit-scrollbar-thumb { background: #e8e4d8; border-radius: 3px; }
.legal-modal-body p { margin-bottom: 12px; }
.legal-modal-body strong { color: #2c2c2c; font-weight: 600; }
.legal-modal-body h2 {
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 600;
  color: #2c2c2c;
  margin: 24px 0 10px;
}
.legal-modal-body h2:first-child { margin-top: 0; }
.legal-modal-body ul { margin: 10px 0 16px 22px; padding: 0; }
.legal-modal-body li { margin-bottom: 6px; }
.legal-modal-footer {
  padding: 16px 32px 20px;
  border-top: 1px solid #f0ede5;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.legal-modal-btn {
  padding: 10px 28px;
  background: #8a7a5c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
}
.legal-modal-btn:hover { background: #736650; }

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: #f5f3ee;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo svg { width: 48px; height: 48px; }
.auth-logo img { width: 48px; height: 48px; object-fit: contain; }
.auth-title {
  font-family: "Songti SC", "STSong", serif;
  font-size: 26px;
  font-weight: 600;
  color: #2c2c2c;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  font-size: 13.5px;
  color: #8a8578;
  text-align: center;
  margin-bottom: 28px;
}
.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.auth-close:hover { background: #f5f3ee; color: #5a5648; }
.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 44px; }
.auth-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #b5b0a3;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.auth-eye:hover { color: #5a5648; }
.auth-eye svg { width: 18px; height: 18px; }
.auth-remember, .auth-agreement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #8a8578;
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}
.auth-remember input,
.auth-agreement input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: #8a7a5c;
  cursor: pointer;
  flex-shrink: 0;
}
.auth-agreement a { color: #4a7ab8; text-decoration: none; }
.auth-agreement a:hover { text-decoration: underline; }
.auth-error { color: #c66; font-size: 12.5px; min-height: 18px; text-align: center; }

/* ============ 顶栏积分 ============ */
.sa-header-points {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #f5f3ee, #faf9f6);
  border: 1px solid #ebe7dd;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #8a7a5c;
  margin-right: 10px;
}
.sa-header-points svg {
  color: #b5b0a3;
  flex-shrink: 0;
}
.sa-header-points [data-points] {
  font-weight: 700;
  color: #5a5648;
}

/* Logo 悬停效果 */
.sa-side-logo {
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s;
  border-radius: 12px;
}
.sa-side-logo:hover {
  transform: scale(1.08);
  opacity: 0.85;
}
.sa-side-logo:active {
  transform: scale(0.95);
}

/* ============================================================
   电商生图 · 结果区渲染（2026-09-20 追加）
   ============================================================ */

/* 覆盖现有的 flex 居中，改为顶部对齐让 grid 展开 */
.ecom-result-body {
  display: block !important;
  align-items: initial !important;
  justify-content: initial !important;
  padding: 20px !important;
}

/* 有结果时激活 */
.ecom-result-body.has-results {
  align-items: stretch;
}

/* 结果网格 */
.ecom-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  padding-bottom: 16px;
}

.ecom-result-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #faf9f6;
  border: 1px solid #f0ede5;
  transition: all 0.2s;
}

.ecom-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(138,122,92,0.12);
  border-color: #d6cfc0;
}

.ecom-result-card img {
  width: 100%;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
  background: #fff;
}

.ecom-result-actions {
  padding: 8px;
  display: flex;
  gap: 6px;
  justify-content: center;
  border-top: 1px solid #f0ede5;
  background: #fff;
}

.ecom-result-actions button {
  padding: 5px 14px;
  border: 1px solid #ece7dd;
  border-radius: 6px;
  background: #fff;
  color: #6e6555;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.ecom-result-actions button:hover {
  border-color: #a88448;
  color: #8b6914;
  background: #faf5e8;
}

.ecom-result-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px 4px;
  font-size: 13px;
  color: #6e6555;
  border-top: 1px solid #f0ede5;
}

.ecom-result-footer .ecom-result-link {
  color: #a88448;
  text-decoration: none;
  font-weight: 500;
}

.ecom-result-footer .ecom-result-link:hover {
  text-decoration: underline;
}

/* Lightbox */
.ecom-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ecom-lb-fade 0.2s ease;
}

@keyframes ecom-lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ecom-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,14,0.88);
  cursor: zoom-out;
}

.ecom-lightbox-img {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 1;
  object-fit: contain;
  background: #fff;
}

.ecom-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
  font-family: inherit;
}

.ecom-lightbox-close:hover {
  background: rgba(255,255,255,0.28);
}

/* 加载动画（按钮上的 spinner） */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   电商生图 · 生成中状态（2026-09-20 追加）
   ============================================================ */

.ecom-generating {
  text-align: center;
  padding: 40px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.ecom-generating-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid #ece7dd;
  border-top-color: #a88448;
  border-radius: 50%;
  animation: ecom-spin 0.8s linear infinite;
}

@keyframes ecom-spin {
  to { transform: rotate(360deg); }
}

.ecom-generating-title {
  font-size: 18px;
  font-weight: 600;
  color: #3d3628;
  margin: 0 0 8px;
}

.ecom-generating-desc {
  font-size: 13px;
  color: #8a8578;
  margin: 0 0 24px;
}

.ecom-generating-progress {
  margin-bottom: 28px;
}

.ecom-progress-bar {
  width: 100%;
  height: 6px;
  background: #f0ede5;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.ecom-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b89050, #8b6914);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.ecom-progress-text {
  font-size: 13px;
  color: #6e6555;
  font-weight: 500;
}

.ecom-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.ecom-skeleton-item {
  aspect-ratio: 1;
  background: #f5f3ee;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.ecom-skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.6) 50%,
    transparent 100%
  );
  animation: ecom-shimmer 1.5s ease-in-out infinite;
}

@keyframes ecom-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.ecom-skeleton-item.filled {
  background: #fff;
}

.ecom-skeleton-item.filled .ecom-skeleton-shimmer {
  display: none;
}

/* ============================================================
   PAGE4 爆款复刻结果区
   ============================================================ */

.clone-result-wrap {
  padding: 20px 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.clone-section {
  margin-bottom: 28px;
}

.clone-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #3d3628;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0ede5;
}

.clone-grid-preview {
  background: #faf9f6;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #f0ede5;
}

.clone-grid-preview img {
  width: 100%;
  display: block;
}

.clone-analysis {
  padding: 16px 18px;
  background: #faf9f6;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #4a4033;
  border-left: 3px solid #a88448;
}

.clone-scenes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.clone-scene-card {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #f0ede5;
  border-radius: 10px;
  transition: all 0.15s;
}

.clone-scene-card:hover {
  border-color: #d4c9b0;
  box-shadow: 0 4px 12px rgba(138,122,92,0.06);
}

.clone-scene-num {
  font-size: 11px;
  color: #a88448;
  font-weight: 600;
  margin-bottom: 6px;
}

.clone-scene-title {
  font-size: 14px;
  font-weight: 600;
  color: #3d3628;
  margin-bottom: 8px;
}

.clone-scene-desc {
  font-size: 12px;
  color: #6e6555;
  line-height: 1.6;
}

.clone-scene-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #a89e8f;
}

.clone-prompt {
  padding: 16px 18px;
  background: #fdf8ef;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: #6b5f4d;
  border: 1px solid #e8d5a2;
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
