body.se-explore-shell {
    --se-nav-w: 208px;
    --se-tools-top: 28px;
    --se-search-offset: 64px;
    --se-search-height: 52px;
    --se-search-content-top: calc(var(--se-tools-top) + var(--se-search-offset) + var(--se-search-height) + 12px);
    --explore-ink: #edf7ff;
    --explore-line: rgba(179, 210, 242, .2);
    --explore-panel: #142941;
    isolation: isolate;
}

html[data-theme='light'] body.se-explore-shell {
    --explore-ink: #234c70;
    --explore-line: rgba(71, 139, 185, .22);
    --explore-panel: #edf8ff;
}

body.se-inner-on {
    --se-nav-w: 0px;
}

body.se-inner-on #app-nav,
body.se-inner-on #app-bottom {
    display: none !important;
}

body.se-explore-shell::before,
body.se-explore-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

body.se-explore-shell::before {
    background: #0d1e39;
}

body.se-explore-shell::after {
    background: url('figma/explore-pattern-dark.webp') center / 658px repeat;
    opacity: .065;
}

html[data-theme='light'] body.se-explore-shell::before {
    background: #e7f6ff url('figma/login-light.webp') center / cover no-repeat;
}

html[data-theme='light'] body.se-explore-shell::after {
    background-image: url('figma/explore-pattern-light.webp');
    opacity: .15;
}

.explore-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body.se-nav-on #app-nav {
    padding: 0;
    overflow-y: auto;
    background: rgba(22, 43, 67, .8);
    border-right: 1px solid var(--explore-line);
}

html[data-theme='light'] body.se-nav-on #app-nav {
    background: rgba(226, 244, 255, .75);
}

body.se-nav-on .app-nav-logo {
    padding: 32px 24px 44px;
}

body.se-nav-on .app-nav-logo a {
    text-decoration: none !important;
}

.app-nav-brand {
    color: #8bd5fa !important;
    font-size: 25px;
    font-weight: 800;
    white-space: nowrap;
}

html[data-theme='light'] .app-nav-brand {
    color: #298dc3 !important;
}

body.se-nav-on .app-nav-list {
    gap: 0;
}

body.se-nav-on .app-nav-item {
    height: clamp(44px, calc((100dvh - 110px) / 6), 78px);
    padding: 0 26px;
    gap: 16px;
    border: 0;
    border-radius: 0;
    font-size: 18px;
    color: var(--explore-ink) !important;
}

body.se-nav-on .app-nav-item img,
body.se-nav-on .app-nav-item i {
    width: 42px;
    height: 42px;
    object-fit: contain;
    font-size: 30px;
    line-height: 42px;
    text-align: center;
}

/* 按素材的实际图案面积校准，保留统一的图标槽位。 */
body.se-nav-on .app-nav-item[data-frame='starword'] img {
    box-sizing: border-box;
    padding: 2px;
}

body.se-nav-on .app-nav-item[data-frame='profile'] img {
    box-sizing: border-box;
    padding: 5px;
}

html[data-theme] body.se-nav-on .app-nav-item.active {
    background: #40bdf0;
    color: #fff !important;
}

body.se-nav-on .app-nav-more {
    position: relative;
}

body.se-nav-on .app-nav-more-toggle {
    width: 100%;
    text-align: left;
    font-family: inherit;
    background: transparent;
}

#tools-settings-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    padding: 6px;
    border: 0;
    border-bottom: 5px solid #cba100;
    border-radius: 17px;
    background: #ffd117;
    cursor: pointer;
}

.app-nav-menu-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#app-nav-sub {
    display: none;
}

body.se-explore-shell #app-nav-sub {
    position: fixed;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: min(220px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    background: var(--explore-panel);
    border: 1px solid var(--explore-line);
    border-radius: 16px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    z-index: 1100;
}

body.se-explore-shell #app-nav-sub.is-open {
    display: flex;
}

body.se-explore-shell #app-title {
    top: 0;
    width: 372px;
    height: 85px;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 372 85'%3E%3Cpath d='M0 0 L37 76 Q45 85 58 85 H314 Q327 85 335 76 L372 0' fill='none' stroke='%23cfeaff' stroke-width='1.6' stroke-opacity='0.42'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 40px;
    font-weight: 800;
    color: var(--explore-ink);
    text-align: center;
    letter-spacing: 0;
}

html[data-theme='light'] body.se-explore-shell #app-title {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 372 85'%3E%3Cpath d='M0 0 L37 76 Q45 85 58 85 H314 Q327 85 335 76 L372 0 Z' fill='%239cccf8' fill-opacity='0.55'/%3E%3Cpath d='M0 0 L37 76 Q45 85 58 85 H314 Q327 85 335 76 L372 0' fill='none' stroke='%23ffffff' stroke-width='2' stroke-opacity='0.9'/%3E%3C/svg%3E");
}

body.se-explore-shell #app-title::before,
body.se-explore-shell #app-title::after {
    content: "\2726";
    margin: 0 26px;
    color: #5fc7f2;
    font-size: 14px;
    text-shadow: 0 0 8px rgba(70, 190, 236, .5);
}

html[data-theme='light'] body.se-explore-shell #app-title::before,
html[data-theme='light'] body.se-explore-shell #app-title::after {
    color: #3fb9e8;
}

@media screen and (orientation: portrait) and (max-width: 1024px), screen and (max-width: 760px), screen and (orientation: landscape) and (max-width: 1000px) and (max-height: 500px) {
    #app-title {
        display: none !important;
    }
}

body.se-explore-shell #app-panel {
    top: 28px;
    left: calc(var(--se-nav-w) + 28px);
}

html[data-theme] body.se-explore-shell #app-panel .panel-card {
    min-width: 0;
    padding: 0;
    gap: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.se-explore-shell #app-panel .panel-avatar-wrap,
body.se-explore-shell #app-panel .panel-avatar {
    width: 58px;
    height: 58px;
    box-sizing: border-box;
}

/* 头像外圈即经验进度：深色段表示当前等级进度，浅色段为未满部分 */
body.se-explore-shell #app-panel .panel-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #e08f00 0 var(--lv-pct, 0%), #ffc21a var(--lv-pct, 0%) 100%);
}

body.se-explore-shell #app-panel .panel-avatar-wrap::after {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: #fff;
}

body.se-explore-shell #app-panel .panel-avatar {
    position: relative;
    inset: auto;
    transform: none;
    z-index: 1;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #eaf4ff;
    box-shadow: none;
}

body.se-explore-shell #app-panel .panel-info {
    padding: 0;
    border: 0;
}

/* 统计行容器：默认不改变既有网格排布，仅语义云内作为独立一行使用 */
#app-panel .panel-stats {
    display: contents;
}

body.se-explore-shell #app-panel .panel-nick {
    display: grid;
    grid-template-areas: "nick level" "stats stats";
    grid-template-columns: auto auto;
    justify-content: start;
    align-items: center;
    gap: 8px 10px;
    color: var(--explore-ink) !important;
}

body.se-explore-shell #app-panel .panel-nick-text {
    grid-area: nick;
    max-width: 200px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.15;
    color: inherit !important;
}

body.se-explore-shell #app-panel .panel-level-badge {
    grid-area: level;
    margin: 0;
    justify-self: start;
    width: auto;
    height: auto;
    border: 0;
    background: #1e9df4;
    box-shadow: none;
}

