/* ============ 活动扫码登记系统 - 共享样式 ============ */
:root {
  --accent: #5b6cff;
  --accent-dark: #4656e8;
  --ink: #1a1d2e;
  --ink-soft: #5b6079;
  --line: #e8eaf2;
  --bg: #f5f6fb;
  --card: #ffffff;
  --ok: #16a34a;
  --danger: #e11d48;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(30, 35, 90, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 13px 22px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px rgba(91,108,255,.32); }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); box-shadow: 0 14px 28px rgba(91,108,255,.42); }
.btn-ghost { background: #f0f1f8; color: var(--ink); }
.btn-ghost:hover { background: #e7e9f4; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn-danger { background: #fef2f4; color: var(--danger); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.field label .req { color: var(--danger); margin-left: 3px; }
.input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fbfbfe; color: var(--ink);
  font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(91,108,255,.12); }
.input::placeholder { color: #a9adc2; }
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-opt { display: inline-flex !important; align-items: center; gap: 8px; padding: 12px 20px; border: 1.5px solid var(--line); border-radius: 12px; background: #fbfbfe; cursor: pointer; font-size: 15px; color: var(--ink); margin-bottom: 0 !important; transition: border-color .2s, background .2s; }
.radio-opt:has(input:checked) { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(91,108,255,.12); }
.radio-opt input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; top: 26px; transform: translate(-50%, -20px);
  background: #1f2338; color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: all .28s ease; z-index: 9999; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #15803d; }
.toast.err { background: #be123c; }

/* ============ 海报页 ============ */
.poster-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 15% 10%, #3a3f8f 0%, transparent 55%),
              radial-gradient(900px 700px at 85% 90%, #6b3fa0 0%, transparent 55%),
              linear-gradient(135deg, #1b1e4a 0%, #2a2160 50%, #171a3c 100%);
}
.poster-stage::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px; mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.glow.a { width: 320px; height: 320px; background: #6d5bff; top: -80px; right: 8%; }
.glow.b { width: 260px; height: 260px; background: #ff5ba7; bottom: -70px; left: 6%; opacity: .32; }

.poster {
  position: relative; z-index: 1; width: min(960px, 100%);
  background: rgba(255,255,255,.06); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.16); border-radius: 30px;
  box-shadow: 0 40px 100px rgba(0,0,0,.42); overflow: hidden;
  display: grid; grid-template-columns: 1.35fr .85fr;
}
.poster-left { padding: 56px 50px 50px; color: #fff; position: relative; }
.poster-left::after {
  content: ''; position: absolute; right: -60px; top: 40px; width: 220px; height: 220px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 50%;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; letter-spacing: .5px; opacity: .92; }
.brand .dot { width: 10px; height: 10px; border-radius: 3px; background: #7d8bff; box-shadow: 0 0 0 5px rgba(125,139,255,.22); }
.kicker {
  display: inline-block; margin-top: 44px; padding: 7px 15px; border-radius: 30px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.2);
  font-size: 12px; letter-spacing: 2px; color: #cfd4ff;
}
.poster-title {
  margin: 20px 0 0; font-size: clamp(38px, 5.2vw, 62px); line-height: 1.14;
  font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(180deg, #fff 30%, #c9ceff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.poster-sub { margin: 18px 0 0; font-size: 19px; color: #d8dbf5; letter-spacing: 3px; font-weight: 300; }
.divider { width: 54px; height: 3px; border-radius: 3px; background: #7d8bff; margin: 34px 0 30px; }
.info-list { display: grid; gap: 18px; }
.info-item { display: flex; align-items: flex-start; gap: 14px; }
.info-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
  background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center;
}
.info-ico svg { width: 19px; height: 19px; stroke: #cfd4ff; }
.info-txt b { display: block; font-size: 11px; letter-spacing: 1.5px; color: #9ba2d8; font-weight: 600; margin-bottom: 4px; }
.info-txt span { font-size: 16px; color: #f2f3ff; font-weight: 500; }
.poster-foot { margin-top: 42px; font-size: 12px; color: #8e96cf; letter-spacing: 1px; }

.poster-right {
  background: #fff; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 44px 36px; text-align: center; position: relative;
}
.poster-right::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, #5b6cff, #9b5bff, #ff5ba7);
}
.qr-title { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.qr-desc { font-size: 13px; color: var(--ink-soft); margin: 0 0 26px; line-height: 1.7; }
.qr-box {
  position: relative; padding: 16px; background: #fff; border-radius: 20px;
  border: 1px solid var(--line); box-shadow: 0 12px 35px rgba(40,45,100,.13);
}
#posterQr { width: 190px; height: 190px; display: flex; align-items: center; justify-content: center; }
#posterQr img, #posterQr canvas { width: 190px !important; height: 190px !important; }
.qr-corner { position: absolute; width: 20px; height: 20px; border-color: var(--accent); border-style: solid; }
.qr-corner.tl { top: 6px; left: 6px; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.qr-corner.tr { top: 6px; right: 6px; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.qr-corner.bl { bottom: 6px; left: 6px; border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.qr-corner.br { bottom: 6px; right: 6px; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }
.qr-hint { margin-top: 22px; font-size: 12px; color: #9298b0; display: flex; align-items: center; gap: 6px; justify-content: center; }
.qr-hint svg { width: 15px; height: 15px; stroke: #9298b0; }

@media (max-width: 780px) {
  .poster { grid-template-columns: 1fr; margin: 0 auto; }
  .poster-left { padding: 38px 30px 34px; }
  .poster-right { padding: 36px 24px; }
  .kicker { margin-top: 30px; }
}

/* ============ 登记页 ============ */
.form-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 18px; position: relative; overflow: hidden;
  background: radial-gradient(800px 500px at 10% 0%, #e3e7ff 0%, transparent 60%),
              radial-gradient(700px 500px at 95% 100%, #f3e6ff 0%, transparent 60%), #f7f8fd;
}
.form-card {
  width: min(480px, 100%); background: #fff; border-radius: 24px;
  box-shadow: var(--shadow); padding: 38px 34px 34px; position: relative; z-index: 1;
}
.form-head { text-align: center; margin-bottom: 30px; }
.form-logo {
  width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), #9b5bff);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(91,108,255,.3);
}
.form-logo svg { width: 26px; height: 26px; stroke: #fff; }
.form-head h1 { font-size: 24px; margin: 0 0 8px; font-weight: 800; }
.form-head p { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.form-event {
  background: linear-gradient(135deg, rgba(91,108,255,.08), rgba(155,91,255,.06));
  border: 1px solid rgba(91,108,255,.16); border-radius: 13px;
  padding: 13px 16px; margin-bottom: 26px; font-size: 13px; color: #4b5080; line-height: 1.7;
}
.form-event b { color: var(--accent-dark); }
.submit-btn { width: 100%; margin-top: 8px; padding: 15px; font-size: 16px; }
.form-note { text-align: center; font-size: 11px; color: #a3a8bd; margin-top: 18px; line-height: 1.6; }
.success-view { text-align: center; padding: 24px 0 8px; }
.success-ico {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 22px;
  background: #e8f8ee; display: flex; align-items: center; justify-content: center;
}
.success-ico svg { width: 38px; height: 38px; stroke: var(--ok); stroke-width: 2.5; }
.success-view h2 { font-size: 23px; margin: 0 0 10px; }
.success-view p { color: var(--ink-soft); font-size: 14px; line-height: 1.7; margin: 0 0 26px; }

/* ============ 后台 ============ */
.admin-app { min-height: 100vh; display: flex; background: #f4f5fa; }
.sidebar {
  width: 230px; flex: 0 0 230px; background: #191c33; color: #fff;
  display: flex; flex-direction: column; padding: 28px 18px; position: sticky; top: 0; height: 100vh;
}
.side-logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; padding: 0 10px 28px; }
.side-logo .mark {
  width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6d7bff, #a15bff); font-size: 16px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px;
  font-size: 14px; color: #b9bdd8; cursor: pointer; margin-bottom: 5px; transition: all .18s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, #5b6cff, #815bff); color: #fff; box-shadow: 0 8px 18px rgba(91,108,255,.3); }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; }
.side-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255,255,255,.09); }
.side-foot button { background: none; border: 0; color: #aeb3d0; font-size: 13px; cursor: pointer; padding: 8px 0; }
.side-foot button:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; padding: 32px 36px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 28px; }
.admin-top h1 { font-size: 26px; margin: 0 0 6px; font-weight: 800; }
.admin-top p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 4px 18px rgba(30,35,90,.05);
  border: 1px solid var(--line);
}
.stat-card .label { font-size: 12px; color: var(--ink-soft); margin-bottom: 10px; font-weight: 600; }
.stat-card .value { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1; }
.stat-card .value.accent { color: var(--accent); }
.stat-card .sub { font-size: 11px; color: #a3a8bd; margin-top: 8px; }

.panel { background: #fff; border-radius: 16px; box-shadow: 0 4px 18px rgba(30,35,90,.05); border: 1px solid var(--line); overflow: hidden; }
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.panel-head h2 { font-size: 16px; margin: 0; font-weight: 700; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fbfbfe; }
.search-box svg { width: 16px; height: 16px; stroke: #9ba0b8; }
.search-box input { border: 0; outline: none; background: none; font-size: 13px; width: 190px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
th { text-align: left; padding: 13px 20px; background: #fafbfe; color: var(--ink-soft); font-weight: 600; font-size: 12px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid #f0f1f6; color: #333a52; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbff; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 20px; background: #eef0ff; color: var(--accent-dark); font-size: 11px; font-weight: 600; }
.row-del { border: 0; background: none; color: #c2c6d6; cursor: pointer; font-size: 16px; padding: 4px 8px; }
.row-del:hover { color: var(--danger); }
.empty { text-align: center; padding: 70px 20px; color: #a3a8bd; }
.empty svg { width: 46px; height: 46px; stroke: #c9cde0; margin-bottom: 14px; }
.empty p { margin: 0; font-size: 14px; }

/* 配置表单 */
.config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; padding: 24px; }
.config-actions { padding: 0 24px 24px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f1f6; }

/* 登录页 */
.login-stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(800px 500px at 20% 0%, #e3e7ff 0%, transparent 60%), #f7f8fd;
}
.login-card { width: min(400px, 100%); background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 40px 36px; }
.login-card .form-logo { margin-bottom: 20px; }
.login-card h1 { font-size: 22px; margin: 0 0 8px; text-align: center; }
.login-card .tip { text-align: center; color: var(--ink-soft); font-size: 13px; margin: 0 0 28px; }
.hidden { display: none !important; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 活动卡片 ============ */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.act-card {
  background: #fff; border-radius: 16px; border: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(30,35,90,.05); overflow: hidden; transition: transform .18s, box-shadow .18s;
}
.act-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(30,35,90,.12); }
.act-card-top { border-top: 4px solid var(--accent); padding: 20px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.act-card-name { font-size: 17px; font-weight: 800; line-height: 1.4; }
.status-tag { font-size: 11px; font-weight: 600; white-space: nowrap; padding: 4px 9px; border-radius: 20px; }
.status-tag.on { background: #e8f8ee; color: var(--ok); }
.status-tag.off { background: #f1f2f6; color: #9ba0b8; }
.act-card-sub { padding: 6px 20px 0; font-size: 12px; color: var(--ink-soft); }
.act-card-meta { padding: 14px 20px 0; font-size: 12px; color: var(--ink-soft); line-height: 1.9; min-height: 30px; }
.act-card-count { padding: 16px 20px; font-size: 13px; color: var(--ink-soft); }
.act-card-count b { font-size: 20px; color: var(--accent); }
.act-card-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 20px; }
.act-card-actions button {
  border: 1px solid var(--line); background: #fafbfe; color: #4b5080; cursor: pointer;
  font-size: 12px; padding: 6px 11px; border-radius: 8px; transition: all .15s;
}
.act-card-actions button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.act-card-actions button.danger:hover { background: var(--danger); border-color: var(--danger); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,22,45,.55); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal { background: #fff; border-radius: 20px; width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-head { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { border: 0; background: none; font-size: 26px; color: #9ba0b8; cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 24px 26px; overflow-y: auto; }
.modal-foot { padding: 18px 26px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.fields-editor { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fields-editor-head { padding: 12px 16px; background: #fafbfe; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--line); }
.fields-editor-head span { font-weight: 400; color: var(--ink-soft); font-size: 11px; }
.field-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f0f1f6; }
.field-row:last-child { border-bottom: 0; }
.field-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.field-row .input { padding: 8px 10px; font-size: 13px; }
.field-row #fe_req_0, .field-row select { width: 80px; }
.field-key { font-size: 11px; color: #b0b5c8; min-width: 52px; }

/* ============ 飞书同步 ============ */
.notice-box { background: #fff9e8; border: 1px solid #f5e2a8; color: #8a6d1f; padding: 14px 18px; border-radius: 12px; font-size: 13px; line-height: 1.7; margin-bottom: 20px; }
.notice-box a { color: var(--accent-dark); font-weight: 600; }
.switch-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.switch-line input { width: 16px; height: 16px; cursor: pointer; }
.col-tag { display: inline-block; background: #eef0ff; color: var(--accent-dark); padding: 3px 10px; border-radius: 6px; font-size: 12px; margin: 0 4px 4px 0; }
.test-ok { background: #e8f8ee; color: #15803d; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.test-err { background: #fef2f4; color: var(--danger); padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
