/* 仅 html.is-phone：真机（含平板）应用布局。电脑版选择器一律不动。 */

html.is-phone,
html.is-phone body {
  height: 100%;
  height: var(--app-h, 100dvh);
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: manipulation;
}
html.is-phone.is-ios,
html.is-phone.is-ios body {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
}
html.is-phone body {
  min-height: var(--app-h, 100dvh);
}

html.is-phone .layout {
  grid-template-columns: 1fr;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: var(--app-h, 100dvh);
  margin: 0;
  padding-top: env(safe-area-inset-top, 0px);
  overflow: hidden;
}
html.is-phone.is-ios .layout {
  top: var(--vv-top, 0px) !important;
  right: 0 !important;
  left: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  height: var(--app-h, 100dvh) !important;
  padding-top: 0;
}
html.is-phone .side-mask[hidden] { display: none !important; }
html.is-phone .side-mask:not([hidden]) { display: block; }
html.is-phone .sidebar {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(320px, 88vw);
  z-index: 20;
  transform: translateX(-105%);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow);
  height: var(--app-h, 100dvh);
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
html.is-phone .sidebar.open { transform: none; }
html.is-phone .main {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
html.is-phone .messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-bottom: 8px;
}
html.is-phone .composer {
  flex-shrink: 0;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
html.is-phone .composer-tools {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
html.is-phone .composer-tools::-webkit-scrollbar { display: none; }
html.is-phone .quick-bubbles-wrap { max-width: 100%; overflow: hidden; }
html.is-phone .icon-btn { display: inline-flex; }
html.is-phone .top {
  padding-top: 10px;
  padding-left: 12px;
  padding-right: 12px;
}
html.is-phone .top-title small { display: none; }
html.is-phone .model { max-width: min(120px, 34vw); font-size: 0.85rem; padding: 7px 8px; }
html.is-phone #modeSelect { max-width: min(88px, 24vw); }
html.is-phone .send-btn { padding: 10px 12px; font-size: 0.9rem; }
html.is-phone .bubble { max-width: 92%; font-size: 0.95rem; }
html.is-phone input,
html.is-phone select,
html.is-phone textarea {
  font-size: 16px !important;
}

html.is-phone .auth-gate {
  height: var(--app-h, 100dvh);
  max-height: var(--app-h, 100dvh);
  min-height: 0;
  padding:
    calc(1.25rem + env(safe-area-inset-top, 0px))
    1.25rem
    calc(1.25rem + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* —— 所有应用铺满，横屏也不走电脑双栏 —— */
html.is-phone .feature-panel {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
html.is-phone .feature-sheet,
html.is-phone .apps-sheet,
html.is-phone .note-sheet,
html.is-phone .remind-sheet,
html.is-phone .book-read-sheet,
html.is-phone .travel-sheet,
html.is-phone .photo-sheet,
html.is-phone .ocr-sheet,
html.is-phone .shop-sheet,
html.is-phone .buylist-sheet,
html.is-phone .browser-sheet,
html.is-phone #betaPanel .apps-sheet,
html.is-phone #writePanel .feature-sheet {
  width: 100% !important;
  max-width: none !important;
  height: var(--app-h, 100dvh) !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

html.is-phone .feature-head {
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  gap: 8px;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 6;
}
html.is-phone .feature-head strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.is-phone .feature-head .ghost,
html.is-phone .feature-head button {
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

html.is-phone .apps-sheet .apps-body,
html.is-phone .travel-sheet .apps-body,
html.is-phone .photo-sheet .apps-body,
html.is-phone .ocr-sheet .apps-body,
html.is-phone .shop-sheet .apps-body,
html.is-phone .buylist-sheet .apps-body {
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
html.is-phone #mapPanel .apps-body,
html.is-phone #photoPanel .apps-body,
html.is-phone #notePanel .apps-body,
html.is-phone #remindPanel .apps-body {
  overflow: hidden;
}
html.is-phone #bookReadPanel .book-split {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html.is-phone .apps-toolbar {
  flex-direction: column;
  align-items: stretch;
  padding: 8px 10px;
  gap: 8px;
}
html.is-phone .apps-toolbar input[type="text"],
html.is-phone .apps-toolbar input[type="search"],
html.is-phone .apps-toolbar input[type="number"],
html.is-phone .apps-toolbar input[type="time"] {
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}
html.is-phone .apps-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 10px;
  scrollbar-width: none;
}
html.is-phone .apps-chips::-webkit-scrollbar { display: none; }
html.is-phone .apps-chip,
html.is-phone .more-app,
html.is-phone .trv-trips button,
html.is-phone .trv-filt-row button,
html.is-phone .trv-tabs button,
html.is-phone .photo-bar button,
html.is-phone .ocr-toolbar button {
  flex: 0 0 auto;
  min-height: 44px;
}

html.is-phone .map-routebar {
  flex-direction: column;
}
html.is-phone .map-place {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
html.is-phone .map-routebar #mapGo {
  width: 100%;
  min-height: 44px;
}
html.is-phone .map-wrap {
  min-height: 0;
  flex: 1 1 auto;
}
html.is-phone .map-zooms {
  right: 10px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  top: auto;
}
html.is-phone .map-zooms button {
  width: 44px;
  height: 44px;
}

html.is-phone .note-body,
html.is-phone .remind-body {
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(132px, 30%) minmax(0, 1fr);
}
html.is-phone .note-side,
html.is-phone .remind-side {
  border-right: 0;
  max-height: 30vh;
  min-height: 132px;
}
html.is-phone .note-side {
  border-bottom: 1px solid rgba(122, 82, 48, 0.14);
}
html.is-phone .remind-side {
  border-bottom: 1px solid rgba(13, 148, 136, 0.16);
}

html.is-phone .jd-bar {
  flex-direction: column;
  align-items: stretch;
}
html.is-phone .jd-bar input,
html.is-phone .jd-bar button {
  width: 100%;
  min-height: 44px;
}
html.is-phone .jd-item {
  grid-template-columns: 36px 1fr auto auto;
}
html.is-phone .jd-buy { min-height: 44px; }

html.is-phone .photo-bar {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html.is-phone .photo-bar::-webkit-scrollbar { display: none; }
html.is-phone .photo-pane .ph-sl {
  flex-basis: 100%;
  max-width: none;
}
html.is-phone .photo-stage {
  flex: 1 1 auto;
  min-height: 36vh;
  margin: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
html.is-phone .ocr-stage {
  min-height: 28vh;
  max-height: none;
  flex: 1 1 auto;
}
html.is-phone #ocrText {
  min-height: 120px;
}

html.is-phone .trv-row { flex-wrap: wrap; }
html.is-phone .trv-city { flex: 1 1 calc(50% - 28px); min-height: 56px; }
html.is-phone .trv-swap { min-width: 44px; min-height: 44px; }
html.is-phone .trv-date { flex: 1 1 100%; }
html.is-phone .trv-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
html.is-phone .trv-sum { flex-direction: column; align-items: stretch; }
html.is-phone .trv-card { flex-wrap: wrap; }
html.is-phone .trv-search {
  margin: 8px 10px;
  padding: 12px;
}
html.is-phone .travel-sheet .apps-body {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

html.is-phone .book-split { flex-direction: column; }
html.is-phone .book-assist {
  max-width: none;
  border-left: 0;
  border-top: 1px solid rgba(14, 165, 233, 0.2);
  max-height: 36%;
}
html.is-phone .book-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  padding: 8px 10px 16px;
}
html.is-phone .book-read-bar { flex-wrap: wrap; }
html.is-phone .clock-timer { font-size: 2.4rem; padding: 16px 10px; }
html.is-phone .more-apps {
  grid-template-columns: 1fr 1fr;
  padding: 10px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

html.is-phone .layout.code-mode-on #codeIde {
  max-height: none;
  min-height: 0;
  flex: 1 1 52vh;
}
html.is-phone .code-ide-body { flex-direction: column; }
html.is-phone .code-ide-rail {
  width: 100%;
  max-height: 28vh;
  border-right: 0;
  border-bottom: 1px solid #333;
}
html.is-phone .code-ide-bar {
  flex-wrap: wrap;
  overflow-x: auto;
}
html.is-phone .code-ide-bar .code-key-path { display: none; }

html.is-phone .beta-body { flex-direction: column; }
html.is-phone .beta-side {
  width: 100%;
  max-height: 28vw;
  min-height: 88px;
  border-right: none;
  border-bottom: 1px solid rgba(14, 165, 233, 0.15);
}
html.is-phone .beta-room-list {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 8px 8px;
}
html.is-phone .beta-room-item {
  flex: 0 0 auto;
  width: auto;
  min-width: 110px;
  margin: 0;
  min-height: 44px;
}
html.is-phone .beta-drawer-sheet { width: 100%; max-width: 100%; }

html.is-phone #writePanel .write-assist-body {
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-phone dialog {
  width: calc(100% - 20px);
  max-width: calc(100% - 20px);
  margin: auto 10px;
}
html.is-phone .pay-qr { max-width: 220px; }

html.is-phone .apps-chip:hover,
html.is-phone .more-app:hover,
html.is-phone .note-new:hover {
  transform: none;
}

html.is-phone .assist-island {
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
}
html.is-phone .assist-pane .browser-tabs { display: flex; }
html.is-phone .assist-head {
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}


/* kmute-android-fix — 常见断版/溢出 */
html.is-phone .bubble,
html.is-phone .bubble .answer,
html.is-phone .bubble .bubble-text {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
html.is-phone .bubble pre,
html.is-phone .bubble code,
html.is-phone .answer pre,
html.is-phone .answer code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
  word-break: break-word;
}
html.is-phone .bubble img,
html.is-phone .bubble-attach-preview img,
html.is-phone .answer img {
  max-width: 100% !important;
  height: auto !important;
}
html.is-phone .bubble-file-card {
  width: 100%;
}
html.is-phone .top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  max-width: 100%;
  overflow: hidden;
}
html.is-phone .top-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
html.is-phone .top-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
html.is-phone .top-right,
html.is-phone .mode-seg {
  display: flex;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
html.is-phone .top-right::-webkit-scrollbar,
html.is-phone .mode-seg::-webkit-scrollbar { display: none; }
html.is-phone .composer-dock,
html.is-phone .compose-row {
  max-width: 100%;
  min-width: 0;
}
html.is-phone .input-slot,
html.is-phone .input-slot textarea {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
html.is-phone .model-orb-wrap,
html.is-phone .model-orb {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
html.is-phone .model-orb-menu {
  width: min(260px, calc(100vw - 24px));
  right: -4px;
}
html.is-phone .model-orb-menu.is-portaled {
  /* body portal + z-index 100000 above welcome; JS width from innerWidth (no 100vw grow) */
  right: auto !important;
  width: auto;
  max-width: none;
  z-index: 100000 !important;
}

html.is-phone .welcome-chips,
html.is-phone .welcome-empty {
  max-width: 100%;
  overflow-x: hidden;
}
html.is-phone .welcome-chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
html.is-phone .feature-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  max-width: 100%;
}
html.is-phone .feature-head strong {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.is-phone .apps-grid,
html.is-phone .feature-body,
html.is-phone .apps-sheet,
html.is-phone .feature-sheet {
  max-width: 100%;
  overflow-x: hidden;
}
html.is-phone .bubble-actions {
  gap: 8px;
}
html.is-phone .bubble-act {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.82rem;
}
html.is-phone table {
  max-width: 100%;
}
html.is-phone .chat-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
html.is-phone .chat-code-card { max-width: 100%; }
html.is-phone .chat-code-edit { min-height: 120px; font-size: 12px; }
html.is-phone .chat-code-frame { height: 240px; }

/* —— 真机紧凑：字、栏、按钮都缩小，功能不动。电脑选择器一律不写。 —— */
html.is-phone {
  --phone-fs: 14.5px;
}
html.is-phone,
html.is-phone body,
html.is-phone .layout,
html.is-phone .main,
html.is-phone .feature-panel,
html.is-phone .sidebar {
  max-width: 100%;
  overflow-x: hidden;
}
html.is-phone .more-apps {
  gap: 8px;
  padding: 8px 10px 12px;
}
html.is-phone .more-app {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.82rem;
}
html.is-phone .feature-head {
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
html.is-phone .feature-head strong { font-size: 0.92rem; }
html.is-phone .feature-head .ghost,
html.is-phone .feature-head button {
  min-width: 36px;
  min-height: 36px;
  padding: 5px 10px;
  font-size: 0.78rem;
}
html.is-phone input,
html.is-phone select,
html.is-phone textarea {
  font-size: 15px !important;
}
html.is-phone.is-ios input,
html.is-phone.is-ios select,
html.is-phone.is-ios textarea {
  font-size: 16px !important;
}

/* 泡泡修图：只压手机。电脑端原样。 */
html.is-phone .photo-sheet,
html.is-phone .photo-body {
  font-size: 0.78rem;
}
html.is-phone .photo-bar {
  gap: 4px;
  padding: 6px 8px 0;
}
html.is-phone .photo-bar button {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.76rem;
}
html.is-phone .photo-body > .apps-chips,
html.is-phone .photo-tools {
  padding: 4px 8px 6px;
  gap: 4px;
}
html.is-phone .photo-tools .apps-chip,
html.is-phone .photo-body > .apps-chips .apps-chip {
  min-height: 32px;
  padding: 4px 9px;
  font-size: 0.72rem;
}
html.is-phone .photo-pane {
  padding: 4px 8px 6px;
  gap: 6px;
  font-size: 0.72rem;
}
html.is-phone .photo-pane .ph-sl {
  flex: 1 1 100%;
  max-width: none;
  gap: 6px;
}
html.is-phone .photo-pane .ph-sl > span {
  min-width: 2em;
  font-size: 0.72rem;
}
html.is-phone .photo-pane .ph-sl input[type="range"] {
  min-width: 0;
  width: 100%;
}
html.is-phone .photo-pane .ph-sl > b { flex-basis: 2.4em; font-size: 0.7rem; }
html.is-phone .photo-pane .ph-cards .ph-card { width: 56px; padding: 3px; border-radius: 10px; }
html.is-phone .photo-pane .ph-cards .ph-card canvas { width: 48px; height: 48px; }
html.is-phone .photo-pane .ph-cards .ph-frame-card { width: 62px; }
html.is-phone .photo-pane .ph-cards .ph-frame-card canvas { width: 54px; height: 54px; }
html.is-phone .photo-pane .ph-cards .ph-font-card { min-width: 68px; padding: 5px 8px; }
html.is-phone .photo-pane .ph-cards .ph-font-card .ph-font-name { font-size: 0.92rem; }
html.is-phone .photo-pane .ph-row-end .mini,
html.is-phone .photo-pane .mini {
  font-size: 0.64rem;
  line-height: 1.35;
}
html.is-phone .photo-pane .ph-swatches .ph-sw { width: 22px; height: 22px; }
html.is-phone .photo-pane button,
html.is-phone .photo-ai button,
html.is-phone .photo-erase-modes .apps-chip {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 0.74rem;
}
html.is-phone .photo-stage {
  min-height: 28vh;
  margin: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  border-radius: 10px;
}
html.is-phone .photo-busy-card { padding: 16px 18px; width: min(300px, 88%); }
html.is-phone .photo-busy-label { font-size: 0.86rem; margin-bottom: 10px; }
html.is-phone #phEraseSizeWrap { min-width: 0; flex: 1 1 100%; }
html.is-phone #phEraseSizeWrap input { width: 100%; }

/* 其它应用：栏变窄、字变小、不挤出屏幕 */
html.is-phone .ocr-bar,
html.is-phone .jd-bar,
html.is-phone .apps-toolbar {
  gap: 6px;
  padding: 6px 8px 0;
}
html.is-phone .ocr-bar button,
html.is-phone .ocr-acts button {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.78rem;
}
html.is-phone .ocr-fine { margin: 4px 10px 0; font-size: 0.7rem; }
html.is-phone .ocr-stage { min-height: 22vh; margin: 6px 8px; }
html.is-phone #ocrText { min-height: 88px; font-size: 0.86rem !important; }
html.is-phone .trv-city { min-height: 48px; font-size: 0.82rem; }
html.is-phone .trv-card { font-size: 0.8rem; padding: 8px 10px; }
html.is-phone .book-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); padding: 6px 8px 12px; gap: 8px; }
html.is-phone .clock-timer { font-size: 2rem; padding: 12px 8px; }
html.is-phone .note-side,
html.is-phone .remind-side { min-height: 100px; max-height: 26vh; }
html.is-phone .map-zooms button { width: 38px; height: 38px; }
html.is-phone .popo-about-dlg {
  max-width: calc(100vw - 16px);
  width: calc(100vw - 16px);
  max-height: calc(var(--app-h, 100dvh) - 20px);
}
html.is-phone .popo-about-box {
  padding: 0.85rem 0.95rem;
  gap: 0.45rem;
  overflow: auto;
  max-height: calc(var(--app-h, 100dvh) - 28px);
}
html.is-phone .popo-about-box h2 { font-size: 1.02rem; }
html.is-phone .popo-about-box p,
html.is-phone .popo-about-box .sub { font-size: 0.78rem; }
html.is-phone .popo-about-box .voices button,
html.is-phone .popo-about-box .theme-picks button {
  padding: 8px;
  font-size: 0.72rem;
}
html.is-phone .popo-about-dl {
  width: 100%;
  margin-top: 4px;
}

/* 手机弹窗：少 3D / 少粒子，还是纸页滑入 */
html.is-phone .popo-wind-host { perspective: none; }
html.is-phone .popo-wind-host.popo-wind-in.feature-panel,
html.is-phone .popo-wind-host.popo-wind-out.feature-panel { animation: none !important; }
html.is-phone .popo-wind-host.popo-wind-in .popo-wind-paper,
html.is-phone dialog.popo-wind-in,
html.is-phone .popo-wind-host.popo-wind-in.popo-wind-self {
  animation: popoPaperInLite 0.42s cubic-bezier(.22,.8,.28,1) both !important;
}
html.is-phone .popo-wind-host.popo-wind-out .popo-wind-paper,
html.is-phone dialog.popo-wind-out,
html.is-phone .popo-wind-host.popo-wind-out.popo-wind-self {
  animation: popoPaperOutLite 0.32s ease both !important;
}
html.is-phone .popo-wind-paper::after,
html.is-phone dialog.popo-wind-in::after { display: none !important; }
@keyframes popoPaperInLite {
  0% { transform: translate3d(-36vw, 0, 0); opacity: 0; filter: none; }
  100% { transform: none; opacity: 1; filter: none; }
}
@keyframes popoPaperOutLite {
  0% { transform: none; opacity: 1; clip-path: none; filter: none; }
  100% { transform: translate3d(-18vw, 0, 0); opacity: 0; clip-path: none; filter: none; }
}
