/* ==================== 全局样式 ==================== */
:root {
  --red: #c41e3a;
  --dark-red: #8b0000;
  --gold: #d4a574;
  --light-gold: #f5e6d3;
  --cream: #fdfaf5;
  --dark: #2c1810;
  --text: #4a3728;
  --text-light: #8b7355;
  --white: #ffffff;
  --border: #e0d5c1;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--red); text-decoration: none; }
a:hover { color: var(--dark-red); }

.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

/* ==================== 顶部标语 ==================== */
.top-banner {
  background: linear-gradient(135deg, var(--dark-red), var(--red));
  color: var(--gold);
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  letter-spacing: 2px;
  border-bottom: 3px solid var(--gold);
}

.banner-content {
  max-width: 1200px;
  margin: 0 auto;
}

.banner-text {
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  font-weight: bold;
}

/* ==================== 导航栏 ==================== */
.navbar {
  background: var(--dark);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand {
  color: var(--gold) !important;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 0.75rem 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  color: #ccc !important;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--gold) !important;
  background: rgba(255,255,255,0.1);
}

.nav-btn {
  background: none;
  border: 1px solid #666;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.nav-btn:hover {
  border-color: var(--red);
}

.nav-admin {
  color: #ff9800 !important;
}

/* 语言切换 */
.lang-switcher {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 0.25rem 0;
}

.lang-link {
  color: #999 !important;
  font-size: 0.7rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #555;
  border-radius: 3px;
  transition: 0.2s;
}

.lang-link:hover, .lang-active {
  color: var(--gold) !important;
  border-color: var(--gold);
  background: rgba(212,165,116,0.1);
}

/* ==================== 英雄区 ==================== */
.hero-section {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.hero-title {
  font-size: 2.5rem;
  color: var(--red);
  margin-bottom: 0.5rem;
}

.hero-slogan {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* ==================== 神明卡片网格 ==================== */
.deities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.deity-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.deity-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: var(--gold);
}

.deity-card-img {
  height: 200px;
  overflow: hidden;
  background: var(--light-gold);
}

.deity-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.3s;
}

.deity-card:hover .deity-card-img img {
  transform: scale(1.05);
}

.deity-card-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.deity-card-info h3 {
  color: var(--red);
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.deity-card-title {
  color: var(--gold);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.deity-card-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  flex: 1;
  margin-bottom: 0.75rem;
}

.deity-card-btn {
  display: inline-block;
  color: var(--red);
  font-weight: bold;
  font-size: 0.9rem;
}

/* ==================== 神明详情页 ==================== */
.deity-detail {
  padding: 1rem 0;
}

.deity-header {
  display: flex;
  gap: 2rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.deity-header-img {
  width: 250px;
  height: 250px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--light-gold);
}

.deity-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deity-header-info h1 {
  color: var(--red);
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.deity-title-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.deity-desc {
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.deity-stats {
  display: flex;
  gap: 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.deity-stats strong {
  color: var(--red);
}

/* ==================== 许愿表单 ==================== */
.wish-form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.wish-form-section h2 {
  color: var(--red);
  margin-bottom: 1rem;
}

.wish-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.wish-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.2);
}

.wish-options {
  display: flex;
  gap: 1.5rem;
  margin: 1rem 0;
}

.radio-label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: 0.2s;
}

.radio-label:hover {
  border-color: var(--gold);
  background: var(--light-gold);
}

/* ==================== 登录提示 ==================== */
.login-prompt {
  text-align: center;
  padding: 2rem;
}

.login-prompt p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.login-prompt .btn {
  margin: 0 0.5rem;
}

/* ==================== 按钮 ==================== */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: 0.2s;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--dark-red));
  color: var(--white) !important;
  box-shadow: 0 2px 8px rgba(196,30,58,0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196,30,58,0.4);
}

.btn-outline {
  border: 1px solid var(--red);
  color: var(--red) !important;
  background: transparent;
}

.btn-outline:hover {
  background: var(--red);
  color: var(--white) !important;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-danger {
  background: #e74c3c;
  color: var(--white) !important;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-fulfill {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: var(--white) !important;
}

.btn-fulfill:hover {
  background: #e67e22;
}

/* ==================== 愿望列表 ==================== */
.wish-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wish-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: 0.2s;
}

.wish-item:hover {
  border-color: var(--gold);
}

.wish-text {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.wish-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-light);
}

.wish-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.btn-like, .btn-comment-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
  font-family: inherit;
  color: var(--text-light);
}

.btn-like:hover, .btn-like.liked {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fef0f0;
}

.btn-comment-toggle:hover {
  border-color: var(--gold);
}

/* ==================== 徽章 ==================== */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
}

.badge-fulfilled {
  background: #d4edda;
  color: #155724;
}

.badge-public {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-private {
  background: #fce4ec;
  color: #c62828;
}

/* ==================== 评论区域 ==================== */
.comments-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.comments-list {
  margin-bottom: 0.75rem;
}

.comment-item {
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
  font-size: 0.9rem;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-user {
  color: var(--red);
  font-weight: bold;
}

.comment-time {
  color: #bbb;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.comment-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.comment-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: inherit;
}

.comment-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.comment-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  text-align: center;
  padding: 0.5rem;
}

/* ==================== 认证页 ==================== */
.auth-page {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  text-align: center;
  color: var(--red);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: bold;
  color: var(--text);
  font-size: 0.9rem;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.auth-switch {
  text-align: center;
  margin-top: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==================== 提醒 ==================== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #a5d6a7;
}

/* ==================== 愿望广场 ==================== */
.wish-square h1, .profile-page h1, .redeem-page h1 {
  color: var(--red);
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ==================== 个人中心 ==================== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.stat-num {
  font-size: 2rem;
  font-weight: bold;
  color: var(--red);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
}

.profile-email {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.likes-display {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==================== 还愿页 ==================== */
.redeem-desc {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.redeem-note {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.payment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.payment-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.payment-card h3 {
  color: var(--red);
  margin-bottom: 1rem;
}

.qr-image {
  width: 180px;
  height: 180px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--light-gold);
}

.qr-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-info p {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.payment-instructions {
  color: var(--text-light);
  font-style: italic;
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.page-info {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* ==================== 返回按钮 ==================== */
.back-home {
  text-align: center;
  margin-top: 2rem;
}

/* ==================== 404页 ==================== */
.error-page {
  text-align: center;
  padding: 3rem 1rem;
}

.error-page h1 {
  font-size: 5rem;
  color: var(--red);
}

.error-page p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* ==================== 底部 ==================== */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--dark);
  color: var(--text-light);
  margin-top: 2rem;
  border-top: 2px solid var(--gold);
}

.site-footer p {
  margin-bottom: 0.5rem;
}

.footer-langs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-lang-link {
  color: var(--gold) !important;
  font-size: 0.8rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .deity-header {
    flex-direction: column;
  }

  .deity-header-img {
    width: 100%;
    height: 200px;
  }

  .nav-inner {
    flex-wrap: wrap;
  }

  .lang-switcher {
    margin-left: 0;
    order: 10;
    width: 100%;
    justify-content: center;
  }

  .deities-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .deity-card-img {
    height: 140px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .wish-options {
    flex-direction: column;
  }

  .payment-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .deities-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .deity-card-img {
    height: 120px;
  }

  .deity-card-info h3 {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .nav-links {
    gap: 0;
  }

  .nav-link {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}
