/* ============================================================
   书画展 H5 · 现代极简风格
   白底 / 近黑字 / 朱红印章点缀 / 大留白
   ============================================================ */

:root {
  --ink: #1a1a1a;        /* 主文字 近黑 */
  --ink-soft: #6b6b6b;   /* 次级文字 */
  --paper: #ffffff;      /* 背景 纯白 */
  --red: #b22222;        /* 朱红 印章/强调 */
  --line: #ececec;       /* 细分隔线 */
  --field: #f6f6f6;      /* 输入框底色 */
  --radius: 14px;
  --maxw: 460px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px 48px;
  min-height: 100vh;
}

/* 顶部细线 + 展览标识 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.brand {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.seal {
  width: 30px; height: 30px;
  border: 1.5px solid var(--red);
  color: var(--red);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0;
}

/* 标题区 */
.hero { margin-bottom: 30px; }
.hero .kicker {
  font-size: 12px; letter-spacing: 3px; color: var(--red);
  text-transform: uppercase; margin-bottom: 12px;
}
.hero h1 {
  font-size: 30px; font-weight: 700; line-height: 1.25;
  margin: 0 0 12px; letter-spacing: 1px;
}
.hero .sub { color: var(--ink-soft); font-size: 15px; margin: 0; }
.hero .meta {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
}
.hero .meta div { margin: 4px 0; }
.hero .meta b { color: var(--ink); font-weight: 600; }

/* 区块标题 */
.section-title {
  font-size: 13px; letter-spacing: 2px; color: var(--ink-soft);
  text-transform: uppercase; margin: 30px 0 14px;
}

/* 表单 */
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; color: var(--ink-soft);
  margin-bottom: 7px; letter-spacing: .5px;
}
.field input, .field select {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--field); color: var(--ink); font-size: 16px;
  outline: none; transition: border-color .15s;
  font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--ink); }

/* 按钮 */
.btn {
  display: block; width: 100%; padding: 15px;
  border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; letter-spacing: 1px;
  cursor: pointer; transition: opacity .15s, transform .05s;
  font-family: inherit;
}
.btn:active { transform: scale(.99); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-red { background: var(--red); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 入口卡片（首页两栏） */
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; background: #fff;
}
.entry-card:active { border-color: var(--ink); }
.entry-card .ic { font-size: 22px; margin-bottom: 8px; }
.entry-card .t { font-weight: 600; font-size: 15px; }
.entry-card .d { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* 提示 / 状态 */
.note {
  font-size: 13px; color: var(--ink-soft); margin-top: 12px; line-height: 1.5;
}
.msg {
  padding: 11px 14px; border-radius: 10px; font-size: 14px;
  margin: 14px 0; display: none;
}
.msg.show { display: block; }
.msg-err { background: #fdeaea; color: #b22222; }
.msg-ok { background: #eafaf0; color: #1c7a43; }

/* ===================== 电子票 ===================== */
.ticket {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; background: #fff;
}
.ticket-head {
  padding: 22px 22px 16px; border-bottom: 1px dashed var(--line);
  position: relative;
}
.ticket-head .kicker {
  font-size: 11px; letter-spacing: 3px; color: var(--red);
  text-transform: uppercase; margin-bottom: 8px;
}
.ticket-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.ticket-head .seal-float {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border: 2px solid var(--red); color: var(--red);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; transform: rotate(-6deg);
}
.ticket-body { padding: 20px 22px; }
.ticket-row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; }
.ticket-row .k { color: var(--ink-soft); }
.ticket-row .v { font-weight: 600; text-align: right; }
.ticket-qr {
  margin: 18px auto 6px; width: 200px; height: 200px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff;
}
.ticket-qr img, .ticket-qr canvas { width: 100% !important; height: 100% !important; display: block; }
.ticket-no {
  text-align: center; font-size: 13px; letter-spacing: 2px; color: var(--ink-soft);
  margin-top: 6px;
}
.ticket-no b { color: var(--ink); letter-spacing: 3px; }
.ticket-foot {
  padding: 14px 22px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-soft); text-align: center;
}

/* ===================== 核销 ===================== */
.scan-box {
  width: 100%; aspect-ratio: 1 / 1; background: #000; border-radius: var(--radius);
  overflow: hidden; position: relative; margin: 8px 0 14px;
}
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-box .placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #888; font-size: 14px; text-align: center; padding: 20px;
}
.scan-frame {
  position: absolute; left: 15%; right: 15%; top: 15%; bottom: 15%;
  border: 2px solid var(--red); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}
.result {
  margin-top: 16px; padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--line); display: none;
}
.result.show { display: block; }
.result.ok { border-color: #1c7a43; background: #f3fbf6; }
.result.fail { border-color: var(--red); background: #fdf2f2; }
.result .name { font-size: 18px; font-weight: 700; }
.result .line { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.stat-row { display: flex; gap: 12px; margin-top: 22px; }
.stat {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: center;
}
.stat .n { font-size: 24px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* 隐藏元素辅助 */
.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 24px; }

/* ===================== 管理后台：数据概览 / 票务 ===================== */
.stat-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.stat-card {
  flex: 1 1 28%; min-width: 84px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 8px; text-align: center; background: #fff;
}
.stat-card .n { font-size: 22px; font-weight: 700; }
.stat-card .l { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.tk-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.tk-table th, .tk-table td {
  border: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: middle;
}
.tk-table th { background: #f5f2ee; font-weight: 600; white-space: nowrap; }
.tk-table td.ops { white-space: nowrap; text-align: center; }
.btn-del {
  background: none; border: none; color: var(--red);
  font-size: 12px; cursor: pointer; padding: 2px 4px; font-family: inherit;
}
.btn-del:hover { text-decoration: underline; }
.tk-empty { font-size: 13px; color: var(--ink-soft); padding: 16px 0; text-align: center; }
