/* 子屏游戏 · 嘿咻五子棋（独立样式）
 * 视觉：田园核 / Cottagecore；暖亚麻、草木绿、旧玫瑰与蜂蜜黄。
 */
.heyxiu-gomoku-game {
    --hxg-paper: #faf6f0;
    --hxg-paper-deep: #f3eadf;
    --hxg-cream: #fffaf2;
    --hxg-ink: #6f5b44;
    --hxg-ink-soft: #8b7355;
    --hxg-leaf: #5a8f5a;
    --hxg-leaf-dark: #3d5c3d;
    --hxg-rose: #d4a0a0;
    --hxg-berry: #8b4a5a;
    --hxg-honey: #f5d75f;
    --hxg-line: rgba(139, 115, 85, 0.24);
    position: absolute;
    inset: 0;
    z-index: 100198;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    color: var(--hxg-ink);
    font-family: 'Noto Serif SC', 'Songti SC', STSong, Georgia, 'Times New Roman', serif;
}

.heyxiu-gomoku-game.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 从游戏中心瞬时切入：关掉 opacity 过渡，避免与 hub 淡出叠帧时露出下层子屏幕底图 */
.heyxiu-gomoku-game.heyxiu-gomoku-game--instant {
    transition: none !important;
    opacity: 1;
    visibility: visible;
}

.hxg-shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 8%, rgba(212, 160, 160, 0.18) 0 2px, transparent 3px),
        radial-gradient(circle at 88% 16%, rgba(90, 143, 90, 0.16) 0 2px, transparent 3px),
        radial-gradient(circle at 72% 82%, rgba(245, 215, 95, 0.19) 0 2px, transparent 3px),
        linear-gradient(145deg, #fffaf3 0%, #faf6f0 45%, #f1eadf 100%);
    background-size: 48px 48px, 58px 58px, 64px 64px, auto;
}

.hxg-shell::before,
.hxg-shell::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    opacity: 0.42;
}

.hxg-shell::before {
    width: 110px;
    height: 110px;
    left: -48px;
    top: 18%;
    border: 2px solid rgba(90, 143, 90, 0.16);
    border-radius: 48% 52% 46% 54%;
    transform: rotate(24deg);
}

.hxg-shell::after {
    width: 90px;
    height: 90px;
    right: -46px;
    bottom: 14%;
    border: 2px dashed rgba(212, 160, 160, 0.24);
    border-radius: 50%;
}

.hxg-header {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    min-height: 58px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 66px;
    align-items: center;
    gap: 7px;
    padding: calc(9px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) max(13px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) 9px max(13px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    box-sizing: border-box;
    border-bottom: 1px solid rgba(139, 115, 85, 0.18);
    background: rgba(250, 246, 240, 0.88);
    box-shadow: 0 4px 16px rgba(92, 69, 45, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

html.lovemi-flat-glass .hxg-header,
html.lovemi-chat-flat-glass .hxg-header {
    background: #faf6f0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hxg-header-title {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--hxg-leaf);
}

.hxg-header-title span {
    font-size: 12px;
    color: var(--hxg-rose);
}

.hxg-header h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hxg-ink-soft);
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: center;
}

.hxg-icon-btn,
.hxg-text-btn {
    height: 38px;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.28);
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.94);
    color: var(--hxg-ink-soft);
    box-shadow: 0 3px 8px rgba(92, 69, 45, 0.08);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-icon-btn {
    width: 38px;
    padding: 0;
    font-size: 25px;
    line-height: 1;
}

.hxg-text-btn {
    padding: 0 11px;
    font-size: 13px;
}

.hxg-header-spacer {
    width: 38px;
    height: 38px;
}

.hxg-main {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
    padding: 14px max(13px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) 16px max(13px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
}

.hxg-main::-webkit-scrollbar,
.hxg-friend-list::-webkit-scrollbar,
.hxg-chat-list::-webkit-scrollbar { width: 0; height: 0; display: none; }

.hxg-main--setup,
.hxg-main--result,
.hxg-main--history,
.hxg-main--play {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hxg-hero {
    position: relative;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 42px;
    box-sizing: border-box;
    border: 1px solid rgba(212, 160, 160, 0.38);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(250, 246, 240, 0.96), rgba(245, 215, 95, 0.10));
    box-shadow: 0 8px 20px rgba(92, 69, 45, 0.08);
    text-align: center;
}

.hxg-hero p {
    margin: 0;
    color: var(--hxg-ink-soft);
    font-size: 13px;
    line-height: 1.7;
}

.hxg-hero-flower,
.hxg-hero-leaf {
    position: absolute;
    color: var(--hxg-rose);
    font-size: 24px;
}

.hxg-hero-flower { left: 15px; top: 12px; }
.hxg-hero-leaf { right: 14px; bottom: 8px; color: var(--hxg-leaf); transform: rotate(-18deg); }

.hxg-card,
.hxg-board-card,
.hxg-chat-card,
.hxg-history-item {
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.20);
    border-radius: 20px;
    background: rgba(250, 246, 240, 0.92);
    box-shadow: 0 8px 20px rgba(92, 69, 45, 0.08);
}

.hxg-card { padding: 14px; }

.hxg-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.hxg-card-title > div,
.hxg-option-row > div,
.hxg-option-stack > div,
.hxg-settings-entry > span,
.hxg-setting-row > span:first-child,
.hxg-settings-head > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hxg-card-title span,
.hxg-option-row strong,
.hxg-option-stack strong,
.hxg-settings-entry strong,
.hxg-settings-head strong {
    color: var(--hxg-ink);
    font-size: 15px;
    line-height: 1.25;
}

.hxg-card-title small,
.hxg-option-row small,
.hxg-option-stack small,
.hxg-settings-entry small,
.hxg-settings-head small,
.hxg-setting-row small {
    color: rgba(111, 91, 68, 0.68);
    font-size: 11px;
    line-height: 1.45;
}

.hxg-card-title b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 30px;
    padding: 0 9px;
    box-sizing: border-box;
    border: 1px solid rgba(90, 143, 90, 0.34);
    border-radius: 999px;
    background: rgba(90, 143, 90, 0.10);
    color: var(--hxg-leaf-dark);
    font-size: 13px;
}

.hxg-search {
    height: 42px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    margin-bottom: 10px;
    border: 1px solid rgba(139, 115, 85, 0.26);
    border-radius: 14px;
    background: var(--hxg-cream);
    overflow: hidden;
}

.hxg-search span {
    text-align: center;
    color: var(--hxg-leaf);
    font-size: 20px;
}

.hxg-search input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 10px 0 0;
    box-sizing: border-box;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--hxg-ink);
    font: inherit;
    font-size: 14px;
}

.hxg-search input::placeholder,
.hxg-chat-input::placeholder { color: rgba(139, 115, 85, 0.46); }

.hxg-friend-list {
    max-height: 244px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: grid;
    gap: 8px;
    scrollbar-width: none;
}

