/**
 * SLM 系统主样式
 * 兼容老旧浏览器，使用传统CSS语法
 */

/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, "Microsoft YaHei", "SimHei", sans-serif;
  font-size: 18px; /* 大字体 */
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.slm-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 200px;
}

/* ========== 按钮样式 ========== */
.slm-btn {
  display: inline-block;
  padding: 16px 32px; /* 大按钮 */
  font-size: 20px; /* 大字体 */
  font-weight: bold;
  text-align: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
  min-height: 56px;
}

.slm-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slm-btn:active {
  transform: translateY(0);
}

.slm-btn-primary {
  background-color: #1890ff;
  color: #fff;
}

.slm-btn-secondary {
  background-color: #6c757d;
  color: #fff;
}

.slm-btn-success {
  background-color: #52c41a;
  color: #fff;
}

.slm-btn-danger {
  background-color: #ff4d4f;
  color: #fff;
}

.slm-btn-disabled {
  background-color: #d9d9d9;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.slm-btn-disabled:hover {
  transform: none;
  box-shadow: none;
}

.slm-btn-large {
  padding: 16px 32px;
  font-size: 20px;
}

.slm-btn-medium {
  padding: 12px 24px;
  font-size: 18px;
  min-height: 48px;
}

.slm-btn-small {
  padding: 8px 16px;
  font-size: 16px;
  min-height: 40px;
}

/* ========== 卡片样式 ========== */
.slm-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.slm-card-header {
  padding: 20px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #fafafa;
}

.slm-card-title {
  font-size: 24px; /* 大字体 */
  font-weight: bold;
  color: #333;
  margin: 0;
}

.slm-card-body {
  padding: 20px;
  font-size: 18px; /* 大字体 */
}

/* ========== 告警样式 ========== */
.slm-alert-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.slm-alert {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 18px; /* 大字体 */
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
}

.slm-alert-show {
  opacity: 1;
  transform: translateX(0);
}

.slm-alert-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.slm-alert-message {
  flex: 1;
  word-break: break-word;
}

.slm-alert-close {
  font-size: 24px;
  line-height: 1;
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.6;
  flex-shrink: 0;
}

.slm-alert-close:hover {
  opacity: 1;
}

.slm-alert-info {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #0050b3;
}

.slm-alert-info .slm-alert-icon {
  background-color: #1890ff;
}

.slm-alert-success {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
  color: #135200;
}

.slm-alert-success .slm-alert-icon {
  background-color: #52c41a;
}

.slm-alert-warning {
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
  color: #613400;
}

.slm-alert-warning .slm-alert-icon {
  background-color: #faad14;
}

.slm-alert-error {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  color: #820014;
}

.slm-alert-error .slm-alert-icon {
  background-color: #ff4d4f;
}

/* ========== 签到页面样式 ========== */
.slm-signin-container {
  text-align: center;
  padding: 40px 20px;
}

.slm-signin-info {
  margin: 30px 0;
}

.slm-signin-days {
  font-size: 48px; /* 超大字体 */
  font-weight: bold;
  color: #1890ff;
  margin: 20px 0;
}

.slm-signin-label {
  font-size: 20px;
  color: #666;
  margin: 10px 0;
}

.slm-signin-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 30px 0;
}

.slm-signin-stat-item {
  text-align: center;
}

.slm-signin-stat-value {
  font-size: 36px; /* 大数字 */
  font-weight: bold;
  color: #333;
}

.slm-signin-stat-label {
  font-size: 18px;
  color: #999;
  margin-top: 8px;
}

.slm-user-info {
  background: #f0f0f0;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  font-size: 16px;
  color: #666;
}

/* ========== 设置弹窗样式 ========== */
.slm-settings-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slm-settings-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  min-width: 400px;
  max-width: 90%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slm-settings-overlay.show {
  opacity: 1;
}

.slm-settings-dialog.show {
  opacity: 1;
}

.slm-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e8e8e8;
  background-color: #fafafa;
  border-radius: 8px 8px 0 0;
}

.slm-settings-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

.slm-settings-close {
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.slm-settings-close:hover {
  color: #333;
  background-color: #f0f0f0;
}

.slm-settings-body {
  padding: 20px;
}

.slm-settings-group {
  margin-bottom: 20px;
}

.slm-settings-group:last-child {
  margin-bottom: 0;
}

.slm-settings-label {
  display: block;
  font-size: 18px;
  color: #333;
  margin-bottom: 10px;
  font-weight: bold;
}

.slm-settings-input {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  outline: none;
  transition: all 0.3s ease;
}

.slm-settings-input:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.slm-settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e8e8e8;
  border-radius: 0 0 8px 8px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .slm-btn {
    padding: 14px 28px;
    font-size: 18px;
    min-height: 52px;
  }

  .slm-card-title {
    font-size: 20px;
  }

  .slm-signin-days {
    font-size: 36px;
  }

  .slm-signin-stats {
    flex-direction: column;
    gap: 20px;
  }

  .slm-alert-container {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .slm-settings-dialog {
    min-width: 300px;
    max-width: 95%;
  }

  .slm-settings-header h3 {
    font-size: 20px;
  }

  .slm-settings-body {
    padding: 16px;
  }

  .slm-settings-footer {
    flex-direction: column;
  }

  .slm-settings-footer .slm-btn {
    width: 100%;
  }
}

/* ========== 通用工具类 ========== */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.p-20 {
  padding: 20px;
}

/* ========== 闪烁提醒样式 ========== */
.slm-reminder-flash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 0, 0, 0.85);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background-color 0.3s ease;
}

.slm-reminder-text {
  text-align: center;
  color: #ffffff;
  font-size: 48px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  animation: pulse 0.5s ease-in-out infinite alternate;
}

.slm-reminder-title {
  font-size: 72px;
  display: block;
  margin-bottom: 20px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

.slm-reminder-title {
  cursor: pointer !important;
  user-select: none;
  transition: transform 0.2s ease;
}

.slm-reminder-title:hover {
  transform: scale(1.05);
}
