* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
}

.hidden {
  display: none !important;
}

/* 登录页 */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  width: 380px;
}

.login-box h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 30px;
  color: #333;
}

/* 表单 */
.form-item {
  margin-bottom: 18px;
}

.form-item label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #555;
}

.form-item input,
.form-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-item input:focus,
.form-item select:focus {
  border-color: #667eea;
}

.form-item input:disabled {
  background: #f5f5f5;
  color: #999;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.btn-text {
  border: none;
  background: transparent;
  color: #fff;
  text-decoration: underline;
}

.btn-small {
  padding: 5px 12px;
  font-size: 13px;
}

/* 头部 */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #667eea;
  color: #fff;
  padding: 14px 30px;
}

.header h2 {
  font-size: 18px;
  font-weight: 600;
}

/* 容器和卡片 */
.container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h3 {
  font-size: 16px;
  margin-bottom: 18px;
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}

.search-bar input:focus {
  border-color: #667eea;
}

/* 推送方式列 */
.push-cell {
  white-space: nowrap;
}

.push-row {
  display: grid;
  grid-template-columns: 64px 22px;
  gap: 4px;
  align-items: center;
  line-height: 22px;
}

.push-label {
  text-align: left;
}

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

/* 表格 */
#user-result {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.user-table th,
.user-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.user-table th {
  background: #fafafa;
  color: #666;
  font-weight: 600;
}

.empty-tip {
  text-align: center;
  color: #999;
  padding: 30px 0;
  font-size: 14px;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 28px;
  width: 400px;
}

.modal h3 {
  font-size: 17px;
  margin-bottom: 20px;
}

.type-toggle {
  display: flex;
  gap: 12px;
}

.type-btn {
  flex: 1;
  padding: 10px 0;
}

.type-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.points-preview {
  background: #fafafa;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  color: #555;
}

.preview-row {
  line-height: 26px;
}

.preview-row span {
  font-weight: 600;
  color: #667eea;
}

.preview-row-after {
  color: #faad14;
}

.preview-row-after span {
  color: #ff4d4f;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 999;
}

.toast.success {
  background: #52c41a;
}

.toast.error {
  background: #ff4d4f;
}

/* 手机端适配 */
@media (max-width: 600px) {
  /* 登录页 */
  #login-page {
    padding: 16px;
  }

  .login-box {
    width: 100%;
    max-width: 380px;
    padding: 28px 20px;
  }

  .login-box h1 {
    font-size: 19px;
    margin-bottom: 24px;
  }

  /* 头部 */
  .header {
    padding: 12px 16px;
  }

  .header h2 {
    font-size: 16px;
  }

  /* 容器和卡片 */
  .container {
    margin: 16px auto;
    padding: 0 12px;
  }

  .card {
    padding: 16px 14px;
    border-radius: 8px;
  }

  /* 搜索栏：改为上下堆叠 */
  .search-bar {
    flex-direction: column;
    gap: 10px;
  }

  .search-bar input {
    width: 100%;
    font-size: 16px;
  }

  .search-bar .btn {
    width: 100%;
    padding: 12px;
  }

  /* 表格 */
  .user-table {
    font-size: 13px;
  }

  .user-table th,
  .user-table td {
    padding: 10px 8px;
  }

  /* 弹窗 */
  .modal-mask {
    align-items: center;
    padding: 16px;
  }

  .modal {
    width: 100%;
    max-width: 380px;
    border-radius: 10px;
    padding: 24px 20px;
    margin: auto;
  }

  .modal h3 {
    font-size: 16px;
  }

  /* 防止 iOS 输入框自动缩放 */
  .form-item input,
  .form-item select {
    font-size: 16px;
  }

  .modal-actions .btn {
    flex: 1;
    padding: 12px;
  }

  /* Toast */
  .toast {
    width: calc(100% - 48px);
    text-align: center;
    box-sizing: border-box;
  }
}
