/* 小邻 · 顶栏三栏布局（左菜单 / 中标题 / 右操作） */
header.header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    box-sizing: border-box;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
    min-height: 48px;
    gap: 8px;
    overflow: visible;
}
.header-left {
    grid-column: 1;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 40px;
    flex-shrink: 0;
}
.header-center {
    grid-column: 2;
    z-index: 1;
    min-width: 0;
    text-align: center;
    padding: 0 4px;
    pointer-events: none;
    overflow: hidden;
}
.header-center h1 {
    text-align: center;
    margin: 0;
    line-height: 1.25;
}
.header-center .sub {
    text-align: center;
    margin-top: 2px;
}
.header-right {
    grid-column: 3;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    flex-shrink: 0;
}
.header-right.merchant-actions {
    gap: 10px;
}
.header-order-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.header-btn,
.bar-icon,
.page-back,
.sub-page-back {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2C2C2C;
}
.header-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    flex-shrink: 0;
}
.header-btn svg,
.bar-icon svg,
.page-back svg,
.sub-page-back svg {
    display: block;
    flex-shrink: 0;
    overflow: visible;
}
.header-btn svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}
.bar-icon svg {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
}

/* TTS · 略大于邮件图标 */
.header-btn.tts-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    margin: 0;
}
.tts-toggle .icon-tts-on {
    display: none;
}
.tts-toggle.active .icon-tts-off {
    display: none;
}
.tts-toggle.active .icon-tts-on {
    display: block;
}
.tts-toggle.active::after {
    display: none !important;
    content: none !important;
    animation: none !important;
}
.header-btn.tts-toggle svg.icon-tts-off,
.header-btn.tts-toggle svg.icon-tts-on {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
}
.header-btn.tts-toggle svg.icon-tts-off {
    color: #2C2C2C;
}

@media (max-width: 440px) {
    header.header {
        padding-left: 12px;
        padding-right: 12px;
        gap: 4px;
    }
    .header-right {
        gap: 8px;
    }
    .header-right.merchant-actions {
        gap: 6px;
    }
    .header-center h1 {
        font-size: 16px !important;
    }
    .header-center h1 span {
        font-size: 13px !important;
    }
    .header-center .sub {
        font-size: 10px;
    }
    .header-order-switch .order-switch-text {
        display: none;
    }
    .header-btn.tts-toggle {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
    .header-btn.tts-toggle svg.icon-tts-off,
    .header-btn.tts-toggle svg.icon-tts-on {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }
}

@media (max-width: 360px) {
    .header-center .sub {
        font-size: 9px;
        letter-spacing: 0;
    }
}
