/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #8B2C1C;
  --color-primary-light: #C84B31;
  --color-gold: #C9A24B;
  --color-gold-light: #E0C170;
  --color-bg: #f5f0e8;
  --color-bg-dark: #e8e0d0;
  --color-text: #2a2018;
  --color-text-dim: #6b5d4f;
  --color-white: #ffffff;
  --color-border: #d4c9b8;
  --color-card: #ffffff;
  --color-success: #28a745;
  --color-danger: #dc3545;
  --font-serif: 'Noto Serif SC', serif;
  --font-sans: 'Noto Sans SC', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.15);
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* ===== 顶部导航 ===== */
.contribute-header {
  background: linear-gradient(135deg, #2a1a10 0%, #4a2a18 100%);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-back,
.header-admin {
  color: #b0a898;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s ease;
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  flex: 1;
}

.header-admin {
  text-align: right;
}

.header-back:hover,
.header-admin:hover {
  color: var(--color-gold);
}

.lang-switch {
  background: rgba(201, 162, 75, 0.12);
  border: 1px solid rgba(201, 162, 75, 0.4);
  color: var(--color-gold);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  font-family: inherit;
  white-space: nowrap;
}

.lang-switch:hover {
  background: rgba(201, 162, 75, 0.25);
  border-color: var(--color-gold);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  font-size: 24px;
  color: var(--color-gold);
}

.header-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 2px;
}

/* ===== 审核提示 ===== */
.notice-bar {
  background: rgba(201, 162, 75, 0.15);
  border-bottom: 1px solid rgba(201, 162, 75, 0.3);
  padding: 10px 24px;
  text-align: center;
  font-size: 13px;
  color: #8a6d20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.notice-icon {
  font-size: 16px;
}

/* ===== 主内容区 ===== */
.contribute-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ===== Tab 切换 ===== */
.contribute-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.contribute-tab {
  flex: 1;
  padding: 16px 20px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-dim);
}

.contribute-tab:hover {
  border-color: var(--color-gold);
  color: var(--color-text);
}

.contribute-tab.active {
  border-color: var(--color-primary);
  background: rgba(139, 44, 28, 0.05);
  color: var(--color-primary);
  font-weight: 600;
}

.tab-icon {
  font-size: 20px;
}

/* ===== Tab 内容 ===== */
.tab-content {
  display: none;
}

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

/* ===== 表单卡片 ===== */
.form-card {
  background: var(--color-card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}

.form-card-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.form-card-desc {
  font-size: 13px;
  color: var(--color-text-dim);
  margin-bottom: 28px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: border-color 0.3s ease;
  background: var(--color-white);
  color: var(--color-text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

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

.form-hint {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-top: 4px;
}

.form-hint a {
  color: var(--color-primary);
}

/* ===== 上传区域 ===== */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--color-bg);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--color-primary);
  background: rgba(139, 44, 28, 0.03);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.upload-icon {
  font-size: 28px;
}

.upload-hint {
  font-size: 12px;
  color: var(--color-text-dim);
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.image-preview-item {
  position: relative;
  width: 100%;
  padding-top: 75%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.image-preview-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview {
  margin-top: 12px;
}

.video-preview video {
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.video-preview-remove {
  margin-top: 8px;
  display: inline-block;
}

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-sans);
}

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

.btn-primary:hover {
  background: var(--color-primary-light);
}

.btn-secondary {
  background: var(--color-bg-dark);
  color: var(--color-text);
}

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

.btn-large {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
}

.form-actions {
  margin-top: 28px;
  text-align: center;
}

/* ===== 成功弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.success-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.success-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.success-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 420px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.success-modal.show .success-card {
  transform: scale(1);
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
}

.success-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.success-text {
  font-size: 14px;
  color: var(--color-text-dim);
  line-height: 1.6;
  margin-bottom: 24px;
}

.success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--color-white);
  border-radius: 8px;
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--color-success);
  min-width: 250px;
}

.toast.error {
  border-left-color: var(--color-danger);
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .header-title {
    font-size: 16px;
  }

  .contribute-tabs {
    flex-direction: column;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 20px;
  }
}