body.se-explore-shell #app-panel .panel-level-fill {
    background: transparent;
}

body.se-explore-shell #app-panel .panel-level-badge .panel-level-text {
    padding: 5px 11px;
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
}

html[data-theme] body.se-explore-shell #app-panel .panel-level-badge .panel-level-text {
    color: #fff !important;
}

body.se-explore-shell #app-panel .panel-level-clip {
    display: none;
}

body.se-explore-shell #app-panel .panel-stats {
    grid-area: stats;
    display: flex;
    align-items: center;
    gap: 18px;
}

body.se-explore-shell #app-panel .panel-gold,
body.se-explore-shell #app-panel .panel-credit {
    margin: 0;
    gap: 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--explore-ink) !important;
}

body.se-explore-shell #app-panel .panel-gold img,
body.se-explore-shell #app-panel .panel-credit img {
    display: none;
}

body.se-explore-shell #app-panel .panel-gold::before,
body.se-explore-shell #app-panel .panel-credit::before {
    content: "";
    flex: none;
    width: 26px;
    height: 26px;
}

body.se-explore-shell #app-panel .panel-gold::before {
    background: url("figma/semantic-gold.png") center / contain no-repeat;
}

body.se-explore-shell #app-panel .panel-credit::before {
    background: url("figma/semantic-credit.png") center / contain no-repeat;
}

html[data-theme] body.se-inner-on #app-panel .panel-card {
    align-items: flex-start;
}

/* 返回按钮外观统一在 style3.css 中定义，这里只处理内页的焦点环 */
body.se-inner-on #app-panel .panel-back:focus-visible {
    outline: 3px solid #40bdf0;
    outline-offset: 3px;
}

body.se-inner-on #app-panel .panel-avatar-wrap {
    width: 54px;
    height: 54px;
}

body.se-inner-on #app-panel .panel-avatar {
    width: 40px;
    height: 40px;
}

body.se-inner-on #app-panel .panel-info {
    padding-top: 2px;
}

body.se-inner-on #app-panel .panel-nick-text {
    max-width: min(200px, calc(50vw - 300px));
}

body.se-explore-shell #tools-div {
    top: var(--se-tools-top);
    right: 28px;
    display: flex !important;
    gap: 12px;
    padding: 0;
}

html[data-theme] body.se-explore-shell #tools-div {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.se-explore-shell #tools-div .tool-block {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    float: none;
    flex: none;
    width: 54px;
    background: transparent;
}

body.se-explore-shell #tools-search-btn,
body.se-explore-shell #tools-help-btn,
body.se-explore-shell #tools-settings-btn {
    position: static;
    width: 54px;
    height: 54px;
    margin: 0;
    border: 0;
    border-bottom: 5px solid #4b9f00;
    border-radius: 17px;
    background: #8ada16 url('figma/nav-search.webp') center / 42px no-repeat;
    cursor: pointer;
}

body.se-explore-shell #tools-settings-btn {
    padding: 6px;
    border-bottom-color: #cba100;
    background: #ffd117;
}

#tools-div .tool-settings {
    display: none;
}

body.se-explore-shell #tools-div .tool-settings {
    display: block;
}

#tools-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-image: none;
}

#tools-help-btn .tool-theme-icon,
.tool-theme-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.se-explore-shell #tools-help-btn {
    padding: 6px;
    border-bottom-color: #2391c7;
    background: #40bdf0;
    font-size: 26px;
}

body.se-explore-shell #tools-help-btn i {
    color: #fff !important;
}

body.se-explore-shell #tools-div .tool-search .input {
    position: absolute;
    top: var(--se-search-offset);
    right: 0;
    width: min(360px, calc(100vw - 32px));
    height: var(--se-search-height);
    box-sizing: border-box;
    padding: 0 18px;
    border: 1px solid var(--explore-line);
    border-radius: 14px;
    font-size: 16px;
    visibility: hidden;
    transition-property: background-color, border-color, box-shadow;
}

body.se-explore-shell #tools-div .tool-search .input:focus {
    border-color: var(--se-accent, #8bd5fa);
    box-shadow: 0 0 0 4px var(--se-accent-soft, rgba(64, 189, 240, .14));
    outline: none;
}

body.se-explore-shell #tools-div .tool-search.search-open .input {
    visibility: visible;
}

/* 检索面板从工具栏下方展开（输入框 + 补全列表同一块），不再横向挤占标题牌的位置 */
body.se-explore-shell #tools-div .tool-search {
    position: static;
}

body.se-explore-shell #tools-div .tool-dict {
    top: calc(var(--se-search-offset) + var(--se-search-height) + 8px);
    right: 0;
    width: min(360px, calc(100vw - 32px));
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list {
    max-height: 320px;
    margin: 0;
    padding: 6px;
    box-sizing: border-box;
    overflow-y: auto;
    line-height: 1.4;
    background: #1a212c;
    border: 1px solid var(--se-card-border, #3a4456);
    border-radius: 14px;
    box-shadow: var(--se-shadow, 0 6px 20px rgba(0, 0, 0, .35));
}

:root[data-theme='light'] body.se-explore-shell #tools-div .tool-dict ul.sense-list {
    background: #ffffff;
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list li {
    min-height: 0;
    margin: 0;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 100%;
    color: var(--se-text, #d2d7df) !important;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list li:hover,
body.se-explore-shell #tools-div .tool-dict ul.sense-list li.sel {
    background: var(--se-accent-soft, rgba(64, 189, 240, .14));
    color: var(--se-strong, #ffffff) !important;
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list::-webkit-scrollbar {
    width: 8px;
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list::-webkit-scrollbar-thumb {
    background: var(--se-card-border, #3a4456);
    border-radius: 4px;
}

body.se-explore-shell #tools-div .tool-dict ul.sense-list::-webkit-scrollbar-track {
    background: transparent;
}

/* 词典详情卡：与检索面板同宽同位置，标题只放词头+词性，记忆法说明移到正文 */
body.se-explore-shell #dict-div {
    width: min(360px, calc(100vw - 32px));
    max-width: 360px;
    right: 16px;
}

body.se-explore-shell #dict-div .form {
    background: #1a212c !important;
    border: 1px solid var(--se-card-border, #3a4456) !important;
    border-radius: 18px !important;
    box-shadow: var(--se-shadow, 0 6px 20px rgba(0, 0, 0, .35)) !important;
}

:root[data-theme='light'] body.se-explore-shell #dict-div .form {
    background: #ffffff !important;
    border-color: var(--se-card-border, #d5d9e0) !important;
}

body.se-explore-shell #dict-div #dict-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px 18px 10px;
    font-size: 22px;
    line-height: 1.3;
    text-align: left;
}

body.se-explore-shell #dict-div #dict-text {
    max-height: min(60vh, 520px);
    overflow-y: auto;
    padding: 12px 18px 16px;
}

/* 义项改成卡片流式排布：随内容自适应宽度、自动折行 */
body.se-explore-shell #dict-div #dict-text .expList {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 2px 0 10px;
    list-style: none;
}

body.se-explore-shell #dict-div #dict-text .expList li {
    list-style: none;
    margin: 0;
    padding: 5px 11px;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    font-size: 13.5px;
    line-height: 1.45;
    text-align: left;
    word-break: break-word;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}

