/* ============================================================
   AEG1S AI · Cookie 同意横幅 + 自定义模态框
   ============================================================ */

#aegis-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(13, 17, 23, 0.97);
    color: #fff;
    padding: 18px 24px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none !important; /* 默认隐藏，加 !important 防被全站样式覆盖导致永久遮挡 */
    font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
    animation: aegis-cookie-slideup 0.35s ease-out;
}
#aegis-cookie-banner.aegis-visible { display: block !important; }

@keyframes aegis-cookie-slideup {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.aegis-cookie-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.aegis-cookie-msg {
    flex: 1 1 420px;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.88);
}
.aegis-cookie-msg strong { color: #fff; }
.aegis-cookie-msg a { color: #f04d1e; text-decoration: underline; }
.aegis-cookie-msg a:hover { color: #ff7748; }

.aegis-cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aegis-cookie-btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}
.aegis-cookie-btn-accept {
    background: #f04d1e;
    color: #fff;
}
.aegis-cookie-btn-accept:hover { background: #d94215; }
.aegis-cookie-btn-necessary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.aegis-cookie-btn-necessary:hover { background: rgba(255, 255, 255, 0.18); }
.aegis-cookie-btn-custom {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.35);
}
.aegis-cookie-btn-custom:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* ===== 自定义模态框 ===== */
#aegis-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: 'Noto Sans SC', 'Inter', -apple-system, sans-serif;
}
#aegis-cookie-modal.aegis-visible { display: flex; }

.aegis-modal-card {
    background: #fff;
    color: #1a1a1a;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    animation: aegis-modal-in 0.25s ease-out;
}
@keyframes aegis-modal-in {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.aegis-modal-head {
    padding: 22px 26px 14px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.aegis-modal-head h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.aegis-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.aegis-modal-close:hover { color: #1a1a1a; }

.aegis-modal-body {
    padding: 18px 26px;
}
.aegis-modal-body p.aegis-intro {
    font-size: 13.5px;
    color: #555;
    margin-bottom: 14px;
    line-height: 1.6;
}

.aegis-cat {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fafafa;
}
.aegis-cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.aegis-cat-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1a1a1a;
}
.aegis-cat-desc {
    font-size: 12.5px;
    color: #666;
    line-height: 1.55;
}
.aegis-cat-locked {
    font-size: 12px;
    color: #f04d1e;
    font-weight: 600;
}

/* iOS-style toggle */
.aegis-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}
.aegis-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.aegis-toggle .aegis-slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}
.aegis-toggle .aegis-slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.aegis-toggle input:checked + .aegis-slider { background: #f04d1e; }
.aegis-toggle input:checked + .aegis-slider::before { transform: translateX(18px); }
.aegis-toggle input:disabled + .aegis-slider {
    background: #f04d1e;
    opacity: 0.55;
    cursor: not-allowed;
}

.aegis-modal-foot {
    padding: 16px 26px 22px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.aegis-modal-foot .aegis-cookie-btn { padding: 9px 18px; font-size: 13.5px; }

@media (max-width: 640px) {
    #aegis-cookie-banner { padding: 14px 18px; }
    .aegis-cookie-inner { gap: 14px; }
    .aegis-cookie-msg { flex-basis: 100%; font-size: 13.5px; }
    .aegis-cookie-actions { width: 100%; }
    .aegis-cookie-btn { flex: 1 1 30%; padding: 10px 8px; font-size: 13px; }
    .aegis-modal-head { padding: 18px 20px 12px; }
    .aegis-modal-body { padding: 14px 20px; }
    .aegis-modal-foot { padding: 14px 20px 18px; }
}
