@import url("./xiaoche-panels-polish.css?v=3");

/* Cards form a horizontal shelf on touch screens; both directions remain native scrolling. */
html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) .tx-story-cards {
    overscroll-behavior-x: contain;
}
html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) .tx-story-cards .tx-card {
    touch-action: pan-x pan-y pinch-zoom;
}

/*
 * 萧澈固定主角模式的 HUD / 底栏容纳修复。
 * 只调整原版面板内部坐标和文字排版，不移除生命、玄力、修为、境界、目标或操作入口。
 */

/* 寿元徽章和头像分列；三条核心状态从头像右缘之后开始。 */
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .life-box {
    left: .55rem;
    top: .45rem;
    width: 2.7rem;
    height: 2.7rem;
    font-size: 1rem;
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .avatar-wrap {
    left: 3.45rem;
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #current-realm {
    left: 4.45rem;
    width: 5.5rem;
    font-size: 1.1rem;
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .birth-tags {
    left: 3.45rem;
    width: 20.5rem;
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #hud-top .bar-row {
    left: 11rem;
    width: 13rem;
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #hud-top .bar-row > b {
    width: 100%;
    font-size: 1.08rem;
}

/* “装备 / 玄器”各占一条真实竖排，不再用过大的两行文字挤进 50px 高度。 */
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .dock-tab {
    top: 3.9rem;
    height: 4.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font: 400 1.25rem/1 "PangMenZhengDao", "STKaiti", "KaiTi", serif;
    letter-spacing: .04em;
    text-align: center;
    text-orientation: upright;
    text-shadow: 0 .08rem .16rem #000;
    white-space: nowrap;
    writing-mode: vertical-rl;
}

/* 开局亮背景下使用实色正文底，避免场景、任务标题从字后透出。 */
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #dialogue-box {
    background: linear-gradient(180deg, #0b2027 0%, #07171c 100%) !important;
    border-color: rgba(202, 174, 112, .82);
    box-shadow: 0 1rem 4rem rgba(0, 0, 0, .72), inset 0 0 0 1px rgba(255, 248, 225, .025);
}

html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #dialogue-text {
    color: #f7f1e5;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.78;
    text-shadow: 0 .06rem .12rem rgba(0, 0, 0, .82);
}

/* 竖屏 HUD 高 6.5rem：对白框从其下缘开始，不再被顶栏压住边框。 */
@media (max-width: 960px) {
    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) #dialogue-box {
        top: max(6.5rem, calc(env(safe-area-inset-top) + 6.5rem));
    }

    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) #dialogue-text {
        font-size: 1rem;
        line-height: 1.72;
    }

    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world).tx-story-open #dialogue-box {
        top: auto;
    }
}

/* 横屏 HUD 高 4.8rem，留出约 2px 间隔，同时保留底部操作栏。 */
@media (max-width: 960px) and (max-height: 600px) {
    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) #dialogue-box {
        top: max(4.9rem, calc(env(safe-area-inset-top) + 4.9rem));
    }

    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world) #dialogue-text {
        font-size: .88rem;
        line-height: 1.56;
    }

    html.tx-edition.tx-mobile:is(.xiaoche-campaign,.tx-open-world).tx-story-open #dialogue-box {
        top: auto;
    }
}

