@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/kantumruy-pro-khmer-400-normal.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/kantumruy-pro-khmer-500-normal.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/kantumruy-pro-khmer-700-normal.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('/fonts/kantumruy-pro-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('/fonts/kantumruy-pro-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('/fonts/kantumruy-pro-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122;
}

:root {
  --color-primary: #0f766e;
  --color-primary-dark: #0b5750;
  --color-danger: #b91c1c;
  --color-warn: #b45309;
  --color-bg: #f5f7f7;
  --color-card: #ffffff;
  --color-border: #e2e8e7;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

body.lang-km {
  font-family: 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lang-switch {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 0;
}

.lang-switch button {
  width: auto;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: none;
  border-radius: 999px;
}

.lang-switch button.active {
  background: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.lang-switch-bar {
  background: transparent;
  padding: 10px 16px;
  position: relative;
  z-index: 1;
}

.lang-switch-bar .lang-switch {
  max-width: 480px;
  margin: 0 auto;
}

.cover-image {
  width: 100%;
  aspect-ratio: 820 / 312; /* 和客户端 hero 封面比例一致(Facebook 封面图比例),预览所见即所得 */
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 12px;
  background: var(--color-border);
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.media-gallery-item {
  position: relative;
}

.media-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--color-border);
  cursor: pointer;
  display: block;
}

.media-gallery img:hover {
  border-color: var(--color-primary);
}

.media-gallery img.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.media-gallery-delete {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.media-gallery-delete:hover {
  background: #b91c1c;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-wide {
  max-width: 960px;
}

.narrow-panel {
  max-width: 480px;
  margin: 0 auto;
}

/* 全站统一的固定背景层:铺满整个视口,不随内容滚动,只随屏幕尺寸缩放。
   z-index:-1 让它稳稳沉在所有正常内容(static/auto 层)下面。 */
.theme-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background-color: #050505;
}

.theme-backdrop-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.theme-backdrop-gradient {
  position: absolute;
  inset: 0;
}

/* Sticky-footer 布局:内容短时 footer-bar 仍贴在视口底部,内容长时自然跟随内容往下排 */
#state-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  position: relative;
  flex: 1 0 auto;
}

.footer-bar {
  margin-top: auto;
}

/* hero-inner 永远撑满视口宽度,本身透明,让固定背景层透出来 */
.hero-inner {
  position: relative;
  width: 100%;
}

.hero-inner-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 16px 24px;
}

/* 首页文字+封面图+按钮整体套的半透明毛玻璃面板,保证叠在背景图上时始终可读 */
.content-panel {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 20px;
}

.content-panel h1 {
  margin-top: 0;
}

.content-panel h2,
.content-panel label,
.content-panel p,
.content-panel .customer-info dd {
  color: #fff;
}

.content-panel p.muted,
.content-panel .customer-info dt {
  color: #d7d9dd;
}

.content-panel + .content-panel {
  margin-top: 16px;
}

.hero-meta,
.hero-desc {
  opacity: 0.9;
  color: #fff;
}

.hero-meta {
  margin: 0 0 12px;
}

.hero-meta p {
  margin: 0 0 2px;
}

.hero-desc {
  white-space: pre-line; /* 保留 admin 填写描述时的换行 */
}

/* 会议专属封面图:在 Register/Map 按钮上方,按原图比例自然高度 */
.event-cover-wrap {
  width: 100%;
  margin: 18px 0 4px;
}

.event-cover-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  cursor: zoom-in;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0 8px;
}

