.member-rules-page {
  width: 100%;
  min-height: 100vh;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
}

/* 顶部 Header */
.rules-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #8b2632 0%, #5d1a22 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 38, 50, 0.18);
}

.rules-header .back-btn,
.rules-header .reload-btn {
  width: 36px;
  height: 36px;
  color: #fff !important;
  font-size: 18px;
  border: none;
  background: transparent !important;
}

.rules-header .back-btn:hover,
.rules-header .reload-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
}

.rules-title {
  flex: 1;
  margin: 0 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
}

/* 提示工具栏 */
.rules-toolbar {
  padding: 10px 16px;
  background: #fff7ed;
  border-bottom: 1px solid #fde0c4;
  font-size: 12px;
  color: #ad6800;
  text-align: center;
}

.rules-toolbar-tip {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.toolbar-link {
  color: #8b2632;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.toolbar-link:hover {
  opacity: 0.85;
}

/* PDF 预览容器 */
.rules-viewer {
  flex: 1;
  margin: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  min-height: calc(100vh - 220px);
  display: flex;
}

.rules-iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 220px);
  border: none;
  background: #fff;
}

/* 兜底视图 */
.rules-fallback {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 24px;
  text-align: center;
}

.fallback-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.55;
}

.fallback-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
}

.fallback-desc {
  font-size: 14px;
  color: #888;
  margin: 0 0 24px;
  line-height: 1.6;
  max-width: 320px;
}

.fallback-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 底部操作 */
.rules-actions {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
}

.rules-actions .ant-btn {
  height: 44px;
  font-size: 15px;
  border-radius: 8px;
}

.rules-actions .ant-btn-primary {
  background: #8b2632;
  border-color: #8b2632;
}

.rules-actions .ant-btn-primary:hover {
  background: #a32a39 !important;
  border-color: #a32a39 !important;
}

/* iPhone 安全区域 */
@supports (padding: max(0px)) {
  .rules-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* 大屏适配 */
@media screen and (min-width: 768px) {
  .rules-viewer {
    margin: 16px auto;
    max-width: 960px;
    width: calc(100% - 32px);
  }

  .rules-title {
    font-size: 20px;
  }
}
