/* ============================================================
   聊天页里的二级界面 —— 同 API 页的黑白毛玻璃
   覆盖：我 / 钱包 / 面具编辑 / 底部面板（资料、亲情卡、群聊、剧情道具、趣味礼物）/
   + 号功能面板 / 礼物页 / 红包转账页 / 音乐搜索 / 发表朋友圈 / 看大图。
   加载顺序在 chat.css、chat-glass.css、chat-music.css 之后；删掉这行 link 即可还原。
   规则跟 api.css 一致：容器半透明白 + backdrop-filter，控件胶囊，重要按钮黑色像素切角。
   ============================================================ */

.chat-phone {
  --glass-sunken: rgb(255 255 255 / 26%);
  --glass-panel: rgb(255 255 255 / 70%);
  --glass-ctrl-blur: saturate(150%) brightness(1.1) blur(14px);
  --lift-lg: 0 2px 4px rgb(23 23 26 / 4%), 0 18px 40px -14px rgb(23 23 26 / 16%);
  --pixel-cut: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)
  );
  --pixel-scan: repeating-linear-gradient(0deg, transparent 0 2px, rgb(255 255 255 / 5%) 2px 3px);
  --wallpaper: var(--page-wallpaper, url("参考图/默认背景图背景图.jpg"));
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2317171a' stroke-opacity='.62' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.chat-phone.theme-night {
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23f2f2f4' stroke-opacity='.68' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------- 1. 全屏二级页铺壁纸（同 API 页），玻璃才有东西可折射 ---------- */
.chat-phone :is(.me-view, .wallet-view, .mask-view, .mask-editor, .gift-view, .money-view, .moment-composer) {
  background-color: #e9e9eb;
  background-image: var(--wallpaper);
  background-size: cover;
  background-position: center;
}
.chat-phone.theme-night :is(.me-view, .wallet-view, .mask-view, .mask-editor, .gift-view, .money-view, .moment-composer) {
  background-color: #111113;
  background-image: linear-gradient(rgb(12 12 14 / 62%), rgb(12 12 14 / 62%)), var(--wallpaper);
}

/* 黑色像素主按钮：同 .save-api */
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) .profile-save,
.chat-phone .money-submit,
.chat-phone .moment-composer-submit,
.chat-phone .moment-picker-done {
  border: 0;
  border-radius: 0;
  color: #fff;
  background: var(--ink);
  background-image: var(--pixel-scan);
  clip-path: var(--pixel-cut);
  box-shadow: none;
  filter: drop-shadow(4px 4px 0 rgb(23 23 26 / 26%)) drop-shadow(0 8px 18px rgb(23 23 26 / 18%));
  font-weight: 600;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: transform .1s ease, filter .1s ease;
}
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) .profile-save:active,
.chat-phone .money-submit:active,
.chat-phone .moment-composer-submit:active,
.chat-phone .moment-picker-done:active {
  transform: translate(4px, 4px);
  filter: drop-shadow(0 0 0 transparent) drop-shadow(0 2px 6px rgb(23 23 26 / 20%));
}
.chat-phone.theme-night :is(.profile-sheet .profile-save, .mask-sheet .profile-save, .mask-editor .profile-save, .money-submit, .moment-composer-submit, .moment-picker-done) {
  color: #17171a;
  background-color: #f2f2f4;
  filter: drop-shadow(4px 4px 0 rgb(0 0 0 / 40%));
}

