/* 幸运抽奖页：布局对齐装扮商城（af-layout / af-head / aside-card） */

.plaza-main.lt-layout{
  --plaza-aside-w: 20%;
  --lt-cell-h: 148px;
  grid-template-columns: minmax(0, 1fr) var(--plaza-aside-w);
  gap: 20px;
  align-items: start;
}
html.layout-triple .plaza-main.lt-layout:has(> .plaza-left),
html.layout-triple .plaza-main.lt-layout > .plaza-left{
  display: none !important;
}
.plaza-main.lt-layout > .lt-feed-main,
.plaza-main.lt-layout > .plaza-feed{
  min-width: 0;
  gap: 16px;
}
.plaza-main.lt-layout > .plaza-aside{
  min-width: 0;
}

/* ---- 页头（对齐 .af-head；覆盖 lottery.css 里 .lt-head 的横向 flex） ---- */
.plaza-main.lt-layout .lt-page-head,
.lt-feed-main > .lt-page-head{
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start;
  gap: 0 !important;
  margin-bottom: 0 !important;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--accent) 14%, var(--card)) 0%,
    color-mix(in srgb, var(--accent) 5%, var(--card)) 42%,
    color-mix(in srgb, var(--accent-soft, var(--accent)) 45%, var(--card)) 100%
  );
  border: 0;
  border-radius: var(--radius, 20px);
  padding: 24px 24px 20px;
  box-shadow: var(--card-shadow);
  box-sizing: border-box;
}
.plaza-main.lt-layout .lt-page-head::before,
.plaza-main.lt-layout .lt-page-head::after,
.lt-feed-main > .lt-page-head::before,
.lt-feed-main > .lt-page-head::after{
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.plaza-main.lt-layout .lt-page-head::before,
.lt-feed-main > .lt-page-head::before{
  width: min(320px, 70%);
  height: min(320px, 140%);
  top: -55%;
  right: -8%;
  background: radial-gradient(circle at 40% 40%, color-mix(in srgb, var(--accent) 24%, transparent) 0%, transparent 72%);
  opacity: .85;
}
.plaza-main.lt-layout .lt-page-head::after,
.lt-feed-main > .lt-page-head::after{
  width: min(220px, 44%);
  height: min(220px, 110%);
  left: -6%;
  bottom: -60%;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 74%);
  opacity: .75;
}
.lt-head-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.lt-head-brand{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}
.lt-head-icon{
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #764ba2));
  border: 0;
  color: var(--accent-ink, #fff);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}
.lt-head-text{ min-width: 0 }
.lt-head-title{
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -.02em;
}
.lt-head-sub{
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 760px;
}
.lt-head-actions{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.lt-head-actions:empty{ display: none }
.lt-head-actions .btn-primary{
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 24%, transparent);
}
.lt-head-tabs{
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 18%, transparent);
  position: relative;
  z-index: 1;
  width: auto;
  margin-left: 0;
  box-sizing: border-box;
}
.lt-tab{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 0;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--accent);
  background: color-mix(in srgb, var(--card) 76%, transparent);
  border: 1px solid transparent;
  white-space: nowrap;
}
.lt-tab i{ font-size: 15px }
.lt-tab b{
  color: var(--text);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- 工具栏 ---- */
.lt-toolbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 0;
}
.lt-count{
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.lt-toolbar-right{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---- 主面板九宫格 ---- */
.uc-panel.lt-panel,
.lt-panel{
  position: relative;
  overflow: visible;
  padding: 20px;
  box-sizing: border-box;
  background: var(--card, #fff) !important;
  border-radius: var(--radius, 20px);
  box-shadow: var(--card-shadow);
}
.lt-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, var(--lt-cell-h));
  gap: clamp(10px, 1.6vw, 16px);
  width: 100%;
  max-width: none;
  margin: 0;
}
.lt-cell{
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line, #e2e8f0));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  box-sizing: border-box;
  text-align: center;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}
.lt-cell-ico{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent);
  font-size: 20px;
  flex: none;
  overflow: hidden;
}
.lt-cell-ico.has-cover{
  background: transparent;
  padding: 0;
}
.lt-cell-ico img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.lt-cell-name{
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lt-cell-tag{
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-radius: 999px;
  padding: 2px 8px;
}
.lt-cell.is-thanks .lt-cell-ico{
  background: #f1f5f9;
  color: #94a3b8;
}
.lt-cell.is-soldout{ opacity: .42 }
.lt-cell.is-on{
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: scale(1.04);
}
.lt-cell.is-win{
  border-color: #f59e0b;
  background: linear-gradient(160deg, #fffbeb, #ffedd5);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .22), 0 12px 24px rgba(245, 158, 11, .18);
}
.lt-cell-start{
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
  justify-self: stretch;
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #0f172a));
  color: var(--accent-ink, #fff);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 32%, transparent);
  font: inherit;
  gap: 4px;
  padding: 0;
}
.lt-cell-start i{ font-size: 26px; line-height: 1 }
.lt-cell-start strong{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .04em;
}
.lt-cell-start em{
  font-style: normal;
  font-size: 11px;
  opacity: .88;
  font-weight: 600;
}
.lt-cell-start:disabled{
  opacity: .72;
  cursor: not-allowed;
}
.lt-cell-start:not(:disabled):active{ transform: scale(.96) }

/* ---- 侧栏 ---- */
.lt-aside{
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lt-member-card .lt-member-head{ margin-bottom: 12px }
.lt-member-stats{ margin-bottom: 12px }
.lt-member-assets{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.lt-member-assets i{ color: var(--accent); margin-right: 2px }
.lt-member-assets b{ color: var(--text); font-weight: 800 }

.lt-member-guest{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 4px 4px;
}
.lt-guest-icon{
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #764ba2));
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 26%, transparent);
}
.lt-guest-title{
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.lt-guest-desc{
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.lt-activity-card .sec-head,
.lt-rank-card .sec-head{ margin-bottom: 10px }

.lt-feed-marquee{
  height: 220px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}
.lt-feed-track{
  display: flex;
  flex-direction: column;
  animation: lt-feed-up 22s linear infinite;
}
.lt-feed-marquee:hover .lt-feed-track{ animation-play-state: paused }
.lt-feed-list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.lt-feed-list li{
  margin: 0 0 10px;
}
.lt-feed-line{
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface, #f8fafc));
  border: 1px solid color-mix(in srgb, var(--accent) 8%, transparent);
}
.lt-feed-act{
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft, #64748b);
}
.lt-feed-act b{ color: #2563eb; font-weight: 700 }
.lt-feed-act em{ color: var(--accent); font-style: normal; font-weight: 700 }

@keyframes lt-feed-up{
  from{ transform: translateY(0) }
  to{ transform: translateY(-50%) }
}

.lt-rank-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lt-rank-item{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
}
.lt-rank-no{
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
  flex: none;
  font-style: normal;
}
.lt-rank-no--1{ background: #fbbf24; color: #78350f }
.lt-rank-no--2{ background: #cbd5e1; color: #334155 }
.lt-rank-no--3{ background: #fdba74; color: #9a3412 }
.lt-rank-avatar{
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex: none;
}
.lt-rank-meta{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lt-rank-meta strong{
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-rank-meta span{
  font-size: 12px;
  color: var(--muted);
}

/* 中奖记录弹窗 */
.lt-uc-panel.lt-records-panel{
  width: min(420px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
}
.lt-records-body{
  margin: 0;
  padding: 0;
  overflow: auto;
  max-height: min(52vh, 420px);
  list-style: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lt-records-body::-webkit-scrollbar{ display: none; width: 0; height: 0 }
.lt-records-body li{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #e2e8f0) 80%, transparent);
}
.lt-records-body li:last-child{ border-bottom: 0 }
.lt-records-meta{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lt-records-meta strong{
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-records-meta strong.is-thanks{ color: var(--muted); font-weight: 600 }
.lt-records-meta span{
  font-size: 12px;
  color: var(--muted);
}
.lt-records-tag{
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border-radius: 999px;
  padding: 3px 8px;
}
.lt-records-empty{
  padding: 28px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px){
  .plaza-main.lt-layout{
    --plaza-aside-w: 24%;
    --lt-cell-h: 132px;
  }
}
@media (max-width: 960px){
  .plaza-main.lt-layout{
    grid-template-columns: 1fr;
    --lt-cell-h: 118px;
  }
  .lt-page-head{ padding: 18px 16px 16px }
  .lt-head-title{ font-size: 20px }
  .lt-head-icon{ width: 46px; height: 46px; font-size: 22px; border-radius: 14px }
  .lt-head-tabs{
    margin-left: 0;
    width: 100%;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .lt-tab{
    flex: 1 1 0;
    justify-content: center;
    font-size: 11px;
    padding: 6px 6px;
    gap: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .lt-tab i{ font-size: 13px }
  .lt-toolbar-right{ gap: 6px }
  .lt-toolbar-right .btn{ padding-left: 10px; padding-right: 10px }
  .lt-panel{ padding: 14px }
  .lt-grid{
    max-width: none;
    gap: 8px;
  }
  .lt-cell-ico{ width: 34px; height: 34px; font-size: 17px; border-radius: 10px }
  .lt-cell-name{ font-size: 11px }
  .lt-feed-marquee{ height: 180px }
}
