/* Homepage hub: center tools | right portals */

.hub-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hub-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.hub-sidebar {
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    width: 13.5rem;
    background: #fff;
    border-color: #f3f4f6;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hub-sidebar-right {
    border-left: 1px solid #f3f4f6;
    width: 21rem;
}

@media (min-width: 1280px) {
    .hub-sidebar-right {
        width: 24rem;
    }
}

@media (min-width: 1536px) {
    .hub-sidebar-right {
        width: 26rem;
    }
}

@media (min-width: 1024px) {
    .hub-sidebar {
        display: flex;
    }
}

.hub-sidebar-head {
    padding: 1rem 1rem 0.625rem;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #111827;
}

.hub-sidebar-sub {
    padding: 0 1rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.5;
}

.hub-sidebar-left .hub-sidebar-head {
    padding-bottom: 0.75rem;
}

.hub-sidebar-right .hub-sidebar-head {
    font-size: 1rem;
}

.hub-sidebar-right .hub-sidebar-sub {
    font-size: 0.875rem;
    color: #374151;
}

.hub-nav-list,
.hub-portal-list {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem 1rem;
}

.hub-portal-list li + li {
    margin-top: 0.5rem;
}

.hub-sidebar-left .hub-nav-list {
    padding-top: 1rem;
}

.hub-sidebar-left .hub-nav-list a {
    font-size: 1.0625rem;
    padding: 0.6875rem 0.875rem;
}

.hub-nav-list a,
.hub-portal-list a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.hub-nav-list a {
    padding: 0.625rem 0.875rem;
}

.hub-nav-list a:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.hub-nav-list a.is-active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.hub-portal-list a {
    flex-direction: column;
    align-items: stretch;
    padding: 0.875rem 1rem;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.hub-portal-list a:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.hub-portal-list a:hover .hub-portal-title {
    color: #2563eb;
}

.hub-portal-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.hub-portal-icon {
    flex-shrink: 0;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.hub-portal-title {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    transition: color 0.15s;
}

.hub-portal-desc {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.55;
}

.hub-portal-external-inline {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin-left: 0.125rem;
    vertical-align: 0.05em;
}

.hub-portal-list a:hover .hub-portal-external-inline {
    color: #2563eb;
}

.hub-center {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.hub-center-wide .hub-center-inner {
    max-width: 64rem;
}

.hub-center-inner {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

@media (min-width: 640px) {
    .hub-center-inner {
        padding: 1.5rem 1.5rem 2.5rem;
    }
}

.hub-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
}

.hub-group {
    scroll-margin-top: 1rem;
}

.hub-group + .hub-group {
    margin-top: 2rem;
}

.hub-group-head {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.875rem;
    padding-left: 0.75rem;
    border-left: 3px solid #2563eb;
    line-height: 1.3;
}

.hub-tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hub-tool-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-height: 0;
    padding: 0.5rem 0.875rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.hub-tool-badge {
    flex: 0 0 auto;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    border-radius: 0.375rem;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}

.hub-tool-badge-paid {
    color: #b45309;
    background: #fffbeb;
    border-color: #fcd34d;
}

.hub-tool-badge-limit {
    color: #0f766e;
    background: #f0fdfa;
    border-color: #99f6e4;
}

.hub-tool-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.hub-tool-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s;
}

.hub-tool-card:hover h3 {
    color: #2563eb;
}

.hub-tool-card.is-hidden {
    display: none !important;
}

.hub-group.is-hidden,
.hub-empty-search {
    display: none;
}

.hub-empty-search.is-visible {
    display: block;
    text-align: center;
    color: #6b7280;
    padding: 3rem 1rem;
    font-size: 0.9375rem;
}

/* Mobile toolbar: search */
.hub-mobile-toolbar {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
}

.hub-music-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0 0.75rem;
}

@media (min-width: 1024px) {
    .hub-mobile-toolbar {
        display: none !important;
    }
}

.hub-search-wrap {
    position: relative;
    max-width: 80rem;
    margin: 0 auto;
}

.hub-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
    pointer-events: none;
}

.hub-search-input {
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    background: #f9fafb;
    font-size: 0.9375rem;
    color: #111827;
    outline: none;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.hub-search-input:focus {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.hub-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #9ca3af;
    padding: 0.25rem 0.375rem;
    cursor: pointer;
    display: none;
    line-height: 1;
}

.hub-search-clear.is-visible {
    display: block;
}

.hub-search-clear:hover {
    color: #4b5563;
}

/* Mobile portals：跟在工具列表滚动内容最下方 */
.hub-mobile-portals {
    margin-top: 1.25rem;
    padding-bottom: 0.5rem;
    background: transparent;
    border-top: 1px solid #e5e7eb;
}

@media (min-width: 1024px) {
    .hub-mobile-portals {
        display: none !important;
    }
}

.hub-mobile-portals-label {
    padding: 0.5rem 1rem 0;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
}

.hub-mobile-portals-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: visible;
    padding: 0.5rem 1rem 0.75rem;
}

.hub-mobile-portal-chip {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
}

.hub-mobile-portal-chip:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #2563eb;
}

.hub-mobile-portal-chip i {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Xianyu / redeem howto on homepage */
.hub-howto {
    margin: 0.75rem 1rem 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.hub-howto-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.375rem;
}

.hub-howto-body {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #1e40af;
}

.hub-howto-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.hub-howto-actions .tb-btn {
    text-decoration: none;
    text-align: center;
}

@media (max-width: 768px) {
    .hub-howto {
        margin: 0.5rem 0.75rem 1.5rem;
    }

    .hub-howto + .hub-group {
        margin-top: 0.25rem;
    }
}