.hxg-friend-row {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.16);
    border-radius: 16px;
    background: rgba(255, 250, 242, 0.78);
    color: var(--hxg-ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.hxg-friend-row:active { transform: scale(0.985); }

.hxg-friend-row.is-selected {
    border-color: rgba(90, 143, 90, 0.46);
    background: linear-gradient(135deg, rgba(90, 143, 90, 0.12), rgba(245, 215, 95, 0.10));
    box-shadow: inset 0 0 0 1px rgba(90, 143, 90, 0.10);
}

.hxg-friend-avatar,
.hxg-chat-avatar,
.hxg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 auto;
    border: 2px solid rgba(212, 160, 160, 0.46);
    border-radius: 50%;
    background: linear-gradient(145deg, #f7e6df, #eef5e9);
    color: var(--hxg-berry);
    font-weight: 800;
}

.hxg-friend-avatar { width: 42px; height: 42px; }
.hxg-chat-avatar { width: 30px; height: 30px; }

.hxg-friend-avatar img,
.hxg-chat-avatar img,
.hxg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hxg-friend-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hxg-friend-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--hxg-ink);
    font-size: 14px;
}

.hxg-friend-main small { color: rgba(111, 91, 68, 0.62); font-size: 11px; }

.hxg-radio {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid rgba(139, 115, 85, 0.28);
    border-radius: 50%;
    color: white;
    font-size: 13px;
}

.hxg-friend-row.is-selected .hxg-radio {
    border-color: var(--hxg-leaf);
    background: var(--hxg-leaf);
}

.hxg-options-card { display: grid; gap: 13px; }

.hxg-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 46%);
    align-items: center;
    gap: 10px;
}

.hxg-option-stack { display: grid; gap: 10px; }

.hxg-segments {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
}

.hxg-segment {
    min-width: 0;
    min-height: 36px;
    padding: 0 7px;
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.24);
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.90);
    color: var(--hxg-ink-soft);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.hxg-segment.is-selected {
    border-color: rgba(90, 143, 90, 0.54);
    background: var(--hxg-leaf);
    color: #fff;
    box-shadow: 0 4px 10px rgba(61, 92, 61, 0.18);
}

.hxg-stitch-divider {
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(212, 160, 160, 0.64);
    font-size: 10px;
    letter-spacing: 0.55em;
}

.hxg-settings-card { padding: 4px 12px; }

.hxg-settings-entry {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.hxg-settings-entry b { color: var(--hxg-leaf); font-size: 28px; font-weight: 400; }

.hxg-footer {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    display: grid;
    padding: 10px max(13px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))) max(13px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    box-sizing: border-box;
    border-top: 1px solid rgba(139, 115, 85, 0.15);
    background: rgba(250, 246, 240, 0.92);
}

.hxg-footer--split { grid-template-columns: 0.9fr 1.1fr; gap: 9px; }

.hxg-primary,
.hxg-secondary,
.hxg-outline {
    min-height: 46px;
    padding: 8px 16px;
    box-sizing: border-box;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hxg-primary {
    border: 1px solid rgba(61, 92, 61, 0.22);
    background: linear-gradient(135deg, #5a8f5a, #4b7a4b);
    color: white;
    box-shadow: 0 6px 14px rgba(61, 92, 61, 0.22);
}

.hxg-secondary,
.hxg-outline {
    border: 1px solid rgba(139, 115, 85, 0.34);
    background: rgba(255, 250, 242, 0.94);
    color: var(--hxg-ink-soft);
}

.hxg-outline { min-height: 38px; font-size: 12px; }
.hxg-primary:active, .hxg-secondary:active, .hxg-outline:active { transform: scale(0.98); }

.hxg-empty {
    padding: 24px 12px;
    color: rgba(111, 91, 68, 0.62);
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
}

/* 设置抽屉 */
.hxg-settings-mask {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: stretch;
    background: rgba(73, 57, 39, 0.34);
}

.hxg-settings-sheet {
    width: 100%;
    max-height: 88%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(212, 160, 160, 0.44);
    border-bottom: 0;
    border-radius: 26px 26px 0 0;
    background: var(--hxg-paper);
    box-shadow: 0 -16px 40px rgba(73, 57, 39, 0.18);
}

.hxg-settings-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 16px 11px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}

.hxg-settings-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 16px 12px;
}

.hxg-setting-row {
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed rgba(139, 115, 85, 0.18);
}

.hxg-setting-row strong { color: var(--hxg-ink); font-size: 13px; line-height: 1.35; }

.hxg-number {
    height: 36px;
    display: grid;
    grid-template-columns: 34px 44px 34px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(139, 115, 85, 0.28);
    border-radius: 999px;
    background: var(--hxg-cream);
}

.hxg-number button,
.hxg-number input {
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--hxg-ink);
    text-align: center;
    font: inherit;
    font-size: 13px;
    outline: 0;
}

.hxg-number input { width: 44px; -moz-appearance: textfield; }
.hxg-number input::-webkit-inner-spin-button,
.hxg-number input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.hxg-setting-row--toggle {
    position: relative;
    grid-template-columns: minmax(0, 1fr) 52px;
}

.hxg-switch-input {
    position: absolute;
    right: 0;
    width: 48px;
    height: 30px;
    opacity: 0;
    cursor: pointer;
}

.hxg-switch {
    position: relative;
    width: 48px;
    height: 28px;
    display: block;
    border: 1px solid rgba(139, 115, 85, 0.26);
    border-radius: 999px;
    background: rgba(139, 115, 85, 0.16);
    transition: background 0.2s ease;
    pointer-events: none;
}

.hxg-switch::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 6px rgba(73, 57, 39, 0.18);
    transition: transform 0.2s ease;
}

.hxg-switch-input:checked + .hxg-switch { background: var(--hxg-leaf); }
.hxg-switch-input:checked + .hxg-switch::after { transform: translateX(20px); }

