* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: PingFangSC-Medium, PingFang SC;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto !important;
    flex-direction: column;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: auto !important;
    /* 关键：允许所有方向的手势/鼠标动作，防止被 JS 拦截 */
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

#app {
    width: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    height: 60px;
    min-height: 60px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.8); /* 半透明 */
    backdrop-filter: blur(10px);         /* 👈 毛玻璃 */
    -webkit-backdrop-filter: blur(10px); /* Safari 兼容 */

    z-index: 1000;
}

.header-logo {
    justify-content: center;
    align-items: center;
    display: flex;
    padding: 10px 20px;
    color: #494949;
}

.main-content {
    flex: 1; /* This allows the content to expand and fill available space */
    display: flex;
    overflow-y: auto;
    margin-top: 60px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.main-content h1 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #525252;
}

.main-content .main-logo {
    justify-content: center;
    align-items: center;
    display: flex;
    height: 100px;
    color: #494949;
    font-size: 30px;
    margin-bottom: 30px;
    margin-top: 30px;
}

.code-container {
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.url-container {
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.url-container .url-input {
    width: 47%;
    height: 60px;
    padding: 0 20px;
    margin-bottom: 40px;
    font-size: 16px;
    border: 2px solid #52aa6c;
    border-radius: 15px;
}

.url-container input:focus {
  outline: none;        /* 确保聚焦时也无轮廓 */
  box-shadow: none; /* 去除阴影效果 (Bootstrap 等框架常用) */
  border-color: #52aa6c;/* 可选：设置一个默认的边框颜色 */
}

.url-container .btn-container{
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
    height: 90px;
    line-height: 90px;
    display: flex;
    flex-wrap: wrap; 
    gap: 10px;
    justify-content: center;
}

.url-container .gen-code-btn {
    width: 280px;
    height: 60px;
    font-size: 22px;
}

.url-container .upload-btn {
    width: 450px;
    height: 60px;
    font-size: 22px;
    background-color: white;
    border: 2px solid #33913d;
    color: #43a14d;
}


.url-result {
    font-size: 18px;
    width: 100%;
    height: 100%;
}

.url-result .code {
    font-weight: bold;
    font-size: 24px;
    color: #56b55f;
}

.url-result .code .code-item{
    flex-direction: row;
    display: inline-flex;
    width: 80px;
    height: 80px;
    background: linear-gradient( #4db758, #24682b);
    color: white;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    font-size: 36px;
    margin: 0 5px;
}

.url-result .code .code-item:not(.graystyle) {
    background: #3AA73E;
    color: #fff;
    border-color: #3AA73E;
    animation: pulse 2s infinite;
}
    
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(58, 167, 62, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(58, 167, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(58, 167, 62, 0); }
}

.url-result .notify {
    line-height: 40px;
    height: 40px;
    margin: 30px 0;
    color: red;
    font-size: 16px;
    justify-content: center;
    align-items: center;
    display: flex;
}

.url-result .notify img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.url-result .btn-container {
    margin: 30px 30px;
    height: 60px;
    justify-content: between;
    align-items: center;
}

.url-result .btn-container button {
    height: 50px;
    width: 160px !important;
    background-color: #56b55f;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 23px;
    cursor: pointer;
    margin-left: 30px;
}

.url-result .btn-container .back-home-btn {
    background-color: #c2dbc4 !important;
    color: #327439 !important;
}

/* 用例容器开始 */
.use-container {
  max-width: 1200px;
  margin: 0 auto;
  color: #494949;
  padding: clamp(16px, 2vw, 40px);
}

/* 标题 */
.use-container .title {
  align-self: flex-start;
  font-size: clamp(20px, 3vw, 32px);
  margin-bottom: 10px;
}

/* 卡片布局 */
.use-container .card-list {
  display: flex;
  gap: 34px;
  flex-direction:row;
  flex-wrap: wrap;
}

/* 单个卡片 */
.use-container .card {
  min-width: 260px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin: auto;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  overflow: hidden;
  text-align: center;  
}

.use-container .card:focus {
  outline: none;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px #4da3ff;
}

/* 图片区域 */
.use-container .media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

/* 图片 */
.use-container .media img {
  width: 100%;
  display: block;
  transition: transform 0.4s ease;
}


/* 播放按钮 */
.use-container .play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  transition: transform 0.35s ease, background 0.3s;
  cursor: pointer;
}

/* 三角形 */
.use-container .play-btn::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 18px;
  border-left: 18px solid #000;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

/* 文字 */
.use-container .text {
  margin-top: 12px;
  font-size: clamp(14px, 2vw, 18px);
  color: #555;
  text-align: center;
}
/** 用例容器结束 **/

/* 播放器开始 */
/* 播放器遮罩 */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  touch-action: none;
  z-index: 999;
}

/* 关键：定位参照物 */
.player-container {
  position: relative;
  top: 40px;
  width: min(90vw, 90vh * 16 / 9);
  height: min(70vh, 90vw * 9 / 16);
  max-width: 1200px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}


.player-container video, 
.player-container iframe {
  width: 100% !important;
  height: 100% !important;
  max-height: 80vh;
  border-radius: 12px;
  /* aspect-ratio: 16 / 9; */
  display: block;
}

.player-close-btn {
  position: absolute;
  top: 10px;
  right: -40px;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.player-close-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px #fff;
}

.player-close-btn:hover {
  background: rgba(0,0,0,0.8);
  transform: scale(1.1);
}

/* 移动端点击反馈 */
.player-close-btn:active {
  transform: scale(0.95);
}
/* 播放器结束 */

.footer {
  max-width: 1100px;
  margin: 0 auto;
}

.footer .install-instruction {
    font-size: 20px;
    color: #6c6c6c;
    margin-bottom: 40px;

    text-align: left;
}

.footer .policy {
    color: #888;
    font-size: 14px;
    margin-bottom: 20px;
}
    
.footer .policy a {
    color: #888;
    text-decoration: none;
}

.footer .policy a:hover {
    text-decoration: underline;
}

button {
    height: 60px;
    width: 250px;
    background-color: #3AA73D;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-size: 23px;
    cursor: pointer;
    margin-left: 10px;
}

button:hover {
    background-color: #4a9a4d;
    box-shadow: rgba(92, 172, 110, 0.4) 3px 5px 5px;
    top: -9px;
}

/* ====== Hover 效果（桌面端） ====== */
@media (hover: hover) {
  .use-container .card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  }

  .use-container .card:hover img {
    transform: scale(1.1);
  }

  .use-container .card:hover .play-btn {
    transform: translate(-50%, -50%) scale(1.2);
    background: rgba(255,255,255,1);
  }
}

