/* 各系統頁首權限摘要 + 與首頁一致的開發者+ 徽章 */

.htfl-access-banner {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.95);
}

.header .htfl-access-banner {
    color: rgba(255, 255, 255, 0.95);
}

.htfl-access-primary {
    flex: 1 1 220px;
    min-width: 0;
    font-weight: 600;
}

.htfl-access-designated {
    flex-basis: 100%;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
}

/* 與 templates/home.html 首頁卡片徽章一致 */
.card-badge {
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.3px;
}

.card-badge.dev-plus {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.18);
}

/* 頁首時鐘左側：工作暑熱警告（僅官方圖示，無文字） */
.htfl-hsww {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    padding: 0;
    border: none;
    background: none;
    line-height: 0;
    cursor: default;
    vertical-align: middle;
}

.htfl-hsww-icon {
    display: block;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    object-fit: contain;
}

.htfl-hsww[hidden] {
    display: none !important;
}

/* 頁首香港時間（與 partial htfl_live_clock 共用） */
.htfl-live-clock {
    display: inline-block;
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 7.5ch;
    margin-right: 6px;
    opacity: 0.95;
    white-space: nowrap;
}

.header .htfl-live-clock,
.hero-top .htfl-live-clock {
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* 頁首時鐘右側：豆包 API 餘額（預留寬度，避免載入後推擠版面） */
.htfl-llm-balance {
    display: inline-block;
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-right: 8px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    opacity: 0.92;
    cursor: default;
    vertical-align: middle;
}

.htfl-llm-balance.is-reserved {
    display: inline-block;
    min-width: 4.85rem;
    text-align: center;
    box-sizing: border-box;
}

.htfl-llm-balance[hidden] {
    display: none !important;
}

.htfl-llm-balance.is-pending {
    opacity: 0.5;
}

.htfl-llm-balance.is-stale {
    opacity: 0.78;
}

.htfl-llm-balance.is-guest {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.header-actions,
.hero-top .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* admin 等淺色頁首 */
body.admin-page .header .htfl-live-clock,
.admin-header-bar .htfl-live-clock {
    color: rgba(255, 255, 255, 0.98);
}

@media (max-width: 768px) {
    .htfl-access-banner {
        margin-top: 8px;
        padding: 8px 10px;
        align-items: flex-start;
    }

    .htfl-access-primary {
        flex: 1 1 auto;
        min-width: 0;
    }

    .htfl-access-designated {
        font-size: 11px;
        line-height: 1.4;
    }

    .htfl-hsww {
        margin-right: 4px;
    }

    .htfl-hsww-icon {
        width: 22px;
        height: 22px;
    }

    .htfl-live-clock {
        font-size: 12px;
        margin-right: 4px;
    }

    .htfl-llm-balance {
        font-size: 11px;
        margin-right: 4px;
        padding: 2px 5px;
    }
}

@media (max-width: 430px) {
    .htfl-access-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .card-badge {
        align-self: flex-start;
    }
}
