* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #f5f5f7;  /* 苹果浅灰背景 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1c1c1e;
  line-height: 1.4;
  padding: 24px 20px;
}

/* 主容器——优雅居中 */
.app-container {
  max-width: 1300px;
  margin: 0 auto;
}

/* 全局卡片风格：大圆角、柔和阴影、白色基底 */
.card, #hall, #roomArea, #claimArea, #hallChatBox, .auth-card, .create-card, .room-list-card {
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0px 10px rgba(0, 0, 0, 0.05);
  padding: 1.5rem 1.8rem;
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

/* 紧凑卡片内边距可微调 */
#claimArea {
  background: #fff9f0;
  border-left: 5px solid #ff9f0a;
  padding: 1.2rem 1.8rem;
}

/* 标题风格 */
h3, h4 {
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 1rem;
  color: #1c1c1e;
}

h3 {
  font-size: 1.65rem;
  background: linear-gradient(135deg, #1c1c1e, #3a3a3e);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
}

h4 {
  font-size: 1.25rem;
  border-left: 4px solid #007aff;
  padding-left: 12px;
  margin-top: 6px;
  margin-bottom: 1.2rem;
}

/* 按钮系统 —— 苹果风圆角 + 灵动反馈 */
button {
  background-color: #007aff;
  border: none;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  letter-spacing: -0.2px;
}

button:hover {
  background-color: #005fc1;
  transform: scale(0.97);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: scale(0.96);
}

/* 次要按钮（灰色） */
.btn-secondary, #btnCancelReady, #btnLeaveRoom, #btnRefreshRooms, #btnEndWait {
  background-color: #6c6c70;
}

.btn-secondary:hover, #btnCancelReady:hover, #btnLeaveRoom:hover, #btnRefreshRooms:hover {
  background-color: #4a4a4e;
}

/* 警示/危险按钮 */
.btn-danger, #btnLeaveRoom {
  background-color: #ff3b30;
}
.btn-danger:hover, #btnLeaveRoom:hover {
  background-color: #d70015;
}

/* 成功绿按钮（开始游戏） */
#btnStartGame {
  background-color: #34c759;
}
#btnStartGame:hover {
  background-color: #28a745;
}

/* 输入框与选择框 */
input, select {
  background-color: #f9f9fb;
  border: 1px solid #e5e5ea;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: 0.15s;
  outline: none;
  width: auto;
  color: #1c1c1e;
}

input:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
  background-color: white;
}

/* 复选框与标签行 */
label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 20px;
  font-size: 0.85rem;
  color: #3a3a3e;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  accent-color: #007aff;
  margin: 0;
}

/* 认证区域 flex 布局 */
.auth-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#authPhone, #authCode, #authUsername, #authPassword {
  flex: 1;
  min-width: 160px;
}

#loginStatus {
  background: #e9f5ff;
  border-radius: 40px;
  padding: 6px 14px;
  font-size: 0.85rem;
  display: inline-block;
}

/* 房间列表与成员列表卡片样式 */
.room-item, .member-item {
  background: #f8f8fc;
  border-radius: 20px;
  padding: 10px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.1s;
  border: 1px solid #efeff4;
}

.room-item:hover, .member-item:hover {
  background: #f1f1f6;
  transform: translateY(-1px);
}

.room-info, .member-name {
  font-weight: 500;
}

.room-status {
  font-size: 0.75rem;
  background: #e5e5ea;
  padding: 4px 8px;
  border-radius: 30px;
  color: #3a3a3e;
}

/* 聊天区域圆润处理 */
.chat-message {
  padding: 5px 10px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: #f2f2f6;
  max-width: 85%;
  width: fit-content;
  font-size: 0.85rem;
  word-break: break-word;
}

.chat-message strong {
  color: #007aff;
  font-weight: 600;
}

#hallChatContent, #chatContent {
  background: #fafafc;
  border-radius: 20px;
  padding: 12px;
  height: 200px;
  overflow-y: auto;
  border: 1px solid #efeff4;
}

#chatInput, #hallChatInput {
  border-radius: 30px;
  background: white;
  margin-top: 8px;
  flex: 1;
}

.chat-send-area {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* 手牌区域（麻将牌样式） */
#myHand {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 20px;
  background: #fef7e8;
  border-radius: 28px;
  padding: 16px;
  min-height: 110px;
}

/* 模拟麻将牌样式 (适配动态生成的牌块) */
#myHand .tile, #myHand button, #myHand div[class*="tile"], #myHand span {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  width: 60px;
  height: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  color: #2c2c2e;
  transition: 0.1s ease;
  cursor: pointer;
  border: 1px solid #e9e9ef;
  background: #ffffff;
  flex-direction: column;
}

#myHand .tile:hover, #myHand button:hover {
  transform: translateY(-5px);
  background: #ffffff;
  border-color: #007aff;
  box-shadow: 0 10px 18px rgba(0, 122, 255, 0.2);
}

/* 游戏信息栏 */
.game-info-bar {
  background: #f0f2f8;
  border-radius: 32px;
  padding: 12px 18px;
  margin: 15px 0;
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}

#wallCount, #currentTurn {
  background: white;
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.85rem;
  margin-left: 6px;
}

/* 抢杠区计时器 */
#claimTimer {
  background: #1c1c1e;
  color: white;
  padding: 4px 12px;
  border-radius: 60px;
  font-size: 0.8rem;
  margin-left: 12px;
}

/* 癞子信息栏 */
#laiziInfo {
  background: #eef5ff;
  border-radius: 28px;
  padding: 8px 16px;
  font-weight: 500;
  border: none;
  color: #0051a1;
}

/* 房间成员区域网格 */
#memberList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

/* 按钮组合响应式 */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

/* 创建房间选项行 */
.create-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 16px 0;
  align-items: center;
}

/* 分隔线 */
hr {
  margin: 16px 0;
  border: 0;
  height: 1px;
  background: linear-gradient(to right, #e9e9ef, transparent);
}

/* 状态条 */
#status {
  background: #fff5e6;
  border-radius: 32px;
  padding: 8px 18px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  color: #b45309;
  border-left: 5px solid #ff9f0a;
}

/* 禁用按钮样式 */
button:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}

/* 滚动条苹果风 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #e9e9ef;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: #c6c6c8;
  border-radius: 10px;
}

/* 响应式 */
@media (max-width: 720px) {
  body {
    padding: 16px;
  }
  .card, #hall, #roomArea, #claimArea {
    padding: 1rem;
  }
  #myHand .tile, #myHand button {
    width: 48px;
    height: 64px;
    font-size: 1rem;
  }
  button {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
}

/* 页尾（Footer）样式 —— 左对齐、简洁美观 */
footer.site-footer{
  color: #6c6c70;
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 14px 20px;
  border-top: 1px solid #efeff4;
  background: transparent;
}

/* 内部内容对齐到页面主容器宽度并左对齐 */
footer.site-footer .footer-inner{
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

footer.site-footer a{
  color: #6c6c70;
  text-decoration: none;
}

footer.site-footer .brand{
  font-weight: 600;
  color: #606060;
}

footer.site-footer .beian{
  font-size: 0.85rem;
  color: #8e8e93;
}

@media (max-width:720px){
  footer.site-footer{
    padding: 12px 14px;
    font-size: 0.85rem;
  }
  footer.site-footer .footer-inner{
    padding: 0 6px;
  }
}