/* ====== 移动端优化 ====== */
@media (hover: none) {
  .use-container .card-list {
    gap: 10px;
    display: grid;
  }

  .use-container .card {
    min-width: 330px;
  }

  .use-container .card:hover {
    transform: none;
  }

  .use-container .card:active {
    border-radius: 16px;
    border: #cec0c0 solid 1px;
    transform: scale(0.97);
  }

  .use-container .card:active .play-btn {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* TV / 大屏 */
@media screen and (min-width: 960px) {
  .main-content .main-logo {
    margin-top: 20px;
    margin-bottom: 10px;
  }
}

@media screen and (max-width: 768px) {
  .use-container .card {
    width: 100px;
  }

  /* 播放器容器 */
  .player-overlay video, 
  .player-overlay iframe {
    width: 80vw;
    height: 35vw;
    max-width: 1200px;
    max-height: 675px;
  }

  .player-close-btn {
    width: 38px;
    height: 38px;
    top: calc(-20px + env(safe-area-inset-top));
    right: calc(-10px + env(safe-area-inset-right));
  }

  .use-container .title {
    margin-top: 30px;
  }
}

@media screen and (max-width: 600px) {
  .url-result .btn-container button {
      height: 50px;
      width: 120px !important;
      background-color: #56b55f;
      color: white;
      padding: 10px 10px;
      border: none;
      border-radius: 25px;
      font-size: 18px;
      cursor: pointer;
      margin: 0 auto;
  }

  .url-result .code .code-item{
      width: 60px;
      height: 60px;
  }

  .url-result .notify span {
      font-size: 14px;
  }

  .url-container .url-input {
      width: 97%;
      height: 60px;
      padding: 0 20px;
      margin-bottom: 40px;
      font-size: 16px;
      border: 2px solid #52aa6c;
      border-radius: 15px;
  }

  .url-container .gen-code-btn {
      width: 160px;
      height: 50px;
      font-size: 20px;
  }

  .url-container .upload-btn {
    font-size: 16px;
  }

  .player-close-btn {
    width: 38px;
    height: 38px;
    top: calc(120px + env(safe-area-inset-top));
    right: calc(20px + env(safe-area-inset-right));
  }

  .use-container .title {
    margin-top: 20px;
  }
}

/* ====== 小屏适配 ====== */
@media (max-width: 480px) {
  .use-container .play-btn {
    width: 50px;
    height: 50px;
  }

  .use-container .play-btn::before {
    left: 18px;
    top: 15px;
    border-left: 14px solid #000;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
  }

  .use-container .title {
    font-size: 18px;
  }

  .player-container {
    width: min(90vw, 90vh * 16 / 9);
    height: max(90vh, 90vw * 9 / 16);
  }

  .player-container video, 
  .player-container iframe {
    height: 40%;
    max-height: 30vh;
    max-width: 1200px;
  }

  .player-close-btn {
    width: 40px;
    height: 40px;
    top: calc(150px + env(safe-area-inset-top));
    right: calc(-10px + env(safe-area-inset-right));
  }
}