body.se-explore-shell #dict-div #dict-text .expList li:hover {
    border-color: var(--se-accent-line, #7c8fff);
    background: var(--se-accent-soft, rgba(124, 143, 255, .16));
}

:root[data-theme='light'] body.se-explore-shell #dict-div #dict-text .expList li {
    background: #f5f7fb;
    border-color: #e3e8f0;
}

:root[data-theme='light'] body.se-explore-shell #dict-div #dict-text .expList li:hover {
    background: var(--se-accent-soft, rgba(124, 143, 255, .12));
    border-color: var(--se-accent-line, #7c8fff);
}

body.se-explore-shell #dict-div #dict-text .mnemonicRow {
    color: var(--se-text);
    opacity: .85;
    font-size: 13.5px;
    line-height: 1.55;
    text-align: left;
}

body.se-explore-shell #dict-div #dict-text::-webkit-scrollbar {
    width: 8px;
}

body.se-explore-shell #dict-div #dict-text::-webkit-scrollbar-thumb {
    background: var(--se-card-border, #3a4456);
    border-radius: 4px;
}

body.se-explore-shell #dict-div #dict-text::-webkit-scrollbar-track {
    background: transparent;
}

body.se-nav-on #app-bottom {
    display: none;
}

body.se-nav-on #nebula-div,
body.se-nav-on #starword-div {
    --entry-viewport-top: 112px;
    display: block;
    top: var(--entry-viewport-top) !important;
    bottom: 0;
    left: calc(var(--se-nav-w) + 32px) !important;
    width: calc(100vw - var(--se-nav-w) - 64px) !important;
    height: auto !important;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

body.se-nav-on #starword-div {
    scrollbar-gutter: stable both-edges;
}

@media screen and (orientation: portrait), screen and (max-width: 760px), screen and (orientation: landscape) and (max-width: 1000px) and (max-height: 500px) {
    body.se-nav-on #starword-div {
        overflow: hidden;
        scrollbar-gutter: auto;
    }
}

@media screen and (max-width: 760px) and (max-height: 500px), screen and (orientation: landscape) and (max-width: 1000px) and (max-height: 500px) {
    body.se-nav-on #starword-div {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }
}

@media screen and (orientation: landscape) and (max-width: 1000px) and (max-height: 340px) {
    body.se-nav-on #starword-div {
        --entry-viewport-top: 96px;
    }
}

.nebula-scene,
.starword-wrap {
    --entry-semantic-color: #40bdf0;
    --entry-semantic-shadow: #278fb9;
    --entry-teaching-color: #c97bf4;
    --entry-teaching-shadow: #914bbb;
    --entry-skill-color: #ffce0a;
    --entry-skill-shadow: #c59500;
    --entry-color-color: #60cf00;
    --entry-color-shadow: #429700;
    --entry-width: 1040px;
    --entry-height: 112px;
    --entry-row-gap: 80px;
    --entry-top: 32px;
    --entry-helper-size: 190px;
    --entry-helper-gap: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    box-sizing: border-box;
    padding: 32px 0;
}

.starword-wrap {
    justify-content: flex-start;
}

@media screen and (orientation: landscape) {
    .starword-wrap {
        --starword-top-padding: max(32px, calc((100vh - var(--entry-viewport-top) - var(--entry-top) - 2 * var(--entry-height) - var(--entry-row-gap) - var(--entry-helper-gap) - var(--entry-helper-size)) / 2));
        padding-top: var(--starword-top-padding);
        padding-bottom: 82px;
    }
}

body.se-nav-on #nebula-div #nebula_ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--entry-row-gap) 64px;
    width: min(100%, var(--entry-width));
    height: auto;
    padding: var(--entry-top) 0 0;
    margin: 0;
}

html[data-theme] body.se-nav-on #nebula_ul li.nebula-card {
    top: auto;
    width: 100%;
    height: var(--entry-height);
    margin: 0;
    padding: 20px 24px 20px 166px;
    overflow: visible;
    border: 0;
    border-radius: 20px;
    background: var(--cloud-color);
    box-shadow: 0 9px 0 var(--cloud-shadow);
    cursor: pointer;
    opacity: 1;
    transition: transform .15s, box-shadow .15s;
}

body.se-nav-on #nebula_ul .card-semantic {
    --cloud-color: var(--entry-semantic-color);
    --cloud-shadow: var(--entry-semantic-shadow);
}

body.se-nav-on #nebula_ul .card-teaching {
    --cloud-color: var(--entry-teaching-color);
    --cloud-shadow: var(--entry-teaching-shadow);
}

body.se-nav-on #nebula_ul .card-skill {
    --cloud-color: var(--entry-skill-color);
    --cloud-shadow: var(--entry-skill-shadow);
}

body.se-nav-on #nebula_ul .card-color {
    --cloud-color: var(--entry-color-color);
    --cloud-shadow: var(--entry-color-shadow);
}

html[data-theme] body.se-nav-on #nebula_ul li.nebula-card:hover {
    transform: translateY(-4px);
}

body.se-nav-on #nebula_ul .nebula-icon {
    position: absolute;
    left: 10px;
    top: -30px;
    width: 150px;
    height: 144px;
}

body.se-nav-on #nebula_ul .nebula-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

body.se-nav-on #nebula_ul .nebula-text {
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    gap: 6px;
}

body.se-nav-on #nebula_ul .nebula-title {
    color: #fff !important;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
}

body.se-nav-on #nebula_ul .nebula-hint {
    display: block;
    margin: 0;
    color: #fff !important;
    font-size: 13px;
    opacity: .9;
}

body.se-nav-on #nebula-div #nebula-helper {
    position: relative;
    inset: auto;
    transform: none;
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 12px;
    width: min(100%, 600px);
    margin: var(--entry-helper-gap) 0 0 max(0px, calc((100% - var(--entry-width)) / 2 - 120px));
}

.nebula-helper-toggle {
    flex: 0 0 var(--entry-helper-size);
    width: var(--entry-helper-size);
    height: var(--entry-helper-size);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

body.se-nav-on #nebula-div #nebula-helper .nebula-helper-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

html[data-theme] body.se-nav-on #nebula-div #nebula-helper .nebula-helper-dialog {
    position: relative;
    inset: auto;
    transform: none;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: 340px;
    margin: 0;
    padding: 18px 30px 18px 20px;
    border: 1px solid var(--explore-line);
    border-radius: 18px;
    background: var(--explore-panel);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .1);
}

html[data-theme] body.se-nav-on #nebula-div #nebula-helper .nebula-helper-dialog-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--explore-ink) !important;
}

.nebula-helper-close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

body.se-nav-on #galaxy-page {
    top: 112px;
    bottom: 0;
    left: var(--se-nav-w);
    width: calc(100% - var(--se-nav-w));
    height: auto;
    padding: 0 24px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    transform: none;
}

.galaxy-course-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

body.se-nav-on #galaxyList,
body.se-nav-on #btnShowGalaxyList {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    transform: none;
}

body.se-nav-on #btnShowGalaxyList .btnRectMain {
    height: 42px;
    padding: 0 14px;
    font-size: 22px;
    line-height: 42px;
    border: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

body.se-nav-on #btnShowGalaxyList .btnRectMain::before,
body.se-nav-on #btnShowGalaxyList .btnRectMain::after {
    display: none;
}

