/* ============================================================
   portal.css — 门户首页样式
   ============================================================ */

html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #050505;
}

/* ---------- 顶部导航 ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(5, 5, 5, .18);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--sp-5);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    box-shadow: var(--shadow-sm);
}
.brand-name {
    letter-spacing: .5px;
    white-space: nowrap;
}
.topnav {
    display: flex;
    gap: var(--sp-6);
    flex: 1;
    justify-content: center;
}
.topnav a {
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    font-weight: 500;
    transition: color var(--t-fast) var(--ease);
}
.topnav a:hover { color: #fff; }
.topbar-actions { display: flex; gap: var(--sp-3); }

@media (max-width: 768px) {
    .topnav { display: none; }
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    height: 40px;
    padding: 0 var(--sp-5);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
}
.btn-primary {
    background: var(--c-brand);
    color: #fff;
    border-color: var(--c-brand);
}
.btn-primary:hover {
    background: var(--c-brand-deep);
    border-color: var(--c-brand-deep);
    box-shadow: 0 4px 12px rgba(31, 78, 216, .3);
}
.btn-ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .24);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .45);
    color: #fff;
}
.btn-block { width: 100%; }
.btn-lg { height: 48px; padding: 0 var(--sp-6); font-size: 15px; }
.btn-admin {
    background: var(--c-admin);
    color: #fff;
    border-color: var(--c-admin);
}
.btn-admin:hover { background: #4c1d95; }

/* ---------- Hero ---------- */
.hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: #050505;
    color: #fff;
}
.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, .22);
    pointer-events: none;
}
.hero-blur {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    mask-image: linear-gradient(to top, black 0%, transparent 45%);
    -webkit-mask-image: linear-gradient(to top, black 0%, transparent 45%);
}
.hero-inner {
    position: relative;
    z-index: 3;
    width: 100%;
    padding-top: 150px;
    padding-bottom: clamp(56px, 9vh, 110px);
}
.hero-copy { max-width: 940px; }
.hero-eyebrow {
    color: rgba(255, 255, 255, .76);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0 0 var(--sp-4);
}
.hero-title {
    font-size: clamp(46px, 8vw, 96px);
    font-weight: 500;
    line-height: .98;
    margin: 0 0 var(--sp-4);
    letter-spacing: 0;
    color: #fff;
    text-wrap: balance;
}
.hero-sub {
    color: rgba(255, 255, 255, .68);
    font-size: clamp(16px, 2vw, 22px);
    margin: 0 0 var(--sp-3);
    max-width: 680px;
}
.hero-sub-strong {
    color: rgba(255, 255, 255, .92);
    font-weight: 500;
    margin-bottom: var(--sp-2);
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    margin-top: var(--sp-7);
}
.liquid-glass {
    background: rgba(255, 255, 255, .01);
    background-blend-mode: luminosity;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .1);
    position: relative;
    overflow: hidden;
}
.liquid-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.15) 20%, rgba(255,255,255,0) 40%, rgba(255,255,255,0) 60%, rgba(255,255,255,.15) 80%, rgba(255,255,255,.45) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.animate-blur-fade-up {
    opacity: 0;
    animation: blurFadeUp 1s ease-out forwards;
}
@keyframes blurFadeUp {
    from { opacity: 0; filter: blur(20px); transform: translateY(40px); }
    to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* ---------- 功能板块 ---------- */
.modules {
    padding: clamp(72px, 10vw, 120px) 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(65, 88, 208, .22), transparent 30%),
        radial-gradient(circle at 86% 0%, rgba(200, 80, 192, .18), transparent 34%),
        linear-gradient(180deg, #050505 0%, #0b0d15 100%);
    color: #fff;
}
.section-head {
    text-align: center;
    margin-bottom: var(--sp-7);
}
.section-head h2 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    margin: 0 0 var(--sp-3);
    letter-spacing: 0;
    color: #fff;
}
.section-head p {
    color: rgba(255, 255, 255, .58);
    margin: 0;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: clamp(18px, 2vw, 28px);
    perspective: 900px;
}
.module-card {
    min-height: 254px;
    background: linear-gradient(
        43deg,
        rgba(65, 88, 208, .92) 0%,
        rgba(200, 80, 192, .86) 46%,
        rgba(255, 204, 112, .9) 100%
    );
    border: 0;
    border-radius: 20px;
    padding: var(--sp-6);
    transition:
        transform 200ms var(--ease),
        filter 300ms var(--ease),
        box-shadow 300ms var(--ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    isolation: isolate;
    transform-style: preserve-3d;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .38);
}
.module-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: inherit;
    filter: blur(2rem);
    opacity: .3;
    transform: translate3d(0, 0, -1px);
    pointer-events: none;
    z-index: -1;
}
.module-card::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 19px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(0, 0, 0, .1));
    pointer-events: none;
    z-index: 0;
}
.module-card > * { position: relative; z-index: 1; }
.module-card:hover {
    transform: translateY(-8px) rotateX(7deg) rotateY(-6deg);
    filter: brightness(1.08);
    box-shadow: 0 30px 78px rgba(0, 0, 0, .46);
}
.module-card:active {
    transform: translateY(-2px) scale(.98) rotateX(3deg) rotateY(-3deg);
}
.module-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 28px;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.module-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}
.module-card p {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
    flex: 1;
}
.module-card-arrow {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    opacity: .9;
    transition: gap var(--t-fast) var(--ease);
}
.module-card:hover .module-card-arrow {
    gap: var(--sp-3);
    opacity: 1;
}

