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

body {
  background: linear-gradient(145deg, #f4f7fb 0%, #dfe9f3 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
  padding: 18px;
}

.card {
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 42px;
  box-shadow: 0 20px 40px rgba(0, 10, 30, 0.12);
  padding: 26px 24px 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

/* 状态栏 */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 16px;
  background: rgba(240, 248, 255, 0.6);
  border-radius: 30px;
  font-size: 0.9rem;
}

.status-spacer {
  flex: 1;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ccc;
  transition: all 0.3s;
}

.status-dot.online { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.status-dot.offline { background: #f44336; }
.status-dot.syncing { background: #ff9800; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 用户切换区 */
.user-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}

.nickname-area {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(230, 242, 255, 0.5);
  padding: 5px 15px 5px 18px;
  border-radius: 40px;
  flex: 1;
  border: 1px solid rgba(140, 180, 220, 0.2);
}

.nickname-area label {
  font-weight: 600;
  color: #1e3b5c;
  font-size: 1rem;
}

#nicknameInput {
  border: none;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 500;
  color: #0a2a44;
  flex: 1;
  outline: none;
  border-bottom: 2px dashed #6f9bc1;
  padding: 4px 0;
  transition: border 0.15s;
}

#nicknameInput:focus {
  border-bottom: 2px solid #1f6390;
}

#nicknameInput:disabled {
  opacity: 0.6;
}

/* 总打卡 */
.total-checkins {
  background: #1e4f7a;
  padding: 8px 22px;
  border-radius: 40px;
  color: white;
  font-weight: 600;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
  box-shadow: 0 6px 12px rgba(20, 60, 100, 0.2);
}

#totalDaysDisplay {
  font-size: 1.8rem;
  font-weight: 800;
}

/* 日历头部 */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 20px;
  padding: 0 4px;
}

.month-year {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#yearSelect {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1e2f4d;
  background: transparent;
  border: none;
  border-bottom: 2px solid #a0bedd;
  padding: 2px 8px;
  outline: none;
  cursor: pointer;
}

#yearSelect:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#monthDisplay {
  font-size: 1.9rem;
  font-weight: 600;
  color: #1e2f4d;
}

.nav-buttons {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 30px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(200, 220, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn.small {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
}

.icon-btn:hover:not(:disabled) {
  background: #fff;
  transform: scale(1.02);
  color: #1a4c8c;
  box-shadow: 0 8px 14px rgba(28, 60, 100, 0.1);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 星期 */
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 12px;
}

.weekday {
  font-weight: 600;
  font-size: 0.9rem;
  color: #4a627a;
  padding: 8px 0;
}

.weekday.weekend {
  color: #c0392b;
}

/* 日历网格 */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-bottom: 28px;
}

.date-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  cursor: pointer;
  transition: 0.12s;
  border: 1px solid transparent;
  user-select: none;
}

/* 周末日期样式 */
.date-cell.weekend {
  color: #c0392b;
}

.date-cell.other-month {
  color: #9aabbb;
  background: rgba(240, 245, 250, 0.5);
}

.date-cell.today {
  background: #d4e2f0;
  border: 2px solid #3f7eb6;
  font-weight: 700;
}

.date-cell.checked {
  background: #b8e0c2;
  border: 1px solid #5f9d80;
  color: #1d4630;
  font-weight: 600;
}

.date-cell.checked::after {
  content: "✓";
  font-size: 1rem;
  margin-left: 3px;
  color: #1f6e43;
}

.date-cell.selected {
  outline: 3px solid #b0c8e0;
  outline-offset: 2px;
}

.date-cell.future {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(200, 200, 200, 0.3);
}

.date-cell:hover:not(.future) {
  background: #e7eef8;
  transform: scale(0.97);
}

/* 打卡区域 */
.checkin-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
}

.selected-date-info {
  margin: 8px 0 14px;
  font-size: 1.1rem;
  color: #2b506e;
  background: rgba(220, 235, 250, 0.6);
  padding: 8px 24px;
  border-radius: 40px;
}

.checkin-btn {
  background: linear-gradient(135deg, #1e4f7a 0%, #143e60 100%);
  border: none;
  color: white;
  font-size: 1.8rem;
  font-weight: 600;
  padding: 18px 40px;
  min-width: 220px;
  border-radius: 60px;
  box-shadow: 0 16px 30px -6px rgba(24, 70, 120, 0.35);
  cursor: pointer;
  letter-spacing: 6px;
  transition: 0.2s;
}

.checkin-btn:hover:not(:disabled) {
  background: #225f8f;
  transform: translateY(-2px);
  letter-spacing: 8px;
}

.checkin-btn:active:not(:disabled) {
  transform: translateY(2px);
}

.checkin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-message {
  min-height: 28px;
  margin: 16px 0 6px;
  font-size: 0.95rem;
  color: #2f5f7a;
}

.footer-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 6px;
}

.text-btn {
  background: none;
  border: none;
  color: #54738f;
  font-size: 0.9rem;
  text-decoration: underline dotted;
  cursor: pointer;
  padding: 6px 12px;
  font-weight: 500;
}

.text-btn:hover:not(:disabled) {
  color: #103a5c;
}

.text-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 用户列表面板 */
.user-list-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.user-list-panel {
  position: absolute;
  bottom: 100%;
  background: white;
  border-radius: 20px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  border: 1px solid rgba(200, 220, 240, 0.8);
  margin-bottom: 8px;
}

.user-list-panel.hidden {
  display: none;
}

.user-list-item {
  padding: 10px 16px;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s;
}

.user-list-item:hover {
  background: #e8f0fe;
}

.user-list-item.active {
  background: #d4e2f0;
  font-weight: 600;
}

.user-name {
  font-size: 1rem;
}

.user-checkin-count {
  background: #1e4f7a;
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* 响应式 */
@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  .card {
    padding: 18px 14px 24px;
  }
  
  #monthDisplay {
    font-size: 1.5rem;
  }
  
  #yearSelect {
    font-size: 1.2rem;
  }
  
  .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  
  .checkin-btn {
    font-size: 1.5rem;
    padding: 14px 28px;
    min-width: 180px;
  }
  
  .month-year {
    gap: 6px;
  }
  
  .footer-actions {
    gap: 8px;
  }
  
  .text-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  
  .user-list-panel {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    max-width: none;
    margin-bottom: 0;
  }
}