/* ============================================================
   星屿 · 个人引导页  —  前台样式
   设计：二次元玻璃拟态，深/浅双主题，手机/电脑自适应
   ============================================================ */

:root {
    --accent: #7c6cff;
    --accent-2: #ff7ce0;
    --panel-opacity: 0.55;
    --blur: 0px;
    --text: #f4f5ff;
    --text-dim: rgba(244, 245, 255, 0.72);
    --text-faint: rgba(244, 245, 255, 0.5);
    --glass-bg: rgba(20, 18, 40, 0.42);
    --glass-border: rgba(255, 255, 255, 0.16);
    --card-bg: rgba(255, 255, 255, 0.08);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
    --text: #1b1830;
    --text-dim: rgba(27, 24, 48, 0.72);
    --text-faint: rgba(27, 24, 48, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.5);
    --shadow: 0 12px 40px rgba(80, 60, 160, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    position: relative;
    transition: color .3s ease;
}

/* 背景层 */
.bg-layer {
    position: fixed; inset: 0; z-index: -2;
    background-size: cover; background-position: center;
    filter: blur(var(--blur));
    transform: scale(1.08);
    transition: background-image .5s ease, filter .4s ease;
}
.bg-overlay {
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(8,6,20,.45) 0%, rgba(8,6,20,.25) 40%, rgba(8,6,20,.55) 100%);
    transition: background .4s ease;
}
html[data-theme="light"] .bg-overlay {
    background: linear-gradient(180deg, rgba(255,255,255,.35) 0%, rgba(255,255,255,.15) 45%, rgba(255,255,255,.45) 100%);
}

/* 顶部栏 */
.topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 30;
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
}
.brand {
    font-weight: 800; font-size: 18px; letter-spacing: 1px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.topbar-right { display: flex; gap: 8px; }
.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; color: var(--text);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow); transition: transform .15s ease, background .2s ease;
}
.icon-btn:active { transform: scale(.9); }
.icon-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 主内容 */
.page {
    max-width: 600px; margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 80px) 18px calc(env(safe-area-inset-bottom, 0px) + 40px);
    display: flex; flex-direction: column; gap: 16px;
}

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

/* 资料卡 */
.profile-card { text-align: center; padding: 26px 20px 22px; }
.avatar-ring {
    width: 116px; height: 116px; margin: 0 auto 14px; position: relative;
    border-radius: 50%; padding: 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 28px rgba(124,108,255,.55);
}
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.online-dot {
    position: absolute; right: 6px; bottom: 6px; width: 18px; height: 18px;
    border-radius: 50%; background: #34d399; border: 3px solid var(--glass-bg);
}
.profile-name { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.profile-status { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.profile-desc { font-size: 14px; color: var(--text-dim); margin-top: 12px; line-height: 1.6; }

/* 状态条 */
.status-bar { padding: 12px 16px; display: flex; flex-direction: row; justify-content: flex-end; }
.meta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
#clock { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--text); }
.admin-entry { margin-left: auto; text-decoration: none; font-size: 16px; opacity: .7; }
.admin-entry:hover { opacity: 1; }

/* 链接区块 */
.link-section { display: flex; flex-direction: column; gap: 10px; }
.section-title {
    font-size: 13px; font-weight: 700; color: var(--text-faint);
    padding: 4px 6px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px;
}
.section-title::before { content: ""; width: 4px; height: 14px; border-radius: 4px; background: var(--accent); }

.link-card {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; border-radius: 16px;
    background: var(--card-bg); border: 1px solid var(--glass-border);
    text-decoration: none; color: var(--text);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative; overflow: hidden;
}
.link-card::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(135deg, var(--accent), transparent); opacity: 0; transition: opacity .2s;
}
.link-card:active { transform: scale(.97); }
.link-card:hover { border-color: var(--accent); box-shadow: 0 6px 22px rgba(124,108,255,.35); }
.link-icon {
    flex: none; width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center; font-size: 22px;
    background: rgba(255,255,255,.12); overflow: hidden;
}
.link-icon img { width: 100%; height: 100%; object-fit: cover; }
.link-body { flex: 1; min-width: 0; }
.link-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.link-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-arrow { flex: none; color: var(--text-faint); font-size: 18px; }

/* 页脚 */
.footer { text-align: center; font-size: 12px; color: var(--text-faint); padding-top: 8px; }

/* 时钟（头像上方，参考样式：大号时间 + 日期） */
.clock-box { text-align: center; margin-bottom: 10px; }
.clock-time {
    font-size: 42px; font-weight: 800; letter-spacing: 3px;
    font-variant-numeric: tabular-nums; line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.clock-date { font-size: 15px; font-weight: 600; color: var(--text-dim); margin-top: 6px; }
@media (max-width: 420px) { .clock-time { font-size: 34px; } }

.name-line {
    width: 96px; height: 5px; border-radius: 4px;
    margin: 10px auto 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

/* 左下角悬浮音乐钮 */
.music-fab {
    position: fixed; left: 18px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    z-index: 40; width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; color: #fff;
    background: linear-gradient(135deg, #34d399, #0ea5e9);
    border: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
    transition: transform .15s ease;
}
.music-fab:active { transform: scale(.9); }
.playing .music-fab svg { animation: rotate 3.2s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* Toast */
.toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
    background: rgba(20,18,40,.9); color: #fff; padding: 10px 18px; border-radius: 999px;
    font-size: 13px; z-index: 80; box-shadow: var(--shadow);
    border: 1px solid var(--glass-border); max-width: 80vw; text-align: center;
}
html[data-theme="light"] .toast { background: rgba(40,30,80,.92); }

/* 电脑端（宽屏）微调 */
@media (min-width: 768px) {
    .page { padding-top: calc(env(safe-area-inset-top, 0px) + 92px); gap: 18px; }
    .profile-card { padding: 30px; }
    .avatar-ring { width: 132px; height: 132px; }
    .profile-name { font-size: 27px; }
    .clock-time { font-size: 48px; }
}

/* 小屏适配 */
@media (max-width: 380px) {
    .bg-grid { grid-template-columns: repeat(2, 1fr); }
    .page { padding-left: 14px; padding-right: 14px; }
}
