/**
 * 友讲 H5 — 公共 UI 组件层
 * 业务页只组合这些原语，避免各自再写一套圆角/软底/等宽格
 *
 * 命名：vh-* 为稳定公共 API；历史类名（msg-tabs / me-growth-card / publish-source-*）
 * 通过同规则选择器兼容，逐步收敛到 vh-*。
 */

/* ==================== 文字动作 / 顶栏元信息（同字号、不加粗） ==================== */
:root,
[data-theme="light"],
[data-theme="dark"] {
    --vh-text-action-size: 13px;
    --vh-text-action-weight: 400;
}

/* 右侧「全部已读」等文字按钮 */
.vh-text-action,
.btn-text {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: var(--vh-text-action-size);
    font-weight: var(--vh-text-action-weight);
    line-height: 1.3;
    cursor: pointer;
    padding: 4px 6px;
    -webkit-tap-highlight-color: transparent;
}

/* 左侧元信息：与文字按钮同字号/字重；数字单独用未读红点色 */
.vh-toolbar-meta,
.msg-unread-hint {
    display: block;
    margin: 0;
    padding: 4px 0;
    font-size: var(--vh-text-action-size);
    font-weight: var(--vh-text-action-weight);
    line-height: 1.3;
    color: var(--primary);
}
.vh-toolbar-meta__num,
.msg-unread-hint__num {
    color: var(--like, #FF6B8A);
    font-weight: inherit;
}
.vh-toolbar-meta--action {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
}
.vh-toolbar-meta--action:active {
    opacity: 0.75;
}

/* ==================== 页顶粘性栏（发现 / 消息 共用） ==================== */
.vh-page-top,
.discover-top,
.msg-top {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-card);
}

.vh-page-header,
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    padding-top: max(14px, env(safe-area-inset-top));
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.vh-page-header__title,
.page-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: var(--text);
}
.vh-page-header__actions,
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.vh-page-header__main,
.page-header-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

/* 分段上方的工具行：透明、无底边，与下方 vh-seg 合成一条顶栏 */
.vh-page-header--under-seg,
.page-header--under-seg {
    background: transparent !important;
    border-bottom: none !important;
    padding-bottom: 4px;
}

.vh-page-top > .vh-seg,
.vh-page-top > .msg-tabs,
.msg-top > .msg-tabs,
.discover-top > .msg-tabs {
    background: transparent;
}

/* ==================== 软色卡片（我的增长区等） ==================== */
.vh-stack,
.me-growth-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 var(--space-4, 16px) var(--space-2, 8px);
    box-sizing: border-box;
    width: 100%;
}

.vh-soft-card,
.me-growth-card {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    background: var(--primary-soft, #E6F8F5);
    border: 1px solid var(--soft-border, rgba(46, 196, 182, 0.22));
    border-radius: var(--radius-card, 16px);
    color: inherit;
    font: inherit;
    text-align: left;
}

.vh-soft-card--button,
button.vh-soft-card,
button.me-growth-card {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.vh-soft-card--button:active,
button.vh-soft-card:active,
button.me-growth-card:active {
    opacity: 0.92;
}

.vh-soft-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vh-soft-card__title,
.me-growth-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 8px;
}

.vh-soft-card__title--inline,
.me-growth-card-title--inline,
.vh-soft-card__head .vh-soft-card__title,
.vh-soft-card__head .me-growth-card-title,
.me-creator-stats-head .me-growth-card-title,
.me-drafts-card .me-growth-card-title {
    margin: 0;
}

.vh-soft-card__meta {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.vh-soft-card__sub {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.vh-soft-card__row,
.me-invite-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.vh-code-chip,
.me-invite-code {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 0 12px;
    min-height: 36px;
    font-size: 17px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.18em;
    color: var(--primary);
    background: var(--bg-card, #fff);
    border: 1px solid var(--soft-border-strong, rgba(46, 196, 182, 0.28));
    border-radius: 10px;
}

.vh-soft-card__action,
.me-invite-btn {
    flex: 0 0 auto;
    min-width: 72px;
    height: 36px;
    padding-left: 12px;
    padding-right: 12px;
}

/* ==================== 等宽选择格（发布相册/拍摄等） ==================== */
.vh-pick-grid,
.publish-source-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

.vh-pick-tile,
.publish-source-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 112px;
    padding: 14px 10px;
    border: 1.5px dashed var(--soft-border-strong, rgba(46, 196, 182, 0.55));
    border-radius: 14px;
    background: var(--bg-input, #f7f9fb);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vh-pick-tile > span:not(.vh-pick-tile__icon):not(.publish-upload-icon),
.publish-source-btn > span:not(.publish-upload-icon) {
    display: block;
    max-width: 100%;
}

.vh-pick-tile small,
.publish-source-btn small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    opacity: 0.75;
    max-width: 100%;
}

.vh-pick-tile__icon,
.publish-source-btn .publish-upload-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vh-pick-tile:active,
.publish-source-btn:active {
    border-color: var(--primary);
    color: var(--text);
    background: var(--primary-soft, #E6F8F5);
}

/* ==================== 分段 Tab（消息/发现/搜索/我的 共用） ==================== */
.vh-seg,
.msg-tabs {
    position: relative;
    display: flex;
    gap: 0;
    padding: 0 var(--space-4, 16px);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.vh-seg__item,
.msg-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: color var(--motion-ink, 220ms) ease;
}

.vh-seg__item.active,
.msg-tab.active {
    color: var(--primary);
    font-weight: 600;
    background: transparent;
}

/* 无滑动 ink 时的兜底下划线；有 .vh-seg-ink 时由 motion.css 隐藏 */
.vh-seg__item.active::after,
.msg-tab.active::after {
    content: '';
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
}

.vh-seg__dot,
.msg-tab-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--like);
    margin-left: 4px;
    vertical-align: middle;
}
.vh-seg__dot.hidden,
.msg-tab-dot.hidden {
    display: none;
}

/* 行内两端对齐入口（友币行等） */
.vh-row-link,
.me-points-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    margin: 0;
}
.vh-row-link:active,
.me-points-card:active {
    opacity: 0.9;
}
.vh-row-link__value,
.me-points-card-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--points, #E8A838);
}
.vh-row-link__arrow,
.me-points-card-arrow {
    color: var(--text-muted);
    font-size: 16px;
}
.me-points-card-label {
    font-size: 14px;
    font-weight: 600;
}
