/* ============================================================
 * gift-order.css — 礼物单下单重构（三列礼物墙 + 数量步进器 + 礼物目录管理）
 * ============================================================ */

/* 去掉礼物单标题下方的分割横线 */
#dialog[data-kind="gift-order"] .dialog-head {
  border-bottom: 0;
  padding-bottom: 4px;
}

#dialog[data-kind="gift-order"] .dialog-body {
  padding-top: 8px;
}

.gf-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.gf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gf-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text);
}

.gf-manage-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.gf-manage-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 三列礼物排布 */
.gf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.gf-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 7px 6px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.12s ease,
    box-shadow 0.16s ease;
}

.gf-tile:active {
  transform: scale(0.97);
}

.gf-tile[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--panel));
  box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 55%, transparent);
}

.gf-check {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on, #ffffff);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.16s ease;
  pointer-events: none;
}

.gf-tile[aria-pressed="true"] .gf-check {
  opacity: 1;
  transform: scale(1);
}

.gf-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(234, 90, 50, 0.14), rgba(201, 154, 88, 0.18));
  color: var(--accent);
}

.gf-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gf-thumb.is-rose {
  background: linear-gradient(145deg, #ffe4e6, #fecdd3);
  color: #e11d48;
}
.gf-thumb.is-bear {
  background: linear-gradient(145deg, #fef3c7, #fde68a);
  color: #b45309;
}
.gf-thumb.is-crown {
  background: linear-gradient(145deg, #fef9c3, #fde047);
  color: #a16207;
}
.gf-thumb.is-firework {
  background: linear-gradient(145deg, #ede9fe, #ddd6fe);
  color: #7c3aed;
}
.gf-thumb.is-car {
  background: linear-gradient(145deg, #e0f2fe, #bae6fd);
  color: #0284c7;
}
.gf-thumb.is-castle {
  background: linear-gradient(145deg, #fce7f3, #f5d0fe);
  color: #a21caf;
}

.gf-tile-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.gf-name {
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.gf-empty {
  padding: 20px 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* 礼物数量选择器（紧跟礼物墙下方） */
.gf-qty-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
}

.gf-qty-summary {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gf-qty-summary b {
  font-size: 13.5px;
  font-weight: 750;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-qty-summary small {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.gf-qty-summary small em {
  font-style: normal;
  font-weight: 750;
  color: var(--accent);
}

.gf-stepper {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gf-step {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.gf-step:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.gf-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gf-stepper input[name="giftCount"] {
  width: 56px;
  height: 34px;
  padding: 0 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  appearance: textfield;
  -moz-appearance: textfield;
}

.gf-stepper input[name="giftCount"]::-webkit-outer-spin-button,
.gf-stepper input[name="giftCount"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 礼物管理后台弹窗 */
.gf-admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.gf-admin-top p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.gf-admin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.gf-admin-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
}

.gf-admin-row .gf-thumb {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 10px;
}

.gf-admin-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gf-admin-meta b {
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-admin-meta small {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.gf-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.gf-preview-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  margin-bottom: 10px;
}

.gf-preview-box .gf-thumb {
  width: 60px;
  height: 60px;
  flex: none;
}

.gf-preview-copy {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

/* ---------- 收礼陪玩：与搜索框等大统一尺寸 + 陪玩主页背景与头像 ---------- */
.roster-picker.is-gift {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-picker.is-gift .choice-list.flip-list.gf-rec-list {
  margin-top: 0;
  max-height: 320px;
  gap: 8px;
}

/* 搜索框与下方每一位收礼陪玩卡片保持完全一致的宽高、圆角与左右留白 */
.roster-picker.is-gift .gf-rec-search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 62px;
  min-height: 62px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  box-sizing: border-box;
  cursor: text;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.roster-picker.is-gift .gf-rec-search:focus-within {
  border-color: var(--accent, var(--gold));
  background: var(--panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, var(--gold)) 16%, transparent);
}

.gf-rec-search-ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent, var(--gold)) 12%, var(--panel));
  color: var(--accent, var(--gold));
}

.roster-picker.is-gift .gf-rec-search input[data-pick-search] {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 14px;
  font-weight: 550;
  color: var(--text);
}

.roster-picker.is-gift .gf-rec-search input[data-pick-search]::placeholder {
  color: var(--muted);
  font-weight: 500;
}

/* 收礼陪玩卡片：同步陪玩主页背景与头像 */
.roster-picker.is-gift .pick.flip-pick.gf-rec-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 62px;
  min-height: 62px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: var(--pp-backdrop, linear-gradient(145deg, #272235, #181622));
  color: #ffffff;
  box-sizing: border-box;
  isolation: isolate;
}

.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="0"] {
  background:
    radial-gradient(ellipse 85% 90% at 15% 20%, rgba(251, 146, 60, 0.44) 0%, transparent 62%),
    linear-gradient(155deg, #3c1e1a 0%, #6b2f26 52%, #24161a 100%);
}
.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="1"] {
  background:
    radial-gradient(ellipse 85% 90% at 85% 20%, rgba(56, 189, 248, 0.42) 0%, transparent 62%),
    linear-gradient(155deg, #13253b 0%, #1f3b66 52%, #121827 100%);
}
.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="2"] {
  background:
    radial-gradient(ellipse 85% 90% at 80% 20%, rgba(52, 211, 153, 0.4) 0%, transparent 62%),
    linear-gradient(155deg, #0f2924 0%, #1a4b40 52%, #101e1c 100%);
}
.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="3"] {
  background:
    radial-gradient(ellipse 85% 90% at 20% 20%, rgba(192, 132, 252, 0.44) 0%, transparent 62%),
    linear-gradient(155deg, #28193d 0%, #4b2b6e 52%, #191326 100%);
}
.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="4"] {
  background:
    radial-gradient(ellipse 85% 90% at 80% 20%, rgba(251, 191, 36, 0.4) 0%, transparent 62%),
    linear-gradient(155deg, #362413 0%, #63421d 52%, #1e1710 100%);
}
.roster-picker.is-gift .pick.flip-pick.gf-rec-card[data-card-tone="5"] {
  background:
    radial-gradient(ellipse 85% 90% at 20% 20%, rgba(244, 114, 182, 0.42) 0%, transparent 62%),
    linear-gradient(155deg, #35192e 0%, #662950 52%, #1d121c 100%);
}

.roster-picker.is-gift .pick.flip-pick.gf-rec-card:has(:checked) {
  border-color: var(--accent, var(--gold));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent, var(--gold)) 70%, transparent),
    0 8px 18px -10px color-mix(in srgb, var(--accent, var(--gold)) 70%, transparent);
}

.gf-rec-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.gf-rec-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  display: block;
}

.gf-rec-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(12, 14, 22, 0.62) 0%,
    rgba(12, 14, 22, 0.46) 58%,
    rgba(12, 14, 22, 0.56) 100%
  );
}

.gf-rec-face {
  position: relative;
  z-index: 1;
  gap: 11px;
}

.gf-rec-av {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
}

.gf-rec-av.tone-0 { background: linear-gradient(135deg, #f97316, #fb7185); }
.gf-rec-av.tone-1 { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.gf-rec-av.tone-2 { background: linear-gradient(135deg, #10b981, #0d9488); }
.gf-rec-av.tone-3 { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.gf-rec-av.tone-4 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.gf-rec-av.tone-5 { background: linear-gradient(135deg, #3b82f6, #06b6d4); }

.gf-rec-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gf-rec-text b {
  color: #ffffff;
  font-size: 14px;
  font-weight: 750;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-rec-card .gf-rec-text small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 11.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-rec-card .flip-toggle {
  --fp-size: 36px;
}
