/* ===============================================================
   统一身份认证站 · 样式表
   浅色企业风格，无外部依赖（不引 CDN，内网可用）
   =============================================================== */

:root {
  --brand:        #1668dc;
  --brand-dark:   #0f4fa8;
  --brand-soft:   #e8f1fd;
  --text:         #1d2129;
  --text-2:       #4e5969;
  --text-3:       #86909c;
  --border:       #e5e6eb;
  --border-2:     #f0f1f3;
  --bg:           #f5f7fa;
  --card:         #ffffff;
  --ok:           #00a870;
  --err:          #d54941;
  --err-soft:     #fdecec;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(0,0,0,.04), 0 6px 20px rgba(29,33,41,.06);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: .3px;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  background: var(--border-2);
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 4px;
}

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

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark-debug { background: #8f5cd6; }

.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 15px; font-weight: 600; }
.brand-text small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user { display: flex; align-items: center; gap: 14px; }
.who { color: var(--text-2); font-size: 13px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text-2);
  background: #fff;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

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

.btn-outline {
  background: #fff;
  border-color: var(--brand);
  color: var(--brand);
}
.btn-outline:hover { background: var(--brand-soft); }

/* ---------------- 主区 ---------------- */
.main { padding: 26px 20px 8px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-2);
}
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-sub { color: var(--text-3); font-size: 12px; }

.sub-head {
  margin: 22px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

/* ---------------- 身份卡 ---------------- */
.identity-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-2);
}

.avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
}

.avatar-text {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 24px;
  font-weight: 600;
}

.identity-title { flex: 1 1 auto; min-width: 0; }
.identity-title h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.identity-title p { margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 5px;
}
.tag-plain { background: var(--border-2); color: var(--text-2); }

.identity-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ok);
  font-size: 12px;
  white-space: nowrap;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(0,168,112,.14);
}

/* ---------------- 四个重点字段 ---------------- */
.grid-primary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.field {
  background: #fafbfc;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 14px 16px;
  position: relative;
  transition: border-color .15s;
}
.field:hover { border-color: #d6dae0; }

.field-label { color: var(--text-3); font-size: 12px; margin-bottom: 6px; }

.field-value {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.35;
}

.field-empty .field-value { color: var(--text-3); font-weight: 400; }

.field-key {
  margin-top: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  color: #b7bcc4;
}

/* ---------------- 档案表 ---------------- */
.grid-profile {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-2);
  border: 1px solid var(--border-2);
  border-radius: 9px;
  overflow: hidden;
}

