/* ===================================================================
   ★ KP 原生极速系统 UI (高级权重架构版 - 告别 !important 滥用)
   =================================================================== */

/* ===================================================================
   ★ 1. 系统级容器强制覆写 (这部分属于结构对抗，保留 !important 是合理的)
   =================================================================== */
body:has(.kp-auth-wrapper) {
    min-height: 100dvh !important;
    background-color: var(--wv-bg-color) !important;
    margin: 0 !important; 
    padding: 0 !important;
}

body:has(.kp-auth-wrapper) #main-container {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100dvh !important;
}

body:has(.kp-auth-wrapper) #main {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    margin: 0 !important;
}

body:has(.kp-auth-wrapper) .ct-container-full,
body:has(.kp-auth-wrapper) article,
body:has(.kp-auth-wrapper) .entry-content,
body:has(.kp-auth-wrapper) .is-layout-constrained {
    display: contents !important; 
}

body:has(.kp-auth-wrapper) .entry-content > p {
    display: none !important;
}

/* ===================================================================
   ★ 2. 登录/注册卡片 (纯净架构：利用多层级选择器增加权重)
   =================================================================== */
body .kp-auth-wrapper {
    width: 100%;
    max-width: 360px;
    margin: auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    font-family: 'Noto Sans SC', 'Noto Sans KR', sans-serif;
}

.kp-auth-wrapper .kp-form .kp-field { 
    margin-bottom: 12px; 
}

.kp-auth-wrapper .kp-form label { 
    display: block; 
    font-size: 14px; 
    font-weight: 600; 
    color: #222; 
    margin-bottom: 6px; 
}

.kp-auth-wrapper .kp-form label .kp-help { 
    font-size: 11px; 
    color: #999; 
    font-weight: normal; 
    display: block; 
    margin-top: 2px; 
}

.kp-auth-wrapper .kp-form input[type="text"], 
.kp-auth-wrapper .kp-form input[type="email"], 
.kp-auth-wrapper .kp-form input[type="password"] {
    width: 100%; 
    height: 38px; 
    padding: 0 12px;
    border: 1px solid #e0e0e0; 
    border-radius: 6px;
    font-size: 16px; /* 防 iOS 自动放大 */
    color: #222; 
    background: #fff; 
    box-sizing: border-box;
    box-shadow: none; /* 清除可能带有的默认阴影 */
}

.kp-auth-wrapper .kp-form input:focus { 
    border-color: #374151; 
    outline: none; 
}

.kp-auth-wrapper .kp-form input:disabled { 
    background: #f9f9f9; 
    color: #888; 
    border-color: #eee; 
    cursor: not-allowed; 
}

.kp-auth-wrapper .kp-field-checkbox { 
    margin: 10px 0 15px 0; 
    font-size: 12px; 
    font-weight: 400; 
    color: #666; 
    display: flex; 
    align-items: center; 
}

.kp-auth-wrapper .kp-field-checkbox input { 
    margin-right: 6px; 
}

.kp-auth-wrapper .kp-form-actions { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 12px; 
    margin-top: 15px; 
}

.kp-auth-wrapper .kp-btn {
    height: 38px; 
    line-height: 38px; 
    text-align: center; 
    border-radius: 6px;
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer; 
    border: none; 
    transition: all 0.2s;
    padding: 0;
}

.kp-auth-wrapper .kp-btn-primary { 
    background: #202124; 
    color: #fff; 
} 

.kp-auth-wrapper .kp-btn-primary:hover { 
    background: #222; 
}

.kp-auth-wrapper .kp-btn-alt { 
    background: #fff; 
    color: #444; 
    border: 1px solid #ddd; 
    text-decoration: none; 
    display: block; /* 保证 a 标签铺满 */
}

.kp-auth-wrapper .kp-btn-alt:hover {
    background: #f9f9f9;
}

.kp-auth-wrapper .kp-form-msg { 
    font-size: 13px; 
    margin-bottom: 10px; 
    padding: 8px; 
    border-radius: 4px; 
}

.kp-auth-wrapper .kp-link-forgot { 
    display: block; 
    text-align: center; 
    margin-top: 20px; 
    font-size: 12px; 
    color: #aaa; 
    text-decoration: none;
}

/* ===================================================================
   ★ 3. 个人中心专属布局 (系统防滑动级覆写，保留必要的 !important)
   =================================================================== */
