/* 发布页面样式 - 滚动导航版 */

/* 页面容器 */
.publish-page {
  min-height: calc(100vh - 72px);
  background: var(--bg-page, #f8fafc);
  padding: 24px 0;
  padding-top: calc(var(--nav-h, 64px) + 24px); /* 预留导航栏高度 */
}

.publish-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 左右布局 */
.publish-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* 左侧导航 */
.publish-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 88px;
}

.publish-title-area {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.publish-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text, #1e293b);
  margin: 0 0 8px;
}

.publish-subtitle {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin: 0;
  line-height: 1.5;
}

/* 滚动导航 */
.publish-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.publish-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.publish-nav .nav-item:hover {
  background: var(--bg-section, #f1f5f9);
  color: var(--text, #1e293b);
}

.publish-nav .nav-item.active {
  background: var(--primary-bg, #eff6ff);
  color: var(--primary, #2563eb);
  font-weight: 500;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border, #e2e8f0);
  flex-shrink: 0;
}

.publish-nav .nav-item.active .nav-dot {
  background: var(--primary, #2563eb);
}

/* 右侧表单内容 */
.publish-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 80px;
}

/* 表单区块 */
.form-section {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
  scroll-margin-top: 100px;
}

.form-section-header {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-section, #f8fafc);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 20px;
  height: 20px;
}

.form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #1e293b);
  margin: 0 0 2px;
}

.form-section-desc {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  margin: 0;
}

.form-section-body {
  padding: 24px;
}

/* 表单元素 */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-group {
  flex: 1;
}

.form-group.flex-2 { flex: 2; }
.form-group.flex-1 { flex: 1; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1e293b);
  margin-bottom: 6px;
}

.form-label .required {
  color: #dc2626;
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: #fff;
  color: var(--text, #1e293b);
  transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted, #94a3b8);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}

/* 标签输入 */
.tag-input-area {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-pills:empty { margin-bottom: 0; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-bg, #eff6ff);
  color: var(--primary, #2563eb);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  line-height: 1;
}

.tag-remove:hover { opacity: 1; }

.tag-input-area .form-input {
  border: none;
  padding: 8px 0;
}

.tag-input-area .form-input:focus { box-shadow: none; }

/* AI标签推荐 */
.ai-tags-suggest {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-radius: 8px;
}

.ai-tag-label {
  font-size: 13px;
  color: #0369a1;
  font-weight: 500;
}

.ai-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-tag-btn {
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  font-size: 12px;
  color: #0369a1;
  cursor: pointer;
  transition: all 0.15s;
}

.ai-tag-btn:hover { background: #bae6fd; }

/* AI 智能填写面板 */
.ai-assist-banner {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.ai-banner-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-banner-header:hover {
  background: rgba(37, 99, 235, 0.05);
}

.ai-banner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #1e40af;
}

.ai-badge {
  padding: 2px 6px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
}

.ai-banner-desc {
  flex: 1;
  margin-left: 16px;
  font-size: 13px;
  color: #64748b;
}

.ai-banner-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 13px;
}

.ai-assist-panel {
  border-top: 1px solid #e0f2fe;
  background: #fff;
}

.ai-panel-content {
  padding: 20px;
}

.ai-input-area {
  margin-bottom: 12px;
}

.ai-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
}

.ai-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ai-templates {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ai-template-label {
  font-size: 13px;
  color: #64748b;
}

.ai-template-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-template-btn:hover {
  background: #f8fafc;
  border-color: #2563eb;
  color: #2563eb;
}

.ai-result-area {
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ai-result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: #16a34a;
}

.ai-result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ai-result-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-result-label {
  font-size: 12px;
  color: #64748b;
}

.ai-result-value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

.ai-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 加载动画 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--primary, #2563eb);
  background: var(--bg-section, #f8fafc);
}

.upload-area-small { padding: 14px; }

.upload-placeholder {
  color: var(--text-secondary, #64748b);
}

.upload-placeholder svg {
  margin-bottom: 6px;
  opacity: 0.5;
}

.upload-placeholder span {
  display: block;
  font-size: 12px;
}

.upload-placeholder img {
  max-width: 100%;
  max-height: 100px;
  border-radius: 6px;
}

.upload-file-list {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary, #64748b);
}

.upload-file-list span { font-size: 12px; }
.upload-area-file { padding: 16px; }
.upload-video { padding: 18px; }
.upload-video .upload-placeholder svg { color: #7c3aed; opacity: 0.7; }

/* 视频预览 */
.video-preview {
  position: relative;
  max-width: 100%;
}
.video-preview video {
  max-width: 100%;
  max-height: 120px;
  border-radius: 6px;
  background: #000;
}
.video-preview .video-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.video-preview .video-remove:hover {
  background: #dc2626;
}

/* 固定底部按钮 */
.form-actions-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border, #e2e8f0);
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  z-index: 100;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary, #2563eb);
  color: #fff;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-success {
  background: var(--green, #16a34a);
  color: #fff;
}

.btn-success:hover { background: #15803d; }

.btn-outline {
  background: #fff;
  color: var(--text, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
}

.btn-outline:hover {
  background: var(--bg-section, #f8fafc);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary, #64748b);
}

.btn-ghost:hover {
  background: var(--bg-section, #f8fafc);
  color: var(--text, #1e293b);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* 响应式 */
@media (max-width: 1024px) {
  .publish-sidebar {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .publish-layout {
    flex-direction: column;
  }

  .publish-sidebar {
    width: 100%;
    position: static;
    margin-bottom: 20px;
  }

  .publish-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .publish-nav .nav-item {
    padding: 8px 12px;
    font-size: 13px;
  }

  .nav-dot { display: none; }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-actions-fixed {
    flex-wrap: wrap;
  }

  .form-actions-fixed .btn {
    flex: 1;
  }
}