/* ============================================================
   首页（兽设灵感盒）专用样式
   - 视觉：玻璃拟态卡片 + 背景 / 角色图层鼠标视差
   - 不依赖 Tailwind CDN，离线也能正常渲染
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background: #eef1f7;
    color: #1f2937;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- 背景视差层（z-index: 0） ---------- */
.bg-parallax-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-full {
    position: absolute;
    inset: -12px; /* 预留偏移空间，避免视差时露边 */
    background-color: #e7dcf6;
    background-image: url("../bg_full.webp");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    will-change: transform;
}

/* 竖屏 / 窄屏：主体（彩虹与水岸）居中偏上，避免被裁掉 */
@media (max-aspect-ratio: 1/1) {
    .bg-full {
        background-position: 50% 38%;
    }
}

/* ---------- 角色图层（z-index: 1，永远低于卡片） ---------- */
/* 角色身后的柔光，模拟环境光，减少「贴上去」的割裂感 */
.char-glow {
    position: fixed;
    right: -8%;
    bottom: -10%;
    width: 56vw;
    height: 68vh;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        closest-side,
        rgba(196, 181, 253, 0.55) 0%,
        rgba(186, 168, 255, 0.28) 45%,
        rgba(186, 168, 255, 0) 75%
    );
    filter: blur(34px);
}

/* 人物图层：靠右下站立，色彩向背景靠拢，底部柔和过渡 */
.char-furry {
    position: fixed;
    right: 3%;
    bottom: 5%;
    height: min(62vh, 600px);
    width: auto;
    display: block;
    z-index: 1;
    pointer-events: none;
    object-fit: contain;
    object-position: bottom right;
    /* 降饱和、微提亮、压对比，贴近背景的浅色氛围 */
    filter: brightness(1.05) saturate(0.78) contrast(0.93);
    opacity: 0.97;
    /* 底部渐隐，避免裁切边生硬 */
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0) 100%);
    will-change: transform;
    transition: transform 0.18s ease-out;
}

/* ---------- 主 UI 层（z-index: 2） ---------- */
.home-ui {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    width: 100%;
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    fill: #8b5cf6;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #4b2e83;
    line-height: 1.3;
}

.brand-sub {
    font-size: 12px;
    color: #4b5563;
    letter-spacing: 0.02em;
}

/* ---------- 标题区 ---------- */
.hero {
    text-align: center;
    margin: 12px 0 28px;
    padding: 0 24px;
}

.hero h1 {
    font-size: clamp(2.6rem, 4vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    color: #3b2466;
    letter-spacing: 0.01em;
}

.hero p {
    margin-top: 8px;
    font-size: 18px;
    color: #554077;
}

/* ---------- 卡片区 ---------- */
.card-grid {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
    padding: 0 24px 56px;
}

/* 玻璃拟态卡片：更强的磨砂与高光层次 */
.glass-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(
        158deg,
        rgba(255, 255, 255, 0.62) 0%,
        rgba(255, 255, 255, 0.34) 55%,
        rgba(255, 255, 255, 0.46) 100%
    );
    backdrop-filter: blur(26px) saturate(1.15);
    -webkit-backdrop-filter: blur(26px) saturate(1.15);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 18px 44px rgba(96, 72, 168, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    will-change: transform, box-shadow, border-color;
}

/* 跟随鼠标的高光，让卡片更「活」 */
.glass-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        240px circle at var(--mx, 50%) var(--my, 0%),
        rgba(255, 255, 255, 0.7),
        rgba(255, 255, 255, 0) 70%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.card-item:hover::before {
    opacity: 1;
}

/* 内容层级高于鼠标高光层 */
.card-item > * {
    position: relative;
    z-index: 1;
}

.card-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 380px;
    min-height: 500px;
    padding: 26px 22px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.card-item:hover {
    transform: translateY(-10px) scale(1.018);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 28px 60px rgba(96, 72, 168, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.95);
}

.card-item:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 3px;
}

