/* =========================================================
   admin_knowledge.php - 应用题知识点管理后台
   时间: 2026-09-21
   设计: 左侧题目列表 + 右侧知识点勾选,
         移动端自适应, 暗色模式基础兼容
   ========================================================= */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
                 "Microsoft YaHei", sans-serif;
    background: #f3f4f6;
    margin: 0;
    color: #1f2937;
}

.ak-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.ak-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}
.ak-header h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}
.ak-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.92;
}

.ak-toolbar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.ak-toolbar label {
    font-size: 13px;
    color: #6b7280;
}
.ak-toolbar select,
.ak-toolbar input[type=text] {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    min-width: 120px;
}
.ak-toolbar input[type=text] { min-width: 200px; }
.ak-toolbar button {
    padding: 7px 16px;
    background: #6366f1;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.ak-toolbar button:hover { background: #4f46e5; }

.ak-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 900px) {
    .ak-layout { grid-template-columns: 1fr; }
}

.ak-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 540px;
}
.ak-card__title {
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ak-card__title b { color: #6366f1; }
.ak-card__body {
    flex: 1;
    overflow-y: auto;
    max-height: 70vh;
}

.ak-qlist { list-style: none; margin: 0; padding: 0; }
.ak-qlist li {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background 0.1s ease;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.ak-qlist li:hover { background: #f9fafb; }
.ak-qlist li.is-active {
    background: linear-gradient(90deg, #eef2ff, transparent);
    border-left: 3px solid #6366f1;
    padding-left: 13px;
}
.ak-qlist .ak-qid {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 36px;
}
.ak-qlist .ak-qname {
    color: #1f2937;
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ak-qlist .ak-qbadge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 4px;
    color: #fff;
    flex-shrink: 0;
}

.ak-kplist {
    padding: 14px 16px;
}
.ak-kplist__hint {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 4px;
}
.ak-kplist__group {
    margin-bottom: 14px;
}
.ak-kplist__group-title {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.ak-kp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    margin: 3px 4px 3px 0;
    font-size: 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.ak-kp-chip:hover { background: #e5e7eb; }
.ak-kp-chip.is-on {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
.ak-kp-chip.is-on::before { content: "✓ "; }
.ak-kp-chip:not(.is-on)::before { content: "+ "; color: #6b7280; }

.ak-kp-new {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
}
.ak-kp-new input {
    flex: 1;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
.ak-kp-new button {
    padding: 6px 14px;
    background: #10b981;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.ak-kp-new button:hover { background: #059669; }

.ak-empty {
    padding: 30px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.ak-flash {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: none;
}
.ak-flash.is-ok { background: #10b981; }
.ak-flash.is-err { background: #ef4444; }
.ak-flash.is-show { display: block; }