/* 弹窗、对话框、卡组编辑器相关样式 */
#mulligan-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

#mulligan-inner {
  background: #fff;
  padding: 32px 24px;
  border-radius: 12px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  text-align: center;
}

#mulligan-waiting {
  margin-top: 12px;
  color: #888;
}

.modal {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
  display: flex;
}

.modal-inner {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  min-width: 320px;
  max-width: 1050px;
  max-height: 90vh;
  overflow: auto;
}

.deck-dialog {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck-dialog-inner {
  background: #fff;
  padding: 32px;
  border-radius: 12px;
  text-align: center;
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}

.deck-dialog-empty {
  margin: 16px;
  color: #888;
  font-size: 16px;
}

.deck-dialog-btn-wrap {
  display: inline-block;
  margin: 4px;
}

.deck-dialog-btn {
  margin: 8px;
  padding: 8px 18px;
  font-size: 16px;
  border-radius: 6px;
  border: 1.5px solid #0078d7;
  background: #f0f4ff;
  color: #0078d7;
  cursor: pointer;
  transition: background 0.2s;
}

.deck-dialog-btn:hover {
  background: #e3eaff;
}

.deck-dialog-del-btn {
  margin: 8px;
  padding: 8px 14px;
  font-size: 15px;
  color: #fff;
  background: #d9534f;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.deck-dialog-del-btn:hover {
  background: #b52a26;
}

.deck-dialog-cancel-btn {
  margin: 16px;
  padding: 8px 24px;
  font-size: 16px;
  border-radius: 6px;
  border: 1.5px solid #bbb;
  background: #f8f8ff;
  color: #333;
  cursor: pointer;
  transition: background 0.2s;
}

.deck-dialog-cancel-btn:hover {
  background: #e3eaff;
}

.select-inner {
  min-width: 320px;
  max-width: 90vw;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px #b3cfff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.select-title {
  margin-bottom: 10px;
  font-size: 22px;
  text-align: center;
}

.select-desc {
  margin-bottom: 12px;
  color: #666;
  text-align: center;
}

.select-list {
  margin-bottom: 10px;
  overflow: auto;
}

.select-btn {
  font-size: 18px;
  padding: 4px;
  border-radius: 8px;
  background: #f0f4ff;
  color: #333;
  border: 1.5px solid #b3cfff;
  box-shadow: 0 2px 8px #e3eaff;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 0;
  min-width: 80px;
}

.select-btn:hover {
  background: #e3eaff;
}

.select-btn.selected {
  background: #0078d7;
  color: #fff;
  border-color: #005fa3;
  box-shadow: 0 2px 8px #b3cfff;
}

.select-card {
  display: flex;
  width: 140px;
  border-radius: 16px;
  clip-path: inset(3px 3px 3px 3px);
}

/* 将领排序弹窗样式 */
.order-modal {
  z-index: 3000;
}

.order-inner {
  background: #fff;
  padding: 24px;
  border-radius: 10px;
  min-width: 320px;
  max-width: 90vw;
  box-shadow: 0 4px 16px #b3cfff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.order-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 12px 0 0 0;
}

.order-general-card {
  display: inline-block;
  text-align: center;
  cursor: grab;
  user-select: none;
  border: 2px solid #bbb;
  border-radius: 8px;
  background: #f8faff;
  margin: 0 4px;
  padding: 4px 6px;
  transition: border 0.2s, box-shadow 0.2s;
}

.order-general-card.drag-over {
  border-color: #0078d7;
  box-shadow: 0 0 8px #b3cfff;
}

.order-general-img {
  width: 48px;
  height: 68px;
  border-radius: 6px;
  display: block;
  margin: auto;
}

.order-general-name {
  font-size: 14px;
  margin-top: 2px;
}

.order-btn-group {
  margin-top: 18px;
  text-align: center;
}

.order-confirm-btn {
  font-size: 18px;
  padding: 8px 32px;
  border-radius: 8px;
  background: #0078d7;
  color: #fff;
  border: none;
  margin-right: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.order-confirm-btn:hover {
  background: #005fa3;
}

.order-cancel-btn {
  font-size: 18px;
  padding: 8px 24px;
  border-radius: 8px;
  background: #eee;
  color: #333;
  border: 1px solid #bbb;
  cursor: pointer;
  transition: background 0.2s;
}

.order-cancel-btn:hover {
  background: #e3eaff;
}

.card-span {
  display: inline-block;
  position: relative;
  margin: 2px;
}

.card-ui-img {
  width: 5.6vh;
  height: 8vh;
  border-radius: 5px;
  border: 1px solid #bbb;
}

.card-count {
  position: absolute;
  left: 2px;
  bottom: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 13px;
  padding: 0 4px;
  border-radius: 3px;
}

.generals-list {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 8px;
}

/* 按钮样式 */
.modal-btn-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* .primary-btn {
  font-size: 16px;
  padding: 10px 24px;
  border-radius: 6px;
  background: #0078d7;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
} */

.primary-btn:hover {
  background: #005fa3;
}

.primary-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.5;
}

/* .secondary-btn {
  font-size: 16px;
  padding: 10px 24px;
  border-radius: 6px;
  background: #f8f8ff;
  color: #333;
  border: 1.5px solid #bbb;
  cursor: pointer;
  transition: background 0.2s;
} */

.secondary-btn:hover {
  background: #e3eaff;
}

.secondary-btn:disabled {
  background: #f0f0f0;
  color: #999;
  cursor: not-allowed;
}

/* 玩家列表样式 */
#player-list-container {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
}

