/* ------------------ 全局样式 ------------------ */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  touch-action: pan-x pan-y;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: linear-gradient(135deg, rgb(214,238,250), rgb(180,222,250), rgb(240,248,255));
}
b {
  font-weight: 600;
  font-family: inherit;
}
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ------------------ 容器 ------------------ */
.container {
  position: relative;
  z-index: 998;
  width: 80vw;
  max-width: 500px;
  min-width: 280px;
  margin: 40px;
  padding: 25px;
  text-align: center;
  border-radius: 20px;
  border: 0px solid rgba(255,255,255,0.25);

  /* 毛玻璃效果 */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);

  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  color: #333;
  flex-shrink: 0;
}

/* ------------------ 标题 ------------------ */
h2 { margin-bottom: 10px; color: #333; }
.subtitle { font-size: 14px; color: #666; margin-bottom: 20px; }

/* ------------------ 输入区域 ------------------ */
.input-container {
  display: flex;
  width: 100%;
  position: relative;
  margin-bottom: 15px;
}

/* 左边引擎按钮 */
.engine-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  border: 0px solid rgba(255,255,255,0.25);
  border-right: none;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  z-index: 2;
}
.engine-wrapper img {
  width: 20px;
  height: 20px;
}

/* 输入框 */
input[type="url"] {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border-radius: 0 10px 10px 0;
  border: 0px solid rgba(255,255,255,0.25);
  border-left: none;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  outline: none;
  box-sizing: border-box;
  min-width: 0;
  color: #333;
  z-index: 2;
}

input[type="url"]::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------ 搜索引擎下拉菜单 ------------------ */
.engine-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 120px;
  border-radius: 12px;
  overflow: hidden;
  z-index: 100;

  /* 液态玻璃效果 */
  background: rgba(17,30,44, 1);  /* 半透明底色 */
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);

  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border: 0px solid rgba(255,255,255,0.15);
}

/* 下拉选项文字 */
.engine-dropdown div {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #333;  /* 确保文字可读 */
  transition: background 0.2s ease;
}

.engine-dropdown div:hover {
  background-color: rgba(242, 230, 215,0.08);  /* 轻微高光提示 */
}
/* ------------------ 按钮 ------------------ */
button {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  font-size: 18px;
  border-radius: 12px;
  border: none;
  color: #333;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: scale 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
button:hover {
  scale: 1.03;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  background: rgba(255, 255, 255, 0.05);
}
button:active { scale: 0.97; }

/* ------------------ 提示信息 ------------------ */
.tip-message {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  margin-top: 15px;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  border: 1px solid rgba(255,255,255,0.25);
}
.tip-message.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.tip-error {
  color: #FF4949;
  border: 1px solid rgba(255,73,73,0.5);
}
.tip-success {
  color: #27832A;
  border: 1px solid rgba(39,131,42,0.5);
}
.tip-info {
  color: #1DB6DC;
  border: 1px solid rgba(29,182,220,0.5);
}

/* ------------------ 底部 ------------------ */
.footer {
  position: relative;
  z-index: 998;
  background: rgba(255, 255, 255, 0.05); 
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  color: #fff;
  padding: 25px 15px; 
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* 图标布局 */
.footer-right {
  display: flex;
  justify-content: center;
  gap: 20px; 
  margin-bottom: 15px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap; /* 小屏幕自动换行 */
}

/* 图标容器 */
.icon-wrapper {
  display: inline-block;
}

/* 图标样式 */
.icon-img {
  width: 44px; 
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  padding: 6px;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, opacity;
  position: relative;
  z-index: 2;
}

/* hover 动画保留 */
.icon-wrapper:first-child .icon-img:hover {
  transform: scale(1.1) rotate(-10deg);
}
.icon-wrapper:last-child .icon-img:hover {
  transform: scale(1.1) rotate(10deg);
}

/* 版权信息 */
.copyright {
  font-size: 15px;
  color: #333; /* 可改成动态灰度后期统一 */
  margin-top: 5px;
  background: rgba(255,255,255,0.05);
  padding: 4px 10px;
  border-radius: 10px;
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  position: relative;
  z-index: 2;
}

/* ------------------ 动画 ------------------ */
@keyframes float-up {
  0% {transform:translateY(0) scale(1);opacity:1;}
  100%{transform:translateY(-30px) scale(1.5);opacity:0;}
}

/* ------------------ 响应式 ------------------ */
@media (max-width:480px){
  .container {padding:25px 15px;}
  input[type="text"]{padding:14px 16px;font-size:15px;}
  button{padding:14px 20px;font-size:16px;}
  .icon-img{width:35px;height:35px;}
}

/* ------------------ 爱心动画 ------------------ */
.heart {
  position: absolute;
  font-size: 18px;
  pointer-events: none;
  animation: float-up 1s ease-out forwards;
  will-change: transform, opacity;
}

/* ------------------ 输入框选中 ------------------ */
input[type="text"], textarea {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* ------------------ 语言切换按钮 ------------------ */
.lang-wrapper {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 999;
}
/* 语言选择按钮 */
.lang-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 15px;

  /* 液态玻璃背景 */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);

  color: #333; /* 可读文字 */
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lang-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
}

/* 下拉菜单 */
.lang-dropdown {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  margin-top: 6px;

  /* 宽度自适应内容 */
  width: max-content;      /* 自动根据内容宽度 */
  min-width: 100px;            /* 防止被最小宽度限制 */
  
  border-radius: 12px;
  overflow: hidden;

  /* 液态玻璃效果 */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);
  -webkit-backdrop-filter: blur(10px) saturate(180%) brightness(1.1) contrast(1.05);

  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  will-change: opacity, transform;
}