.hxg-settings-foot {
    flex: 0 0 auto;
    padding: 10px 16px calc(10px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid rgba(139, 115, 85, 0.14);
    background: rgba(250, 246, 240, 0.96);
}

.hxg-settings-foot .hxg-primary { width: 100%; }

/* 对局 */
.hxg-board-card {
    flex: 0 0 auto;
    padding: 10px;
}

.hxg-board-meta {
    min-height: 30px;
    display: grid;
    grid-template-columns: 1fr minmax(90px, 1.2fr) 1fr;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: rgba(111, 91, 68, 0.70);
    font-size: 9px;
}

.hxg-board-meta span {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hxg-board-meta span:last-child { justify-content: flex-end; }

.hxg-board-meta strong {
    color: var(--hxg-leaf-dark);
    text-align: center;
    font-size: 11px;
}

.hxg-mini-stone {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 50%;
    box-shadow: inset -1px -2px 3px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.14);
}

.hxg-mini-stone--1 { background: linear-gradient(145deg, #5d5145, #211e1a); }
.hxg-mini-stone--2 { background: linear-gradient(145deg, #fff, #ded8cd); border: 1px solid rgba(111, 91, 68, 0.24); }

.hxg-board-wrap {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 7px;
    box-sizing: border-box;
    border: 2px solid rgba(139, 115, 85, 0.40);
    border-radius: 17px;
    background: linear-gradient(145deg, #dfc796, #cdae78);
    box-shadow: inset 0 0 0 2px rgba(255, 250, 242, 0.34), 0 7px 18px rgba(92, 69, 45, 0.16);
}

.hxg-board {
    position: relative;
    width: 100%;
    min-height: 270px;
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
    grid-template-rows: repeat(15, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(95, 70, 40, 0.36);
    border-radius: 11px;
    background:
        radial-gradient(circle at 24% 14%, rgba(255, 250, 222, 0.28), transparent 34%),
        linear-gradient(145deg, #e4cb98, #d4b681);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.hxg-cell {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 0;
    background:
        linear-gradient(to right, transparent calc(50% - 0.5px), rgba(94, 68, 37, 0.46) calc(50% - 0.5px), rgba(94, 68, 37, 0.46) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(94, 68, 37, 0.46) calc(50% - 0.5px), rgba(94, 68, 37, 0.46) calc(50% + 0.5px), transparent calc(50% + 0.5px));
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.hxg-cell:disabled { opacity: 1; cursor: default; }
.hxg-cell:not(:disabled):active { background-color: rgba(245, 215, 95, 0.24); }

.hxg-stone {
    position: absolute;
    z-index: 3;
    left: 13%;
    top: 13%;
    width: 74%;
    height: 74%;
    box-sizing: border-box;
    border-radius: 50%;
    pointer-events: none;
}

.hxg-stone--0 { display: none; }
.hxg-stone--1 {
    background: radial-gradient(circle at 34% 28%, #74685a 0%, #352f29 42%, #171512 100%);
    box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.48), 0 2px 3px rgba(70, 48, 25, 0.34);
}

.hxg-stone--2 {
    border: 1px solid rgba(96, 76, 53, 0.24);
    background: radial-gradient(circle at 34% 27%, #fff 0%, #f5efe5 44%, #cfc5b5 100%);
    box-shadow: inset -2px -3px 4px rgba(111, 91, 68, 0.16), 0 2px 3px rgba(70, 48, 25, 0.24);
}

.hxg-cell.is-last .hxg-stone::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: #c15d62;
    box-shadow: 0 0 0 1px rgba(255, 250, 242, 0.70);
}

.hxg-star {
    position: absolute;
    z-index: 1;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: rgba(80, 57, 32, 0.70);
    pointer-events: none;
}

.hxg-star--1 { left: 23.33%; top: 23.33%; }
.hxg-star--2 { left: 76.67%; top: 23.33%; }
.hxg-star--3 { left: 50%; top: 50%; }
.hxg-star--4 { left: 23.33%; top: 76.67%; }
.hxg-star--5 { left: 76.67%; top: 76.67%; }

.hxg-round-result {
    margin-top: 10px;
    padding: 11px;
    border: 1px solid rgba(90, 143, 90, 0.30);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(90, 143, 90, 0.10), rgba(245, 215, 95, 0.10));
    text-align: center;
}

.hxg-round-result strong { color: var(--hxg-leaf-dark); font-size: 14px; }
.hxg-round-result p { margin: 5px 0 9px; color: var(--hxg-ink-soft); font-size: 11px; line-height: 1.55; }
.hxg-round-result .hxg-primary { min-height: 38px; padding: 6px 18px; font-size: 12px; }
.hxg-round-result .hxg-primary:disabled { opacity: 0.56; cursor: wait; }

/* 惩罚结算面板 */
.hxg-punish-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.hxg-round-result .hxg-ghost {
    min-height: 38px;
    padding: 6px 16px;
    font-size: 12px;
    border: 1px solid rgba(90, 143, 90, 0.42);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    color: var(--hxg-leaf-dark);
    font-weight: 600;
    cursor: pointer;
}

.hxg-punish-skip {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    border: none;
    background: none;
    color: var(--hxg-ink-soft);
    font-size: 10.5px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.82;
}

.hxg-punish-input {
    width: 100%;
    min-height: 64px;
    margin: 4px 0 9px;
    padding: 9px 11px;
    border: 1px solid rgba(90, 143, 90, 0.36);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--hxg-ink);
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.hxg-punish-input:focus { outline: none; border-color: rgba(90, 143, 90, 0.66); }

.hxg-punish-hint {
    animation: hxgPunishPulse 1.4s ease-in-out infinite;
}

@keyframes hxgPunishPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.hxg-punish-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 4px 0 10px;
    max-height: 176px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.hxg-punish-options::-webkit-scrollbar { display: none; }

.hxg-punish-option {
    padding: 8px 11px;
    border: 1px solid rgba(90, 143, 90, 0.30);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--hxg-ink);
    font-size: 11.5px;
    line-height: 1.55;
    text-align: left;
    cursor: pointer;
}

.hxg-punish-option.is-active {
    border-color: rgba(90, 143, 90, 0.78);
    background: linear-gradient(135deg, rgba(90, 143, 90, 0.16), rgba(245, 215, 95, 0.16));
    box-shadow: 0 0 0 1px rgba(90, 143, 90, 0.4) inset;
    font-weight: 600;
}

/* 聊天卡片：弹性填满棋盘下方剩余高度。
 * 注意不能只给 overflow:hidden——flex 子项的 min-height:auto 会因此归零，
 * 整张卡片会被压扁去迁就一屏高度，消息被裁掉且无处可滚（真机已踩坑）。 */
.hxg-chat-card {
    flex: 1 1 auto;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 聊天显示区：无头部、隐形滚动条，可独立滚动查看全部消息 */
.hxg-chat-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 11px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 消息节点禁止被 flex 压缩，保证超出部分进入滚动而不是被压扁 */
.hxg-chat-list > * { flex: 0 0 auto; }

/* 双语折叠块（复用微信 chat-bilingual-block 全局样式）在游戏气泡内的适配 */
.hxg-bilingual-p { margin: 0; }
.hxg-bilingual-p .chat-bilingual-block { max-width: 100%; }

/* 多选模式下双语块自身的点击展开（内联 stopPropagation）会吞掉“点选消息”，此时禁用它 */
.hxg-chat-list--selecting .chat-bilingual-block { pointer-events: none; }

.hxg-chat-empty { margin: auto; color: rgba(111, 91, 68, 0.56); font-size: 11px; }

.hxg-typing-indicator {
    flex: 0 0 auto;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(212, 160, 160, 0.13);
    color: rgba(111, 91, 68, 0.78);
    font-size: 10px;
    line-height: 1.4;
}

.hxg-typing-indicator > span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hxg-typing-indicator i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--hxg-rose);
    animation: hxgDot 0.9s infinite alternate;
}

.hxg-typing-indicator i:nth-child(2) { animation-delay: 0.18s; }
.hxg-typing-indicator i:nth-child(3) { animation-delay: 0.36s; }

.hxg-system-message {
    align-self: center;
    max-width: 90%;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(245, 215, 95, 0.14);
    color: rgba(111, 91, 68, 0.72);
    text-align: center;
    font-size: 9px;
    line-height: 1.45;
}

.hxg-chat-message {
    max-width: 88%;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.hxg-chat-message--user { align-self: flex-end; flex-direction: row-reverse; text-align: right; }
.hxg-chat-message > div { min-width: 0; }
.hxg-chat-message small { display: block; margin: 0 5px 3px; color: rgba(111, 91, 68, 0.54); font-size: 8px; }

.hxg-chat-message p {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(139, 115, 85, 0.16);
    border-radius: 5px 15px 15px 15px;
    background: var(--hxg-cream);
    /* 台词字号/颜色可在聊天设置-字体设置里自定义（CSS 变量由 .hxg-chat-list 下发） */
    color: var(--hxg-font-chat-color, var(--hxg-ink));
    text-align: left;
    font-size: var(--hxg-font-chat-size, 11px);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.hxg-chat-message--user p {
    border-color: rgba(90, 143, 90, 0.22);
    border-radius: 15px 5px 15px 15px;
    background: rgba(90, 143, 90, 0.14);
}

@keyframes hxgDot { from { opacity: 0.25; transform: translateY(1px); } to { opacity: 1; transform: translateY(-1px); } }

/* 游戏聊天输入栏：表情 / 消息输入 / 发送 / 接收 */
.hxg-game-chat-footer {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    border-top: 1px solid rgba(139, 115, 85, 0.15);
    background: rgba(250, 246, 240, 0.96);
}

.hxg-chat-controls {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 52px 52px;
    align-items: center;
    gap: 6px;
    padding: 9px max(12px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) calc(9px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))) max(12px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    box-sizing: border-box;
}

.hxg-chat-emoji {
    width: 42px;
    height: 42px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0;
    padding: 0;
    border: 1px solid rgba(139, 115, 85, 0.24);
    border-radius: 50%;
    background: var(--hxg-cream);
    color: var(--hxg-leaf-dark);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-chat-emoji span { font-size: 17px; line-height: 1.1; }
.hxg-chat-emoji small { font-size: 7px; color: rgba(111, 91, 68, 0.62); }
.hxg-chat-emoji[aria-expanded="true"] { border-color: rgba(90, 143, 90, 0.44); background: rgba(90, 143, 90, 0.12); }

.hxg-chat-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.24);
    border-radius: 999px;
    outline: 0;
    background: var(--hxg-cream);
    color: var(--hxg-ink);
    font: inherit;
    font-size: 13px;
}

.hxg-chat-input:focus { border-color: rgba(90, 143, 90, 0.44); }

.hxg-chat-send,
.hxg-chat-receive {
    height: 42px;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-chat-send {
    border: 1px solid rgba(90, 143, 90, 0.38);
    background: var(--hxg-leaf);
    color: #fffdf7;
    box-shadow: 0 4px 10px rgba(61, 92, 61, 0.18);
}

.hxg-chat-receive {
    border: 1px solid rgba(139, 74, 90, 0.32);
    background: rgba(212, 160, 160, 0.14);
    color: var(--hxg-berry);
}

.hxg-chat-send:disabled,
.hxg-chat-receive:disabled,
.hxg-chat-emoji:disabled,
.hxg-chat-input:disabled { opacity: 0.55; cursor: default; }

/* 战绩 */
.hxg-history-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 15px;
    border: 1px solid rgba(212, 160, 160, 0.34);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(212, 160, 160, 0.10), rgba(245, 215, 95, 0.10));
    text-align: center;
}

.hxg-history-intro strong { color: var(--hxg-ink); font-size: 14px; }
.hxg-history-intro small { color: rgba(111, 91, 68, 0.64); font-size: 10px; }
.hxg-empty--history { border: 1px dashed rgba(139, 115, 85, 0.24); border-radius: 18px; }

.hxg-history-item { overflow: hidden; border-radius: 17px; }
.hxg-card .hxg-history-item + .hxg-history-item { margin-top: 8px; }

.hxg-history-row {
    width: 100%;
    min-height: 65px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 48px 18px;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    box-sizing: border-box;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.hxg-history-flower {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 160, 160, 0.42);
    border-radius: 50%;
    background: rgba(212, 160, 160, 0.12);
    color: var(--hxg-berry);
}

.hxg-history-row > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hxg-history-row > span:nth-child(2) strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hxg-ink); font-size: 13px; }
.hxg-history-row > span:nth-child(2) small { color: rgba(111, 91, 68, 0.60); font-size: 9px; }
.hxg-history-row > i { color: var(--hxg-leaf); font-style: normal; }

.hxg-history-score { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hxg-history-score b { color: var(--hxg-berry); font-size: 15px; }
.hxg-history-score small { color: rgba(111, 91, 68, 0.54); font-size: 8px; }

.hxg-history-detail {
    padding: 0 11px 12px;
    border-top: 1px dashed rgba(139, 115, 85, 0.17);
}

.hxg-history-rounds { display: grid; gap: 6px; padding: 10px 0; }

.hxg-history-round {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 2px 8px;
    padding: 7px 9px;
    border-radius: 12px;
    background: rgba(245, 215, 95, 0.09);
}

.hxg-history-round b { color: var(--hxg-leaf-dark); font-size: 10px; }
.hxg-history-round span { color: var(--hxg-ink); font-size: 10px; }
.hxg-history-round small { grid-column: 1 / -1; color: rgba(111, 91, 68, 0.64); font-size: 9px; line-height: 1.45; }

.hxg-summary-toggle {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border: 0;
    border-top: 1px dashed rgba(139, 115, 85, 0.18);
    background: transparent;
    color: var(--hxg-ink);
    font: inherit;
    font-size: 11px;
}

.hxg-summary-toggle b { color: var(--hxg-leaf); font-size: 10px; }
.hxg-summary-body { padding: 8px; border-radius: 12px; background: rgba(90, 143, 90, 0.07); }
.hxg-summary-body article { color: var(--hxg-ink); font-size: 10px; line-height: 1.65; }
.hxg-history-hint { margin: 0 0 8px; color: rgba(111, 91, 68, 0.68); font-size: 10px; line-height: 1.5; }

.hxg-history-delete {
    width: 100%;
    min-height: 36px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(212, 160, 160, 0.10);
    color: var(--hxg-berry);
    font: inherit;
    font-size: 10px;
}

.hxg-result-hero {
    padding: 22px 14px;
    border: 1px solid rgba(212, 160, 160, 0.38);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(250, 246, 240, 0.96), rgba(245, 215, 95, 0.12));
    box-shadow: 0 10px 24px rgba(92, 69, 45, 0.10);
    text-align: center;
}

.hxg-result-hero > span { color: var(--hxg-rose); font-size: 24px; }
.hxg-result-hero > small { display: block; margin-top: 3px; color: rgba(111, 91, 68, 0.62); font-size: 10px; }
.hxg-result-hero h3 { margin: 8px 0; color: var(--hxg-leaf-dark); font-size: 18px; }
.hxg-result-hero > div { display: flex; align-items: center; justify-content: center; gap: 17px; }
.hxg-result-hero > div b { color: var(--hxg-berry); font-size: 34px; }
.hxg-result-hero > div i { color: var(--hxg-rose); font-style: normal; font-size: 20px; }
.hxg-result-hero p { margin: 3px 0 0; color: rgba(111, 91, 68, 0.65); font-size: 10px; }

.hxg-loading {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--hxg-ink-soft);
    text-align: center;
}

.hxg-loading span { color: var(--hxg-rose); font-size: 38px; animation: hxgBloom 1.6s ease-in-out infinite alternate; }
.hxg-loading strong { font-size: 15px; }
.hxg-loading small { color: rgba(111, 91, 68, 0.58); font-size: 10px; }
@keyframes hxgBloom { from { transform: scale(0.92) rotate(-5deg); opacity: 0.62; } to { transform: scale(1.06) rotate(5deg); opacity: 1; } }

/* 游戏 Hub 中的独立入口颜色。结构由 heyxiu-gomoku.js 注入，Hub 只负责通用拖拽/换图标。 */
.sgh-tile--heyxiu-gomoku .sgh-tile__icon {
    background: linear-gradient(145deg, #faf6f0, #dfeeda);
    color: #5a8f5a;
}

.sgh-tile--heyxiu-gomoku .sgh-tile__icon-default {
    color: #5a8f5a;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.75);
}

@media (max-height: 720px) {
    .hxg-main { padding-top: 10px; padding-bottom: 10px; gap: 9px; }
    .hxg-board-card { padding: 8px; }
    .hxg-chat-card { min-height: 150px; }
    .hxg-friend-list { max-height: 190px; }
}

@media (max-width: 360px) {
    .hxg-header { grid-template-columns: 40px minmax(0, 1fr) 60px; padding-left: 9px; padding-right: 9px; }
    .hxg-main { padding-left: 9px; padding-right: 9px; }
    .hxg-option-row { grid-template-columns: 1fr; }
    .hxg-setting-row { grid-template-columns: minmax(0, 1fr) 108px; }
}

@media (prefers-reduced-motion: reduce) {
    .heyxiu-gomoku-game,
    .hxg-friend-row,
    .hxg-primary,
    .hxg-secondary,
    .hxg-outline,
    .hxg-switch,
    .hxg-switch::after { transition: none !important; }
    .hxg-loading span,
    .hxg-typing-indicator i { animation: none !important; }
}

/* 第二阶段 · 对局顶栏、聊天交互与独立聊天设置 */
.hxg-game-header {
    position: relative;
    z-index: 4;
    flex: 0 0 auto;
    min-height: 72px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    padding: calc(7px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) max(12px, var(--safe-area-inset-right, env(safe-area-inset-right, 0px))) 7px max(12px, var(--safe-area-inset-left, env(safe-area-inset-left, 0px)));
    box-sizing: border-box;
    border-bottom: 1px solid rgba(139, 115, 85, 0.18);
    background: rgba(250, 246, 240, 0.92);
    box-shadow: 0 4px 16px rgba(92, 69, 45, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hxg-game-participants {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.hxg-player-avatar-btn {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-columns: 38px;
    justify-items: center;
    gap: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hxg-ink-soft);
    font: inherit;
}

button.hxg-player-avatar-btn { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hxg-player-avatar-btn small { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.hxg-game-avatar { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; border: 2px solid rgba(212, 160, 160, 0.48); border-radius: 50%; background: #fffaf2; color: var(--hxg-berry); font-weight: 800; }
.hxg-game-avatar { width: 36px; height: 36px; }
.hxg-game-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hxg-player-avatar-btn--user .hxg-game-avatar { border-color: rgba(90, 143, 90, 0.44); }

/* 顶栏内嵌比分：双方头像之间直接显示输赢统计与局数，不再单列比分卡 */
.hxg-head-score {
    min-width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 3px 10px;
    border: 1px solid rgba(212, 160, 160, 0.30);
    border-radius: 999px;
    background: rgba(255, 250, 242, 0.72);
}

.hxg-head-score-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.hxg-head-score-line b { color: var(--hxg-berry); font-size: 17px; line-height: 1.15; }
.hxg-head-score-line i { color: var(--hxg-rose); font-style: normal; font-size: 12px; }
.hxg-head-score > small { max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(111, 91, 68, 0.62); font-size: 8px; }
.hxg-heartbeat-dot { position: absolute; top: 25px; right: 0; width: 9px; height: 9px; border: 2px solid #faf6f0; border-radius: 50%; background: #d36c77; box-shadow: 0 0 0 0 rgba(211, 108, 119, 0.35); animation: hxgHeartbeatPulse 1.8s ease-out infinite; }
@keyframes hxgHeartbeatPulse { 0% { box-shadow: 0 0 0 0 rgba(211, 108, 119, 0.38); } 70%, 100% { box-shadow: 0 0 0 7px rgba(211, 108, 119, 0); } }
.hxg-game-settings-btn { font-size: 18px; }

.hxg-board-end {
    width: 100%;
    min-height: 34px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(139, 74, 90, 0.72);
    font: inherit;
    font-size: 10px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hxg-action-message {
    align-self: center;
    max-width: 88%;
    padding: 3px 9px;
    /* 旁白字号/颜色可在聊天设置-字体设置里自定义（CSS 变量由 .hxg-chat-list 下发） */
    color: var(--hxg-font-action-color, rgba(111, 91, 68, 0.72));
    text-align: center;
    font-size: var(--hxg-font-action-size, 10px);
    font-style: italic;
    line-height: 1.6;
    white-space: pre-wrap;
}

.hxg-action-message::before,
.hxg-action-message::after { content: "—"; padding: 0 5px; color: rgba(212, 160, 160, 0.72); }
.hxg-emoji-bubble { display: grid; justify-items: center; gap: 3px; padding: 6px !important; background: transparent !important; border-color: transparent !important; }
.hxg-emoji-bubble img { width: 72px; height: 72px; display: block; object-fit: contain; }
.hxg-emoji-bubble small { max-width: 80px; margin: 0 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hxg-emoji-panel { border-top: 1px solid rgba(139, 115, 85, 0.14); background: rgba(255, 250, 242, 0.98); }
.hxg-emoji-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 7px 8px 5px; scrollbar-width: none; touch-action: pan-x; }
.hxg-emoji-tabs::-webkit-scrollbar { display: none; }
.hxg-emoji-tabs button { flex: 0 0 auto; min-height: 27px; padding: 0 10px; border: 1px solid rgba(139, 115, 85, 0.18); border-radius: 999px; background: transparent; color: var(--hxg-ink-soft); font: inherit; font-size: 9px; }
.hxg-emoji-tabs button.is-active { border-color: rgba(90, 143, 90, 0.36); background: rgba(90, 143, 90, 0.12); color: var(--hxg-leaf-dark); }
.hxg-emoji-grid { max-height: 172px; overflow-y: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; padding: 6px 8px 9px; }
.hxg-emoji-grid button { min-width: 0; min-height: 48px; padding: 4px; border: 0; border-radius: 11px; background: rgba(245, 215, 95, 0.08); color: var(--hxg-ink); font: inherit; }
.hxg-emoji-glyph { font-size: 24px !important; }
.hxg-emoji-image { display: grid; justify-items: center; gap: 2px; }
.hxg-emoji-image img { width: 42px; height: 42px; object-fit: contain; }
.hxg-emoji-image small { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 7px; }
.hxg-emoji-empty { grid-column: 1 / -1; padding: 18px; color: rgba(111, 91, 68, 0.55); text-align: center; font-size: 10px; }

/* 心跳监控：购物小票风浮窗（默认停靠 Char 头像下方，长按拖拽换位） */
.hxg-heartbeat-card {
    position: absolute;
    z-index: 30;
    width: 203px;
    padding: 12px 14px 10px;
    box-sizing: border-box;
    background: #fffdf8;
    color: var(--hxg-ink);
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 3px;
    box-shadow: 0 10px 26px rgba(49, 34, 22, 0.20);
    font-family: 'Courier New', 'Noto Serif SC', Georgia, monospace;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

/* 上下锯齿边：模拟撕下来的购物小票 */
.hxg-heartbeat-card::before,
.hxg-heartbeat-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background:
        linear-gradient(45deg, #fffdf8 4.2px, transparent 0) 0 0 / 9px 6px repeat-x,
        linear-gradient(-45deg, #fffdf8 4.2px, transparent 0) 0 0 / 9px 6px repeat-x;
    filter: drop-shadow(0 2px 2px rgba(49, 34, 22, 0.08));
}

.hxg-heartbeat-card::before { top: -6px; transform: scaleY(-1); }
.hxg-heartbeat-card::after { bottom: -6px; }

.hxg-heartbeat-card.is-dragging {
    box-shadow: 0 16px 38px rgba(49, 34, 22, 0.30);
    opacity: 0.92;
    cursor: grabbing;
}

.hxg-hb-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hxg-hb-head > b { color: var(--hxg-leaf-dark); font-size: 14px; font-weight: 800; letter-spacing: 2.5px; }
.hxg-hb-btns { display: inline-flex; gap: 5px; }
.hxg-hb-btns button { width: 24px; height: 24px; padding: 0; border: 1px solid rgba(139, 115, 85, 0.24); border-radius: 50%; background: #fffaf2; color: var(--hxg-ink-soft); font: inherit; font-size: 13px; line-height: 1; cursor: pointer; }
.hxg-hb-btns button:disabled { opacity: 0.45; }
.hxg-hb-sub { margin-top: 3px; color: rgba(111, 91, 68, 0.62); font-size: 10px; letter-spacing: 1px; text-align: center; }
.hxg-hb-divider { margin: 8px 0; border-top: 1px dashed rgba(139, 115, 85, 0.34); }
.hxg-hb-body { display: flex; flex-direction: column; gap: 4px; }
.hxg-hb-row { display: flex; align-items: baseline; gap: 6px; font-size: 12.5px; }
.hxg-hb-row span { flex: 0 0 auto; color: var(--hxg-ink); }
.hxg-hb-row em { flex: 1 1 auto; border-bottom: 1px dotted rgba(139, 115, 85, 0.42); }
.hxg-hb-row b { flex: 0 0 auto; color: var(--hxg-berry); font-size: 15px; font-weight: 800; }
.hxg-hb-row b small { color: rgba(111, 91, 68, 0.55); font-size: 9px; font-weight: 400; }
.hxg-hb-note { margin: 0 0 5px; color: rgba(111, 91, 68, 0.78); font-size: 10.5px; line-height: 1.6; }
.hxg-hb-empty { padding: 9px 0; color: rgba(111, 91, 68, 0.6); font-size: 11px; text-align: center; line-height: 1.6; }
.hxg-hb-loading { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 0; color: var(--hxg-leaf-dark); font-size: 11px; letter-spacing: 2px; }
.hxg-hb-loading i { width: 15px; height: 15px; border: 2px solid rgba(90, 143, 90, 0.24); border-top-color: var(--hxg-leaf-dark); border-radius: 50%; animation: hxgSpin 0.8s linear infinite; }
.hxg-hb-motto { color: rgba(111, 91, 68, 0.55); font-size: 9.5px; text-align: center; letter-spacing: 1px; }

/* 条形码本身是按钮：点击回看过往心跳小票 */
button.hxg-hb-barcode {
    display: block;
    width: calc(100% - 20px);
    height: 17px;
    margin: 7px 10px 4px;
    padding: 0;
    border: none;
    background: repeating-linear-gradient(90deg, var(--hxg-ink) 0 1px, transparent 1px 3px, var(--hxg-ink) 3px 5px, transparent 5px 6px, var(--hxg-ink) 6px 7px, transparent 7px 10px);
    opacity: 0.82;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button.hxg-hb-barcode:active { opacity: 0.6; }
.hxg-hb-no { color: rgba(111, 91, 68, 0.5); font-size: 9px; text-align: center; letter-spacing: 1.5px; }
@keyframes hxgSpin { to { transform: rotate(360deg); } }

/* 过往心跳小票：长票据回看 */
.hxg-hb-history-mask {
    position: absolute;
    inset: 0;
    z-index: 34;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    box-sizing: border-box;
    background: rgba(56, 43, 30, 0.32);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hxg-hb-history {
    width: min(100%, 260px);
    max-height: 78%;
    display: flex;
    flex-direction: column;
    padding: 12px 14px 10px;
    box-sizing: border-box;
    background: #fffdf8;
    color: var(--hxg-ink);
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 3px;
    box-shadow: 0 14px 34px rgba(49, 34, 22, 0.26);
    font-family: 'Courier New', 'Noto Serif SC', Georgia, monospace;
}

.hxg-hb-history-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hxg-hb-history-list::-webkit-scrollbar { display: none; }
.hxg-hb-history-item { padding: 2px 0; }
.hxg-hb-history-time { margin-bottom: 3px; color: rgba(111, 91, 68, 0.55); font-size: 9.5px; letter-spacing: 1px; }

.hxg-main--chat-settings { display: flex; flex-direction: column; gap: 11px; }
.hxg-chat-setting-card { padding: 14px; border: 1px solid rgba(139, 115, 85, 0.20); border-radius: 20px; background: rgba(250, 246, 240, 0.92); box-shadow: 0 8px 20px rgba(92, 69, 45, 0.07); }
.hxg-chat-setting-title { display: flex; flex-direction: column; gap: 3px; margin-bottom: 11px; }
.hxg-chat-setting-title span { color: var(--hxg-ink); font-size: 15px; font-weight: 800; }
.hxg-chat-setting-title small,
.hxg-chat-setting-card > p { color: rgba(111, 91, 68, 0.64); font-size: 10px; line-height: 1.5; }
.hxg-chat-setting-card > p { margin: 8px 0 0; }
.hxg-chat-setting-select { display: grid; gap: 7px; }
.hxg-chat-setting-select span { color: var(--hxg-ink-soft); font-size: 11px; }
.hxg-chat-setting-select select { width: 100%; min-height: 43px; padding: 0 36px 0 12px; border: 1px solid rgba(90, 143, 90, 0.30); border-radius: 14px; outline: 0; background: #fffaf2; color: var(--hxg-ink); font: inherit; font-size: 12px; }
.hxg-chat-setting-card.is-placeholder button { width: 100%; min-height: 43px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px dashed rgba(139, 115, 85, 0.26); border-radius: 14px; background: rgba(139, 115, 85, 0.04); color: rgba(111, 91, 68, 0.52); font: inherit; }
.hxg-chat-setting-card.is-placeholder button b { font-size: 9px; }

/* 字体设置：旁白/台词的字号滑杆、取色器与即时预览 */
.hxg-font-rows { display: grid; gap: 10px; }
.hxg-font-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) 54px; align-items: center; gap: 10px; }
.hxg-font-row > span { color: var(--hxg-ink-soft); font-size: 11px; }
.hxg-font-row > b { color: var(--hxg-ink); font-size: 10px; font-weight: 700; text-align: right; }
.hxg-font-row input[type="range"] { width: 100%; min-height: 26px; accent-color: var(--hxg-leaf-dark); }
.hxg-font-row input[type="color"] {
    width: 100%;
    height: 30px;
    padding: 2px;
    border: 1px solid rgba(139, 115, 85, 0.26);
    border-radius: 9px;
    background: var(--hxg-cream);
}
.hxg-font-preview {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px;
    border: 1px dashed rgba(139, 115, 85, 0.24);
    border-radius: 14px;
    background: rgba(255, 250, 242, 0.7);
}
.hxg-font-preview .hxg-chat-message { align-self: flex-start; }
.hxg-font-reset {
    margin-top: 9px;
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(139, 115, 85, 0.24);
    border-radius: 12px;
    background: transparent;
    color: var(--hxg-ink-soft);
    font: inherit;
    font-size: 11px;
}

/* 终局后棋盘可收起：只留「下一局/惩罚」区域，聊天区放大 */
.hxg-board-collapse-bar {
    width: 100%;
    min-height: 34px;
    margin-top: 8px;
    border: 1px dashed rgba(139, 115, 85, 0.32);
    border-radius: 12px;
    background: rgba(245, 215, 95, 0.10);
    color: var(--hxg-ink-soft);
    font: inherit;
    font-size: 11px;
}
.hxg-board-card--collapsed .hxg-board-collapse-bar { margin-top: 0; }
.hxg-main--play.is-board-collapsed .hxg-chat-card { min-height: min(430px, 55vh); }
/* 终局后棋格全部 disabled，点击穿透到 wrap 触发收起 */
.hxg-cell:disabled { pointer-events: none; }
.hxg-board-wrap[data-hxg-action] { cursor: pointer; }
.hxg-chat-setting-toggle { display: grid; grid-template-columns: minmax(0, 1fr) 45px; align-items: center; gap: 12px; cursor: pointer; }
.hxg-chat-setting-toggle > span { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hxg-chat-setting-toggle strong { color: var(--hxg-ink); font-size: 14px; }
.hxg-chat-setting-toggle small { color: rgba(111, 91, 68, 0.63); font-size: 10px; line-height: 1.45; }
.hxg-chat-setting-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hxg-chat-setting-toggle i { position: relative; width: 45px; height: 25px; border-radius: 999px; background: rgba(139, 115, 85, 0.22); transition: background 0.18s ease; }
.hxg-chat-setting-toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fffaf2; box-shadow: 0 2px 5px rgba(70, 50, 32, 0.20); transition: transform 0.18s ease; }
.hxg-chat-setting-toggle input:checked + i { background: var(--hxg-leaf); }
.hxg-chat-setting-toggle input:checked + i::after { transform: translateX(20px); }
.hxg-chat-setting-toggle.is-disabled { cursor: not-allowed; opacity: 0.56; }
.hxg-chat-settings-note { padding: 10px 12px; border-radius: 14px; background: rgba(245, 215, 95, 0.10); color: rgba(111, 91, 68, 0.64); font-size: 9px; line-height: 1.55; }
.hxg-end-game-btn { border-color: rgba(139, 74, 90, 0.34); color: var(--hxg-berry); }

@media (max-height: 720px) {
    .hxg-game-header { min-height: 62px; }
    .hxg-game-avatar { width: 32px; height: 32px; }
    .hxg-player-avatar-btn { grid-template-columns: 34px; }
    .hxg-heartbeat-dot { top: 22px; }
    .hxg-emoji-grid { max-height: 130px; }
}

@media (max-width: 360px) {
    .hxg-game-header { grid-template-columns: 38px minmax(0, 1fr) 38px; padding-left: 8px; padding-right: 8px; }
    .hxg-game-participants { gap: 5px; }
    .hxg-player-avatar-btn small { max-width: 56px; }
    .hxg-head-score { min-width: 60px; padding: 2px 7px; }
    .hxg-head-score-line b { font-size: 14px; }
    .hxg-chat-controls { grid-template-columns: 36px minmax(0, 1fr) 45px 45px; gap: 4px; padding-left: 7px; padding-right: 7px; }
    .hxg-chat-emoji { width: 36px; height: 36px; }
    .hxg-chat-emoji span { font-size: 15px; }
    .hxg-chat-input, .hxg-chat-send, .hxg-chat-receive { height: 38px; }
    .hxg-chat-send, .hxg-chat-receive { font-size: 11px; }
    .hxg-emoji-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .hxg-heartbeat-card { width: 191px; }
}

@media (prefers-reduced-motion: reduce) {
    .hxg-heartbeat-dot,
    .hxg-hb-loading i { animation: none !important; }
}

/* 第三阶段 · 消息长按互动菜单、编辑、引用、多选转发与 TA 转发设置 */

/* 长按呼出菜单需要禁掉系统文字选取与 iOS 长按弹窗 */
.hxg-chat-list .hxg-chat-message,
.hxg-chat-list .hxg-action-message {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.hxg-msg-menu-mask,
.hxg-edit-mask {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(70, 50, 32, 0.32);
    backdrop-filter: blur(2px);
}

.hxg-msg-menu {
    width: min(320px, 92%);
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 18px;
    background: var(--hxg-paper);
    box-shadow: 0 14px 34px rgba(70, 50, 32, 0.24);
    overflow: hidden;
}

.hxg-msg-menu-preview {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-bottom: 1px dashed rgba(139, 115, 85, 0.22);
    background: rgba(245, 215, 95, 0.10);
}

.hxg-msg-menu-preview small { color: var(--hxg-berry); font-size: 9px; font-weight: 800; }
.hxg-msg-menu-preview span { color: rgba(111, 91, 68, 0.78); font-size: 10px; line-height: 1.5; word-break: break-word; }

.hxg-msg-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hxg-msg-menu-grid button {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 11px 6px 9px;
    border: 0;
    border-right: 1px solid rgba(139, 115, 85, 0.10);
    border-bottom: 1px solid rgba(139, 115, 85, 0.10);
    background: transparent;
    color: var(--hxg-ink);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-msg-menu-grid button:nth-child(3n) { border-right: 0; }
.hxg-msg-menu-grid button:active { background: rgba(90, 143, 90, 0.10); }
.hxg-msg-menu-grid button i { color: var(--hxg-leaf-dark); font-style: normal; font-size: 16px; line-height: 1.1; }
.hxg-msg-menu-grid button b { font-size: 12px; }
.hxg-msg-menu-grid button small { color: rgba(111, 91, 68, 0.55); font-size: 8px; line-height: 1.3; text-align: center; }

/* 编辑弹窗 */
.hxg-edit-sheet {
    width: min(340px, 94%);
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px 14px 14px;
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 18px;
    background: var(--hxg-paper);
    box-shadow: 0 14px 34px rgba(70, 50, 32, 0.24);
    box-sizing: border-box;
}

.hxg-edit-head { display: flex; align-items: center; justify-content: space-between; }
.hxg-edit-head strong { color: var(--hxg-ink); font-size: 14px; }
.hxg-edit-head button { width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(139, 115, 85, 0.10); color: var(--hxg-ink-soft); font: inherit; font-size: 15px; cursor: pointer; }

.hxg-edit-format {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(139, 115, 85, 0.08);
}

.hxg-edit-format button {
    padding: 7px 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--hxg-ink-soft);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-edit-format button.is-active {
    border-color: rgba(90, 143, 90, 0.36);
    background: var(--hxg-cream);
    color: var(--hxg-leaf-dark);
    font-weight: 800;
}

.hxg-edit-text {
    width: 100%;
    min-height: 74px;
    padding: 9px 11px;
    box-sizing: border-box;
    border: 1px solid rgba(139, 115, 85, 0.24);
    border-radius: 12px;
    outline: 0;
    background: var(--hxg-cream);
    color: var(--hxg-ink);
    font: inherit;
    font-size: 12px;
    line-height: 1.55;
    resize: vertical;
}

.hxg-edit-text:focus { border-color: rgba(90, 143, 90, 0.44); }
.hxg-edit-hint { margin: 0; color: rgba(111, 91, 68, 0.60); font-size: 9px; line-height: 1.5; }
.hxg-edit-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.hxg-edit-foot button { min-height: 38px; border-radius: 999px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }

/* 语音格式气泡 */
.hxg-voice-bubble {
    display: flex !important;
    align-items: center;
    gap: 7px;
    min-width: 96px;
    cursor: pointer;
}

.hxg-voice-bubble i {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(90, 143, 90, 0.16);
    color: var(--hxg-leaf-dark);
    font-style: normal;
    font-size: 10px;
}

.hxg-voice-bubble span { min-width: 0; word-break: break-word; }
.hxg-voice-bubble small { flex: 0 0 auto; margin: 0 !important; color: rgba(111, 91, 68, 0.50) !important; font-size: 8px !important; }

/* 引用：气泡内引用块与输入栏引用条 */
.hxg-quote-block {
    display: block;
    margin: 0 0 4px;
    padding: 5px 8px;
    border-left: 2px solid rgba(139, 74, 90, 0.42);
    border-radius: 4px 10px 10px 4px;
    background: rgba(139, 115, 85, 0.09);
    color: rgba(111, 91, 68, 0.72) !important;
    font-size: 9px !important;
    line-height: 1.5;
    text-align: left;
    word-break: break-word;
}

.hxg-quote-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px;
    padding: 6px 10px;
    border: 1px dashed rgba(139, 74, 90, 0.30);
    border-radius: 11px;
    background: rgba(212, 160, 160, 0.12);
}

.hxg-quote-bar span {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: rgba(111, 91, 68, 0.78);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hxg-quote-bar button {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: rgba(139, 74, 90, 0.14);
    color: var(--hxg-berry);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

/* 多选模式 */
.hxg-chat-message.is-unselected,
.hxg-action-message.is-unselected { opacity: 0.78; }

.hxg-chat-message.is-selected p,
.hxg-chat-message.is-selected .hxg-emoji-bubble {
    border-color: rgba(90, 143, 90, 0.55);
    box-shadow: 0 0 0 2px rgba(90, 143, 90, 0.22);
}

.hxg-action-message.is-selected { color: var(--hxg-leaf-dark); }

.hxg-select-tick {
    flex: 0 0 auto;
    align-self: center;
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    border: 1.5px solid rgba(139, 115, 85, 0.36);
    border-radius: 50%;
    background: var(--hxg-cream);
    color: #fffaf2;
    font-size: 10px;
    line-height: 1;
}

.hxg-select-tick.is-on {
    border-color: var(--hxg-leaf);
    background: var(--hxg-leaf);
}

.hxg-multi-bar { position: relative; padding: 9px 12px calc(9px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))); }

.hxg-multi-bar-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.hxg-multi-bar-row button {
    min-height: 38px;
    padding: 0 15px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-multi-bar-row button:disabled { opacity: 0.45; cursor: not-allowed; }
.hxg-multi-cancel { border: 1px solid rgba(139, 115, 85, 0.28); background: var(--hxg-cream); color: var(--hxg-ink-soft); }
.hxg-multi-count { min-width: 0; overflow: hidden; color: rgba(111, 91, 68, 0.70); font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.hxg-multi-forward { border: 1px solid rgba(90, 143, 90, 0.40); background: rgba(90, 143, 90, 0.14); color: var(--hxg-leaf-dark); }
.hxg-multi-forward[aria-expanded="true"] { background: var(--hxg-leaf); color: #fffaf2; }
.hxg-multi-delete { border: 1px solid rgba(139, 74, 90, 0.34); background: rgba(139, 74, 90, 0.10); color: var(--hxg-berry); }

.hxg-forward-menu {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 6px);
    z-index: 6;
    display: flex;
    flex-direction: column;
    width: min(250px, 80vw);
    border: 1px solid rgba(139, 115, 85, 0.22);
    border-radius: 14px;
    background: var(--hxg-paper);
    box-shadow: 0 12px 28px rgba(70, 50, 32, 0.22);
    overflow: hidden;
}

.hxg-forward-menu button {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 13px;
    border: 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.10);
    background: transparent;
    text-align: left;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hxg-forward-menu button:last-child { border-bottom: 0; }
.hxg-forward-menu button:active { background: rgba(90, 143, 90, 0.10); }
.hxg-forward-menu button b { color: var(--hxg-ink); font-size: 12px; }
.hxg-forward-menu button small { color: rgba(111, 91, 68, 0.58); font-size: 9px; line-height: 1.4; }

/* 聊天设置 · 允许 TA 转发的目标下拉区 */
.hxg-share-targets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 11px;
    padding: 5px 10px;
    border: 1px dashed rgba(139, 115, 85, 0.24);
    border-radius: 13px;
    background: rgba(245, 215, 95, 0.07);
}

.hxg-share-target-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 39px;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed rgba(139, 115, 85, 0.14);
    cursor: pointer;
}

.hxg-share-target-row:last-child { border-bottom: 0; }
.hxg-share-target-row > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hxg-share-target-row strong { color: var(--hxg-ink); font-size: 12px; }
.hxg-share-target-row small { color: rgba(111, 91, 68, 0.58); font-size: 9px; line-height: 1.4; }
.hxg-share-target-row input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.hxg-share-target-row i { position: relative; width: 39px; height: 22px; border-radius: 999px; background: rgba(139, 115, 85, 0.22); transition: background 0.18s ease; }
.hxg-share-target-row i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fffaf2; box-shadow: 0 2px 5px rgba(70, 50, 32, 0.20); transition: transform 0.18s ease; }
.hxg-share-target-row input:checked + i { background: var(--hxg-leaf); }
.hxg-share-target-row input:checked + i::after { transform: translateX(17px); }

@media (max-width: 360px) {
    .hxg-msg-menu-grid button b { font-size: 11px; }
    .hxg-multi-bar-row button { padding: 0 11px; font-size: 11px; }
}