body:has(.kp-profile-layout),
body:has(.kp-profile-layout) .wv-wrapper,
body:has(.kp-profile-layout) .wv-main-body,
body:has(.kp-profile-layout) .wv-content,
body:has(.kp-profile-layout) .wv-content-inner {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important; 
    margin: 0 !important;
}

body:has(.kp-profile-layout) .wv-main-body {
    padding-top: var(--wv-header-h-pc, 60px) !important; 
    box-sizing: border-box !important;
}

body:has(.kp-profile-layout) .wv-content-inner {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    padding: 0 !important;
}

body:has(.kp-profile-layout) .wv-content-inner > br {
    display: none !important;
}

/* ===================================================================
   ★ 3.1 个人中心卡片本体样式 (无 !important 版)
   =================================================================== */
body .kp-profile-layout {
    display: flex; 
    width: 100%;
    max-width: 600px; 
    margin: 0 auto; 
    background: #fff; 
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
    border: 1px solid #f0f0f0; 
    overflow: hidden;
}

.kp-profile-layout .kp-profile-sidebar { 
    width: 220px; 
    background: #fafafa; 
    padding: 30px 0; 
    text-align: center; 
    border-right: 1px solid #eee; 
}

.kp-profile-layout .kp-avatar-wrap { 
    position: relative; 
    width: 90px; 
    height: 90px; 
    margin: 0 auto 15px auto; 
}

.kp-profile-layout .kp-profile-avatar { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid #fff; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
}

.kp-profile-layout .kp-profile-name { 
    font-size: 16px; 
    font-weight: 600; 
    color: #1c1c1e; 
    margin: 0 0 5px 0; 
}

.kp-profile-layout .kp-profile-menu { 
    text-align: left; 
    margin-top: 10px; 
}

.kp-profile-layout .kp-menu-item { 
    padding: 14px 25px; 
    font-size: 14px; 
    color: #666; 
    cursor: pointer; 
    transition: all 0.2s; 
    border-left: 3px solid transparent; 
    display: flex; 
    align-items: center; 
}

.kp-profile-layout .kp-menu-item:hover { 
    background: #f0f0f0; 
}

.kp-profile-layout .kp-menu-item.active { 
    background: #fff; 
    color: #1c1c1e; 
    font-weight: 600; 
    border-left: 3px solid #1c1c1e; 
}

.kp-profile-layout .kp-menu-item img.icon { 
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 12px;
    opacity: 0.8; 
}

.kp-profile-layout .kp-profile-main { 
    flex: 1; 
    padding: 40px 50px; 
    box-sizing: border-box;
}

.kp-profile-layout .kp-avatar-upload-btn-new {
    display: inline-block; 
    margin-top: 5px; 
    font-size: 12px; 
    font-weight: 500;
    color: #fff; 
    background: #202124; 
    padding: 6px 16px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: all 0.2s; 
    border: none;
}

.kp-profile-layout .kp-avatar-upload-btn-new:hover { 
    background: #222; 
}

/* ===================================================================
   ★ 4. 手机端专属适配
   =================================================================== */
@media (max-width: 1000px) {
    body:has(.kp-profile-layout) .wv-main-body {
        padding-top: var(--wv-header-h-mo, 54px) !important;
    }
    body:has(.kp-profile-layout) .wv-content-inner {
        padding: 20px !important; 
        box-sizing: border-box !important;
    }
    body .kp-profile-layout { 
        flex-direction: column; 
        width: 100%;
        max-width: 100%;
    }
    .kp-profile-layout .kp-profile-sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid #eee; 
        padding: 25px 0 15px 0; 
    }
    .kp-profile-layout .kp-profile-main { 
        padding: 30px 20px; 
    }
}

/* ===================================================================
   ★ 5. 极简复选框
   =================================================================== */
.kp-auth-wrapper .kp-field-checkbox input[type="checkbox"] {
    accent-color: #333333; 
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ===================================================================
   ★ 补丁：恢复电脑端侧边栏避让空间
   =================================================================== */
@media (min-width: 1001px) {
    body:has(.kp-profile-layout) .wv-content {
        margin-left: 260px !important; 
        padding-right: 20px !important; 
    }
}

.kp-btn-primary, 
#kp-login-btn, 
#kp-register-btn, 
#kp-password-btn, 
.kp-avatar-upload-btn-new {
    background-color: #202124 !important; /* 你的碳黑色 */
    color: #ffffff !important;
    border: none !important;
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}