/* 遮罩层 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); /* 页面背景模糊 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 弹窗主体 */
.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    width: 380px;
    padding: 30px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* 顶部图标和标题 */
.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.modal-logo-icon {
    background: #1d61ff;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(29, 97, 255, 0.3);
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1d1d1f;
}

/* 关闭按钮 */
.modal-close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: #86868b;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 输入框组 */
.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group .material-icons-outlined {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #86868b;
    font-size: 20px;
}

.modal-content input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    border-radius: 16px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

.modal-content input:focus {
    background: white;
    border-color: #1d61ff;
    box-shadow: 0 0 0 4px rgba(29, 97, 255, 0.1);
}

/* 底部按钮区域 */
.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.modal-footer .btn {
    flex: 1;
    padding: 15px;
    border-radius: 14px;
    font-size: 1rem;
}

/* 深色主按钮 (立即登录) */
.btn-dark {
    background: #1a1a1c;
    color: white !important;
}

.btn-dark:hover {
    background: #000;
    transform: translateY(-2px);
}

.modal-message {
    color: #ff3b30;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

/* 打卡弹窗特有样式 */
.checkin-content {
    width: 420px;
    text-align: center;
}

.dumbbell-icon {
    color: #1d61ff;
    margin-bottom: 15px;
}
.dumbbell-icon span { font-size: 48px; }

.current-time-box { margin-bottom: 25px; }
#checkinDate { color: #86868b; font-size: 0.9rem; }
#checkinTime { font-size: 2rem; font-weight: 800; color: #1d1d1f; }

.checkin-content textarea {
    width: 100%;
    height: 100px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 18px;
    padding: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    margin-bottom: 20px;
}

/* 长按按钮核心逻辑 */
.press-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.press-btn-wrapper {
    width: 90px;
    height: 90px;
    background: #f2f2f7;
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    overflow: hidden; /* 关键：切掉溢出的进度条 */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* 进度填充层：初始在中心且缩放为0 */
.progress-fill {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #1d61ff;
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.1s ease; /* 默认快速重置 */
}

/* 当激活长按时，1.5s匀速变大 */
.press-btn-wrapper.pressing .progress-fill {
    transform: scale(1.2);
    transition: transform 1.5s linear;
}

.check-icon {
    position: relative;
    z-index: 2;
    color: #1d61ff;
    font-size: 36px;
    transition: color 0.3s;
}

.press-btn-wrapper.pressing .check-icon {
    color: rgba(255,255,255,0.8);
}

.press-hint {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #86868b;
}

/* 成功文字出现的动画 */
.current-time-box h2 {
    animation: fadeInUp 0.5s ease-out;
}

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

/* 成功状态下的点赞按钮 */
#longPressBtn span {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-content {
    width: 320px;
    padding: 25px;
    text-align: center;
}

.alert-icon {
    color: var(--primary-blue);
    margin-bottom: 15px;
}
.alert-icon span { font-size: 40px; }

.alert-content h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.alert-content p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.alert-content .modal-footer {
    flex-direction: column; /* 按钮上下堆叠，更有设计感 */
    gap: 10px;
}

.alert-content .btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
}

.code-list-container {
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.code-item {
    background: white;
    padding: 12px 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.code-item:hover {
    border-color: #1d61ff;
    transform: translateX(5px);
}

.code-text {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: #1d1d1f;
}

.copy-hint {
    font-size: 0.75rem;
    color: #1d61ff;
}