/* ===== 全局重置 ===== */
* {
  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-danger: #dc3545;
  --color-success: #28a745;
  --color-success: #28a745;
  --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;
}

/* ===== 登录页面 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a1a10 0%, #4a2a18 50%, #8B2C1C 100%);
}

.login-card {
  background: var(--color-white);
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 48px;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.login-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 900;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--color-text-dim);
  margin-bottom: 28px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s ease;
  margin-bottom: 8px;
}

.login-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.login-error {
  color: var(--color-danger);
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

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

.login-back {
  display: inline-block;
  margin-top: 20px;
  color: var(--color-text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s ease;
}

.login-back:hover {
  color: var(--color-primary);
}

.login-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

/* ===== 管理面板布局 ===== */
.admin-page {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 220px;
  background: #2a1a10;
  color: #e8e0d0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(201, 162, 75, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-link {
  display: block;
  padding: 12px 24px;
  color: #b0a898;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--color-gold);
  background: rgba(201, 162, 75, 0.1);
}

.sidebar-link.active {
  color: var(--color-gold);
  background: rgba(201, 162, 75, 0.15);
  border-left-color: var(--color-gold);
}

.sidebar-footer {
  padding: 16px 0;
  border-top: 1px solid rgba(201, 162, 75, 0.2);
}

.sidebar-lang-row {
  padding: 0 20px 12px;
  display: flex;
  justify-content: center;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 28px 32px;
}

/* ===== 视图切换 ===== */
.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
}

.view-filter {
  display: flex;
  gap: 12px;
}

/* ===== 地点网格 ===== */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.location-card {
  background: var(--color-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--color-border);
}

.location-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-gold);
}

.location-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.location-card-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
}

.location-card-badge {
  background: rgba(139, 44, 28, 0.1);
  color: var(--color-primary);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.location-card-desc {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
  min-height: 40px;
}

.location-card-coords {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-bottom: 12px;
  font-family: monospace;
}

.location-card-actions {
  display: flex;
  gap: 8px;
}

/* ===== 按钮 ===== */
.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-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  opacity: 0.85;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ===== 非遗项目列表 ===== */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  background: var(--color-card);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-gold);
}

.item-card-info {
  flex: 1;
}

.item-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.item-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}

.item-card-meta .tag {
  background: rgba(201, 162, 75, 0.15);
  color: #8a6d20;
  padding: 1px 8px;
  border-radius: 10px;
}

.item-card-desc {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.5;
}

.item-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 16px;
}

/* ===== 表单 ===== */
.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;
}

/* ===== 弹窗 ===== */
.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;
}

.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;
}

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

.modal-content {
  background: var(--color-white);
  border-radius: 14px;
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

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

.modal-large {
  width: 720px;
}

.modal-small {
  width: 400px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-dim);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--color-bg-dark);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-text {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.6;
}

/* ===== 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);
}

.toast.info {
  border-left-color: var(--color-gold);
}

@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;
  }
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-dim);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* ===== 待审核区域 ===== */
.badge {
  display: inline-block;
  background: var(--color-danger);
  color: white;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

.pending-section {
  margin-bottom: 32px;
}

.pending-section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

.pending-card {
  background: var(--color-card);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-gold);
  transition: all 0.3s ease;
}

.pending-card:hover {
  box-shadow: var(--shadow-md);
}

.pending-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.pending-card-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.pending-card-meta {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-bottom: 8px;
}

.pending-card-desc {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.5;
  margin-bottom: 12px;
}

.pending-card-actions {
  display: flex;
  gap: 8px;
}

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

.btn-success:hover {
  opacity: 0.85;
}

/* ===== 审核详情弹窗 ===== */
.review-detail {
  font-size: 14px;
  line-height: 1.7;
}

.review-detail-row {
  display: flex;
  margin-bottom: 12px;
  gap: 8px;
}

.review-detail-label {
  font-weight: 600;
  color: var(--color-text-dim);
  min-width: 80px;
  flex-shrink: 0;
}

.review-detail-value {
  color: var(--color-text);
  flex: 1;
}

.review-detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.review-detail-images img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--color-border);
}

.review-detail-video {
  width: 100%;
  max-height: 240px;
  border-radius: 6px;
  margin: 8px 0 12px;
}

.review-detail-text {
  background: var(--color-bg);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--color-gold);
  white-space: pre-wrap;
  margin-top: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-title,
  .sidebar-link span {
    display: none;
  }

  .main-content {
    margin-left: 60px;
    padding: 16px;
  }

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

  .location-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== 语言切换按钮 ===== */
.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);
}

/* ===== 管理员账号表格 ===== */
.admin-table-wrap {
  background: var(--color-card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead th {
  padding: 14px 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-dim);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table-username {
  font-weight: 600;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-current-tag {
  background: rgba(40, 167, 69, 0.12);
  color: var(--color-success);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
}

.admin-table-actions {
  display: flex;
  gap: 8px;
}
