/* ==========================================
   Baseball Hot Common UI
   統一頁面標題 / 分頁 / 次分頁 / 共用色彩 / Header
   ========================================== */


/* ==========================================
   [TYPOGRAPHY] 頁面標題區塊
   ========================================== */

.page-title-section {
    display: block !important;
    margin: 12px 0 20px 0 !important;
    margin-left: 0 !important;
    position: relative !important;
    padding-left: 5px;
}

.page-main-title {
    color: rgb(5, 71, 0) !important;
    font-size: 32px !important;
    font-weight: 900 !important;
    margin: 0 0 10px 0 !important;
    letter-spacing: 1px !important;
}


/* ==========================================
   [COLORS] 數值熱力色
   ========================================== */

.val-high {
    color: #2e7d32;
    font-weight: bold;
}

.val-mid {
    color: #1565c0;
}

.val-low {
    color: #c62828;
}


/* ==========================================
   [FOOTER] 共用頁尾
   ========================================== */

.site-footer {
    margin-top: 40px;
    padding: 14px 16px;
    background: #1b5e20;
    color: #fff;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}


/* ==========================================
   [BH PAGE TABS] 共用主分頁列
   ========================================== */

.player-management-header {
    width: 100%;
    margin: 8px 0 24px 0;
}

.bh-tabs {
    display: flex;
    align-items: stretch;
    width: 100%;
    background: #f3f5f2;
    border: 1px solid #d9e2d6;
    border-radius: 0;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.bh-tab {
    appearance: none;
    -webkit-appearance: none;
    flex: 1 1 0;
    min-width: 120px;
    height: 46px;
    padding: 0 18px !important;
    border: 0 !important;
    border-right: 1px solid #d9e2d6 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #064b12 !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    text-align: center;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    line-height: 46px;
    bottom: auto !important;
    transform: none !important;
    box-shadow: none;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.bh-tab:last-child {
    border-right: 0 !important;
}

.bh-tab:hover {
    background: #e8f3e5 !important;
    color: #043d0d !important;
    box-shadow: inset 0 -3px 0 rgba(5, 71, 0, 0.22);
    z-index: 2;
}

.bh-tab.active,
.bh-tab.active:hover {
    background: rgb(5, 71, 0) !important;
    color: #ffffff !important;
    border-color: rgb(5, 71, 0) !important;
    box-shadow: none !important;
    z-index: 5;
}

.bh-tab.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgb(5, 71, 0);
}

.bh-tab:focus-visible {
    outline: 3px solid rgba(5, 71, 0, 0.25);
    outline-offset: -3px;
}


/* ==========================================
   [BH SUB TABS] 共用次分頁列
   ========================================== */

.bh-subtabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 22px auto 12px auto;
    padding: 4px;
    background: #f3f5f2;
    border: 1px solid #d9e2d6;
    border-radius: 999px;
    width: fit-content;
    max-width: 100%;
}

.bh-subtab {
    appearance: none;
    -webkit-appearance: none;
    min-width: 150px;
    height: 36px;
    padding: 0 22px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #064b12 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    cursor: pointer !important;
    position: relative !important;
    white-space: nowrap;
    outline: none !important;
    line-height: 36px;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.bh-subtab:hover {
    background: #e8f3e5 !important;
    color: #043d0d !important;
    box-shadow: none !important;
    border: 0 !important;
    outline: none !important;
}

.bh-subtab.active,
.bh-subtab.active:hover {
    background: rgb(5, 71, 0) !important;
    color: #ffffff !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(5, 71, 0, 0.22) !important;
}

.bh-subtab:focus-visible {
    outline: 3px solid rgba(5, 71, 0, 0.25) !important;
    outline-offset: 2px !important;
}


/* ==========================================
   [ROSTER] 分頁區塊間距
   ========================================== */

.roster-tabs-header {
    margin-bottom: 14px;
}


/* ==========================================
   [PLAYER CONDITION LIGHT] 球員狀態燈號
   ========================================== */

.condition-light {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 999px;
    vertical-align: middle;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.18),
        0 0 0 2px rgba(0, 0, 0, 0.04);
}

.condition-excellent {
    background: #f97316;
}

.condition-good {
    background: #facc15;
}

.condition-normal {
    background: #22c55e;
}

.condition-low {
    background: #d1d5db;
}

.condition-awful {
    background: #4b5563;
}

.condition-injured {
    background: #9333ea;
}


/* ==========================================
   [MANAGER ALERT BANNER] 球團辦公室全站提示列
   ========================================== */

.manager-alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 10px 14px 0;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.manager-alert-banner-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.5;
}

.manager-alert-banner-icon {
    flex: 0 0 auto;
}