.row {
  background: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.row-wide { grid-column: 1 / -1; }

.row-label {
  flex: 0 0 128px;
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.row-value {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  word-break: break-all;
}
.muted { color: var(--text-3); }

/* ---------------- 提示条 ---------------- */
.alert {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--err-soft);
  border-color: #f7c8c5;
}
.alert-title { font-weight: 600; color: var(--err); margin-bottom: 4px; }
.alert-body { color: #8f2b26; }
.alert-meta { margin-top: 8px; font-size: 12px; color: #a5544f; }
.alert-meta code { background: rgba(213,73,65,.10); color: #8f2b26; }
.alert-hint { margin-top: 8px; font-size: 12px; color: var(--text-2); }

/* ---------------- 未登录引导 ---------------- */
.welcome { text-align: center; padding: 44px 24px; }

.welcome-icon {
  width: 66px; height: 66px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome h1 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
.welcome-desc { color: var(--text-2); margin: 0 auto 26px; max-width: 560px; }

.flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.flow-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fafbfc;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-2);
}
.flow-step span {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-2);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flow-done { background: var(--brand-soft); border-color: #c3ddfb; color: var(--brand); }
.flow-done span { background: var(--brand); color: #fff; }
.flow-arrow { color: #c9ced6; }

.welcome-debug {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--text-3);
}

/* ---------------- 调试台 ---------------- */
.debug-form textarea,
.key-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--text);
  outline: none;
  resize: vertical;
  background: #fff;
}
.debug-form textarea:focus,
.key-form input:focus { border-color: var(--brand); }

.lbl {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.debug-actions { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }

.key-form {
  display: flex;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto;
}
.key-form input { font-family: inherit; }
.key-error { color: var(--err); font-size: 13px; margin-top: 12px; }

.badge {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 5px;
  margin-left: auto;
}
.badge-ok { background: rgba(0,168,112,.12); color: var(--ok); }
.badge-fail { background: var(--err-soft); color: var(--err); }

.raw {
  background: #f7f8fa;
  border: 1px solid var(--border-2);
  border-radius: 9px;
  padding: 14px 16px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  overflow-x: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------------- 页脚 ---------------- */
.foot-note {
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  margin: 4px 0 0;
}

.footer {
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
  padding: 22px 20px 30px;
}
.sep { margin: 0 8px; color: #d4d8de; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 820px) {
  .grid-primary { grid-template-columns: repeat(2, 1fr); }
}

/* ========== 后台「活动设置」表单 ========== */
.admin-settings-card .field-label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin: 16px 0 6px;
}
.admin-settings-card .field-label:first-of-type { margin-top: 0; }

.agenda-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.agenda-row { display: flex; align-items: center; gap: 8px; }
.agenda-time-input { flex: 0 0 150px; margin-bottom: 0; }
.agenda-text-input { flex: 1 1 auto; margin-bottom: 0; }
.btn-ag-row {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-3);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.btn-ag-row.del:hover { border-color: #f0a0a0; color: var(--err); background: #fff5f5; }

.settings-divider {
  height: 1px;
  background: var(--border-2);
  margin: 22px 0 4px;
}

.banner-upload { margin-bottom: 4px; }
.banner-preview {
  display: block;
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.banner-upload input[type=file] { font-size: 13px; color: var(--text-2); }
.banner-hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.banner-hint.err { color: #dc2626; font-weight: 600; }

/* 议程图片上传（与议程文字互不影响） */
.agenda-img-upload { margin: 8px 0 4px; }
.agenda-img-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  margin: 8px 0 4px;
  cursor: pointer;
}
.agenda-img-clear input { width: 15px; height: 15px; cursor: pointer; }

.alert-ok { background: #ecfdf5; border-color: #bbf7d0; }
.alert-ok .alert-body { color: #047857; }

/* ========== 后台「活动管理」列表 + 筛选 ========== */
.admin-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.admin-filter .field-label {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.admin-filter .input {
  width: auto;
  min-width: 220px;
  margin-bottom: 0;
}

.admin-events-card { padding: 0; overflow: hidden; }
.admin-event-table .event-link { max-width: 340px; }
.admin-event-table .event-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}
.admin-event-table .event-url {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft);
  border-radius: 6px;
  padding: 4px 8px;
  word-break: break-all;
}
.btn-copy {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--brand); }
.btn-copy-ok { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.admin-event-table .event-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--brand); text-decoration: none; }
.btn-mini-danger {
  border-color: #f0b4b4;
  background: #fff5f5;
  color: #dc2626;
}
.btn-mini-danger:hover { border-color: #f0a0a0; }

.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 15px; padding: 0 22px; }
.btn-sm { height: 30px; font-size: 12px; padding: 0 12px; }

/* 后台：大会主题多行输入框 */
.event-title-input {
  min-height: 66px;
  resize: vertical;
  line-height: 1.5;
  padding-top: 10px;
  padding-bottom: 10px;
}

/* 后台：按钮主色预览 */
.accent-preview {
  display: flex;
  align-items: center;
  gap: 6px;
}
.accent-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border);
  vertical-align: middle;
}
.accent-preview code {
  font-size: 12px;
  color: var(--brand);
}

/* 后台：钉钉直达链接（可点击弹二维码） */
.dt-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.dt-link:hover {
  color: var(--brand-dark);
}

/* 二维码弹窗 */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.qr-modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px 20px 20px;
  max-width: 340px;
  width: 86%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.qr-close {
  position: absolute;
  top: 10px;
  right: 14px;
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  padding: 0 2px;
}
.qr-close:hover { color: #111827; }
.qr-title {
  font-size: 16px;
  font-weight: 500;
  color: #111827;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  margin: 0 28px 16px;
}
#qrImg {
  width: 260px;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.qr-foot {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand);
  text-align: center;
  margin: 14px 0 0;
  letter-spacing: 1px;
}

@media (max-width: 600px) {
  .topbar-inner { height: 56px; }
  .brand-text small { display: none; }
  .main { padding: 18px 16px 8px; }
  .card { padding: 18px 16px; }
  .grid-primary { grid-template-columns: 1fr 1fr; gap: 10px; }
  .field-value { font-size: 17px; }
  .grid-profile { grid-template-columns: 1fr; }
  .row { flex-direction: column; gap: 4px; }
  .row-label { flex: none; }
  .identity-state { width: 100%; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
}