body.se-nav-on #btnShowGalaxyList .btnRectMain .inner {
    padding: 0 8px;
    background: none;
    color: #75c7f1 !important;
}

html[data-theme='light'] body.se-nav-on #btnShowGalaxyList .btnRectMain .inner {
    color: #287ead !important;
}

body.se-nav-on #btnShowGalaxyList .svgIcon {
    color: inherit !important;
}

body.se-nav-on #galaxyList .galaxyListInner {
    top: 52px;
    bottom: auto;
    left: 50%;
    width: min(520px, calc(100vw - var(--se-nav-w) - 48px));
    max-height: 60vh;
    transform: translateX(-50%);
}

body.se-nav-on #galaxyStarTrack {
    position: relative;
    inset: auto;
    width: 100%;
    height: max(360px, calc(100vh - 360px));
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

body.se-nav-on #galaxyStarTrack::-webkit-scrollbar {
    height: 7px;
}

body.se-nav-on #galaxyStarInner {
    min-width: 100%;
}

body.se-nav-on .galaxy-star {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--explore-ink);
    font: inherit;
}

body.se-nav-on .galaxy-star-ball {
    flex: none;
    width: 100%;
    border-radius: 0;
    background-size: contain;
}

.galaxy-progress-stars {
    position: relative;
    display: inline-block;
    font-size: 20px;
    line-height: 24px;
    white-space: nowrap;
}

.galaxy-progress-stars i {
    color: #afb9c5 !important;
    margin: 0 1px;
}

.galaxy-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.galaxy-progress-fill i {
    color: #ffd340 !important;
}

.galaxy-star.is-browse .galaxy-progress-stars {
    visibility: hidden;
}

.galaxy-star-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(100%, 150px);
    box-sizing: border-box;
    padding: 7px;
    border-radius: 17px;
    background: #adb8c7;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}

body.se-nav-on .galaxy-star-label {
    margin: 0;
    overflow: hidden;
    color: #173047 !important;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none;
}

.galaxy-star-status {
    padding: 4px;
    border-radius: 12px;
    background: #0f2a5a;
    color: #fff !important;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
}

html[data-theme='light'] .galaxy-star-status {
    background: rgba(47, 159, 224, .22);
    color: #1b3a58 !important;
    font-weight: 600;
}

.galaxy-star.is-complete .galaxy-star-badge {
    background: #9cda2c;
}

.galaxy-star.is-current .galaxy-star-badge {
    background: #40bdf0;
}

.galaxy-star-action,
.galaxy-current-start {
    box-sizing: border-box;
    padding: 8px 16px;
    border: 0;
    border-radius: 20px;
    border-bottom: 4px solid #2391c7;
    background: #40bdf0;
    color: #fff !important;
    font: inherit;
    font-size: 15px;
    white-space: nowrap;
}

.galaxy-star-action {
    margin-top: 6px;
}

.galaxy-current-start {
    display: none;
    cursor: pointer;
}

.galaxy-footer {
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr) 172px;
    align-items: center;
    min-height: 172px;
}

body.se-nav-on #galaxy-page .hintBox {
    position: relative;
    inset: auto;
    width: 172px;
    height: 172px;
    transform: none;
    cursor: pointer;
}

body.se-nav-on #galaxy-page .hintBoxBg {
    inset: 0;
    width: 100%;
    height: 100%;
    background: url('series/helper.png') center / contain no-repeat;
}

html[data-theme] body.se-nav-on #galaxy-page .hintBox .hintBoxInfo {
    position: fixed;
    inset: auto;
    transform: none;
    width: min(340px, calc(100vw - var(--se-nav-w) - 48px));
    max-height: calc(100dvh - 24px);
    padding: 16px 18px;
    border: 1px solid var(--explore-line);
    background: var(--explore-panel);
    color: var(--explore-ink);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .1);
    font-size: 14px;
    line-height: 1.7;
    overflow-y: auto;
    overflow-wrap: anywhere;
    z-index: 1000;
}

body.se-nav-on #galaxy-page .hintBoxInfo ul {
    margin: 0;
    padding-left: 16px;
}

body.se-nav-on #galaxy-page .hintBoxInfo li:last-child {
    margin-bottom: 0;
}

.galaxy-page-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.galaxy-page-arrow {
    width: 54px;
    height: 54px;
    border: 0;
    border-bottom: 5px solid #459800;
    border-radius: 17px;
    background: #65cf00;
    font-size: 22px;
    cursor: pointer;
}

.galaxy-page-arrow i {
    color: #fff !important;
}

.galaxy-page-arrow:disabled,
.galaxy-current-start:disabled {
    opacity: .4;
    cursor: default;
}

.galaxy-page-number {
    min-width: 48px;
    color: var(--explore-ink) !important;
    text-align: center;
    font-size: 13px;
}

.app-nav-item:focus-visible,
.app-bottom-btn:focus-visible,
.app-nav-menu-toggle:focus-visible,
.nebula-card:focus-visible,
.nebula-helper-toggle:focus-visible,
.galaxy-star:focus-visible,
.galaxy-page-arrow:focus-visible,
.galaxy-current-start:focus-visible,
.galaxy-course-toggle:focus-visible,
#galaxyList .channel:focus-visible,
#galaxyList .galaxy-menu-tab:focus-visible,
#galaxy-page .hintBox:focus-visible {
    outline: 3px solid #40bdf0;
    outline-offset: 5px;
}

@media screen and (orientation: landscape) and (max-width: 1100px) {
    body.se-inner-on #app-panel .panel-avatar-wrap {
        display: none;
    }

    body.se-inner-on #app-panel .panel-nick-text {
        max-width: 90px;
    }

    body.se-nav-on {
        --se-nav-w: 88px;
    }

    body.se-nav-on .app-nav-logo {
        padding: 28px 8px 32px;
    }

    .app-nav-brand {
        font-size: 15px;
    }

    body.se-nav-on .app-nav-item {
        justify-content: center;
        padding: 0;
    }

    body.se-nav-on .app-nav-item span {
        display: none;
    }

    body.se-explore-shell #app-title {
        width: 260px;
        height: 70px;
        font-size: 30px;
    }

    body.se-explore-shell #app-title::before,
    body.se-explore-shell #app-title::after {
        margin: 0 12px;
    }

    .nebula-scene,
    .starword-wrap {
        --entry-height: 88px;
        --entry-row-gap: 54px;
    }

    body.se-nav-on #nebula-div #nebula_ul {
        gap: var(--entry-row-gap) 28px;
    }

    html[data-theme] body.se-nav-on #nebula_ul li.nebula-card {
        height: var(--entry-height);
        padding-left: 112px;
    }

    body.se-nav-on #nebula_ul .nebula-icon {
        width: 110px;
        height: 112px;
        left: 0;
    }

    body.se-nav-on #nebula_ul .nebula-title {
        font-size: 23px;
    }
}