/* ---------- 2. 底部面板 ---------- */
.chat-phone :is(.profile-sheet, .mask-sheet) {
  background: rgb(23 23 26 / 18%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.chat-phone :is(.profile-sheet-panel, .mask-sheet-panel) {
  max-height: 86%;
  padding: 22px 20px calc(24px + var(--safe-bottom));
  border-radius: var(--r-card, 28px) var(--r-card, 28px) 0 0;
  color: var(--ink);
  background: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), 0 -18px 40px -16px rgb(23 23 26 / 22%);
  scrollbar-width: none;
}
.chat-phone :is(.profile-sheet-panel, .mask-sheet-panel)::-webkit-scrollbar { display: none; }
.chat-phone :is(.profile-sheet, .mask-sheet) header { margin-bottom: 16px; }
.chat-phone :is(.profile-sheet, .mask-sheet) h2 { color: var(--ink); font-size: 19px; font-weight: 620; letter-spacing: -.2px; }
/* 关闭钮：36px 圆形玻璃钮（同 .api-back） */
.chat-phone :is(.profile-sheet, .mask-sheet) header button {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 0 0 2px;
  border: 0; border-radius: 999px;
  color: var(--ink-2);
  background: var(--glass-strong);
  box-shadow: var(--edge), var(--lift);
  font: 300 23px/1 Arial, sans-serif;
  cursor: pointer;
}
.chat-phone .sheet-hint, .chat-phone .family-card-hint { color: var(--ink-3); font-size: 12.5px; line-height: 1.6; }
.chat-phone :is(.profile-sheet label, .mask-form, .sheet-label) { gap: 7px; margin-top: 14px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea) {
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  outline: 0;
  color: var(--ink);
  background-color: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-ctrl-blur);
  backdrop-filter: var(--glass-ctrl-blur);
  box-shadow: var(--edge), 0 1px 2px rgb(23 23 26 / 4%);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) textarea { min-height: 96px; padding: 13px 17px; border-radius: 22px; line-height: 1.6; }
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) :is(input, select, textarea):focus { box-shadow: inset 0 0 0 1.5px var(--ink-4), 0 0 0 4px rgb(23 23 26 / 6%); }
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) :is(input, textarea)::placeholder { color: var(--ink-4); }
.chat-phone :is(.profile-sheet, .mask-sheet, .mask-editor) .profile-save { width: 100%; height: 50px; margin-top: 22px; font-size: 15px; }

/* 次级按钮：玻璃 + 小像素切角（同 .soft-button） */
.chat-phone :is(.mask-sheet, .profile-sheet) :is(.upload-button, .family-card-upload button, .family-card-actions button, .group-settings-image),
.chat-phone .mask-avatar-editor button {
  min-height: 44px;
  display: grid; place-items: center;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  clip-path: var(--pixel-cut-sm);
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
}
.chat-phone :is(.mask-sheet, .profile-sheet) :is(.upload-button, .family-card-upload button, .family-card-actions button):active { background: var(--glass); }
.chat-phone .family-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.chat-phone .family-card-actions #disable-family-card { color: #a43d31; }

