/* public/style.css */
/* 我们可以在这里添加一些Tailwind无法直接实现的自定义样式 */
.calendar-grid .day {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2px;
    min-height: 2.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    margin-bottom: 1px;
}

.day-count {
    font-size: 0.625rem;
    font-weight: 600;
    color: #059669; /* green-600 */
    line-height: 1;
    background-color: rgba(5, 150, 105, 0.1);
    padding: 1px 3px;
    border-radius: 4px;
    min-width: 16px;
    text-align: center;
}

/* 针对移动设备优化 */
@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
    .calendar-grid .day {
        padding: 1px;
        min-height: 2.25rem;
        border-radius: 0.375rem;
    }
    .day-number {
        font-size: 0.75rem;
        margin-bottom: 0.5px;
    }
    .day-count {
        font-size: 0.5rem;
        padding: 0.5px 2px;
        min-width: 14px;
    }
}

@media (min-width: 641px) {
    .calendar-grid .day {
        padding: 3px;
        min-height: 3rem;
        border-radius: 0.5rem;
    }
    .day-number {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    .day-count {
        font-size: 0.7rem;
        padding: 1px 4px;
        min-width: 18px;
    }
}

/* 日历标题样式 */
.calendar-header {
    background-color: #f1f5f9; /* slate-100 */
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .calendar-header {
        padding: 0.25rem;
        margin-bottom: 0.25rem;
    }
}

@media (min-width: 641px) {
    .calendar-header {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* 日历状态样式 */
.calendar-grid .day.today {
    background-color: #e0e7ff; /* indigo-100 */
    border: 2px solid #4f46e5; /* indigo-600 */
    transform: scale(1.05);
}

.calendar-grid .day.selected {
    background-color: #dbeafe; /* blue-100 */
    border: 2px solid #3b82f6; /* blue-500 */
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.calendar-grid .day.has-checkin {
    background-color: #dcfce7; /* green-100 */
    border: 1px solid #22c55e; /* green-500 */
}

.calendar-grid .day.has-checkin:hover {
    background-color: #bbf7d0; /* green-200 */
    transform: scale(1.02);
}

.calendar-grid .day.empty {
    background-color: transparent;
    border: 1px solid transparent;
    cursor: default;
}

.calendar-grid .day.empty:hover {
    transform: none;
}

/* 日历网格容器 */
.calendar-grid {
    background-color: #f8fafc; /* slate-50 */
    border-radius: 0.75rem;
    padding: 0.5rem;
    gap: 0.25rem;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

@media (max-width: 640px) {
    .calendar-grid {
        padding: 0.25rem;
        gap: 0.125rem;
    }
}

@media (min-width: 641px) {
    .calendar-grid {
        padding: 0.75rem;
        gap: 0.375rem;
    }
}

/* 补打卡模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 640px) {
    .modal {
        padding: 2rem;
    }
    .modal-content {
        padding: 2rem;
    }
}

/* 排行榜相关样式 */
.leaderboard-tab {
    transition: all 0.2s ease-in-out;
}

.leaderboard-tab.active {
    border-bottom-color: #4f46e5;
    color: #4f46e5;
}

.leaderboard-content {
    transition: opacity 0.3s ease-in-out;
}

/* 排行榜列表项样式 */
.leaderboard-content .flex {
    transition: all 0.2s ease-in-out;
    border-radius: 0.5rem;
}

.leaderboard-content .flex:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 排行榜排名样式 */
.leaderboard-rank {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #92400e;
}

.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #e5e7eb);
    color: #374151;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #d97706);
    color: white;
}

.rank-other {
    background: #f3f4f6;
    color: #6b7280;
}

/* 戒色好处提示样式 */
.benefits-container {
    animation: fadeIn 0.5s ease-in-out;
}

.benefits-container:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.refresh-benefit-btn {
    transition: all 0.2s ease-in-out;
}

.refresh-benefit-btn:hover {
    transform: rotate(180deg);
}

.refresh-benefit-btn.rotate-180 {
    transform: rotate(180deg);
}

.benefit-text {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.benefit-text {
    line-height: 1.6;
    transition: all 0.3s ease-in-out;
}

/* 快捷选项按钮样式 */
.quick-exercise-btn {
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.quick-exercise-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 编辑和删除按钮样式 */
.edit-btn, .delete-btn {
    transition: all 0.2s ease-in-out;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.edit-btn:hover, .delete-btn:hover {
    transform: scale(1.05);
}

/* 响应式优化 */
@media (max-width: 640px) {
    .modal-content {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .quick-exercise-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .edit-btn, .delete-btn {
        font-size: 0.75rem;
        padding: 0.125rem 0.375rem;
    }
}

/* 加载状态样式 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 成功状态样式 */
.success {
    background-color: #dcfce7;
    border-color: #22c55e;
}

/* 错误状态样式 */
.error {
    background-color: #fef2f2;
    border-color: #ef4444;
}

/* 禁用状态样式 */
.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 动画效果 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 登录弹框更有设计感 */
.login-modal {
    font-size: 0.95rem;
    background: #fff;
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(60, 72, 180, 0.10);
    padding: 2.5rem 2rem;
    max-width: 380px;
    margin: 0 auto;
    animation: fadeIn 0.5s;
    border: none;
    position: relative;
    overflow: hidden;
}
.login-modal h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #3730a3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}
.login-modal h2::before {
    content: '👋';
    font-size: 1.2em;
    margin-right: 0.2em;
}
.login-modal label {
    color: #6366f1;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 0.98em;
}
.login-modal .input-group {
    position: relative;
    margin-bottom: 1.2rem;
}
.login-modal .input-group .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a5b4fc;
    font-size: 1.1em;
    pointer-events: none;
}
.login-modal input[type="text"] {
    border-radius: 1rem;
    border: 1.5px solid #c7d2fe;
    padding: 0.6rem 1rem 0.6rem 2.3rem;
    font-size: 1em;
    transition: border 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.04);
    background: #f8fafc;
}
.login-modal input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px #a5b4fc;
    background: #fff;
}
.login-modal button[type="submit"] {
    font-size: 1em;
    padding: 0.6rem 0;
    margin-top: 0.8rem;
    background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
    color: #fff;
    font-weight: 700;
    border-radius: 1.5rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}
.login-modal button[type="submit"]:hover {
    background: linear-gradient(90deg, #818cf8 0%, #6366f1 100%);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px #a5b4fc55;
}
.login-modal .text-red-500 {
    min-height: 1.5em;
    margin-bottom: 0.5rem;
}
@media (max-width: 480px) {
    .login-modal {
        padding: 1.2rem 0.5rem;
        border-radius: 1.2rem;
        font-size: 0.9rem;
    }
    .login-modal h2 {
        font-size: 1.1rem;
    }
}

/* 优化主内容卡片样式 */
.card-main {
    background: #fcfcfe;
    border-radius: 2.5rem;
    /* box-shadow: 0 6px 32px rgba(60, 72, 180, 0.10), 0 1.5px 6px rgba(60,72,180,0.04); */
    padding: 2.5rem 2rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

/* 优化昵称输入框外层样式 */
.input-nick-wrap {
    display: flex;
    align-items: center;
    border-radius: 1.5rem;
    background: #f8fafd;
    padding: 0.7rem 1.2rem;
    box-shadow: 0 1px 4px rgba(60,72,180,0.04) inset;
    transition: box-shadow 0.18s, border 0.18s;
}

/* 全局去除 focus-within 的 ring 效果 */
.focus-within\:ring-2:focus-within,
.focus-within\:ring-indigo-400:focus-within {
    box-shadow: none !important;
    border-color: inherit !important;
}

/* 极简输入框：无边框、无聚焦描边、无阴影、无背景变化 */
.flex-1.border-none.outline-none.bg-transparent.text-sm,
.flex-1.border-none.outline-none.bg-transparent.text-sm.sm\:text-base {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

/* 优化所有input输入框样式 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="datetime-local"] {
  font-size: 15px !important;
  font-family: inherit;
  border-radius: 1rem;
  box-shadow: none;
  outline: none;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  transition: border 0.18s;
  padding: 0.7rem 1rem;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus {
  border-color: #e5e7eb;
  box-shadow: none;
  outline: none;
}

/* 优化备注输入框样式 */
textarea.remarks-input {
  border: 1.5px solid #e5e7eb;
  border-radius: 1rem;
  font-size: 14px;
  font-family: inherit;
  box-shadow: none;
  outline: none;
  background: #fff;
  transition: border 0.18s;
  padding: 0.7rem 1rem;
  resize: vertical;
}
textarea.remarks-input:focus {
  border-color: #e5e7eb;
  box-shadow: none;
  outline: none;
}

/* 设置页用户ID输入框字体缩小 */
.settings-userid-input {
  font-size: 13px !important;
  padding: 0.5rem 0.7rem;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.7rem;
  box-shadow: none;
  outline: none;
}
.settings-userid-input:focus {
  border: 1px solid #cbd5e1 !important;
  box-shadow: none;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  font-size: 16px !important;
}

input,
textarea {
  font-size: 16px !important;
}
input::placeholder,
textarea::placeholder {
  font-size: 16px !important;
}

html, body {
  touch-action: manipulation;
}