/* 下拉选项 */
.lang-dropdown a {
  display: flex;              
  align-items: center;        
  justify-content: center;    /* 水平居中 */
  
  padding: 10px 15px;         
  font-size: 14px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;        
  box-sizing: border-box;
  
  transition: background 0.2s ease;
}

/* 悬停效果 */
.lang-dropdown a:hover {
  background: rgba(242, 230, 215,0.08);
}

/* 展示下拉菜单 */
.lang-wrapper.active .lang-dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* ------------------ 全局禁止选中 ------------------ */
body, body * {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
input, textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* ------------------ 下拉/弹窗通用动画 ------------------ */
.engine-dropdown,
.lang-dropdown,
.tip-message {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  will-change: opacity, transform;
}
.show,
.lang-wrapper.active .lang-dropdown {
  animation: popIn 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  pointer-events: auto;
}
.hide, 
.lang-dropdown.hide {
  animation: popOut 0.35s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  pointer-events: none;
}
@keyframes popIn {
  0%   { opacity: 0; transform: translateY(-10px); }
  60%  { opacity: 1; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes popOut {
  0%   { opacity: 1; transform: translateY(0); }
  40%  { transform: translateY(-4px); }
  100% { opacity: 0; transform: translateY(-12px); }
}
/* ------------------ 强制 GPU 渲染，优化模糊层 ------------------ */
button,
input,
textarea,
.icon-img,
.lang-btn,
.copyright 
 will-change: transform, opacity, backdrop-filter;
 transform: translateZ(0); 
}

/* ------------------ 调整全局用户选择，仅禁止非交互元素 ------------------ */
body *:not(input):not(textarea):not(button) {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
/* ------------------ 背景元素 ------------------ */

/* 渐变兜底 */
body {
background: linear-gradient(135deg, #1f1f1f, #3c4a57, #7a8a99);
  );
  background-attachment: fixed;
  position: relative;
  z-index: 0;
}

/* 背景图层 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg) no-repeat center/cover;
  opacity: 1; /* 想要透明度可调，改这里 */
}

/* ------------------ 动态文字颜色 ------------------ */
:root {
  --dynamic-text-color: #333;
}

h1, h2, h3, p, a, .subtitle, 
.lang-btn, .lang-dropdown a, 
.engine-dropdown div, .copyright, 
input, input::placeholder, 
button {
  color: var(--dynamic-text-color) !important;
}