/* 用途标签：一眼看出这张卡适合什么时候用 */
.card-eyebrow {
    align-self: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(124, 109, 242, 0.1);
    border: 1px solid rgba(124, 109, 242, 0.18);
    color: #6d5ae0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

/* 图标紫圆底 + 白色线条 */
.icon-badge {
    align-self: center;
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(145deg, #a78bfa 0%, #7c6df2 100%);
    box-shadow: 0 10px 22px rgba(124, 109, 242, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.35s ease;
}

.icon-badge img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    /* 紫色线条转白色，适配紫色圆底 */
    filter: brightness(0) invert(1);
}

.card-item:hover .icon-badge {
    transform: translateY(-2px) scale(1.07) rotate(-4deg);
    box-shadow: 0 14px 28px rgba(124, 109, 242, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.card-title {
    font-size: 21px;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    transition: color 0.25s ease;
}

.card-desc {
    font-size: 13.5px;
    line-height: 1.65;
    color: #4b5563;
    text-align: center;
}

/* 效果预览区：用迷你界面示意「生成 / 复制 / 得到什么」 */
.card-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 4px 14px rgba(96, 72, 168, 0.06);
}

.mini-sheet {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, #c4b5fd, #8b7cf6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.mini-info {
    min-width: 0;
}

.mini-name {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2f2a45;
    line-height: 1.3;
}

.mini-meta {
    margin: 2px 0 0;
    font-size: 11px;
    color: #6b6488;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mini-tags span {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(124, 109, 242, 0.1);
    color: #5b5380;
    font-size: 11px;
    line-height: 1.6;
}

.mini-prompt {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 9px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(124, 109, 242, 0.14);
}

.mini-prompt.neg {
    background: rgba(255, 246, 246, 0.8);
    border-color: rgba(220, 120, 140, 0.18);
}

.mini-prompt code {
    flex: 1;
    min-width: 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px;
    line-height: 1.5;
    color: #4a4660;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-label {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(124, 109, 242, 0.14);
    color: #5f4fd6;
    font-size: 10px;
    line-height: 1.6;
}

.mini-label.neg {
    background: rgba(220, 120, 140, 0.16);
    color: #b2566c;
}

.mini-copy {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #a78bfa, #7c6df2);
    color: #fff;
    font-size: 10px;
    line-height: 1.7;
}

.mini-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-btn,
.mini-chip {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1.6;
}

.mini-btn {
    background: rgba(124, 109, 242, 0.12);
    color: #5f4fd6;
}

.mini-btn.ghost {
    background: transparent;
    border: 1px dashed rgba(124, 109, 242, 0.35);
    color: #7869cf;
}

.mini-chip {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(124, 109, 242, 0.16);
    color: #6b6488;
}

/* 步骤引导：选词 → 生成 → 分享/出图 */
.card-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.card-steps li {
    counter-increment: step;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: #6b6488;
}

.card-steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(124, 109, 242, 0.14);
    color: #5f4fd6;
    font-size: 9.5px;
    font-weight: 700;
}

.card-steps li:not(:last-child) {
    margin-right: 8px;
    position: relative;
}

.card-steps li:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -14px;
    color: rgba(124, 109, 242, 0.45);
    font-size: 10px;
}

/* 主按钮：胶囊形，宽度自适应居中，避免整块厚重感 */
.btn-primary {
    position: relative;
    overflow: hidden;
    align-self: center;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 176px;
    height: 44px;
    padding: 0 30px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #a78bfa 0%, #7c6df2 55%, #6366f1 100%);
    box-shadow: 0 6px 18px rgba(124, 109, 242, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    cursor: pointer;
    will-change: transform, filter, box-shadow;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

/* 按钮扫光 */
.btn-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    transform: skewX(-18deg);
    transition: left 0.6s ease;
}

.card-item:hover .btn-primary::after {
    left: 125%;
}

.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(124, 109, 242, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

.btn-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-item:hover .btn-arrow {
    transform: translateX(4px);
}

/* ---------- 底部 ---------- */
.site-footer {
    margin-top: auto;
    padding: 0 24px 20px;
    text-align: center;
}

.footer-tip {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #6b7280;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.footer-tip:hover {
    color: #4b5563;
}

/* ---------- 入场动画 ---------- */
.animate-fadeup {
    opacity: 0;
    transform: translateY(20px);
}

.fadeup-in {
    animation: fadeUp 0.6s ease-out forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 降级：不支持毛玻璃时改纯白底 ---------- */
@supports not ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
    .glass-card {
        background: rgba(255, 255, 255, 0.92);
    }
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .site-header {
        padding: 18px 20px;
    }
    .hero {
        margin: 8px 0 28px;
    }
    .hero p {
        font-size: 15px;
    }
    .card-grid {
        gap: 20px;
        padding: 0 20px 40px;
    }
    .card-item {
        min-height: 0;
        padding: 26px 20px;
    }
}

/* 小屏 / 平板 / 手机：隐藏人物图层，卡片居中不受干扰 */
@media (max-width: 1023px) {
    .char-furry {
        display: none;
    }
}

/* ---------- 无障碍：用户偏好减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
    .animate-fadeup {
        opacity: 1;
        transform: none;
    }
    .fadeup-in {
        animation: none;
    }
    .card-item,
    .btn-primary,
    .btn-arrow,
    .icon-badge,
    .char-furry {
        transition: none;
    }
    .card-item:hover {
        transform: none;
    }
    .glass-card::before {
        display: none;
    }
}
