/* ==========================================================================
   轻美图 · 前台样式（小红书风格 / 浅色 + 深色 / 纯 CSS 无框架）
   ========================================================================== */

:root {
    --brand: #2f6f68;
    --brand-2: #4e9187;
    --brand-soft: rgba(47, 111, 104, .1);
    --bg: #f6f6f8;
    --card: #ffffff;
    --card-2: #f2f3f5;
    --text: #17181a;
    --text-2: #4b4d52;
    --muted: #9a9ca3;
    --line: rgba(17, 18, 20, .07);
    --shadow: 0 1px 2px rgba(17, 18, 20, .04), 0 8px 24px -12px rgba(17, 18, 20, .12);
    --radius: 16px;
    --radius-sm: 12px;
    --tab-h: 56px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --app-w: 620px;
    --skeleton: linear-gradient(100deg, #ececf0 30%, #f6f6f8 50%, #ececf0 70%);
}

html[data-theme="dark"] {
    --bg: #0d0d0f;
    --card: #191a1d;
    --card-2: #232428;
    --text: #f2f3f5;
    --text-2: #c7c9cf;
    --muted: #7c7f88;
    --line: rgba(255, 255, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -16px rgba(0, 0, 0, .7);
    --brand-soft: rgba(99, 179, 164, .18);
    --skeleton: linear-gradient(100deg, #1f2024 30%, #2a2b30 50%, #1f2024 70%);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-size: 14px;
    line-height: 1.5;
    overscroll-behavior-y: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { -webkit-user-drag: none; }
.ic { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
[hidden] { display: none !important; }

/* ---------- 应用外壳 ---------- */
.app {
    max-width: var(--app-w);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
    box-shadow: 0 0 0 1px var(--line);
}

/* ---------- 顶部栏 ---------- */
.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 12px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.appbar.scrolled { border-bottom-color: var(--line); }
.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.4px;
    flex: none;
}
.brand-dot {
    width: 22px; height: 22px; border-radius: 7px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 800;
    box-shadow: 0 4px 10px -4px rgba(47, 111, 104, .8);
}

.searchpill {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 13px;
    transition: background .2s;
}
.searchpill:active { background: var(--line); }
.searchpill .ic { width: 16px; height: 16px; }
.searchpill form { display: flex; flex: 1; min-width: 0; }
.searchpill input {
    flex: 1; min-width: 0;
    border: 0; background: transparent; outline: 0;
    font-size: 13px; color: var(--text);
}
.searchpill input::placeholder { color: var(--muted); }

.avatar-btn {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-weight: 700; font-size: 14px;
    flex: none; border: 0; cursor: pointer;
    overflow: hidden;
}
.avatar-btn.guest { background: var(--card-2); color: var(--muted); }
.avatar-btn .ic { width: 19px; height: 19px; }

/* ---------- 主内容 ---------- */
.content { padding: 0 10px; }
.page-head { padding: 12px 2px 8px; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.page-sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 0; }

/* ---------- 分段控件 ---------- */
.seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--card-2);
    gap: 2px;
}
.seg a, .seg button {
    border: 0;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: .18s;
}
.seg a.on, .seg button.on {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

/* ---------- 提示条 ---------- */
.notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 2px 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--brand-soft), transparent 70%);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 600;
}
.notice .ic { width: 16px; height: 16px; }
.notice.plain { background: var(--card); color: var(--text-2); font-weight: 500; border: 1px solid var(--line); }

/* ---------- 图片流（双列瀑布） ---------- */
.feed {
    column-count: 2;
    column-gap: 8px;
    padding-top: 4px;
}
.card {
    display: block;
    position: relative;
    margin: 0 0 8px;
    break-inside: avoid;
    border-radius: 14px;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow);
    transform: translateZ(0);
}
.card .ph {
    display: block;
    width: 100%;
    position: relative;
    background: var(--card-2);
    overflow: hidden;
}
.card .ph::after {
    content: "";
    position: absolute; inset: 0;
    background: var(--skeleton);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    opacity: 1;
    transition: opacity .3s;
}
.card.loaded .ph::after { opacity: 0; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.card img {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity .35s ease;
}
.card.loaded img { opacity: 1; }

.card .veil {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 46%;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, .58), rgba(0, 0, 0, .18) 55%, transparent);
    pointer-events: none;
}
.card .ctitle {
    position: absolute;
    left: 9px; right: 9px; bottom: 8px;
    z-index: 3;
    color: #fff;
    font-size: 12.5px;
    line-height: 1.35;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card .cmeta {
    position: absolute;
    left: 9px; bottom: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .92);
    font-size: 11px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.card .cmeta span { display: inline-flex; align-items: center; gap: 3px; }
.card .cmeta .ic { width: 12px; height: 12px; }
.card.has-title .cmeta { display: none; }

.badge-count {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 21px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .42);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
}
.badge-count .ic { width: 11px; height: 11px; }

