/* ====== 自动锁屏插件样式 ====== */

/* -- 遮罩层 -- */
#plugin-lock-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9995;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 25, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    animation: als-fade-in 0.4s ease forwards;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    user-select: none;
}

@keyframes als-fade-in {
    to { opacity: 1; }
}

/* -- 锁屏卡片 -- */
.als-card {
    width: 380px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: als-card-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
    transform: scale(0.88) translateY(20px);
}

@keyframes als-card-in {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* -- 卡片头部 -- */
.als-header {
    background: linear-gradient(135deg, #3478F6 0%, #2563EB 100%);
    padding: 32px 24px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.als-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -30%;
    width: 160%;
    height: 160%;
    background: radial-gradient(circle at 35% 45%, rgba(255, 255, 255, 0.12) 0%, transparent 55%);
    pointer-events: none;
}

.als-lock-icon {
    font-size: 52px;
    margin-bottom: 10px;
    animation: als-lock-pulse 2.5s ease-in-out infinite;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

@keyframes als-lock-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.als-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.als-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* -- 卡片内容区域 -- */
.als-body {
    background: #ffffff;
    padding: 28px 24px;
}

/* 时钟显示 */
.als-clock {
    text-align: center;
    margin-bottom: 24px;
}

.als-clock-time {
    font-size: 42px;
    font-weight: 800;
    color: #1d1d1f;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
    line-height: 1;
}

.als-clock-date {
    font-size: 13px;
    color: #86868b;
    margin-top: 4px;
}

/* 密码输入区域 */
.als-password-group {
    position: relative;
    margin-bottom: 8px;
}

.als-password-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #48484a;
    margin-bottom: 8px;
}

.als-password-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    background: #f5f5f7;
    border: 2px solid #d1d1d6;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.als-password-wrapper:focus-within {
    border-color: #3478F6;
    box-shadow: 0 0 0 3px rgba(52, 120, 246, 0.15);
}

.als-password-wrapper.als-error {
    border-color: #FF3B30;
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12);
    animation: als-shake 0.4s ease;
}

@keyframes als-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.als-password-icon {
    flex-shrink: 0;
    width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.als-password-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 4px 12px 0;
    font-size: 15px;
    color: #1d1d1f;
    outline: none;
    letter-spacing: 3px;
}

.als-password-input::placeholder {
    letter-spacing: 0;
    color: #86868b;
}

.als-password-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #86868b;
    border-radius: 8px;
    margin-right: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.als-password-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #3478F6;
}

/* 错误提示 */
.als-error-msg {
    font-size: 12px;
    color: #FF3B30;
    min-height: 20px;
    line-height: 20px;
    padding-left: 2px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.als-error-msg.als-visible {
    opacity: 1;
}

/* 解锁按钮 */
.als-unlock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3478F6 0%, #2563EB 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(52, 120, 246, 0.35);
    outline: none;
    margin-top: 4px;
}

.als-unlock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(52, 120, 246, 0.5);
}

.als-unlock-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 120, 246, 0.3);
}

/* -- 卡片底部 -- */
.als-footer {
    background: #ffffff;
    padding: 0 24px 20px;
    text-align: center;
}

.als-footer-hint {
    font-size: 12px;
    color: #86868b;
    margin: 0;
}

/* -- 首次设置密码模式 -- */
.als-setup-hint {
    background: linear-gradient(135deg, #f0f0ff 0%, #faf0ff 100%);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid rgba(52, 120, 246, 0.12);
}

.als-setup-hint-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1.4;
}

.als-setup-hint-text {
    font-size: 13px;
    color: #6e6e73;
    line-height: 1.5;
}

.als-confirm-group {
    margin-top: 12px;
}

/* ====== 暗色模式适配 ====== */
html[data-theme="dark"] #plugin-lock-screen-overlay {
    background: rgba(8, 8, 16, 0.92);
}

html[data-theme="dark"] .als-card {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .als-body,
html[data-theme="dark"] .als-footer {
    background: #1c1c1e;
}

html[data-theme="dark"] .als-clock-time {
    color: #f5f5f7;
}

html[data-theme="dark"] .als-clock-date {
    color: #86868b;
}

html[data-theme="dark"] .als-password-label {
    color: #a1a1a6;
}

html[data-theme="dark"] .als-password-wrapper {
    background: #2c2c2e;
    border-color: #3a3a3c;
}

html[data-theme="dark"] .als-password-wrapper:focus-within {
    border-color: #3478F6;
    box-shadow: 0 0 0 3px rgba(52, 120, 246, 0.2);
}

html[data-theme="dark"] .als-password-input {
    color: #f5f5f7;
}

html[data-theme="dark"] .als-password-input::placeholder {
    color: #86868b;
}

html[data-theme="dark"] .als-password-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .als-setup-hint {
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    border-color: rgba(52, 120, 246, 0.15);
}

html[data-theme="dark"] .als-setup-hint-text {
    color: #a1a1a6;
}

html[data-theme="dark"] .als-footer-hint {
    color: #86868b;
}

/* ====== 解锁成功动画 ====== */
#plugin-lock-screen-overlay.als-unlocking {
    animation: als-fade-out 0.4s ease forwards;
}

#plugin-lock-screen-overlay.als-unlocking .als-card {
    animation: als-card-out 0.35s ease forwards;
}

@keyframes als-fade-out {
    to { opacity: 0; }
}

@keyframes als-card-out {
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
}
