/* 全站布局：固定视口 1024×720，与阿里人脸共用深色星空底图 */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #050a18;
  color: #ffffff;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100%;
  box-sizing: border-box;
  overflow: auto;
}

.app {
  --app-bg-color: #050a18;
  --app-bg-image: url("../img/face/jiqiai-beijing.png");
  width: 1024px;
  height: 750px;
  box-sizing: border-box;
  padding: 0;
  flex-shrink: 0;
  background-color: var(--app-bg-color);
  background-image: var(--app-bg-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  color: #ffffff;
  overflow: hidden;
  /* border: 1px solid rgba(120, 160, 220, 0.35); */
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 全站文案：禁止长按选中、拖选（含按钮内文字、提示、识别结果等） */
.app *,
.app *::before,
.app *::after {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.app ::selection {
  background: transparent;
}

/* 当前页在 1024×720 内占满；内容过高时仅在本页内滚动 */
.app > .view:not([hidden]) {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* 语音识别 / 智能语音：固定像素布局，禁止整页滚动条把布局“挤”出视口 */
.app > .view.view-speech:not([hidden]),
.app > .view.view-smart-voice:not([hidden]),
.app > .view.view-image:not([hidden]),
.app > .view.view-doodle:not([hidden]) {
  overflow: hidden;
}

/*
 * Android / WebView：<video> 在未 play 前会闪默认播放三角，H5 侧隐藏控件并在播放后再显示
 */
.app video {
  object-fit: contain;
}

.app video::-webkit-media-controls {
  display: none !important;
}

.app video::-webkit-media-controls-enclosure {
  display: none !important;
}

.app video::-webkit-media-controls-overlay-play-button {
  display: none !important;
}

.app video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.app video::-webkit-media-controls-panel {
  display: none !important;
}

/*
 * 全站按钮：去除 Android/WebView 默认点击高亮、焦点环、焦点底色
 * （参考 abg网页ppt/index.html 的 nav-btn / page-indicator 方案）
 */
.app button {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.app button:focus,
.app button:focus-visible,
.app button:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

/* 切图/透明底按钮：聚焦时不出现系统灰块 */
.app button:not(.home-tile):focus,
.app button:not(.home-tile):focus-visible {
  background-color: transparent !important;
}

/* 各功能页通用：返回 */
.view {
  min-height: 0;
}

.view[hidden] {
  display: none !important;
}

.back-link {
  display: inline-block;
  margin: 16px 0 16px 24px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  flex-shrink: 0;
}

.back-link:hover {
  opacity: 0.75;
}

/* 非人脸详情页：标题与说明在深色底图上用浅色字（内容区卡片仍保持原浅色样式） */
.view-doodle .dh-tip-text,
.view-doodle .dh-bottom-text {
  color: #ffffff;
}

/* 一级首页：208×226 卡片；左 48 / 右 47 / 顶 120；行间距 49 */
.view-home {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 120px 47px 0 48px;
  overflow: hidden;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 208px);
  column-gap: calc((100% - 832px) / 3);
  row-gap: 49px;
  width: 100%;
  box-sizing: border-box;
}

.home-tile {
  position: relative;
  width: 208px;
  height: 226px;
  margin: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 208px 226px;
  -webkit-tap-highlight-color: transparent;
}

.home-tile:focus-visible {
  outline: 2px solid rgba(120, 200, 255, 0.95);
  outline-offset: 3px;
}

.home-tile:hover {
  filter: brightness(1.06);
}

.home-tile:active {
  filter: brightness(0.96);
}

.home-tile--speech {
  background-image: url("../img/tab/jiqiai-yuyin.png");
}

.home-tile--smart-voice {
  background-image: url("../img/tab/jiqiai-zhinengyuyin.png");
}

.home-tile--image {
  background-image: url("../img/tab/jiqiai-tupianshibie.png");
}

.home-tile--doodle {
  background-image: url("../img/tab/jiqiai-huihuashibie.png");
}

.home-tile--face {
  background-image: url("../img/tab/jiqiai-renlianbidui.png");
}

.home-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 17px;
  margin: 0;
  font-weight: 500;
  font-size: 30px;
  line-height: 1.2;
  color: #ffffff;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

/* 占位详情页 */
.placeholder-body {
  text-align: center;
  padding: 48px 24px;
  font-size: 16px;
  line-height: 1.6;
}

.placeholder-body p {
  margin: 0;
}

code {
  font-size: 12px;
  background: #eeeeee;
  color: #000000;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #000000;
}

a {
  color: #000000;
  text-decoration: underline;
}
