/**
 * Cnlog 组件样式
 * 包含：登录/注册弹窗、分类/标签提示框、无文章提示等
 * 从 header.php 和 log_list.php 中提取，减少主 CSS 体积
 */

/* ==================== 登录/注册弹窗 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px;
    width: 90%;
    max-width: 360px;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e8e8e8;
    background: white;
    font-size: 18px;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.login-header, .register-header {
    margin-bottom: 24px;
}

.login-header h1, .register-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.login-header p, .register-header p {
    font-size: 13px;
    color: #999;
}

.form-group {
    margin-bottom: 16px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fafafa;
}

.form-group input:focus {
    outline: none;
    border-color: #5ba3f5;
    background: white;
    box-shadow: 0 0 0 2px rgba(91, 163, 245, 0.1);
}

.form-group input::placeholder {
    color: #bbb;
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.remember-me input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.btn-login, .btn-register {
    width: 100%;
    padding: 12px;
    background: #5ba3f5;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}

.btn-login:hover, .btn-register:hover {
    background: #4a92e8;
    box-shadow: 0 4px 12px rgba(91, 163, 245, 0.3);
}

.btn-login:active, .btn-register:active {
    transform: scale(0.98);
}

.login-footer, .register-footer {
    text-align: center;
    font-size: 13px;
}

.login-footer a, .register-footer a {
    color: #5ba3f5;
    text-decoration: none;
    margin: 0 8px;
}

.login-footer a:hover, .register-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-error {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.alert-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.password-tips {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group input {
    flex: 1;
}

.captcha-group img {
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e8e8e8;
    transition: all 0.2s;
}

.captcha-group img:hover {
    border-color: #5ba3f5;
    box-shadow: 0 2px 8px rgba(91, 163, 245, 0.2);
}

/* ==================== 分类/标签提示框 ==================== */
.category-notice,
.search-notice {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.category-notice strong {
    color: var(--text-color);
}

.category-notice .category-name {
    color: var(--primary-color);
    font-weight: 600;
}

.category-notice .article-count {
    color: var(--text-light);
    font-size: 14px;
    margin-left: 10px;
}

.tag-notice {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-left: 3px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.tag-notice strong {
    color: var(--text-color);
}

.tag-notice .tag-name {
    color: var(--primary-color);
    font-weight: 600;
}

.tag-notice .article-count {
    color: var(--text-light);
    font-size: 14px;
    margin-left: 10px;
}

/* ==================== 无文章提示 ==================== */
.no-posts-card {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.no-posts-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-posts-icon::before {
    content: "📝";
}

.no-posts-card h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.no-posts-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== 无限滚动加载 ==================== */
#infinite-scroll-trigger {
    text-align: center;
    padding: 20px;
}

#loading-indicator {
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-light);
    margin-top: 10px;
    font-size: 14px;
}
