/* 前台顶部栏 */
.front-topbar {
    position: relative;
    z-index: 30;
    height: var(--topbar-height, 74px);
    border-bottom: 1px solid rgba(15, 23, 42, .08);
    background: rgba(255, 255, 255, .86);
    color: #0f172a;
    backdrop-filter: blur(16px);
}

.front-topbar.is-sticky {
    position: sticky;
    top: 0;
}

.front-topbar--dark {
    border-bottom-color: rgba(255, 255, 255, .12);
    background: rgba(8, 17, 33, .82);
    color: #eaf1fb;
}

.front-topbar--transparent {
    border-bottom-color: rgba(255, 255, 255, .14);
    background: linear-gradient(180deg, rgba(6, 14, 28, .36), rgba(6, 14, 28, .08));
    color: #fff;
}

.front-topbar--transparent .topbar-brand-text small { color: rgba(255, 255, 255, .7); }
.front-topbar--transparent .topbar-search { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.front-topbar--transparent .topbar-search input { color: #fff; }
.front-topbar--transparent .topbar-lang { border-color: rgba(255, 255, 255, .2); }

.topbar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
    color: inherit;
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.topbar-logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.topbar-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.topbar-brand-text b {
    overflow: hidden;
    color: inherit;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-brand-text small {
    margin-top: 3px;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    margin-inline-start: 18px;
    overflow: hidden;
    flex: 1 1 auto;
}

.topbar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 8px;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
    opacity: .68;
    transition: opacity .16s ease, background .16s ease, color .16s ease;
    white-space: nowrap;
}

.topbar-nav a i { font-size: 12px; opacity: .85; }
.topbar-nav a:hover { opacity: 1; background: rgba(37, 99, 235, .08); }
.topbar-nav a.is-active {
    background: color-mix(in srgb, var(--topbar-accent, #2563eb) 13%, transparent);
    color: var(--topbar-accent, #2563eb);
    opacity: 1;
}

.front-topbar--dark .topbar-nav a:hover,
.front-topbar--transparent .topbar-nav a:hover { background: rgba(255, 255, 255, .1); }
.front-topbar--dark .topbar-nav a.is-active,
.front-topbar--transparent .topbar-nav a.is-active {
    background: color-mix(in srgb, var(--topbar-accent, #2563eb) 28%, transparent);
    color: #fff;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(220px, 22vw);
    height: 38px;
    margin-inline-start: auto;
    padding: 0 10px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 10px;
    background: rgba(255, 255, 255, .6);
    flex-shrink: 1;
}

.topbar-search > i { color: #64748b; font-size: 12px; }
.topbar-search input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font-size: 12px;
}
.topbar-search input::placeholder { color: #94a3b8; }
.topbar-search button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--topbar-accent, #2563eb);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
.topbar-search button i { font-size: 10px; }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-inline-start: 4px;
    flex-shrink: 0;
}

.topbar-phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: inherit;
}

.topbar-phone > i { color: var(--topbar-accent, #2563eb); font-size: 13px; }
.topbar-phone span { display: flex; flex-direction: column; line-height: 1.1; }
.topbar-phone small { color: #64748b; font-size: 9px; }
.topbar-phone b { margin-top: 2px; font-size: 12px; font-weight: 600; }
.front-topbar--dark .topbar-phone small,
.front-topbar--transparent .topbar-phone small { color: rgba(255, 255, 255, .6); }

.topbar-lang {
    display: flex;
    align-items: center;
    padding: 2px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 8px;
}

.topbar-lang a {
    padding: 5px 8px;
    border-radius: 6px;
    color: inherit;
    font-size: 10px;
    font-weight: 600;
    opacity: .62;
}
.topbar-lang a.is-active { background: var(--topbar-accent, #2563eb); color: #fff; opacity: 1; }

.topbar-user-wrap {
    position: relative;
    flex-shrink: 0;
}

.topbar-user {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.topbar-user:hover { border-color: var(--topbar-accent, #2563eb); }

.topbar-user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    color: inherit;
    font-size: 13px;
}

.topbar-user-icon.has-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-user-status {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #16a34a;
}

.topbar-user-caret {
    position: absolute;
    right: -3px;
    bottom: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 50%;
    background: #fff;
    color: #475569;
    font-size: 7px;
}

.front-topbar--dark .topbar-user,
.front-topbar--transparent .topbar-user { border-color: rgba(255, 255, 255, .24); }
.front-topbar--dark .topbar-user-caret,
.front-topbar--transparent .topbar-user-caret { background: #13233b; border-color: rgba(255, 255, 255, .24); color: #fff; }

/* 用户下拉菜单 */
.topbar-user-menu {
    position: absolute;
    top: calc(100% + 12px);
    inset-inline-end: 0;
    z-index: 70;
    width: 328px;
    max-height: min(78vh, 620px);
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    color: #0f172a;
    text-align: start;
}
.topbar-user-menu[hidden] { display: none; }
.topbar-user-menu::-webkit-scrollbar { width: 0; height: 0; display: none; }

.topbar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 13px;
    background: linear-gradient(135deg, #f2f7ff, #f7fbf8);
}
.topbar-user-card .topbar-user-icon {
    width: 46px;
    height: 46px;
    border: 1px solid rgba(15, 23, 42, .08);
    background: #fff;
}
.topbar-user-card .topbar-user-icon i { font-size: 17px; color: #2563eb; }
.topbar-user-id { min-width: 0; flex: 1 1 auto; }
.topbar-user-id b { display: block; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-id span { display: block; margin-top: 3px; overflow: hidden; color: #64748b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff3df;
    color: #9a6216;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.topbar-user-level i { font-size: 9px; }

.topbar-user-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 9px 12px;
    border: 1px solid #e6edf5;
    border-radius: 10px;
    color: #64748b;
    font-size: 12px;
}
.topbar-user-balance b { color: #16231f; font-size: 15px; }

.topbar-user-links { display: grid; gap: 2px; }
.topbar-user-links a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
}
.topbar-user-links a:hover { background: #f3f7fd; color: #2563eb; }
.topbar-user-links a > i:first-child { width: 15px; color: #2563eb; font-size: 12px; text-align: center; }
.topbar-user-links a > span { flex: 1 1 auto; }
.topbar-user-link-arrow { color: #94a3b8; font-size: 9px; }
.is-rtl .topbar-user-link-arrow { transform: rotate(180deg); }

.topbar-user-logout {
    margin: 10px -14px -14px;
    padding: 10px 14px 12px;
    border-top: 1px solid #eef2f7;
}
.topbar-user-logout button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 36px;
    padding: 0;
    border: 1px solid #f0d7d7;
    border-radius: 9px;
    background: #fff8f8;
    color: #b43b3b;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.topbar-user-logout button:hover { background: #fdeeee; border-color: #e8bcbc; }

/* 未登录用户 */
.topbar-user-guest { display: grid; gap: 12px; }
.topbar-user-guest-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar-user-guest-head .topbar-user-icon {
    width: 46px;
    height: 46px;
    border: 1px solid #e4ebf4;
    background: #f4f8fd;
}
.topbar-user-guest-head .topbar-user-icon i { font-size: 17px; color: #2563eb; }
.topbar-user-guest-head b { display: block; font-size: 14px; }
.topbar-user-guest-head small { display: block; margin-top: 4px; color: #64748b; font-size: 11px; line-height: 1.55; }

.topbar-user-login-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.topbar-user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    border: 1px solid #dbe4ef;
    border-radius: 9px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
}
.topbar-user-btn:hover { border-color: #2563eb; color: #2563eb; }
.topbar-user-btn.is-primary { border-color: #2563eb; background: #2563eb; color: #fff; }
.topbar-user-btn.is-primary:hover { background: #1d4ed8; }

.topbar-user-support {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 10px;
}
.topbar-user-support i { color: #16a34a; font-size: 10px; }

.topbar-user-third {
    padding-top: 11px;
    border-top: 1px solid #eef2f7;
}
.topbar-user-third-title { display: block; margin-bottom: 8px; color: #94a3b8; font-size: 10px; text-align: center; }
.topbar-user-third-empty { margin: 0; color: #94a3b8; font-size: 10px; line-height: 1.6; text-align: center; }
.topbar-third-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 6px; }
.topbar-third {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    border: 1px solid #e5ebf3;
    border-radius: 9px;
    background: #fff;
    color: #475569;
    font-size: 10px;
    white-space: nowrap;
}
.topbar-third:hover { border-color: var(--third-color, #2563eb); color: var(--third-color, #2563eb); }
.topbar-third i { color: var(--third-color, #2563eb); font-size: 14px; }

/* 移动端会员区 */
.topbar-mobile-user { display: grid; gap: 10px; margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(15, 23, 42, .08); }
.topbar-mobile-user.is-guest { padding: 0 0 12px; }
.topbar-mobile-user-head { display: flex; align-items: center; gap: 9px; }
.topbar-mobile-user-head .topbar-user-icon { width: 38px; height: 38px; flex-shrink: 0; border: 1px solid rgba(15, 23, 42, .1); background: rgba(255, 255, 255, .7); }
.topbar-mobile-user-head b { display: block; font-size: 12px; }
.topbar-mobile-user-head small { display: block; margin-top: 2px; color: #64748b; font-size: 10px; }
.topbar-mobile-user.is-guest .topbar-user-login-actions { margin-top: 2px; }
.topbar-mobile-user-center { margin-inline-start: auto; padding: 5px 9px; border-radius: 7px; background: rgba(37, 99, 235, .08); color: #2563eb; font-size: 10px; }
.topbar-mobile-user-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.topbar-mobile-user-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 9px;
    border-radius: 8px;
    background: rgba(241, 245, 249, .7);
    color: inherit;
    font-size: 11px;
}
.topbar-mobile-user-links a i { color: #2563eb; font-size: 10px; }
.topbar-mobile-logout button {
    width: 100%;
    min-height: 32px;
    border: 1px solid rgba(180, 59, 59, .25);
    border-radius: 8px;
    background: transparent;
    color: #b43b3b;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}
.topbar-mobile-third { display: flex; justify-content: center; gap: 10px; margin-top: 2px; }
.topbar-mobile-third a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 50%;
    color: #475569;
    font-size: 15px;
}

.topbar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 9px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.topbar-mobile {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 2;
    max-height: min(76vh, 520px);
    overflow: auto;
    padding: 12px 16px 18px;
    border-bottom: 1px solid rgba(15, 23, 42, .1);
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
    color: #0f172a;
}

.front-topbar--dark .topbar-mobile {
    border-bottom-color: rgba(255, 255, 255, .12);
    background: #101c31;
    color: #eaf1fb;
}
.front-topbar--transparent .topbar-mobile {
    background: rgba(8, 17, 33, .96);
    color: #eaf1fb;
}

.topbar-mobile .topbar-search {
    width: 100%;
    margin: 0 0 12px;
    background: rgba(241, 245, 249, .8);
}
.topbar-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.topbar-mobile-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    padding: 0 11px;
    border-radius: 8px;
    color: inherit;
    font-size: 13px;
    font-weight: 500;
}
.topbar-mobile-nav a i { width: 16px; color: var(--topbar-accent, #2563eb); font-size: 12px; text-align: center; }
.topbar-mobile-nav a.is-active { background: rgba(37, 99, 235, .1); color: var(--topbar-accent, #2563eb); }
.topbar-mobile-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, .08);
}
.topbar-mobile-phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: inherit;
    font-size: 12px;
}

.front-topbar.is-open .topbar-mobile { display: block; }
.front-topbar.is-open .topbar-toggle i::before { content: "\f00d"; }

@media (max-width: 1120px) {
    .topbar-phone span small { display: none; }
    .topbar-search { width: 180px; }
}

@media (max-width: 980px) {
    .front-topbar { height: 62px; }
    .front-topbar .topbar-nav,
    .front-topbar .topbar-search:not(.topbar-search-mobile),
    .front-topbar .topbar-phone,
    .front-topbar .topbar-lang:not(.topbar-lang--mobile),
    .front-topbar .topbar-user-wrap { display: none; }
    .topbar-brand-text small { display: none; }
    .topbar-brand-text b { font-size: 16px; }
    .topbar-toggle { display: inline-flex; }
    .front-topbar.no-mobile .topbar-toggle { display: none; }
}

@media (max-width: 480px) {
    .topbar-logo { width: 32px; height: 32px; }
    .topbar-mobile { padding-inline: 12px; }
}

/* 自定义背景颜色：覆盖风格默认背景，并按背景明暗自适应文字色 */
.front-topbar.has-custom-bg {
    background: var(--topbar-bg, rgba(255, 255, 255, .86));
    border-bottom-color: var(--topbar-line, rgba(15, 23, 42, .08));
    color: var(--topbar-fg, #0f172a);
}

.front-topbar.has-custom-bg .topbar-brand-text small,
.front-topbar.has-custom-bg .topbar-phone small,
.front-topbar.has-custom-bg .topbar-search > i,
.front-topbar.has-custom-bg .topbar-search input::placeholder {
    color: var(--topbar-muted, #64748b);
}

.front-topbar.has-custom-bg .topbar-search {
    border-color: var(--topbar-line, rgba(15, 23, 42, .1));
    background: var(--topbar-control, rgba(255, 255, 255, .6));
}

.front-topbar.has-custom-bg .topbar-lang,
.front-topbar.has-custom-bg .topbar-user {
    border-color: var(--topbar-line, rgba(15, 23, 42, .1));
}

.front-topbar.has-custom-bg .topbar-nav a:hover {
    background: var(--topbar-hover, rgba(37, 99, 235, .08));
}

.front-topbar.has-custom-bg .topbar-user-caret {
    border-color: var(--topbar-line, rgba(15, 23, 42, .1));
    background: var(--topbar-caret, #fff);
    color: var(--topbar-caret-fg, #475569);
}

.front-topbar.has-custom-bg .topbar-mobile {
    border-bottom-color: var(--topbar-line, rgba(15, 23, 42, .1));
    background: var(--topbar-bg-solid, #fff);
    color: var(--topbar-fg, #0f172a);
}

.front-topbar.has-custom-bg .topbar-mobile .topbar-search {
    background: var(--topbar-control, rgba(255, 255, 255, .6));
}

.front-topbar.has-custom-bg .topbar-mobile-user,
.front-topbar.has-custom-bg .topbar-mobile-foot {
    border-color: var(--topbar-line, rgba(15, 23, 42, .08));
}

.front-topbar.has-custom-bg .topbar-mobile-user-head .topbar-user-icon,
.front-topbar.has-custom-bg .topbar-mobile-third a {
    border-color: var(--topbar-line, rgba(15, 23, 42, .1));
    background: var(--topbar-control, rgba(255, 255, 255, .7));
}

.front-topbar.has-custom-bg .topbar-mobile-user-links a {
    background: var(--topbar-hover, rgba(37, 99, 235, .08));
}

.front-topbar.has-custom-bg.is-custom-dark .topbar-nav a.is-active {
    background: color-mix(in srgb, var(--topbar-accent, #2563eb) 28%, transparent);
    color: #fff;
}

.front-topbar.has-custom-bg.is-custom-dark .topbar-mobile-nav a.is-active {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.front-topbar.has-custom-bg.is-custom-light .topbar-nav a.is-active {
    background: color-mix(in srgb, var(--topbar-accent, #2563eb) 13%, transparent);
    color: var(--topbar-accent, #2563eb);
}

.front-topbar.has-custom-bg.is-custom-light .topbar-mobile-nav a.is-active {
    background: rgba(37, 99, 235, .1);
    color: var(--topbar-accent, #2563eb);
}
