/* ============================================
   玻璃拟态个人主页
   ============================================ */

:root {
    --text:      #1b1f33;
    --muted:     #6b7189;
    --faint:     #9aa0b5;
    --accent:    #7c5cff;
    --accent-2:  #ff5c9d;
    --like:      #ff4d6d;
    --glass:     rgba(255, 255, 255, .55);
    --glass-hi:  rgba(255, 255, 255, .78);
    --glass-brd: rgba(255, 255, 255, .75);
    --radius:    22px;
    --shadow:    0 10px 34px rgba(27, 31, 51, .10), inset 0 1px 0 rgba(255, 255, 255, .65);
    --ease:      cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: linear-gradient(160deg, #eef1fb 0%, #f6f0fa 45%, #eaf3fb 100%);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ---------- 背景光斑 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: .58;
    will-change: transform;
}
.b1 { width: 460px; height: 460px; top: -140px; left: -120px;
      background: radial-gradient(circle at 30% 30%, #a58cff, #7c5cff 70%);
      animation: float1 22s ease-in-out infinite; }
.b2 { width: 520px; height: 520px; top: 12%; right: -180px;
      background: radial-gradient(circle at 40% 40%, #ff9ec7, #ff5c9d 70%);
      animation: float2 26s ease-in-out infinite; }
.b3 { width: 420px; height: 420px; bottom: -120px; left: 18%;
      background: radial-gradient(circle at 50% 50%, #8fe3ff, #4dc4ff 70%);
      animation: float3 30s ease-in-out infinite; }
.b4 { width: 360px; height: 360px; bottom: 18%; right: 12%;
      background: radial-gradient(circle at 50% 50%, #ffd79a, #ffb454 70%);
      opacity: .4;
      animation: float1 34s ease-in-out infinite reverse; }

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(70px, 55px) scale(1.12); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-85px, 70px) scale(1.08); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, -70px) scale(1.15); }
}

/* 极细噪点，让玻璃更有质感 */
.grain {
    position: absolute; inset: 0;
    opacity: .035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 布局 ---------- */
.wrap {
    max-width: 940px;
    margin: 0 auto;
    padding: 62px 20px 40px;
}

.card {
    position: relative;
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid var(--glass-brd);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---------- 主卡片 ---------- */
.hero {
    padding: 46px 34px 34px;
    text-align: center;
}

.avatar-ring {
    position: relative;
    width: 124px; height: 124px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
}
/* 旋转的光环 */
.avatar-ring::before {
    content: "";
    position: absolute; inset: -7px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #7c5cff, #ff5c9d, #4dc4ff, #ffb454, #7c5cff);
    filter: blur(11px);
    opacity: .85;
    animation: spin 9s linear infinite;
    z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
    position: relative;
    z-index: 1;
    width: 124px; height: 124px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 4px solid rgba(255, 255, 255, .9);
    background: linear-gradient(140deg, #7c5cff, #ff5c9d);
    box-shadow: 0 8px 26px rgba(27, 31, 51, .18);
}
.avatar-fallback {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 48px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.nickname {
    margin: 0 0 8px;
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 700;
    letter-spacing: .5px;
}

.douyin-id {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: .3px;
}

.bio {
    max-width: 560px;
    margin: 18px auto 4px;
    color: #4a5068;
    font-size: 15.5px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ---------- 点赞 / 评论按钮 ---------- */
.acts {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font: inherit;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    cursor: pointer;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(27, 31, 51, .06);
    transition: transform .22s var(--ease), background .22s, color .22s, box-shadow .22s;
    -webkit-tap-highlight-color: transparent;
}
.act:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 6px 18px rgba(27, 31, 51, .12);
}
.act:active { transform: translateY(0) scale(.96); }

.act-ico { font-size: 15px; line-height: 1; }

.act-like.on {
    color: #fff;
    background: linear-gradient(135deg, #ff6b8b, var(--like));
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(255, 77, 109, .38);
}
.act-like.on .act-ico { animation: pop .42s var(--ease); }
@keyframes pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.55); }
    100% { transform: scale(1); }
}

.act.busy { opacity: .55; pointer-events: none; }

/* ---------- 统计标签 ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.stat-cell { display: flex; }          /* 让内部卡片撑满 */
.stat-cell .tile { flex: 1; }
.stat-cell.open { grid-column: 1 / -1; flex-direction: column; }

.tile {
    width: 100%;
    padding: 24px 16px 18px;
    text-align: center;
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border: 1px solid var(--glass-brd);
    box-shadow: var(--shadow);
    transition: transform .3s var(--ease);
}
.tile:hover { transform: translateY(-3px); }

.tile-num {
    font-size: clamp(24px, 4.4vw, 32px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tile-lab {
    margin-top: 2px;
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 1.5px;
}
.tile .acts { margin-top: 14px; gap: 6px; }
.tile .act { padding: 5px 12px; font-size: 12.5px; }

/* ---------- 评论抽屉 ---------- */
.cmt-panel {
    width: 100%;
    margin-top: 14px;
    padding: 18px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .45);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .7);
    animation: slideDown .38s var(--ease);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
}

.cmt-list { list-style: none; margin: 0 0 16px; padding: 0; }
.cmt-loading { color: var(--faint); font-size: 13.5px; padding: 8px 2px; }
.cmt-empty   { color: var(--faint); font-size: 13.5px; padding: 14px 2px; text-align: center; }

.cmt {
    display: flex;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(27, 31, 51, .07);
}
.cmt:last-child { border-bottom: 0; }

.cmt-av {
    flex: 0 0 34px;
    width: 34px; height: 34px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(140deg, #8f7bff, #ff7fb0);
}
.cmt-body { flex: 1; min-width: 0; }
.cmt-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.cmt-name { font-size: 13.5px; font-weight: 600; }
.cmt-time { font-size: 12px; color: var(--faint); }
.cmt-text {
    margin-top: 2px;
    font-size: 14.5px;
    color: #3c4257;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cmt-form { display: flex; flex-direction: column; gap: 9px; }

.cmt-form input,
.cmt-form textarea {
    width: 100%;
    padding: 10px 13px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 13px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.cmt-form textarea { resize: vertical; min-height: 64px; }
.cmt-form input:focus,
.cmt-form textarea:focus {
    background: #fff;
    border-color: rgba(124, 92, 255, .55);
    box-shadow: 0 0 0 4px rgba(124, 92, 255, .13);
}

.cmt-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.cmt-msg { font-size: 13px; color: var(--like); }
.cmt-msg.ok { color: #17a673; }

.cmt-form button {
    padding: 9px 24px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: 0;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(124, 92, 255, .32);
    transition: transform .2s var(--ease), box-shadow .2s, opacity .2s;
}
.cmt-form button:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(124, 92, 255, .42); }
.cmt-form button:active { transform: scale(.97); }
.cmt-form button:disabled { opacity: .5; cursor: default; transform: none; }

/* ---------- 作品 ---------- */
.works { margin-top: 40px; }

.sec-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding-left: 4px;
    font-size: 20px;
    font-weight: 700;
}
.sec-sub { font-size: 13px; font-weight: 400; color: var(--muted); }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

.video { padding: 16px; }

.video-top { display: flex; gap: 14px; }

.cover {
    flex: 0 0 76px;
    width: 76px; height: 100px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(140deg, #d9d2ff, #ffd9ea);
    box-shadow: 0 4px 14px rgba(27, 31, 51, .13);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.video-meta { flex: 1; min-width: 0; }
.video-title {
    margin: 2px 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.video-date { color: var(--faint); }

.video-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed rgba(124, 92, 255, .45);
}
.video-link:hover { color: var(--accent-2); border-bottom-color: rgba(255, 92, 157, .5); }

.video-foot { margin-top: 4px; }
.video .acts { justify-content: flex-start; margin-top: 12px; }

/* ---------- 页脚 ---------- */
.foot {
    margin-top: 46px;
    padding: 22px 0 10px;
    text-align: center;
    font-size: 13px;
    color: var(--faint);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .dot { margin: 0 8px; }

/* ---------- 滚动淡入 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .75s var(--ease), transform .75s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 手机 ---------- */
@media (max-width: 640px) {
    .wrap { padding: 34px 14px 30px; }
    .hero { padding: 34px 20px 26px; }
    .stats { grid-template-columns: 1fr; gap: 12px; }
    .stat-cell.open { grid-column: auto; }
    .video-grid { grid-template-columns: 1fr; }
    .avatar-ring, .avatar { width: 104px; height: 104px; }
    .avatar-fallback { font-size: 40px; }
}

/* ---------- 尊重「减少动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
    .blob, .avatar-ring::before, .act-like.on .act-ico { animation: none !important; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .cmt-panel { animation: none; }
}
