/**
 * Shiguang 拾光集 - 投稿页样式
 */

/* ========== 投稿页 ========== */
.contribute-page { min-height: 100vh; }

.contribute-main {
  padding-top: calc(var(--nav-height) + 32px);
  padding-bottom: 80px;
}

.contribute-header {
  text-align: center;
  padding: 32px 0 40px;
  position: relative;
}
.contribute-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg,
    rgba(108,159,255,0.06) 0%,
    rgba(255,184,122,0.03) 60%,
    transparent 100%);
  pointer-events: none;
}
.contribute-title {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.contribute-subtitle {
  font-size: 14px;
  color: var(--text-light);
}

/* ========== 表单 ========== */
.contribute-form {
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  margin-bottom: 48px;
}

.form-group {
  margin-bottom: 28px;
  position: relative;
}
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.form-label .required { color: #ff4d4f; margin-left: 2px; }
.form-label .optional { color: var(--text-light); font-weight: 400; font-size: 12px; }

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: rgba(255,255,255,0.8);
  transition: all var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,159,255,0.1);
}
.form-input::placeholder { color: var(--text-light); }

.form-counter {
  text-align: right;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.form-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
}

/* 分类选择器 */
.category-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.category-tag {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}
.category-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.category-tag.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
}

/* 封面上传 */
.cover-uploader { position: relative; }
.cover-upload-area {
  width: 100%;
  height: 180px;
  border: 2px dashed rgba(0,0,0,0.08);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(0,0,0,0.01);
}
.cover-upload-area:hover {
  border-color: var(--primary);
  background: rgba(108,159,255,0.02);
}
.cover-upload-area .upload-icon { font-size: 32px; opacity: 0.4; }
.cover-upload-area .upload-text { font-size: 14px; color: var(--text-secondary); }
.cover-upload-area .upload-hint { font-size: 12px; color: var(--text-light); }

.cover-preview {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}
.cover-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
}
.cover-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cover-remove:hover { background: rgba(0,0,0,0.7); }

/* ========== 富文本编辑器 ========== */
.editor-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,0.9);
  transition: border-color var(--transition);
}
.editor-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,159,255,0.1);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(0,0,0,0.01);
}
.toolbar-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.toolbar-btn:hover {
  background: rgba(108,159,255,0.08);
  color: var(--primary);
}
.toolbar-btn.active {
  background: rgba(108,159,255,0.12);
  color: var(--primary);
}
.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(0,0,0,0.08);
  margin: 0 4px;
}

.editor-content {
  min-height: 300px;
  max-height: 600px;
  overflow-y: auto;
  padding: 20px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  outline: none;
}
.editor-content:empty::before {
  content: attr(data-placeholder);
  white-space: pre-wrap;
  color: var(--text-light);
  opacity: 0.6;
  pointer-events: none;
}
.editor-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 20px 0 12px;
}
.editor-content p { margin-bottom: 12px; }
.editor-content img {
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}
.editor-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 8px 16px;
  margin: 12px 0;
  background: rgba(108,159,255,0.04);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}
.editor-content ul, .editor-content ol {
  padding-left: 24px;
  margin-bottom: 12px;
}
.editor-content hr {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 20px 0;
}

/* ========== 投稿须知 ========== */
.contribute-rules {
  background: rgba(255,184,122,0.06);
  border: 1px solid rgba(255,184,122,0.15);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.contribute-rules h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.contribute-rules ul {
  list-style: none;
  padding: 0;
}
.contribute-rules li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  padding-left: 18px;
  position: relative;
}
.contribute-rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,184,122,0.5);
}

/* ========== 提交按钮 ========== */
.form-actions {
  text-align: center;
}
.submit-btn {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 16px rgba(108,159,255,0.3);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
}
.submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108,159,255,0.4);
}
.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-agreement {
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkbox-label input { display: none; }
.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}
.form-agreement a { color: var(--primary); }

/* ========== 我的投稿列表 ========== */
.my-contributions {
  max-width: 720px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 15px; font-weight: 600; color: var(--text); }
.section-subtitle { font-size: 12px; color: var(--text-light); }

