.ai-learning-page .ai-learning-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

html.ai-processed .ai-learning-page {
    width: calc(100% - 100px);
    max-width: 1200px;
}

.ai-study-panel {
    position: sticky;
    top: 12px;
    z-index: 4;
    display: flex;
    height: calc(100vh - 24px);
    min-height: 420px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(35, 35, 35, .06);
    color: #333;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.ai-study-panel[hidden] {
    display: none !important;
}

.ai-study-panel,
.ai-study-panel * {
    box-sizing: border-box;
}

.ai-study-panel .ai-panel-heading {
    display: flex;
    min-height: 56px;
    padding: 0 14px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.ai-study-panel .ai-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    color: #bb0000;
    font-size: 15px;
}

.ai-study-panel .ai-brand-icon {
    display: block;
    width: 140px;
    height: auto;
    object-fit: contain;
}

.ai-study-panel .ai-generated-note {
    display: flex;
    align-items: center;
    color: #999;
    font-size: 10px;
    white-space: nowrap;
}

.ai-study-panel .ai-generated-note i {
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #2e9b55;
}

.ai-study-panel .ai-tabs {
    display: grid;
    min-height: 50px;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    padding: 6px 9px;
    gap: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.ai-study-panel .ai-tab {
    position: relative;
    padding: 0 3px;
    border: 0;
    border-radius: 4px;
    background: #f7f7f7;
    color: #777;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    transition: background-color .18s, color .18s;
}

.ai-study-panel .ai-tab:hover {
    color: #bb0000;
}

.ai-study-panel .ai-tab.is-active {
    background: #fff3f3;
    color: #bb0000;
    font-weight: 600;
}

.ai-study-panel .ai-tab.is-active::after {
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 2px;
    background: #bb0000;
    content: "";
}

.ai-study-panel .ai-tab-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 15px 13px 20px;
    scrollbar-color: #d7d7d7 transparent;
    scrollbar-width: thin;
}

.ai-study-panel .ai-tab-content::-webkit-scrollbar {
    width: 5px;
}

.ai-study-panel .ai-tab-content::-webkit-scrollbar-thumb {
    border-radius: 5px;
    background: #d7d7d7;
}

.ai-study-panel .ai-tab-pane[hidden] {
    display: none !important;
}

