/* =========================
   通用页面容器
========================= */
.page-container {
  width: 100%;
  max-width: 1200px; /* 根据页面需求限制最大宽度 */
  margin: 10px auto;
  padding: 0 0px; /* 左右间隙 */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
}

/* =========================
     高级顶部 Tab
  ========================= */
.tab-wrapper {
  margin-top: 40px;
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
}

.tab-group {
  position: relative;
  display: flex;
  background: #e5e7eb;
  border-radius: 999px;
  margin-top: 40px;
  padding: 4px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.tab-item {
  position: relative;
  z-index: 2;
  min-width: 140px;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s ease;
}

.tab-item.active {
  color: #0f172a;
}

/* 滑动指示块 */
.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 140px;
  height: calc(100% - 8px);
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease;
}

.tab-indicator.right {
  transform: translateX(140px);
}

/* =========================
     卡片样式（通用） 
  ========================= */
.card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin: 0 auto 16px;
  box-sizing: border-box;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
}

/* =========================
     表单控件
  ========================= */
.form-item {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-item label {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 6px;
}

.form-item input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0 12px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-item input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* 代币切换 */
.label-token-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.token-switch-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid #3b82f6;
  background: #ffffff;
  color: #3b82f6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.token-switch-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}

/* =========================
     按钮
  ========================= */
.btn {
  width: 100%;
  height: 44px;
  font-size: 15px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

/* =========================
     订单 & 历史记录
  ========================= */
.order-block {
  margin: 0 auto;
  padding: 0 0px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.order-block h3 {
  font-size: 15px;
  margin-top: 16px;
  color: #334155;
}

.order-item {
  background: #ffffff; /* 与 roomlist-card 一致 */
  border-radius: 14px;
  padding: 16px;

  font-size: 13px;
  color: #334155;

  display: flex;
  flex-direction: column;
  gap: 6px;

  /* ⭐ 统一边框 + 阴影 */
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);

  transition: all 0.2s ease;
}

.cancel-btn {
  margin-top: 10px;
  align-self: flex-end;
  background: #ef4444;
  border: none;
  color: white;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* =========================
     房间列表 / 我的房间
  ========================= */
.roomlist-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roomlist-card {
  position: relative;
  display: block;

  background-image:
    linear-gradient(
      180deg,
      rgba(52, 152, 219, 0.75) 0%,
      rgba(58, 123, 229, 0.75) 50%,
      rgba(41, 128, 185, 0.75) 100%
    ),
    url("/images/card-bg.png");

  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;

  border-radius: 14px;
  padding: 16px;
  border: none;

  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.4),
    0 4px 6px rgba(0, 0, 0, 0.1);

  transition: all 0.25s ease;
}

.roomlist-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.roomlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roomlist-title {
  font-size: 18px;
  font-weight: 700;
}

.roomlist-status {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
}

.status-open {
  background: #3b82f6;
}
.status-full {
  background: #ef4444;
}
.status-settled {
  background: #22c55e;
}
.status-expired {
  background: #6b7280;
}

.roomlist-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  grid-row-gap: 6px;
  row-gap: 6px;
  margin-top: 12px;
  font-size: 14px;
}

.label {
  color: #ffffff;
}
.value {
  color: #ffffff;
  word-break: break-all;
}

/* 分页按钮 */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.pager button {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  background: #fff;
}

.pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================
     房间详情
  ========================= */
/* =========================
     房间详情
  ========================= */
/* =========================
   通用页面容器
========================= */
.page-container {
  width: 100%;
  max-width: 1200px;
  margin: 10px auto;
  padding: 0 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
}

/* =========================
   房间详情
========================= */
.room-page-card {
  width: 100%;
  max-width: 520px;
  margin: 80px auto 40px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(11, 35, 57, 0.08);
  padding: 24px;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .room-page-card {
    margin: 72px auto 24px;
    max-width: calc(100% - 32px);
    padding: 20px;
  }
}

/* =========================
   房间 Meta 信息（关键）
========================= */
.room-meta {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 8px 12px;
  gap: 8px 12px;
  font-size: 13px;
  color: #475569;
}

/* 创建者：始终独占一行 */
.meta-owner {
  grid-column: 1 / -1;
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
  word-break: break-all;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e5e7eb;
  margin-bottom: 6px;
}

/* =========================
   手机端重排（彻底解决溢出）
========================= */
/* @media (max-width: 640px) {
  .room-meta {
    grid-template-columns: 88px 1fr;
    row-gap: 10px;
  }

  .room-meta > div {
    display: contents;
  }

  .room-meta > div::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 12px;
  }
} */

/* =========================
   其余保持原样
========================= */
.players {
  margin-top: 16px;
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.player-item {
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: #0f172a;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-direction: column;
}

.winners-list {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.winner-item {
  background: linear-gradient(90deg, #fff7ed, #ffedd5);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: #92400e;
}

.winner-me {
  border: 1px solid #10b981;
}

.muted {
  color: #94a3b8;
}

/* 返回按钮 */
.back-btn {
  /* position: fixed; */
  top: 80px;
  left: 16px;
  z-index: 99999;
  padding: 8px 14px;
  font-size: 16px;
  background: rgba(50, 112, 77, 0.85);
  border: 1px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.back-btn:hover {
  background: rgb(55, 107, 68);
  transform: translateX(-3px);
}

.room-title {
  margin: 0 0 16px 0;
  font-size: 20px;
}
h2.room-title {
  color: #10b981;
}
h3 {
  color: #10b981;
}
.result {
  margin-top: 16px;
  margin-bottom: 16px;
}

/* =========================
     加载、空状态
  ========================= */
.roomlist-loading,
.roomlist-empty {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 15px;
}

.roomlist-link {
  text-decoration: none;
  color: inherit; /* 非常重要 */
}

.roomlist-link:hover {
  text-decoration: none;
}

.create-room-action {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  margin-bottom: 32px; /* 和下方区域的间距 */
}

.btn-create {
  width: 20%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);

  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;

  cursor: pointer;
  color: #ffffff;

  background: linear-gradient(135deg, #16a34a 0%, #22c55e 45%, #4ade80 100%);

  box-shadow:
    0 10px 28px rgba(34, 197, 94, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);

  transition: all 0.25s ease;
}

/* hover */
.btn-create:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 36px rgba(34, 197, 94, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* disabled 通用态 */
.btn-create:disabled,
.btn-create.loading {
  cursor: not-allowed;
  opacity: 0.6;

  background: linear-gradient(135deg, #14532d, #166534);

  box-shadow: none;
  transform: none;
}

/* 已确认 */
.btn-create.success {
  background: linear-gradient(135deg, #22c55e, #86efac);

  box-shadow: 0 12px 32px rgba(34, 197, 94, 0.6);
}

/* 失败 */
.btn-create.error {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);

  box-shadow: 0 10px 28px rgba(220, 38, 38, 0.4);
}

/* =========================
   房间排序选择器（高级版）
========================= */
.roomlist-sort {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.roomlist-sort button {
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

/* hover（未选中） */
.roomlist-sort button:hover:not(.active) {
  color: #334155;
}

/* 选中态 */
.roomlist-sort button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 点击反馈 */
.roomlist-sort button:active {
  transform: scale(0.97);
}

/* =========================
   房间 Ribbon（丝带标签）
========================= */
.room-ribbon {
  position: absolute;
  top: 12px;
  left: -8px;

  padding: 6px 18px 6px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;

  /* 渐变色，让丝带更高级 */
  background: linear-gradient(135deg, #3498db, #8b5cf6);

  border-radius: 4px;
  z-index: 2;
}

/* 左下角折角 */
.room-ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;

  width: 0;
  height: 0;
  border-top: 8px solid #5b2c6f; /* 渐深色 */
  border-left: 8px solid transparent;
}

/* =========================
   房间背景色  上边线
========================= */
.roomlist-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 14px;

  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0) 60%
  );
  pointer-events: none;
}

