* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #000; color: #fff; min-height: 100vh; display: flex; overflow-x: hidden; }
/* 全局自定义滚动条 */
* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.5) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }



.sidebar { width: 100px; min-height: 100vh; background: rgba(0,0,0,0.35); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; flex-direction: column; align-items: center; padding: 16px 0; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; }

.sidebar-logo { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; flex-shrink: 0; }
.sl-text { color: #fff; font-size: 0.85rem; font-weight: 700; text-align: center; line-height: 1.2; }
.sl-img { max-width: 80px; max-height: 80px; border-radius: 8px; }

.sidebar-nav { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; padding: 0 10px; flex-shrink: 0; }

.sidebar-item { width: 80px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; border-radius: 12px; transition: all 0.2s; cursor: pointer; position: relative; color: #888; }
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-item.active, .sidebar-item.active .si-label { color: #667eea; }
.sidebar-item.active .si-icon-text { filter: brightness(0) saturate(100%) invert(48%) sepia(60%) saturate(440%) hue-rotate(203deg) brightness(94%) contrast(88%); }

.si-icon-wrap { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.si-icon-text { font-size: 24px; line-height: 1; }
.si-icon-img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; }
.si-label { font-size: 11px; color: #888; opacity: 0; transition: opacity 0.2s; white-space: nowrap; line-height: 1; }
.sidebar-item:hover .si-label { opacity: 1; }

.sidebar-spacer { flex: 1; min-height: 10px; }
.sidebar-bottom { display: flex; flex-direction: column; align-items: center; padding: 0 10px; margin-bottom: 8px; flex-shrink: 0; }
.sidebar-footer { font-size: 0.65rem; color: #555; text-align: center; padding: 8px 4px; flex-shrink: 0; line-height: 1.3; }

#main-content { margin-left: 100px; flex: 1; min-height: 100vh; overflow-x: hidden; }

/* 右侧用户信息面板 */
.user-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 998; }
.user-overlay.show { display: block; }
.user-panel { position: fixed; top: 20px; left: -340px; width: 320px; height: calc(100vh - 40px); background: #16162a; z-index: 999; transition: left 0.3s ease; display: flex; flex-direction: column; box-shadow: 4px 0 20px rgba(0,0,0,0.3); border-radius: 12px; overflow: hidden; }
.user-panel.show { left: 110px; }
.user-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.user-panel-title { color: #fff; font-size: 1.05rem; font-weight: 600; }
.user-panel-close { background: none; border: none; color: #888; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.user-panel-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

.user-panel-body { flex: 1; overflow-y: auto; padding: 20px; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.5) transparent; }
.user-panel-body::-webkit-scrollbar { width: 4px; }
.user-panel-body::-webkit-scrollbar-track { background: transparent; }
.user-panel-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 2px; }
.user-panel-body::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }

/* 头像 */
.up-avatar-section { text-align: center; margin-bottom: 20px; }
.up-avatar-wrap { position: relative; display: inline-block; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; cursor: pointer; background: rgba(255,255,255,0.06); }
.up-avatar-wrap:hover .up-avatar-upload-hint { opacity: 1; }
.up-avatar-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 36px; }
.up-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.up-avatar-upload-hint { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px 0; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.7rem; text-align: center; opacity: 0; transition: opacity 0.2s; }

/* 头像选择网格 */
.up-avatar-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.up-avatar-option { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; opacity: 0.7; }
.up-avatar-option img { width: 100%; height: 100%; object-fit: cover; }
.up-avatar-option:hover { opacity: 1; border-color: rgba(255,255,255,0.3); }
.up-avatar-option.up-avatar-selected { opacity: 1; border-color: #667eea; box-shadow: 0 0 8px rgba(102,126,234,0.5); }

/* 字段 */
.up-field { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.up-field-label { color: #999; font-size: 0.85rem; flex-shrink: 0; }
.up-field-value { color: #ddd; font-size: 0.85rem; text-align: right; display: flex; align-items: center; gap: 6px; }
.up-clickable { cursor: pointer; }
.up-clickable:hover { background: rgba(255,255,255,0.03); margin: 0 -12px; padding: 10px 12px; border-radius: 6px; }
.up-arrow { color: #666; font-size: 1.2rem; }
.verify-unverified { color: #e67e22; font-size:0.85rem; cursor:pointer; }
.verify-unverified:hover { text-decoration: underline; }
.verify-verified { color: #27ae60; font-size:0.85rem; }

/* 昵称编辑 */
.up-edit-btn { background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 2px; opacity: 0.5; }
.up-edit-btn:hover { opacity: 1; }
.up-edit-inline { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.up-input { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; color: #fff; padding: 8px 12px; font-size: 0.8rem; width: 100%; outline: none; }
.up-input:focus { border-color: #667eea; }
.up-input::placeholder { color: #555; }
.up-save-btn, .up-cancel-btn { background: #667eea; border: none; color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; white-space: nowrap; }
.up-cancel-btn { background: rgba(255,255,255,0.1); }
.up-cancel-btn:hover { background: rgba(255,255,255,0.15); }

/* 分隔 */
.up-section-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 14px 0; }
.up-section-title { color: #888; font-size: 0.8rem; margin-bottom: 8px; }

/* 操作按钮 */
.up-action-btn { width: 100%; padding: 10px; border: none; border-radius: 8px; font-size: 0.85rem; cursor: pointer; margin-bottom: 8px; text-align: center; background: rgba(255,255,255,0.06); color: #ccc; transition: all 0.15s; }
.up-action-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.up-logout-btn { margin-top: 4px; }
.up-logout-btn:hover { background: rgba(231,76,60,0.15); color: #e74c3c; }
.up-admin-btn { background: rgba(102,126,234,0.12); color: #667eea; }
.up-admin-btn:hover { background: rgba(102,126,234,0.25); }

/* 修改密码弹窗 */
.pwd-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 1001; display: none; align-items: center; justify-content: center; animation: modalFadeIn 0.2s ease; }
.pwd-modal-content { background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%); border: 1px solid #333; border-radius: 16px; width: 380px; max-width: 90vw; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,0.5); animation: modalSlideIn 0.28s cubic-bezier(0.21,1.02,0.73,1); position: relative; }
.pwd-modal-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #667eea, #764ba2, #e74c3c); border-radius: 16px 16px 0 0; }
.pwd-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.pwd-modal-header span { color: #fff; font-size: 0.95rem; font-weight: 600; }
.pwd-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: rgba(255,255,255,0.4); cursor: pointer; border-radius: 8px; transition: all 0.25s; z-index: 10; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); line-height: 1; padding: 0; }
.pwd-close:hover { color: #fff; background: rgba(255,75,75,0.15); border-color: rgba(255,75,75,0.3); transform: rotate(90deg); }
.pwd-modal-body { padding: 20px; }
.pwd-field { margin-bottom: 14px; }
.pwd-field label { display: block; color: #999; font-size: 0.8rem; margin-bottom: 4px; }
.pwd-input { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #e8e8e8; padding: 10px 12px; font-size: 0.85rem; outline: none; transition: all 0.3s; box-sizing: border-box; }
.pwd-input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.15); background: rgba(255,255,255,0.1); }
.pwd-input::placeholder { color: #555; }
.pwd-submit { width: 100%; padding: 11px; background: linear-gradient(135deg, #667eea, #764ba2); border: none; color: #fff; border-radius: 10px; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-top: 6px; transition: all 0.25s; letter-spacing: 0.5px; }
.pwd-submit:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(102,126,234,0.3); }
.pwd-submit:active { transform: scale(0.98); }
.pwd-tip { color: #e74c3c; font-size: 0.78rem; text-align: center; margin-top: 10px; min-height: 20px; }
.up-pwd-tip { color: #666; font-size: 0.7rem; text-align: center; margin-top: 4px; }

/* 积分记录弹窗 */
.cl-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 1000; display: none; align-items: center; justify-content: center; animation: modalFadeIn 0.2s ease; }
.cl-modal-content { background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%); border: 1px solid #333; border-radius: 16px; width: 460px; max-width: 90vw; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,0.5); animation: modalSlideIn 0.28s cubic-bezier(0.21,1.02,0.73,1); position: relative; }
.cl-modal-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #667eea, #764ba2, #e74c3c); border-radius: 16px 16px 0 0; }
.cl-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.cl-modal-header span { color: #fff; font-size: 1rem; font-weight: 600; }
.cl-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: rgba(255,255,255,0.4); cursor: pointer; border-radius: 8px; transition: all 0.25s; z-index: 10; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); line-height: 1; padding: 0; }
.cl-close:hover { color: #fff; background: rgba(255,75,75,0.15); border-color: rgba(255,75,75,0.3); transform: rotate(90deg); }
.cl-list { flex: 1; overflow-y: auto; padding: 12px 20px; min-height: 120px; }
.cl-empty { color: #555; text-align: center; padding: 40px 0; font-size: 0.85rem; }
.cl-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.cl-item:last-child { border-bottom: none; }
.cl-item-desc { color: #ccc; font-size: 0.82rem; flex: 1; }
.cl-item-amount { font-size: 0.85rem; font-weight: 600; margin-left: 12px; }
.cl-item-amount.positive { color: #2ecc71; }
.cl-item-amount.negative { color: #e74c3c; }
.cl-item-time { color: #555; font-size: 0.72rem; }
.cl-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.06); }
.cl-page-btn { background: rgba(255,255,255,0.06); border: none; color: #aaa; padding: 5px 10px; border-radius: 4px; font-size: 0.78rem; cursor: pointer; }
.cl-page-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.cl-page-btn.active { background: #667eea; color: #fff; }
.cl-page-btn:disabled { opacity: 0.3; cursor: default; }

#main-content { margin-left: 100px; flex: 1; min-height: 100vh; overflow-x: hidden; background: #000; position: relative; }

.hero-section { text-align: center; padding: 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; position: relative; overflow: hidden; }
.hero-foreground { pointer-events: none; }
.hero-section h1 { font-size: 2.2rem; margin-bottom: 1rem; }
.hero-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; padding: 3rem 2rem; max-width: 1100px; margin: 0 auto; }
.grid-item { background: #1a1a1a; border-radius: 12px; padding: 2rem; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,0.15); transition: transform 0.3s; }
.grid-item:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.grid-item h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.5rem; }
.grid-item p { color: #aaa; }

.btn-primary { padding: 12px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; letter-spacing: 0.5px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 25px rgba(102,126,234,0.4); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { padding: 0.75rem 2rem; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.4); border-radius: 8px; cursor: pointer; }
.btn-save, .btn-success { background: #27ae60; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; }
.btn-delete, .btn-danger { background: #e74c3c; color: white; border: none; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-download { padding: 0.4rem 1rem; background: #667eea; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-warning { background: #f39c12; color: white; border: none; padding: 0.4rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn-warning:hover { background: #e67e22; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; color: #ccc; font-size: 0.9rem; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-input { background: #2a2a3e; border: 1px solid #333; border-radius: 8px; padding: 10px 12px; color: #fff; font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: #667eea; }

/* contenteditable 提示词编辑器 */
.ai-prompt-editor {
  min-height: 80px;
  max-height: 200px;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  cursor: text;
}
.ai-prompt-editor:focus {
  border-color: #667eea;
}

/* 配置面板 - 字数统计 */
.cfg-prompt-wrap {
  position: relative;
}
.cfg-charcount {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
  z-index: 2;
}
.ai-prompt-editor:empty:before {
  content: attr(data-placeholder);
  color: #666;
  pointer-events: none;
}
.ref-inline-img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #667eea;
  vertical-align: middle;
  margin: 0 2px;
  display: inline;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%);
  padding: 2rem;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  border: 1px solid #333;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.28s cubic-bezier(0.21,1.02,0.73,1);
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #667eea, #764ba2, #e74c3c); border-radius: 16px 16px 0 0; }
/* 弹窗滚动条美化 */
.modal-content::-webkit-scrollbar { width: 5px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.modal-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
@keyframes modalSlideIn {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-content h2,
.modal-content h3 {
  color: #f0f0f0;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 1.2rem 0;
  padding: 0 32px 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-content .close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s;
  z-index: 10;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  line-height: 1;
}
.modal-content .close:hover {
  color: #fff;
  background: rgba(255,75,75,0.15);
  border-color: rgba(255,75,75,0.3);
  transform: rotate(90deg);
}
.modal-content form .form-group {
  margin-bottom: 1rem;
}
.modal-content form .form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.modal-content form input,
.modal-content form select,
.modal-content form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s;
  background: rgba(255,255,255,0.06);
  color: #e8e8e8;
  box-sizing: border-box;
}
.modal-content form input:focus,
.modal-content form select:focus,
.modal-content form textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background: rgba(255,255,255,0.1);
}
.modal-content form input::placeholder,
.modal-content form select::placeholder,
.modal-content form textarea::placeholder {
  color: #666;
}
.modal-content p {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #aaa;
}
.modal-content a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}
.modal-content a:hover {
  text-decoration: underline;
}
.modal-content table {
  font-size: 0.82rem;
}
.modal-content h4 {
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 8px;
}

.asset-center-container { padding: 2rem; overflow: hidden; }

/* ========== 无限画布 ========== */
.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

/* 项目选择器遮 */
.canvas-project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  gap: 24px;
}
.canvas-project-overlay h2 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.canvas-project-overlay .cpo-body {
  background: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  padding: 28px 32px;
  min-width: 380px;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.canvas-project-overlay .cpo-body .cpo-create {
  display: flex;
  gap: 8px;
}
.canvas-project-overlay .cpo-body .cpo-create input {
  flex: 1;
  padding: 9px 14px;
  border: 2px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  background: #d0d0d0;
  color: #000;
}
.canvas-project-overlay .cpo-body .cpo-create input:focus {
  border-color: #667eea;
}
.canvas-project-overlay .cpo-body .cpo-list-title {
  font-size: 0.85rem;
  color: #aaa;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 8px;
}
.canvas-project-overlay .cpo-body .cpo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.canvas-project-overlay .cpo-body .cpo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.canvas-project-overlay .cpo-body .cpo-item:hover {
  border-color: #667eea;
  background: #222;
}
.canvas-project-overlay .cpo-body .cpo-item .cpo-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.canvas-project-overlay .cpo-body .cpo-item .cpo-item-meta {
  font-size: 0.72rem;
  color: #aaa;
}
.cpo-del-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #ccc;
  font-size: 0.6rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}
.cpo-del-btn:hover {
  background: #e74c3c;
  color: white;
}
.canvas-workspace {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #111;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  overflow: hidden;
  cursor: grab;
}
.canvas-workspace:active {
  cursor: grabbing;
}
#canvas-modules {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}
#canvas-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-origin: 0 0;
  overflow: visible;
}

/* 连线悬停高亮 */
#canvas-svg .cm-conn.cm-conn-hover {
  stroke: #e74c3c !important;
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 4px rgba(231,76,60,0.4));
}

/* 已读取的连线（深紫色 */
#canvas-svg .cm-conn.cm-conn-loaded {
  stroke: #6a0dad !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 4px rgba(106,13,173,0.3));
}

.canvas-svg .conn-line {
  transition: d 0.15s;
}

/* === 端口（拖拽连线）=== */

/* 共用样式：虚线圆 + 号，无填充色 */
.canvas-module .cm-port {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1.5px dashed rgba(255,255,255,0.55);
  cursor: crosshair;
  z-index: 10;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
/* 扩大点击/悬停触发区域 */
.canvas-module .cm-port::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  pointer-events: auto;
}
/* + */
.canvas-module .cm-port::after {
  content: '+';
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 300;
  line-height: 1;
  pointer-events: none;
}
.canvas-module .cm-port:hover {
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 0 14px 6px rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.85);
}
.canvas-module .cm-port:hover::after {
  color: rgba(255,255,255,0.9);
}

/* 已连线：保持虚线透明，略加亮显示 */
.canvas-module .cm-port.cm-connected {
  border-color: rgba(255,255,255,0.8);
}
.canvas-module .cm-port.cm-connected::after {
  color: rgba(255,255,255,0.85);
}
.canvas-module .cm-port.cm-connected:hover {
  box-shadow: 0 0 14px 6px rgba(255,255,255,0.35);
  transform: translateY(-50%) scale(1.15);
}

/* 输出端口（右侧）—模块外边10px */
.canvas-module .cm-port-out {
  right: -19px;
  transform: translateY(-50%);
}
/* 输入端口（左侧） */
.canvas-module .cm-port-in {
  left: -19px;
  transform: translateY(-50%);
}

/* 拖拽连线时吸附高 */
.canvas-module.cm-snap-active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 0 24px 8px rgba(255,255,255,0.15) !important;
}

/* 模块处于连线模式时，端口发光放大吸引注意 */
.cm-connecting .cm-port-out {
  animation: cm-port-pulse 1s ease-in-out infinite alternate;
}
.cm-connecting .cm-port-out:hover {
  box-shadow: 0 0 20px 10px rgba(255,255,255,0.3);
  transform: translateY(-50%) scale(1.2);
}
@keyframes cm-port-pulse {
  from { box-shadow: 0 0 4px 2px rgba(255,255,255,0.1); }
  to { box-shadow: 0 0 14px 6px rgba(255,255,255,0.3); }
}

/* 模块 300×200 纯展示模 */
.canvas-module {
  position: absolute;
  background: #1a1a2e;
  border-radius: 8px;
  z-index: 2;
  cursor: move;
  transition: box-shadow 0.15s;
}
/* 结果展示区，结果填满后延展模块——不裁剪，让外置端点可见 */
.canvas-module:hover {
  box-shadow: 0 4px 20px rgba(102,126,234,0.25);
}

/* 无结果时居中显示模块 */
.canvas-module .cm-empty-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8888aa;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  user-select: none;
  pointer-events: none;
}

/* 结果展示 */
.canvas-module .cm-display {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.canvas-module .cm-display img,
.canvas-module .cm-display video {
  width: 100%;
  height: 100%;
  display: block;
}

/* 状态指示（左下角小字） */
.canvas-module .cm-st {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  padding: 0 4px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 6;
}

/* 删除按钮（右上角红色圆，悬停才显示） */
.canvas-module .cm-del-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.12s;
}
.canvas-module:hover .cm-del-btn {
  display: flex;
}
.canvas-module .cm-del-btn:hover {
  transform: scale(1.2);
}

/* 底部操作按钮组（预览 + 下载）悬停显 */
.canvas-module .cm-result-actions {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  z-index: 10;
}
.canvas-module.has-result:hover .cm-result-actions {
  display: flex;
}
.canvas-module .cm-result-actions .cm-dl-btn,
.canvas-module .cm-result-actions .cm-prev-btn {
  padding: 5px 14px;
  background: rgba(0,0,0,0.55);
  color: white;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.canvas-module .cm-result-actions .cm-dl-btn {
  text-decoration: none;
  border: none;
}
.canvas-module .cm-result-actions .cm-prev-btn {
  border: none;
}
.canvas-module .cm-result-actions .cm-dl-btn:hover,
.canvas-module .cm-result-actions .cm-prev-btn:hover {
  background: rgba(0,0,0,0.85);
}

/* ===== 折叠3D 模块 ===== */
.canvas-module.type-fold3d {
  background: #111122;
  overflow: hidden;
}
.canvas-module .cm-display-fold3d {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.canvas-module .cm-display-fold3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* 折叠3D 配置面板 */
.cm-cfg-header {
  color: #e0e0ff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.5px;
}
.cm-fold-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cm-fold-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ccc;
  font-size: 0.78rem;
  margin-bottom: 6px;
}
.cm-fold-label strong {
  color: #fff;
  font-size: 0.85rem;
}
.cm-fold-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.cm-fold-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}
.cm-fold-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.cm-fold-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}
.cm-fold-range-labels {
  display: flex;
  justify-content: space-between;
  color: rgba(255,255,255,0.3);
  font-size: 0.68rem;
  margin-top: 4px;
}
.cm-fold-select {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #e0e0ff;
  padding: 8px 10px;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cm-fold-select:focus {
  border-color: #667eea;
}
.cm-fold-select option {
  background: #1a1a2e;
  color: #e0e0ff;
}
.cm-fold-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.cm-fold-btn {
  background: rgba(102,126,234,0.15) !important;
  border: 1px solid rgba(102,126,234,0.3) !important;
  color: #aabbff !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  font-size: 0.78rem !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.cm-fold-btn:hover {
  background: rgba(102,126,234,0.3) !important;
  color: #fff !important;
}
.cm-fold-tex-name {
  color: #888;
  font-size: 0.72rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cm-fold-hint {
  padding: 10px 14px;
  color: rgba(255,255,255,0.35);
  font-size: 0.72rem;
  text-align: center;
}

/* ===== 折叠3D SVG 交互覆盖层 ===== */
.cm-fold3d-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.cm-fold3d-overlay svg {
  width: 100%;
  height: 100%;
  display: block;
}
.cm-fold3d-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: none;
}
.cm-fold3d-line {
  stroke: #ff6644;
  stroke-width: 2;
  stroke-dasharray: 6,3;
  cursor: ew-resize;
  pointer-events: stroke;
  transition: stroke 0.2s;
}
.cm-fold3d-line:hover {
  stroke: #ff8844;
  stroke-width: 3;
}
.cm-fold3d-line.active {
  stroke: #ffaa66;
  stroke-width: 3;
  stroke-dasharray: none;
}
.cm-fold3d-dim {
  fill: rgba(255,255,255,0.7);
  font-size: 12px;
  font-family: Arial, sans-serif;
  text-anchor: middle;
  dominant-baseline: hanging;
  pointer-events: none;
  user-select: none;
}
.cm-fold3d-arc {
  fill: none;
  stroke: rgba(102,126,234,0.6);
  stroke-width: 2;
  transition: stroke 0.2s;
}
.cm-fold3d-arc:hover {
  stroke: rgba(102,126,234,0.9);
  stroke-width: 2.5;
}
.cm-fold3d-angle {
  fill: rgba(255,255,255,0.75);
  font-size: 11px;
  font-family: Arial, sans-serif;
  text-anchor: start;
  dominant-baseline: auto;
  user-select: none;
}
.cm-fold3d-handle {
  fill: #ff6644;
  cursor: ew-resize;
  pointer-events: all;
  transition: fill 0.2s;
}
.cm-fold3d-handle:hover {
  fill: #ff8844;
}

/* 角度选择器弹窗 */
.cm-fold-angle-picker {
  position: fixed;
  z-index: 10001;
  background: #1a1a2e;
  border: 1px solid rgba(102,126,234,0.4);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  min-width: 180px;
}
.cm-fold-angle-picker .cm-fold-slider {
  margin: 4px 0;
}

/* ========== 配置面板（模块下方弹出）========== */
.cm-cfg-panel {
  position: absolute;
  background: #1a1a1a;
  border: 1px solid #333;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  z-index: 10000;
  padding: 8px 10px;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 320px;
  border-radius: 8px;
}
.cm-cfg-panel .cm-cfg-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-model {
  flex: 1;
  min-width: 0;
  padding: 3px 5px;
  border: 1.5px solid #444;
  border-radius: 5px;
  font-size: 0.7rem;
  background: #d0d0d0;
  color: #000;
  cursor: pointer;
}
.cm-cfg-panel .cm-cfg-model:focus {
  outline: none;
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-upbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #333;
  cursor: pointer;
  font-size: 0.75rem;
  flex-shrink: 0;
  color: #fff;
}
.cm-cfg-panel .cm-cfg-upbtn:hover {
  background: #444;
}
.cm-cfg-panel .cm-uthumbs {
  display: flex;
  flex-direction: row-reverse;
  margin-left: 2px;
  flex-shrink: 0;
}
.cm-cfg-panel .cm-uthumb {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  border: 1.5px solid white;
  margin-left: -8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.cm-cfg-panel .cm-uthumb:first-child {
  margin-left: 0;
}
.cm-cfg-panel .cm-cfg-prompt {
  width: 100%;
  padding: 5px 8px;
  border: 1.5px solid #444;
  border-radius: 5px;
  font-size: 0.72rem;
  background: #d0d0d0;
  color: #000;
  resize: vertical;
  min-height: 86px;
  max-height: 80px;
  box-sizing: border-box;
  font-family: inherit;
}
.cm-cfg-panel .cm-cfg-prompt:focus {
  outline: none;
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-prompt[contenteditable] {
  resize: none;
  background: #1a1a1a;
  color: #e0e0e0;
  min-height: 86px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  cursor: text;
  outline: none;
}
.cm-cfg-panel .cm-cfg-prompt[contenteditable]:focus {
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-params {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.cm-cfg-panel .cm-cfg-params select {
  flex: 1;
  min-width: 50px;
  padding: 3px 5px;
  border: 1.5px solid #444;
  border-radius: 5px;
  font-size: 0.68rem;
  background: #d0d0d0;
  color: #000;
  cursor: pointer;
}
.cm-cfg-panel .cm-cfg-params select option { background: #1a1a1a; color: #fff; }
.cm-cfg-panel .cm-cfg-params select:focus {
  outline: none;
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-gen {
  padding: 5px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: opacity 0.15s;
}
.cm-cfg-panel .cm-cfg-gen:hover {
  opacity: 0.85;
}

.cm-cfg-panel .cm-cfg-plain {
  padding: 5px 10px;
  background: rgba(255,255,255,0.1);
  color: #ccc;
  border: 1.5px solid #555;
  border-radius: 5px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.cm-cfg-panel .cm-cfg-plain:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: #888;
}

/* 模块内文本显示区 */
.canvas-module .cm-display-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 0.85rem;
  color: #ddd;
  overflow: auto;
  word-break: break-word;
  white-space: pre-wrap;
}

/* 预设提示词名称标- 浮动在模块左上角 */
.canvas-module .cm-preset-label {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 12;
  padding: 2px 8px;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

/* 结果弹窗放大 */
#cm-result-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: modalFadeIn 0.2s ease;
}
#cm-result-modal img,
#cm-result-modal video {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  object-fit: contain;
}

/* 右键菜单 */
.canvas-context-menu {
  position: fixed;
  z-index: 99999;
  background: #1a1a1a;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  min-width: 150px;
  padding: 4px;
  overflow: hidden;
}
.canvas-context-menu .ctx-item {
  padding: 8px 14px;
  font-size: 0.82rem;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.canvas-context-menu .ctx-item:hover {
  background: #333;
  color: #667eea;
}

/* @图片选择 */
.cm-picker {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  z-index: 10;
}
.asset-filters { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.filter-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-btn { padding: 0.5rem 1.2rem; border: 1px solid #444; border-radius: 20px; background: #1a1a1a; cursor: pointer; font-size: 0.9rem; color: #fff; }
.filter-btn.active, .filter-btn:hover { background: #667eea; color: white; border-color: #667eea; }
.search-input { padding: 0.5rem 1rem; border: 1px solid #444; border-radius: 8px; font-size: 0.95rem; min-width: 200px; background: #d0d0d0; color: #000; }

/* ===== 资产中心新布局 ===== */
.folder-bar-outer {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.asset-folder-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  position: relative;
}

.folder-scroll-wrapper {
  overflow: visible;
  flex: 1;
  min-width: 0;
}

.folder-scroll-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #aaa;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  z-index: 2;
  line-height: 1;
  padding: 0;
}
.folder-scroll-btn:hover {
  border-color: #667eea;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(102,126,234,0.15);
}

.folder-list {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.5) transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.folder-list::-webkit-scrollbar { height: 5px; }
.folder-list::-webkit-scrollbar-track { background: transparent; }
.folder-list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
.folder-list::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }
.folder-item {
  width: 80px;
  height: 80px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.folder-item:hover { border-color: #667eea; box-shadow: 0 2px 8px rgba(102,126,234,0.15); }
.folder-item.active { border-color: #667eea; box-shadow: 0 0 0 2px #667eea; }

.fi-thumbs {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
  padding: 4px;
}
.fi-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: #252525;
}
.fi-thumb-video { background: #2a1a1a; }
.fi-thumb-image { background: #1a1a2a; }
.fi-thumb-doc { background: #1a2a1a; }
.fi-thumb-audio { background: #2a2a1a; }
.fi-thumb-empty { background: #222; }

.fi-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  font-size: 0.75rem;
  color: #ccc;
  background: rgba(0,0,0,0.65);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: none;
  gap: 2px;
  line-height: 1.4;
}
.folder-item.active .fi-name { color: #667eea; font-weight: 600; }
.fi-count {
  font-size: 0.5rem;
  color: #aaa;
  background: #333;
  padding: 0 4px;
  border-radius: 6px;
  line-height: 1.4;
  flex-shrink: 0;
  margin-left: 2px;
}
.folder-item.active .fi-count { background: #e0e4ff; color: #667eea; }

.fi-del {
  display: none;
  position: absolute;
  top: 1px;
  right: 1px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 0.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.folder-item:hover .fi-del { display: flex; }
.fi-del:hover { transform: scale(1.15); }

/* 文件夹操作区（共享 + 删除） */
.fi-actions {
  display: none;
  position: absolute;
  top: 1px;
  right: 1px;
  gap: 2px;
  z-index: 10;
}
.folder-item:hover .fi-actions { display: flex; }

.fi-share {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(102,126,234,0.7);
  color: #fff;
  font-size: 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  line-height: 1;
}
.fi-share:hover { transform: scale(1.15); background: rgba(102,126,234,0.9); }

.folder-add-btn {
  width: 80px;
  height: 80px;
  border: 1px dashed #555;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0px;
  transition: all 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1.2;
}
.folder-add-btn:hover { border-color: #667eea; color: #667eea; }
.folder-add-btn .fab-line1 {
  font-size: 0.7rem;
  color: #aaa;
}
.folder-add-btn .fab-line2 {
  font-size: 1.6rem;
  color: #888;
  line-height: 1;
}
.folder-add-btn .fab-line3 {
  font-size: 0.62rem;
  color: #999;
}

/* 新建文件夹弹 */
.folder-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}
.folder-modal-box {
  background: #1a1a1a;
  border-radius: 14px;
  padding: 28px 32px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 12px 48px rgba(0,0,0,0.4);
}
.folder-modal-box h3 {
  margin: 0 0 16px 0;
  font-size: 1.05rem;
  color: #fff;
}
.folder-modal-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
  background: #d0d0d0;
  color: #000;
}
.folder-modal-box input:focus { border-color: #667eea; }
.folder-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
}
.folder-modal-actions button {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid #444;
  background: #1a1a1a;
  color: #ccc;
  transition: all 0.15s;
}
.folder-modal-actions button:hover { border-color: #667eea; }
.folder-modal-actions .fm-primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}
.folder-modal-actions .fm-primary:hover { opacity: 0.9; }

.asset-type-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.asset-type-bar .type-btn {
  padding: 5px 16px;
  border: 1px solid #444;
  border-radius: 20px;
  background: #1a1a1a;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  color: #fff;
}
.asset-type-bar .type-btn.active,
.asset-type-bar .type-btn:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
}
.type-bar-fill { flex: 1; min-width: 8px; }

/* 批量操作按钮 */
.batch-actions-sep {
  width: 100px;
  flex-shrink: 0;
}
.batch-action-btn {
  padding: 5px 14px;
  border: 1.5px solid #f0c040;
  border-radius: 20px;
  background: transparent;
  color: #f0c040;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.batch-action-btn:hover {
  background: #f0c040;
  color: #1a1a1a;
}
.batch-action-btn.batch-danger {
  border-color: #e74c3c;
  color: #e74c3c;
}
.batch-action-btn.batch-danger:hover {
  background: #e74c3c;
  color: #fff;
}
.batch-action-btn.active {
  background: #f0c040;
  color: #1a1a1a;
}
.batch-action-btn.batch-danger.active {
  background: #e74c3c;
  color: #fff;
}

/* 批量选择模式 - 资产卡片 */
.asset-card.batch-selectable {
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: -1px;
  transition: outline-color 0.15s, transform 0.15s;
}
.asset-card.batch-selectable:hover {
  transform: translateY(-2px);
  outline-color: rgba(102,126,234,0.4);
}
.asset-card.batch-selectable.batch-selected {
  outline-color: #667eea;
  box-shadow: 0 0 0 2px #667eea, 0 4px 16px rgba(102,126,234,0.3);
}
.asset-card-batch-cb {
  display: none;
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  z-index: 5;
  cursor: pointer;
  accent-color: #667eea;
  border-radius: 4px;
}
.batch-selectable .asset-card-batch-cb {
  display: block;
}

/* 批量操作栏 */
.batch-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  margin-top: 8px;
  background: rgba(102,126,234,0.12);
  border: 1px solid rgba(102,126,234,0.25);
  border-radius: 10px;
  font-size: 0.85rem;
}
.batch-bar.show {
  display: flex;
}
.batch-bar .batch-count {
  color: #ccc;
}
.batch-bar .batch-count strong {
  color: #667eea;
  font-size: 1rem;
}
.batch-bar .batch-bar-actions {
  display: flex;
  gap: 8px;
}
.batch-bar .batch-bar-btn {
  padding: 5px 18px;
  border-radius: 20px;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.batch-bar .batch-bar-btn.confirm {
  background: #667eea;
  color: #fff;
}
.batch-bar .batch-bar-btn.confirm:hover {
  background: #5a6fd6;
}
.batch-bar .batch-bar-btn.confirm.danger {
  background: #e74c3c;
}
.batch-bar .batch-bar-btn.confirm.danger:hover {
  background: #c0392b;
}
.batch-bar .batch-bar-btn.cancel {
  background: rgba(255,255,255,0.08);
  color: #ccc;
}
.batch-bar .batch-bar-btn.cancel:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.type-upload-btn {
  padding: 5px 16px;
  border: 1.5px dashed #667eea;
  border-radius: 20px;
  background: transparent;
  color: #667eea;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  white-space: nowrap;
}
.type-upload-btn:hover {
  background: #667eea;
  color: white;
}
.type-share-btn {
  padding: 5px 12px;
  border: 1.5px solid #667eea;
  border-radius: 20px;
  background: transparent;
  color: #667eea;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  white-space: nowrap;
  margin-right: 6px;
}
.type-share-btn:hover {
  background: #667eea;
  color: white;
}
.type-share-label {
  font-size: 0.78rem;
  color: #aaa;
  white-space: nowrap;
  padding: 4px 12px;
  margin: 0 4px;
  background: rgba(102,126,234,0.08);
  border: 1px solid rgba(102,126,234,0.18);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.type-share-label::before {
  content: '🔗';
  font-size: 0.7rem;
}

/* 资产库管理员用户搜索 */
.ac-user-filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 6px;
}
.ac-user-search {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  color: #ccc;
  padding: 4px 12px;
  font-size: 0.8rem;
  outline: none;
  width: 160px;
  transition: all 0.15s;
}
.ac-user-search:focus {
  border-color: #667eea;
  color: #fff;
  width: 200px;
}
.ac-user-search::placeholder { color: #888; }
.ac-ddown { position: relative; display: inline-flex; }
.ac-back-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.8rem;
  white-space: nowrap;
  transition: all 0.15s;
}
.ac-back-btn:hover {
  border-color: #667eea;
  color: #fff;
}
.ac-user-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  color: #ccc;
  padding: 4px 28px 4px 10px;
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
  max-width: 200px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.ac-user-select:hover { border-color: #667eea; color: #fff; }
.ac-user-select:focus { border-color: #667eea; color: #fff; }
.ac-user-select option { background: #1a1a1a; color: #fff; }
.ac-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1e1e2f;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  min-width: 240px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.acu-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  transition: background 0.1s;
}
.acu-item:hover { background: rgba(102,126,234,0.15); }
.acu-item.acu-empty {
  color: #888;
  cursor: default;
  justify-content: center;
}
.acu-name { color: #fff; font-weight: 500; }
.acu-id { color: #888; font-size: 0.75rem; }
.acu-phone { color: #666; font-size: 0.75rem; margin-left: auto; }
.acu-close {
  cursor: pointer;
  opacity: 0.6;
  margin-left: 4px;
  font-size: 0.85rem;
}
.acu-close:hover { opacity: 1; }
.ac-user-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(102,126,234,0.15);
  border: 1px solid rgba(102,126,234,0.3);
  border-radius: 16px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: #ccc;
  white-space: nowrap;
}

.asset-content-area { min-height: 300px; }
.asset-empty {
  padding: 60px 20px;
  text-align: center;
  color: #666;
  font-size: 0.95rem;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 14px;
}

.asset-card {
  width: 180px;
  height: 250px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s;
  flex-shrink: 0;
}
.asset-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }

.asset-del-btn {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: #e74c3c;
  color: white;
  font-size: 0.7rem;
  cursor: pointer;
  z-index: 5;
  line-height: 1;
  padding: 0;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.asset-card:hover .asset-del-btn { display: flex; }
.asset-del-btn:hover { transform: scale(1.15); }

.asset-video-play-btn {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 6;
  line-height: 1;
  padding: 0;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  transition: all 0.2s;
}
.asset-card:hover .asset-video-play-btn { display: flex; }
.asset-video-play-btn:hover { background: rgba(0,0,0,0.75); transform: translate(-50%,-50%) scale(1.1); border-color: #fff; }

.asset-card .asset-preview {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.asset-card .asset-preview video,
.asset-card .asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ac-icon {
  font-size: 48px;
  opacity: 0.4;
}

.asset-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  font-size: 0.78rem;
  gap: 8px;
}
.ao-name {
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.ao-type {
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;
  flex-shrink: 0;
  background: rgba(0,0,0,0.3);
  padding: 1px 7px;
  border-radius: 8px;
}

/* 预览弹窗 */
.asset-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}
.asset-preview-modal .apm-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.asset-preview-modal #apm-content {
  cursor: default;
  width: 90vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
  max-width: 90vw;
  max-height: 90vh;
}
.asset-preview-modal #apm-content img,
.asset-preview-modal #apm-content video {
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.apm-placeholder {
  text-align: center;
  color: white;
  font-size: 1.2rem;
}
.apm-placeholder a {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 24px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* 资产预览弹窗 - 重命名栏 */
.apm-namebar {
  text-align: center;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.apm-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.apm-name-text {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apm-name-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid #667eea;
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 0.95rem;
  outline: none;
  width: 260px;
}
.apm-rename-btn {
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
  user-select: none;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #ccc;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.apm-rename-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.apm-rename-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.apm-save-btn, .apm-cancel-btn {
  padding: 4px 12px;
  border: none;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
}
.apm-save-btn {
  background: #667eea;
  color: #fff;
}
.apm-save-btn:hover { background: #5a6fd6; }
.apm-cancel-btn {
  background: rgba(255,255,255,0.1);
  color: #aaa;
}
.apm-cancel-btn:hover { background: rgba(255,255,255,0.15); }


.admin-panel { padding: 2rem; }
.admin-tabs { display: flex; flex-direction: row; gap: 0; margin-bottom: 2rem; border-bottom: 2px solid #333; }
.tab-btn { padding: 0.6rem 1.2rem; border: none; background: none; cursor: pointer; font-size: 0.95rem; color: #aaa; }
.tab-btn.active { color: #667eea; border-bottom: 2px solid #667eea; margin-bottom: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
/* ========== 仪表盘重构 ========== */
.dashboard-container { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.dash-section-full { grid-column: 1 / -1; }
.dash-section { background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%); border-radius: 14px; padding: 1.2rem; border: 1px solid rgba(255,255,255,0.06); box-shadow: 0 4px 20px rgba(0,0,0,0.3); transition: box-shadow 0.3s ease; }
.dash-section:hover { box-shadow: 0 6px 30px rgba(0,0,0,0.4); }
.dash-section-title { font-size: 0.95rem; font-weight: 600; color: #e0e0ff; margin: 0 0 0.75rem 0; display: flex; align-items: center; gap: 0.5rem; letter-spacing: 0.3px; }
.dash-icon { font-size: 1.1rem; }
.dash-grid { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; }
.dash-grid-2 { display: flex; gap: 0.6rem; }
.dash-grid-3 { display: flex; gap: 0.6rem; }
.dash-grid-4 { display: flex; gap: 0.6rem; }
.dash-grid-2 > * { flex: 1; min-width: 0; }
.dash-grid-3 > * { flex: 1; min-width: 0; }
.dash-grid-4 > * { flex: 1; min-width: 0; }
.dash-sub-grid { margin-top: 0.6rem; }

/* 仪表盘卡片 - 毛玻璃质感 */
.dash-card { border-radius: 10px; padding: 0.7rem 0.6rem; text-align: center; position: relative; overflow: hidden; transition: transform 0.25s ease, box-shadow 0.25s ease; cursor: default; }
.dash-card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%); opacity: 0; transition: opacity 0.4s ease; }
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.35); }
.dash-card:hover::before { opacity: 1; }
.dash-card .dash-val { font-size: 1.5rem; font-weight: 700; color: #fff; position: relative; z-index: 1; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.dash-card .dash-label { font-size: 0.75rem; color: rgba(255,255,255,0.65); margin-top: 0.2rem; position: relative; z-index: 1; }
.dash-card-total { background: linear-gradient(135deg, #1a2a4a, #2d5a8e); border: 1px solid rgba(100,150,255,0.15); }
.dash-card-success { background: linear-gradient(135deg, #1a3a2a, #2d7a4e); border: 1px solid rgba(100,255,150,0.15); }
.dash-card-warn { background: linear-gradient(135deg, #3a3a1a, #8a7a2e); border: 1px solid rgba(255,200,80,0.15); }
.dash-card-danger { background: linear-gradient(135deg, #3a1a1a, #8a2e2e); border: 1px solid rgba(255,80,80,0.15); }
.dash-card-user { background: linear-gradient(135deg, #2a1a4a, #5a2e8a); border: 1px solid rgba(180,100,255,0.15); }
.dash-card-credits { background: linear-gradient(135deg, #1a2a4a, #2e5a8a); border: 1px solid rgba(80,150,255,0.15); }
.dash-card-consume { background: linear-gradient(135deg, #3a2a1a, #7a4a2e); border: 1px solid rgba(255,150,80,0.15); }

/* 任务类型明细卡 */
.dash-type-card { background: rgba(37,37,50,0.7); backdrop-filter: blur(8px); border-radius: 8px; padding: 0.4rem 0.4rem; text-align: center; border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s ease, transform 0.2s ease; }
.dash-type-card:hover { background: rgba(50,50,70,0.8); transform: translateY(-2px); }
.dash-type-name { font-size: 0.75rem; color: #ccc; margin-bottom: 0.2rem; }
.dash-type-ok { color: #4caf50; font-weight: 600; font-size: 0.8rem; }
.dash-type-run { color: #ffc107; font-weight: 600; font-size: 0.8rem; }
.dash-type-fail { color: #f44336; font-weight: 600; font-size: 0.8rem; }

/* 用户组 */
.dash-user-groups { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.dash-group-item { display: flex; align-items: center; gap: 0.5rem; background: rgba(37,37,50,0.7); backdrop-filter: blur(8px); padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s ease; }
.dash-group-item:hover { background: rgba(50,50,70,0.8); }
.dash-group-label { color: #aaa; }
.dash-group-count { color: #e0e0ff; font-weight: 600; min-width: 1.5rem; text-align: center; }

/* 模型排名 */
.dash-ranking-empty { color: #666; text-align: center; padding: 2rem; font-size: 0.9rem; }
.dash-rank-table { width: 100%; border-collapse: collapse; }
.dash-rank-table th { text-align: left; font-size: 0.8rem; color: #999; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.dash-rank-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.04); color: #ddd; font-size: 0.85rem; transition: background 0.2s ease; }
.dash-rank-table tr:last-child td { border-bottom: none; }
.dash-rank-num { width: 3rem; text-align: center; font-size: 1.1rem; }
.dash-rank-count { text-align: right; font-weight: 600; color: #4caf50; }
.dash-rank-table tr:hover td { background: rgba(255,255,255,0.03); }

@media (max-width: 1100px) {
  .dashboard-container { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .dash-grid-2 { flex-direction: column; }
}
@media (max-width: 400px) {
  .dash-grid-3 { flex-direction: column; }
}
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #333; }
.admin-table th { background: #222; font-weight: 500; color: #fff; }
.admin-table td { color: #fff; }
/* 模型拖拽排序样式 */
.admin-table tr[data-model-id] { cursor: grab; }
.admin-table tr[data-model-id]:active { cursor: grabbing; }
.drag-handle { font-size:1.1rem;color:#bbb;user-select:none;line-height:1; }
.drag-handle-cell:hover .drag-handle { color:#667eea; }
tr.model-dragging { opacity:0.35; }
tr.model-drag-over { outline:2px dashed #667eea; outline-offset:-2px; background:rgba(102,126,234,0.06) !important; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* DB 管理卡片 */
.dbmgr-card:hover { border-color:#667eea !important; transform:translateY(-2px); box-shadow:0 4px 12px rgba(102,126,234,0.15); }
.dbmgr-category h4 { font-size:0.95rem; color:#ccc; display:flex; align-items:center; gap:6px; margin:0 0 8px 0; }
/* 管理后台表单元素 */
.admin-panel input:not([type="checkbox"]):not([type="hidden"]),
.admin-panel select,
.admin-panel textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #444;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s;
  background: #d0d0d0;
  color: #000;
  box-sizing: border-box;
}
.admin-panel input:not([type="checkbox"]):not([type="hidden"]):focus,
.admin-panel select:focus,
.admin-panel textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #e8e8e8;
}
.admin-panel .section-header h3 { color: #fff; }
.admin-panel h4 { color: #fff; }
.status-badge { padding: 0.3rem 0.8rem; border-radius: 12px; font-size: 0.8rem; }
.status-badge.success { background: #d4edda; color: #155724; }
.status-badge.warning { background: #fff3cd; color: #856404; }
.status-badge.danger { background: #f8d7da; color: #721c24; }

/* ===== 预设提示词管理页===== */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.preset-card {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px;
}
.preset-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.preset-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}
.preset-type-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(102,126,234,0.2);
  color: #667eea;
}
.preset-prompt-preview {
  font-size: 0.8rem;
  color: #999;
  line-height: 1.5;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
}
.preset-card-actions {
  display: flex;
  gap: 6px;
}
.preset-card-actions .btn-small {
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: 4px;
  border: 1px solid #555;
  background: transparent;
  color: #ccc;
  cursor: pointer;
}
.preset-card-actions .btn-small:hover {
  background: rgba(255,255,255,0.08);
}
.preset-card-actions .btn-danger {
  color: #ff6b6b;
  border-color: #ff6b6b;
}
.preset-card-actions .btn-danger:hover {
  background: rgba(255,107,107,0.1);
}

/* ===== 系统配置卡片布局 ===== */
.config-section { background:#1a1a2e; border:1px solid #333; border-radius:8px; margin-bottom:14px; overflow:hidden; }
.config-section-title { padding:10px 16px; font-size:0.9rem; font-weight:600; color:#fff; background:#222; border-bottom:1px solid #333; }
.config-section-body { padding:14px 16px; }
.config-section-body .form-group { margin-bottom:0; }
.config-section-body .form-group + .form-group { margin-top:10px; }
.config-logo-row { display:flex; align-items:center; gap:14px; }
.config-nav-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:12px; }
.config-nav-item { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px; background:#222; border-radius:8px; text-align:center; }
.config-nav-preview { width:40px; height:40px; border:1px solid #444; border-radius:6px; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#2a2a2a; }
.config-nav-label { font-size:0.8rem; color:#ccc; }
.config-nav-actions { display:flex; gap:4px; }
.config-hero-row { display:flex; gap:20px; }
.config-hero-col { flex:1; min-width:0; }
.config-hero-label { font-weight:500; font-size:0.85rem; margin-bottom:6px; color:#aaa; }

/* 管理面板-头像管理 */
.config-avatar-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:12px; }
.config-avatar-item { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px; background:#222; border-radius:8px; text-align:center; }
.config-avatar-preview { width:60px; height:60px; border:1px solid #444; border-radius:50%; display:flex; align-items:center; justify-content:center; overflow:hidden; background:#2a2a2a; }
.config-avatar-label { font-size:0.75rem; color:#ccc; }
.config-avatar-actions { display:flex; gap:4px; }

.footer-info { text-align: center; padding: 2rem; color: #666; border-top: 1px solid #222; margin-top: 2rem; }

/* ========== 画布小地========== */
.canvas-minimap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 180px;
  height: 130px;
  background: #333;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  z-index: 60;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}
.canvas-minimap:hover {
  opacity: 0.95;
}
.canvas-minimap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 768px) {
  #main-content { margin-left: 0; }
  .generator-container { grid-template-columns: 1fr; }
}

/* ========== AI生成页面三栏布局 ========== */
.ai-gen-container {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
}

.ai-gen-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  background: #111;
  border-bottom: 1px solid #333;
}

.ai-tab-btn {
  padding: 8px 20px;
  background: rgba(255,255,255,0.05);
  color: #888;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-tab-btn:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.ai-tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.ai-gen-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ========== AI生成页 - 布局样式 ========== */
.ai-gen-body .result-panel {
  flex: 1;
  min-width: 0;
}
.ai-gen-body .config-panel {
  width: 40%;
  min-width: 400px;
  max-width: 500px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  background: #0a0a0a;
  border-radius: 0;
  box-shadow: none;
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  max-height: none;
}

/* 覆盖旧样 */
.ai-gen-body .config-panel h3 {
  display: block;
}
.ai-gen-body .config-panel form {
  flex: none;
  overflow: visible;
  padding: 0;
}
.ai-gen-body .config-panel .form-group {
  margin-bottom: 0;
}
.ai-gen-body .config-panel input,
.ai-gen-body .config-panel select,
.ai-gen-body .config-panel textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #1a1a1a;
  color: #fff;
  transition: border-color 0.2s;
  box-shadow: none;
}
.ai-gen-body .config-panel input:focus,
.ai-gen-body .config-panel select:focus,
.ai-gen-body .config-panel textarea:focus {
  border-color: #667eea;
  background: #222;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}
.ai-gen-body .config-panel textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
  background: #1a1a1a;
}
.ai-gen-body .config-panel select {
  cursor: pointer;
  appearance: auto;
  background-image: none;
  padding-right: 10px;
}
.ai-gen-body .config-panel select option {
  background: #1a1a1a;
  color: #fff;
}
/* 覆盖result-panel样式 */
.ai-gen-body .result-panel h4 {
  display: block;
}
.ai-gen-body .result-panel #task-container {
  flex: none;
  overflow: visible;
  padding: 0;
}

.ai-gen-body .config-header h3 {
  display: block !important;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
}

.ai-gen-body .config-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-gen-body .params-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-gen-body .params-row .form-group {
  flex: 1;
  min-width: 100px;
}

.ai-gen-body .generate-btn-wrap {
  margin-top: 20px;
}

.ai-gen-body .generate-btn-wrap .btn-generate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.ai-gen-body .generate-btn-wrap .btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

/* ========== 子模式卡片菜========== */
.submode-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.submode-card {
  flex: 1;
  min-width: 80px;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.submode-card:hover {
  border-color: #667eea;
  color: #fff;
  background: #222;
}
.submode-card.active {
  border-color: #667eea;
  background: rgba(102,126,234,0.15);
  color: #fff;
  font-weight: 600;
}

/* ========== 子模式卡片菜========== */
.ai-gen-body .result-panel {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.5) transparent;
  padding: 24px;
  background: #000;
  border-radius: 0;
  box-shadow: none;
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  max-height: none;
}
.ai-gen-body .result-panel::-webkit-scrollbar { width: 5px; }
.ai-gen-body .result-panel::-webkit-scrollbar-track { background: transparent; }
.ai-gen-body .result-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
.ai-gen-body .result-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }

.ai-gen-body .result-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
}

.ai-gen-body .result-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: #666;
}

.ai-gen-body .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.ai-gen-body .empty-text {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.ai-gen-body .empty-hint {
  font-size: 0.9rem;
  opacity: 0.7;
}

.ai-gen-body .result-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
}

.ai-gen-body .result-grid.grid-1 {
  display: block;
  width: 1000px;
  height: 720px;
  max-width: 100%;
  max-height: 100%;
  position: relative;
}

.ai-gen-body .result-grid.grid-1 .result-item {
  width: 100%;
  height: 100%;
}

/* 多部分加载（逐部分推送） */
.ai-gen-body .result-part {
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-gen-body .result-grid.grid-2 .result-part {
  width: 100%;
  height: 50%;
  max-width: 100%;
  max-height: 50%;
  border-radius: 4px;
}

.ai-gen-body .result-grid.grid-4 .result-part {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.ai-gen-body .result-part .colorful-spinner {
  width: 60px !important;
  height: 60px !important;
}

.ai-gen-body .result-part.completed .colorful-spinner {
  display: none;
}

.ai-gen-body .result-part video,
.ai-gen-body .result-part img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-gen-body .result-part .result-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.25s;
}

.ai-gen-body .result-part:hover .result-overlay {
  opacity: 1;
}

.ai-gen-body .result-grid.grid-2 {
  display: flex;
  flex-direction: column;
  width: 1000px;
  height: 720px;
  max-width: 100%;
}

.ai-gen-body .result-grid.grid-2 .result-item {
  width: 100%;
  height: 50%;
  max-width: 100%;
  max-height: 50%;
  border-radius: 4px;
}

.ai-gen-body .result-grid.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 1000px;
  height: 720px;
  max-width: 100%;
  gap: 2px;
}

.ai-gen-body .result-grid.grid-4 .result-item {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}

.ai-gen-body .result-item {
  position: relative;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-gen-body .result-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-gen-body .result-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-gen-body .result-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  transition: opacity 0.25s;
}

.ai-gen-body .result-item:hover .result-overlay {
  opacity: 1;
}

.ai-gen-body .result-btn {
  background: rgba(255,255,255,0.10);
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.78rem;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px;
  white-space: nowrap;
}

.ai-gen-body .result-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.25);
}

.ai-gen-body .result-footer {
  padding: 12px 0;
  color: #999;
  font-size: 0.8rem;
  line-height: 1.6;
  width: 100%;
  max-width: 1024px;
}

.ai-gen-body .result-footer .rf-meta {
  color: #777;
  margin-bottom: 4px;
}

.ai-gen-body .result-footer .rf-prompt {
  color: #aaa;
  word-break: break-all;
  white-space: pre-wrap;
}

.ai-gen-body .result-video-btn {
  background: rgba(0,0,0,0.6);
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s;
}

.ai-gen-body .result-video-btn:hover {
  background: rgba(0,0,0,0.8);
}

.ai-gen-body .history-panel {
  width: 150px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.5) transparent;
  padding: 24px 16px;
  background: #0a0a0a;
  border-radius: 0;
  box-shadow: none;
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  max-height: none;
}
.ai-gen-body .history-panel::-webkit-scrollbar { width: 5px; }
.ai-gen-body .history-panel::-webkit-scrollbar-track { background: transparent; }
.ai-gen-body .history-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
.ai-gen-body .history-panel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }

.ai-gen-body .history-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #fff;
}

.ai-gen-body .history-empty {
  text-align: center;
  padding: 40px 0;
  color: #666;
}

.ai-gen-body .history-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ai-gen-body .history-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: #1a1a1a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.ai-gen-body .history-item:hover {
  background: #222;
}

.ai-gen-body .history-thumb {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #333;
  position: relative;
}

.ai-gen-body .history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-gen-body .history-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 视频缩略图捕获失败的降级样式 */
/* video 元素在结果/历史面板中作为缩略图显示 */
.result-item video, .result-grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0d0d1a;
  display: block;
}
.history-item video.video-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid white;
  background: #1a1a2e;
  display: block;
}

/* 视频缩略图首帧捕获失败的占位提示 */
.vt-fallback {
  position: relative;
  background: #2a2a3e;
  min-width: 40px;
  min-height: 40px;
}
.vt-fallback::after {
  content: '🎬';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  pointer-events: none;
  z-index: 1;
}

.ai-gen-body .thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0.5;
}

/* 历史记录中的进行中任务：彩色旋转圆环 */
.history-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6, #ff6b6b);
  animation: spinColorful 3s linear infinite;
  position: relative;
  margin: 20px auto;
}
.history-spinner::before {
  content: '';
  position: absolute;
  top: 14px; left: 14px; right: 14px; bottom: 14px;
  border-radius: 50%;
  background: #0a0a0a;
}

.ai-gen-body .history-thumb.multi-thumb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: #222;
}

.ai-gen-body .history-thumb.multi-thumb img,
.ai-gen-body .history-thumb.multi-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
}

.ai-gen-body .history-thumb .thumb-count {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  z-index: 2;
  line-height: 1.4;
}

.ai-gen-body .history-thumb .thumb-more {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  color: #999;
  font-size: 11px;
  border-radius: 2px;
  width: 100%;
  height: 100%;
}

.ai-gen-body .history-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #0a0a0a;
}

.ai-gen-body .history-dot.completed {
  background: #27ae60;
}

.ai-gen-body .history-dot.failed {
  background: #e74c3c;
}

.ai-gen-body .history-dot.pending {
  background: #f39c12;
}

/* 历史项左上角类型标记 */
.ht-type-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 3;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.ht-type-badge.type-video,
.ht-type-badge.type-image {
  background: rgba(0,0,0,0.65);
  border-radius: 3px;
  padding: 1px 3px;
}

.ai-gen-body .history-info {
  display: none;
}

.ai-gen-body .history-model {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-gen-body .history-status {
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.ai-gen-body .history-status.completed {
  color: #27ae60;
}

.ai-gen-body .history-status.failed {
  color: #e74c3c;
}

.ai-gen-body .history-status.pending {
  color: #f39c12;
}

.ai-gen-body .history-time {
  font-size: 0.7rem;
  color: #666;
}

/* ========== 模型管理子TAB ========== */
.model-sub-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #333;
}

.model-sub-tab {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  color: #888;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.model-sub-tab:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.model-sub-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

.model-tab-content {
  display: none;
}

.model-tab-content.active {
  display: block;
}

/* ========== 响应========== */
@media (max-width: 1200px) {
  .ai-gen-body .config-panel {
    width: 45%;
    min-width: 350px;
  }
  
  .ai-gen-body .history-panel {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .ai-gen-body {
    flex-direction: column;
  }
  
  .ai-gen-body .config-panel {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid #333;
  }
  
  .ai-gen-body .result-panel {
    border-left: none;
  }
  
  .ai-gen-body .history-panel {
    width: 100%;
  }
}

/* ========== 旧样式兼========== */
.generator-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 2rem;
  padding: 2rem;
  min-height: calc(100vh - 80px);
  position: relative;
  padding-bottom: 220px;
}

.config-panel {
  grid-column: 1;
  grid-row: 1;
  background: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: calc(100vh - 200px);
}
.config-panel h3 {
  display: none;
}
.config-panel form {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  min-height: 0;
}
.config-panel .form-group {
  margin-bottom: 1.2rem;
}
.config-panel .form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.config-panel input,
.config-panel select,
.config-panel textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #444;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: all 0.3s;
  background: #d0d0d0;
  color: #000;
}
.config-panel input:focus,
.config-panel select:focus,
.config-panel textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: #e8e8e8;
}
.config-panel textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}
.config-panel select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.config-panel select option { background: #1a1a1a; color: #fff; }

.result-panel {
  grid-column: 2;
  grid-row: 1;
  background: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: calc(100vh - 200px);
  position: relative;
  box-sizing: border-box;
}
.result-panel h4 {
  display: none;
}
.result-panel #task-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}
.result-panel #task-container .task-result {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.result-panel #task-container .task-result video {
  flex: 1;
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
  background: #000;
  min-height: 0;
  margin: 4px 0;
}
.generator-container > .result-panel { grid-column: 2; grid-row: 1; }
.generator-container > .config-panel { grid-column: 1; grid-row: 1; }

.btn-generate {
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}
.btn-generate:active { transform: scale(0.98); }
.btn-generate.loading .btn-text { opacity: 0.5; }
.btn-generate.loading .spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  left: 50%; top: 50%;
  margin-left: -10px; margin-top: -10px;
}

.upload-box {
  transition: all 0.3s;
}
.upload-box:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.04);
  transform: scale(1.02);
}
.preview-row img {
  border-radius: 8px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: all 0.2s;
}
.preview-row img:hover {
  transform: scale(1.1);
  z-index: 100;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}
.preview-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: center;
}
.preview-row > div:hover {
  z-index: 9999;
  position: relative;
}

.float-generate-btn { transition: box-shadow 0.3s; }

.btn-generate-float {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 28px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
  position: relative;
  overflow: visible;
}
.btn-generate-float:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 36px rgba(102, 126, 234, 0.5);
}
.btn-generate-float:active { transform: scale(0.95); }
.btn-generate-float .btn-text-float {
  color: white;
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
  letter-spacing: 1px;
}
.btn-generate-float .spinner-float {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
}
.btn-generate-float.loading svg,
.btn-generate-float.loading .btn-text-float { display: none; }
.btn-generate-float.loading { animation: pulse 1.5s ease-in-out infinite; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 28px rgba(102, 126, 234, 0.4); }
  50% { box-shadow: 0 6px 40px rgba(102, 126, 234, 0.7); }
}

.history-item {
  min-width: 130px;
  max-width: 130px;
  transition: all 0.3s;
}
.history-item:hover {
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}
.history-scroll { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.5) transparent; }
.history-scroll::-webkit-scrollbar { height: 5px; }
.history-scroll::-webkit-scrollbar-track { background: transparent; }
.history-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
.history-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }

.param-controls { display: flex; gap: 1rem; flex-wrap: wrap; }
.param-controls .form-group { min-width: 100px; }

#task-history { width: 485px; padding: 15px; background: #1a1a1a; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.15); box-sizing: border-box; grid-column: 2; grid-row: 2; margin: 0; }

@media (max-width: 768px) {
  .generator-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .config-panel { grid-row: 1; grid-column: 1; }
  .result-panel { grid-row: 2; grid-column: 1; }
}

/* ========== 画布配置面板新布局 ========== */
.cm-cfg-panel .cm-cfg-imgs {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px 0;
}
.cm-cfg-panel .cm-cfg-img-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.cm-cfg-panel .cm-cfg-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1.5px solid #444;
  display: block;
}
.cm-cfg-panel .cm-cfg-img-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e74c3c;
  color: white;
  font-size: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  border: none;
  padding: 0;
}
.cm-cfg-panel .cm-cfg-img-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px dashed #555;
  border-radius: 4px;
  cursor: pointer;
  color: #aaa;
  font-size: 0.6rem;
  font-weight: 600;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
  background: transparent;
}
.cm-cfg-panel .cm-cfg-img-add:hover {
  border-color: #667eea;
  color: #667eea;
}

.cm-cfg-panel .cm-cfg-editrow {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-editrow .cm-cfg-prompt {
  flex: 1;
}
.cm-cfg-panel .cm-cfg-botrow {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-botrow-right {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-botrow .cm-cfg-model {
  flex: 1;
  min-width: 0;
}
.cm-cfg-panel .cm-cfg-botrow .cm-cfg-params {
  flex: none;
}

/* 提示词编辑框 - 字数统计 */
.cm-cfg-panel .cm-cfg-prompt-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.cm-cfg-panel .cm-cfg-charcount {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
  z-index: 2;
}

/* 预设提示词标签（提示词栏内嵌 */
.cm-cfg-preset-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.4;
}
.cm-cfg-preset-badge .cm-cfg-preset-badge-label {
  margin-right: 4px;
}
.cm-cfg-preset-badge .cm-cfg-preset-badge-del {
  cursor: pointer;
  font-size: 0.65rem;
  opacity: 0.7;
  line-height: 1;
}
.cm-cfg-preset-badge .cm-cfg-preset-badge-del:hover {
  opacity: 1;
}

/* 上游连接模块的预设标 */
.cm-cfg-upstream-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 4px 2px 0;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid rgba(56, 189, 248, 0.35);
  cursor: help;
}

/* 预设提示词下拉面 */
.cm-preset-panel {
  background: #252540;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 0;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.cm-preset-item {
  padding: 8px 14px;
  color: #ccc;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s;
}
.cm-preset-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* 上传弹出菜单 - 左右浮动按钮 */
.cm-upload-popup-flank {
  position: fixed;
  display: flex;
  flex-direction: row;
  gap: 4px;
  z-index: 10001;
}
.cm-upload-flank-btn {
  width: 40px;
  height: 40px;
  border: 1.5px dashed #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #1a1a1a;
  color: #aaa;
  font-size: 0.55rem;
  font-weight: 600;
  text-align: center;
  white-space: pre-line;
  line-height: 1.15;
  transition: border-color 0.15s, color 0.15s;
}
.cm-upload-flank-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

/* 资产选择遮罩 */
.cm-asset-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-asset-body {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  min-width: 360px;
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
}
.cm-asset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cm-asset-header h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0;
}
.cm-asset-close {
  color: #aaa;
  cursor: pointer;
  font-size: 1.1rem;
}
.cm-asset-close:hover {
  color: #fff;
}
.cm-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}
.cm-asset-item {
  cursor: pointer;
  text-align: center;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}
.cm-asset-item:hover {
  background: #333;
}
.cm-asset-item span {
  display: block;
  font-size: 0.6rem;
  color: #aaa;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 画布视频模块上传：一行按+ 虚线========== */
.at-image-picker-popup {
  position: fixed;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 14px;
  z-index: 9999;
  max-width: 360px;
}
.cm-cfg-panel .cm-cfg-imgs-video {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cm-cfg-panel .cm-cfg-vcolumns-row {
  display: flex;
  gap: 6px;
  width: 100%;
}
.cm-cfg-panel .cm-cfg-vcol {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 0;
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vupload {
  width: 40px;
  height: 40px;
  border: 1.5px dashed #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  background: transparent;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vupload:hover {
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-vupload-label {
  color: #aaa;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vupload:hover .cm-cfg-vupload-label {
  color: #667eea;
}
/* ========== 画布视频模块预览：默认在按钮内重叠，悬停展开到按钮下========== */
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vpreviews {
  display: flex;
  flex-direction: row;
  gap: 0;
  align-items: center;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  overflow: hidden;
  /* 缓慢收回（hover-out），延迟0.2s再收 */
  top: 0;
  transition: top 0.35s ease 0.2s;
}
.cm-cfg-panel .cm-cfg-vcol:hover .cm-cfg-vpreviews {
  overflow: visible;
  /* 快速弹出（hover-in），无延 */
  top: calc(100% + 4px);
  transition: top 0.2s ease;
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vpreview-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  z-index: 1;
  transition: margin-left 0.3s ease 0.2s;
}
/* 默认横向重叠：后续图向左覆盖 */
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vpreview-wrap:not(:first-child) {
  margin-left: -28px;
}
/* 列悬停时展开到按钮下 */
.cm-cfg-panel .cm-cfg-vcol:hover .cm-cfg-vpreview-wrap {
  margin-left: 2px;
  transition: margin-left 0.2s ease;
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vpreview-wrap:hover {
  z-index: 10;
  transform: scale(1.15);
}
.cm-cfg-panel .cm-cfg-vcol .cm-cfg-vpreview {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  border: 1.5px solid #444;
  display: block;
  pointer-events: none;
}
/* 单个视频模块上传按钮样式（兼容旧.cm-cfg-vupload 直接调用 */
.cm-cfg-panel .cm-cfg-vupload {
  width: 50px;
  height: 50px;
  border: 1.5px dashed #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
  background: transparent;
}
.cm-cfg-panel .cm-cfg-vupload:hover {
  border-color: #667eea;
}
.cm-cfg-panel .cm-cfg-vupload-label {
  color: #aaa;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}
.cm-cfg-panel .cm-cfg-vupload:hover .cm-cfg-vupload-label {
  color: #667eea;
}

/* 画布顶部行：子模+ 模型选择 */
.cm-cfg-panel .cm-cfg-toprow {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-toprow .cm-cfg-submodes {
  flex: 1;
  min-width: 0;
}
.cm-cfg-panel .cm-cfg-toprow .cm-cfg-model {
  width: auto;
  flex: none;
  min-width: 80px;
  max-width: 130px;
  padding: 3px 5px;
  border: 1.5px solid #444;
  border-radius: 5px;
  font-size: 0.7rem;
  background: #d0d0d0;
  color: #000;
  cursor: pointer;
}
.cm-cfg-panel .cm-cfg-toprow .cm-cfg-model:focus {
  outline: none;
  border-color: #667eea;
}

/* 画布子模式选择卡片 */
.cm-cfg-panel .cm-cfg-submodes {
  display: flex;
  gap: 4px;
}
.cm-cfg-panel .cm-cfg-subcard {
  flex: 1;
  padding: 5px 6px;
  background: #1a1a1a;
  border: 1.5px solid #333;
  border-radius: 6px;
  text-align: center;
  font-size: 0.65rem;
  color: #aaa;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.cm-cfg-panel .cm-cfg-subcard:hover {
  border-color: #667eea;
  color: #fff;
  background: #222;
}
.cm-cfg-panel .cm-cfg-subcard.active {
  border-color: #667eea;
  background: rgba(102,126,234,0.15);
  color: #fff;
  font-weight: 600;
}


.cm-cfg-panel .cm-cfg-vdel {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e74c3c;
  color: white;
  font-size: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  border: none;
  padding: 0;
}

/* ========== 模型编辑弹窗布局 ========== */
@keyframes modalFadeSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.model-edit-modal .modal-content {
  max-width: 850px !important;
  width: 95% !important;
  max-height: 85vh !important;
  overflow-y: auto;
  background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%);
  border: 1px solid #333;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  animation: modalFadeSlideIn 0.3s ease-out;
}
.model-edit-modal .modal-content::-webkit-scrollbar { width: 6px; }
.model-edit-modal .modal-content::-webkit-scrollbar-track { background: transparent; }
.model-edit-modal .modal-content::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.5); border-radius: 3px; }
.model-edit-modal .modal-content::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.7); }

.model-edit-modal .close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s;
  z-index: 10;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  line-height: 1;
}
.model-edit-modal .close:hover {
  color: #fff;
  background: rgba(255,75,75,0.15);
  border-color: rgba(255,75,75,0.3);
  transform: rotate(90deg);
}

.model-edit-modal .modal-content > h3 {
  display: block !important;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #333;
  letter-spacing: 0.5px;
}

.model-edit-modal .model-section-title {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 16px 0 10px;
  letter-spacing: 0.5px;
}
.model-edit-modal .section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #aaa;
  margin: 14px 0 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.model-edit-modal .model-info-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.model-edit-modal .model-info-grid .model-info-col {
  flex: 1;
  min-width: 220px;
}
.model-edit-modal .model-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.model-edit-modal .model-mode-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.model-edit-modal .model-mode-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 模型编辑弹窗表格 */
.model-edit-modal .config-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}
.model-edit-modal .config-table th {
  background: #252540;
  color: #ccc;
  font-weight: 600;
  padding: 8px 6px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #333;
}
.model-edit-modal .config-table td {
  text-align: center;
  vertical-align: middle;
  padding: 6px 4px;
  background: #1a1a30;
  border-bottom: 1px solid #2a2a40;
  color: #ccc;
}
.model-edit-modal .config-table tr:last-child td {
  border-bottom: none;
}
.model-edit-modal .config-table tbody tr:hover td {
  background: #222240;
}
.model-edit-modal .config-table td:not(:last-child),
.model-edit-modal .config-table th:not(:last-child) {
  border-right: 1px solid #2a2a40;
}
.model-edit-modal .config-table input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: #667eea;
  cursor: pointer;
}

/* 配置表输入框统一样式 */
.model-edit-modal .config-table .iw-40 { width: 40px !important; }
.model-edit-modal .config-table .iw-50 { width: 50px !important; }
.model-edit-modal .config-table .iw-80 { width: 80px !important; }
.model-edit-modal .config-table .iw-100 { width: 100px !important; }
.model-edit-modal .config-table .iw-140 { width: 140px !important; }
.model-edit-modal .config-table .iw-150 { width: 150px !important; }
.model-edit-modal .config-table td input[type=text],
.model-edit-modal .config-table input[type=number] {
  padding: 4px 6px !important;
  border: 1px solid #444 !important;
  border-radius: 6px !important;
  font-size: 0.8rem !important;
  background: #2a2a3e !important;
  color: #fff !important;
  text-align: center;
  width: auto;
}
.model-edit-modal .config-table input[type=text]:focus,
.model-edit-modal .config-table input[type=number]:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15) !important;
}

.model-edit-modal .model-credit-flex {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.model-edit-modal .model-credit-card {
  border: 1px solid #333;
  padding: 12px;
  border-radius: 8px;
  background: #222;
  min-width: 160px;
}
.model-edit-modal .model-credit-card strong {
  color: #ddd;
  font-size: 0.85rem;
}
.model-edit-modal .model-credit-card label {
  font-size: 0.82rem;
  color: #aaa;
}
.model-edit-modal .model-credit-card .form-group {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-edit-modal .model-credit-card .form-group label {
  min-width: 50px;
  margin-bottom: 0;
}
.model-edit-modal .model-credit-card input {
  padding: 4px 8px !important;
  border: 1px solid #444 !important;
  border-radius: 6px !important;
  font-size: 0.8rem !important;
  background: #2a2a3e !important;
  color: #fff !important;
  width: 60px !important;
  text-align: center;
}
.model-edit-modal .model-credit-card input:focus {
  border-color: #667eea !important;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15) !important;
}

.model-edit-modal .model-support-flex {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.model-edit-modal .model-support-flex .form-group {
  margin-bottom: 0;
}
.model-edit-modal .model-support-flex .form-group label {
  display: block;
  margin-bottom: 4px;
  color: #ccc;
  font-size: 0.85rem;
}
.model-edit-modal .model-support-flex input {
  padding: 8px 12px;
  border: 1px solid #444 !important;
  border-radius: 8px !important;
  font-size: 0.9rem !important;
  background: #2a2a3e !important;
  color: #fff !important;
}
.model-edit-modal .model-support-flex input:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}
.model-edit-modal .model-credit-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.model-edit-modal .model-credit-inline .form-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.model-edit-modal .model-credit-inline .form-group label {
  margin-bottom: 0;
  font-size: 0.85rem;
}
.model-edit-modal .model-credit-inline input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #444 !important;
  border-radius: 6px !important;
  font-size: 0.85rem !important;
  background: #2a2a3e !important;
  color: #fff !important;
  text-align: center;
}
.model-edit-modal .model-credit-inline input:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15) !important;
}
.model-edit-modal .model-footer-flags {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.model-edit-modal .model-footer-flags label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

/* 支持参数输入框宽度辅助类 */
.model-edit-modal .model-support-flex .input-w-200 { width: 200px !important; }
.model-edit-modal .model-support-flex .input-w-240 { width: 240px !important; }
.model-edit-modal .model-support-flex .input-w-280 { width: 280px !important; }

.model-edit-modal .model-btn-submit {
  margin-top: 15px;
  width: 100%;
  padding: 12px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
}

/* ========== 预设提示词编辑弹========== */
#preset-form-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.2s ease;
}
#preset-form-modal .modal-content {
  max-width: 700px !important;
  width: 90% !important;
  background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%);
  border: 1px solid #333;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  animation: modalFadeSlideIn 0.3s ease-out;
  position: relative;
}
#preset-form-modal .modal-content h3 {
  display: block !important;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #333;
  letter-spacing: 0.5px;
}
#preset-form-modal .modal-content .close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s;
  z-index: 10;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  line-height: 1;
}
#preset-form-modal .modal-content .close-btn:hover {
  color: #fff;
  background: rgba(255,75,75,0.15);
  border-color: rgba(255,75,75,0.3);
  transform: rotate(90deg);
}
#preset-form-modal .preset-form-group {
  margin-bottom: 16px;
}
#preset-form-modal .preset-form-group label {
  display: block;
  margin-bottom: 6px;
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
#preset-form-modal .preset-form-group input,
#preset-form-modal .preset-form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #2a2a3e;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
#preset-form-modal .preset-form-group input:focus,
#preset-form-modal .preset-form-group select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}
#preset-form-modal .preset-form-group select option {
  background: #1a1a1a;
  color: #fff;
}
#preset-form-modal .preset-form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #2a2a3e;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  box-sizing: border-box;
}
#preset-form-modal .preset-form-group textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
}
#preset-form-modal .preset-form-group textarea::placeholder {
  color: #666;
}
#preset-form-modal .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #333;
}
#preset-form-modal .modal-actions .btn-secondary {
  padding: 10px 24px;
  font-size: 0.9rem;
  border: 1px solid #444;
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s;
}
#preset-form-modal .modal-actions .btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
#preset-form-modal .modal-actions .btn-primary {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
#preset-form-modal .modal-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

/* ========== Toast 通知系统 ========== */
.ai-toast-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  padding-top: 16px;
}
.ai-toast {
  max-width: 420px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: #fff;
  margin-bottom: 8px;
  animation: toastSlideIn 0.35s cubic-bezier(0.21,1.02,0.73,1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,0.08);
}
.ai-toast.toast-success {
  background: rgba(46,204,113,0.82);
}
.ai-toast.toast-error {
  background: rgba(231,76,60,0.82);
}
.ai-toast.toast-info {
  background: rgba(102,126,234,0.82);
}
@keyframes toastSlideIn {
  0% { opacity: 0; transform: translateY(-40px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastFadeOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(0.95); }
}
.ai-toast.removing {
  animation: toastFadeOut 0.3s ease forwards;
}

/* ========== 彩色旋转(Spinner) ========== */
.colorful-spinner {
  border-radius: 50%;
  background: conic-gradient(#ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6, #ff6b6b);
  animation: spinColorful 3s linear infinite;
  position: relative;
}
.colorful-spinner::before {
  content: '';
  position: absolute;
  top: 28px; left: 28px; right: 28px; bottom: 28px;
  border-radius: 50%;
  background: #1a1a1a;
}
.colorful-spinner::after {
  content: 'AI GEN';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  z-index: 1;
  text-shadow: 0 0 12px rgba(255,255,255,0.3);
}
@keyframes spinColorful {
  to { transform: rotate(360deg); }
}

/* 生成页面结果spinner 容器 */
.result-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 200px;
  width: 100%;
}

.canvas-module-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* ========== 确认/提示弹窗 ========== */
.ai-alert-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 10000;
  display: none; align-items: center; justify-content: center;
  animation: alertOverlayIn 0.2s ease;
}
@keyframes alertOverlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.ai-alert-box {
  background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%);
  border-radius: 16px; width: 340px; max-width: 88vw;
  padding: 32px 28px 24px; text-align: center;
  animation: alertBoxIn 0.28s cubic-bezier(0.21,1.02,0.73,1);
  border: 1px solid #333;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  position: relative;
}
.ai-alert-box::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2, #e74c3c);
  border-radius: 16px 16px 0 0;
}
.ai-alert-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  line-height: 1;
  display: inline-block;
  animation: alertIconBounce 0.4s cubic-bezier(0.21,1.02,0.73,1);
}
@keyframes alertIconBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes alertBoxIn {
  0% { opacity: 0; transform: scale(0.92) translateY(16px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.ai-alert-msg {
  color: #e8e8e8; font-size: 0.95rem; line-height: 1.6; margin-bottom: 24px;
}
.ai-alert-ok, .ai-alert-cancel {
  padding: 10px 32px; border-radius: 10px; border: none; font-size: 0.88rem;
  cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.ai-alert-ok {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff;
}
.ai-alert-ok:hover { opacity: 0.9; transform: translateY(-1px); }
.ai-alert-cancel {
  background: rgba(255,255,255,0.08); color: #aaa; margin-right: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.ai-alert-cancel:hover { background: rgba(255,255,255,0.14); color: #fff; transform: translateY(-1px); }
.ai-alert-actions {
  display: flex; justify-content: center; gap: 12px;
}

/* ========== 剧本任务模块 ========== */

/* ---- 容器：全屏 ---- */
.sp-container {
  padding: 24px 28px;
  margin: 0;
}

/* ---- 头部横幅 ---- */
.sp-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(102,126,234,0.12) 0%, rgba(118,75,162,0.08) 100%);
  border: 1px solid rgba(102,126,234,0.2);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.sp-hero-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.sp-hero-content p {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

/* ---- 过滤器 ---- */
.sp-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.sp-filter-btn {
  padding: 6px 16px;
  border: 1px solid #444;
  border-radius: 20px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.sp-filter-btn:hover {
  border-color: #667eea;
  color: #fff;
}
.sp-filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}
.sp-filter-my {
  margin-left: auto;
  border-color: #2ecc71;
  color: #2ecc71;
}
.sp-filter-my.active {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* ---- 卡片列表（网格卡片布局） ---- */
.sp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.sp-card {
  width: 100%;
  height: 280px;
  display: flex;
  flex-direction: column;
  background: #1e1e2e;
  border: 1px solid #333;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
}
.sp-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(102,126,234,0.15);
}
.sp-card-row {
  margin-bottom: 4px;
  line-height: 1.5;
}
.sp-card-row:last-child {
  margin-bottom: 0;
}
.sp-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.sp-card-top .status-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}
.sp-card-code-row {
  margin-bottom: 2px;
}
.sp-card-title-row {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-card-workflow-row {
  font-size: 0.82rem;
  color: #aaa;
}
.sp-card-deadline-row {
  font-size: 0.78rem;
  color: #888;
}
.sp-card-intro-row {
  font-size: 0.78rem;
  color: #999;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  line-height: 1.5;
  flex: 1;
}
.sp-deadline-over {
  color: #e74c3c !important;
}

.sp-deadline-text {
  font-size: 0.78rem;
  color: #888;
}

/* 工作流行标签 */
.sp-wf-label {
  display: inline-block;
  font-size: 0.82rem;
  color: #aaa;
}
.sp-wf-label.eliminated { color: #e74c3c; }
.sp-wf-label.pending { color: #f39c12; }
.sp-wf-label.awaiting { color: #667eea; }
.sp-wf-label.done { color: #2ecc71; }
.sp-wf-label.resubmit { color: #f39c12; }

.sp-countdown-badge {
  font-weight: 400;
  opacity: 0.9;
  margin-left: 4px;
}

.sp-assign-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  vertical-align: middle;
}

/* 指定任务卡片专属标记 */
.sp-card-designated {
  position: relative;
}
.sp-card-designated::after {
  content: '🔒';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ---- 加载/空状态 ---- */
.sp-loading, .sp-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 0.95rem;
  grid-column: 1 / -1;
}

/* ---- 分页 ---- */
.sp-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.sp-page-btn {
  padding: 6px 12px;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.sp-page-btn:hover {
  border-color: #667eea;
  color: #fff;
}
.sp-page-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}

/* ========== 详情页（全屏） ========== */
.sp-detail-container {
  padding: 24px 28px;
  margin: 0;
}
.sp-detail-topbar {
  margin-bottom: 24px;
}
.sp-detail-back {
  color: #888;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-block;
  transition: color 0.15s;
  margin-bottom: 8px;
}
.sp-detail-back:hover {
  color: #667eea;
}
.sp-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 4px 0 0;
}

/* ---- 左右两栏 ---- */
.sp-detail-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* 左侧 */
.sp-detail-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 右侧 */
.sp-detail-right {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ---- 统一卡片 ---- */
.sp-detail-card {
  background: #1e1e2e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 16px 18px;
}
.sp-detail-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #aaa;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a3e;
}
.sp-detail-text {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ---- 参数网格（两列） ---- */
.sp-detail-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.sp-param-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #252540;
  font-size: 0.82rem;
}
.sp-param-key {
  color: #888;
  flex-shrink: 0;
  margin-right: 8px;
}
.sp-param-val {
  color: #ccc;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .sp-detail-params-grid {
    grid-template-columns: 1fr;
  }
}

/* 已接受单独行 - 在参数网格下方，不影响上方布局 */
.sp-param-accepted-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0 4px;
  margin-top: 6px;
  border-top: 1px solid #252540;
  font-size: 0.82rem;
  min-height: 28px;
  max-height: 120px;
  overflow-y: auto;
}
.sp-param-accepted-row .sp-param-key {
  color: #888;
  flex-shrink: 0;
  margin-right: 8px;
  white-space: nowrap;
}
.sp-param-accepted-row .sp-param-val {
  color: #ccc;
  text-align: right;
  word-break: break-all;
}

/* ---- 操作按钮（紧凑一排） ---- */
.sp-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.sp-btn-accept {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
}
.sp-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
.sp-btn-disabled {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #555;
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: not-allowed;
  text-align: center;
  width: auto;
}
.sp-btn-secondary {
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  transition: all 0.15s;
  width: auto;
}
.sp-btn-secondary:hover {
  border-color: #667eea;
  color: #fff;
}
.sp-btn-danger {
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  background: transparent;
  color: #e74c3c;
  cursor: pointer;
  transition: all 0.15s;
  width: auto;
}
.sp-btn-danger:hover {
  background: rgba(231,76,60,0.12);
}

/* 剧本上传虚线按钮 */
.sp-upload-btn-dashed {
  width: 36px;
  height: 36px;
  border: 2px dashed #666;
  border-radius: 8px;
  background: transparent;
  color: #888;
  font-size: 1.3rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}
.sp-upload-btn-dashed:hover {
  border-color: #667eea;
  color: #667eea;
  background: rgba(102,126,234,0.08);
}

/* ========== 站内短信弹窗 ========== */
.msg-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}
.msg-modal-content {
  background: linear-gradient(145deg, #1e1e2e 0%, #1a1a2e 100%);
  border: 1px solid #333;
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.28s cubic-bezier(0.21,1.02,0.73,1);
  position: relative;
}
.msg-modal-content::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #667eea, #764ba2, #e74c3c); border-radius: 16px 16px 0 0; }
.msg-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a3e;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.msg-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: rgba(255,255,255,0.4); cursor: pointer; border-radius: 8px; transition: all 0.25s; z-index: 10; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); line-height: 1; padding: 0;
}
.msg-close:hover { color: #fff; background: rgba(255,75,75,0.15); border-color: rgba(255,75,75,0.3); transform: rotate(90deg); }
.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}
.msg-loading, .msg-empty {
  text-align: center;
  padding: 40px 16px;
  color: #888;
  font-size: 0.9rem;
}
.msg-item {
  padding: 12px 14px;
  border-bottom: 1px solid #252540;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
  margin-bottom: 4px;
}
.msg-item:hover { background: rgba(102,126,234,0.06); }
.msg-item:last-child { border-bottom: none; }
.msg-item-unread {
  background: rgba(102,126,234,0.08);
  border-left: 3px solid #667eea;
}
.msg-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.msg-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #eee;
}
.msg-dot {
  color: #667eea;
  font-size: 0.6rem;
  line-height: 1;
}
.msg-item-content {
  font-size: 0.82rem;
  color: #999;
  line-height: 1.5;
  margin-bottom: 4px;
  word-break: break-all;
  white-space: pre-wrap;
}
.msg-item-time {
  font-size: 0.72rem;
  color: #666;
}
.msg-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px 14px;
  border-top: 1px solid #2a2a3e;
}
.msg-page-btn {
  padding: 4px 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.msg-page-btn:hover {
  border-color: #667eea;
  color: #fff;
}
.msg-page-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}

/* ---- 短信角标 ---- */
.up-msg-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.sidebar-msg-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #e74c3c;
  border-radius: 50%;
  border: 2px solid #14142a;
}

/* 侧栏头像右上角消息数量角标 */
.sidebar-msg-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 0.6rem;
  font-weight: 700;
  background: #e74c3c;
  color: #fff;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  border: 1.5px solid #111;
  z-index: 5;
}
#sidebar-login {
  position: relative;
}

/* ========== 已接任务卡片 ========== */
.sp-card-accepted {
  /* 卡片样式不变，仅背景微绿区分布置 */
  border-color: #2ecc71;
  background: linear-gradient(135deg, rgba(46,204,113,0.06) 0%, rgba(39,174,96,0.03) 100%);
}
.sp-card-accepted:hover {
  border-color: #2ecc71;
  box-shadow: 0 8px 30px rgba(46,204,113,0.15);
}

/* 已接任务：大号倒计时（换行在标题下方） */
.sp-accepted-countdown {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2ecc71;
  margin: 4px 0 8px;
  line-height: 1.4;
}

/* ✅ 已接标签 */
.sp-accepted-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(46,204,113,0.2);
  color: #2ecc71;
  vertical-align: middle;
}

/* ========== 任务提交表单 ========== */
.sp-submit-url-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.sp-submit-url-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a3e;
  color: #fff;
  font-size: 0.85rem;
}
.sp-submit-add-url, .sp-submit-rm-url {
  width: 30px;
  height: 30px;
  border: 1px solid #444;
  border-radius: 6px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: all 0.15s;
}
.sp-submit-add-url:hover {
  border-color: #2ecc71;
  color: #2ecc71;
}
.sp-submit-rm-url:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ===== 广场 (Plaza) ===== */
.plaza-container {
  padding: 24px 32px;
  min-height: 100vh;
}

.plaza-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #222;
}

.plaza-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.plaza-type-filter {
  display: flex;
  gap: 8px;
}

.plaza-filter-btn {
  background: #1a1a2e;
  border: 1px solid #333;
  color: #aaa;
  padding: 6px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.plaza-filter-btn:hover {
  border-color: #667eea;
  color: #fff;
}

.plaza-filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: #fff;
}

.plaza-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.plaza-loading, .plaza-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 1rem;
}

.plaza-card {
  background: #1a1a2e;
  border: 1px solid #222;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.plaza-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.15);
  border-color: #667eea;
}

.plaza-card-preview {
  flex: 1;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plaza-card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plaza-card-info {
  padding: 12px 14px;
  background: #1a1a2e;
  border-top: 1px solid #222;
}

.plaza-card-title {
  font-size: 0.85rem;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.plaza-card-desc {
  font-size: 0.72rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.plaza-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.plaza-card-user {
  color: #888;
}

.plaza-card-like {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
  user-select: none;
}

.plaza-card-like:hover .plaza-like-icon {
  transform: scale(1.2);
}

.plaza-liked {
  color: #ff4757;
}

.plaza-like-icon {
  transition: transform 0.2s;
  font-size: 1rem;
}

.plaza-like-count {
  min-width: 16px;
  text-align: center;
}

.plaza-card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.plaza-card:hover .plaza-card-del {
  display: flex;
}

.plaza-card-del:hover {
  background: #e74c3c;
}

/* 广场详情弹窗 - 无遮罩浮动卡片 + 独立右侧缩略图列 */
.plaza-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.plaza-detail-overlay {
  display: none;
}

/* 主内容卡片 - 居中浮动 */
.plaza-detail-content {
  position: relative;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: auto;
  max-width: 82vw;
  max-height: 90vh;
  z-index: 2;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5);
  pointer-events: auto;
}

.plaza-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: all 0.2s;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.plaza-detail-close:hover {
  color: #fff;
  background: rgba(255,75,75,0.3);
  border-color: rgba(255,75,75,0.4);
  transform: scale(1.1);
}

.plaza-detail-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 4px;
}

.plaza-detail-img {
  max-width: 78vw;
  max-height: calc(86vh - 60px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
}

.plaza-detail-video {
  max-width: 78vw;
  max-height: calc(86vh - 60px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
}

.plaza-detail-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.plaza-detail-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.plaza-detail-user {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

.plaza-detail-time {
  font-size: 0.72rem;
  color: #666;
  white-space: nowrap;
  margin-left: auto;
}

.plaza-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.plaza-detail-like-btn, .plaza-detail-del-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ccc;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.plaza-detail-like-btn:hover, .plaza-detail-like-btn.liked {
  background: rgba(255, 71, 87, 0.12);
  border-color: #ff4757;
  color: #ff4757;
}

.plaza-detail-del-btn:hover {
  background: rgba(231, 76, 60, 0.12);
  border-color: #e74c3c;
  color: #e74c3c;
}

/* 右侧独立缩略图列 - 浮动在卡片右侧 */
.plaza-detail-thumbs {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 62px;
  max-height: 70vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: rgba(26,26,46,0.75);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  z-index: 3;
}

.plaza-detail-thumbs::-webkit-scrollbar {
  width: 2px;
}
.plaza-detail-thumbs::-webkit-scrollbar-track {
  background: transparent;
}
.plaza-detail-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.plaza-detail-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.15s;
  border: 2px solid transparent;
  box-sizing: content-box;
}
.plaza-detail-thumb.active {
  border-color: #667eea;
}
.plaza-detail-thumb:hover:not(.active) {
  border-color: rgba(255,255,255,0.2);
}
.plaza-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 资产预览 - 操作按钮栏 */
.apm-actions-bar {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.apm-action-btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  padding: 8px 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}
.apm-action-btn:hover {
  background: rgba(255,255,255,0.20);
  color: #fff;
}

.apm-action-danger:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.apm-action-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
}
.apm-action-primary:hover {
  opacity: 0.88;
  color: #fff;
}

/* 资产预览 - 媒体区域（无遮挡，完整显示） */
.apm-media-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.apm-media-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.apm-media-wrap video {
  max-width: 100%;
  max-height: 100%;
}

/* ===== 管理后台 - 积分消费页面 ===== */
.btn-info {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-info:hover {
  background: #2980b9;
}

.credits-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.credit-card {
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.15s;
}
.credit-card:hover {
  border-color: #667eea;
}
.credit-card-label {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 8px;
}
.credit-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}
.credit-card-value.positive {
  color: #2ecc71;
}
.credit-card-value.negative {
  color: #e74c3c;
}

.credits-user-table {
  font-size: 0.85rem;
}
.credits-user-table th {
  white-space: nowrap;
}

/* ========== 剧本工作流样式 ========== */

/* ---- 编号 ---- */
.sp-card-code {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 1px;
}
.sp-detail-code {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 6px;
  margin-left: 10px;
  letter-spacing: 1px;
  vertical-align: middle;
}

/* ---- 工作流徽章 ---- */
.sp-wf-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 2px;
}
.sp-wf-badge.eliminated {
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
}
.sp-wf-badge.pending {
  background: rgba(243,156,18,0.2);
  color: #f39c12;
}
.sp-wf-badge.approved {
  background: rgba(46,204,113,0.2);
  color: #2ecc71;
}
.sp-wf-badge.rejected {
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
}
.sp-wf-badge.resubmit {
  background: rgba(243,156,18,0.2);
  color: #f39c12;
}
.sp-wf-badge.done {
  background: rgba(46,204,113,0.2);
  color: #2ecc71;
}
.sp-wf-badge.awaiting {
  background: rgba(102,126,234,0.2);
  color: #667eea;
}
.sp-wf-badge.final-pending {
  background: rgba(102,126,234,0.2);
  color: #667eea;
}

/* ---- 详情容器 ---- */
.sp-detail-container {
  padding: 24px 28px;
}
.sp-detail-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #222;
}
.sp-detail-back {
  cursor: pointer;
  color: #667eea;
  font-size: 0.9rem;
  margin-right: 12px;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.sp-detail-back:hover {
  opacity: 0.7;
}
.sp-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-detail-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.sp-detail-left {
  flex: 1;
  min-width: 0;
}
.sp-detail-right {
  width: 340px;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .sp-detail-body {
    flex-direction: column;
  }
  .sp-detail-right {
    width: 100%;
  }
}

/* ---- 详情卡片 ---- */
.sp-detail-card {
  background: #1a1a2e;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.sp-detail-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sp-detail-text {
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ---- 参数列表 ---- */
.sp-detail-params {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.sp-param-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.85rem;
}
.sp-param-row:last-child {
  border-bottom: none;
}
.sp-param-key {
  color: #888;
}
.sp-param-val {
  color: #ddd;
  text-align: right;
}

/* ---- 操作按钮 ---- */
.sp-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-btn-accept {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
  width: 100%;
}
.sp-btn-accept:hover {
  opacity: 0.85;
}
.sp-btn-secondary {
  background: transparent;
  border: 1px solid #444;
  color: #ccc;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  width: 100%;
}
.sp-btn-secondary:hover {
  border-color: #667eea;
  color: #fff;
}
.sp-btn-danger {
  background: transparent;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  width: 100%;
}
.sp-btn-danger:hover {
  background: rgba(231,76,60,0.1);
}
.sp-btn-disabled {
  background: #2a2a3e;
  border: 1px solid #444;
  color: #666;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  width: 100%;
}

/* ---- 工作流步骤条 ---- */
.sp-workflow-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 12px 0;
}
.wf-step {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 12px;
  transition: all 0.2s;
}
.wf-step-done {
  color: #2ecc71;
  background: rgba(46,204,113,0.1);
}
.wf-step-active {
  color: #f39c12;
  background: rgba(243,156,18,0.1);
  font-weight: 600;
}
.wf-step-pending {
  color: #666;
}
.wf-step-line {
  width: 20px;
  height: 2px;
  background: #333;
  margin: 0 2px;
  flex-shrink: 0;
}
.wf-step-line.wf-line-done {
  background: #2ecc71;
}

/* ---- 工作流计数和审核意见 ---- */
.sp-wf-countdown {
  font-size: 0.85rem;
  color: #2ecc71;
  padding: 8px 12px;
  background: rgba(46,204,113,0.08);
  border-radius: 8px;
  margin: 8px 0;
  font-weight: 600;
}
.sp-wf-countdown.sp-wf-warning {
  color: #f39c12;
  background: rgba(243,156,18,0.08);
}
.sp-wf-review-comment {
  font-size: 0.8rem;
  color: #f39c12;
  padding: 8px 12px;
  background: rgba(243,156,18,0.06);
  border: 1px solid rgba(243,156,18,0.15);
  border-radius: 8px;
  margin: 8px 0;
  white-space: pre-wrap;
}

/* ---- 样片预览 ---- */
.sp-sample-card {
  border-left: 3px solid #667eea;
}
.sp-sample-episode {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 6px 8px 6px 0;
  padding: 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  width: 80px;
}
.sp-sample-ep-num {
  font-size: 0.7rem;
  color: #aaa;
  margin-bottom: 6px;
  text-align: center;
  display: block;
  width: 100%;
}
.sp-sample-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.sp-sample-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #666;
  background: #2a2a3e;
}
.sp-sample-ep-title {
  font-size: 0.65rem;
  color: #888;
  margin-top: 4px;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-sample-status {
  font-size: 0.8rem;
  color: #aaa;
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
}
.sp-sample-content {
  font-size: 0.8rem;
  color: #ccc;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
  word-break: break-all;
}
.sp-final-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* ---- 资产选择网格 ---- */
.sp-asset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}
.sp-asset-item {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #2a2a3e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: border-color 0.15s;
}
.sp-asset-item:hover {
  border-color: #667eea;
}

/* ---- 多选资产项 ---- */
.sp-multi-asset-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 90px;
  padding: 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #2a2a3e;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.sp-multi-asset-item:hover {
  border-color: #667eea;
  background: #333350;
}
.sp-multi-asset-item:has(.sp-multi-asset-cb:checked) {
  border-color: #667eea;
  background: rgba(102,126,234,0.15);
}
.sp-multi-asset-cb {
  margin-bottom: 2px;
  accent-color: #667eea;
  cursor: pointer;
}

/* ---- 样片提交表单 ---- */
.sp-sample-ep-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.sp-sample-ep-row input[type="number"] {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a3e;
  color: #fff;
  font-size: 0.8rem;
}
.sp-sample-ep-row input[type="text"] {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a3e;
  color: #fff;
  font-size: 0.8rem;
}
.sp-sample-ep-row select {
  flex: 2;
  padding: 6px 8px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a3e;
  color: #fff;
  font-size: 0.8rem;
}
.sp-add-ep-btn {
  padding: 6px 10px;
  background: #667eea;
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.sp-add-ep-btn:hover {
  opacity: 0.85;
}

/* 短信删除按钮 */
.msg-del-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 4px;
  border-radius: 4px;
  transition: all 0.15s;
  vertical-align: middle;
  line-height: 1;
}
.msg-del-btn:hover {
  color: #e74c3c;
  background: rgba(231,76,60,0.1);
}

/* 样片预览弹窗 */
.sp-preview-modal {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.sp-preview-content {
  position: relative;
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 20px;
  max-width: 90vw;
  overflow: visible;
}
.sp-preview-content .sp-preview-body {
  max-height: calc(90vh - 40px);
  overflow-y: auto;
}
.sp-preview-content .close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 30px;
  height: 30px;
  background: #333;
  border: 2px solid #555;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}
.sp-preview-content .close:hover {
  background: #e74c3c;
  border-color: #e74c3c;
}
.sp-preview-content video,
.sp-preview-content img {
  display: block;
  border-radius: 8px;
}

/* 预览弹窗审核区 */
.sp-preview-review {
  margin-top: 10px;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  width: 100%;
}
.sp-preview-review .sp-episode-review-actions {
  gap: 6px;
}
.sp-preview-review .sp-episode-review-comment {
  min-height: 32px;
  font-size: 0.78rem;
  padding: 6px 10px;
}
.sp-preview-review .sp-episode-review-btn {
  padding: 6px 14px;
  font-size: 0.78rem;
}
.sp-sample-thumb {
  cursor: pointer;
}
.sp-sample-thumb:hover {
  opacity: 0.85;
}

/* ---- 审核印章叠加 ---- */
.sp-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  border: 2px solid;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  font-size: 0.7rem;
  line-height: 1.2;
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
.sp-stamp-approved {
  color: #2ecc71;
  border-color: #2ecc71;
  background: rgba(46,204,113,0.3);
}
.sp-stamp-rejected {
  color: #e74c3c;
  border-color: #e74c3c;
  background: rgba(231,76,60,0.3);
}
.sp-stamp-eliminated {
  color: #f39c12;
  border-color: #f39c12;
  background: rgba(243,156,18,0.3);
}

/* ---- 逐集审核样式 ---- */

/* 水平集数行容器 */
.sp-episodes-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  padding: 4px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* 单集容器 - 水平排列 */
.sp-episode-wrap {
  flex: 0 0 auto;
  width: 96px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 审核状态标签 */
.sp-episode-review-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.sp-episode-review-tag.approved {
  background: rgba(46,204,113,0.2);
  color: #2ecc71;
  border: 1px solid rgba(46,204,113,0.3);
}
.sp-episode-review-tag.rejected {
  background: rgba(231,76,60,0.2);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}

/* 视频预览容器 */
.sp-episode-video-wrap {
  margin-bottom: 6px;
  position: relative;
  display: inline-block;
  width: 80px;
  height: 90px;
}

/* 视频标签 */
.sp-episode-video {
  max-width: 320px;
  width: 100%;
  border-radius: 8px;
  display: block;
  background: #111;
}
.sp-episode-video-placeholder {
  width: 320px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  border: 1px dashed #444;
  border-radius: 8px;
  color: #888;
  font-size: 0.85rem;
  cursor: pointer;
}
.sp-episode-video-placeholder:hover {
  border-color: #667eea;
  color: #667eea;
}

/* 集标题 */
.sp-episode-title {
  font-size: 0.7rem;
  color: #ccc;
  margin-bottom: 6px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-episode-subtitle {
  font-weight: 400;
  font-size: 0.65rem;
  color: #999;
}

/* 审核控制区 */
.sp-episode-review-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

/* 审核意见输入框 */
.sp-episode-review-comment {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1e1e2e;
  color: #ddd;
  font-size: 0.65rem;
  resize: vertical;
  min-height: 24px;
  max-height: 52px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.sp-episode-review-comment:focus {
  border-color: #667eea;
}
.sp-episode-review-comment::placeholder {
  color: #555;
}

/* 审核按钮组 */
.sp-episode-review-btns {
  display: flex;
  gap: 4px;
}

/* 审核按钮 */
.sp-episode-review-btn {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #2a2a3e;
  color: #ccc;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}
.sp-episode-review-btn.approve:hover {
  background: rgba(46,204,113,0.2);
  border-color: #2ecc71;
  color: #2ecc71;
}
.sp-episode-review-btn.reject:hover {
  background: rgba(231,76,60,0.2);
  border-color: #e74c3c;
  color: #e74c3c;
}
.sp-episode-review-btn.active-approve {
  background: rgba(46,204,113,0.2);
  border-color: #2ecc71;
  color: #2ecc71;
}
.sp-episode-review-btn.active-reject {
  background: rgba(231,76,60,0.2);
  border-color: #e74c3c;
  color: #e74c3c;
}

/* 确认审核栏 */
.sp-confirm-review-bar {
  display: flex;
  justify-content: flex-end;
  padding: 12px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 8px;
}

/* 确认审核按钮 */
.sp-confirm-review-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.sp-confirm-review-btn:hover {
  opacity: 0.85;
}

/* 样片剧本内容 */
.sp-script-content {
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #ccc;
  padding: 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

/* ========== Video Clip 模块样式 ========== */
.video-clip { display: flex; flex-direction: column; gap: 24px; padding: 40px 48px; max-width: 960px; margin: 0 auto; width: 100%; }
.video-clip h1 { font-size: 36px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.5px; }
.video-clip .subtitle { color: #888; font-size: 16px; margin-bottom: 8px; }

/* Upload Area */
.video-clip .upload-area { background: #1a1a1e; border-radius: 16px; padding: 60px 40px; text-align: center; border: 2px dashed #333; cursor: pointer; transition: all 0.3s; }
.video-clip .upload-area:hover { border-color: #667eea; background: #1e1e24; }
.video-clip .upload-area.dragover { border-color: #667eea; background: rgba(102,126,234,0.08); }
.video-clip .upload-icon { font-size: 48px; margin-bottom: 12px; }
.video-clip .upload-text { font-size: 18px; font-weight: 500; margin-bottom: 6px; }
.video-clip .upload-hint { color: #666; font-size: 13px; }
.video-clip .upload-area input[type="file"] { display: none; }

/* Editor Section */
.video-clip .editor-section { display: none; background: #1a1a1e; border-radius: 16px; padding: 32px; }
.video-clip .file-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding: 12px 16px; background: #222; border-radius: 10px; }
.video-clip .file-name { font-size: 14px; font-weight: 500; }
.video-clip .file-size { font-size: 13px; color: #888; margin-left: 8px; }
.video-clip .btn-remove { background: none; border: 1px solid #444; color: #aaa; cursor: pointer; font-size: 13px; padding: 6px 14px; border-radius: 8px; transition: all 0.2s; }
.video-clip .btn-remove:hover { background: rgba(215,0,21,0.1); border-color: #d70015; color: #d70015; }
.video-clip .video-wrapper { border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 24px; }
.video-clip .video-wrapper video { width: 100%; display: block; max-height: 420px; object-fit: contain; }

/* Timeline */
.video-clip .timeline-section { margin-bottom: 28px; }
.video-clip .timeline-label { display: flex; justify-content: space-between; font-size: 12px; color: #888; margin-bottom: 6px; font-family: 'SF Mono', 'Menlo', 'Consolas', monospace; }
.video-clip .timeline-container { position: relative; height: 68px; background: #1d1d1f; border-radius: 10px; overflow: hidden; user-select: none; cursor: pointer; }
.video-clip .timeline-thumbnails { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; }
.video-clip .timeline-thumbnails canvas { width: 100%; height: 100%; }
.video-clip .timeline-selection { position: absolute; top: 0; height: 100%; background: rgba(102,126,234,0.2); border-top: 3px solid #667eea; border-bottom: 3px solid #667eea; }
.video-clip .timeline-handle { position: absolute; top: 0; width: 22px; height: 100%; cursor: ew-resize; display: flex; align-items: center; justify-content: center; z-index: 10; }
.video-clip .timeline-handle::after { content: ''; width: 6px; height: 32px; background: #667eea; border-radius: 3px; box-shadow: 0 2px 8px rgba(102,126,234,0.4); }
.video-clip .timeline-handle:hover::after { height: 40px; background: #5a6fd6; }
.video-clip .handle-left { left: 0; transform: translateX(-50%); }
.video-clip .handle-right { right: 0; transform: translateX(50%); }
.video-clip .handle-tooltip { position: absolute; top: -32px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #fff; font-size: 11px; font-family: 'SF Mono','Menlo','Consolas',monospace; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.video-clip .handle-tooltip.show { opacity: 1; }
.video-clip .timeline-playhead { position: absolute; top: 0; width: 2px; height: 100%; background: #ff3b30; pointer-events: none; transition: left 0.1s linear; }

/* Time Display */
.video-clip .time-display { display: flex; justify-content: center; gap: 28px; margin-top: 18px; margin-bottom: 24px; }
.video-clip .time-item { text-align: center; }
.video-clip .time-item label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 500; }
.video-clip .time-item .time-value { display: block; font-size: 20px; font-weight: 500; font-family: 'SF Mono','Menlo','Consolas',monospace; margin-top: 4px; cursor: text; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; transition: all 0.2s; min-width: 155px; background: transparent; text-align: center; color: #fff; }
.video-clip .time-item .time-value:hover { background: #222; border-color: #444; }
.video-clip .time-item .time-value:focus { outline: none; border-color: #667eea; background: #1a1a1e; }

/* Keyboard hints */
.video-clip .keyboard-hints { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.video-clip .kbd-hint { font-size: 11px; color: #888; }
.video-clip .kbd-hint kbd { display: inline-block; background: #222; border-radius: 4px; padding: 2px 6px; font-family: 'SF Mono','Menlo',monospace; font-size: 10px; margin-right: 3px; border: 1px solid #444; color: #ccc; }

/* Buttons */
.video-clip .actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.video-clip .btn { padding: 12px 28px; border-radius: 980px; border: none; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.video-clip .btn-primary { background: #667eea; color: #fff; }
.video-clip .btn-primary:hover { background: #5a6fd6; transform: scale(1.02); }
.video-clip .btn-primary:disabled { background: #444; cursor: not-allowed; transform: none; }
.video-clip .btn-secondary { background: transparent; color: #667eea; border: 1.5px solid #667eea; }
.video-clip .btn-secondary:hover { background: rgba(102,126,234,0.06); }
.video-clip .btn-success { background: #34c759; color: #fff; }
.video-clip .btn-success:hover { background: #2db84e; }

/* Status & Progress */
.video-clip .status-bar { display: none; margin-top: 18px; padding: 14px 18px; background: #222; border-radius: 10px; text-align: center; font-size: 14px; color: #ccc; }
.video-clip .status-bar.show { display: block; }
.video-clip .status-bar.success { background: rgba(52,199,89,0.1); color: #34c759; }
.video-clip .status-bar.error { background: rgba(215,0,21,0.1); color: #ff3b30; }
.video-clip .download-link { color: #667eea; text-decoration: none; font-weight: 500; }
.video-clip .download-link:hover { text-decoration: underline; }
.video-clip .progress-bar { width: 100%; height: 4px; background: #333; border-radius: 2px; margin-top: 8px; overflow: hidden; display: none; }
.video-clip .progress-bar.show { display: block; }
.video-clip .progress-fill { height: 100%; background: #667eea; border-radius: 2px; transition: width 0.3s ease; width: 0%; }

/* AI Edit Sections */
.video-clip .ai-edit-section, .video-clip .ai-result-section { display: none; margin-top: 24px; padding: 28px; background: #1a1a1e; border-radius: 16px; }
.video-clip .ai-edit-section.show, .video-clip .ai-result-section.show { display: block; }
.video-clip .ai-edit-title, .video-clip .ai-result-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.video-clip .ai-edit-subtitle, .video-clip .ai-result-subtitle { font-size: 13px; color: #888; margin-bottom: 18px; }
.video-clip .ai-input-group { margin-bottom: 14px; }
.video-clip .ai-input-group label { display: block; font-size: 13px; font-weight: 500; color: #aaa; margin-bottom: 6px; }
.video-clip .ai-input-group textarea { width: 100%; padding: 12px 16px; border: 1px solid #333; border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical; min-height: 80px; transition: border-color 0.2s; background: #111; color: #fff; }
.video-clip .ai-input-group textarea:focus { outline: none; border-color: #667eea; }
.video-clip .ai-input-group input[type="text"] { width: 100%; padding: 10px 16px; border: 1px solid #333; border-radius: 10px; font-size: 14px; font-family: inherit; transition: border-color 0.2s; background: #111; color: #fff; }
.video-clip .ai-input-group input[type="text"]:focus { outline: none; border-color: #667eea; }
.video-clip .ai-source-info { padding: 10px 14px; background: #222; border-radius: 8px; font-size: 13px; color: #888; margin-bottom: 14px; }
.video-clip .ai-source-info span { color: #ccc; font-weight: 500; }
.video-clip .prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.video-clip .prompt-chip { padding: 6px 14px; border-radius: 980px; background: rgba(102,126,234,0.1); border: 1px solid rgba(102,126,234,0.3); color: #667eea; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.video-clip .prompt-chip:hover { background: #667eea; color: #fff; border-color: #667eea; }
.video-clip .ref-preview { margin-top: 8px; display: none; border-radius: 8px; overflow: hidden; border: 1px solid #333; }
.video-clip .ref-preview.show { display: block; }
.video-clip .ref-preview img { max-width: 200px; max-height: 120px; display: block; }
.video-clip .ref-preview .ref-error { padding: 8px 12px; font-size: 12px; color: #ff3b30; background: rgba(215,0,21,0.1); }
.video-clip .ai-result-video { border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 18px; }
.video-clip .ai-result-video video { width: 100%; display: block; max-height: 380px; object-fit: contain; }
.video-clip .ai-result-actions { display: flex; justify-content: center; gap: 12px; }

/* AI Log */
.video-clip .ai-log { margin-top: 10px; padding: 12px 16px; background: #1d1d1f; border-radius: 10px; font-family: 'SF Mono', monospace; font-size: 12px; color: #888; max-height: 120px; overflow-y: auto; display: none; }
.video-clip .ai-log.show { display: block; }
.video-clip .ai-log .log-line { margin-bottom: 4px; }
.video-clip .ai-log .log-line.active { color: #34c759; }
.video-clip .ai-log .log-line .spinner { display: inline-block; animation: vc-spin 1s linear infinite; }
@keyframes vc-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Adjust Section */
.video-clip .adjust-section { display: none; margin-top: 18px; padding: 20px; background: #222; border-radius: 12px; }
.video-clip .adjust-section.show { display: block; }
.video-clip .adjust-title { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.video-clip .adjust-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.video-clip .adjust-row label { font-size: 13px; color: #aaa; min-width: 70px; }
.video-clip .adjust-row input[type="range"] { flex: 1; accent-color: #667eea; background: #333; }
.video-clip .adjust-row .adjust-value { font-size: 13px; font-family: 'SF Mono', monospace; min-width: 50px; text-align: right; color: #ccc; }
.video-clip .adjust-actions { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }

/* Compare Mode */
.video-clip .compare-toggle { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; justify-content: center; }
.video-clip .compare-toggle label { font-size: 13px; color: #aaa; cursor: pointer; }
.video-clip .compare-toggle input[type="checkbox"] { accent-color: #667eea; width: 16px; height: 16px; }
.video-clip .compare-view { display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.video-clip .compare-view.show { display: grid; }
.video-clip .compare-panel { border-radius: 10px; overflow: hidden; background: #000; }
.video-clip .compare-panel video { width: 100%; display: block; max-height: 220px; object-fit: contain; }
.video-clip .compare-label { text-align: center; font-size: 11px; color: #888; padding: 6px 0; background: #1a1a1e; }
