/* 云奕平台主题层：只覆盖颜色令牌和基础表面，不改变任何业务布局。 */
@media screen {
 html[data-yunyi-theme-resolved="light"] body>main:has(>.code) {background:#fffefa!important;color:#234563!important;border-color:#d6dfe3!important;box-shadow:0 8px 30px #23456312!important;}
 html[data-yunyi-theme-resolved="light"] body>main:has(>.code) p {color:#536c82!important;}
}
/* 首页复查：名单弹窗、学生卡片；深色沿用原配色。 */
body.legacy-dashboard-page #missedStudentsModal:not(.active) { display:none; visibility:hidden; }
body.legacy-dashboard-page #missedStudentsModal .modal-content { background:transparent; border:0; }
body.legacy-dashboard-page .tile { min-height:88px; padding:10px 6px; }
body.legacy-dashboard-page .tile .nm { font-size:15px; line-height:1.5; }
body.legacy-dashboard-page .tile :is(.id,.sc) { font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
body.legacy-dashboard-page [role="button"]:focus-visible { outline:3px solid #358cf0; outline-offset:3px; }
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page .tile :is(.nm,.id,.sc) { color:#263e55 !important; }
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.stats-date-preset-btn.active,.student-date-preset-btn.active) { color:#fff !important; -webkit-text-fill-color:#fff !important; }
html[data-yunyi-theme-resolved="light"] #missedStudentsModal :is(.modal,.modal-content) { background:#fff !important; color:#17263a !important; }
html[data-yunyi-theme-resolved="light"] #missedStudentsModal :is(.modal-title,.modal-student-name,.modal-stat-value) { color:#17263a !important; }
html[data-yunyi-theme-resolved="light"] #missedStudentsModal :is(.modal-close,.modal-student-id,.modal-stat-label,p) { color:#526780 !important; }
html[data-yunyi-theme-resolved="light"] #missedStudentsModal :is(.modal-student-item,.modal-stat-item) { background:#f0f5fa !important; border-color:#cad9e8; }
/* 个性化任务工作台：只在明亮皮肤中替换内部表面与文字。 */
html[data-yunyi-theme-resolved="light"] {
    --bp-text:#17263a; --bp-muted:#526780; --bp-line:#c7d7e7;
}
html[data-yunyi-theme-resolved="light"] .bp-main :is(.bp-steps,.bp-scope-card,.bp-workspace,.bp-dispatch,.bp-history,.bp-summary article,.bp-roster,.bp-student-preview,.bp-check-panel,.bp-task-card,.bp-history-item,.bp-task-source div,.bp-dispatch-grid article) {
    background:#fff !important; color:#17263a !important; border-color:#c7d7e7 !important; box-shadow:0 4px 18px rgba(35,64,93,.06);
}
html[data-yunyi-theme-resolved="light"] .bp-main :is(p,small,legend,label>span,.bp-empty,.bp-task-meta,.bp-connector-note,.bp-history-item em) { color:#526780 !important; }
html[data-yunyi-theme-resolved="light"] .bp-main :is(h1,h2,h3,strong) { color:#17263a !important; }
html[data-yunyi-theme-resolved="light"] .bp-main :is(select,input:not([type="checkbox"]),textarea,.bp-student-row,.bp-mode-tab,.bp-check-panel li,.bp-roster-search,.bp-task-types span,.bp-page-head nav a) {
    background:#f4f8fc !important; color:#263e55 !important; border-color:#b9cfe4 !important;
}
html[data-yunyi-theme-resolved="light"] .bp-main :is(.bp-student-row.is-active,.bp-mode-tab.is-active),
html[data-yunyi-theme-resolved="light"] .bp-task-types input:checked+span { background:#e4f0ff !important; border-color:#2778df !important; }
html[data-yunyi-theme-resolved="light"] .bp-main .bp-mode-tab :is(button,label) { color:#235d99 !important; }
html[data-yunyi-theme-resolved="light"] .bp-main .bp-steps article { opacity:1; }
html[data-yunyi-theme-resolved="light"] .bp-main .bp-steps article b { color:#fff !important; }
html[data-yunyi-theme-resolved="light"] .bp-main :is(.bp-final-check,.bp-dispatch-result) { background:#fff7e5 !important; color:#6d4c0e !important; }
html[data-yunyi-theme-resolved="light"] :is(.bp-loading>div,.bp-toast) { background:#fff !important; color:#17263a !important; }
html[data-yunyi-theme-resolved="light"] .bp-main :is(.bp-scope-action>button,.bp-check-panel>button,.bp-dispatch-grid button,.bp-steps article b),
html[data-yunyi-theme-resolved="light"] .bp-main :is(.bp-scope-action>button,.bp-check-panel>button,.bp-dispatch-grid button) * { color:#fff !important; -webkit-text-fill-color:#fff !important; }
html[data-yunyi-theme-resolved="light"] .bp-main .bp-task-card>header { background:#eaf2fa !important; border-color:#c7d7e7 !important; }
html[data-yunyi-theme-resolved="light"] .bp-main .bp-task-source { background:#fff !important; border-color:#c7d7e7 !important; }
/* 首页个性化任务入口在两种皮肤中都保留蓝底，文字不继承全局深色。 */
#batchPracticeBtn h3,
#batchPracticeBtn .batch-home-action { color:#f5fbff !important; -webkit-text-fill-color:#f5fbff !important; }
#batchPracticeBtn p { color:#c4d9ee !important; -webkit-text-fill-color:#c4d9ee !important; }
#batchPracticeBtn .batch-home-tags span { color:#d7eaff !important; -webkit-text-fill-color:#d7eaff !important; }
html[data-yunyi-theme-resolved="navy"] {
    --bg-gradient-start: #041224;
    --bg-gradient-end: #0a2847;
    --dark-bg: #06182d;
    --card-bg: #0d223a;
    --card-hover: #15314f;
    --text-light: #edf6ff;
    --text-muted: #91a8bf;
    --border-light: rgba(115, 164, 214, .18);
    --ti-page: #06182d;
    --ti-sidebar: #082039;
    --ti-surface: #0d223a;
    --ti-surface-raised: #122b46;
    --ti-surface-dark: #071a30;
    --ti-text: #edf6ff;
    --ti-muted: #91a8bf;
    --ti-subtle: #6d88a4;
    --trc-bg: #06182d;
    --trc-bg-2: #082039;
    --trc-panel: rgba(8, 32, 57, .94);
    --trc-panel-2: rgba(11, 39, 67, .92);
    --trc-text: #f1f8ff;
    --trc-muted: #96adc2;
    --trc-subtle: #6f8aa5;
    --ga-bg: #06182d;
    --ga-bg-deep: #041224;
    --ga-panel: rgba(8, 32, 57, .94);
    --ga-panel-strong: #0a2847;
    --ga-text: #edf6ff;
    --ga-muted: #7893ae;
}

html[data-yunyi-theme-resolved="navy"],
html[data-yunyi-theme-resolved="navy"] body {
    background-color: #06182d;
}

.sidebar-theme-control {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 0 10px 10px;
    padding: 8px 9px;
    border: 1px solid rgba(103, 156, 209, .2);
    border-radius: 8px;
    background: rgba(9, 35, 61, .62);
}
.sidebar-theme-control > i { color: #60a5fa; text-align: center; }
.sidebar-theme-control label { display: grid; gap: 3px; min-width: 0; }
.sidebar-theme-control span { color: #7791ab; font-size: 10px; }
.sidebar-theme-control select {
    width: 100%;
    min-width: 0;
    height: 28px;
    padding: 0 24px 0 7px;
    border: 1px solid rgba(103, 156, 209, .22);
    border-radius: 6px;
    outline: 0;
    background: #071a30;
    color: #eaf4ff;
    font-size: 11px;
}
.sidebar.collapsed .sidebar-theme-control { display: none; }
.sidebar .sidebar-submenu { list-style:none;margin:5px 12px 9px 28px;padding:0 0 0 12px;border-left:1px solid var(--border-light); }
.sidebar .sidebar-submenu .submenu-link { display:flex;align-items:center;gap:10px;padding:10px 12px;color:var(--text-muted);font-size:14px;text-decoration:none;border-radius:7px; }
.sidebar .sidebar-submenu .submenu-link:hover,.sidebar .sidebar-submenu .submenu-link.active { color:var(--text-light);background:var(--card-hover); }
.sidebar.collapsed .sidebar-submenu { display:none; }

html[data-yunyi-theme-resolved="light"] {
    --dark-bg: #edf3fa;
    --card-bg: #ffffff;
    --card-hover: #e7eff8;
    --text-light: #17263a;
    --text-muted: #60748a;
    --border-light: rgba(43, 77, 112, .16);
    --ti-page: #edf3fa;
    --ti-sidebar: #ffffff;
    --ti-surface: #ffffff;
    --ti-surface-raised: #f6f9fc;
    --ti-surface-dark: #e7eef7;
    --ti-border: rgba(43, 77, 112, .14);
    --ti-border-strong: rgba(43, 77, 112, .24);
    --ti-text: #17263a;
    --ti-muted: #60748a;
    --ti-subtle: #75879a;
    --trc-bg: #edf3fa;
    --trc-bg-2: #f7faff;
    --trc-panel: rgba(255, 255, 255, .96);
    --trc-panel-2: rgba(247, 250, 254, .98);
    --trc-line: rgba(45, 95, 142, .24);
    --trc-line-soft: rgba(45, 95, 142, .13);
    --trc-text: #17263a;
    --trc-muted: #60748a;
    --trc-subtle: #75879a;
    --ga-bg: #edf3fa;
    --ga-bg-deep: #dfe9f4;
    --ga-panel: rgba(255, 255, 255, .97);
    --ga-panel-strong: #f5f9fd;
    --ga-line: rgba(45, 95, 142, .2);
    --ga-line-bright: rgba(47, 128, 255, .45);
    --ga-text: #17263a;
    --ga-muted: #60748a;
}

html[data-yunyi-theme-resolved="light"],
html[data-yunyi-theme-resolved="light"] body,
html[data-yunyi-theme-resolved="light"] body.ga-page {
    background: #edf3fa !important;
    color: #17263a !important;
}
html[data-yunyi-theme-resolved="light"] body:is(.ga-page) { background-image: none !important; }
html[data-yunyi-theme-resolved="light"] .sidebar {
    border-right-color: rgba(43, 77, 112, .14) !important;
    background: #ffffff !important;
    color: #17263a !important;
    box-shadow: 7px 0 28px rgba(37, 61, 89, .08) !important;
}
html[data-yunyi-theme-resolved="light"] :is(.sidebar-header,.sidebar-footer) { border-color: rgba(43, 77, 112, .13) !important; }
html[data-yunyi-theme-resolved="light"] :is(.menu-link,.submenu-link,.menu-group-title,.sidebar-footer-role) { color: #60748a !important; }
html[data-yunyi-theme-resolved="light"] :is(.menu-link:hover,.menu-link.active,.submenu-link:hover,.submenu-link.active) { background: #e8f1fb !important; color: #246fc1 !important; }

/* Shared sidebar markup is fetched in two ways across legacy and modern
   pages.  Keep nested groups valid and neutral even when the <style> block in
   sidebar.html is not inserted by a legacy loader. */
.sidebar .menu-group-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.sidebar .sidebar-footer-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(96, 165, 250, .55);
    background: linear-gradient(145deg, #2563eb, #0f766e);
    color: #fff;
    font-weight: 700;
    object-fit: initial;
}
html[data-yunyi-theme-resolved="light"] .sidebar-theme-control { border-color: rgba(43,77,112,.15); background: #f3f7fb; }
html[data-yunyi-theme-resolved="light"] .sidebar-theme-control span { color: #64788d; }
html[data-yunyi-theme-resolved="light"] .sidebar-theme-control select { border-color: rgba(43,77,112,.2); background: #fff; color: #17263a; }

html[data-yunyi-theme-resolved="light"] :is(.main-content,.ti-main,.trc-main,.ga-main) { color: #17263a; }
html[data-yunyi-theme-resolved="light"] :is(.page-header,.filter-bar,.student-performance,.weak-knowledge,.card,.ti-card,.ti-panel,.ti-modal-shell,.ti-info-shell,.trc-panel,.ga-dialog) {
    border-color: rgba(43, 77, 112, .16) !important;
    background-color: #ffffff !important;
    color: #17263a !important;
    box-shadow: 0 10px 30px rgba(37, 61, 89, .07) !important;
}
html[data-yunyi-theme-resolved="light"] :is(.filter-select,.page-size-select,.ti-filter select,.trc-filters select,.ga-filterbar select,input,textarea) {
    border-color: rgba(43, 77, 112, .2) !important;
    background-color: #f8fbfe !important;
    color: #17263a !important;
}
html[data-yunyi-theme-resolved="light"] :is(.page-title,.section-title,.ti-page-header h1,.trc-page-heading h2,.trc-panel h3,.ga-title-line h1,.ga-dialog h2,table th,table td) { color: #17263a; }
html[data-yunyi-theme-resolved="light"] .ti-info-shell :is(#infoContent,#infoContent p,#infoContent li,#infoContent strong,#infoContent b,#infoContent span) { color:#243a50!important; text-shadow:none!important; }
html[data-yunyi-theme-resolved="light"] :is(.permission-hint,.analysis-scope-tabs,.performance-tabs,table thead) { border-color: rgba(43,77,112,.14) !important; background-color: #f5f9fd !important; }
html[data-yunyi-theme-resolved="light"] :is(.progress-table tbody tr,.all-data-table tbody tr,.knowledge-table tbody tr) { border-color: rgba(43,77,112,.11) !important; }

html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.progress-overview-card,.quick-btn,.homework-grid-container,.nine-grid-container,.modal,.student-date-filter,.grid-info,.nine-grid-description,.data-card) {
    border-color: rgba(43, 77, 112, .16) !important;
    background: #ffffff !important;
    color: #17263a !important;
    box-shadow: 0 10px 30px rgba(37, 61, 89, .07) !important;
}
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.quick-btn,.data-card,.student-date-filter,.grid-info,.nine-grid-description) {
    background: #f7fafd !important;
}
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.quick-btn span,.quick-btn p,.stats-title,.ring-chart-title,.ring-chart-value,.ring-chart-label,.data-card-value,.data-card-label,.student-date-filter-title,.grid-stat-item,.nine-grid-title,.nine-grid-description) {
    color: #17263a !important;
}
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.filter-controls select,.time-range-selector select,.stats-date-input,.student-date-input) {
    border-color: rgba(43, 77, 112, .2) !important;
    background: #f8fbfe !important;
    color: #17263a !important;
}
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page :is(.stats-date-input-group,.student-date-input-group) {
    border-color: rgba(43, 77, 112, .18) !important;
    background: #f8fbfe !important;
    color: #60748a !important;
}
html[data-yunyi-theme-resolved="light"] body.legacy-dashboard-page .essay-analysis-link {
    border-color: rgba(47, 128, 255, .28) !important;
    background: #e7f1ff !important;
    color: #246fc1 !important;
}

.sidebar-submenu,
.sidebar-submenu > li {
    list-style: none !important;
}

html[data-yunyi-theme-resolved="light"] body.ga-page :is(.ga-topbar,.ga-analysis-control-deck,.ga-filterbar label,.ga-stage>article,.ga-focus,.ga-focus-card,.ga-terrain-card,.ga-constellation-card) {
    border-color: rgba(43,77,112,.16) !important;
    background-color: #ffffff !important;
    color: #17263a !important;
}
html[data-yunyi-theme-resolved="light"] body.ga-page :is(.ga-title-line h1,.ga-filterbar select,.ga-stage h2,.ga-stage h3,.ga-stage strong) { color: #17263a !important; }
html[data-yunyi-theme-resolved="light"] body.ga-page :is(.ga-title-block p,.ga-updated,.ga-filterbar span,.ga-stage p,.ga-stage small) { color: #60748a !important; }

html[data-yunyi-theme-resolved="light"] body :is(.trc-panel.is-starred,.trc-history-classroom,.ti-lecture-deck,.ga-cause-classroom,.yy-assistant) {
    /* 全屏教学和视觉图表保留深色画布，保证投屏、标注和图表对比度。 */
    color-scheme: dark;
}

/* 旧版核心页面的窄屏兜底。业务表格保留横向查阅能力，但不再撑宽整个页面。 */
@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    body:not(.legacy-dashboard-page) .main-content,
    body:not(.legacy-dashboard-page) .sidebar.collapsed ~ .main-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        padding-right: 12px !important;
        padding-left: 12px !important;
        box-sizing: border-box !important;
    }

    /* 首页没有独立的移动菜单按钮，保留可操作的图标导航栏。 */
    body.legacy-dashboard-page .sidebar {
        width: 64px !important;
        max-width: 64px !important;
    }
    body.legacy-dashboard-page .sidebar :is(.sidebar-logo h2,.menu-group-title,.menu-link span,.sidebar-submenu,.sidebar-footer,.sidebar-theme-control) {
        display: none !important;
    }
    body.legacy-dashboard-page .sidebar .sidebar-logo {
        display: none !important;
    }
    body.legacy-dashboard-page .sidebar .sidebar-header,
    body.legacy-dashboard-page .sidebar .menu-link {
        justify-content: center !important;
        padding-right: 8px !important;
        padding-left: 8px !important;
    }
    body.legacy-dashboard-page .main-content,
    body.legacy-dashboard-page .sidebar.collapsed ~ .main-content {
        width: calc(100% - 64px) !important;
        max-width: calc(100% - 64px) !important;
        min-width: 0 !important;
        margin-left: 64px !important;
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .main-content > .container-fluid,
    .main-content :is(.page-header,.filter-bar,.filter-row,.header-actions,.filter-actions,.pagination-controls,.pagination-nav,.table-container,.table-wrapper) {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .main-content :is(.page-header,.filter-bar,.filter-row,.header-actions,.filter-actions,.pagination-controls,.pagination-nav) {
        flex-wrap: wrap !important;
    }
    .main-content :is(.table-container,.table-wrapper) {
        width: 100% !important;
        overflow-x: auto !important;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
    .main-content :is(input,select,textarea) {
        max-width: 100%;
    }
}
/* Full navigation fold shared by pages that load sidebar.html dynamically. */
.yunyi-nav-reveal[hidden]{display:none!important}
.yunyi-nav-reveal{position:fixed;left:0;top:50%;transform:translateY(-50%);z-index:10050;width:34px;height:76px;border:1px solid #c9d8e7;border-radius:0 13px 13px 0;background:#fff;color:#235c96;box-shadow:5px 4px 18px #173d6626;cursor:pointer;font-size:17px}
.yunyi-nav-reveal:hover,.yunyi-nav-reveal:focus-visible{background:#eaf3ff;outline:2px solid #72a7df;outline-offset:2px}
body.yunyi-sidebar-hidden .sidebar{transform:translateX(-110%)!important;pointer-events:none!important}
@media(min-width:901px){body.yunyi-sidebar-hidden :is(.main-content,.content-wrapper,.ti-main,.trc-main,.ga-main,.do-main,.asa-main,.cpa-main,.gas-main){margin-left:0!important;width:100%!important;max-width:100%!important}body.yunyi-sidebar-hidden #sidebarContainer{pointer-events:none!important}}
@media(max-width:900px){.yunyi-nav-reveal{display:none!important}}
