/**
 * 科技门户主题主样式。
 *
 * 按布局、首页模块、列表、详情、侧栏、页脚分段组织，便于后续扩展和维护。
 */

/* 基础变量与重置 */
:root {
    --tp-primary: #007bfc;
    --tp-dark: #0f172a;
    --tp-text: #333333;
    --tp-text-soft: #667085;
    --tp-border: #e7edf5;
    --tp-surface: #ffffff;
    --tp-surface-soft: #f9fcff;
    --tp-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --tp-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
    --tp-radius-sm: 6px;
    --tp-radius-md: 10px;
    --tp-radius-lg: 18px;
    --tp-container: 1370px;
    --tp-inner-container: 1220px;
    --tp-transition: 0.25s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.portal-body {
    margin: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    color: var(--tp-text);
    background: #ffffff;
    line-height: 1.75;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.portal-container {
    width: min(var(--tp-container), calc(100% - 48px));
    margin: 0 auto;
}

.portal-body--inner .portal-container {
    width: min(var(--tp-inner-container), calc(100% - 48px));
}

.markdown img {
    border-radius: var(--tp-radius-md);
}

/* 顶部导航 */
.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px) saturate(140%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
    border-bottom: 1px solid rgba(231, 237, 245, 0.72);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
    transition: background var(--tp-transition), border-color var(--tp-transition), box-shadow var(--tp-transition);
}

.portal-header--overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    background: linear-gradient(180deg, rgba(5, 12, 24, 0.2), rgba(5, 12, 24, 0.02));
    border-bottom-color: transparent;
    box-shadow: none;
}

.portal-header.is-scrolled {
    background: rgba(15, 23, 42, 0.78);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 52px rgba(2, 6, 23, 0.28);
}

.portal-header__inner {
    position: relative;
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.portal-brand {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: max-content;
    padding: 12px 0;
    flex-shrink: 0;
}

.portal-brand img {
    max-height: 48px;
    width: auto;
}

.portal-brand__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--tp-dark);
}

.portal-brand__subtitle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 280px;
    color: rgba(102, 112, 133, 0.9);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.portal-brand__subtitle::before {
    content: "";
    width: 24px;
    height: 1px;
    background: color-mix(in srgb, var(--tp-primary) 58%, #d7e5f7);
    flex-shrink: 0;
}

.portal-header__nav-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.portal-header--overlay .portal-brand__title,
.portal-header--overlay .portal-nav__link,
.portal-header.is-scrolled .portal-brand__title,
.portal-header.is-scrolled .portal-nav__link {
    color: #ffffff;
}

.portal-header--overlay .portal-brand__subtitle,
.portal-header.is-scrolled .portal-brand__subtitle {
    color: rgba(255, 255, 255, 0.78);
}

.portal-header--overlay .portal-brand__subtitle::before,
.portal-header.is-scrolled .portal-brand__subtitle::before {
    background: rgba(255, 255, 255, 0.42);
}

.portal-nav {
    flex: 1;
}

.portal-nav__list {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-nav__item {
    position: relative;
}

.portal-nav__item.has-children {
    padding-right: 0;
}

.portal-nav__item::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 2px;
    height: 2px;
    border-radius: 999px;
    background: var(--tp-primary);
    opacity: 0;
    transform: scaleX(0.6);
    transition: opacity var(--tp-transition), transform var(--tp-transition);
    pointer-events: none;
}

.portal-nav__item:hover::after,
.portal-nav__item:focus-within::after,
.portal-nav__item.is-active::after {
    opacity: 1;
    transform: scaleX(1);
}

.portal-nav__item.has-children > .portal-nav__link {
    min-width: 0;
}

.portal-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 8px;
    border-radius: 0;
    font-size: 16px;
    font-weight: 500;
    color: color-mix(in srgb, var(--tp-dark) 82%, #617088);
    transition: color var(--tp-transition), opacity var(--tp-transition);
}

.portal-nav__label {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.portal-nav__item:hover > .portal-nav__link,
.portal-nav__item:focus-within > .portal-nav__link {
    color: var(--tp-primary);
    opacity: 1;
}

.portal-nav__item.is-active > .portal-nav__link {
    color: var(--tp-primary);
    background: transparent;
    box-shadow: none;
}

.portal-nav__link--parent::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    opacity: 0.82;
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--tp-transition), opacity var(--tp-transition);
}