.manager-alert-banner.info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.manager-alert-banner.warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.manager-alert-banner.danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.manager-alert-banner-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 11px;
    border-radius: 999px;
    background: #145c22;
    color: #fff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

.manager-alert-banner-link:hover {
    filter: brightness(1.08);
}


/* ==========================================
   [GLOBAL HEADER] 全站 Header
   ========================================== */

.bh-site-header-bg {
    width: 100%;
    background: #145c22;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
    position: relative;
    z-index: 50;
}

.bh-site-header {
    min-height: 78px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-sizing: border-box;
    position: relative;
}

.bh-site-header-left {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.bh-header-burger {
    display: none !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

.bh-header-burger:hover {
    background: rgba(255, 255, 255, 0.12);
}

.bh-header-brand {
    flex: 1 1 auto;
    min-width: 0;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    color: #fff;
    text-decoration: none;
}

.bh-site-header .logo,
.bh-site-header .header,
.bh-site-header .main-logo {
    position: static !important;
    float: none !important;
    transform: none !important;
}

.bh-header-logo,
.bh-site-header .bh-header-logo,
.bh-site-header img.main-logo {
    position: static !important;
    flex: 0 0 62px !important;
    width: 62px !important;
    min-width: 62px !important;
    max-width: 62px !important;
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    object-fit: contain !important;
    margin: 0 !important;
    display: block !important;
}

.bh-header-title-info {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 0 !important;
    margin-left: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bh-header-title {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.25 !important;
    white-space: nowrap;
}

.bh-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    line-height: 1.35;
}

.bh-header-clock {
    margin-left: 2px;
}

.bh-header-user {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 44%;
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    line-height: 1.4;
    text-align: right;
    overflow: visible !important;
    padding-right: 0 !important;
}

.bh-header-user a {
    color: #fff !important;
}

.bh-header-user span {
    min-width: 0;
}


/* ==========================================
   [HEADER USER PANEL] 右上角帳號工具列
   ========================================== */

.bh-user-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    color: #fff;
    min-width: 0;
}

.bh-user-main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    max-width: 100%;
    min-width: 0;
}

.bh-user-avatar {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.bh-user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bh-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.bh-user-action {
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 6px;
    background: transparent;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none !important;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        background-color 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.bh-user-action:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #fff;
    transform: translateY(-1px);
}

.bh-user-action svg,
.bh-user-avatar svg {
    width: 25px;
    height: 25px;
    display: block;
}

.bh-user-action svg path,
.bh-user-avatar svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bh-mail-unread-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ffeb3b;
    color: #8b0000;
    font-size: 11px;
    line-height: 17px;
    font-weight: 900;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.bh-user-mail {
  position: relative;
  margin-right: 2px; /* 讓信封和右邊圖示多一點空間，可改 3~4px */
}

.bh-mail-unread-badge {
  position: absolute;
  top: -6px;
  right: -4px; /* 原本如果太靠右，例如 -7px，可改成 -4px 或 -3px */
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
}

.bh-user-office {
  position: relative;
  margin-right: 2px;
}

.bh-office-todo-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
}


/* ==========================================
   [MOBILE HEADER META] 手機版時間展開列
   ========================================== */

.bh-mobile-time-toggle,
.bh-mobile-header-meta,
.bh-mobile-header-meta[hidden] {
    display: none !important;
}


/* ==========================================
   [TABLET] 平板適應
   ========================================== */

@media screen and (min-width: 769px) and (max-width: 1180px) {
    .page-main-title {
        font-size: 24px !important;
    }

    .bh-tab {
        min-width: 112px;
        height: 44px;
        line-height: 44px;
        font-size: 15px !important;
        padding: 0 14px !important;
    }

    .bh-subtab {
        min-width: 130px;
        height: 34px;
        line-height: 34px;
        font-size: 14px !important;
        padding: 0 18px !important;
    }

    .bh-site-header {
        padding: 8px 14px;
    }

    .bh-header-title {
        font-size: 18px;
    }

    .bh-header-logo,
    .bh-site-header .bh-header-logo,
    .bh-site-header img.main-logo {
        flex-basis: 44px !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
    }

    .bh-header-user {
        max-width: 42%;
        font-size: 13px;
    }

    .bh-user-name {
        max-width: 140px;
        font-size: 13px;
    }

    .bh-user-action {
        width: 29px;
        height: 29px;
    }

    .bh-user-action svg,
    .bh-user-avatar svg {
        width: 19px;
        height: 19px;
    }
}


/* ==========================================
   [MOBILE] 手機適應
   ========================================== */

