/* 全局样式 */
* {
  box-sizing: border-box;
}

/* 强制设置根元素背景 */
:root {
  background: #f0f2f5 !important;
}

html {
  background: #f0f2f5 !important;
  min-height: 100vh;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0 !important;
  padding: 0 !important;
  background: #f0f2f5 !important;
  min-height: 100vh;
  width: 100%;
}

/* 后台管理系统样式 */
.admin-layout,
.admin-login {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  z-index: 9999 !important;
}

/* 后台管理系统覆盖全局背景 */
body.admin-body {
  background: #f0f2f5 !important;
  overflow: hidden;
}

/* 页面头部样式 */
.page-header {
  text-align: center;
  padding: 60px 20px 30px;
  background: linear-gradient(135deg, #e53e3e 0%, #ff6b6b 100%);
  color: white;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="pattern" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23pattern)"/></svg>');
  pointer-events: none;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-subtitle {
  font-size: 16px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* 通用按钮样式 */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #e53e3e, #ff6b6b);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-secondary {
  background: #f8f9fa;
  color: #666;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
  background: #e9ecef;
  border-color: #ccc;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

/* 通用模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 18px;
}

.modal-content p {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.5;
  font-size: 14px;
}

/* 容器样式 */
.container {
  width: 100%;
  position: relative;
}

/* 主页特殊容器 */
.home-container {
  background: #f0f2f5;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 各页面容器 */
.lottery-container,
.profile-container,
.login-page-container,
.register-page-container {
  background: #f0f2f5;
  position: relative;
  padding: 0;
  flex: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .page-header {
    padding: 20px 15px 15px;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  .page-subtitle {
    font-size: 13px;
  }
  
  .modal-content {
    padding: 25px 20px;
  }
  
  .lottery-container,
  .profile-container,
  .login-page-container,
  .register-page-container {
    padding: 0 15px;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误提示样式 */
.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  border-left: 4px solid #e53e3e;
}

/* 成功提示样式 */
.success-message {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 15px;
  border-left: 4px solid #4caf50;
}

/* 隐藏子页面顶部背景图的浮动元素 */
.page-header-modern::before {
  display: none !important;
}

/* 移除所有链接的选中效果 */
a, a:link, a:visited, a:hover, a:active, a:focus {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  outline: none !important;
}

/* 移除所有元素的tap高亮效果 */
* {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
}

/* 特别针对协议链接 */
.terms-link,
.terms-link:link,
.terms-link:visited,
.terms-link:hover,
.terms-link:active,
.terms-link:focus {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  outline: none !important;
  background: transparent !important;
  background-color: transparent !important;
} 