.module-card--admin {
    background: linear-gradient(
        43deg,
        rgba(88, 28, 135, .94) 0%,
        rgba(126, 34, 206, .88) 48%,
        rgba(244, 114, 182, .9) 100%
    );
}

.module-card--admin .module-card-icon {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}
.module-card--admin:hover { border-color: transparent; }
.module-card--admin .module-card-arrow { color: #fff; }

/* ---------- 关于我们 ---------- */
.about {
    padding: var(--sp-8) 0;
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
}
.about-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.about h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 var(--sp-4);
    color: #fff;
}
.about p {
    color: rgba(255, 255, 255, .62);
    margin: 0 0 var(--sp-3);
}
.about-meta {
    margin-top: var(--sp-6) !important;
    color: rgba(255, 255, 255, .42);
    font-size: 13px;
}

@media (hover: none) {
    .module-card:hover {
        transform: none;
        filter: none;
    }
}

@media (max-width: 640px) {
    .modules { padding: 64px 0; }
    .module-card { min-height: 220px; }
}

/* ---------- 登录弹窗 ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: var(--sp-5);
}
.modal[hidden] { display: none; }
.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 27, 45, .55);
    backdrop-filter: blur(4px);
}
.modal-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--c-surface);
    border-radius: var(--r-lg);
    padding: var(--sp-7);
    box-shadow: var(--shadow-lg);
    animation: modal-in var(--t-base) var(--ease);
}
.modal-panel--admin { border-top: 4px solid var(--c-admin); }
@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.modal-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-4);
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    border: none;
    background: transparent;
    color: var(--c-muted);
    font-size: 22px;
    line-height: 1;
    display: grid;
    place-items: center;
    transition: background var(--t-fast) var(--ease);
}
.modal-close:hover { background: var(--c-line-soft); color: var(--c-ink); }
.modal-panel h3 {
    margin: 0 0 var(--sp-2);
    font-size: 22px;
    font-weight: 700;
}
.modal-sub {
    color: var(--c-ink-soft);
    font-size: 13px;
    margin: 0 0 var(--sp-5);
}

/* ---------- 表单 ---------- */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.form label {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}
.form label > span {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-ink-soft);
}
.form input {
    height: 44px;
    padding: 0 var(--sp-4);
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    background: var(--c-surface);
    font-size: 14px;
    color: var(--c-ink);
    transition: border-color var(--t-fast) var(--ease);
    outline: none;
}
.form input:focus {
    border-color: var(--c-brand);
    box-shadow: 0 0 0 3px rgba(31, 78, 216, .12);
}
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--c-danger);
    padding: var(--sp-3);
    border-radius: var(--r-md);
    font-size: 13px;
}

/* ---------- 全局 toast ---------- */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--c-ink);
    color: #fff;
    padding: var(--sp-3) var(--sp-5);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    animation: toast-in var(--t-base) var(--ease);
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* 顶部登录态用户信息 */
.topbar-user { color: #fff; font-size: 14px; margin-right: 4px; white-space: nowrap; }