.portal-header--overlay .portal-nav__link,
.portal-header.is-scrolled .portal-nav__link {
    color: rgba(255, 255, 255, 0.86);
}

.portal-header--overlay .portal-nav__item:hover > .portal-nav__link,
.portal-header--overlay .portal-nav__item:focus-within > .portal-nav__link,
.portal-header.is-scrolled .portal-nav__item:hover > .portal-nav__link,
.portal-header.is-scrolled .portal-nav__item:focus-within > .portal-nav__link {
    color: #ffffff;
    opacity: 1;
}

.portal-header--overlay .portal-nav__item.is-active > .portal-nav__link,
.portal-header.is-scrolled .portal-nav__item.is-active > .portal-nav__link {
    color: #ffffff;
    background: transparent;
    box-shadow: none;
}

.portal-nav__item:hover > .portal-nav__link--parent::after,
.portal-nav__item:focus-within > .portal-nav__link--parent::after,
.portal-nav__item.is-active > .portal-nav__link--parent::after {
    opacity: 1;
    transform: rotate(225deg) translateY(-1px);
}

.portal-nav__toggle {
    display: none;
}

.portal-nav__submenu {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    min-width: 220px;
    margin: 0;
    padding: 10px;
    list-style: none;
    border: 1px solid rgba(226, 235, 248, 0.92);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.14);
    transform: translateY(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--tp-transition), transform var(--tp-transition), visibility var(--tp-transition);
}

.portal-nav__submenu::before {
    display: none;
}

.portal-nav__item:hover .portal-nav__submenu,
.portal-nav__item:focus-within .portal-nav__submenu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.portal-nav__submenu-item + .portal-nav__submenu-item {
    margin-top: 6px;
}

.portal-nav__submenu-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    color: var(--tp-text);
    transition: background var(--tp-transition), color var(--tp-transition), transform var(--tp-transition);
}

.portal-nav__submenu-link::before {
    display: none;
}

.portal-nav__submenu-item:hover .portal-nav__submenu-link,
.portal-nav__submenu-item.is-active .portal-nav__submenu-link,
.portal-nav__submenu-link:focus-visible {
    color: var(--tp-primary);
    background: rgba(0, 123, 252, 0.08);
    transform: none;
}

.portal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: transform var(--tp-transition), background var(--tp-transition), color var(--tp-transition), border-color var(--tp-transition);
}

.portal-button:hover {
    transform: translateY(-1px);
}

.portal-button:focus-visible,
.portal-nav__link:focus-visible,
.portal-nav__toggle:focus-visible,
.portal-nav-toggle:focus-visible,
.portal-backtop:focus-visible,
.portal-inline-link:focus-visible,
.portal-search__button:focus-visible {
    outline: 2px solid var(--tp-primary);
    outline-offset: 3px;
}

.portal-button--primary {
    background: var(--tp-primary);
    color: #ffffff;
}

.portal-button--ghost {
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--tp-text);
    background: transparent;
}

.portal-header--overlay .portal-button--ghost,
.portal-header.is-scrolled .portal-button--ghost {
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.portal-button--solid-light {
    background: #ffffff;
    color: var(--tp-dark);
}

.portal-button--ghost-light {
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.portal-button--outline {
    border-color: var(--tp-border);
    color: var(--tp-text);
    background: #ffffff;
}

.portal-nav-toggle {
    display: none;
    position: relative;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.82));
    padding: 0;
    cursor: pointer;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
}

.portal-nav-toggle span {
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transform: translateX(-50%);
    transition: top var(--tp-transition), transform var(--tp-transition), opacity var(--tp-transition);
}

.portal-nav-toggle span:nth-child(1) {
    top: 18px;
}

.portal-nav-toggle span:nth-child(2) {
    top: 25px;
}

