/* ======= 主题变量 / Reset ======= */
:root{
  --ink:#1e1b16; --paper:#f8f5f1; --tea:#c7b59d; --gold:#b08a49; --accent:#7e5c3a; --muted:#6b6b6b;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:ui-serif,"Songti SC","Noto Serif CJK SC",serif;
  color:var(--ink);
  background:var(--paper) url('../assets/paper-texture.png') repeat;
  line-height:1.6;
}
.instance-note-btn-container {
  margin: 15px 0;
}

.instance-note-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.instance-note-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.instance-note-content {
  line-height: 1.6;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
  white-space: pre-line;
}

/* ======= 工具类 ======= */
.hidden{display:none!important}
.text-center{text-align:center}

/* ======= 状态徽章 ======= */
.status-badge{padding:4px 8px;border-radius:12px;font-size:.8rem;font-weight:600}
.status-pending{background:#fff3cd;color:#856404}
.status-approved{background:#d1edff;color:#0c5460}
.status-rejected{background:#f8d7da;color:#721c24}

/* ======= 站点头 ======= */
.site-header{
  position:sticky;top:0;z-index:10;
  background:linear-gradient(180deg,rgba(248,245,241,.95),rgba(248,245,241,.85));
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  border-bottom:1px solid rgba(0,0,0,.06);
  padding:.75rem 1rem;
  display:flex;justify-content:space-between;align-items:center
}
.brand{display:flex;align-items:center;gap:.75rem}
.brand-link{display:flex;align-items:center;gap:.75rem;text-decoration:none;color:inherit;border-radius:8px;padding:4px 8px;margin:-4px -8px;transition:.3s}
.brand-link:hover{background:rgba(138,107,61,.1);transform:translateY(-1px)}
.brand .seal{display:inline-grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--gold);color:#fff;font-weight:700;transition:.3s;box-shadow:0 1px 2px rgba(0,0,0,.15) inset}
.brand-link:hover .seal{transform:scale(1.05);box-shadow:0 4px 12px rgba(138,107,61,.3)}
.brand h1{font-size:1.25rem;margin:0}
.nav a{margin-left:.75rem;color:var(--ink);text-decoration:none;padding:.35rem .6rem;border-radius:.5rem}
.nav a:hover{background:rgba(0,0,0,.06)}

/* ======= 用户中心：基础布局 ======= */
.user-body{background:#f7f7f7;min-height:100vh}
.user-main{max-width:1080px;margin:0 auto;padding:12px}
.section-card{background:#fff;border:1px solid rgba(0,0,0,.06);border-radius:14px;padding:14px 16px;box-shadow:0 8px 20px rgba(0,0,0,.06);margin-bottom:16px}
.section-card h2{margin:0 0 10px;font-size:1.12rem}

/* ======= 成功消息样式 ======= */
.success-message{background:#d4edda;color:#155724;padding:12px 16px;border-radius:8px;margin-bottom:18px;border:1px solid #c3e6cb}

/* ======= 基础资料卡片样式 ======= */
.profile-card{position:relative}
.profile-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid rgba(176,138,73,.2)}
.profile-header h2{margin:0}
.btn-edit{background:var(--gold);color:white;border:none;padding:8px 16px;border-radius:6px;cursor:pointer;font-size:.9rem;transition:all .3s ease}
.btn-edit:hover{background:var(--accent);transform:translateY(-1px);box-shadow:0 2px 8px rgba(176,138,73,.3)}

/* ======= 三栏布局（资料 | 积分 | 历史中奖）=== */
.profile-card .profile-body.grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

/* --- 基础资料左侧布局优化 --- */
.profile-card--with-points .profile-readonly.compact {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-card--with-points .profile-top-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.profile-card--with-points .profile-avatar-readonly .avatar-preview {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 2px solid var(--gold);
}

/* 三项信息强制一行 */
.profile-card--with-points .profile-basic-info {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.profile-card--with-points .profile-basic-info::-webkit-scrollbar {
  height: 4px;
}

.profile-card--with-points .profile-basic-info::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.profile-card--with-points .profile-basic-info::-webkit-scrollbar-thumb {
  background: var(--tea);
  border-radius: 2px;
}

.profile-card--with-points .profile-basic-info .info-item-inline {
  display: flex;
  flex-direction: column;
  min-width: 120px;
  flex-shrink: 0;
}

.profile-card--with-points .profile-basic-info label {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
  font-weight: 600;
}

.profile-card--with-points .profile-basic-info .value {
  font-size: 14px;
  font-weight: 500;
  background: #f8f9fa;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  min-height: 32px;
  display: flex;
  align-items: center;
}

/* 简介区紧凑 */
.profile-card--with-points .profile-bio-large {
  border-top: 1px solid #eee;
  padding-top: 12px;
}

.profile-card--with-points .profile-bio-large label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 600;
}

.profile-card--with-points .profile-bio-large .value {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  min-height: 50px;
}

/* --- 积分右侧卡片 --- */
.points-card {
  border: 1px solid #e9edf2;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.points-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  text-align: center;
}

.points-display-compact {
  display: grid;
  place-items: center;
  padding: 10px 0;
}
.points-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: var(--gold);
}
.points-label {
  font-size: 11px;
  color: #75819a;
  margin-top: 4px;
}
.points-actions-compact {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.points-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 8px;
  background: #1f6feb;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all .3s ease;
}
.points-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(31, 111, 235, 0.3);
}
.points-btn.secondary { background: #6e7781; }
.points-btn.info { background: #0ea5e9; }

/* --- 历史中奖排行榜（最右列） --- */
.winners-card {
  border: 1px solid #e9edf2;
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.winners-card .card-hd{
  display:flex; 
  align-items:center; 
  gap:6px; 
  margin-bottom:10px;
}
.winners-card .card-hd h3 {
  font-size: 14px;
  margin: 0;
}
.winners-card .card-hd .muted {
  font-size: 11px;
  color: #666;
}

.winner-list{ 
  list-style:none; 
  margin:0; 
  padding:0; 
  position:relative; 
}

.winner-item{
  display:grid; 
  grid-template-columns: 24px 32px 1fr auto;
  align-items:center; 
  gap:8px;
  padding:6px 4px; 
  border-radius:8px;
}
.winner-item:not(:last-child){ 
  border-bottom:1px dashed #eef1f5; 
}
.winner-rank{ 
  width:24px; 
  text-align:center; 
  font-weight:700; 
  font-size: 12px;
}
.winner-avatar{ 
  width:32px; 
  height:32px; 
  border-radius:50%; 
  background:#f2f4f7 center/cover no-repeat; 
  border: 1px solid #e5e7eb;
}
.winner-name{ 
  font-size:13px; 
  overflow:hidden; 
  text-overflow:ellipsis; 
  white-space:nowrap; 
}
.winner-badge{
  font-size:11px; 
  padding:3px 6px; 
  border-radius:999px;
  background:#f3f4f6; 
  border:1px solid #e5e7eb;
  font-weight: 600;
}

.winner-actions{ 
  margin-top:8px; 
  text-align:center; 
}
.btn.ghost{
  background:transparent; 
  border:1px solid #e5e7eb; 
  color:#374151;
  padding:5px 10px; 
  border-radius:8px; 
  cursor:pointer;
  font-size: 12px;
}
.btn.ghost:hover{ 
  background:#f9fafb; 
}

/* ======= 队伍信息模块 ======= */
.two-col-card .two-col-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.squad-info-section h3 {
  font-size: 14px;
  margin: 0 0 12px;
}

/* 副本说明紧凑样式 */
.instance-note-compact{
  background:linear-gradient(135deg,#f0f7ff,#e6f3ff);
  border:1px solid rgba(74,144,226,.2);
  border-radius:8px;
  padding:10px;
  margin-bottom:12px
}
.instance-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px
}
.instance-header h4{
  margin:0;
  font-size:.9rem;
  color:var(--text)
}
.instance-badge{
  background:var(--tea);
  color:white;
  padding:2px 6px;
  border-radius:8px;
  font-size:.7rem;
  font-weight:600
}
.instance-content-compact{
  max-height:100px;
  overflow-y:auto;
  font-size:.8rem;
  line-height:1.4;
  color:var(--text);
  background:rgba(255,255,255,.7);
  padding:6px;
  border-radius:4px
}

/* 小队详情样式 */
.squad-details-compact{
  background:#f8f9fa;
  border-radius:8px;
  padding:12px
}
.info-item{
  display:flex;
  margin-bottom:6px;
  align-items:flex-start;
  font-size: 13px;
}
.info-item .label{
  font-weight:600;
  color:var(--muted);
  min-width:60px;
  margin-right:8px;
  flex-shrink: 0;
}
.info-item .value{
  flex:1;
  color:var(--text)
}
.leader-name{
  color:var(--gold);
  font-weight:600
}
.squad-actions{
  margin-top:12px;
  text-align:center
}

/* 没有小队的状态样式 */
.no-squad{
  text-align:center;
  padding:16px;
  background:#f8f9fa;
  border-radius:8px;
  border:2px dashed #dee2e6;
  min-height:120px;
  display:flex;
  flex-direction:column;
  justify-content:center
}
.no-squad-icon{
  font-size:2rem;
  margin-bottom:8px
}
.no-squad-message{
  color:var(--muted);
  margin-bottom:12px;
  font-size:.85rem
}

/* 报名状态样式 */
.signup-status{
  background:#d1edff;
  padding:12px;
  border-radius:8px;
  border:1px solid #b8daff;
  margin-top:8px
}
.signed-up-message{
  color:#0c5460;
  margin-bottom:6px;
  font-weight:600;
  font-size: 13px;
}
.signup-details{
  margin-bottom:10px;
  padding:6px;
  background:rgba(255,255,255,.7);
  border-radius:4px
}
.signup-details small{
  color:#495057;
  line-height:1.4;
  font-size: 11px;
}
.cancel-signup-form{
  margin-top:8px;
  text-align:center
}
.signup-form{
  margin-top:12px
}
.signup-hint{
  color:var(--muted);
  font-style:italic;
  margin-top:8px;
  font-size: 12px;
}

/* 占位样式 */
.placeholder-right .placeholder-box {
  border: 1px dashed #d9dee5;
  border-radius: 8px;
  padding: 16px;
  color: #8a94a6;
  text-align: center;
  background: #fafbfc;
  font-size: 13px;
}

/* ======= 书页编辑紧凑样式 ======= */
.collapsible section-card{
  border:1px solid rgba(0,0,0,.06);
  border-radius:12px;
  overflow:hidden
}
.book-editor{
  border:1px solid rgba(0,0,0,.06);
  border-radius:12px;
  box-shadow:0 6px 16px rgba(0,0,0,.05);
  overflow:hidden
}
.page-nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 12px;
  background:#fafafa;
  border-bottom:1px solid #eee
}
.page-index{
  font-weight:600;
  color:#333;
  font-size: 13px;
}
.page-panel{
  display:none;
  padding:14px
}
.page-panel.active{
  display:block
}
.page-content{
  display:grid;
  grid-template-columns: 250px 1fr;
  gap:14px
}
.dz{
  position:relative;
  display:grid;
  place-items:center;
  border:1px dashed rgba(0,0,0,.18);
  border-radius:12px;
  background:#fafafa;
  cursor:pointer;
  overflow:hidden
}
.dz .preview{
  position:absolute;
  inset:0;
  background:#ddd center/cover no-repeat
}
.dz input[type=file]{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer
}
.dz.page{
  width:100%;
  height:320px;
  border:2px dashed #ddd;
  border-radius:8px
}
.page-tools{
  display:flex;
  gap:6px;
  margin-top:6px
}
.tip{
  font-size:.75rem;
  color:#666;
  margin-top:6px;
  line-height:1.4
}
.lined{
  --lh:1.9em;
  font:500 14px/1.9 "Noto Serif SC","Songti SC","SimSun",serif;
  color:#2a2111;
  width:100%;
  padding:6px 8px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  background:#fff;
  background-image:repeating-linear-gradient(to bottom,transparent 0,transparent calc(var(--lh)-1px),rgba(138,107,61,.18) calc(var(--lh)-1px),rgba(138,107,61,.18) var(--lh));
  background-size:100% var(--lh);
  background-position:0 .6em
}
.sticky-save{
  position:sticky;
  bottom:0;
  padding:8px;
  background:linear-gradient(180deg,transparent,rba(255,255,255,.9));
  text-align:center
}

/* ======= 通用表单/按钮 ======= */
.form-group{
  margin-bottom:12px
}
label{
  display:block;
  font-size:.9rem;
  color:#333;
  margin:.3rem 0
}
input,textarea,select{
  width:100%;
  padding:.4rem .5rem;
  border-radius:.4rem;
  border:1px solid rgba(0,0,0,.15);
  outline:none;
  background:#fff;
  font-size: 14px;
}
textarea{
  resize:vertical
}
.btn{
  display:inline-block;
  padding:.5rem .9rem;
  border-radius:.6rem;
  border:0;
  cursor:pointer;
  text-decoration:none;
  background:#333;
  color:#fff;
  transition:.2s;
  font-size: 13px;
}
.btn:hover{
  filter:brightness(.95)
}
.btn.alt{
  background:var(--gold);
  color:#fff
}
.btn-mini{
  padding:5px 8px;
  font-size:.75rem;
  border-radius:6px;
  border:0;
  background:#6c757d;
  color:#fff;
  cursor:pointer
}
.btn-mini.danger{
  background:#dc3545
}
.btn.danger{
  background:#dc3545;
  color:white;
  border:none;
  padding:6px 12px;
  border-radius:6px;
  font-size:.85rem;
  cursor:pointer;
  transition:all .3s ease
}
.btn.danger:hover{
  background:#c82333;
  transform:translateY(-1px);
  box-shadow:0 2px 8px rgba(220,53,69,.3)
}
.error{
  background:#ffecec;
  color:#b15353;
  padding:.4rem .6rem;
  border-radius:.4rem;
  margin-bottom:.5rem;
  border:1px solid #ffcdd2;
  font-size: 13px;
}

/* 平台选项样式 */
.platform-options{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-top:4px
}
.checkbox-option{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.85rem
}

/* ======= 弹窗样式 ======= */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.5);
  z-index:9999;
  justify-content:center;
  align-items:center
}
.modal-content{
  background:#fff;
  padding:20px;
  border-radius:12px;
  width:90%;
  max-width:500px;
  max-height:80vh;
  overflow-y:auto;
  box-shadow:0 20px 40px rgba(0,0,0,.3);
  animation:modalFadeIn .3s ease;
  position:relative;
  z-index:10000
}
@keyframes modalFadeIn{
  from{
    opacity:0;
    transform:scale(.9)
  }
  to{
    opacity:1;
    transform:scale(1)
  }
}
.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
  padding-bottom:12px;
  border-bottom:1px solid #eee
}
.modal-header h3{
  margin:0;
  color:#333;
  font-size: 16px;
}
.close-modal{
  background:none;
  border:0;
  font-size:1.3rem;
  cursor:pointer;
  color:#666;
  padding:0;
  width:28px;
  height:28px;
  display:flex;
  align-items:center;
  justify-content:center
}
.close-modal:hover{
  color:#333
}

/* 积分兑换选项样式 */
.exchange-option{
  margin:12px 0;
  padding:10px;
  border:1px solid #eee;
  border-radius:6px;
  cursor:pointer;
  transition:all .3s ease;
  font-size: 13px;
}
.exchange-option:hover{
  border-color:var(--gold);
  background:rgba(176,138,73,.05)
}
.exchange-option.selected{
  border-color:var(--gold);
  background:rgba(176,138,73,.1)
}

/* 兑换历史表格样式 */
.history-table{
  width:100%;
  border-collapse:collapse;
  margin-top:12px;
  font-size: 12px;
}
.history-table th,.history-table td{
  padding:8px;
  text-align:left;
  border-bottom:1px solid #eee
}
.history-table th{
  background:#f8f9fa;
  font-weight:600
}

/* 规则内容样式 */
.rules-content{
  max-height:300px;
  overflow-y:auto;
  padding:12px;
  background:#f8f9fa;
  border-radius:6px;
  margin-top:12px;
  font-size: 13px;
}

/* 快速导航栏样式 */
.mobile-quickbar{
  display: none;
}
.quick-pill{
  padding:6px 10px;
  font-size:12px;
  white-space:nowrap;
  border:1px solid #e5e7eb;
  border-radius:999px;
  color:#333;
  text-decoration:none;
  transition: all .3s ease;
}
.quick-pill.active {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

/* 确保横向滚动容器可以编程控制滚动 */
.profile-card .profile-body.grid-3 {
  scroll-behavior: smooth;
}

/* ======= 响应式设计 ======= */

/* 中等屏幕适配 */
@media (max-width: 1200px) {
  .profile-card .profile-body.grid-3 {
    grid-template-columns: 1.6fr 1fr;
  }
  .profile-right {
    display: grid;
    gap: 14px;
  }
}

/* 移动端主要适配 */
@media (max-width: 900px) {
  .user-main {
    padding: 10px;
  }
  
  .section-card {
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  
  /* 快速导航栏显示 */
  .mobile-quickbar{
    position: sticky;
    top: 56px;
    z-index: 11;
    display:flex;
    gap:8px;
    padding:8px 12px;
    overflow-x:auto;
    background:rgba(248,245,241,.9);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    border-bottom:1px solid rgba(0,0,0,.06);
  }
  
  /* 三栏布局改为横向滚动，积分模块默认第一 */
  .profile-card .profile-body.grid-3 {
    display: flex !important;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scroll-behavior: smooth;
  }
  
  /* 重新排序：积分模块排第一，资料第二，排行第三 */
  .profile-card .profile-body.grid-3 > .profile-left {
    order: 2;
  }
  .profile-card .profile-body.grid-3 > .profile-mid {
    order: 1;
  }
  .profile-card .profile-body.grid-3 > .profile-right {
    order: 3;
  }
  
  .profile-card .profile-body.grid-3 > * {
    flex: 0 0 88%;
    scroll-snap-align: start;
  }
  
  /* 卡片高度调整 */
  .points-card, .winners-card {
    min-height: 220px;
  }
  
  /* 基础资料区优化 */
  .profile-card--with-points .profile-top-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  
  .profile-card--with-points .profile-basic-info {
    justify-content: flex-start;
    gap: 8px;
  }
  
  .profile-card--with-points .profile-basic-info .info-item-inline {
    min-width: 100px;
  }
  
  /* 简介默认折叠，点击展开 */
  .profile-bio-large .value.bio-value {
    max-height: 120px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    cursor: pointer;
  }
  .profile-bio-large .value.bio-value.expanded {
    max-height: none;
    -webkit-line-clamp: unset;
  }
  
  /* 队伍模块优化 */
  .two-col-card .two-col-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  
  .two-col-card .col-right {
    display: none;
  }
  
  .instance-content-compact {
    max-height: 72px;
  }
  
  /* 书页编辑区优化 */
  .page-content {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .dz.page {
    height: 200px;
  }
  
  .lined {
    font-size: 13px;
    line-height: 1.8;
  }
  
  /* 其他细节优化 */
  .winner-item {
    grid-template-columns: 20px 28px 1fr auto;
    gap: 6px;
    padding: 4px 2px;
  }
  
  .winner-avatar {
    width: 30px;
    height: 30px;
  }
  
  .winner-name {
    font-size: 12px;
  }
  
  .winner-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .signup-status, .no-squad {
    padding: 12px;
  }
  
  .btn, .points-btn {
    padding: .45rem .75rem;
    font-size: 13px;
    border-radius: 8px;
  }
  
  .btn-mini {
    padding: 4px 7px;
    font-size: .72rem;
  }
  
  .modal-content {
    width: 95%;
    padding: 16px;
  }
  
  /* 横向滚动条优化 */
  .profile-card .profile-body.grid-3::-webkit-scrollbar {
    height: 6px;
  }
  .profile-card .profile-body.grid-3::-webkit-scrollbar-thumb {
    background: #e5decf;
    border-radius: 999px;
  }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
  .user-main {
    padding: 8px;
  }
  
  .section-card {
    padding: 10px 12px;
    margin-bottom: 12px;
  }
  
  .profile-card .profile-body.grid-3 > * {
    flex-basis: 92%;
  }
  
  .points-value {
    font-size: 24px;
  }
  
  .profile-card--with-points .profile-basic-info .info-item-inline {
    min-width: 90px;
  }
  
  .profile-card--with-points .profile-basic-info .value {
    font-size: 13px;
    padding: 4px 6px;
  }
  
  .winner-item {
    grid-template-columns: 20px 28px 1fr auto;
    gap: 6px;
    padding: 4px 2px;
  }
  
  .winner-avatar {
    width: 28px;
    height: 28px;
  }
  
  .winner-name {
    font-size: 12px;
  }
  
  .winner-badge {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* 页脚样式 */
.site-footer{
  padding:1rem;
  text-align:center;
  color:var(--muted);
  margin-top:20px;
  font-size: 13px;
}

/* 加载动画 */
.loading-spinner{
  display:inline-block;
  width:1em;
  height:1em;
  margin-right:.5em;
  border-radius:50%;
  border:.18em solid rgba(0,0,0,.15);
  border-top-color: currentColor;
  animation: spin 1s linear infinite;
  vertical-align:-0.125em;
}
@keyframes spin{
  to{
    transform:rotate(360deg)
  }
}

/* 所有中奖人员弹窗样式 */
.all-winners-container {
  max-height: 60vh;
  overflow-y: auto;
}

.winners-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 13px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.8em;
  color: #666;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.1em;
  font-weight: bold;
  color: #333;
}

.winners-table-container {
  margin-bottom: 16px;
}

.winners-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  table-layout: fixed;
}

.winners-table th {
  background: #f8f9fa;
  padding: 10px 6px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  font-size: 11px;
}

.winners-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.winners-table tr:hover {
  background: #f8f9fa;
}

.text-center {
  text-align: center;
}

.rank-badge {
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  text-align: center;
  font-weight: bold;
  font-size: 0.8em;
}

.rank-1 {
  background: #ffd700;
  color: #000;
}

.rank-2 {
  background: #c0c0c0;
  color: #000;
}

.rank-3 {
  background: #cd7f32;
  color: #000;
}

.rank-other {
  background: #6c757d;
  color: white;
}

.winner-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.winner-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid #e9ecef;
  flex-shrink: 0;
}

.winner-name-small {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-size: 12px;
}

.total-count {
  font-weight: bold;
  color: #dc3545;
  font-size: 1em;
}

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid #dee2e6;
  text-align: right;
}

/* 武侠修炼模块容器 */
.cultivation-module-container {
    background: linear-gradient(135deg, #1a2f3b 0%, #2c5530 100%);
    border: 2px solid #8b7355;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
}

.cultivation-module-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

/* 头部样式 */
.cultivation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(139, 115, 85, 0.3);
}

.cultivation-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-icon {
    font-size: 1.5rem;
}

.cultivation-title h3 {
    margin: 0;
    color: #d4af37;
    font-size: 1.25rem;
    font-weight: 600;
}

.cultivation-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4CAF50;
    font-size: 0.875rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 主体内容 */
.cultivation-body {
    padding: 1.5rem;
}

/* 统计信息 */
.cultivation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: #ccc;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1rem;
    color: #d4af37;
    font-weight: 600;
}

/* 属性展示 */
.cultivation-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.attribute-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    background: rgba(139, 115, 85, 0.1);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.attribute-item:hover {
    background: rgba(139, 115, 85, 0.2);
    border-color: rgba(212, 175, 55, 0.4);
}

.attribute-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.attribute-name {
    font-size: 0.75rem;
    color: #ccc;
    margin-bottom: 0.25rem;
}

.attribute-value {
    font-size: 1.125rem;
    color: #d4af37;
    font-weight: 600;
}

/* 操作区域 */
.cultivation-actions {
    text-align: center;
}

.cultivation-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #d4af37, #f7ef8a);
    color: #2c5530;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.cultivation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: #2c5530;
}

.btn-icon {
    font-size: 1.25rem;
}

.cultivation-tips {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #d4af37;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cultivation-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .cultivation-attributes {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .cultivation-body {
        padding: 1rem;
    }
    
    .cultivation-header {
        padding: 1rem;
    }
}

/* 移动端按钮点击优化 */
.points-btn { 
  touch-action: manipulation; 
}
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    flex: 1;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.instance-note-content {
    line-height: 1.6;
    white-space: pre-line;
}
/* 按钮行样式 */
.squad-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

/* 已报名人员列表样式 */
.signed-up-users-list {
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.signed-user-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 6px;
}

.user-name {
    font-weight: 500;
}

.user-faction {
    color: #666;
    margin-left: 4px;
    font-size: 11px;
}
/* 所有中奖人员弹窗优化样式 */
.all-winners-container {
  max-height: 70vh;
  overflow-y: auto;
}

/* 统计区域优化 */
.winners-stats {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.stat-item {
  text-align: center;
  padding: 0 15px;
}

.stat-label {
  display: block;
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  font-weight: 500;
}

.stat-value {
  display: block;
  font-size: 28px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 表格容器优化 */
.winners-table-container {
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 表格优化 */
.winners-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 14px;
}

.winners-table th {
  background: #f8f9fa;
  color: #2d3748;
  font-weight: 600;
  padding: 16px 12px;
  text-align: center;
  border-bottom: 2px solid #e2e8f0;
  font-size: 14px;
}

.winners-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: center;
  color: #4a5568;
}

.winners-table tbody tr {
  transition: all 0.2s ease;
}

.winners-table tbody tr:hover {
  background: #f7fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 排名徽章优化 */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 13px;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.rank-1 {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #7c5a00;
}

.rank-2 {
  background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
  color: #4a4a4a;
}

.rank-3 {
  background: linear-gradient(135deg, #CD7F32, #B08D57);
  color: #5a3d1b;
}

.rank-other {
  background: linear-gradient(135deg, #718096, #4a5568);
  color: white;
}

/* 玩家信息优化 */
.winner-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}

.winner-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}

.winner-name-small {
  font-weight: 600;
  color: #2d3748;
  font-size: 14px;
  text-align: left;
  flex: 1;
}

/* 中奖次数显示优化 */
.total-count {
  font-weight: 700;
  font-size: 16px;
  color: #2d3748;
  background: #f0fff4;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #c6f6d5;
  display: inline-block;
  min-width: 40px;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .winners-stats {
    flex-direction: column;
    gap: 15px;
  }
  
  .stat-item {
    padding: 10px 0;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  .winners-table {
    font-size: 13px;
  }
  
  .winner-info {
    gap: 8px;
  }
  
  .winner-avatar-small {
    width: 32px;
    height: 32px;
  }
}
.pending-exchange-warning {
    display: block;
    color: #dc3545;
    margin-top: 5px;
    font-size: 12px;
    font-weight: bold;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