@media screen and (orientation: portrait) {
    body.se-explore-shell {
        --se-tools-top: calc(16px + env(safe-area-inset-top));
        --se-search-offset: 52px;
        --se-search-height: 44px;
    }

    body.se-nav-on {
        --se-nav-w: 0px;
    }

    body.se-nav-on #app-nav {
        display: block;
        width: 0;
        border: 0;
        background: transparent;
    }

    body.se-nav-on .app-nav-logo,
    body.se-nav-on .app-nav-list > li {
        display: none;
    }

    body.se-explore-shell #tools-settings-btn,
    body.se-explore-shell #tools-search-btn,
    body.se-explore-shell #tools-help-btn {
        width: 36px;
        height: 40px;
        border-bottom-width: 4px;
        border-radius: 12px;
        background-size: 28px;
        font-size: 20px;
    }

    body.se-explore-shell #app-panel {
        top: calc(16px + env(safe-area-inset-top));
        left: 12px;
    }

    body.se-explore-shell #app-panel .panel-card {
        gap: 6px;
    }

    body.se-explore-shell #app-panel .panel-avatar-wrap {
        width: 44px;
        height: 44px;
    }

    body.se-explore-shell #app-panel .panel-avatar {
        width: 32px;
        height: 32px;
    }

    body.se-explore-shell #app-panel .panel-nick {
        gap: 4px 5px;
    }

    body.se-explore-shell #app-panel .panel-nick-text {
        max-width: min(110px, calc(100vw - 266px));
        font-size: 14px;
    }

    body.se-explore-shell #app-panel .panel-gold,
    body.se-explore-shell #app-panel .panel-credit {
        gap: 3px;
        font-size: 11px;
    }

    body.se-explore-shell #app-panel .panel-gold img,
    body.se-explore-shell #app-panel .panel-credit img {
        width: 16px;
        height: 16px;
    }

    body.se-explore-shell #app-panel .panel-gold::before,
    body.se-explore-shell #app-panel .panel-credit::before {
        width: 16px;
        height: 16px;
    }

    body.se-explore-shell #tools-div {
        right: 12px;
        gap: 8px;
    }

    body.se-explore-shell #tools-div .tool-block {
        width: 36px;
    }

    body.se-explore-shell #tools-div .tool-search .input {
        right: 0;
        width: calc(100vw - 24px);
        padding: 0 14px;
        font-size: 15px;
    }

    body.se-explore-shell #tools-div .tool-dict {
        right: 0;
        width: calc(100vw - 24px);
    }

    html[data-theme] body.se-inner-on #app-panel .panel-card {
        gap: 6px;
    }

    body.se-inner-on #app-panel .panel-avatar-wrap {
        width: 36px;
        height: 36px;
    }

    body.se-inner-on #app-panel .panel-avatar {
        width: 28px;
        height: 28px;
    }

    body.se-inner-on #app-panel .panel-nick {
        gap: 4px 6px;
    }

    body.se-inner-on #app-panel .panel-nick-text {
        max-width: max(36px, calc(100vw - 300px));
        font-size: 12px;
    }

    body.se-inner-on #app-panel .panel-level-badge .panel-level-text {
        padding: 2px 6px;
        font-size: 10px;
    }

    body.se-inner-on #app-panel .panel-stats {
        gap: 10px;
    }

    body.se-inner-on #app-panel .panel-gold::before,
    body.se-inner-on #app-panel .panel-credit::before {
        width: 18px;
        height: 18px;
    }

    body.se-nav-on #profileWrap,
    body.se-nav-on #starword-div,
    body.se-nav-on #task-div {
        top: calc(88px + env(safe-area-inset-top)) !important;
        bottom: calc(84px + env(safe-area-inset-bottom));
        height: auto !important;
    }

    body.se-nav-on #task-page {
        inset: auto 0 8px 0 !important;
        width: auto !important;
    }

    body.se-nav-on #starword-div {
        --entry-viewport-top: calc(88px + env(safe-area-inset-top));
        top: var(--entry-viewport-top) !important;
        left: 16px !important;
        width: calc(100vw - 32px) !important;
    }

    body.se-nav-on #app-bottom {
        position: fixed;
        inset: auto 0 0;
        display: flex;
        align-items: center;
        height: calc(84px + env(safe-area-inset-bottom));
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        border-top: 1px solid var(--explore-line);
        background: var(--explore-panel);
        z-index: 950;
    }

    body.se-nav-on #app-bottom .app-bottom-btn {
        position: static;
        transform: none;
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 68px;
        padding: 0;
        border: 0;
        color: var(--explore-ink) !important;
        text-decoration: none !important;
    }

    body.se-nav-on #app-bottom .app-bottom-btn img,
    body.se-nav-on #app-bottom .app-bottom-btn i {
        width: 44px;
        height: 40px;
        box-sizing: border-box;
        padding: 4px;
        object-fit: contain;
        line-height: 32px;
        text-align: center;
        font-size: 28px;
    }

    body.se-nav-on #app-bottom .app-bottom-btn[data-frame='starword'] img {
        padding: 5px;
    }

    body.se-nav-on #app-bottom .app-bottom-btn[data-frame='profile'] img {
        padding: 8px;
    }

    body.se-nav-on #app-bottom .app-bottom-btn span {
        color: inherit !important;
        font-size: 13px;
        line-height: 16px;
        white-space: nowrap;
    }

    body.se-nav-on #app-bottom .app-bottom-btn.active img,
    body.se-nav-on #app-bottom .app-bottom-btn.active i {
        border-radius: 12px;
        background: #40bdf0;
        box-shadow: 0 4px 0 #2391c7;
        color: #fff !important;
    }

    body.se-nav-on #nebula-div {
        top: calc(88px + env(safe-area-inset-top)) !important;
        bottom: calc(84px + env(safe-area-inset-bottom));
        left: 16px !important;
        width: calc(100vw - 32px) !important;
    }

    .nebula-scene,
    .starword-wrap {
        --entry-width: 480px;
        --entry-height: 80px;
        --entry-row-gap: 38px;
        --entry-top: 12px;
        --entry-helper-size: 128px;
        --entry-helper-gap: 28px;
        padding: 24px 0;
    }

    /* 竖屏云入口按设计稿收窄：条宽约 68% 视口，星球压在条左端 */
    .nebula-scene {
        --entry-width: min(480px, 68vw);
        --entry-height: clamp(52px, 14vw, 80px);
        --entry-row-gap: clamp(38px, 14vw, 64px);
        --entry-helper-size: clamp(96px, 30vw, 128px);
    }

    body.se-nav-on #nebula-div #nebula_ul {
        grid-template-columns: minmax(0, 1fr);
        width: min(100%, var(--entry-width));
        gap: var(--entry-row-gap);
        padding-top: var(--entry-top);
    }

    html[data-theme] body.se-nav-on #nebula_ul li.nebula-card {
        height: var(--entry-height);
        max-height: none;
        aspect-ratio: auto;
        padding: 8px 3.7vw 8px min(126px, 23vw);
        border-radius: 15px;
    }

    body.se-nav-on #nebula_ul .nebula-icon {
        top: -3.5vw;
        left: 0;
        width: min(116px, 22vw);
        height: min(108px, 21vw);
    }

    body.se-nav-on #nebula_ul .nebula-title {
        font-size: clamp(18px, 5.6vw, 24px);
    }

    body.se-nav-on #nebula_ul .nebula-hint {
        font-size: 12px;
    }

    body.se-nav-on #nebula-div #nebula-helper {
        align-self: center;
        gap: 8px;
        width: min(100%, 480px);
        margin: var(--entry-helper-gap) 0 0;
    }

    .nebula-helper-toggle {
        flex-basis: var(--entry-helper-size);
        width: var(--entry-helper-size);
        height: var(--entry-helper-size);
    }

    html[data-theme] body.se-nav-on #nebula-div #nebula-helper .nebula-helper-dialog {
        padding: 14px 26px 14px 14px;
    }

    html[data-theme] body.se-nav-on #nebula-div #nebula-helper .nebula-helper-dialog-text {
        font-size: 12px;
    }

    body.se-nav-on #galaxy-page {
        top: calc(84px + env(safe-area-inset-top));
        bottom: calc(146px + env(safe-area-inset-bottom));
        left: 0;
        width: 100%;
        padding: 0 12px;
    }

    .galaxy-course-head {
        position: fixed;
        inset: auto 0 calc(84px + env(safe-area-inset-bottom));
        gap: 10px;
        min-height: 62px;
        padding: 8px 12px;
        box-sizing: border-box;
        background: var(--explore-panel);
        z-index: 920;
    }

    body.se-nav-on #galaxyList {
        flex: 1;
        min-width: 0;
    }

    body.se-nav-on #btnShowGalaxyList .btnRectMain {
        display: block;
        height: 42px;
        padding: 0 8px;
        font-size: 14px;
        line-height: 42px;
        width: 100%;
        border-bottom: 4px solid #459800;
        border-radius: 14px;
        background: #65cf00;
    }

    body.se-nav-on #btnShowGalaxyList .btnRectMain .inner {
        display: block;
        overflow: hidden;
        padding: 0 4px;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #fff !important;
    }

    html[data-theme='light'] body.se-nav-on #btnShowGalaxyList .btnRectMain .inner {
        color: #fff !important;
    }

    body.se-nav-on #galaxyList .galaxyListInner {
        top: auto;
        bottom: 52px;
        left: 0;
        width: calc(100vw - 24px);
        max-height: 60vh;
        transform: none;
    }

    .galaxy-current-start {
        display: block;
        flex: none;
        padding: 10px 12px;
        font-size: 13px;
    }

    body.se-nav-on #galaxyStarTrack {
        height: calc(100% - 124px);
        min-height: 240px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .galaxy-progress-stars {
        font-size: 15px;
        line-height: 20px;
    }

    body.se-nav-on .galaxy-star-label {
        font-size: 14px;
    }

    .galaxy-star-badge {
        padding: 5px;
        border-radius: 13px;
    }

    .galaxy-star-status {
        padding: 3px;
        font-size: 10px;
        white-space: normal;
    }

    .galaxy-star-action {
        display: none;
    }

    .galaxy-footer {
        grid-template-columns: 110px minmax(0, 1fr);
        min-height: 124px;
    }

    body.se-nav-on #galaxy-page .hintBox {
        width: 110px;
        height: 110px;
    }

    html[data-theme] body.se-nav-on #galaxy-page .hintBox .hintBoxInfo {
        width: min(340px, calc(100vw - 24px));
        padding: 14px 16px;
        font-size: 12px;
    }

    .galaxy-page-controls {
        gap: 8px;
    }

    .galaxy-page-arrow {
        width: 36px;
        height: 40px;
        border-bottom-width: 4px;
        border-radius: 12px;
        font-size: 16px;
    }
}

