/* 文件路径: frontend/css/app.css
   天天拍club 活动报名网站 — 主样式表（手机优先、深色主题）。
   与 app-additions.css 配合使用：本文件负责全局与全部基础模块，
   app-additions.css 在其后加载，只补新增模块（首页数字、关于、三步流程、
   筛选栏、页脚、凭证列表、群码上传提示）。
   设计语言：底色近黑、卡片 #111114、边框 #232329、主黄 #ffd000、 muted #9ca3af。 */

/* ================= 基础 ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #0a0a0c;
  color: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 10px;
  line-height: 1.4;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

h4 {
  font-size: 15px;
}

p {
  margin: 0 0 10px;
}

a {
  color: #ffd000;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code {
  background: #1f1f24;
  border: 1px solid #2e2e35;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 13px;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.view {
  padding: 20px 0 8px;
}

.sub-hint {
  color: #9ca3af;
  font-size: 13px;
  margin: 6px 0 0;
}

/* ================= 页头 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(10, 10, 12, 0.96);
  border-bottom: 1px solid #232329;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-mark {
  background: #ffd000;
  color: #111;
  font-weight: 800;
  font-size: 14px;
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 1px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-slogan {
  color: #9ca3af;
  font-size: 13px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav-link {
  color: #d4d4d8;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-link:hover {
  background: #1f1f24;
  color: #fff;
}

.nav-link.active {
  background: #ffd000;
  color: #111;
  font-weight: 700;
}

.sync-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 8px;
  font-size: 13px;
  color: #9ca3af;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex: none;
}

.sync-dot.error {
  background: #f87171;
}

.sync-text {
  flex: 1;
  min-width: 0;
}

/* ================= 首页 Hero ================= */
.hero {
  padding: 28px 0 8px;
}

.hero h1 {
  font-size: 30px;
  margin-bottom: 4px;
}

.hero-slogan {
  font-size: 18px;
  color: #ffd000;
  font-weight: 700;
  margin: 0 0 8px;
}

.hero-sub {
  color: #9ca3af;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  background: #26262b;
  color: #e5e7eb;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #ffd000;
  color: #111;
  font-weight: 700;
}

.btn-outline {
  background: transparent;
  border-color: #3f3f46;
  color: #e5e7eb;
}

.btn-danger {
  background: #7f1d1d;
  border-color: #991b1b;
  color: #fecaca;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

/* ================= 卡片与区块头 ================= */
.card {
  background: #111114;
  border: 1px solid #232329;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.card h2,
.card h3 {
  margin-bottom: 8px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}

.section-header h2,
.section-header h3 {
  margin: 0;
}

/* ================= 活动卡片 ================= */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.activity-card {
  background: #111114;
  border: 1px solid #232329;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.activity-cover-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #1a1a1e;
  overflow: hidden;
}

.activity-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffd000;
  border: 1px solid rgba(255, 208, 0, 0.5);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

.activity-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  flex: 1;
}

.activity-title {
  font-size: 17px;
  margin: 0;
}

.activity-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: #9ca3af;
}

.quota-box {
  display: flex;
  gap: 8px;
}

.quota-item {
  flex: 1;
  background: #1a1a1e;
  border: 1px solid #232329;
  border-radius: 10px;
  padding: 8px 6px;
  text-align: center;
}

.quota-item span {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}

.quota-item strong {
  font-size: 15px;
  color: #ffd000;
}

.activity-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.activity-footer .btn {
  flex: 1;
}

/* ================= 回顾照片与 FAQ ================= */
.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.photo-card {
  background: #111114;
  border: 1px solid #232329;
  border-radius: 12px;
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-caption {
  padding: 10px 12px;
  font-size: 13px;
}

.photo-caption strong {
  display: block;
  margin-bottom: 2px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: #111114;
  border: 1px solid #232329;
  border-radius: 12px;
  padding: 14px 16px;
}

.faq-item h4 {
  margin-bottom: 4px;
}

.faq-item p {
  margin: 0;
  color: #9ca3af;
  font-size: 14px;
}

/* ================= 表单 ================= */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.form-stack input[type='text'],
.form-stack input[type='password'],
.form-stack input[type='number'],
.form-stack input[type='tel'],
.form-stack input[type='url'],
.form-stack input[type='datetime-local'],
.form-stack select,
.form-stack textarea {
  width: 100%;
  background: #0f0f12;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  color: #e5e7eb;
  font-size: 15px;
  padding: 10px 12px;
  outline: none;
}

.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
  border-color: #ffd000;
}

.form-stack textarea {
  resize: vertical;
}

.form-stack input[readonly] {
  color: #9ca3af;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.form-actions .btn {
  flex: 0 1 auto;
}

.checkbox-row {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px !important;
  font-weight: 400 !important;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  accent-color: #ffd000;
}

.consent-box {
  background: #0f0f12;
  border: 1px solid #2e2e35;
  border-radius: 12px;
  padding: 14px;
}

.consent-text {
  font-size: 13px;
  color: #9ca3af;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

/* ================= 弹窗 ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
}

.modal-card {
  background: #17171b;
  border: 1px solid #2e2e35;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  padding: 20px;
  margin: auto 0;
}

.modal-card-wide {
  max-width: 760px;
}

.modal-card h3 {
  margin-bottom: 12px;
}

/* ================= 二维码 ================= */
.qr-box {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  justify-content: center;
  margin: 12px 0;
}

.qr-box img {
  width: 100%;
  max-width: 280px;
}

.qr-image-300 {
  max-width: 300px;
}

.group-qr-section h4 {
  margin-bottom: 4px;
}

/* ================= 报名结果与状态 ================= */
.result-status-banner {
  background: #0f0f12;
  border: 1px solid #2e2e35;
  border-radius: 12px;
  padding: 12px 14px;
}

.status-pill {
  display: inline-block;
  background: #ffd000;
  color: #111;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  padding: 3px 12px;
}

.credential-box {
  background: #0f0f12;
  border: 1px dashed #3f3f46;
  border-radius: 12px;
  padding: 14px;
}

.credential-box p {
  margin-bottom: 6px;
}

/* ================= 筛选 chips ================= */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: transparent;
  border: 1px solid #3f3f46;
  color: #d4d4d8;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.chip.active {
  background: #ffd000;
  border-color: #ffd000;
  color: #111;
  font-weight: 700;
}

/* ================= 管理后台 ================= */
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #232329;
  vertical-align: top;
}

.admin-table th {
  color: #9ca3af;
  font-weight: 600;
  white-space: nowrap;
}

.admin-table td .btn {
  margin: 2px 4px 2px 0;
}

/* ================= Toast ================= */
.toast-container {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 480px;
  pointer-events: none;
}

.toast {
  background: #1f1f24;
  border: 1px solid #ffd000;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ================= 页脚 ================= */
.site-footer {
  background: #0f0f12;
  padding-bottom: 24px;
}

/* ================= 小屏适配 ================= */
@media (max-width: 640px) {
  .hero {
    padding-top: 20px;
  }

  .hero h1 {
    font-size: 26px;
  }

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

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

  .modal {
    padding: 12px 8px;
  }

  .modal-card {
    padding: 16px;
  }

  .form-actions .btn {
    flex: 1 1 100%;
  }

  .quota-box {
    gap: 6px;
  }
}
