:root {
  --ink: #1b2a41;
  --ink-soft: #3d4f68;
  --muted: #7b8798;
  --line: #e3ded4;
  --bg: #f7f5f1;
  --card: #ffffff;
  --gold: #b08d57;
  --gold-soft: #f3ece0;
  --ok: #2f7d5d;
  --ok-soft: #e8f2ed;
  --warn: #b4761f;
  --warn-soft: #fbf1e0;
  --danger: #a8412f;
  --danger-soft: #f9e9e5;
  --info: #35597e;
  --info-soft: #e9f0f7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 42, 65, .05), 0 8px 24px rgba(27, 42, 65, .06);
}

* { box-sizing: border-box; }

/* 作者样式里的 display 会盖掉 [hidden] 的 UA 规则，必须显式加一条 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .01em; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px;
  background: radial-gradient(circle at 20% 10%, #fff 0, var(--bg) 45%, #efeae0 100%);
}
.login-card {
  width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 34px 32px 28px; box-shadow: var(--shadow);
}
.login-card .mark { font-size: 12px; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.login-card h1 { font-size: 21px; margin: 8px 0 4px; }
.login-card p.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 58px; padding: 0 22px;
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #f4f1ea;
}
.topbar .brand { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.topbar .brand small { display: block; font-size: 10.5px; letter-spacing: .16em; color: #b9c2cf; font-weight: 400; }
.topbar .spacer { flex: 1; }
.topbar .pill {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: #dfe5ee;
}
.topbar .link { color: #dfe5ee; font-size: 12.5px; }
.topbar .link:hover { color: #fff; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - 58px); }

.sidebar {
  width: 268px; flex: 0 0 268px; padding: 18px 14px 40px;
  border-right: 1px solid var(--line); min-height: calc(100vh - 58px);
  background: #fbf9f5;
}
.sidebar .side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.sidebar .side-head span { font-size: 11.5px; letter-spacing: .16em; color: var(--muted); }
.evt-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 11px; margin-bottom: 4px; font: inherit; color: var(--ink);
}
.evt-item:hover { background: #fff; border-color: var(--line); }
.evt-item.active { background: #fff; border-color: var(--gold); box-shadow: var(--shadow); }
.evt-item .t { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: block; }
.evt-item .m { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11.5px; margin-top: 5px; }

.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.main-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.main-head h1 { font-size: 20px; line-height: 1.4; }
.main-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.main-head .spacer { flex: 1; }

.tabs { display: flex; gap: 2px; margin: 18px 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  border: 0; background: transparent; font: inherit; cursor: pointer; color: var(--muted);
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: 600; }

/* ---------------- 卡片 / 表单 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > h3 { font-size: 14px; margin-bottom: 4px; }
.card > .desc { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }

.grid { display: grid; gap: 14px 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--ink-soft); font-weight: 600; letter-spacing: .02em; }
.field .tip { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.field.wide { grid-column: 1 / -1; }

input[type=text], input[type=password], input[type=date], input[type=datetime-local],
input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  background: #fdfcfa; border: 1px solid var(--line); border-radius: 8px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: #fff; box-shadow: 0 0 0 3px var(--gold-soft); }
textarea { min-height: 74px; resize: vertical; line-height: 1.6; }
input[disabled] { background: #f2efe9; color: var(--muted); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.check input { width: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: 13px; padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap;
}
.btn:hover { border-color: #c9c2b4; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #24374f; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #a17f4b; }
.btn-danger { background: #fff; border-color: #e6c9c1; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.7; white-space: nowrap; background: #eef0f3; color: var(--ink-soft);
}
.badge.draft { background: #eef0f3; color: #5b6879; }
.badge.open, .badge.confirmed { background: var(--ok-soft); color: var(--ok); }
.badge.closed, .badge.pending, .badge.dry_run { background: var(--warn-soft); color: var(--warn); }
.badge.finished, .badge.checked_in { background: var(--info-soft); color: var(--info); }
.badge.archived, .badge.void, .badge.failed { background: #eef0f3; color: #7b8798; }
.badge.dead { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12.8px; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid #f0ece4; vertical-align: middle; }
th { background: #faf8f4; color: var(--ink-soft); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fdfcfa; }
td.num { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
td .name { font-weight: 600; }
td .sub { color: var(--muted); font-size: 11.5px; }
.actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------------- 统计 ---------------- */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }
.stat .v { font-size: 25px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 46px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .lab { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 9px; background: #f1ede5; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #c9a877); border-radius: 999px; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- 其他 ---------------- */
.empty { padding: 34px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.notice {
  border-left: 3px solid var(--gold); background: var(--gold-soft); color: #6f5730;
  padding: 9px 12px; border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.65;
}
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .22s ease; z-index: 90;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

.modal-mask {
  position: fixed; inset: 0; background: rgba(27, 42, 65, .38); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  width: 560px; max-width: 100%; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .2);
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .sidebar { width: 210px; flex-basis: 210px; }
  .main { padding: 18px 16px 50px; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex-basis: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .evt-item .t { font-size: 13px; }
}

/* ---------------- 公开报名页 ---------------- */
.pub-body { background: #f4f1ea; }
.pub-head { background: var(--ink); color: #f4f1ea; padding: 34px 22px 40px; }
.pub-inner { max-width: 760px; margin: 0 auto; }
.pub-head .kicker { font-size: 11.5px; letter-spacing: .2em; color: #c3ab86; }
.pub-head h1 { font-size: 26px; line-height: 1.4; margin: 10px 0 14px; font-weight: 600; }
.pub-head .facts { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; color: #d7dde6; }
.pub-head .facts b { color: #fff; font-weight: 500; }
.pub-main { max-width: 760px; margin: -22px auto 60px; padding: 0 18px; }
.pub-card { background: #fff; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 24px 26px; margin-bottom: 16px; }
.pub-card h2 { font-size: 15px; margin-bottom: 12px; }
.pub-sec-title { font-size: 12px; letter-spacing: .18em; color: var(--gold); margin-bottom: 10px; }
.rich p { margin: 0 0 10px; color: var(--ink-soft); }
.agenda { display: flex; flex-direction: column; }
.agenda .row { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #ece7dd; font-size: 13px; }
.agenda .row:last-child { border-bottom: 0; }
.agenda .t { color: var(--gold); font-variant-numeric: tabular-nums; }
.agenda .o { color: var(--muted); font-size: 12px; }
.form-sec { border-top: 1px solid #f0ece4; margin-top: 18px; padding-top: 16px; }
.form-sec:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.seg button { border: 0; background: #fff; font: inherit; font-size: 12.5px; padding: 6px 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.form-foot { margin-top: 16px; display: flex; flex-direction: column; gap: 9px; }
.form-foot .btn { width: 100%; justify-content: center; padding: 12px 26px; font-size: 15px; }
.form-foot .hint { color: var(--muted); font-size: 12px; text-align: center; }

/* 报名表单：问卷星式单列排列（只作用于公开报名卡片，不影响管理台/签到台的多列 grid） */
.pub-card .grid { grid-template-columns: 1fr; gap: 13px; }
.field > label .req { font-style: normal; color: #d64541; margin-right: 3px; }
.icon-field { position: relative; }
.icon-field .ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: #a7b0bb; display: flex; pointer-events: none;
}
.icon-field input { padding-left: 34px; }
.agree {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; cursor: pointer;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.6;
}
.agree input { width: auto; margin-top: 3px; }
.done { text-align: center; padding: 26px 10px; }
.done .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 26px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.done h2 { font-size: 19px; margin-bottom: 8px; }
.done .code { font-size: 22px; letter-spacing: .06em; font-weight: 600; margin: 12px 0; }
.done p { color: var(--muted); font-size: 13px; margin: 4px 0; }
.err-box { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 11.5px; padding: 0 0 40px; }

/* ---------------- 图片直播（公开页） ---------------- */
.live-body { background: #14181f; color: #e8edf4; }
.live-head { background: #0f1319; padding: 26px 18px 22px; border-bottom: 1px solid #232a35; }
.live-inner { max-width: 1080px; margin: 0 auto; }
.live-head .kicker { font-size: 11px; letter-spacing: .22em; color: #c3ab86; }
.live-head h1 { font-size: 21px; line-height: 1.45; margin: 8px 0 8px; color: #fff; font-weight: 600; }
.live-facts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: #98a4b6; align-items: center; }
.live-main { max-width: 1080px; margin: 0 auto; padding: 14px 18px 60px; }
.live-bar {
  display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #98a4b6;
  padding: 9px 0 14px; position: sticky; top: 0; background: #14181f; z-index: 10;
}
.live-bar .spacer { flex: 1; }
.live-bar .btn { background: #1c222c; border-color: #2b3442; color: #cdd6e2; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a6472; display: inline-block; }
.live-dot.on { background: #38b07a; box-shadow: 0 0 0 3px rgba(56, 176, 122, .18); }
.live-count { color: #7f8b9c; }
.live-banner {
  background: #1b2230; border: 1px solid #2b3442; border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #c9d3e0; margin-bottom: 14px;
}
.live-banner.active { border-left-color: #38b07a; background: #17241f; color: #cfe8dc; }
.live-grid { columns: 3; column-gap: 10px; }
.live-item {
  margin: 0 0 10px; break-inside: avoid; border-radius: 10px; overflow: hidden;
  background: #1b2028; cursor: zoom-in; position: relative;
}
.live-item img { width: 100%; display: block; }
.live-item figcaption { font-size: 12px; color: #9aa6b6; padding: 7px 10px 9px; }
.live-item.fresh { outline: 2px solid #38b07a; }
.live-empty { text-align: center; color: #7f8b9c; font-size: 13px; padding: 40px 10px; line-height: 1.9; }
.live-foot { text-align: center; color: #6b7789; font-size: 11.5px; line-height: 1.9; margin-top: 26px; }
.live-gate { display: flex; justify-content: center; padding: 26px 0 40px; }
.live-gate-card {
  width: 100%; max-width: 340px; background: #1b2028; border: 1px solid #2b3442;
  border-radius: 12px; padding: 24px 22px;
}
.live-gate-card h2 { font-size: 16px; color: #fff; margin-bottom: 6px; }
.live-gate-card p { font-size: 12.5px; color: #98a4b6; margin: 0 0 16px; }
.live-gate-card .field > label { color: #c3ccd9; }
.live-gate-card input {
  background: #131820; border-color: #2b3442; color: #e8edf4; letter-spacing: .18em; text-align: center;
}
.live-gate-card .btn { width: 100%; justify-content: center; margin-top: 14px; }
.live-gate-card .err { color: #e08f7d; font-size: 12px; margin: 10px 0 0; }
.lightbox {
  position: fixed; inset: 0; background: rgba(6, 9, 13, .95); z-index: 80;
  display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px;
}
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 6px; object-fit: contain; }
.lb-close {
  position: absolute; top: 14px; right: 18px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid #333c4b; background: #1b2028; color: #cfd8e4; font-size: 22px; line-height: 1; cursor: pointer;
}
.lb-bar { display: flex; gap: 14px; align-items: center; margin-top: 14px; color: #b9c4d2; font-size: 13px; }
.lb-bar .btn { background: #1b2028; border-color: #333c4b; color: #dfe6f0; }
@media (max-width: 860px) { .live-grid { columns: 2; } }
@media (max-width: 520px) {
  .live-grid { columns: 2; column-gap: 8px; }
  .live-head h1 { font-size: 17px; }
  .live-main { padding: 10px 12px 50px; }
}

/* ---------------- 归口文件列表 ---------------- */
.file-cat { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.file-cat > summary {
  cursor: pointer; padding: 11px 14px; background: #faf8f4; font-size: 13px; font-weight: 600;
  color: var(--ink-soft); display: flex; gap: 10px; align-items: center; list-style: none;
}
.file-cat > summary::-webkit-details-marker { display: none; }
.file-cat > summary .cnt { color: var(--muted); font-weight: 400; font-size: 12px; }
.file-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid #f2eee6; font-size: 13px; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .nm { font-weight: 600; }
.file-row .meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.file-row .ver { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--gold); }
.file-ver { padding: 2px 14px 8px 26px; }
.file-ver div { font-size: 11.5px; color: var(--muted); padding: 3px 0; display: flex; gap: 10px; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumb img { width: 100%; height: 110px; object-fit: cover; display: block; background: #f1ede5; }
.thumb .cap { font-size: 11.5px; color: var(--muted); padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.thumb .cap > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .cap .btn { flex: 0 0 auto; }
.qr-box { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.qr-box img { width: 168px; height: 168px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }

/* ---------------- 签到台 ---------------- */
.ck-wrap { max-width: 620px; margin: 0 auto; padding: 22px 16px 60px; }
.ck-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f0ece4; }
.ck-item:last-child { border-bottom: 0; }
.ck-item .grow { flex: 1; min-width: 0; }
.ck-item .n { font-weight: 600; font-size: 14px; }
.ck-item .m { color: var(--muted); font-size: 12px; }