@media (orientation: portrait) and (max-width: 360px) {
    body.se-explore-shell #app-panel .panel-card {
        gap: 4px;
    }

    body.se-explore-shell #app-panel .panel-stats {
        gap: 10px;
    }

    body.se-explore-shell #app-panel .panel-gold,
    body.se-explore-shell #app-panel .panel-credit {
        gap: 2px;
        font-size: 10px;
    }

    body.se-explore-shell #app-panel .panel-gold::before,
    body.se-explore-shell #app-panel .panel-credit::before {
        width: 14px;
        height: 14px;
    }
}

body.se-explore-shell:not(.se-cloud-on):not(.se-game-on):has(#tools-div .tool-search.search-open) #page-body > :is(.global-content-wrap, #galaxy-page) {
    top: var(--se-search-content-top) !important;
    max-height: calc(100% - var(--se-search-content-top) - 12px - env(safe-area-inset-bottom));
}

@media screen and (orientation: portrait) and (min-width: 1025px) {
    body.se-explore-shell #tools-div .tool-search .input,
    body.se-explore-shell #tools-div .tool-dict {
        /* 标题牌宽 372px，保留 8px 间距。 */
        width: min(360px, calc(50vw - 206px));
    }
}

@media screen and (orientation: portrait) and (min-height: 501px) and (max-height: 600px) {
    body.se-nav-on:has(#tools-div .tool-search.search-open) #starword-div {
        overflow-y: auto;
        scrollbar-gutter: stable;
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #starword-div .starword-wrap {
        height: auto;
        min-height: 100%;
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #starword-div .starword-content {
        container-type: inline-size;
        height: auto;
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #starword-div .starword-levels {
        --starword-button-height: clamp(44px, 12vh, 64px);
    }
}

@media screen and (orientation: landscape) and (max-height: 340px) {
    body.se-nav-on:has(#tools-div .tool-search.search-open) #galaxy-page .galaxy-footer {
        --se-search-helper-size: clamp(44px, calc(100dvh - var(--se-search-content-top) - 24px - env(safe-area-inset-bottom)), 172px);
        grid-template-columns: var(--se-search-helper-size) minmax(0, 1fr);
        min-height: var(--se-search-helper-size);
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #galaxy-page .hintBox {
        width: var(--se-search-helper-size);
        height: var(--se-search-helper-size);
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #galaxy-page .galaxy-page-controls {
        gap: 8px;
    }

    body.se-nav-on:has(#tools-div .tool-search.search-open) #galaxy-page .galaxy-page-arrow {
        width: 36px;
        height: 40px;
        border-bottom-width: 4px;
        border-radius: 12px;
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.se-nav-on .nebula-card,
    body.se-nav-on .galaxy-star-ball {
        transition: none;
    }

    @media screen and (orientation: portrait) and (max-width: 375px) {
        html[data-theme] body.se-inner-on #app-panel .panel-card {
            gap: 4px;
            padding-right: 6px;
            max-width: calc(100vw - 176px);
        }

        body.se-inner-on #app-panel .panel-avatar-wrap {
            width: 28px;
            height: 28px;
        }

        body.se-inner-on #app-panel .panel-avatar {
            width: 21px;
            height: 21px;
        }

        body.se-inner-on #app-panel .panel-stats {
            gap: 7px;
        }

        body.se-inner-on #app-panel .panel-gold,
        body.se-inner-on #app-panel .panel-credit {
            gap: 2px;
            font-size: 10px;
        }

        body.se-inner-on #app-panel .panel-gold::before,
        body.se-inner-on #app-panel .panel-credit::before {
            width: 14px;
            height: 14px;
        }

        body.se-inner-on #app-panel .panel-back::after {
            width: 20px;
            height: 17px;
        }
    }
}

/* ================= 浏览页 / 做题界面：字号与控件随屏幕缩放 ================= */
/* 基础字号：手机不低于 16px，宽屏约 21px，超大屏封顶 22px；
   下方尺寸按 16px 基准换算成 em，窄屏保持原样，宽屏同步放大 */
#feedback-page {
    font-size: clamp(16px, .4vw + 15px, 22px);
}

/* 正文区字号由 shipe.updateFont() 按用户设置写成 inline 12pt，
   这里对做题界面与词条列表单独给出随屏幕缩放的字号 */
