/* 教师端·私有题库数字资产 */
body[data-page="teacher"] {
    --library-navy: #163a53;
    --library-blue: #286e9d;
    --library-blue-soft: #edf6fb;
    --library-green: #287457;
    --library-ink: #1f3541;
    --library-muted: #73828a;
    --library-line: #dce5e8;
}

.teacher-library-card {
    padding: clamp(22px, 3vw, 34px) !important;
    overflow: hidden;
    border: 1px solid #dce5e8;
    border-radius: 20px !important;
    box-shadow: 0 18px 48px rgba(32, 66, 83, .08) !important;
}

.teacher-library-heading { align-items: flex-start !important; margin-bottom: 20px; }
.teacher-library-heading h3 { margin: 4px 0 7px !important; color: var(--library-ink) !important; font-size: 25px !important; }
.teacher-library-heading .section-subtitle { max-width: 760px; line-height: 1.7; }
.teacher-library-kicker { color: var(--library-blue); font-size: 12px; font-weight: 780; letter-spacing: .12em; }
body[data-page="teacher"] .teacher-library-create { min-height: 44px; padding: 0 18px !important; border-radius: 11px !important; font-weight: 720; }
.teacher-library-create span { margin-right: 5px; font-size: 18px; }

.teacher-library-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.teacher-library-summary > div {
    padding: 16px 18px;
    border: 1px solid #dce7ec;
    border-radius: 14px;
    background: linear-gradient(145deg, #f8fbfc, #fff);
}

.teacher-library-summary strong { display: block; color: var(--library-navy); font-size: 24px; line-height: 1; }
.teacher-library-summary span { display: block; margin-top: 7px; color: var(--library-muted); font-size: 12px; }

.teacher-library-asset {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 12px;
    padding: 19px 20px !important;
    border: 1px solid #e0e8eb !important;
    border-radius: 15px !important;
    background: #fff;
}

.teacher-library-asset:hover { border-color: #bad0db !important; box-shadow: 0 10px 25px rgba(31, 76, 99, .07); }
.teacher-library-asset .announcement-admin-title { flex-wrap: wrap; }
.teacher-library-asset .announcement-admin-title strong { color: var(--library-ink); font-size: 16px; }
.teacher-library-asset p { margin: 8px 0 0; color: #697b84; line-height: 1.65; }
.teacher-library-asset .announcement-meta { margin-top: 10px; color: #8a989e; }
.teacher-library-asset .announcement-actions { display: flex; gap: 8px; }
.teacher-library-asset .announcement-actions .btn { min-height: 38px; border-radius: 9px; }

.library-asset-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
}

.library-asset-badge.private { color: #37607a; background: #edf5fa; }
.library-asset-badge.target { color: #287457; background: #edf8f3; }
.library-asset-badge.draft { color: #826320; background: #fff7de; }
.library-asset-badge.published { color: #276d50; background: #eaf7f1; }

.teacher-library-modal {
    width: min(1120px, calc(100vw - 32px)) !important;
    max-width: 1120px !important;
    max-height: 94vh !important;
    padding: 0 !important;
    overflow: auto;
    border-radius: 20px !important;
    box-shadow: 0 30px 85px rgba(13, 42, 57, .28);
}

.teacher-library-modal-head {
    position: sticky;
    z-index: 5;
    top: 0;
    margin: 0 !important;
    padding: 22px 27px !important;
    border-bottom-color: #dce5e8 !important;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(15px);
}

.teacher-library-modal-head span { color: var(--library-blue); font-size: 12px; font-weight: 780; letter-spacing: .08em; }
.teacher-library-modal-head h3 { margin-top: 4px; color: var(--library-ink) !important; font-size: 21px !important; }

.teacher-library-builder { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 590px; }
.teacher-library-toolbox { padding: 24px; border-right: 1px solid #dfe7ea; background: #f5f9fb; }
.teacher-library-editor { min-width: 0; padding: 25px 28px; }
.teacher-library-primary-field { display: grid; gap: 7px; color: #516771; font-size: 12px; font-weight: 700; }
.teacher-library-primary-field select,
.teacher-library-generator input,
.teacher-library-generator select,
.teacher-library-generator textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #ccdbe1;
    border-radius: 9px;
    color: #29424e;
    background: #fff;
    font: inherit;
}

.teacher-library-tool-heading { margin: 24px 0 10px; }
.teacher-library-tool-heading strong { display: block; color: var(--library-ink); font-size: 14px; }
.teacher-library-tool-heading small { display: block; margin-top: 3px; color: #87969d; font-size: 12px; }
.teacher-library-tools { display: grid; gap: 8px; }
.teacher-library-tools button {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 11px;
    border: 1px solid #d6e2e7;
    border-radius: 11px;
    color: #49616d;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.teacher-library-tools button > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: #eef5f8; font-size: 18px; }
.teacher-library-tools button strong { display: block; color: #294550; font-size: 13px; }
.teacher-library-tools button small { display: block; margin-top: 3px; color: #84949b; font-size: 12px; line-height: 1.4; }
.teacher-library-tools button.active { border-color: #78aeca; background: #edf7fc; box-shadow: 0 0 0 2px rgba(66, 132, 168, .1); }
.teacher-library-tools button.active > span { color: #fff; background: linear-gradient(145deg, var(--library-blue), var(--library-navy)); }

.teacher-library-generator { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #dbe6ea; }
.teacher-library-generator label { display: grid; gap: 5px; color: #60747e; font-size: 12px; font-weight: 650; }
.teacher-library-generator .generator-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.teacher-library-generator textarea { min-height: 70px; resize: vertical; }
body[data-page="teacher"] .teacher-library-generate { width: 100%; min-height: 43px; margin-top: 13px; border-radius: 10px !important; }

.teacher-library-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 13px; }
.teacher-library-editor .form-item { margin-bottom: 15px; }
.teacher-library-editor .form-item label { color: #455d68; font-size: 12px; font-weight: 700; }
.teacher-library-editor .form-item input,
.teacher-library-editor .form-item select,
.teacher-library-editor .form-item textarea { border-color: #d4dfe3; border-radius: 9px; }
.teacher-library-editor .form-item input:focus,
.teacher-library-editor .form-item select:focus,
.teacher-library-editor .form-item textarea:focus { outline: 3px solid rgba(40, 110, 157, .11); border-color: #79abc7; }
.teacher-library-content-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.teacher-library-content-label span { color: #829198; font-size: 12px; }
.teacher-library-content-field textarea { width: 100%; min-height: 245px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.75; }

.teacher-library-targets { margin: 18px 0 0; padding: 19px; border: 1px solid #d9e4e8; border-radius: 14px; background: #fbfdfd; }
.teacher-library-targets legend { padding: 0 8px; color: var(--library-ink); font-size: 14px; font-weight: 750; }
.teacher-library-targets > p { margin: 0 0 13px; color: #76878e; font-size: 12px; line-height: 1.6; }
.teacher-library-target-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.teacher-library-target-tabs button { min-height: 34px; padding: 0 12px; border: 1px solid #d8e3e7; border-radius: 8px; color: #647983; background: #fff; cursor: pointer; font-size: 12px; font-weight: 680; }
.teacher-library-target-tabs button.active { color: #fff; border-color: var(--library-green); background: var(--library-green); }
.teacher-library-target-panel { display: none; max-height: 205px; overflow: auto; }
.teacher-library-target-panel.active { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.teacher-library-target-option { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid #dee7e9; border-radius: 9px; background: #fff; cursor: pointer; }
.teacher-library-target-option:has(input:checked) { border-color: #8bbda9; background: #f0f8f4; }
.teacher-library-target-option input { width: 16px; height: 16px; accent-color: var(--library-green); }
.teacher-library-target-option span { min-width: 0; color: #405963; font-size: 12px; }
.teacher-library-target-option small { display: block; margin-top: 2px; overflow: hidden; color: #89979c; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.teacher-library-target-empty { grid-column: 1 / -1; padding: 18px; color: #84939a; text-align: center; }

.teacher-library-footer { display: flex; position: sticky; z-index: 4; bottom: 0; align-items: center; justify-content: space-between; gap: 18px; margin: 0 !important; padding: 17px 27px !important; border-top-color: #dae4e8 !important; background: rgba(255, 255, 255, .97); backdrop-filter: blur(15px); }
.teacher-library-footer > span { color: #7d8d94; font-size: 12px; }
.teacher-library-footer > span.error { color: #b42318; font-weight: 700; }
body[data-page="teacher"] .teacher-library-footer .btn { min-height: 40px; border-radius: 9px; }

@media (max-width: 850px) {
    .teacher-library-builder { grid-template-columns: 1fr; }
    .teacher-library-toolbox { border-right: 0; border-bottom: 1px solid #dfe7ea; }
    .teacher-library-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .teacher-library-generator .generator-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .teacher-library-heading { display: grid !important; }
    .teacher-library-create { width: 100%; }
    .teacher-library-summary { grid-template-columns: 1fr; }
    .teacher-library-asset { grid-template-columns: 1fr; }
    .teacher-library-asset .announcement-actions { width: 100%; }
    .teacher-library-asset .announcement-actions .btn { flex: 1; }
    .teacher-library-modal { width: calc(100vw - 16px) !important; max-height: 96vh !important; border-radius: 15px !important; }
    .teacher-library-modal-head { padding: 17px !important; }
    .teacher-library-toolbox, .teacher-library-editor { padding: 18px 16px; }
    .teacher-library-tools { grid-template-columns: 1fr; }
    .teacher-library-editor-grid { grid-template-columns: 1fr; gap: 0; }
    .teacher-library-target-panel.active { grid-template-columns: 1fr; }
    .teacher-library-footer { align-items: stretch; flex-direction: column; padding: 14px 16px !important; }
    .teacher-library-footer > span { display: none; }
    .teacher-library-footer > div { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
    .teacher-library-footer .btn { margin: 0 !important; }
}
