body.portal-body {
    margin: 0;
    color: #e5eefc;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 34%),
        linear-gradient(180deg, #07111f 0%, #0b1527 42%, #0f172a 100%);
    min-height: 100vh;
}

body.portal-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.03), transparent 45%),
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.05), transparent 28%),
        radial-gradient(circle at 80% 0%, rgba(255,255,255,0.04), transparent 30%);
}

body.portal-theme-school {
    --portal-accent: #4f8cff;
    --portal-accent-2: #22c3ee;
    --portal-soft: rgba(79, 140, 255, 0.18);
    --portal-badge: rgba(255, 255, 255, 0.12);
}

body.portal-theme-village {
    --portal-accent: #2dd4bf;
    --portal-accent-2: #38bdf8;
    --portal-soft: rgba(45, 212, 191, 0.18);
    --portal-badge: rgba(255, 255, 255, 0.12);
}

body.portal-theme-family {
    --portal-accent: #a78bfa;
    --portal-accent-2: #f59e0b;
    --portal-soft: rgba(167, 139, 250, 0.18);
    --portal-badge: rgba(255, 255, 255, 0.12);
}

body.portal-body .hero {
    position: relative;
    background:
        linear-gradient(135deg, rgba(8, 15, 32, 0.94) 0%, rgba(12, 23, 43, 0.86) 54%, rgba(15, 23, 42, 0.8) 100%),
        linear-gradient(120deg, var(--portal-accent, #4f8cff), var(--portal-accent-2, #22c3ee));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

body.portal-body .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 160px;
    background: linear-gradient(180deg, transparent 0%, rgba(7, 17, 31, 0.38) 100%);
    pointer-events: none;
}

body.portal-body .hero-wrap,
body.portal-body .hero-inner,
body.portal-body .content-wrap,
body.portal-body .page-wrap {
    position: relative;
    z-index: 1;
}

body.portal-body .hero-top,
body.portal-body .hero-person {
    align-items: center;
}

body.portal-body .hero-title {
    font-size: clamp(2rem, 2.8vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

body.portal-body .hero-desc {
    max-width: 860px;
    color: rgba(226, 232, 240, 0.88);
    font-size: 15px;
}

body.portal-body .hero-chip,
body.portal-body .meta-chip {
    backdrop-filter: blur(12px);
    background: var(--portal-badge, rgba(255,255,255,0.12));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

body.portal-body .hero-logo,
body.portal-body .person-avatar {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

body.portal-body .page-wrap,
body.portal-body .content-wrap {
    padding-top: 24px;
    padding-bottom: 56px;
}

body.portal-body .portal-quickbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

body.portal-body .portal-quickbar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #f8fafc;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

body.portal-body .portal-quickbar a:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
}

body.portal-body .portal-stage {
    margin-top: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
    gap: 18px;
}

body.portal-body .portal-stage-main,
body.portal-body .portal-stage-side {
    min-width: 0;
}

body.portal-body .portal-stage-card,
body.portal-body .portal-spotlight-card,
body.portal-body .portal-side-card {
    position: relative;
    border-radius: 22px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%),
        rgba(10, 18, 32, 0.55);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 36px rgba(2, 8, 23, 0.22);
}

body.portal-body .portal-stage-title {
    font-size: clamp(1.5rem, 2vw, 2rem);
    line-height: 1.18;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 10px;
}

body.portal-body .portal-stage-text {
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.85;
    font-size: 14px;
}

body.portal-body .portal-stage-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

body.portal-body .portal-stage-actions a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 700;
    color: #f8fafc;
}

body.portal-body .portal-stage-actions .is-primary {
    background: linear-gradient(135deg, var(--portal-accent, #4f8cff), var(--portal-accent-2, #22c3ee));
    box-shadow: 0 12px 26px rgba(2, 8, 23, 0.26);
}

body.portal-body .portal-stage-actions .is-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.portal-body .portal-highlight-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body.portal-body .portal-highlight-item {
    padding: 14px 14px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .portal-highlight-label {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.68);
    margin-bottom: 8px;
}

body.portal-body .portal-highlight-value {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 800;
    color: #f8fafc;
}

body.portal-body .portal-highlight-note {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(226, 232, 240, 0.62);
}

body.portal-body .portal-spotlight-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 250, 252, 0.92);
    font-size: 12px;
}

body.portal-body .portal-spotlight-title {
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 800;
    color: #f8fafc;
}

body.portal-body .portal-spotlight-text {
    margin-top: 10px;
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.8;
    font-size: 13px;
}

body.portal-body .portal-mini-list {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

body.portal-body .portal-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .portal-mini-item strong {
    color: #f8fafc;
    font-size: 14px;
}

body.portal-body .portal-mini-item span {
    color: rgba(226, 232, 240, 0.68);
    font-size: 12px;
}

body.portal-body .portal-side-card + .portal-side-card {
    margin-top: 14px;
}

body.portal-body .portal-side-title {
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 10px;
}

body.portal-body .portal-side-text {
    color: rgba(226, 232, 240, 0.74);
    line-height: 1.75;
    font-size: 13px;
}

body.portal-body .portal-side-links {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

body.portal-body .portal-side-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: #f8fafc;
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .portal-side-links small {
    color: rgba(226, 232, 240, 0.62);
    display: block;
    margin-top: 2px;
}

body.portal-body .portal-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

body.portal-body .portal-guide-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(17, 24, 39, 0.72) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

body.portal-body .portal-guide-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 18px 34px rgba(2, 8, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.portal-body .portal-guide-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--portal-soft, rgba(79, 140, 255, 0.18));
    color: #eef6ff;
    font-size: 12px;
    font-weight: 700;
}

body.portal-body .portal-guide-title {
    margin-top: 12px;
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 800;
    color: #f8fafc;
}

body.portal-body .portal-guide-text {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.74);
    line-height: 1.75;
    font-size: 13px;
}

body.portal-body .portal-guide-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.portal-body .portal-guide-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.78);
    font-size: 12px;
}

body.portal-body .portal-showcase-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 14px;
}