#feedback-page .quest-box,
#feedback-page .feedback-wiki-display {
    font-size: clamp(16px, .45vw + 14.5px, 24px);
}

#feedback-page .quest-box {
    padding-bottom: 6.875em;
}

#feedback-page .quest-box::after {
    height: 6em;
}

#feedback-page .overlay-quest-progress {
    height: .625em;
    border-radius: .3125em;
}

#feedback-page .overlay-quest-progress .fill {
    border-radius: .3125em;
}

#feedback-page .overlay-quest-counter {
    line-height: 1.5em;
    background-size: 1.375em;
    padding-left: 1.625em;
    margin-left: .75em;
}

/* 题目少时整块在内容区居中，题目多时退回顶部并在内容区内滚动 */
#feedback-page .quest-box .overlay-quest-content {
    justify-content: safe center;
    gap: clamp(1em, 3.5vh, 2.5em);
    padding-top: 1.875em;
}

#feedback-page .overlay-quest-header {
    padding-top: .625em;
    font-size: 1.45em;
}

/* 完形填空：题面段落最长，单独小一档，配合 fitQuestContent 的自适应避免出滚动条 */
#feedback-page .overlay-quest-header.cloze {
    font-size: 1.2em;
}

#feedback-page .overlay-quest-controls {
    height: 6em;
}

#feedback-page .overlay-quest-control {
    min-width: 6.875em;
    height: 2.625em;
    padding: 0 1.125em;
    gap: .375em;
}

#feedback-page .overlay-quest-control.quest-skip::before,
#feedback-page .overlay-quest-control.quest-continue::after,
#feedback-page .overlay-quest-control.quest-check::after {
    font-size: .75em;
}

/* 开始任务按钮随字号放大，标题栏高度保持原值以免挤压内容区 */
#feedback-page .btnStartQuestExercise {
    padding: 0 .5em;
    border-radius: .5em;
}

/* ================= 收件箱等遗留面板的主题适配 ================= */
/* .messageWrapBorder 原为固定深蓝底，亮色下换成卡片底色 */
html[data-theme='light'] .messageWrapBorder {
    border-color: var(--se-card-border, #d5d9e0);
    background-color: var(--se-card-bg, rgba(255, 255, 255, .9));
    box-shadow: var(--se-shadow, 0 6px 20px rgba(30, 45, 70, .2));
}

html[data-theme='light'] .messageList .messageBox {
    background-color: rgba(47, 159, 224, .06);
}

html[data-theme='light'] .messageList .messageBox .name,
html[data-theme='light'] .messageList .messageBox .level,
html[data-theme='light'] .messageList .postCont {
    color: var(--se-text, #4b4b4b);
}

html[data-theme='light'] .messageList .time {
    color: #6b7686;
}

html[data-theme='light'] .messageList .flag {
    color: #ffffff;
    background-color: var(--se-accent, #1f7fc4);
}

/* 七彩云封面兜底底色跟随主题（图片未加载时不再露出深蓝块） */
html[data-theme='light'] .recommend-list .card .cover {
    background-color: #dfe8f3;
}

/* 资料页足迹卡片：亮色只补封面兜底底色，暗色整卡改为深色面 */
html[data-theme='light'] ul.his-list li.foot-card .foot-cover {
    background-color: #dfe8f3;
}

html[data-theme='dark'] ul.his-list li.foot-card {
    background-color: var(--se-card-bg, rgba(33, 40, 52, .86));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

html[data-theme='dark'] ul.his-list li.foot-card .foot-title {
    color: var(--se-text, #d2d7df);
}

html[data-theme='dark'] ul.his-list li.foot-card .foot-time {
    color: rgba(210, 215, 223, .72);
}

html[data-theme='dark'] ul.his-list li.foot-card:hover .foot-title {
    color: #8bd5fa;
}

/* 微课云手机端：style3 里 tc-input-only 会把 Copilot 输入框垂直居中，
   窄屏堆叠后会在上方留出大段空白，这里改为从顶部排列并撑满剩余高度 */
@media screen and (max-width: 880px) {
    #teachingcloud-div .teaching-copilot-panel,
    #teachingcloud-div .teaching-copilot-panel.tc-input-only {
        flex: 1 1 auto;
        justify-content: flex-start;
    }
}

/* 微课云 / 体验云 / 翻译云 / 阅读云：草稿列表标题写死浅色，亮色下改回主题深色 */
html[data-theme='light'] :is(#teachingcloud-div, #experience-div, #reading-div, #translation-div) .writer-result-item b,
html[data-theme='light'] :is(#teachingcloud-div, #experience-div, #reading-div, #translation-div) .writer-result-item strong {
    color: var(--cloud-ink, #23364e) !important;
}

/* 微课云亮色：进度文字用深色，避免浅色写死在浅底上 */
html[data-theme='light'] #teachingcloud-div #teachingProgressText {
    color: var(--cloud-ink, #23364e) !important;
}

/* ================= 设置页（账号 / 安全 / 偏好）主题适配 ================= */
/* 表单标签、占位符、子页签、按钮、复选单选框在亮/暗两套主题下统一取色 */
#setting-div {
    --set-ink: #1f3346;
    --set-ink-muted: #5d7288;
    --set-surface-2: #eef4fa;
    --set-border: #cfdcea;
    --set-field: #f4f7fb;
    --set-field-ink: #1f3346;
    --set-field-ph: #93a5b8;
    --set-accent: #2b8ada;
    --set-accent-2: #40bdf0;
    --set-tab-ink: #44617a;
    --set-rail-icon-filter: none;
}

html[data-theme='dark'] #setting-div {
    color-scheme: dark;
    --set-ink: #e8f0f8;
    --set-ink-muted: #9db4ca;
    --set-surface-2: rgba(36, 66, 96, .55);
    --set-border: #2f4d6b;
    --set-field: rgba(12, 28, 46, .55);
    --set-field-ink: #eaf2fa;
    --set-field-ph: #8ea6bd;
    --set-accent: #2b8ada;
    --set-accent-2: #40bdf0;
    --set-tab-ink: #b3c9dd;
    --set-rail-icon-filter: none;
}

/* 左侧分类图标栏：亮色下白色图标不可见，染成品牌蓝 */
html[data-theme='light'] #setting-toggleTag img {
    filter: invert(45%) sepia(48%) saturate(2200%) hue-rotate(181deg) brightness(94%);
    opacity: 1;
}

html[data-theme='light'] #setting-toggleTag li.active img {
    filter: invert(35%) sepia(70%) saturate(2500%) hue-rotate(190deg) brightness(88%);
}

/* 表单标签（.form-item-label 是 div，主题层没有覆盖到） */
#setting-div .form-item-label {
    color: var(--set-ink) !important;
}

#setting-div .form-item-label .quick-hint {
    color: var(--set-ink-muted) !important;
}

#setting-div .checkbox-label {
    color: var(--set-ink) !important;
    display: inline-flex;
    align-items: center;
    min-height: 50px;
}

#setting-div .checkbox-label input[type="checkbox"],
#setting-div .checkbox-label input[type="radio"] {
    flex: none;
}

/* 输入框 / 下拉框 */
#setting-div .form .input,
#setting-div .form select,
#setting-div .form textarea {
    background-color: var(--set-field) !important;
    border-color: var(--set-border) !important;
    color: var(--set-field-ink) !important;
    border-radius: 12px;
}

