/* style.css — Yu's Nest · iOS26 Liquid Glass */

/* ===== 自定义字体 ===== */
@font-face {
    font-family: 'ShangShouChaoYue';
    src: url('../fonts/ShangShouChaoYueTi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 繁体中文回退：马善政体（毛笔风） */
@font-face {
    font-family: 'MaShanZheng';
    src: url('../fonts/MaShanZheng-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 日文回退：Shippori Mincho（日式衬线） */
@font-face {
    font-family: 'ShipporiMincho';
    src: url('../fonts/ShipporiMincho-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 繁体中文与日文特定字体：MochiyPopPOne */
@font-face {
    font-family: 'MochiyPopPOne';
    src: url('../fonts/MochiyPopPOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== 主题变量 ===== */
:root,
[data-theme="dark"] {
    --bg: #0f0c29;
    --text: #ffffff;
    --sub: rgba(255, 255, 255, 0.78);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bd: rgba(255, 255, 255, 0.22);
    --shine-t: rgba(255, 255, 255, 0.55);
    --shadow-b: rgba(0, 0, 0, 0.18);
    --edge-l: rgba(120, 200, 255, 0.10);
    --edge-r: rgba(255, 140, 220, 0.07);
    --inner: linear-gradient(145deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.04) 35%, transparent 65%, rgba(0, 0, 0, 0.05) 100%);
    --dot-color: rgba(255, 255, 255, 0.52);
    --drop: rgba(0, 0, 0, 0.32);
    --icon-f: brightness(0) invert(1);
    --ctrl-icon: #ffffff;
    --blob-o: 0.82;
    --bd-sat: 210%;
    --bd-bri: 1.06;
    --footer-a: rgba(255, 255, 255, 0.60);
    --indicator-bg: rgba(255, 255, 255, 0.22);
    --indicator-bd: rgba(255, 255, 255, 0.40);
}

[data-theme="light"] {
    --bg: #edf0f7;
    --text: #1a1a2e;
    --sub: rgba(26, 26, 60, 0.65);
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-bd: rgba(255, 255, 255, 0.50);
    --shine-t: rgba(255, 255, 255, 0.95);
    --shadow-b: rgba(0, 0, 0, 0.06);
    --edge-l: rgba(100, 180, 255, 0.14);
    --edge-r: rgba(255, 120, 200, 0.10);
    --inner: linear-gradient(145deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.15) 35%, transparent 65%, rgba(0, 0, 0, 0.02) 100%);
    --dot-color: rgba(60, 60, 100, 0.30);
    --drop: rgba(0, 0, 0, 0.07);
    --icon-f: brightness(0) saturate(0);
    --ctrl-icon: #1a1a2e;
    --blob-o: 0.60;
    --bd-sat: 180%;
    --bd-bri: 1.15;
    --footer-a: rgba(26, 26, 60, 0.55);
    --indicator-bg: rgba(255, 255, 255, 0.80);
    --indicator-bd: rgba(255, 255, 255, 0.95);
}

/* ===== 基础重置 ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* 移除移动端点击蓝底高亮 */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    transition: background-color 0.55s ease, color 0.55s ease;
    user-select: none;
    -webkit-user-select: none;
}

body.app-loading .layout-wrapper,
body.app-loading .footer-text,
body.app-loading .control-panel {
    opacity: 0;
    pointer-events: none;
}

/* ===== 背景动画 ===== */
.bg-layer-1 {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    opacity: var(--blob-o);
    animation: blobMove cubic-bezier(.4, 0, .2, 1) infinite alternate;
    transition: opacity 0.6s ease;
}

.blob-1 {
    width: 420px;
    height: 420px;
    background: #FF6B6B;
    top: -10%;
    left: -8%;
    animation-duration: 25s
}

.blob-2 {
    width: 520px;
    height: 520px;
    background: #4ECDC4;
    bottom: -18%;
    right: -8%;
    animation-duration: 29s
}

.blob-3 {
    width: 360px;
    height: 360px;
    background: #FFE66D;
    top: 38%;
    left: 28%;
    animation-duration: 22s
}

.blob-4 {
    width: 460px;
    height: 460px;
    background: #FF9F1C;
    top: 8%;
    right: 18%;
    animation-duration: 27s
}

.blob-5 {
    width: 390px;
    height: 390px;
    background: #8338EC;
    bottom: 8%;
    left: 8%;
    animation-duration: 21s
}

.blob-6 {
    width: 310px;
    height: 310px;
    background: #3A86FF;
    top: 58%;
    right: 28%;
    animation-duration: 24s
}

.blob-7 {
    width: 430px;
    height: 430px;
    background: #FF007F;
    top: 18%;
    left: 48%;
    animation-duration: 31s
}

@media (max-width:768px) {

    .blob-4,
    .blob-5,
    .blob-6,
    .blob-7 {
        display: none
    }
}

@keyframes blobMove {
    0% {
        transform: translate(0, 0) scale(1)
    }

    25% {
        transform: translate(120px, -60px) scale(1.08)
    }

    50% {
        transform: translate(-80px, 130px) scale(.92)
    }

    75% {
        transform: translate(60px, -120px) scale(1.15)
    }

    100% {
        transform: translate(-130px, 80px) scale(1)
    }
}

.bg-layer-2 {
    position: fixed;
    inset: 0;
    z-index: -1;
    backdrop-filter: blur(65px) saturate(200%);
    -webkit-backdrop-filter: blur(65px) saturate(200%);
    background: rgba(255, 255, 255, 0.015);
    pointer-events: none;
}

/* ===== 主内容布局 ===== */
.layout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    width: 90%;
    max-width: 600px;
    padding: 5rem 0 7rem;
    /* 上留控制面板高度，下留 footer 高度 */
    perspective: 1200px;
}

/* ===== iOS26 液态玻璃块 ===== */
.glass-block {
    background: var(--glass-bg);
    border-radius: 24px;
    backdrop-filter: blur(40px) saturate(var(--bd-sat)) brightness(var(--bd-bri));
    -webkit-backdrop-filter: blur(40px) saturate(var(--bd-sat)) brightness(var(--bd-bri));
    border: 1px solid var(--glass-bd);
    box-shadow:
        inset 0 1px 0 var(--shine-t),
        inset 0 -1px 0 var(--shadow-b),
        inset 2px 0 0 var(--edge-l),
        inset -2px 0 0 var(--edge-r),
        0 8px 32px var(--drop),
        0 20px 60px rgba(0, 0, 0, 0.10);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    cursor: default;
    transition: border-color 0.5s ease, background-color 0.5s ease, box-shadow 0.5s ease;
}

/* 内部静态高光层 */
.glass-block::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--inner);
    pointer-events: none;
    z-index: 0;
    transition: background 0.5s ease;
}

/* 点状追踪效果（GSAP 平滑坐标由 JS 写入 --lx / --ly） */
.glass-block::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(circle 1.4px at 1.4px 1.4px,
            var(--dot-color) 1.4px, transparent 0);
    background-size: 15px 15px;
    -webkit-mask-image: radial-gradient(ellipse 100px 80px at var(--lx, -300px) var(--ly, -300px),
            black 20%, transparent 100%);
    mask-image: radial-gradient(ellipse 100px 80px at var(--lx, -300px) var(--ly, -300px),
            black 20%, transparent 100%);
    transition: background-image 0.5s ease;
}

.glass-block>* {
    position: relative;
    z-index: 2;
}

/* ===== 标题块 ===== */
.header-block {
    padding: 1.5rem;
}

h1 {
    font-family: 'ShangShouChaoYue', 'MaShanZheng', 'ShipporiMincho', 'Inter', system-ui, sans-serif;
    font-size: clamp(1.9rem, 5.5vw, 2.8rem);
    letter-spacing: 0.3rem;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.subtitle {
    font-family: 'ShangShouChaoYue', 'MaShanZheng', 'ShipporiMincho', 'Inter', system-ui, sans-serif;
    margin: 0;
    letter-spacing: 0.15rem;
    font-size: clamp(0.78rem, 2.2vw, 1rem);
    color: var(--sub);
}

/* ===== 内容块 ===== */
.content-section {
    text-align: left;
    line-height: 1.78;
}

.content-section h2 {
    font-family: 'ShangShouChaoYue', 'MaShanZheng', 'ShipporiMincho', 'Inter', system-ui, sans-serif;
    margin-top: 0;
    font-style: normal;
    font-weight: normal;
    font-size: clamp(0.88rem, 2.4vw, 1.1rem);
    color: var(--text);
}

/* 针对繁体中文和日语特定字体的应用，h1 保持默认字体 */
[data-lang="zh-tw"] .subtitle,
[data-lang="zh-tw"] h2,
[data-lang="zh-tw"] .content-section h2,
[data-lang="jp"] .subtitle,
[data-lang="jp"] h2,
[data-lang="jp"] .content-section h2 {
    font-family: 'MochiyPopPOne', 'Inter', system-ui, sans-serif !important;
}

/* 调整 MochiyPopPOne 字体的大小和位置，使其更协调 */
[data-lang="zh-tw"] .subtitle,
[data-lang="jp"] .subtitle {
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    letter-spacing: 0.08rem;
    margin-top: 0.4rem;
}

[data-lang="zh-tw"] .content-section h2,
[data-lang="jp"] .content-section h2 {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    letter-spacing: 0.05rem;
    margin-bottom: 0.8rem;
}

.content-section p {
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    opacity: 0.82;
    margin: 0.45rem 0;
}

.signature p {
    text-align: right;
    font-style: italic;
    margin: 0.2rem 0;
    font-size: 0.88rem;
    opacity: 0.65;
}

/* ===== 社交图标行 ===== */
.social-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.icon-block {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    border-radius: 16px;
    cursor: pointer;
}

.custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: var(--icon-f);
    pointer-events: none;
    transition: filter 0.5s ease;
}

/* ===== 固定底部版权区 ===== */
.footer-text {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
    padding: 0.9rem 1rem 1.1rem;
    font-size: 0.82rem;
    color: var(--footer-a);
    /* 轻微毛玻璃底部 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.15) 0%, transparent 100%);
    transition: color 0.5s ease;
}

[data-theme="light"] .footer-text {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
}

.footer-text p {
    margin: 0.2rem 0;
}

.footer-text a {
    color: inherit;
    text-decoration: none;
    transition: opacity .3s;
}

.footer-text a:hover {
    opacity: 0.6;
}

.footer-ai {
    font-size: 0.70rem;
    opacity: 0.4;
    margin-top: 0.3rem !important;
}

/* ===== 右上角控制面板 ===== */
.control-panel {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

/* 通用圆形控制按钮 */
.ctrl-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-bd);
    box-shadow: inset 0 1px 0 var(--shine-t), 0 4px 20px var(--drop);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: background .5s, border-color .5s, box-shadow .5s;
}

.ctrl-btn:hover {
    box-shadow: inset 0 1px 0 var(--shine-t), 0 6px 28px var(--drop);
}

/* ── MagicUI Animated Theme Toggler ── */
.toggle-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    stroke: var(--ctrl-icon);
    fill: none;
    transition: opacity .4s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1), stroke .5s ease;
}