.ai-study-panel .ai-section-title {
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 3px solid #bb0000;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.ai-study-panel .ai-summary-title {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.ai-study-panel .ai-summary-intro,
.ai-study-panel .ai-quiz-tip,
.ai-study-panel .ai-mindmap-hint {
    margin: 0 0 13px;
    color: #888;
    font-size: 12px;
    line-height: 1.8;
}

.ai-study-panel .ai-summary-toggle {
    display: inline;
    margin-left: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #bb0000;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}

.ai-study-panel .ai-summary-toggle:hover {
    text-decoration: underline;
}

.ai-study-panel .ai-empty-state {
    display: flex;
    min-height: 150px;
    padding: 22px 10px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #999;
    font-size: 12px;
    text-align: center;
}

.ai-study-panel .ai-empty-state img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.ai-study-panel .ai-outline-card {
    position: relative;
    margin: 0 0 11px;
    padding: 12px 11px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
}

.ai-study-panel .ai-outline-list-title {
    margin: 18px 0 11px;
    padding-left: 10px;
    border-left: 3px solid #bb0000;
    color: #333;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.ai-study-panel .ai-outline-point-title {
    display: flex;
    min-width: 0;
    margin: 0 0 8px;
    align-items: flex-start;
    gap: 8px;
}

.ai-study-panel .ai-outline-point-title h3 {
    min-width: 0;
    margin: 0;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}

.ai-study-panel .ai-outline-point-badge {
    display: inline-flex;
    min-width: 34px;
    height: 21px;
    flex: 0 0 auto;
    margin-top: 2px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7e4ff;
    border-radius: 3px;
    background: #eef4ff;
    color: #4b75c8;
    font-size: 11px;
    font-weight: 600;
}

.ai-study-panel .ai-outline-card ul {
    margin: 0;
    padding-left: 16px;
    color: #777;
    font-size: 11px;
    line-height: 1.8;
}

.ai-study-panel .ai-outline-card li {
    margin: 2px 0;
}

.ai-study-panel .ai-outline-card p {
    margin: 0;
    color: #777;
    font-size: 11px;
    line-height: 1.8;
}

.ai-study-panel .ai-outline-card:hover {
    border-color: #bb0000;
    box-shadow: 0 0 0 1px rgba(187, 0, 0, .08);
}

.ai-study-panel .ai-outline-copy {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 7px;
    display: flex;
    min-width: 58px;
    height: auto;
    padding: 8px 7px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, .8);
    color: #bb0000;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s;
}

.ai-study-panel .ai-outline-copy img {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.ai-study-panel .ai-outline-card:hover .ai-outline-copy,
.ai-study-panel .ai-outline-copy:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.ai-study-panel .ai-key-facts > div {
    display: flex;
    padding: 7px 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px dashed #eee;
    font-size: 11px;
}

.ai-study-panel .ai-key-facts b {
    color: #bb0000;
    font-size: 12px;
    white-space: nowrap;
}

.ai-study-panel .ai-key-facts > div span {
    color: #888;
    text-align: right;
}

.ai-study-panel .ai-quiz-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-study-panel .ai-quiz-heading > span {
    color: #999;
    font-size: 11px;
}

.ai-study-panel .ai-quiz-loading[hidden],
.ai-study-panel .ai-quiz-results[hidden] {
    display: none !important;
}

.ai-study-panel .ai-quiz-loading {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    font-size: 12px;
}

.ai-study-panel .ai-quiz-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f2dada;
    border-top-color: #bb0000;
    border-radius: 50%;
    animation: ai-quiz-spin .8s linear infinite;
}

@keyframes ai-quiz-spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-study-panel .ai-quiz-card {
    margin: 0 0 12px;
    padding: 12px 10px;
    border: 1px solid #ededed;
    border-radius: 6px;
    background: #fff;
}

.ai-study-panel .ai-quiz-card h3 {
    display: flex;
    margin: 0 0 10px;
    align-items: flex-start;
    gap: 7px;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}

.ai-study-panel .ai-question-number {
    display: inline-flex;
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff1f1;
    color: #bb0000;
    font-size: 10px;
}

.ai-study-panel .ai-quiz-options {
    display: grid;
    gap: 6px;
}

.ai-study-panel .ai-quiz-option {
    display: flex;
    width: 100%;
    min-height: 34px;
    padding: 6px 8px;
    align-items: center;
    gap: 7px;
    border: 1px solid #ececec;
    border-radius: 4px;
    background: #fafafa;
    color: #666;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    line-height: 1.6;
    text-align: left;
    transition: border-color .15s, background-color .15s;
}

.ai-study-panel .ai-quiz-option:not(:disabled):hover {
    border-color: #d99;
    background: #fff8f8;
}

.ai-study-panel .ai-option-label {
    flex: 0 0 16px;
    color: #999;
    font-weight: 600;
}

.ai-study-panel .ai-option-text {
    min-width: 0;
    flex: 1 1 auto;
}

.ai-study-panel .ai-option-status {
    display: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.ai-study-panel .ai-quiz-option.is-correct {
    border-color: #c9dfd0;
    background: #f4faf6;
    color: #333;
}

.ai-study-panel .ai-quiz-option.is-correct .ai-option-label {
    color: #333;
    font-weight: 700;
}

.ai-study-panel .ai-quiz-option.is-correct .ai-option-status {
    display: inline-flex;
    background: #e4f3e9;
    color: #31834b;
}

.ai-study-panel .ai-quiz-option.is-correct .ai-option-status::before {
    content: "�?;
}

.ai-study-panel .ai-quiz-option.is-wrong {
    border-color: #e4c9c9;
    background: #fff7f7;
    color: #333;
}

.ai-study-panel .ai-quiz-option.is-wrong .ai-option-label,
.ai-study-panel .ai-quiz-option.is-wrong .ai-option-text {
    color: #333;
    font-weight: 600;
}

.ai-study-panel .ai-quiz-option.is-wrong .ai-option-status {
    display: inline-flex;
    background: #fbe7e7;
    color: #c43d3d;
}

.ai-study-panel .ai-quiz-option.is-wrong .ai-option-status::before {
    content: "×";
}

.ai-study-panel .ai-quiz-option:disabled {
    cursor: default;
}

.ai-study-panel .ai-quiz-feedback {
    margin-top: 9px;
    padding: 9px;
    border: 1px solid #f1d1d1;
    border-radius: 4px;
    background: #fffafa;
    color: #777;
    font-size: 11px;
    line-height: 1.7;
}

.ai-study-panel .ai-quiz-feedback[hidden] {
    display: none !important;
}

.ai-study-panel .ai-quiz-feedback strong {
    display: block;
    margin-bottom: 3px;
    color: #bb0000;
}

.ai-study-panel .ai-quiz-feedback .ai-quiz-explanation {
    margin: 0;
}

.ai-study-panel .ai-mindmap-preview {
    position: relative;
    height: 300px;
    overflow: hidden;
    border: 1px solid #e6eef7;
    border-radius: 5px;
    background: #fff;
    cursor: zoom-in;
}

@media (min-width: 821px) {
    .ai-study-panel #ai-tab-mindmap.is-active {
        display: flex;
        min-height: 100%;
        flex-direction: column;
    }

    .ai-study-panel #ai-tab-mindmap .ai-mindmap-preview {
        min-height: 0;
        flex: 1 1 auto;
    }
}