/* 亲情卡：卡面保留用户选的配色，只把圆角、阴影收进同一套系统 */
.chat-phone .physical-card { border-radius: 22px; box-shadow: inset 0 1px 0 rgb(255 255 255 / 30%), var(--lift-lg); }
.chat-phone .family-card-state { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
/* 「开通亲情卡」：凹进去的子卡片 + API 页的开关 */
.chat-phone .family-card-box {
  min-height: 70px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--r-sub, 22px);
  background: var(--glass-sunken);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 34%), inset 0 1px 0 0 rgb(255 255 255 / 55%);
}
.chat-phone .family-card-box strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.chat-phone .family-card-box small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.chat-phone .mask-sheet input[type="checkbox"],
.chat-phone .profile-sheet input[type="checkbox"],
.chat-phone .mask-editor input[type="checkbox"] {
  flex: 0 0 auto;
  position: relative;
  width: 52px; height: 31px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--glass-sunken);
  box-shadow: inset 0 0 0 1px rgb(23 23 26 / 8%), inset 0 1px 3px rgb(23 23 26 / 8%);
  cursor: pointer;
  transition: background .22s ease;
}
.chat-phone .mask-sheet input[type="checkbox"]::after,
.chat-phone .profile-sheet input[type="checkbox"]::after,
.chat-phone .mask-editor input[type="checkbox"]::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(23 23 26 / 22%);
  transition: transform .22s cubic-bezier(.32,.72,0,1);
}
.chat-phone :is(.mask-sheet, .profile-sheet, .mask-editor) input[type="checkbox"]:checked { background: var(--ink); box-shadow: none; }
.chat-phone :is(.mask-sheet, .profile-sheet, .mask-editor) input[type="checkbox"]:checked::after { transform: translateX(21px); }
.chat-phone.theme-night :is(.mask-sheet, .profile-sheet, .mask-editor) input[type="checkbox"]:checked::after { background: #17171a; }

/* 头像预览：去掉酒红 */
.chat-phone .profile-avatar-preview { border-radius: 18px; color: #fff; background: var(--ink); }

/* 面具编辑：字段标签同 API 卡片里的小标签，删除按钮同次级像素按钮 */
.chat-phone .mask-field { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.chat-phone .mask-avatar-editor { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--edge), var(--lift); }
.chat-phone .mask-delete-button {
  border-radius: 0;
  clip-path: var(--pixel-cut-sm);
  color: #a43d31;
  background: var(--glass-strong);
  box-shadow: none;
}

/* 夜间：面板与控件换深色玻璃 */
.chat-phone.theme-night :is(.profile-sheet, .mask-sheet, .chat-functions, .gift-view, .money-view, .moment-composer, .emoji-popover, .sticker-panel, .music-search-sheet) {
  --ink: #f2f2f4;
  --ink-2: rgb(242 242 244 / 68%);
  --ink-3: rgb(242 242 244 / 46%);
  --ink-4: rgb(242 242 244 / 28%);
  --glass: rgb(255 255 255 / 7%);
  --glass-strong: rgb(255 255 255 / 12%);
  --glass-sunken: rgb(255 255 255 / 5%);
  --glass-panel: rgb(30 30 34 / 72%);
  --edge: inset 0 0 0 1px rgb(255 255 255 / 10%), inset 0 1px 0 0 rgb(255 255 255 / 14%);
}
.chat-phone.theme-night .mask-editor { --glass-sunken: rgb(255 255 255 / 5%); }
.chat-phone.theme-night .profile-avatar-preview { color: #17171a; background: #f2f2f4; }

/* ---------- 3. + 号功能面板：一页固定 2×4，像素图标 ---------- */
.chat-phone .chat-functions {
  padding: 0;
  border-top: 0;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge);
}
.chat-phone .chat-function-track { inset: 16px 0 calc(30px + var(--safe-bottom)); }
/* 行高写死成「图标 + 标签」，不再用 1fr 去分一个可能不够高的面板（之前图标把标签压没了） */
.chat-phone .chat-function-page {
  grid-template-rows: repeat(2, auto);
  grid-auto-rows: 0;
  align-content: center;
  row-gap: 12px;
  column-gap: 10px;
  padding: 0 18px;
  overflow: hidden;
}
.chat-phone .chat-function-page button { display: grid; justify-items: center; gap: 6px; color: var(--ink-2); }
.chat-phone .function-icon {
  width: min(56px, 100%);
  margin: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  /* 面板本身是浅底，纯白玻璃叠上去会看不见格子，用一层淡墨色 */
  background: rgb(23 23 26 / 6%);
  clip-path: var(--pixel-cut);
  box-shadow: none;
}
.chat-phone.theme-night .function-icon { background: rgb(255 255 255 / 9%); }
.chat-phone .function-icon .pixel-icon { width: 50%; height: 50%; fill: currentColor; }
.chat-phone .chat-function-page button:active .function-icon { transform: translate(2px, 2px); color: #fff; background: var(--ink); background-image: var(--pixel-scan); }
.chat-phone .chat-function-page strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.chat-phone #meet-innervoice-toggle.active .function-icon { opacity: 1; color: #fff; background: var(--ink); background-image: var(--pixel-scan); }
.chat-phone .chat-function-dots { gap: 8px; }
.chat-phone .chat-function-dots button { width: 6px; height: 6px; background: var(--ink-4); }
.chat-phone .chat-function-dots button.active { width: 14px; background: var(--ink); }
.chat-phone.theme-night .chat-function-page button:active .function-icon,
.chat-phone.theme-night #meet-innervoice-toggle.active .function-icon { color: #17171a; background-color: #f2f2f4; }

/* 趣味礼物：三选一，像素图标 */
.chat-phone .trinket-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.chat-phone .trinket-choices button {
  display: grid; justify-items: center; gap: 8px;
  padding: 16px 6px 14px;
  border: 0;
  border-radius: var(--r-sub, 22px);
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: var(--edge), var(--lift);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.chat-phone .trinket-choices button:active { color: #fff; background: var(--ink); }
.chat-phone .trinket-icon { width: 34px; height: 34px; }
.chat-phone .trinket-icon .pixel-icon { width: 100%; height: 100%; fill: currentColor; }

/* 表情 / 表情包弹层 */
.chat-phone .emoji-popover, .chat-phone .sticker-panel {
  border: 0;
  border-radius: var(--r-sub, 22px);
  background: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift-lg);
}

/* ---------- 4. 礼物页 ---------- */
.chat-phone .gift-view { color: var(--ink); }
.chat-phone .gift-toolbar {
  position: sticky; top: 0; z-index: 2;
  height: calc(60px + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgb(255 255 255 / 60%), rgb(255 255 255 / 22%));
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%);
}
.chat-phone .gift-toolbar h2 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; }
.chat-phone :is(.gift-back, .money-view header button) {
  position: absolute; left: 14px; top: calc(var(--safe-top) + 12px);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  padding: 0 0 4px;
  border: 0; border-radius: 999px;
  color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
  font: 300 26px/1 Arial, sans-serif;
  cursor: pointer;
}
.chat-phone .gift-heading {
  min-height: 0;
  margin: 6px 16px 0;
  padding: 18px 20px;
  border-radius: var(--r-card, 28px);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift-lg);
}
.chat-phone .gift-heading h1 { margin: 0 0 6px; color: var(--ink); font-size: 21px; font-weight: 620; letter-spacing: -.2px; }
.chat-phone .gift-heading p { color: var(--ink-2); font-size: 13px; }
.chat-phone .gift-heading p strong { color: var(--ink); }
.chat-phone .gift-avatar { width: 52px; height: 52px; border-radius: 16px; color: #fff; background: var(--ink); font-size: 20px; }
.chat-phone .gift-search {
  height: 46px;
  margin: 14px 16px;
  padding: 0 18px;
  gap: 10px;
  border-radius: 999px;
  color: var(--ink-3);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-ctrl-blur);
  backdrop-filter: var(--glass-ctrl-blur);
  box-shadow: var(--edge);
}
.chat-phone .gift-search svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chat-phone .gift-search input { color: var(--ink); font-size: 16px; }
.chat-phone .gift-search input::placeholder { color: var(--ink-4); }
.chat-phone .gift-list { padding: 0 16px calc(30px + var(--safe-bottom)); }
.chat-phone .gift-list.is-empty::after { content: "没有找到这件礼物"; display: block; padding: 40px 0; color: var(--ink-3); font-size: 13px; text-align: center; }
.chat-phone .gift-item {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  margin: 0 0 12px;
  padding: 12px;
  border-radius: var(--r-sub, 22px);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
}
.chat-phone .gift-item[hidden] { display: none; }
.chat-phone .gift-item > img { width: 112px; height: 112px; border-radius: 16px; }
.chat-phone .gift-info { padding-top: 2px; }
.chat-phone .gift-info h2 { margin: 0 0 6px; color: var(--ink); font-size: 15px; font-weight: 600; }
.chat-phone .gift-info p { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.chat-phone .gift-bottom { justify-content: space-between; gap: 8px; }
.chat-phone .gift-bottom strong { color: var(--ink); font-size: 19px; font-weight: 650; }
.chat-phone .gift-bottom strong small { color: var(--ink-3); font-size: 11px; font-weight: 500; }
.chat-phone .gift-select {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  clip-path: var(--pixel-cut-sm);
  color: #fff;
  background: var(--ink);
  background-image: var(--pixel-scan);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.chat-phone.theme-night .gift-select, .chat-phone.theme-night .gift-avatar { color: #17171a; background-color: #f2f2f4; }
.chat-phone.theme-night .gift-toolbar { background: linear-gradient(180deg, rgb(20 20 24 / 60%), rgb(20 20 24 / 22%)); }

/* ---------- 5. 红包 / 转账 ---------- */
.chat-phone .money-view { color: var(--ink); }
.chat-phone .money-view header {
  position: relative;
  height: calc(60px + var(--safe-top));
  padding: var(--safe-top) 14px 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-phone .money-view header h1 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1; }
.chat-phone .money-view header span { display: none; }
.chat-phone .money-fields { margin: 12px 16px 0; gap: 12px; }
.chat-phone .money-fields label {
  min-height: 60px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-sub, 22px);
  color: var(--ink);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
  font-size: 15px;
}
.chat-phone .money-fields label b { font-weight: 600; }
.chat-phone .money-fields label input { color: var(--ink); background: transparent; font-size: 16px; }
.chat-phone .money-fields label input::placeholder { color: var(--ink-4); }
.chat-phone .money-fields label span { display: none; }
.chat-phone .money-total { margin-top: 56px; color: var(--ink-2); font-size: 26px; text-align: center; }
.chat-phone .money-total strong { color: var(--ink); font-size: 52px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chat-phone .money-submit { display: block; width: calc(100% - 32px); height: 50px; margin: 28px 16px 0; font-size: 15px; line-height: 50px; }
.chat-phone .money-foot { color: var(--ink-3); font-size: 12px; }

/* ---------- 6. 音乐搜索 ---------- */
.chat-phone .music-search-sheet {
  border: 0;
  border-radius: var(--r-card, 28px);
  color: var(--ink);
  background: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift-lg);
}
.chat-phone .music-search-sheet h2 { font-size: 19px; font-weight: 620; letter-spacing: -.2px; }
.chat-phone .music-search-sheet header small, .chat-phone .music-search-status, .chat-phone .music-search-sheet footer { color: var(--ink-3); }
.chat-phone .music-search-close { width: 36px; height: 36px; padding: 10px; border-radius: 999px; background: var(--glass-strong); box-shadow: var(--edge), var(--lift); }
.chat-phone .music-search-form input { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; color: var(--ink); background: var(--glass-strong); box-shadow: var(--edge); font-size: 16px; }
.chat-phone .music-search-form button { border-radius: 0; clip-path: var(--pixel-cut-sm); color: #fff; background: var(--ink); background-image: var(--pixel-scan); font-weight: 600; }
.chat-phone .music-search-result { border-bottom-color: rgb(23 23 26 / 6%); }
.chat-phone.theme-night .music-search-form button { color: #17171a; background-color: #f2f2f4; }

/* ---------- 7. 发表朋友圈（照微信的全屏编辑页） ---------- */
.chat-phone .moment-composer { position: absolute; inset: 0; z-index: 32; display: flex; flex-direction: column; color: var(--ink); }
.chat-phone .moment-composer[hidden] { display: none; }
.chat-phone .moment-composer-bar {
  position: relative;
  flex: 0 0 auto;
  height: calc(60px + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.chat-phone .moment-composer-bar h2 { position: absolute; left: 50%; bottom: 20px; margin: 0; transform: translateX(-50%); color: var(--ink); font-size: 17px; font-weight: 600; }
.chat-phone .moment-composer-cancel {
  height: 36px; padding: 0 16px;
  border: 0; border-radius: 999px;
  color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
  font-size: 15px;
  cursor: pointer;
}
.chat-phone .moment-composer-submit { height: 36px; padding: 0 18px; clip-path: var(--pixel-cut-sm); font-size: 14.5px; letter-spacing: 1px; }
.chat-phone .moment-composer-submit:disabled { opacity: .35; cursor: default; transform: none; }
.chat-phone .moment-composer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px calc(30px + var(--safe-bottom)); scrollbar-width: none; }
.chat-phone .moment-composer-body::-webkit-scrollbar { display: none; }
/* 正文 + 图片格放在同一张玻璃卡里，像微信那样连成一块 */
.chat-phone #moment-composer-text {
  display: block;
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 18px 18px 8px;
  border: 0;
  border-radius: var(--r-card, 28px) var(--r-card, 28px) 0 0;
  outline: 0;
  color: var(--ink);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: none;
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
}
.chat-phone #moment-composer-text::placeholder { color: var(--ink-4); }
.chat-phone .moment-composer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 8px 18px 18px;
  border-radius: 0 0 var(--r-card, 28px) var(--r-card, 28px);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--lift-lg);
}
.chat-phone .moment-composer-thumb, .chat-phone .moment-composer-add { position: relative; width: auto; height: auto; aspect-ratio: 1; overflow: hidden; border-radius: 10px; }
.chat-phone .moment-composer-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.chat-phone .moment-composer-thumb button { top: 4px; right: 4px; width: 22px; height: 22px; background: rgb(23 23 26 / 62%); font-size: 14px; }
.chat-phone .moment-composer-add {
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  clip-path: var(--pixel-cut);
  color: var(--ink-3);
  background: var(--glass-strong);
  cursor: pointer;
}
.chat-phone .moment-composer-add svg { width: 34%; height: 34%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.chat-phone .moment-composer-rows {
  margin-top: 16px;
  overflow: hidden;
  border-radius: var(--r-sub, 22px);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), var(--lift);
}
.chat-phone .moment-composer-row {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 22px auto minmax(0, 1fr) 10px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgb(23 23 26 / 6%);
  color: var(--ink);
  background: transparent;
  font-size: 15.5px;
  text-align: left;
  cursor: pointer;
}
.chat-phone .moment-composer-row:last-child { border-bottom: 0; }
.chat-phone .moment-composer-row:active { background: rgb(255 255 255 / 30%); }
.chat-phone .moment-composer-row svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.chat-phone .moment-composer-row em { min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 13.5px; font-style: normal; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.chat-phone .moment-composer-row i { width: 8px; height: 8px; transform: rotate(-45deg); border-right: 1.6px solid var(--ink-4); border-bottom: 1.6px solid var(--ink-4); }
.chat-phone .moment-composer-row.filled em { color: var(--ink); font-weight: 600; }
/* 选择面板：位置 / 提醒谁看 / 谁可以看 */
.chat-phone .moment-picker { position: absolute; inset: 0; z-index: 2; display: grid; align-items: end; background: rgb(23 23 26 / 18%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.chat-phone .moment-picker[hidden] { display: none; }
.chat-phone .moment-picker-panel {
  max-height: 78%;
  display: flex; flex-direction: column;
  border-radius: var(--r-card, 28px) var(--r-card, 28px) 0 0;
  background: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--edge), 0 -18px 40px -16px rgb(23 23 26 / 22%);
}
.chat-phone .moment-picker-panel header { position: relative; flex: 0 0 auto; height: 62px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.chat-phone .moment-picker-panel h3 { position: absolute; left: 50%; margin: 0; transform: translateX(-50%); color: var(--ink); font-size: 16px; font-weight: 600; }
.chat-phone #moment-picker-cancel { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; color: var(--ink); background: var(--glass-strong); box-shadow: var(--edge); font-size: 14px; cursor: pointer; }
.chat-phone .moment-picker-done { height: 34px; padding: 0 16px; clip-path: var(--pixel-cut-sm); font-size: 14px; letter-spacing: 1px; }
.chat-phone .moment-picker-body { min-height: 0; overflow-y: auto; padding: 0 16px calc(22px + var(--safe-bottom)); }
.chat-phone .moment-picker-label { margin: 16px 4px 8px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.chat-phone .moment-picker-empty { margin: 30px 0; color: var(--ink-3); font-size: 13px; text-align: center; }
.chat-phone .moment-picker-field { display: grid; gap: 7px; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.chat-phone .moment-picker-field input { width: 100%; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; outline: 0; color: var(--ink); background: var(--glass-strong); box-shadow: var(--edge); font: inherit; font-size: 16px; font-weight: 400; }
.chat-phone .moment-picker-field input::placeholder { color: var(--ink-4); }
.chat-phone .moment-picker-option {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 10px 18px;
  display: grid; gap: 2px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: var(--edge);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.chat-phone .moment-picker-option b { font-weight: 600; }
.chat-phone .moment-picker-option small { color: var(--ink-3); font-size: 12px; }
.chat-phone .moment-picker-option.active { color: #fff; background: var(--ink); background-image: var(--pixel-scan); border-radius: 0; clip-path: var(--pixel-cut-sm); box-shadow: none; }
.chat-phone .moment-picker-option.active small { color: rgb(255 255 255 / 62%); }
.chat-phone .moment-picker-people { display: grid; gap: 6px; }
.chat-phone .moment-picker-person {
  min-height: 54px;
  padding: 7px 14px 7px 8px;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; align-items: center; gap: 12px;
  border-radius: 18px;
  background: var(--glass-strong);
  box-shadow: var(--edge);
  cursor: pointer;
}
.chat-phone .moment-picker-person input { position: absolute; opacity: 0; pointer-events: none; }
.chat-phone .moment-picker-avatar { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: #fff; background: var(--ink); font-size: 15px; font-weight: 700; }
.chat-phone .moment-picker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-phone .moment-picker-person b { overflow: hidden; color: var(--ink); font-size: 15px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.chat-phone .moment-picker-person i { width: 22px; height: 22px; border-radius: 0; clip-path: var(--pixel-cut-sm); background: rgb(23 23 26 / 10%); }
.chat-phone .moment-picker-person input:checked ~ i { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 6.2 2.4 2.3 4.6-5' fill='none' stroke='%23fff' stroke-width='1.6'/%3E%3C/svg%3E") center / 14px no-repeat; }
.chat-phone.theme-night :is(.moment-picker-option.active, .moment-picker-avatar) { color: #17171a; background-color: #f2f2f4; }
.chat-phone.theme-night .moment-picker-person input:checked ~ i { background-color: #f2f2f4; }
.chat-phone.theme-night .moment-composer-row { border-bottom-color: rgb(255 255 255 / 8%); }

/* ---------- 8. 朋友圈 feed 里新增的几行 ---------- */
.moment-location { margin: 6px 0 0; color: var(--m-name); font-size: 13px; line-height: 1.4; }
.moment-mentions { margin: 4px 0 0; color: var(--m-muted); font-size: 13px; line-height: 1.4; }
.moment-visibility { display: inline-grid; place-items: center; color: var(--m-muted); }
.moment-visibility svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* 手动 / 后台模式还没生成的点赞评论：封面上的刷新钮，角标是待处理数量 */
.moments-refresh {
  position: absolute; z-index: 2; top: calc(10px + var(--safe-top)); right: 54px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  padding: 0; border: 0;
  color: #fff; background: transparent;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 35%));
  cursor: pointer;
}
.moments-refresh[hidden] { display: none; }
.moments-refresh svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.moments-refresh.spinning svg { animation: moments-spin 1s linear infinite; }
.moments-refresh b:not(:empty) { position: absolute; top: 6px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; color: #fff; background: #fa5151; font-size: 10px; font-weight: 700; line-height: 16px; }
@keyframes moments-spin { to { transform: rotate(360deg); } }

/* ---------- 9. 看大图：多图左右切换 ---------- */
.image-lightbox img { max-width: 100vw; border-radius: 0; touch-action: pan-y; }
.image-lightbox-close { width: 36px; height: 36px; top: calc(14px + var(--safe-top, 0px)); }
.image-lightbox-nav {
  position: fixed; top: 50%; z-index: 1;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 50%;
  color: #fff;
  background: rgb(20 18 19 / 52%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
  cursor: pointer;
}
.image-lightbox-nav[hidden], .image-lightbox-count[hidden] { display: none; }
.image-lightbox-nav.prev { left: 12px; }
.image-lightbox-nav.next { right: 12px; }
.image-lightbox-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.image-lightbox-count { position: fixed; left: 50%; bottom: calc(22px + var(--safe-bottom, 0px)); padding: 4px 12px; border-radius: 999px; color: #fff; background: rgb(20 18 19 / 52%); font-size: 13px; font-variant-numeric: tabular-nums; transform: translateX(-50%); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .chat-phone { --glass: rgb(255 255 255 / 86%); --glass-strong: rgb(255 255 255 / 94%); --glass-sunken: rgb(255 255 255 / 70%); --glass-panel: rgb(255 255 255 / 95%); }
}
