/* ============================================
   道友投稿页 · 导航 + 米黄纸感表单（与全站协调）
   ============================================ */

.page-submit .page-main {
  min-height: 50vh;
}

.page-submit .page-header {
  margin-top: 70px;
}

.page-submit .page-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.page-submit .page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* 导航右侧：登录状态 */
.page-submit .navbar .nav-container {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-submit .nav-menu {
  flex: 1;
  justify-content: center;
  min-width: 0;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.nav-user-slot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-nav-login,
.nav-logout {
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.btn-nav-login {
  background: var(--primary-color);
  color: var(--secondary-color);
  border: 1px solid var(--border-color);
}

.btn-nav-login:hover {
  filter: brightness(1.05);
}

.nav-user-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.nav-logout {
  color: var(--vermilion, #c94a2a);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0.25rem;
}

.nav-logout:hover {
  text-decoration: underline;
}

.nav-user-slot .user-nickname {
  font-size: 0.9rem;
  color: #5c4b37;
  white-space: nowrap;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-user-slot .btn-small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  min-width: auto;
  border-radius: 6px;
  text-decoration: none;
}

.nav-user-slot .btn-nav-secondary {
  background: #fdf6e3;
  color: #8b7355;
  border: 1px solid #e8dcc8;
}

.nav-user-slot .btn-logout {
  background: transparent;
  color: #c44d4d;
  border: 1px solid #e8dcc8;
  cursor: pointer;
  font-family: inherit;
}

.nav-user-slot .btn-logout:hover {
  background: rgba(196, 77, 77, 0.08);
}

/* ===== 投稿页面样式（米黄纸感） ===== */

/* 登录提示卡片 */
.login-notice {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.notice-card {
  background: #fdf6e3;
  border: 2px solid #8b7355;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.notice-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.notice-text {
  color: #5c4b37;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.notice-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* 投稿区域 */
.submit-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

.submit-container {
  background: #fffef9;
  border: 1px solid #e8dcc8;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(139, 115, 85, 0.1);
}

/* 投稿须知 */
.submit-notice {
  background: #fff8e7;
  border-left: 4px solid #d4a76a;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.notice-title {
  color: #8b7355;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-family: 'ZCOOL KuaiLe', cursive;
}

.notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.notice-list li {
  color: #5c4b37;
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.notice-list li::before {
  content: '⚠️';
  position: absolute;
  left: 0;
}

.notice-list strong {
  color: #8b7355;
}

/* 表单样式 */
.submit-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  color: #5c4b37;
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.label-icon {
  font-size: 1.2rem;
}

.required {
  color: #c44d4d;
}

.optional {
  color: #999;
  font-weight: normal;
  font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e8dcc8;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fffef9;
  color: #5c4b37;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #d4a76a;
  box-shadow: 0 0 0 3px rgba(212, 167, 106, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #aaa;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  color: #999;
  font-size: 0.85rem;
}

.form-error {
  color: #c44d4d;
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* 星级评分（脚本用 data-value 控制选中段） */
.rating-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rating-star {
  width: 44px;
  height: 44px;
  font-size: 2rem;
  background: none;
  border: 2px solid #e8dcc8;
  border-radius: 8px;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.rating-star:hover {
  color: #f5c542;
  border-color: #f5c542;
  transform: scale(1.08);
}

/* 脚本 hover / 点击态（.active） */
.rating-star.active {
  color: #f5c542;
  border-color: #f5c542;
  background: #fff8e7;
}

.rating-container[data-value='1'] .rating-star:nth-child(1),
.rating-container[data-value='2'] .rating-star:nth-child(-n + 2),
.rating-container[data-value='3'] .rating-star:nth-child(-n + 3),
.rating-container[data-value='4'] .rating-star:nth-child(-n + 4),
.rating-container[data-value='5'] .rating-star:nth-child(-n + 5) {
  color: #f5c542;
  border-color: #f5c542;
  background: #fff8e7;
}

.rating-container[data-value=''] .rating-star {
  color: #ddd;
  border-color: #e8dcc8;
  background: none;
}

#ratingText {
  color: #d4a76a;
  font-weight: 500;
}

/* 图片上传 */
.upload-area {
  position: relative;
  border: 2px dashed #e8dcc8;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area:hover {
  border-color: #d4a76a;
  background: #fff8e7;
}

.upload-area.is-dragover {
  border-color: #d4a76a;
  background: rgba(255, 248, 231, 0.95);
}

.upload-input {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-placeholder {
  color: #999;
  pointer-events: none;
}

.upload-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.upload-text {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.upload-hint {
  font-size: 0.85rem;
  color: #aaa;
}

.upload-preview {
  position: relative;
  display: inline-block;
}

.upload-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid #e8dcc8;
}

.upload-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c44d4d;
  color: #fff;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 3;
}

.upload-remove:hover {
  background: #a83d3d;
}

/* 表单操作 */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e8dcc8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: filter 0.2s, transform 0.1s;
}

.btn:hover {
  filter: brightness(1.03);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--border-color);
}

.btn-secondary {
  background: #fdf6e3;
  color: #5c4b37;
  border: 2px solid #e8dcc8;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  min-width: 150px;
}

#submitBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* 提交成功 */
.submit-success {
  text-align: center;
  padding: 3rem 1rem;
}

.success-card {
  background: #f0f9ed;
  border: 2px solid #7cb342;
  border-radius: 16px;
  padding: 3rem 2rem;
}

.success-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.success-title {
  color: #558b2f;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-family: 'ZCOOL KuaiLe', cursive;
}

.success-text {
  color: #5c4b37;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #5c4b37;
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 9999;
  min-width: 280px;
  max-width: min(90vw, 420px);
  justify-content: center;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.success {
  background: #558b2f;
}

.toast.error {
  background: #c44d4d;
}

.toast.info {
  background: #5c4b37;
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: left;
}

/* 兼容旧类名（若仍有脚本使用） */
.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.toast-error {
  background: #c44d4d;
}

/* 响应式 */
@media (max-width: 768px) {
  .page-submit .page-title {
    font-size: 1.75rem;
  }

  .submit-container {
    padding: 1.5rem;
  }

  .notice-actions,
  .success-actions,
  .form-actions {
    flex-direction: column;
  }

  .btn-large {
    width: 100%;
  }

  .rating-star {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }

  .upload-area {
    padding: 1.5rem;
  }

  .upload-preview img {
    max-width: 150px;
    max-height: 150px;
  }

  .nav-user-slot {
    order: 3;
  }

  .navbar .nav-container .mobile-menu-btn {
    order: 4;
  }
}