.contrib-list { display: flex; flex-direction: column; gap: 12px; }
.contrib-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.contrib-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.contrib-item-cover {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(0,0,0,0.03);
}
.contrib-item-info { flex: 1; min-width: 0; }
.contrib-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.contrib-item-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 12px;
}
.contrib-item-status {
  flex-shrink: 0;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.status-pending { color: #D4804A; background: rgba(255,184,122,0.15); }
.status-approved, .status-published { color: #52c41a; background: rgba(82,196,26,0.1); }
.status-rejected { color: #ff4d4f; background: rgba(255,77,79,0.1); cursor: pointer; }

.contrib-more { text-align: center; padding: 20px 0; }
.load-more-btn {
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: none;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.load-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.contrib-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}
.contrib-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.contrib-empty p { font-size: 14px; }

/* ========== 重新投稿弹窗 ========== */
.resubmit-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}
.resubmit-modal.open { display: flex; }
.modal-map {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  max-width: 560px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: fadeInUp 0.3s ease;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.04);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.modal-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-desc { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.8);
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.6;
}
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,159,255,0.1);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}
.modal-cancel {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: none;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}
.modal-confirm {
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== 成功提示 ========== */
.submit-success {
  text-align: center;
  padding: 40px 20px;
  animation: fadeInUp 0.4s ease;
}
.success-icon { font-size: 56px; margin-bottom: 16px; }
.success-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.success-desc { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }
.success-btn {
  padding: 10px 28px;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .contribute-form {
    padding: 24px 20px;
    margin: 0 8px 40px;
  }
  .editor-content { min-height: 200px; padding: 16px; }
  .cover-upload-area { height: 140px; }
  .contrib-item-cover { width: 64px; height: 48px; }
  .modal-card { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .contribute-title { font-size: 1.4rem; }
  .editor-toolbar { padding: 6px 8px; }
  .toolbar-btn { width: 28px; height: 28px; font-size: 12px; }
  .contrib-item { flex-wrap: wrap; }
  .contrib-item-cover { width: 100%; height: 120px; }
}

/* ========== 投稿协议弹窗 ========== */
.agreement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.agreement-modal {
  width: 560px;
  max-width: 100%;
  max-height: 82vh;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agreement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.agreement-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.agreement-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.agreement-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.agreement-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.agreement-html {
  font-size: 14px;
  color: var(--text);
  line-height: 1.9;
}

.agreement-html h1, .agreement-html h2, .agreement-html h3 {
  margin: 16px 0 8px;
}

.agreement-html ul, .agreement-html ol {
  padding-left: 20px;
  margin: 8px 0;
}

.agreement-html p {
  margin: 8px 0;
}

.agreement-updated {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
}

.agreement-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  text-align: right;
  flex-shrink: 0;
}
/* ========== 投稿页 登录 / 绑定提示卡片 ========== */
.login-prompt {
  max-width: 460px;
  margin: 72px auto 60px;
  text-align: center;
  padding: 56px 40px 48px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.6s ease forwards;
}
.login-prompt .prompt-icon { font-size: 52px; margin-bottom: 18px; color: var(--primary); opacity: 0.85; }
.login-prompt h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.login-prompt p { font-size: 14px; color: var(--text-light); line-height: 1.7; margin-bottom: 26px; }

/* —— 绑定微信专属（微信绿主题） —— */
.login-prompt.bind-mode { padding: 52px 40px 46px; }
.login-prompt.bind-mode .bind-icon-wrap { display: flex; justify-content: center; margin-bottom: 24px; }
.login-prompt.bind-mode .bind-icon {
  width: 86px; height: 86px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: #fff;
  background: linear-gradient(135deg, #2BC48A, #07C160);
  box-shadow: 0 12px 30px rgba(7, 193, 96, 0.35), 0 0 0 10px rgba(7, 193, 96, 0.08);
  animation: bindFloat 3s ease-in-out infinite;
}
@keyframes bindFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.login-prompt.bind-mode h2 { font-size: 1.5rem; }
.login-prompt.bind-mode p { margin-bottom: 20px; }
.login-prompt.bind-mode .bind-perks {
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 30px;
}
.login-prompt.bind-mode .bind-perk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: #0a9e52;
  background: rgba(7, 193, 96, 0.09);
  border: 1px solid rgba(7, 193, 96, 0.22);
  padding: 6px 14px; border-radius: 999px;
}
.login-prompt.bind-mode .bind-perk i { font-size: 15px; }
.login-prompt.bind-mode .bind-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 40px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, #2BC48A, #07C160);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 8px 22px rgba(7, 193, 96, 0.35);
  transition: all 0.25s ease; text-decoration: none;
}
.login-prompt.bind-mode .bind-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(7, 193, 96, 0.45); }
.login-prompt.bind-mode .bind-btn i { font-size: 19px; }
@media (max-width: 480px) {
  .login-prompt, .login-prompt.bind-mode { margin: 48px 20px 40px; padding: 44px 24px 38px; }
  .login-prompt.bind-mode .bind-icon { width: 72px; height: 72px; font-size: 36px; }
}