.portal-nav-toggle span:nth-child(3) {
    top: 32px;
}

.portal-nav-toggle.is-active span:nth-child(1) {
    top: 25px;
    transform: translateX(-50%) rotate(45deg);
}

.portal-nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.portal-nav-toggle.is-active span:nth-child(3) {
    top: 25px;
    transform: translateX(-50%) rotate(-45deg);
}

.portal-header--overlay .portal-nav-toggle,
.portal-header.is-scrolled .portal-nav-toggle {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
    box-shadow: 0 18px 30px rgba(2, 6, 23, 0.18);
}

/* 标题区块 */
.portal-section {
    padding: 78px 0;
}

.portal-section--features,
.portal-section--highlights,
.portal-section--news {
    padding-top: 42px;
    padding-bottom: 42px;
}

.portal-section-title {
    max-width: 780px;
    margin: 0 auto 40px;
    text-align: center;
}

.portal-section-title__copy {
    display: grid;
    gap: 8px;
}

.portal-section-title--left {
    text-align: left;
    margin-left: 0;
}

.portal-section-title--compact {
    margin-bottom: 28px;
}

.portal-section-title--split {
    max-width: none;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    text-align: left;
}

.portal-section-title__eyebrow,
.portal-banner__eyebrow,
.portal-hero__eyebrow,
.portal-footer__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tp-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-section-title__eyebrow::before,
.portal-banner__eyebrow::before,
.portal-hero__eyebrow::before,
.portal-footer__eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background: currentColor;
}

.portal-section-title h2,
.portal-banner h1 {
    margin: 14px 0 12px;
    font-size: clamp(30px, 3vw, 38px);
    line-height: 1.24;
}

.portal-section-title p,
.portal-banner p {
    margin: 0;
    color: var(--tp-text-soft);
}

/* 首页首屏 */
.portal-hero {
    position: relative;
    overflow: hidden;
    padding: 160px 0 110px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--tp-hero-glow, #007BFC) 35%, transparent), transparent 30%),
        linear-gradient(135deg, var(--tp-hero-bg-start, #09111F) 0%, color-mix(in srgb, var(--tp-hero-bg-start, #09111F) 35%, var(--tp-hero-bg-end, #0B2E63)) 48%, var(--tp-hero-bg-end, #0B2E63) 100%);
    color: #ffffff;
}

.portal-hero::after {
    content: "";
    position: absolute;
    inset: auto -8% -120px auto;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(4px);
}

.portal-hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 56px;
    align-items: center;
}

.portal-hero__inner--single {
    grid-template-columns: minmax(0, 1fr);
}

.portal-hero__content {
    position: relative;
    min-width: 0;
    max-width: 760px;
}

.portal-hero__copy {
    min-width: 0;
}

.portal-hero__copy h1 {
    margin: 18px 0 18px;
    font-size: clamp(42px, 5vw, 58px);
    line-height: 1.18;
}

.portal-hero__copy p {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.82);
}

.portal-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 36px;
}

.portal-hero__actions--center {
    justify-content: center;
}

/* 首页卡片模块 */
.portal-feature-grid,
.portal-highlight-grid,
.portal-news-grid {
    display: grid;
    gap: 24px;
}

.portal-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-highlight-grid,
.portal-news-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-section--features .portal-section-title,
.portal-section--highlights .portal-section-title,
.portal-section--news .portal-section-title {
    max-width: none;
    margin: 0 0 28px;
    text-align: left;
}

.portal-section--features .portal-section-title__copy,
.portal-section--highlights .portal-section-title__copy,
.portal-section--news .portal-section-title__copy {
    justify-items: start;
}

.portal-section--features .portal-feature-grid {
    gap: 18px;
}

.portal-section--highlights .portal-highlight-grid,
.portal-section--news .portal-news-grid {
    gap: 18px;
}

.portal-feature-card,
.portal-highlight-card,
.portal-news-card,
.portal-stream-card,
.portal-widget,
.portal-empty-card,
.portal-article,
.portal-page-content {
    background: var(--tp-surface);
    border: 1px solid rgba(231, 237, 245, 0.88);
    border-radius: var(--tp-radius-md);
    box-shadow: var(--tp-shadow-soft);
}

