/* 坤服论坛 · 协议中心 */

/* ---------- 正文排版（页面与弹窗共用） ---------- */
body .kll-article {
    --kll-main: #4c8ffb;
    --kll-ink: #39414f;
    --kll-ink-2: #6b7488;
    font-size: 15px;
    line-height: 1.95;
    color: var(--kll-ink);
    letter-spacing: .1px;
    word-break: break-word;
}
body .kll-article .kll-meta {
    font-size: 12.5px;
    color: var(--kll-ink-2);
    background: #f5f8ff;
    border: 1px solid #e6eefc;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 0 0 22px;
    line-height: 1.6;
}
body .kll-article h2 {
    position: relative;
    font-size: 16.5px;
    font-weight: 700;
    color: #1a2233;
    margin: 30px 0 12px;
    padding-left: 12px;
    line-height: 1.5;
}
body .kll-article h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--kll-main);
}
body .kll-article h3 {
    font-size: 15px;
    font-weight: 700;
    color: #1a2233;
    margin: 20px 0 8px;
}
body .kll-article p {
    margin: 0 0 11px;
}
body .kll-article ul {
    margin: 0 0 14px;
    padding-left: 0;
    list-style: none;
}
body .kll-article ul li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 7px;
}
body .kll-article ul li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #c5d6f7;
}
body .kll-article strong {
    color: #1a2233;
    font-weight: 600;
}
body .kll-article a {
    color: var(--kll-main);
}

/* ---------- 弹窗容器 ---------- */
.kll-wrap {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}
.kll-wrap.is-open {
    display: block;
}
.kll-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: kll-fade .22s ease;
}
.kll-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 32px));
    max-height: min(88vh, 860px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .06);
    overflow: hidden;
    animation: kll-pop .26s cubic-bezier(.28, .9, .36, 1);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
@keyframes kll-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes kll-pop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.96) }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1) }
}

/* ---------- 头部 ---------- */
.kll-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
}
.kll-title {
    margin: 0 0 5px;
    font-size: 19px;
    font-weight: 700;
    color: #16203a;
    letter-spacing: .2px;
    line-height: 1.3;
}
.kll-sub {
    margin: 0;
    font-size: 12.5px;
    color: #8b94a7;
    line-height: 1.5;
}
.kll-x {
    flex: none;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: #f4f6fa;
    color: #8b94a7;
    cursor: pointer;
    transition: .18s;
}
.kll-x:hover {
    background: #eaeef6;
    color: #4b5568;
}