.ai-study-panel .ai-mindmap-preview-canvas {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ai-study-panel .ai-mindmap-preview-canvas .jsmind-inner {
    overflow: auto !important;
}

.ai-mindmap-preview-hint {
    position: absolute;
    z-index: 3;
    right: 18px;
    top: 8px;
    padding: 6px 10px;
    border: 0;
    border-radius: 4px;
    background: #c62828;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
}

.ai-mindmap-error {
    padding: 24px 12px;
    color: #b33;
    font-size: 12px;
    text-align: center;
}

.ai-mindmap-modal[hidden] {
    display: none !important;
}

.ai-mindmap-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .56);
}

.ai-mindmap-dialog {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: min(850px, 92vh);
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .24);
}

.ai-mindmap-dialog-header {
    display: flex;
    min-height: 54px;
    padding: 0 18px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.ai-mindmap-dialog-header h2 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.ai-mindmap-dialog-actions {
    display: flex;
    gap: 8px;
}

.ai-mindmap-dialog-actions button {
    width: 32px;
    height: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
    color: #555;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
}

.ai-mindmap-dialog-actions button:hover {
    border-color: #1688e8;
    color: #1688e8;
}

.ai-mindmap-dialog-canvas {
    width: 100%;
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.ai-mindmap-dialog-canvas .jsmind-inner {
    min-width: 100%;
    min-height: 100%;
}

body.ai-mindmap-modal-open {
    overflow: hidden;
}

.ai-learning-page .learning-main-column {
    min-width: 0;
}

.ai-learning-page .learning-main-column > .tab-wrap,
.ai-learning-page .learning-main-column > .tab-wrap .nav-box {
    width: 100%;
}

.ai-learning-page .learning-main-column .content-box {
    width: 100%;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box video,
html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box .course-poster {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box {
    display: flex;
    width: 280px;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    flex: 0 0 280px;
    box-sizing: border-box;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box .wrap {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box .wrap .lesson-button {
    display: flex;
    min-width: 0;
    padding-right: 52px;
    align-items: flex-start;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box .wrap .lesson-button em {
    flex: 0 0 30px;
}

html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box .wrap .lesson-button label {
    display: block;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
}

@media (max-width: 1100px) {
    html.ai-processed .ai-learning-page .ai-learning-layout {
        grid-template-columns: 250px minmax(0, 1fr);
        gap: 14px;
    }

    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box {
        width: auto;
    }

    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box {
        width: 235px;
        flex-basis: 235px;
    }
}

@media (min-width: 821px) {
    html.ai-processed .ai-learning-page {
        width: calc(100% - 64px);
        max-width: 1600px;
    }
}

@media (max-width: 820px) {
    html.ai-processed .ai-learning-page .ai-learning-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-study-panel {
        position: relative;
        top: auto;
        height: 450px;
        min-height: 0;
    }

    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top {
        flex-direction: column;
    }

    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box,
    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .list-box {
        width: 100%;
        flex-basis: auto;
    }

    html.ai-processed .ai-learning-page .learning-main-column .content-box .card .card-top .video-box {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
}

html:not(.ai-processed) .ai-learning-page .ai-learning-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

html:not(.ai-processed) .ai-study-panel {
    display: none;
}

html:not(.ai-processed) .ai-learning-page .learning-main-column {
    width: 100%;
}

html.ai-processed .ai-learning-page .once3 .comment-box .write-box,
html.ai-processed .ai-learning-page .once3 .comment-box .comment-wrap .comment-items {
    display: flex;
    align-items: flex-start;
}

html.ai-processed .ai-learning-page .once3 .comment-box img.head {
    flex: 0 0 50px;
    box-sizing: border-box;
}

html.ai-processed .ai-learning-page .once3 .comment-box .write-box .write,
html.ai-processed .ai-learning-page .once3 .comment-box .comment-wrap .comment-items .comment {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
}