/* 阅读与反馈精修：由实际全文测量对白高度，选择和CG仍使用各自布局。 */
html.tx-edition:is(.xiaoche-campaign,.tx-open-world):not(.tx-story-open) #dialogue-box:not(.choice-state) {
    height: var(--xc-dialogue-height, 18rem);
    min-height: 0;
}
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #mod-destiny { display: none; }
html.tx-edition .tx-bond-button {
    font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif;
    font-size: max(12px, 1.2rem);
    font-weight: 500;
    line-height: 1.4;
}
html.tx-edition :is(.tx-card-foot, .tx-dialog-close, .panel-tip, .queue-title) {
    font-family: "Source Han Sans SC", "Microsoft YaHei", sans-serif;
}
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) :is(.tx-card-foot, #battle-log, .battle-stat-bar > b) {
    font-size: max(12px, 1.1rem);
}
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #dialogue-box::after { font-size: max(12px, .9rem); }
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-chapter-header {
    background: linear-gradient(90deg, #071b22e8, #071b2290 64%, transparent);
    text-shadow: 0 1px 3px #000;
}
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .queue-slot.is-benched .icon-wrap img {
    opacity: .42;
    filter: grayscale(.75);
}
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .queue-slot.is-benched::after {
    content: "下架";
    position: absolute;
    left: 1px;
    right: 1px;
    bottom: 1px;
    z-index: 4;
    padding: 1px 0;
    color: #fff0ce;
    background: #382c1eea;
    border-top: 1px solid #d0ad66;
    text-align: center;
    font: 500 12px/1.35 "Source Han Sans SC", "Microsoft YaHei", sans-serif;
    pointer-events: none;
}
html.tx-edition #title-screen .chrome-fate {
    background: url("../assets/yuanwen-ui/fate-frame-clean-v1.svg") center/100% 100% no-repeat;
}
@media (min-width: 961px) {
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #action-bar { z-index: 3; }
    html.tx-edition #title-screen .chrome-extra .tx-transfer-entry { left: 56.40625rem; }
}
@media (max-width: 960px) {
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-bond-button { font-size: .88rem; }
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-card-foot { font-size: .82rem; }
    html.tx-edition:has(#battle-screen.active) .tx-transfer-fab {
        top: calc(7.5rem + env(safe-area-inset-top));
        bottom: auto;
        right: 1rem;
        left: auto;
    }
}

/* 审计收尾：小字、被遮住的卡面与按钮装饰，不改变原有操作位置。 */
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) :is(.tx-eyebrow, #skill-forget-tip) { font-size: max(12px, 1rem); }
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) :is(#txt-player-hp, #txt-player-mp, #txt-enemy-hp, #txt-enemy-mp) { font-size: max(12px, 1.1rem); }
html.tx-edition:is(.xiaoche-campaign,.tx-open-world):has(#dialogue-box:not(.hidden)) #events-list,
html.tx-edition:is(.xiaoche-campaign,.tx-open-world):has(#dialogue-box:not(.hidden)) #events-list * { visibility: hidden !important; }
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .dock-tab { color: #f2e6c8; text-shadow: 0 1px 3px #000, 0 0 5px #000; }
html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #current-realm { top: 6.35rem; background: #10232aed; border: 1px solid #8f7d53; }
@media (min-width: 961px) {
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .dock-btn { background-image: url("../assets/yuanwen-ui/dock-frame-clean-v1.svg"); color: #f2e6c8; text-shadow: 0 2px 3px #000; }
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .dock-btn::before { position: absolute; inset: 0; display: grid; place-items: center; font: 400 2.5rem/1 "PangMenZhengDao", "STKaiti", "KaiTi", serif; }
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #btn-skills::before { content: "玄技"; }
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) #btn-inventory::before { content: "行囊"; }
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .toast { bottom: 12rem; }
}
@media (max-width: 960px) and (orientation: landscape) {
    html.tx-edition:has(#battle-screen.active) .tx-transfer-fab { top: calc(5.5rem + env(safe-area-inset-top)); }
}
@media (max-width: 960px) {
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-eyebrow { font-size: 12px; padding-right: 8rem; word-break: keep-all; overflow-wrap: normal; }
}
@media (max-width: 960px) and (orientation: portrait) {
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-card > img.art[src*="event_character_"],
    html.tx-edition:is(.xiaoche-campaign,.tx-open-world) .tx-card > img.xiaoche-art-card-portrait { object-position: 50% 18%; }
}
/* overflow:hidden 可被浏览器 focus/scrollIntoView 横移；战场不应有滚动坐标。 */
html.tx-edition.tx-mobile #battle-screen,
html.tx-edition.tx-mobile #battle-screen .battle-shell { overflow: clip; }