/* ---------- 文档切换 ---------- */
.kll-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.kll-tabs::-webkit-scrollbar { display: none }
.kll-tab {
    position: relative;
    flex: 1 1 0;
    min-width: 132px;
    text-align: left;
    padding: 10px 12px 11px;
    border: 1px solid #eaeef6;
    border-radius: 12px;
    background: #fafbfe;
    cursor: pointer;
    transition: .18s;
    font-family: inherit;
}
.kll-tab:hover {
    background: #f2f6ff;
    border-color: #dbe6fb;
}
.kll-tab.is-active {
    background: #fff;
    border-color: #c8dbfb;
    box-shadow: 0 2px 8px rgba(76, 143, 251, .12);
}
.kll-tab-t {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2b3448;
    line-height: 1.3;
    white-space: nowrap;
}
.kll-tab.is-active .kll-tab-t { color: #2f6fe0 }
.kll-tab-d {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #9aa3b5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.kll-dot {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffe0b2;
    transition: .2s;
}
.kll-tab.is-read .kll-dot { background: #34c77b }

/* ---------- 内容区 ---------- */
.kll-body {
    position: relative;
    flex: 1;
    min-height: 0;
    border-top: 1px solid #eef1f7;
}
.kll-progress {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 2px;
    background: #eef1f7;
    z-index: 2;
}
.kll-progress > i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6fa5ff, #4c8ffb);
    transition: width .12s linear;
}
.kll-scroll {
    height: 100%;
    max-height: calc(88vh - 330px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 24px 8px;
    -webkit-overflow-scrolling: touch;
}
.kll-scroll::-webkit-scrollbar { width: 8px }
.kll-scroll::-webkit-scrollbar-thumb {
    background: #dfe5ef;
    border-radius: 8px;
    border: 2px solid #fff;
}
.kll-scroll::-webkit-scrollbar-thumb:hover { background: #ccd5e4 }
.kll-pane { display: none }
.kll-pane.is-active { display: block }

.kll-pane .kll-article {
    font-size: 13.5px;
    line-height: 1.85;
}
.kll-pane .kll-article .kll-meta {
    font-size: 11.5px;
    padding: 6px 10px;
    margin-bottom: 16px;
}
.kll-pane .kll-article h2 {
    font-size: 14.5px;
    margin: 22px 0 9px;
    padding-left: 10px;
}
.kll-pane .kll-article h2::before {
    top: 3px;
    height: 14px;
}
.kll-pane .kll-article h3 {
    font-size: 13.5px;
    margin: 16px 0 6px;
}
.kll-pane .kll-article p { margin-bottom: 9px }
.kll-pane .kll-article ul li { padding-left: 14px; margin-bottom: 5px }
.kll-pane .kll-article ul li::before { top: 10px; width: 4px; height: 4px }

/* ---------- 底部 ---------- */
.kll-foot {
    border-top: 1px solid #eef1f7;
    padding: 14px 24px 18px;
    background: #fcfdff;
}
.kll-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    cursor: pointer;
    margin-bottom: 13px;
    user-select: none;
}
.kll-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.kll-box {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    border: 1.5px solid #ccd6e6;
    border-radius: 5px;
    background: #fff;
    transition: .16s;
    position: relative;
}
.kll-check input:checked + .kll-box {
    background: #4c8ffb;
    border-color: #4c8ffb;
}
.kll-check input:checked + .kll-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}
.kll-check input:focus-visible + .kll-box {
    box-shadow: 0 0 0 3px rgba(76, 143, 251, .18);
}
.kll-txt {
    font-size: 12.5px;
    line-height: 1.6;
    color: #6b7488;
}
.kll-txt a {
    color: #3b7cf0;
    text-decoration: none;
    border-bottom: 1px dashed #b9d0f8;
}
.kll-txt a:hover { border-bottom-style: solid }
.kll-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}
.kll-btn {
    height: 38px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: .18s;
}
.kll-btn.ghost {
    background: #fff;
    border-color: #e2e8f2;
    color: #7b8497;
}
.kll-btn.ghost:hover {
    background: #f6f8fc;
    color: #57607a;
}
.kll-btn.primary {
    min-width: 148px;
    background: linear-gradient(135deg, #5c9bff, #3b7cf0);
    color: #fff;
    box-shadow: 0 6px 16px rgba(59, 124, 240, .28);
}
.kll-btn.primary:hover:not(:disabled) {
    box-shadow: 0 8px 22px rgba(59, 124, 240, .36);
    transform: translateY(-1px);
}
.kll-btn.primary:disabled {
    background: #dfe6f2;
    color: #a7b1c4;
    box-shadow: none;
    cursor: not-allowed;
}

/* 抖动提示 */
.kll-shake {
    animation: kll-shake .4s ease;
}
@keyframes kll-shake {
    0%, 100% { transform: translate(-50%, -50%) }
    25% { transform: translate(calc(-50% - 5px), -50%) }
    75% { transform: translate(calc(-50% + 5px), -50%) }
}

body.kll-lock {
    overflow: hidden !important;
}

/* 移动端 */
@media (max-width: 640px) {
    .kll-wrap {
        align-items: flex-end;
    }
    .kll-panel {
        left: 0;
        top: auto;
        bottom: 0;
        transform: none;
        width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        animation: kll-up .26s cubic-bezier(.28, .9, .36, 1);
    }
    @keyframes kll-up {
        from { transform: translateY(30px); opacity: .6 }
        to   { transform: translateY(0); opacity: 1 }
    }
    .kll-shake { animation: kll-shake-m .4s ease }
    @keyframes kll-shake-m {
        0%, 100% { transform: translateX(0) }
        25% { transform: translateX(-5px) }
        75% { transform: translateX(5px) }
    }
    .kll-head { padding: 18px 18px 12px }
    .kll-title { font-size: 17px }
    .kll-tabs { padding: 0 18px 12px }
    .kll-tab {
        flex: 0 0 auto;
        min-width: 118px;
        padding: 9px 11px 10px;
    }
    .kll-tab-d { display: none }
    .kll-scroll {
        max-height: 52vh;
        padding: 14px 18px 6px;
    }
    .kll-foot { padding: 12px 18px 16px }
    .kll-actions { gap: 8px }
    .kll-btn { flex: 1; padding: 0 12px; font-size: 13px }
    .kll-btn.primary { min-width: 0; flex: 1.4 }
}

/* ---------- 更多规则：链接卡片 ---------- */
.kll-more {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.kll-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid #e7ecf5;
    border-radius: 11px;
    background: #fafbfe;
    text-decoration: none;
    transition: .16s;
}
.kll-more-item:hover {
    background: #f2f6ff;
    border-color: #cfdefa;
    transform: translateX(2px);
}
.kll-more-t {
    flex: none;
    font-size: 13px;
    font-weight: 600;
    color: #2b3448;
}
.kll-more-d {
    flex: 1;
    font-size: 11.5px;
    color: #98a1b3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kll-more-item svg {
    flex: none;
    color: #a9b6cc;
    transition: .16s;
}
.kll-more-item:hover svg {
    color: #4c8ffb;
}
.kll-tab-more .kll-tab-t {
    color: #7d8aa0;
}
.kll-tab-more.is-active .kll-tab-t {
    color: #2f6fe0;
}
