/* ============ 婚礼抓拍PK · 主题样式（象牙白+香槟金+勃艮第红） ============ */
:root {
  --ivory: #faf6ef;
  --cream: #f3ead9;
  --gold: #c9a86a;
  --gold-deep: #a8874a;
  --wine: #8e3b46;
  --wine-deep: #6e2a34;
  --ink: #3d3229;
  --ink-soft: #7a6a5c;
  --card: #fffdf8;
  --shadow: 0 6px 24px rgba(110, 80, 40, .12);
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--ivory);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: "Songti SC", "STSong", "SimSun", serif; }

/* 背景暗纹装饰 */
.bg-deco {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(201,168,106,.14), transparent 34%),
    radial-gradient(circle at 88% 92%, rgba(142,59,70,.10), transparent 38%);
}

/* ---- 通用组件 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-size: 16px; font-weight: 600;
  padding: 14px 28px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--wine) 0%, var(--wine-deep) 100%);
  box-shadow: 0 4px 14px rgba(110, 42, 52, .35);
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: scale(.97); }
.btn.gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #fff; box-shadow: 0 4px 14px rgba(168, 135, 74, .35);
}
.btn.ghost {
  background: transparent; color: var(--wine);
  border: 1.5px solid var(--gold); box-shadow: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(201,168,106,.25);
}

.tag {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--cream); color: var(--gold-deep); border: 1px solid rgba(201,168,106,.4);
}
.tag.pass { background: #e8f3e8; color: #3d7a3d; border-color: #b5d6b5; }
.tag.pending { background: #fdf3e0; color: #a8762a; border-color: #ecd3a4; }
.tag.reject { background: #f9e5e7; color: var(--wine); border-color: #e8bfc4; }

input[type=text], input[type=number], select {
  width: 100%; padding: 12px 16px; font-size: 16px;
  border: 1.5px solid rgba(201,168,106,.5); border-radius: 12px;
  background: #fff; color: var(--ink); outline: none;
}
input:focus { border-color: var(--gold); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40, 25, 15, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 24px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--card); border-radius: 20px; padding: 28px 24px;
  max-width: 420px; width: 100%; max-height: 82vh; overflow-y: auto;
  border-top: 4px solid var(--gold); box-shadow: var(--shadow);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { text-align: center; color: var(--wine); margin-bottom: 14px; font-size: 20px; }
.modal .close-btn { margin-top: 18px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 15%; transform: translateX(-50%);
  background: rgba(61, 50, 41, .92); color: #fff; padding: 12px 22px;
  border-radius: 999px; font-size: 14px; z-index: 200; display: none;
  max-width: 80vw; text-align: center;
}

/* loading spinner */
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(201,168,106,.3); border-top-color: var(--gold);
  animation: spin .8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 宾客端 ============ */
.page { max-width: 480px; margin: 0 auto; padding: 20px 16px 250px; position: relative; z-index: 1; }

.hero {
  text-align: center; padding: 30px 10px 22px;
}
.hero .ring {
  width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%;
  border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 40px; background: radial-gradient(circle, #fff 30%, var(--cream));
  box-shadow: 0 0 0 6px rgba(201,168,106,.15);
}
.hero h1 { font-size: 24px; color: var(--wine); letter-spacing: 1px; }
.hero .amp { color: var(--gold); font-size: 20px; margin: 0 8px; }
.hero .sub { color: var(--ink-soft); font-size: 13px; margin-top: 6px; letter-spacing: 2px; }

.countdown-box { text-align: center; padding: 18px 0 8px; }
.countdown-box .label { font-size: 12px; color: var(--ink-soft); letter-spacing: 3px; margin-bottom: 8px; }
.countdown {
  font-variant-numeric: tabular-nums; font-size: 46px; font-weight: 700;
  color: var(--wine); letter-spacing: 2px;
}
.countdown .sep { color: var(--gold); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: .3; } }
.countdown.over { color: var(--ink-soft); }