@media screen and (max-width: 768px) {
    .page-main-title {
        font-size: 22px !important;
    }

    .bh-tabs {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .bh-tab {
        flex: 0 0 auto;
        min-width: 132px;
        height: 44px;
        line-height: 44px;
        font-size: 15px !important;
        padding: 0 14px !important;
    }

    .bh-subtabs {
        justify-content: flex-start;
        width: 100%;
        overflow-x: auto;
        border-radius: 14px;
        padding: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .bh-subtab {
        flex: 0 0 auto;
        min-width: 120px;
        height: 34px;
        line-height: 34px;
        font-size: 14px !important;
        padding: 0 16px !important;
    }

    .bh-site-header-bg {
        background: #145c22;
    }

    .bh-site-header {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 58px 1fr 52px !important;
        grid-template-rows: auto auto !important;
        align-items: center !important;
        column-gap: 10px !important;
        row-gap: 0 !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 72px !important;
        padding: 8px 14px !important;
        box-sizing: border-box !important;
    }

    .bh-site-header-left {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        width: auto !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
    }

    .bh-header-brand {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .bh-header-logo,
    .bh-site-header .bh-header-logo,
    .bh-site-header img.main-logo {
        flex-basis: 48px !important;
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
        height: 48px !important;
        min-height: 48px !important;
        max-height: 48px !important;
    }

    .bh-header-title-info {
        display: none !important;
    }

    .bh-header-user {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 2 !important;
        width: auto !important;
        max-width: none !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center !important;
        overflow: visible !important;
    }

    .bh-user-panel {
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        width: auto !important;
    }

    .bh-user-main {
        justify-content: center !important;
        gap: 0 !important;
    }

    .bh-user-avatar {
        display: none !important;
    }

    .bh-user-name {
        max-width: 160px !important;
        font-size: 13px !important;
        text-align: center !important;
    }

    .bh-user-actions {
        justify-content: center !important;
        gap: 7px !important;
    }

    .bh-user-action {
        width: 24px !important;
        height: 24px !important;
        border-radius: 5px !important;
        border-width: 1px !important;
    }

    .bh-user-action svg {
        width: 17px !important;
        height: 17px !important;
    }

    .bh-mobile-time-toggle {
        display: inline-flex !important;
    }

    .bh-header-burger {
        display: flex !important;
        position: absolute !important;
        top: 14px !important;
        right: 14px !important;
        transform: none !important;

        width: 44px !important;
        height: 44px !important;
        align-items: center !important;
        justify-content: center !important;

        background: transparent !important;
        border-radius: 0 !important;
        color: #fff !important;
        font-size: 34px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        z-index: 99 !important;
        cursor: pointer !important;
    }

    .bh-header-burger:hover {
        background: rgba(255, 255, 255, 0.12) !important;
    }

    .bh-mobile-header-meta:not([hidden]) {
        grid-column: 1 / 4 !important;
        grid-row: 2 / 3 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 7px !important;
        color: #fff !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        padding-top: 7px !important;
    }

    .bh-mobile-header-meta .bh-mobile-meta-icon {
        width: 22px !important;
        height: 22px !important;
        border: 2px solid #fff !important;
        border-radius: 999px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }
}


/* ==========================================
   [VERY SMALL MOBILE]
   ========================================== */

@media screen and (max-width: 420px) {
    .bh-site-header {
        grid-template-columns: 48px 1fr 46px !important;
        column-gap: 8px !important;
        padding: 8px 10px !important;
    }

    .bh-header-logo,
    .bh-site-header .bh-header-logo,
    .bh-site-header img.main-logo {
        flex-basis: 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }

    .bh-user-name {
        max-width: 130px !important;
        font-size: 12px !important;
    }

    .bh-user-actions {
        gap: 5px !important;
    }

    .bh-user-action {
        width: 23px !important;
        height: 23px !important;
    }

    .bh-user-action svg {
        width: 16px !important;
        height: 16px !important;
    }

    .bh-header-burger {
        top: 10px !important;
        right: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 31px !important;
    }

    .bh-mobile-header-meta:not([hidden]) {
        font-size: 12px !important;
        gap: 6px !important;
    }
}


/* ==========================================
   [MOBILE MENU PATCH] 手機漢堡選單可捲動
   ========================================== */

@media screen and (max-width: 768px) {
    .menu,
    .nav,
    .navbar,
    .side-menu,
    .mobile-menu {
        max-height: calc(100vh - 66px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #menu_control:checked ~ .menu,
    #menu_control:checked ~ .nav,
    #menu_control:checked ~ .navbar,
    #menu_control:checked ~ .side-menu,
    #menu_control:checked ~ .mobile-menu {
        max-height: calc(100vh - 66px) !important;
        overflow-y: auto !important;
        padding-bottom: 24px !important;
        box-sizing: border-box !important;
    }
}