body.portal-body .portal-showcase-card,
body.portal-body .portal-callout-card {
    position: relative;
    border-radius: 20px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(17, 24, 39, 0.74) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body.portal-body .portal-showcase-card + .portal-showcase-card,
body.portal-body .portal-callout-card + .portal-callout-card {
    margin-top: 14px;
}

body.portal-body .portal-block-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--portal-soft, rgba(79, 140, 255, 0.18));
    color: #eef6ff;
    font-size: 12px;
    font-weight: 700;
}

body.portal-body .portal-block-title {
    margin-top: 12px;
    font-size: 1.2rem;
    line-height: 1.35;
    font-weight: 800;
    color: #f8fafc;
}

body.portal-body .portal-block-text {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.74);
    line-height: 1.8;
    font-size: 13px;
}

body.portal-body .portal-chip-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.portal-body .portal-chip-row span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.8);
    font-size: 12px;
}

body.portal-body .portal-action-row {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.portal-body .portal-action-row a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #f8fafc;
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.portal-body .portal-action-row a.is-primary {
    background: linear-gradient(135deg, var(--portal-accent, #4f8cff), var(--portal-accent-2, #22c3ee));
    border-color: transparent;
}

body.portal-body .portal-timeline {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

body.portal-body .portal-timeline-item {
    position: relative;
    padding: 14px 14px 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .portal-timeline-item::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: linear-gradient(180deg, var(--portal-accent, #4f8cff), transparent);
}

body.portal-body .portal-timeline-title {
    font-size: 14px;
    font-weight: 800;
    color: #f8fafc;
}

body.portal-body .portal-timeline-meta {
    margin-top: 6px;
    color: rgba(226, 232, 240, 0.6);
    font-size: 12px;
}

body.portal-body .portal-timeline-text {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.74);
    line-height: 1.75;
    font-size: 13px;
}

body.portal-body .portal-mini-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

body.portal-body .portal-mini-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .portal-mini-card strong {
    display: block;
    font-size: 14px;
    color: #f8fafc;
}

body.portal-body .portal-mini-card span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.7);
}

body.portal-body .panel {
    position: relative;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    backdrop-filter: blur(16px);
    box-shadow:
        0 14px 32px rgba(2, 8, 23, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.portal-body .panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
}

body.portal-body .section-title,
body.portal-body .module-title,
body.portal-body .memo-title,
body.portal-body .archive-name,
body.portal-body .town-name,
body.portal-body .project-name,
body.portal-body .scene-name,
body.portal-body .memo-name,
body.portal-body .family-name,
body.portal-body .branch-name,
body.portal-body .person-name {
    color: #f8fafc;
}

body.portal-body .section-desc,
body.portal-body .module-meta,
body.portal-body .module-desc,
body.portal-body .memo-meta,
body.portal-body .memo-content,
body.portal-body .archive-meta,
body.portal-body .town-meta,
body.portal-body .project-meta,
body.portal-body .scene-meta,
body.portal-body .family-desc,
body.portal-body .branch-desc,
body.portal-body .info-desc,
body.portal-body .person-desc,
body.portal-body .stat-label,
body.portal-body .stat-note,
body.portal-body .breadcrumb-line,
body.portal-body .empty,
body.portal-body .tips li {
    color: rgba(226, 232, 240, 0.74);
}

body.portal-body .breadcrumb-line a,
body.portal-body .btn-main,
body.portal-body .btn-sub {
    color: #f8fafc;
}

body.portal-body .module-card,
body.portal-body .archive-card,
body.portal-body .memo-card,
body.portal-body .town-card,
body.portal-body .project-card,
body.portal-body .scene-card,
body.portal-body .stat-card,
body.portal-body .family-card,
body.portal-body .branch-card,
body.portal-body .info-card,
body.portal-body .person-card {
    position: relative;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(17, 24, 39, 0.76) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body.portal-body .portal-cover {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 14px;
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at 50% 45%, rgba(255,255,255,0.18), transparent 32%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

body.portal-body .portal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.portal-body .portal-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(226, 232, 240, 0.72);
    font-size: 2rem;
}

body.portal-body .module-card:hover,
body.portal-body .archive-card:hover,
body.portal-body .town-card:hover,
body.portal-body .project-card:hover,
body.portal-body .family-card:hover,
body.portal-body .branch-card:hover,
body.portal-body .person-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        0 18px 34px rgba(2, 8, 23, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.portal-body .tag,
body.portal-body .project-tag,
body.portal-body .scene-status,
body.portal-body .kv-chip {
    background: var(--portal-soft, rgba(79, 140, 255, 0.18));
    color: #eaf2ff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.portal-body .stat-card {
    overflow: hidden;
}

body.portal-body .stat-card::after {
    content: "";
    position: absolute;
    inset: auto -18px -20px auto;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, transparent 65%);
    pointer-events: none;
}

body.portal-body .stat-value {
    color: #f8fafc;
    font-size: clamp(1.8rem, 2vw, 2.4rem);
}

body.portal-body .btn-main {
    background: linear-gradient(135deg, var(--portal-accent, #4f8cff), var(--portal-accent-2, #22c3ee));
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
}

body.portal-body .btn-sub {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.portal-body .empty i {
    color: rgba(248, 250, 252, 0.78);
}

@media (max-width: 991px) {
    body.portal-body .portal-stage {
        grid-template-columns: 1fr;
    }

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

    body.portal-body .portal-guide-grid {
        grid-template-columns: 1fr;
    }

    body.portal-body .portal-showcase-grid {
        grid-template-columns: 1fr;
    }

    body.portal-body .hero {
        padding-top: 34px;
    }

    body.portal-body .panel {
        border-radius: 18px;
    }
}

@media (max-width: 767px) {
    body.portal-body .hero {
        padding: 30px 14px 22px;
    }

    body.portal-body .page-wrap,
    body.portal-body .content-wrap {
        padding-left: 14px;
        padding-right: 14px;
        padding-top: 18px;
    }

    body.portal-body .portal-quickbar {
        gap: 10px;
        margin-top: 18px;
    }

    body.portal-body .portal-quickbar a {
        width: calc(50% - 5px);
        justify-content: center;
        padding: 11px 14px;
    }

    body.portal-body .portal-stage-card,
    body.portal-body .portal-spotlight-card,
    body.portal-body .portal-side-card {
        padding: 18px;
        border-radius: 18px;
    }

    body.portal-body .portal-highlight-grid {
        grid-template-columns: 1fr;
    }

    body.portal-body .portal-mini-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body.portal-body .portal-quickbar a {
        width: 100%;
    }
}