.action-square {
  flex: 1;
  aspect-ratio: 1 / 1;
  max-height: 118px;
  border-radius: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.action-square svg {
  width: 30px;
  height: 30px;
}

.footer-bar {
  background: #000;
  padding: 16px 16px;
  text-align: center;
}

.footer-bar p {
  margin: 0 auto;
  font-size: 13px;
  max-width: 480px;
}

.footer-bar p + p {
  margin-top: 6px;
}

.footer-bar span {
  color: #d1d4db;
}

.footer-bar a {
  color: #d4af37;
  font-weight: 700;
  text-decoration: none;
}

.back-btn {
  width: auto;
  padding: 6px 14px;
  margin-bottom: 14px;
  background: #fff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

#map-iframe {
  width: 100%;
  height: 240px;
  border: 0;
  border-radius: 12px;
  display: block;
  margin-bottom: 12px;
}

.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

h1 {
  font-size: 22px;
  margin: 0 0 4px;
}

h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

p {
  margin: 0 0 12px;
}

.muted {
  color: var(--color-text-muted);
  font-size: 14px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 14px;
}

label:first-child {
  margin-top: 0;
}

input[type="text"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
}

textarea {
  resize: vertical;
}

button {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  width: 100%;
}

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

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

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

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

.btn-danger {
  background: #fff;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-small {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.banner {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 14px;
}

.banner-error {
  background: #fef2f2;
  color: var(--color-danger);
  border: 1px solid #fecaca;
}

.banner-warn {
  background: #fffbeb;
  color: var(--color-warn);
  border: 1px solid #fde68a;
}

.banner-success {
  background: #ecfdf5;
  color: var(--color-primary-dark);
  border: 1px solid #a7f3d0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-paid {
  background: #ecfdf5;
  color: var(--color-primary-dark);
}

.badge-pending {
  background: #fffbeb;
  color: var(--color-warn);
}

.badge-other {
  background: #f3f4f6;
  color: var(--color-text-muted);
}

.qr-wrap {
  text-align: center;
  padding: 12px 0;
}

.qr-wrap img,
.qr-wrap canvas {
  width: 220px;
  height: 220px;
  image-rendering: pixelated;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(15, 118, 110, 0.25);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.top-bar .who {
  font-size: 14px;
  color: var(--color-text-muted);
}

.question-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 14px;
}

.question-block {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.question-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.question-block-title {
  font-weight: 700;
  font-size: 14px;
}

.question-remove-btn {
  width: auto;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.question-remove-btn:hover {
  background: rgba(220, 38, 38, 0.6);
}

.question-block .form-grid {
  margin-top: 14px;
}

.question-block .checkbox-row {
  margin-top: 0;
}

.question-block .spacer-label {
  visibility: hidden;
}

.question-row .flex-1 {
  flex: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.checkbox-row input {
  width: auto;
}

#camera-wrap {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}

#camera-wrap video {
  width: 100%;
  display: block;
}

.scan-frame {
  position: absolute;
  inset: 15%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  pointer-events: none;
}

.customer-info dt {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 10px;
}

.customer-info dd {
  margin: 2px 0 0;
  font-size: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tabs button {
  width: auto;
  background: #fff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.tabs button.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ---------- 后台/签到页深色主题(和主页玻璃质感统一) ---------- */

body.dark-admin {
  color: #fff;
}

body.dark-admin h1,
body.dark-admin h2 {
  color: #fff;
}

body.dark-admin .top-bar .who {
  color: #d7d9dd;
}

body.dark-admin .tabs button {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: none;
}

body.dark-admin .tabs button.active {
  background: rgba(255, 255, 255, 0.34);
  border-color: transparent;
}

body.dark-admin .content-panel table {
  color: #fff;
}

body.dark-admin .content-panel th,
body.dark-admin .content-panel td {
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

body.dark-admin .content-panel .muted {
  color: #d7d9dd;
}

body.dark-admin .content-panel a {
  color: #fff;
  text-decoration: underline;
}

/* ---------- 模态弹窗(编辑会议 / 报名名单) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-dialog {
  width: 100%;
  max-width: 720px;
  margin: auto;
}

.modal-dialog.modal-wide {
  max-width: 960px;
}

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

.modal-header h2 {
  margin: 0;
}

.modal-close-btn {
  width: auto;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------- 表单分区 + 两栏布局 ---------- */

.form-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.form-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 12px;
}

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

.form-grid > div {
  min-width: 0;
}

.form-grid > .full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.field-hint {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  margin: 4px 0 0;
}
