/* ===== 暗紫色毛玻璃主题 ===== */
:root {
  --bg-1: #160829;
  --bg-2: #2a1245;
  --primary: #7B2CBF;
  --primary-2: #9D4EDD;
  --primary-3: #C77DFF;
  --text: #f5f0ff;
  --muted: #b8a8d9;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --danger: #ff4d6d;
  --warn: #ffb703;
  --ok: #06d6a0;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  min-height: 100vh;
}
body {
  background: radial-gradient(ellipse at top left, #2a1245 0%, #160829 60%, #0d0419 100%);
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px circle at 8% 12%, rgba(157,78,221,0.35), transparent 60%),
    radial-gradient(500px circle at 95% 85%, rgba(123,44,191,0.30), transparent 60%);
}
.container { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 16px; }

/* ===== 玻璃卡 ===== */
.glass {
  background: var(--card);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.glass-strong { background: var(--card-strong); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; border-radius: 12px;
  font-size: 14px; font-weight: 500;
  transition: transform .1s, box-shadow .2s, opacity .2s;
  box-shadow: 0 4px 14px rgba(123,44,191,0.35);
  text-decoration: none;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(123,44,191,0.55); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost  { background: transparent; border: 1px solid var(--border-strong); box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); }
.btn-danger { background: linear-gradient(135deg,#c9184a,#ff4d6d); }
.btn-warn   { background: linear-gradient(135deg,#b08900,#ffb703); }
.btn-sm     { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-row    { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== 表单 ===== */
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.input, select, textarea {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  font-family: inherit;
}
.input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(157,78,221,0.25);
}
select option { color: #000; }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: rgba(255,255,255,0.05); border-radius: 10px; margin: 4px 0; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary-2); }

/* ===== 表格 ===== */
.table-wrap { overflow: auto; border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; background: rgba(255,255,255,0.04); position: sticky; top: 0; }
.table tr:hover td { background: rgba(255,255,255,0.04); }

/* ===== Badge ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: rgba(255,255,255,0.1); }
.badge-purple { background: rgba(123,44,191,0.35); color: #e0c3fc; }
.badge-yellow { background: rgba(255,195,0,0.25);  color: #fff3a0; }
.badge-green  { background: rgba(56,161,105,0.30); color: #a7f3d0; }
.badge-red    { background: rgba(220,38,38,0.35);  color: #fecaca; }
.badge-gray   { background: rgba(160,160,180,0.25); color: var(--muted); }
.badge-blue   { background: rgba(59,130,246,0.30);  color: #bfdbfe; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; top: 20px; transform: translateX(-50%);
  padding: 12px 18px; background: rgba(0,0,0,0.75);
  color: #fff; border-radius: 10px; z-index: 9999;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  animation: toastIn .2s;
}
.toast.ok    { background: rgba(6,214,160,0.85); }
.toast.warn  { background: rgba(255,183,3,0.85); }
.toast.err   { background: rgba(255,77,109,0.85); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,-10px); } to { opacity: 1; transform: translate(-50%,0); } }

/* ===== 模态框 ===== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(8px); padding: 16px;
  animation: fadeIn .2s;
}
.modal-box {
  background: rgba(36,18,68,0.92);
  border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 20px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  box-shadow: 0 16px 50px rgba(0,0,0,0.5);
}
.modal-box.lg { max-width: 920px; }
.modal-box .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-box .head h3 { margin: 0; font-size: 17px; }
.modal-box .close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 顶部栏 ===== */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: rgba(20,8,40,0.55); backdrop-filter: blur(14px);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand img { width: 36px; height: 36px; border-radius: 50%; background: #fff; padding: 2px; }
.topbar .brand .title { font-weight: 600; }
.topbar .brand .sub   { color: var(--muted); font-size: 12px; }
.topbar .user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.topbar .user .name { color: var(--muted); font-size: 13px; }
.topbar .user .role { color: var(--primary-3); font-size: 12px; }

.op-home { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; }
.op-actions {
  display: grid; grid-template-columns: 1fr; gap: 18px;
  width: 100%; max-width: 720px; padding: 20px;
}
@media (min-width: 700px) { .op-actions { grid-template-columns: 1fr 1fr; } }
.bigbtn {
  padding: 64px 24px; border-radius: 24px; text-align: center;
  font-size: 28px; font-weight: 600;
  background: linear-gradient(135deg, rgba(123,44,191,0.45), rgba(157,78,221,0.45));
  border: 1px solid var(--border-strong);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(123,44,191,0.35);
  transition: transform .15s, box-shadow .2s;
}
.bigbtn:hover { transform: translateY(-3px); box-shadow: 0 16px 50px rgba(123,44,191,0.55); }
.bigbtn:active { transform: scale(0.98); }
.bigbtn .small { display: block; font-size: 13px; font-weight: 400; opacity: 0.7; margin-top: 6px; }

/* ===== 后台导航 ===== */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 16px; min-height: calc(100vh - 64px); }
@media (max-width: 820px) { .admin-layout { grid-template-columns: 1fr; } }
.sidenav { padding: 14px; }
.sidenav .item {
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-size: 14px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.sidenav .item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sidenav .item.active { background: linear-gradient(135deg, rgba(123,44,191,0.5), rgba(157,78,221,0.5)); color: #fff; }
.admin-main { padding: 18px; }
.section-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.section-desc  { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 16px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.stat-card .v { font-size: 28px; font-weight: 600; }
.stat-card .k { color: var(--muted); font-size: 12px; }

/* ===== 杂项 ===== */
/* 白色发光阴影（用于登录页 Logo） */
.logo-glow {
  filter:
    drop-shadow(0 0 14px rgba(255,255,255,0.55))
    drop-shadow(0 0 28px rgba(199,125,255,0.45));
}
.flex { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.tip { background: rgba(255,183,3,0.12); border-left: 3px solid var(--warn); padding: 10px 12px; border-radius: 8px; color: #ffe8a3; font-size: 13px; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .preview-grid { grid-template-columns: 1fr; } }
.preview-grid canvas { width: 100%; height: auto; border-radius: 8px; background: #fff; }

/* ===== Ticket preview thumb ===== */
.ticket-thumb { display: inline-block; margin: 4px; padding: 6px 10px; border: 1px solid var(--primary-3); border-radius: 8px; color: var(--primary-3); font-size: 12px; }