/* 喵御宅 Mfuns 官方 violet 主题配色 */
:root {
  --violet: #8b5cf6;
  --violet-light: #a78bfa;
  --violet-soft: #f3efff;
  --violet-border: #e4dcff;
  --violet-dark: #6d28d9;
  --indigo: #6366f1;
  --ink: #18181c;
  --gray: #61666d;
  --light: #f6f7f8;
  --line: #e3e5e7;
  --white: #fff;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #f6f3ff 0%, #f1f2f3 40%, #f7f5ff 100%);
  color: var(--ink); min-height: 100vh;
}
.app { max-width: 1320px; margin: 0 auto; padding: 18px 20px 30px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: var(--radius); padding: 16px 22px;
  margin-bottom: 16px; box-shadow: 0 4px 20px rgba(139,92,246,.10);
  border: 1px solid var(--violet-border);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff;
  font-size: 26px; font-weight: 800; box-shadow: 0 5px 16px rgba(124,58,237,.35);
}
.topbar h1 { font-size: 20px; letter-spacing: .5px; }
.subtitle { font-size: 12px; color: var(--gray); margin-top: 3px; }
.status { font-size: 13px; color: #16a34a; display: flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; background: #16a34a; border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.status.off { color: #dc2626; }
.status.off .dot { background: #dc2626; box-shadow: 0 0 0 4px rgba(220,38,38,.12); }

.layout { display: grid; grid-template-columns: 390px 1fr; gap: 16px; align-items: start; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(139,92,246,.07); border: 1px solid var(--violet-border); }
.config { padding: 20px; max-height: calc(100vh - 130px); overflow-y: auto; position: sticky; top: 16px; }
.stage { padding: 22px; min-height: 620px; }

.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { font-size: 15px; color: var(--violet-dark); }
.tag { font-size: 11px; background: var(--violet-soft); color: var(--violet); padding: 2px 8px; border-radius: 20px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

.field { margin-bottom: 14px; }
.field.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: #3b3c40; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font-size: 13px; outline: none; transition: border-color .2s, box-shadow .2s; font-family: inherit;
  background: #fdfdff;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.15); background: #fff;
}
.field textarea { resize: vertical; line-height: 1.6; }

/* 输入框 + 粘贴按钮 */
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row input { flex: 1; min-width: 0; }
.input-row .btn { flex: 0 0 auto; white-space: nowrap; }
.input-row.dragover input { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.18); background: var(--violet-soft); }

.drop-tip {
  font-size: 12px; color: var(--violet-dark); background: var(--violet-soft);
  border: 1px dashed var(--violet-border); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px;
}
body.dragging .config { box-shadow: 0 0 0 2px rgba(139,92,246,.35); }
.hint { font-size: 11.5px; color: #9499a0; margin-top: 5px; line-height: 1.5; }
.hint.warn { color: #d97706; background: #fffbeb; border-left: 3px solid #f59e0b; padding: 8px 10px; border-radius: 4px; margin: -4px 0 14px; }

.btn-row { display: flex; gap: 10px; }
.btn {
  border: none; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 10px 16px; transition: all .18s; font-family: inherit;
}
.btn.primary { background: linear-gradient(135deg, var(--violet-light), var(--violet)); color: #fff; flex: 1; }
.btn.primary:hover { background: linear-gradient(135deg, var(--violet), var(--violet-dark)); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,92,246,.3); }
.btn.ghost { background: var(--light); color: #4a4c50; }
.btn.ghost:hover { background: #ede9fe; color: var(--violet-dark); }
.btn.block { width: 100%; }
.btn.tiny { padding: 7px 12px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.resource-card {
  display: flex; gap: 12px; align-items: center; background: var(--violet-soft);
  border: 1px solid var(--violet-border); padding: 12px; border-radius: 11px; margin-top: 14px;
}
.res-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #ede9fe; }
.res-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.res-meta { font-size: 11.5px; color: var(--gray); margin-top: 3px; }

.stage-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.stage-head h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.badge { background: linear-gradient(135deg, var(--violet-light), var(--violet)); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.stage-actions { display: flex; gap: 8px; }

.pool-wrap { min-height: 170px; max-height: 260px; overflow-y: auto; border: 1px dashed var(--violet-border); border-radius: 11px; padding: 12px; background: #fcfbff; }
.empty { text-align: center; padding: 34px 10px; color: #a5a9ad; }
.empty-icon { font-size: 30px; margin-bottom: 8px; }
.empty p { font-size: 14px; margin-bottom: 4px; color: #71767a; }
.empty span { font-size: 12px; }
.pool-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--violet-border);
  border-radius: 20px; padding: 4px 10px 4px 4px; font-size: 12px; max-width: 190px;
}
.person img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: #f0f1f2; }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.draw-zone { text-align: center; margin: 26px 0 10px; }
.reel {
  height: 210px; border-radius: 16px; background: linear-gradient(135deg, #f3efff, #eef2ff);
  border: 2px solid var(--violet-border); display: flex; flex-direction: column; align-items: center;
  justify-content: center; margin-bottom: 18px; overflow: hidden; position: relative;
}
.reel.running { background: linear-gradient(135deg, #ede9fe, #e0e7ff); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(139,92,246,.18); } to { box-shadow: 0 0 0 12px rgba(139,92,246,0); } }
.reel-idle { font-size: 20px; color: #a78bfa; font-weight: 600; }
.reel-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 6px 20px rgba(139,92,246,.22); margin-bottom: 12px; }
.reel-name { font-size: 26px; font-weight: 800; color: var(--violet-dark); }
.reel-uid { font-size: 12px; color: var(--gray); margin-top: 6px; }
.btn.draw {
  background: linear-gradient(135deg, var(--violet-light), var(--violet)); color: #fff;
  font-size: 17px; padding: 14px 54px; border-radius: 30px;
  box-shadow: 0 6px 18px rgba(139,92,246,.35); font-weight: 700; letter-spacing: 2px;
}
.btn.draw:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(139,92,246,.47); }
.btn.draw:disabled { box-shadow: none; }

.result-area { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.result-head h2 { font-size: 17px; color: var(--violet-dark); }
.winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.winner {
  display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #f3efff, #fff);
  border: 1px solid var(--violet-border); border-radius: 12px; padding: 12px 14px;
  animation: pop .45s cubic-bezier(.2,1.5,.4,1) backwards;
}
@keyframes pop { from { opacity: 0; transform: scale(.7) translateY(10px); } to { opacity: 1; transform: scale(1); } }
.winner img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.winner .w-name { font-size: 14px; font-weight: 700; }
.winner .w-uid { font-size: 11px; color: var(--gray); margin-top: 3px; }
.winner .rank { margin-left: auto; font-size: 12px; color: var(--violet); font-weight: 700; }

.foot { display: flex; justify-content: space-between; font-size: 11px; color: #9ba0a5; padding: 16px 6px 0; }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2e1065; color: #fff; padding: 11px 22px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }
.toast.ok { background: #7c3aed; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .config { position: static; max-height: none; }
}

/* 版本标记：用来确认线上跑的是哪一版 */
.ver {
  font-size: 11px; color: var(--violet); background: var(--violet-soft);
  border: 1px solid var(--violet-border); border-radius: 20px; padding: 1px 8px;
}