.portal-feature-card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 24px 22px;
    border-color: rgba(223, 231, 241, 0.92);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.portal-feature-card h3,
.portal-highlight-card h3,
.portal-news-card h3,
.portal-stream-card h2 {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.4;
}

.portal-feature-card p,
.portal-highlight-card p,
.portal-news-card p,
.portal-stream-card p {
    margin: 0;
    line-height: 1.78;
    color: var(--tp-text-soft);
}

.portal-highlight-card,
.portal-news-card {
    overflow: hidden;
}

.portal-highlight-card {
    display: grid;
    grid-template-rows: auto 1fr;
    border-color: rgba(223, 231, 241, 0.92);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.portal-highlight-card__cover {
    display: block;
    aspect-ratio: 16 / 8.8;
    overflow: hidden;
    background: #e2e8f0;
}

.portal-highlight-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-highlight-card__body,
.portal-news-card,
.portal-stream-card,
.portal-article,
.portal-page-content,
.portal-empty-card,
.portal-widget {
    padding: 28px;
}

.portal-highlight-card__body {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 22px;
}

.portal-feature-card h3,
.portal-highlight-card h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.48;
}

.portal-news-card {
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid rgba(220, 228, 238, 0.96);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.portal-news-card h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.52;
}

.portal-news-card .portal-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.portal-news-card .portal-inline-link::after {
    content: "›";
    font-size: 18px;
    line-height: 1;
}

/* 内页 Banner 与二级导航 */
.portal-banner {
    position: relative;
    overflow: hidden;
    padding: 110px 0 74px;
    background: linear-gradient(135deg, #101828 0%, #182d53 62%, #0f172a 100%);
    color: #ffffff;
}

.portal-banner::before {
    content: "";
    position: absolute;
    inset: -40% auto auto 55%;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(0, 123, 252, 0.28);
    filter: blur(20px);
}

.portal-banner .portal-container {
    position: relative;
    z-index: 1;
}

.portal-banner p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.78);
}

/* 列表与详情布局 */
.portal-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.portal-layout--single {
    grid-template-columns: minmax(0, 1fr);
}

.portal-sidebar {
    display: grid;
    gap: 20px;
}

.portal-widget__head {
    margin-bottom: 18px;
}

.portal-widget__head h3 {
    margin: 0;
    font-size: 18px;
}

.portal-widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.portal-widget__list--stacked {
    gap: 10px;
}

.portal-widget__list--stacked a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--tp-radius-sm);
    background: #f7faff;
}

.portal-widget__content {
    color: var(--tp-text-soft);
}

.portal-search {
    display: grid;
    gap: 12px;
}

.portal-search__input,
.portal-comment-form textarea,
.portal-comment-form input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-sm);
    padding: 12px 14px;
    font: inherit;
    color: var(--tp-text);
    background: #ffffff;
}

.portal-comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.portal-search__button {
    min-height: 48px;
    border: 0;
    border-radius: var(--tp-radius-sm);
    background: var(--tp-primary);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

.portal-content {
    min-width: 0;
}

.portal-stream-card {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
}

.portal-stream-card__meta,
.portal-meta-row,
.portal-article__author,
.portal-stream-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--tp-text-soft);
    font-size: 13px;
}

.portal-chip,
.portal-tag,
.portal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(0, 123, 252, 0.08);
    color: var(--tp-primary);
    font-size: 13px;
    font-weight: 600;
}

.portal-badge {
    margin-left: 10px;
}

.portal-inline-link {
    color: var(--tp-primary);
    font-weight: 700;
}

.portal-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.portal-pagination a,
.portal-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--tp-radius-sm);
    background: #ffffff;
    border: 1px solid var(--tp-border);
}

.portal-pagination > span,
.portal-pagination .current,
.portal-pagination span.current {
    color: var(--tp-primary);
    font-weight: 700;
    border-color: var(--tp-primary);
    background: var(--tp-surface-soft);
}