.lb-title {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 12px;
  color: var(--gold-deep); font-size: 15px; font-weight: 700; letter-spacing: 2px;
}
.lb-title::before, .lb-title::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold));
}
.lb-title::after { background: linear-gradient(90deg, var(--gold), transparent); }

.lb-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  margin-bottom: 10px;
}
.lb-item .rank {
  width: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 39px; color: #fff;
}
.lb-item .rank.num { font-size: 20px; color: var(--wine); }
.lb-item img {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover;
  border: 2px solid var(--cream);
}
.lb-item .info { flex: 1; min-width: 0; }
.lb-item .nick { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-item .score { color: var(--wine); font-weight: 700; font-size: 18px; }
.lb-empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 26px 0; }

/* 底部主按钮 */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--ivory);
  border-top: 1px solid rgba(201,168,106,.35);
  box-shadow: 0 -4px 16px rgba(80,50,20,.08);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.bottom-bar .btn { max-width: 448px; }
.bottom-bar #btn-shoot { width: 100%; font-size: 18px; padding: 14px; }
.bottom-bar .danmaku-bar { margin: 0; width: 100%; }
.mine-row { display: flex; gap: 10px; justify-content: center; width: 100%; max-width: 448px; }
.mine-row .btn { flex: 1; font-size: 14px; padding: 9px 12px; }

/* 拍照页 */
.camera-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #241c14; }
.camera-stage video, .camera-stage img.preview {
  width: 100%; max-height: 62vh; object-fit: contain; display: block;
}
.shutter-row { display: flex; gap: 12px; margin-top: 16px; }
.ai-status {
  margin-top: 16px; text-align: center; color: var(--ink-soft); font-size: 14px;
}
.ai-status .spinner { margin-bottom: 10px; }

/* 我的作品 */
.mine-item { display: flex; gap: 12px; padding: 10px; margin-bottom: 10px; align-items: center; }
.mine-item img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }

/* ============ 大屏 ============ */
.bigscreen {
  height: 100vh; overflow: hidden; position: relative;
  background: #1c1310; color: #f5ecdc;
}
.bigscreen .bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: brightness(.42) saturate(.9);
}
.bigscreen .bg-veil { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 30%, rgba(20,10,5,.75)); }
.bs-inner { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; padding: 3vh 5vw; }
.bs-head { display: flex; justify-content: space-between; align-items: center; }
.bs-title { font-size: 3.2vh; color: #e9cf9a; letter-spacing: 4px; }
.bs-countdown { font-variant-numeric: tabular-nums; font-size: 7.5vh; font-weight: 700; color: #fff; text-align: center; text-shadow: 0 0 24px rgba(233,207,154,.5); margin-bottom: 1.5vh; }
.bs-countdown .sep { color: #c9a86a; }
.bs-board { flex: 1; display: flex; align-items: flex-start; gap: 3vw; min-height: 0; margin-top: 0.5vh; }
.bs-listwrap { flex: 1.2; display: flex; flex-direction: column; min-height: 0; }
.bs-list { flex: 1; min-height: 0; overflow: hidden; }
.bs-item {
  display: flex; align-items: center; gap: 14px; padding: 1.2vh 16px; margin-bottom: 1vh;
  background: rgba(255, 250, 240, .08); border: 1px solid rgba(201,168,106,.35);
  border-radius: 12px; backdrop-filter: blur(2px);
}
.bs-item .rank { display: flex; align-items: center; justify-content: center; height: 7.5vh; font-size: 6.8vh; font-weight: 700; color: #e9cf9a; width: 4vh; }
.bs-item .rank.num { font-size: 3.4vh; }
.bs-item img { width: 7.5vh; height: 7.5vh; border-radius: 8px; object-fit: cover; border: 2px solid rgba(201,168,106,.5); margin-left: 2.5vh; }
.bs-item .nick { font-size: 2.4vh; flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-item .score { font-size: 2.4vh; font-weight: 400; color: inherit; }
.bs-photo { position: relative; flex: 1; height: 62vh; margin-top: 5px; border-radius: 18px; overflow: hidden; border: 3px solid rgba(201,168,106,.5); box-shadow: 0 10px 50px rgba(0,0,0,.5); }
.bs-photo img { width: 100%; height: 100%; object-fit: cover; }
.bs-photo-cap {
  position: absolute; bottom: 2.4vh; left: 50%; transform: translateX(-50%);
  background: rgba(28,15,5,.78); color: #ffd98e;
  font-size: 3.2vh; font-weight: 600; letter-spacing: 1px;
  padding: 1vh 3vh; border-radius: 10vh; white-space: nowrap;
  border: 1px solid rgba(233,207,154,.5); text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
/* 大屏底部：弹幕滚动区 */
.bs-footer { position: relative; height: 28vh; overflow: hidden; }
.bs-footer .dm {
  position: absolute; left: 100%; white-space: nowrap;
  font-size: 2.7vh; font-weight: 400; line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,.85), 0 0 16px rgba(0,0,0,.5);
  will-change: transform;
}
.bs-winner {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2.5vh;
  background: radial-gradient(ellipse at center, rgba(60,30,15,.85), rgba(20,8,2,.95));
  animation: pop .5s ease;
}
.bs-winner img {
  width: 46vh; height: 46vh; max-width: 80vw; object-fit: cover;
  border-radius: 20px; border: 4px solid #e9cf9a; box-shadow: 0 0 80px rgba(233,207,154,.35);
}
.bs-winner .w-title { font-size: 5vh; color: #ffd98e; letter-spacing: 6px; text-shadow: 0 0 30px rgba(255,217,142,.6); }
.bs-winner .w-name { font-size: 3.4vh; color: #fff; }
.bs-winner .w-score { font-size: 6vh; font-weight: 700; color: #ffd98e; }

/* ============ 管理后台 ============ */
.admin-wrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 80px; position: relative; z-index: 1; }
.admin-wrap h2 { color: var(--wine); margin: 26px 0 14px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.ref-box { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.ref-card { text-align: center; }
.ref-card .ph {
  width: 110px; height: 110px; border-radius: 12px; border: 2px dashed var(--gold);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--gold-deep); font-size: 26px; background: #fff; overflow: hidden;
}
.ref-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.ref-card .name { font-size: 13px; margin-top: 6px; color: var(--ink-soft); }
.face-pick-mask .modal { max-width: 520px; }
.face-pick-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.face-pick-grid canvas { border: 2px solid transparent; border-radius: 8px; cursor: pointer; }
.face-pick-grid canvas:hover { border-color: var(--gold); }
.sub-row { display: flex; gap: 12px; padding: 12px; margin-bottom: 12px; align-items: center; }
.sub-row img { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; cursor: pointer; }
.sub-row .info { flex: 1; min-width: 0; }
.sub-row .meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.sub-row .ops { display: flex; flex-direction: column; gap: 6px; }
.sub-row .ops .btn { padding: 6px 14px; font-size: 13px; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: #d8cbb4; cursor: pointer; transition: .2s;
}
.switch .track::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { left: 23px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.stat-card { flex: 1; min-width: 140px; padding: 14px 18px; text-align: center; }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--wine); }
.stat-card .lbl { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* 手机端弹幕输入条 */
.danmaku-bar {
  display: flex; gap: 8px; align-items: center;
  margin: 16px auto 0; max-width: 480px;
}
.danmaku-bar input[type="color"] {
  width: 40px; height: 40px; padding: 0; border: 2px solid var(--gold);
  border-radius: 10px; background: #fff; cursor: pointer; flex-shrink: 0;
}
.danmaku-bar input[type="text"] {
  flex: 1; min-width: 0; padding: 10px 14px; font-size: 14px;
  border: 1.5px solid var(--gold); border-radius: 12px; outline: none;
  background: #fff; color: var(--ink);
}
.danmaku-bar input[type="text"]:focus { border-color: var(--wine); }
.danmaku-bar .btn { font-size: 14px; padding: 9px 18px; flex-shrink: 0; }
