/* ==========================================================================
   页面骨架：PC 顶栏 / 移动顶栏 / 内容容器 / tabbar / 页脚
   ========================================================================== */

/* ============================ 顶部导航（PC） ============================ */

.topnav {
    display: none;
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--sep);
}

[data-theme="dark"] .topnav { background: var(--bg-nav); }

.topnav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-mark svg { width: 18px; height: 18px; }

.brand-name {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.28px;
}

.navlinks { display: flex; align-items: center; gap: 24px; flex: 1 1 auto; }

.navlink {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-2);
    padding: 6px 0;
    transition: color 0.2s;
    position: relative;
}

.navlink:hover { color: var(--text); }

.navlink.active { color: var(--text); font-weight: 600; }

.navlink.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--blue);
}

.navacts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.iconbtn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.iconbtn svg { width: 19px; height: 19px; }

/* 主题按钮：白天显示太阳，夜晚显示月亮 */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: inline; }
.iconbtn:hover { background: var(--bg-soft); color: var(--text); }
.iconbtn:active { transform: scale(0.94); }

/* 右上角头像按钮（登录后显示） */
.avatarbtn {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    margin-left: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.1s;
}

.avatarbtn:active { transform: scale(0.94); }
.avatarbtn:hover { opacity: 0.8; }

.avatar-slot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-soft);
    color: var(--text-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

.avatar-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-slot svg { width: 18px; height: 18px; }

/* ============================ 顶栏（移动端） ============================ */

.appbar {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-top: var(--safe-t);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--sep);
}

[data-theme="dark"] .appbar { background: var(--bg-nav-strong); }

.appbar-row {
    height: 46px;
    padding: 0 12px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.appbar-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.28px;
}

.appbar-acts { display: flex; align-items: center; gap: 2px; }

.statusline {
    padding: 0 16px 8px;
    font-size: 12px;
    color: var(--text-3);
    letter-spacing: -0.08px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================ 内容容器 ============================ */

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

.page { padding-top: 16px; }
.page[hidden] { display: none; }

/* ============================ 底部 tabbar ============================ */

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    height: calc(var(--tabbar-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    display: flex;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--sep);
}

[data-theme="dark"] .tabbar { background: rgba(22, 22, 24, 0.86); }

[data-theme="dark"] .seg-btn { color: rgba(255, 255, 255, 0.68); }

.tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    transition: color 0.2s;
}

.tab svg { width: 22px; height: 22px; }

.tab-label {
    font-size: 10px;
    letter-spacing: -0.05px;
}

.tab.active { color: var(--blue); }
.tab.active .tab-label { font-weight: 600; }

/* ============================ 页脚 / 弹层 / toast ============================ */

.foot {
    max-width: 980px;
    margin: 0 auto;
    padding: 26px 22px 40px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-3);
    text-align: center;
}

.foot p { margin-bottom: 6px; }

.foot-icp a {
    color: var(--text-3);
    text-decoration: none;
}

.foot-icp a:hover { color: var(--text-2); text-decoration: underline; }