/* 文章详情与评论 */
.portal-back-link {
    display: inline-flex;
    margin-bottom: 24px;
    color: var(--tp-primary);
    font-weight: 700;
}

.portal-article__header h1 {
    margin: 14px 0 18px;
    font-size: clamp(28px, 2.6vw, 36px);
    line-height: 1.3;
}

.portal-article__body {
    padding-top: 8px;
}

.portal-article__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.portal-neighbor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px;
}

.portal-neighbor__item {
    padding: 22px;
    border-radius: var(--tp-radius-md);
    background: #f8fbff;
    border: 1px solid var(--tp-border);
}

.portal-neighbor__item span {
    display: block;
    color: var(--tp-text-soft);
    margin-bottom: 8px;
}

.portal-comments,
.portal-comment-form {
    margin-top: 42px;
}

.portal-comment-form__body,
.portal-comment-form__grid {
    display: grid;
    gap: 14px;
}

.portal-comment-form__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-comment {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid var(--tp-border);
}

.portal-comment:first-of-type {
    border-top: 0;
}

.portal-comment--child {
    margin-left: 32px;
}

.portal-comment__avatar img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.portal-comment__meta {
    display: flex;
    gap: 10px;
    color: var(--tp-text-soft);
    margin-bottom: 10px;
}

/* 页脚 */
.portal-footer {
    background: var(--tp-surface-soft);
    border-top: 1px solid var(--tp-border);
}

.portal-footer__top {
    border-bottom: 1px solid var(--tp-border);
}

.portal-footer__guarantees,
.portal-footer__grid,
.portal-footer__bottom-inner {
    display: grid;
    gap: 24px;
}

.portal-footer__guarantees {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 28px 0;
}

.portal-guarantee strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.portal-guarantee span,
.portal-footer p,
.portal-footer li,
.portal-footer__bottom {
    color: var(--tp-text-soft);
}

.portal-footer__main {
    padding: 52px 0 38px;
}

.portal-footer__grid {
    grid-template-columns: 1.2fr 0.8fr 0.8fr;
}

.portal-footer__grid h3 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 18px;
}

.portal-footer__grid ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.portal-footer__bottom {
    padding: 20px 0 28px;
    border-top: 1px solid var(--tp-border);
}

.portal-footer__bottom-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.portal-backtop {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--tp-border);
    background: #ffffff;
    border-radius: var(--tp-radius-sm);
    cursor: pointer;
}

/* 首页悬浮返回顶部 */
.portal-body--home .portal-footer__bottom-inner {
    grid-template-columns: minmax(0, 1fr);
}

.portal-body--home .portal-backtop {
    position: fixed;
    right: 32px;
    right: max(32px, env(safe-area-inset-right));
    bottom: 32px;
    bottom: max(32px, env(safe-area-inset-bottom));
    z-index: 30;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: color-mix(in srgb, var(--tp-primary) 78%, #0f172a);
    font-size: 0;
    line-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity var(--tp-transition), transform var(--tp-transition), visibility var(--tp-transition), color var(--tp-transition);
}

.portal-body--home .portal-backtop::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-top: 2.5px solid currentColor;
    border-left: 2.5px solid currentColor;
    border-radius: 1px;
    transform: translateX(-50%) rotate(45deg);
}

.portal-body--home .portal-backtop::after {
    content: "";
    display: block;
    position: absolute;
    top: 19px;
    left: 50%;
    width: 2px;
    height: 14px;
    border-radius: 999px;
    background: currentColor;
    transform: translateX(-50%);
}

.portal-backtop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.portal-body--home .portal-backtop.is-visible:hover {
    transform: translateY(-2px);
    color: var(--tp-primary);
}

@media (prefers-reduced-motion: reduce) {
    .portal-body--home .portal-backtop {
        transition: none;
        transform: none;
    }

    .portal-body--home .portal-backtop.is-visible,
    .portal-body--home .portal-backtop.is-visible:hover {
        transform: none;
    }
}

/* 空状态 */
.portal-empty-card {
    text-align: center;
}

.portal-empty-card h2 {
    margin-top: 0;
}