.rank-mark {
    position: absolute;
    top: 8px; left: 8px;
    z-index: 3;
    min-width: 21px; height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; font-style: italic;
    color: #fff;
    background: linear-gradient(135deg, #ffb020, #ff6b4a);
    box-shadow: 0 2px 8px -2px rgba(78, 145, 135, .8);
}
.rank-mark.r1 { background: linear-gradient(135deg, #ffcf3d, #ff8b2c); }
.rank-mark.r2 { background: linear-gradient(135deg, #c9d3e0, #8f9bad); }
.rank-mark.r3 { background: linear-gradient(135deg, #f0b48a, #c97b4a); }

/* ---------- 引导卡 ---------- */
.promo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 8px;
    break-inside: avoid;
    padding: 20px 14px;
    border-radius: 14px;
    background: linear-gradient(150deg, #fff0f3, #fff7f0);
    border: 1px solid rgba(47, 111, 104, .14);
    text-align: center;
}
html[data-theme="dark"] .promo { background: linear-gradient(150deg, #2a1519, #241a15); }
.promo .ic { width: 26px; height: 26px; color: var(--brand); }
.promo-text { color: var(--brand); font-size: 13px; font-weight: 700; line-height: 1.5; }
.promo img { width: 100%; border-radius: 10px; display: block; }

/* ---------- 标签 chips ---------- */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 2px 12px;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text-2);
    font-size: 12.5px;
    white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip em { font-style: normal; color: var(--muted); font-size: 11px; }
.chip.on em { color: rgba(255, 255, 255, .8); }
.chip .ic { width: 13px; height: 13px; }

/* ---------- 分类相册 ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-top: 6px;
}
.cat-card {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: var(--card-2);
    aspect-ratio: 4 / 3;
    box-shadow: var(--shadow);
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.cat-card:active img { transform: scale(1.03); }
.cat-card .ov {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .66), rgba(0, 0, 0, .05) 55%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px 11px;
    color: #fff;
}
.cat-card .d { font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.cat-card .m { font-size: 11px; opacity: .82; margin-top: 2px; }

/* ---------- 个人中心 ---------- */
.profile {
    padding: 22px 4px 6px;
}
.profile-top { display: flex; align-items: center; gap: 14px; }
.avatar-lg {
    width: 62px; height: 62px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 800; color: #fff; flex: none;
    box-shadow: 0 8px 22px -10px rgba(47, 111, 104, .9);
}
.profile-name { font-size: 20px; font-weight: 800; letter-spacing: -.4px; display: flex; align-items: center; gap: 6px; }
.profile-id { color: var(--muted); font-size: 12px; margin-top: 3px; }
.profile-bio { color: var(--text-2); font-size: 12.5px; margin-top: 6px; }

.stats {
    display: flex;
    gap: 6px;
    margin: 18px 0 4px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 4px;
    box-shadow: var(--shadow);
}
.stats a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    position: relative;
}
.stats a + a::before {
    content: "";
    position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 1px; background: var(--line);
}
.stats b { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.stats span { font-size: 11.5px; color: var(--muted); }

.menu {
    margin-top: 12px;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.menu a, .menu button {
    width: 100%;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid var(--line);
}
.menu > :last-child { border-bottom: 0; }
.menu .ic { width: 20px; height: 20px; color: var(--text-2); }
.menu .arrow { margin-left: auto; color: var(--muted); display: flex; }
.menu .arrow .ic { width: 16px; height: 16px; }
.menu .danger { color: #ff3b30; }
.menu .danger .ic { color: #ff3b30; }
.menu .val { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.group-title { font-size: 12px; color: var(--muted); padding: 18px 4px 8px; font-weight: 600; }

/* ---------- 登录页 ---------- */
.auth {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 18px 40px;
}
.auth-logo {
    width: 58px; height: 58px; border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px; font-weight: 800;
    margin: 0 auto 16px;
    box-shadow: 0 16px 34px -16px rgba(47, 111, 104, .95);
}
.auth h1 { text-align: center; font-size: 22px; margin: 0; letter-spacing: -.5px; }
.auth .sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0 26px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    outline: 0;
    transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    border: 0;
    background: var(--brand);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, filter .2s;
}
.btn:active { transform: scale(.985); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--card-2); color: var(--text); }
.btn.outline { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-grad { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 24px -14px rgba(47, 111, 104, 1); }

.auth-switch { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-switch a { color: var(--brand); font-weight: 600; }
.form-msg {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    background: rgba(180, 70, 70, .08);
    color: #d70015;
}
.form-msg.ok { background: rgba(18, 184, 134, .1); color: #0a7f5c; }
html[data-theme="dark"] .form-msg { color: #ff6b6b; }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 0 8px;
    font-size: 13px;
    color: var(--muted);
}
.pager a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text);
    font-weight: 600;
}
.pager .ic { width: 15px; height: 15px; }

.loadmore, .empty {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 26px 0;
}
.empty .ic { width: 40px; height: 40px; color: var(--line); display: block; margin: 0 auto 10px; }

/* ---------- 底部导航 ---------- */
.tabbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: var(--app-w);
    height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
    display: flex;
    z-index: 45;
}
.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    position: relative;
}
.tab .ic { width: 23px; height: 23px; transition: transform .2s; }
.tab.on { color: var(--brand); font-weight: 700; }
.tab.on .ic { transform: translateY(-1px) scale(1.04); }
.tab .dot {
    position: absolute; top: 6px; left: 50%; margin-left: 6px;
    min-width: 15px; height: 15px; padding: 0 4px;
    border-radius: 999px; background: var(--brand);
    color: #fff; font-size: 9px; line-height: 15px; font-style: normal;
    font-weight: 700;
}

/* ---------- 返回顶部 ---------- */
.backtop {
    position: fixed;
    right: max(14px, calc(50% - var(--app-w) / 2 + 14px));
    bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
    z-index: 30;
    width: 40px; height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow);
    cursor: pointer;
}
.backtop .ic { width: 18px; height: 18px; }

/* ---------- 大图查看 ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: #0a0a0b;
    color: #fff;
    display: flex;
    flex-direction: column;
    animation: lbIn .22s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 4;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent);
}
.lb-title {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-iconbtn {
    width: 34px; height: 34px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    flex: none;
}
.lb-iconbtn .ic { width: 18px; height: 18px; }

.lb-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
}
.lb-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity .2s;
}
.lb-stage img.ready { opacity: 1; }
.lb-spinner {
    position: absolute;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    animation: spin .8s linear infinite;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.lb-spinner.on { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 56px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: .85;
}
.lb-nav.prev { left: 8px; }
.lb-nav.next { right: 8px; }
.lb-nav[disabled] { opacity: .18; cursor: default; }
.lb-nav .ic { width: 22px; height: 22px; }

.lb-count {
    position: absolute;
    left: 50%; bottom: 12px;
    transform: translateX(-50%);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .5);
    font-size: 11.5px;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .9);
}
.lb-dots { display: flex; gap: 4px; justify-content: center; padding: 8px 0 4px; }
.lb-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .28); }
.lb-dots i.on { background: #fff; width: 14px; border-radius: 3px; }

.lb-actions {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent);
}
.lb-act {
    flex: 1;
    border: 0;
    background: transparent;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    font-size: 10.5px;
    opacity: .92;
    cursor: pointer;
}
.lb-act .ic { width: 23px; height: 23px; }
.lb-act.on { color: var(--brand); }
.lb-act.on .ic { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.24); } }

.lb-nextgroup {
    position: absolute;
    right: 14px;
    bottom: 92px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.lb-nextgroup .ic { width: 14px; height: 14px; }

/* ---------- 评论抽屉 ---------- */
.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .22s;
}
.sheet-mask.on { opacity: 1; }
.sheet {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 100%);
    width: 100%;
    max-width: var(--app-w);
    max-height: 76vh;
    z-index: 101;
    background: var(--card);
    color: var(--text);
    border-radius: 18px 18px 0 0;
    display: flex;
    flex-direction: column;
    transition: transform .26s cubic-bezier(.22, .8, .3, 1);
    padding-bottom: env(safe-area-inset-bottom);
}
.sheet.on { transform: translate(-50%, 0); }
.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
}
.sheet-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.sheet-head span { color: var(--muted); font-size: 12.5px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 6px 16px 10px; -webkit-overflow-scrolling: touch; }
.cmt { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: 0; }
.cmt-av {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
}
.cmt-main { flex: 1; min-width: 0; }
.cmt-top { display: flex; align-items: center; gap: 8px; }
.cmt-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cmt-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.cmt-text { font-size: 13.5px; line-height: 1.6; margin-top: 3px; word-break: break-word; }
.cmt-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 0; }
.cmt-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: var(--card);
}
.cmt-form input {
    flex: 1;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card-2);
    padding: 0 14px;
    font-size: 13.5px;
    color: var(--text);
    outline: 0;
}
.cmt-form input:focus { border-color: var(--brand); }
.cmt-form button {
    width: 62px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.cmt-login { padding: 14px; text-align: center; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.cmt-login a { color: var(--brand); font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 30%;
    transform: translate(-50%, 10px);
    z-index: 200;
    max-width: 76vw;
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(20, 20, 22, .88);
    color: #fff;
    font-size: 13px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 搜索页 ---------- */
.hot-block { padding: 6px 2px 2px; }
.hot-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; padding: 14px 2px 10px; }
.hot-title .ic { width: 16px; height: 16px; color: var(--brand); }
.hot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--text-2);
}
.hot-item b { color: var(--brand); font-size: 11px; font-style: italic; }

.result-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 2px 4px; }
.result-head .q { font-size: 16px; font-weight: 800; }
.result-head .n { font-size: 12px; color: var(--muted); }

/* ---------- 组详情头 ---------- */
.group-head { padding: 12px 4px 6px; }
.group-head h1 { font-size: 20px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.4px; }
.group-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.group-head .meta { color: var(--muted); font-size: 12px; display: flex; gap: 12px; align-items: center; }
.group-head .meta span { display: inline-flex; align-items: center; gap: 4px; }
.group-head .meta .ic { width: 14px; height: 14px; }

/* ---------- 收藏/历史页 ---------- */
.seg-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px 6px; }
.link-btn { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }

/* ---------- 桌面端 ---------- */
@media (min-width: 700px) {
    .app { min-height: 100vh; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -60px rgba(0, 0, 0, .4); }
    .card { transition: transform .2s, box-shadow .2s; }
    .card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .3); }
    .lb-nav { width: 44px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   补充组件（v2：登录 / 榜单 / 组页 / 设置）
   ========================================================================== */

/* ---------- 登录页 ---------- */
.auth-title { text-align: center; font-size: 23px; font-weight: 800; letter-spacing: -.6px; margin: 0; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 8px 0 22px; }
.auth-msg { border-radius: 12px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.auth-msg.err { background: rgba(180, 70, 70, .1); color: #d92b20; }
.auth-tabs {
    display: flex; gap: 4px; background: var(--card-2); border-radius: 12px; padding: 4px; margin-bottom: 18px;
}
.auth-tabs a {
    flex: 1; text-align: center; height: 36px; line-height: 36px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); border-radius: 9px; transition: .2s;
}
.auth-tabs a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.auth-form { display: block; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 600; }
.auth-tip { text-align: center; color: var(--muted); font-size: 11px; margin-top: 26px; line-height: 1.7; }

.field { position: relative; display: block; margin-bottom: 12px; }
.field > span {
    display: block; font-size: 11.5px; color: var(--muted); font-weight: 600;
    margin: 0 0 6px 2px; letter-spacing: .2px;
}
.field > span em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; opacity: .8; }
.field input {
    width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); padding: 0 44px 0 14px; font-size: 14px;
    outline: none; transition: border-color .2s, box-shadow .2s; appearance: none;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field .eye {
    position: absolute; right: 4px; bottom: 0; width: 42px; height: 46px; border: 0;
    background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.field .eye .ic { width: 18px; height: 18px; }
.field.dark input { background: var(--card-2); border-color: transparent; }
.field.dark input:focus { background: var(--card); }

/* ---------- 通用面板 ---------- */
.panel {
    background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
    box-shadow: var(--shadow); border: 1px solid var(--line);
}
.panel > .btn { margin-top: 4px; }

/* ---------- 组详情头 ---------- */
.group-head .back-btn {
    display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 6px;
    background: var(--card-2); border-radius: 999px; font-size: 12px; color: var(--text-2); margin-bottom: 10px;
}
.group-head .back-btn .ic { width: 14px; height: 14px; }
.group-head p { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.next-group {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 6px;
    height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 600; color: var(--text-2);
}
.next-group .ic { width: 15px; height: 15px; }

/* ---------- 榜单 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rank-item {
    display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius);
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
    transition: transform .18s;
}
.rank-item:active { transform: scale(.99); }
.rank-item .rk {
    width: 24px; flex: none; text-align: center; font-size: 14px; font-weight: 800;
    font-style: italic; color: var(--muted);
}
.rank-item .rk.top { color: var(--brand); font-size: 17px; }
.rank-item img { width: 54px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; background: var(--card-2); }
.rank-item .ri-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rank-item .ri-main b {
    font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-item .ri-main em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.rank-item .ri-num { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.rank-item .ri-num b { font-size: 14px; font-weight: 800; }
.rank-item .ri-num em { font-style: normal; color: var(--muted); font-size: 10.5px; }

/* ---------- 评论条目兼容 ---------- */
.cmt-top b { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cmt-top em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; }
.cmt p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.6; word-break: break-word; color: var(--text); }
.cmt-av {
    width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 13px; font-weight: 700; text-transform: uppercase;
}

/* ---------- 移动端细节 ---------- */
@media (max-width: 380px) {
    .brand span:last-child { display: none; }
}
/* ---------- 组详情：纯图流（去掉角标与遮罩，避免重复信息） ---------- */
.feed.plain { column-gap: 6px; }
.feed.plain .card { margin-bottom: 6px; border-radius: 12px; }
.feed.plain .card .badge-count,
.feed.plain .card .veil,
.feed.plain .card .ctitle,
.feed.plain .card .cmeta { display: none; }
.feed.plain .card .ph { cursor: zoom-in; }

/* 标签计数与文字之间留白 */
.chip { gap: 6px; }
.chip em { margin-left: 0; letter-spacing: 0; }
/* ================= 徽章 / 作者 / 发布页（v2.2） ================= */
.bdg { display: inline-block; vertical-align: -.17em; }
.pn-text { max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-badges { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.bdg-more {
    display: inline-flex; align-items: center; justify-content: center;
    height: 18px; min-width: 22px; padding: 0 5px; border-radius: 9px;
    background: var(--card-2); color: var(--muted); font-size: 10.5px; font-weight: 700;
}
.role-tag {
    display: inline-block; font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 5px;
    margin-left: 5px; vertical-align: 1px; background: rgba(43, 138, 239, .12); color: #2b8aef; font-weight: 700;
}
.role-tag.admin { background: rgba(47, 111, 104, .1); color: var(--brand); }

.badge-panel {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px 14px 6px; margin-top: 12px;
}
.bp-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.bp-head b { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.bp-head .ic { width: 16px; height: 16px; color: var(--brand); }
.bp-head > span { font-size: 11.5px; color: var(--muted); }
.bp-list { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; padding-bottom: 8px; }
.bp-item { display: flex; align-items: center; gap: 10px; }
.bp-info { min-width: 0; }
.bp-info b { display: block; font-size: 13px; font-weight: 700; }
.bp-info span {
    display: block; font-size: 11.5px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 62vw;
}
.bp-empty { font-size: 12px; color: var(--muted); margin: 10px 0 8px; line-height: 1.7; }
.pub-entry { margin-top: 14px; }

.group-author {
    display: flex; align-items: center; gap: 9px; padding: 10px 12px;
    background: var(--card); border-radius: 14px; box-shadow: var(--shadow); margin: 4px 0 12px;
}
.ga-avatar {
    width: 34px; height: 34px; border-radius: 50%; color: #fff; flex: none;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.ga-main { min-width: 0; }
.ga-main b { display: block; font-size: 13.5px; }
.ga-badges { display: flex; gap: 2px; margin-top: 2px; }

/* 发布页 */
.pub-form { display: flex; flex-direction: column; gap: 12px; }
.pub-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.pub-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 136px; border: 1.5px dashed rgba(17, 18, 20, .14); border-radius: 14px;
    cursor: pointer; color: var(--text-2); background: var(--card-2); transition: .18s;
}
.pub-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.pub-drop .ic { width: 26px; height: 26px; color: var(--muted); }
.pub-drop b { font-size: 13.5px; }
.pub-drop span { font-size: 11.5px; color: var(--muted); }
.pub-previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pub-previews:empty { display: none; }
.pub-pv { border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--card-2); }
.pub-pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-tip { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.pub-note { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.7; margin: 0; }
.btn.block[disabled] { opacity: .45; box-shadow: none; }
.pub-card .field em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; font-size: 11px; }
.pub-card .field label { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin: 0 0 6px 1px; }
.pub-card .field + .field { margin-top: 12px; }

/* ==========================================================================
   v2.3：发布入口 / 分区 / 署名 / 小红书详情 / 用户主页 / 积分 / 关注 / 勋章
   ========================================================================== */

/* ---------- 顶栏发布按钮 ---------- */
.publish-btn {
    width: 32px; height: 32px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--card-2); color: var(--text);
    transition: transform .15s, background .2s;
}
.publish-btn:active { transform: scale(.92); }
.publish-btn .ic { width: 19px; height: 19px; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 底部导航：中间发布 ---------- */
.tab-post { flex: none; width: 68px; }
.tab-post-btn {
    width: 48px; height: 48px; margin-top: -16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border: 3px solid var(--bg);
    box-shadow: 0 6px 18px -6px rgba(47, 111, 104, .7);
}
.tab-post-btn .ic { width: 24px; height: 24px; }
.tab-post:active .tab-post-btn { transform: scale(.94); }

/* ---------- 首页分区 tabs ---------- */
.feed-tabs {
    display: flex; align-items: center; gap: 20px;
    padding: 10px 4px 12px;
    overflow-x: auto; scrollbar-width: none;
}
.feed-tabs::-webkit-scrollbar { display: none; }
.ftab {
    position: relative; flex: none;
    font-size: 14.5px; color: var(--muted); font-weight: 500;
    padding: 2px 0 6px;
}
.ftab.on { color: var(--text); font-weight: 800; }
.ftab.on::after {
    content: ''; position: absolute; left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: 20px; height: 3px; border-radius: 2px; background: var(--brand);
}
.muted { color: var(--muted); font-size: 12px; }

/* ---------- 卡片角标 / 作者署名 ---------- */
.card-marks {
    position: absolute; top: 34px; right: 8px; z-index: 3;
    display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.mark {
    display: inline-block;
    font-size: 9.5px; line-height: 1; font-weight: 700; letter-spacing: .2px;
    padding: 4px 6px; border-radius: 6px; color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.mark.pin { background: linear-gradient(135deg, #ff3b30, #ff7a45); }
.mark.feat { background: linear-gradient(135deg, #7b61ff, #3f7cff); }
.mark.price { background: linear-gradient(135deg, #ffb020, #ff8a00); }

.cauthor {
    position: absolute; left: 8px; bottom: 8px; z-index: 3;
    display: flex; align-items: center; gap: 5px;
    max-width: calc(100% - 60px);
    padding: 3px 8px 3px 3px; border-radius: 999px;
    background: rgba(0, 0, 0, .38);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #fff; font-size: 10.5px; line-height: 1;
}
.card.has-title .cauthor { top: 8px; bottom: auto; max-width: calc(100% - 64px); }
.rank-mark ~ .cauthor { top: 34px; left: 8px; }
.cauthor img, .cauthor i {
    width: 19px; height: 19px; border-radius: 50%; flex: none;
    object-fit: cover; font-style: normal; font-size: 9.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; color: #fff;
    overflow: hidden;
}
.cauthor b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 作品详情（小红书式） ---------- */
.gpage { padding: 4px 0 10px; }
.gauthor { display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px; }
.gav { flex: none; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; }
.gav img, .gav span {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    object-fit: cover; color: #fff; font-weight: 700; font-size: 15px;
}
.gwho { min-width: 0; flex: 1; }
.gname { font-size: 15px; font-weight: 700; letter-spacing: -.2px; display: block; }
.gsub { display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: wrap; }
.guid { font-size: 10.5px; color: var(--muted); }
.btn-follow {
    flex: none; border: 0; cursor: pointer;
    padding: 7px 16px; border-radius: 999px;
    background: var(--brand); color: #fff;
    font-size: 12.5px; font-weight: 700;
    transition: background .2s, color .2s, opacity .2s;
}
.btn-follow.on { background: var(--card-2); color: var(--muted); }
.btn-follow:disabled { opacity: .6; }
.btn-ghost {
    flex: none; padding: 7px 14px; border-radius: 999px;
    background: var(--card-2); color: var(--text-2); font-size: 12.5px; font-weight: 600;
}

.gcarousel {
    position: relative; border-radius: 16px; overflow: hidden; background: #0b0b0c;
    aspect-ratio: 4 / 5; max-height: 76vh; width: 100%;
}
.gslides {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
    align-items: stretch; height: 100%;
}
.gslides::-webkit-scrollbar { display: none; }
.gslide {
    flex: 0 0 100%; scroll-snap-align: center; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #0b0b0c; min-height: 180px;
}
.gslide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gslide.blur img { filter: blur(16px) brightness(.8); transform: scale(1.06); }
.gdots {
    position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: 5px; pointer-events: none;
}
.gdots i {
    width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55);
    transition: width .2s, background .2s;
}
.gdots i.on { width: 14px; border-radius: 3px; background: #fff; }
.gcounter {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(0, 0, 0, .42); color: #fff; font-size: 11px; font-weight: 600;
}
.gcounter b { font-weight: 800; }

.glock {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; text-align: center; padding: 24px;
    background: rgba(12, 12, 14, .55);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    color: #fff;
}
.glock .ic { width: 30px; height: 30px; opacity: .9; }
.glock b { font-size: 15px; }
.glock p { margin: 0 0 8px; font-size: 12.5px; color: rgba(255, 255, 255, .82); }
.glock p em { font-style: normal; color: #ffd24a; font-weight: 800; font-size: 17px; }
.glock .btn-primary { border: 0; cursor: pointer; }
.glock-tip { font-size: 11px; color: rgba(255, 255, 255, .7); }
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 20px; border-radius: 999px; border: 0; cursor: pointer;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-size: 13px; font-weight: 700;
}

.gbody { padding: 14px 6px 0; }
.gtitle { font-size: 19px; line-height: 1.35; font-weight: 800; letter-spacing: -.4px; margin: 0 0 8px; }
.gdesc { font-size: 14px; line-height: 1.75; color: var(--text-2); word-break: break-word; }
.gtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gmeta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.gmeta span { display: inline-flex; align-items: center; gap: 4px; }
.gmeta .ic { width: 13px; height: 13px; }
.tag-mark { padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.tag-mark.pin { background: rgba(47, 111, 104, .12); color: #2f6f68; }
.tag-mark.feat { background: rgba(184, 121, 31, .14); color: #96631a; }
.tag-mark.price { background: rgba(184, 121, 31, .1); color: #96631a; }
html[data-theme="dark"] .tag-mark.pin { background: rgba(99, 179, 164, .18); color: #7cc9bb; }
html[data-theme="dark"] .tag-mark.feat,
html[data-theme="dark"] .tag-mark.price { background: rgba(200, 150, 70, .18); color: #d8ab63; }

.gacts {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 4px 12px; margin-top: 8px;
    border-bottom: 1px solid var(--line);
}
.gact {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: 999px; border: 0; background: transparent;
    color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.gact .ic { width: 20px; height: 20px; }
.gact.on { color: var(--brand); }
.gact.on .ic { fill: currentColor; }

.gcomments { padding: 14px 6px 4px; }
.gcomments h2, .grel h2 { font-size: 14px; font-weight: 800; margin: 0 0 12px; }
.gcmt-form { display: flex; gap: 8px; margin-bottom: 14px; }
.gcmt-form input {
    flex: 1; min-width: 0; height: 38px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--card-2);
    color: var(--text); font-size: 13px; outline: 0;
}
.gcmt-form input:focus { border-color: var(--brand); background: var(--card); }
.gcmt-form button {
    flex: none; padding: 0 16px; height: 38px; border-radius: 999px; border: 0;
    background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;
}
.gcmt-login { font-size: 12.5px; color: var(--muted); }
.gcmt-login a { color: var(--brand); font-weight: 700; }
.gcmt-list .cmt { display: flex; gap: 10px; padding: 10px 0; }
.cmt-av-img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.cmt-main { min-width: 0; flex: 1; }
.cmt-top { display: flex; align-items: center; gap: 8px; }
.cmt-empty { color: var(--muted); font-size: 12.5px; padding: 10px 0; }

.grel { padding: 18px 6px 6px; }
.rel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rel-card { display: block; }
.rel-card img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover;
    border-radius: 10px; background: var(--card-2); display: block;
}
.rel-card span {
    display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 用户主页 ---------- */
.uprofile {
    margin: 6px 0 14px; padding: 0 0 14px;
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.ucover {
    height: 78px;
    background:
        radial-gradient(120% 120% at 10% 0%, rgba(47, 111, 104, .22), transparent 60%),
        radial-gradient(120% 120% at 100% 0%, rgba(90, 120, 255, .18), transparent 60%),
        var(--card-2);
}
.uhead { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px; margin-top: -30px; }
.uavatar {
    width: 68px; height: 68px; border-radius: 50%; flex: none;
    border: 3px solid var(--card); overflow: hidden; object-fit: cover;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; font-weight: 800;
    background: var(--card-2);
}
.uinfo { flex: 1; min-width: 0; padding-bottom: 4px; }
.uinfo h1 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.usub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: var(--muted); }
.urole { color: var(--brand); font-weight: 700; }
.ubtn { padding-bottom: 6px; }
.ubadges { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 0; }
.ustats { display: flex; padding: 14px 16px 0; }
.ustats > div { flex: 1; text-align: center; }
.ustats b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.ustats span { font-size: 11px; color: var(--muted); }

.utabs { display: flex; gap: 22px; padding: 4px 8px 10px; border-bottom: 1px solid var(--line); }
.utabs button {
    border: 0; background: transparent; padding: 8px 0; cursor: pointer;
    font-size: 13.5px; color: var(--muted); position: relative;
}
.utabs button.on { color: var(--text); font-weight: 800; }
.utabs button.on::after {
    content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 18px; height: 3px; border-radius: 2px; background: var(--brand);
}
.upane { padding-top: 10px; }
.ugrid { column-count: 2; column-gap: 8px; }
.ucard {
    display: block; break-inside: avoid; margin-bottom: 8px;
    border-radius: 12px; overflow: hidden; background: var(--card);
    box-shadow: var(--shadow);
}
.ucard-ph { display: block; }
.ucard-ph img { width: 100%; display: block; object-fit: cover; background: var(--card-2); }
.ucard-t {
    display: block; padding: 7px 9px 2px; font-size: 12.5px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ucard-m {
    display: flex; align-items: center; gap: 3px;
    padding: 0 9px 8px; font-size: 10.5px; color: var(--muted);
}
.ucard-m .ic { width: 11px; height: 11px; }
.ucmts { display: flex; flex-direction: column; gap: 8px; }
.ucmt {
    display: flex; gap: 10px; padding: 10px; border-radius: 12px;
    background: var(--card); box-shadow: var(--shadow);
}
.ucmt img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--card-2); }
.ucmt p { margin: 0 0 4px; font-size: 13px; line-height: 1.55; word-break: break-word; }
.ucmt span { font-size: 11px; color: var(--muted); }

/* ---------- 我的：积分卡 ---------- */
.pt-card {
    position: relative; margin: 12px 0 14px; padding: 16px;
    border-radius: var(--radius); color: var(--text);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.pt-card::after {
    content: ''; position: absolute; right: -70px; top: -80px;
    width: 190px; height: 190px; border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(47, 111, 104, .13), transparent 68%);
}
.pt-main { display: flex; align-items: baseline; gap: 8px; position: relative; z-index: 1; }
.pt-label { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.pt-num b { font-size: 28px; font-weight: 800; letter-spacing: -.8px; color: var(--brand); }
.pt-num span { font-size: 12px; margin-left: 3px; color: var(--muted); }
.pt-checkin {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    padding: 7px 15px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--brand); color: #fff;
    font-size: 12px; font-weight: 700;
}
.pt-checkin.on { background: var(--brand-soft); color: var(--brand); }
.pt-hint { margin-top: 8px; font-size: 10.5px; color: var(--muted); position: relative; z-index: 1; }

/* ---------- 设置页头像 ---------- */
.avatar-panel .av-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.av-preview {
    width: 66px; height: 66px; border-radius: 50%; flex: none; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; font-weight: 800; object-fit: cover;
}
.av-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.av-side b { font-size: 14px; }
.av-side .muted { font-size: 11.5px; }
.av-file { margin-top: 6px; }
.av-file input { display: block; font-size: 11.5px; color: var(--muted); max-width: 100%; }
.av-file span { display: none; }

/* ---------- 徽章观感 ---------- */
.bdg {
    filter: drop-shadow(0 2px 2px rgba(17, 18, 20, .18));
    flex: none;
}
.gsub .bdg, .pn-badges .bdg { filter: drop-shadow(0 1px 1px rgba(17, 18, 20, .14)); }
.bp-item .bdg { filter: drop-shadow(0 5px 8px rgba(255, 140, 30, .28)); }

/* ---------- 小屏 ---------- */
@media (max-width: 380px) {
    .rel-grid { grid-template-columns: repeat(3, 1fr); }
    .gtitle { font-size: 17px; }
    .pt-num b { font-size: 23px; }
}

/* 发布页输入框宽度修正 */
.pub-form .field input[type="text"],
.pub-form .field input[type="number"],
.pub-form .field textarea { width: 100%; }
.pub-form .field textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
.pub-form .field input[type="number"] { max-width: 200px; }

/* 文本域与输入框统一外观 */
.pub-form .field textarea {
    border: 1px solid var(--line); border-radius: 12px; background: var(--card);
    color: var(--text); padding: 12px 14px; font-size: 14px; font-family: inherit;
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.pub-form .field textarea::placeholder { color: var(--muted); }
.pub-form .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pub-form .field textarea::-webkit-resizer { background: transparent; }

/* 用户主页徽章胶囊 */
.ubadges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.ubdg {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 4px;
    border-radius: 999px; background: var(--card-2, #f5f5f7); border: 1px solid var(--line, rgba(0,0,0,.06));
}
.ubdg em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--text-2, #555); }
.ubdg .bdg { flex: none; }

/* ================= v2.4 视觉修正 ================= */
:root { --like: #d6455a; --amber: #b8791f; --amber-soft: rgba(184, 121, 31, .12); }
html[data-theme="dark"] { --brand: #63b3a4; --brand-2: #4d9187; --brand-soft: rgba(99, 179, 164, .16); }
.gact.on, .lb-act.on { color: var(--like); }

/* 发布按钮与主按钮：实色为主，去掉大面积渐变 */
.btn-grad {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(20, 60, 55, .9);
}
.btn-grad:active { background: #275e58; }
html[data-theme="dark"] .btn-grad:active { background: #559e91; }
.tab-post-btn {
    background: var(--brand);
    box-shadow: 0 5px 14px -7px rgba(20, 60, 55, .85);
}
.pub-entry.btn-grad { background: var(--brand); }

/* 徽章行内折叠（用户主页） */
.uname-badges {
    display: inline-flex; align-items: center; gap: 1px; vertical-align: 2px;
    margin-left: 6px;
}
.uname-badges i {
    font-style: normal; font-size: 10.5px; font-weight: 700;
    color: var(--muted); margin-left: 2px;
}

/* 我的页徽章折叠 */
.bp-fold { padding: 14px 16px 12px; }
.bp-fold > summary { list-style: none; cursor: pointer; }
.bp-fold > summary::-webkit-details-marker { display: none; }
.bp-fold .bp-arrow { width: 13px; height: 13px; transition: transform .2s; vertical-align: -2px; }
.bp-fold[open] .bp-arrow { transform: rotate(90deg); }
.bp-fold[open] { padding-bottom: 8px; }

/* 打赏 */
.gact-tip .ic { color: var(--amber); }
.tip-mask {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(12, 16, 15, .46);
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0;
}
.tip-mask[hidden] { display: none; }
.tip-box {
    position: relative; width: 100%; max-width: 460px;
    background: var(--card); border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
    animation: tipUp .22s ease-out;
}
@keyframes tipUp { from { transform: translateY(18px); opacity: .6; } }
.tip-x {
    position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
    border-radius: 50%; border: 0; background: var(--card-2, #f2f3f2); color: var(--muted);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.tip-x .ic { width: 15px; height: 15px; }
.tip-title { display: block; font-size: 16px; font-weight: 800; }
.tip-sub { font-size: 12px; color: var(--muted); margin: 6px 0 14px; line-height: 1.6; }
.tip-sub em { font-style: normal; font-weight: 800; color: var(--brand); }
.tip-amts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tip-amts button {
    flex: 1 1 52px; height: 40px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line); background: transparent;
    font-size: 14px; font-weight: 700; color: var(--text);
}
.tip-amts button.on { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.tip-custom { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tip-custom input {
    width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
    border: 1px solid var(--line); background: transparent; color: var(--text);
    font-size: 15px; font-weight: 700;
}
.tip-custom span { font-size: 12px; color: var(--muted); flex: none; }
.tag-mark.tip { background: var(--amber-soft); color: var(--amber); }

/* ---------- 积分商店 ---------- */
.shop-head { padding-bottom: 4px; }
.shop-balance {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 14px; margin: 4px 0 12px;
    border-radius: 14px; background: var(--card); border: 1px solid var(--line);
    font-size: 12.5px; color: var(--muted);
}
.shop-balance b { font-size: 19px; color: var(--brand); font-weight: 800; }
.shop-balance a { margin-left: auto; font-size: 12px; color: var(--brand); font-weight: 600; }
.shop-new, .shop-form, .shop-login {
    border-radius: 14px; background: var(--card); border: 1px solid var(--line);
}
.shop-new { margin-bottom: 12px; padding: 0 14px; }
.shop-new > summary {
    list-style: none; cursor: pointer; font-size: 13.5px; font-weight: 700;
    padding: 13px 0; display: flex; align-items: center; gap: 6px;
}
.shop-new > summary::-webkit-details-marker { display: none; }
.shop-new > summary .ic { width: 16px; height: 16px; color: var(--brand); }
.shop-form { border: 0; padding: 2px 0 16px; }
.shop-type { display: flex; gap: 8px; margin-bottom: 12px; }
.shop-type label { flex: 1; cursor: pointer; }
.shop-type input { display: none; }
.shop-type span {
    display: block; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.shop-type em { display: block; font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.shop-type input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.shop-row { display: flex; gap: 10px; }
.shop-row .field { flex: 1; }
.shop-note { font-size: 10.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.shop-login { padding: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.shop-login a { color: var(--brand); font-weight: 700; }
.shop-tabs { display: flex; gap: 20px; padding: 6px 2px 12px; }
.shop-tabs a { font-size: 14px; color: var(--muted); font-weight: 500; position: relative; padding-bottom: 5px; }
.shop-tabs a.on { color: var(--text); font-weight: 800; }
.shop-tabs a.on::after {
    content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 16px; height: 3px; border-radius: 2px; background: var(--brand);
}
.shop-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.shop-card {
    padding: 14px; border-radius: 14px; background: var(--card);
    border: 1px solid var(--line);
}
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-type {
    font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand); font-weight: 700;
}
.sc-type.bounty { background: var(--amber-soft); color: var(--amber); }
.sc-price { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.sc-price em { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.sc-title { font-size: 14.5px; font-weight: 700; margin: 8px 0 4px; line-height: 1.45; }
.sc-body { font-size: 12px; color: var(--muted); margin: 0 0 6px; line-height: 1.65; }
.sc-meta {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    font-size: 11.5px; color: var(--muted); margin-bottom: 10px;
}
.sc-author { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sc-author img, .sc-author i {
    width: 20px; height: 20px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    object-fit: cover; color: #fff; font-style: normal; font-size: 10px; font-weight: 700;
}
.sc-actions { display: flex; align-items: center; gap: 8px; }
.sc-actions form { flex: 1; }
.sc-own { font-size: 11.5px; color: var(--muted); flex: 1; }
.shop-sub { font-size: 14px; font-weight: 800; margin: 20px 0 8px; }
.shop-mine { border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.sm-row {
    display: flex; align-items: center; gap: 8px; padding: 11px 12px;
    font-size: 12px; border-top: 1px solid var(--line);
}
.sm-row:first-child { border-top: 0; }
.sm-type { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); flex: none; }
.sm-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-price { color: var(--brand); font-weight: 700; flex: none; }
.sm-st { color: var(--muted); flex: none; }
.btn-amber { background: var(--amber); color: #fff; }
.btn-amber:active { background: #a06a1a; }
.btn.sm.block, .btn.block { width: 100%; }
.btn.sm { height: 34px; font-size: 12.5px; padding: 0 14px; border-radius: 9px; }
.btn.line { background: transparent; border: 1px solid var(--line); color: var(--text); }
.empty .ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; color: var(--muted); }

/* ---------- 首页轮播 ---------- */
.banner {
    position: relative; margin: 2px 0 14px;
    border-radius: 16px; overflow: hidden; background: var(--card);
    border: 1px solid var(--line);
}
.banner-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide { flex: 0 0 100%; scroll-snap-align: center; display: block; }
.banner-slide img { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.banner-cap {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 26px 14px 12px; color: #fff; font-size: 12.5px; font-weight: 600;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
    pointer-events: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.banner-dots {
    position: absolute; right: 12px; bottom: 12px; display: flex; gap: 4px;
}
.banner-dots i {
    width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .5);
    transition: width .2s;
}
.banner-dots i.on { width: 14px; border-radius: 3px; background: #fff; }

.shop-entry {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 12px; padding: 12px 14px; border-radius: 14px;
    background: var(--card); border: 1px solid var(--line);
}
.se-ic {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand);
}
.se-ic .ic { width: 17px; height: 17px; }
.se-txt { min-width: 0; flex: 1; }
.se-txt b { display: block; font-size: 13.5px; font-weight: 700; }
.se-txt em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; }
.se-arrow { width: 15px; height: 15px; color: var(--muted); flex: none; }