#setting-div .form input::placeholder,
#setting-div .form textarea::placeholder {
    color: var(--set-field-ph) !important;
}

/* 页内子页签：旧版“深蓝方块 + 4px 蓝条”改为主题色胶囊 */
#setting-div ul.tab-row {
    border-bottom: 1px solid var(--set-border);
    align-items: flex-end;
    gap: 8px;
    min-height: 34px;
    max-height: 44px;
    margin: 4px 0 12px 0;
}

#setting-div ul.tab-row li {
    background: var(--set-surface-2);
    border: 1px solid var(--set-border);
    border-radius: 10px;
    margin-bottom: 6px;
}

#setting-div ul.tab-row li.active {
    background: var(--set-accent);
    border-color: var(--set-accent);
    box-shadow: 0 4px 12px rgba(43, 138, 218, .28);
}

#setting-div ul.tab-row a {
    color: var(--set-tab-ink) !important;
    padding: 5px 14px;
    font-weight: 600;
}

#setting-div ul.tab-row li.active a {
    color: #ffffff !important;
}

/* 按钮：旧版白/灰渐变图改为主题按钮 */
#setting-div .form .button {
    background: var(--set-surface-2);
    background-image: none;
    border: 1px solid var(--set-border);
    border-radius: 14px;
    color: var(--set-ink) !important;
}

#setting-div .form .button.primary {
    background-image: linear-gradient(180deg, var(--set-accent-2), var(--set-accent));
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(43, 138, 218, .26);
}

#setting-div .form .button.primary:hover {
    filter: brightness(1.06);
}

/* 复选框 / 单选框：改为主题化控件（原生控件在暗色下会渲染成灰方块） */
#setting-div .form input[type="checkbox"],
#setting-div .form input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px !important;
    min-height: 0 !important;
    max-height: 20px !important;
    margin-right: 10px;
    box-sizing: border-box;
    border: 2px solid var(--set-border);
    border-radius: 6px;
    background-color: var(--set-field);
    vertical-align: middle;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

#setting-div .form input[type="radio"] {
    border-radius: 50%;
}

#setting-div .form input[type="checkbox"]:checked,
#setting-div .form input[type="radio"]:checked {
    background-color: var(--set-accent-2);
    border-color: var(--set-accent-2);
}

#setting-div .form input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 3px;
    width: 9px;
    height: 5px;
    border-left: 2.5px solid #ffffff;
    border-bottom: 2.5px solid #ffffff;
    transform: rotate(-45deg);
}

#setting-div .form input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: #ffffff;
}

/* 设置页在窄屏上改为标签在上、控件在下的单列排布，避免标签压住输入框与滑杆 */
@media screen and (max-width: 640px) {
    #setting-div .form-row,
    #setting-div .form-clear-row {
        padding-left: 0 !important;
    }

    #setting-div .form-item-label {
        position: static !important;
        width: auto !important;
        height: auto !important;
        line-height: 1.5 !important;
        padding: 0 0 6px !important;
    }

    #setting-div .form-item-control {
        height: auto !important;
        min-height: 0 !important;
    }

    #setting-div .form-item-control .input,
    #setting-div .settings-input,
    #setting-div .settings-select {
        width: 100% !important;
        box-sizing: border-box;
    }

    #setting-div .col-lg-6 {
        float: none !important;
        width: 100% !important;
    }

    #setting-div .checkbox-col-4 .checkbox-label,
    #setting-div .checkbox-col-3 .checkbox-label,
    #setting-div .checkbox-col-2 .checkbox-label {
        width: 50% !important;
        min-height: 44px;
        white-space: normal;
        line-height: 1.35;
        align-items: flex-start;
        padding-top: 10px;
    }

    #setting-div ul.tab-row {
        flex-wrap: wrap;
        max-height: none;
        min-height: 0;
        row-gap: 6px;
    }

    #setting-div ul.tab-row a {
        padding: 5px 10px;
    }

    #setting-div .form .button.primary {
        min-height: 44px;
    }
}

/* ================= 管理模式（#results-div）：旧版深蓝表格在亮色下几乎看不清 ================= */
/* 原来 .data-list 是浅色字 #d0e5f7 + 隔行深蓝，落在浅色页面上就只剩蓝条纹；这里整套换成主题色 */
#results-div {
    --adm-ink: #1f3346;
    --adm-ink-muted: #5d7288;
    --adm-surface: #ffffff;
    --adm-surface-2: #f1f6fb;
    --adm-border: #cfdcea;
    --adm-head: #e6f0f9;
    --adm-accent: #1f7fc4;
    --adm-hover: rgba(31, 127, 196, .08);
}

html[data-theme='dark'] #results-div {
    --adm-ink: #e8f0f8;
    --adm-ink-muted: #9db4ca;
    --adm-surface: #142941;
    --adm-surface-2: rgba(36, 66, 96, .55);
    --adm-border: #2f4d6b;
    --adm-head: rgba(36, 66, 96, .8);
    --adm-accent: #57c9f1;
    --adm-hover: rgba(87, 201, 241, .12);
}

/* 页内子页签 */
#results-div ul.tab-row {
    border-bottom: 1px solid var(--adm-border);
    align-items: flex-end;
    gap: 8px;
    min-height: 34px;
    max-height: 44px;
    margin: 4px 0 12px 0;
}

#results-div ul.tab-row li {
    background: var(--adm-surface-2);
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    margin-bottom: 6px;
}

#results-div ul.tab-row li.active {
    background: var(--adm-accent);
    border-color: var(--adm-accent);
    box-shadow: 0 4px 12px rgba(31, 127, 196, .28);
}

#results-div ul.tab-row a {
    color: var(--adm-ink) !important;
    padding: 5px 14px;
    font-weight: 600;
}

#results-div ul.tab-row li.active a {
    color: #ffffff !important;
}

/* 管理操作按钮 */
#results-div .admin-page .set-cmd {
    height: 32px;
    line-height: 30px;
    padding: 0 12px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: var(--adm-surface-2);
    color: var(--adm-ink) !important;
}

#results-div .admin-page .set-cmd:hover {
    border-color: var(--adm-accent);
    color: var(--adm-accent) !important;
}

/* 数据表 */
#results-div table.data-list {
    color: var(--adm-ink);
    font-size: 14px;
    line-height: 1.5;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--adm-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--adm-surface);
}

#results-div table.data-list tr {
    height: auto;
    background: transparent;
}

#results-div table.data-list th {
    padding: 9px 8px;
    background: var(--adm-head);
    color: var(--adm-ink-muted) !important;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid var(--adm-border);
}

#results-div table.data-list td {
    padding: 8px;
    color: var(--adm-ink) !important;
    border-bottom: 1px solid var(--adm-border);
}

#results-div table.data-list tr:last-child td {
    border-bottom: 0;
}

#results-div table.data-list tr.alternate {
    background: var(--adm-surface-2);
}

#results-div table.data-list tbody tr:hover {
    background: var(--adm-hover);
}

#results-div table.data-list td a {
    color: var(--adm-accent) !important;
}

/* 分页（#results-page 是 #results-div 的兄弟节点，颜色单独给） */
#results-page .pageNumber {
    color: #1f3346;
}

html[data-theme='dark'] #results-page .pageNumber {
    color: #e8f0f8;
}