#player-list {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

.player-item {
  transition: background-color 0.2s;
}

.player-item:hover {
  background-color: #f8f9fa;
}

.player-item:last-child {
  border-bottom: none;
}

/* 卡组广场样式 */
.deck-library-inner {
  width: 90%;
  position: relative;
}

#open-filter-btn {
  position: absolute;
  right: 0;
  top: 0;
}

/* 卡组广场筛选区域样式 */
.deck-library-filter {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.filter-section {
  margin-bottom: 16px;
}

.filter-section label {
  display: block;
  font-weight: bold;
  margin-bottom: 12px;
  color: #333;
}

.general-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.general-filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.general-filter-item:hover {
  background: #e9ecef;
  border-color: #0078d7;
}

.general-filter-item.selected {
  background: #0078d7;
  color: white;
  border-color: #0078d7;
}

.general-filter-item img {
  width: 24px;
  height: 34px;
  border-radius: 2px;
  border: 1px solid #ddd;
}

.general-filter-item.selected img {
  border-color: white;
}

.filter-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.filter-result-info {
  text-align: center;
  padding: 12px;
  background: #e3f2fd;
  border: 1px solid #2196f3;
  border-radius: 4px;
  color: #1976d2;
  font-weight: bold;
  margin-bottom: 16px;
}

#deck-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 16px 0;
  max-height: 60vh;
  overflow-y: auto;
}

.deck-library-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  background: #f9f9f9;
  cursor: pointer;
  transition: all 0.2s;
}

.deck-library-item:hover {
  border-color: #0078d7;
  background: #f0f4ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.deck-library-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.deck-library-item-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.deck-library-item-stats {
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.deck-library-item-generals {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.deck-library-general-img {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.deck-library-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #666;
}

/* 卡组详情样式 */
.deck-detail-inner {
  width: 90%;
  position: relative;
}

#deck-detail-actions {
  position: absolute;
  right: 5%;
}

.deck-detail-generals-list {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}

.deck-detail-card-count {
  position: absolute;
  background: #0078d7;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

#comments-list {
  overflow-y: auto;
  margin-bottom: 16px;
  flex: 1;
}

.comment-item {
  border-bottom: 1px solid #eee;
  padding: 12px 0;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: bold;
  color: #333;
}

.comment-time {
  font-size: 12px;
  color: #999;
}

.comment-content {
  color: #666;
  line-height: 1.4;
  text-align: left;
}

#comment-input {
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  resize: vertical;
  margin-bottom: 8px;
  font-family: inherit;
}

#submit-comment-btn {
  margin-top: 8px;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.like-btn.liked {
  background: #ff4757;
  color: white;
}

.like-btn.liked:hover {
  background: #ff3742;
}

/* 新的卡组详情布局样式 */
#deck-detail-content {
  display: flex;
  gap: 20px;
}

#deck-detail-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min-content;
}

#deck-detail-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 将领部分样式调整 */
.deck-detail-general-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.deck-detail-general-img {
  width: 8.7vh;
  height: 12vh;
  object-fit: cover;
  border-radius: 4px;
  border: 2px solid #0078d7;
  margin-bottom: 4px;
}

/* 卡牌部分样式调整 */
.deck-detail-cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin: 15px;
}

.deck-detail-card-img {
  width: 8.7vh;
  height: 12vh;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #0078d7;
}

.deck-detail-card-count {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #0078d7;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* 评论部分样式调整 */
#deck-detail-comments {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}

#copy-deck-btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
}