[data-theme="dark"] .icon-sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.4);
}

[data-theme="dark"] .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .icon-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
}

/* ── 语言切换：大胶囊 + 滑动指示器 ── */
.lang-pill {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-bd);
    border-radius: 50px;
    padding: 6px;
    gap: 2px;
    box-shadow: inset 0 1px 0 var(--shine-t), 0 4px 20px var(--drop);
    transition: background .5s, border-color .5s, box-shadow .5s;
}

/* 滑动小胶囊指示器 */
.lang-indicator {
    position: absolute;
    top: 6px;
    left: 6px;
    border-radius: 50px;
    background: var(--indicator-bg);
    border: 1px solid var(--indicator-bd);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 8px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    z-index: 0;
    transition: background .5s, border-color .5s, box-shadow .5s;
    /* 尺寸和位置由 GSAP 控制 */
}

.lang-opt {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    padding: 0 0.7rem;
    height: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: color 0.3s ease, font-weight 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

/* 修正 EN 和 あ 文字视觉偏左的问题（通过微词距对冲/内边距微调） */
.lang-opt[data-lang="en"],
.lang-opt[data-lang="jp"] {
    padding-left: calc(0.7rem + 2px);
    padding-right: calc(0.7rem - 2px);
}

/* ===== 移动端适配 ===== */
@media (max-width: 480px) {
    .layout-wrapper {
        gap: 1.6rem;
        padding: 4rem 0 6rem;
    }

    .glass-block {
        padding: 1.4rem;
        border-radius: 20px;
    }

    .icon-block {
        padding: 0.85rem;
    }

    .social-container {
        gap: 1rem;
    }

    .control-panel {
        top: 0.8rem;
        right: 0.8rem;
        gap: 0.4rem;
    }

    .ctrl-btn {
        width: 42px;
        height: 42px;
    }

    .lang-pill {
        height: 42px;
        padding: 4px;
    }

    .lang-indicator {
        top: 4px;
        left: 4px;
    }

    .lang-opt {
        padding: 0 0.5rem;
        font-size: 0.72rem;
        min-width: 34px;
        height: 34px;
    }

    /* 同步修正移动端下 EN 和 あ 的微边距 */
    .lang-opt[data-lang="en"],
    .lang-opt[data-lang="jp"] {
        padding-left: calc(0.5rem + 1px);
        padding-right: calc(0.5rem - 1px);
    }
}

[data-theme="light"] .signature p {
    color: rgba(100, 100, 125, 0.65);
}