@import url("variables.css");
/* frontend/css/style.css - 现代化版本 + 布局优化 + 交互增强 */

/* 语言切换渲染掩模：在i18n应用完成前隐藏页面，避免闪烁 */
html.lang-loading body {
  opacity: 0;
  pointer-events: none;
}

html.lang-ready body {
  opacity: 1;
  transition: opacity 0.2s ease-in-out;
}

/* 面包屑导航样式 */
.breadcrumb {
  background: rgba(26, 34, 58, 0.8);
  padding: 12px 24px;
  margin: 0 auto;
  max-width: 1366px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(45, 54, 80, 0.3);
}

.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  margin-left: 8px;
  color: var(--color-brand-secondary);
  font-weight: bold;
}

.breadcrumb-link {
  color: var(--color-brand-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.breadcrumb-link:hover {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

.breadcrumb-current {
  color: var(--color-text-primary);
  font-weight: 500;
}

@media (max-width: 768px) {
  .breadcrumb {
    padding: 8px 16px;
    margin-bottom: 12px;
  }

  .breadcrumb-list {
    font-size: 0.85em;
    gap: 6px;
  }

  .breadcrumb-item:not(:last-child)::after {
    margin-left: 6px;
  }
}

/* 基本重置和全局样式 */
body {
  font-family: "Segoe UI", "Roboto", "Arial", sans-serif;
  background: var(--color-surface-0)
    url("https://assets-global.website-files.com/63e4e7e7e0e92e1e7b6e7e7e/63e4e7e7e0e92e1e7b6e7e7e_circuit-bg.svg")
    repeat;
  color: var(--color-text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-size: 1em;
}

html,
body {
  overflow-x: hidden;
}

.container {
  width: 98%;
  max-width: 1366px;
  margin: -48px auto 0 auto;
  background: transparent;
  color: var(--color-text-primary);
  padding: 44px 48px;
  border-radius: 28px;
  box-shadow: none;
  backdrop-filter: none;
  border: none;
  position: relative;
  top: 0;
  font-size: 1em;
}

header {
  text-align: center;
  margin-bottom: 40px; /* 增加底部间距 */
  padding-bottom: 25px; /* 增加底部内边距 */
  border-bottom: 2px solid rgba(102, 126, 234, 0.15);
}

header h1 {
  /* 渐变色标题 */
  background: linear-gradient(
    135deg,
    var(--color-brand-secondary) 0%,
    var(--color-accent-purple-strong, #764ba2) 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px; /* 增加间距 */
  font-size: 2.2em; /* 稍微增大字体 */
  font-weight: 700;
}

header p {
  font-size: 1.15em; /* 稍微增大字体 */
  color: var(--color-text-on-light-muted, #666);
  margin: 0;
}

main {
  /* 使用CSS Grid布局优化 */
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

/* 输入区域 - 卡片化设计 */
.input-section,
.output-section {
  background: var(--color-surface-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  margin-bottom: 24px;
  border: 1.5px solid var(--color-border-dark-1, #2d3650);
  color: var(--color-text-primary);
}

.input-section h2,
.output-section h2 {
  color: var(--color-text-primary);
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 20px;
  margin-top: 0;
  letter-spacing: 1px;
}

/* 新增：示例展示区域 */
.examples-container {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.05);
}

.examples-title {
  margin: 0 0 15px 0;
  font-weight: 600;
  color: var(--color-brand-secondary);
  font-size: 1.05em;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.example-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 1;
  background: var(--color-surface-white, #fff);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.example-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.example-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.example-card:hover img {
  transform: scale(1.05);
}

.example-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: var(--color-surface-on-light-white, #fff);
  font-size: 0.9em;
  font-weight: 500;
}

/* 提示词工具样式 */
/*
.prompt-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.tool-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-group label {
    font-size: 0.9em;
    color: var(--color-text-on-light, #555);
    font-weight: 500;
}

.tool-select {
    padding: 8px 12px;
    border: 2px solid var(--color-border-input-2, #e1e8ed);
    border-radius: 8px;
    font-size: 0.95em;
    background: var(--color-surface-white, #fff);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-select:focus {
    border-color: var(--color-brand-secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
*/

/* 负面提示词样式 */
.negative-prompt,
.options,
.image-options {
  background: var(--color-surface-dark-2, #232b3e);
  border-radius: 12px;
  padding: 0 0 0 0; /* 移除原有内边距，左右对齐 */
  border: 1px solid var(--color-border-dark-1, #2d3650);
  margin-bottom: 18px;
  color: var(--color-text-light-2, #e3e6f3);
}

.negative-prompt input,
.image-options select,
.image-options input[type="number"] {
  color: #e5e7eb;
  background: #0e1424;
  border: 1px solid #2a3a57;
}

/* 主文本输入框样式 */
textarea#text-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #2a3a57;
  border-radius: 8px;
  font-size: 1em;
  line-height: 1.5;
  min-height: 140px; /* 增大最小高度，约等于8行文本 */
  resize: vertical;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  margin-bottom: 10px; /* 与下方提示的间距 */
  background: #0e1424;
  color: #e5e7eb;
}

textarea#text-input:focus {
  border-color: var(--color-brand-secondary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .examples-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .prompt-tools {
    grid-template-columns: 1fr;
  }

  .tool-select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .examples-grid {
    grid-template-columns: 1fr;
  }

  .example-card {
    aspect-ratio: 16/9;
  }
}

/* 选项区域 - 卡片化分组 */
.options {
  margin-top: 18px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--color-surface-dark-2, #232b3e) !important;
  padding: 18px 18px 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--color-border-dark-1, #2d3650);
  flex-wrap: wrap;
  color: var(--color-text-light-2, #e3e6f3);
}
.options label {
  margin-right: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text-light-2, #e3e6f3) !important;
  font-size: 1.05em;
}

.options input[type="radio"] {
  margin-right: 5px; /* 增加间距 */
  cursor: pointer;
  transform: scale(1.1); /* 稍微放大单选按钮 */
}

/* 新增：类型提示 */
.type-hint {
  font-size: 0.9em;
  color: #888;
  font-style: italic;
  margin-left: 20px;
  padding: 4px 8px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-xs);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 图片选项区域 - 独立卡片 */
.image-options {
  background: var(--color-surface-dark-2, #232b3e) !important;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--color-border-dark-1, #2d3650);
  margin-bottom: 25px;
  color: var(--color-text-light-2, #e3e6f3);
}

.image-options h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 1.1em;
}

.image-options > div {
  margin-bottom: 15px; /* 统一间距 */
}

.image-options > div:last-child {
  margin-bottom: 0;
}

.image-options label {
  font-weight: 500;
  color: var(--color-text-light-2, #e3e6f3) !important;
  margin-right: 10px;
  font-size: 1.05em;
}

.image-options select,
.image-options input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #2a3a57;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  background: #0e1424;
  color: #e5e7eb;
  margin-right: 10px;
}

.image-options select:focus,
.image-options input[type="number"]:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.image-options input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}

.model-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.85em;
  color: var(--color-brand-secondary);
  font-style: italic;
  line-height: 1.4;
}

/* 自定义尺寸容器 */
#custom-dimensions-container {
  background: rgba(240, 244, 255, 0.8);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.15);
  margin-top: 10px;
}

button#generate-button {
  background: linear-gradient(
    90deg,
    var(--color-cta-blue-start, #0099e6) 0%,
    var(--color-cta-blue-end, #005f99) 100%
  );
  color: #fff;
  font-size: 1.18em;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  padding: 14px 0;
  width: 100%;
  margin-top: 22px;
  box-shadow: 0 2px 8px rgba(0, 207, 255, 0.1);
  transition:
    background 0.2s,
    box-shadow 0.2s;
  letter-spacing: 2px;
}

button#generate-button:hover,
button#generate-button:focus {
  background: linear-gradient(
    90deg,
    var(--color-brand-primary) 0%,
    var(--color-cta-blue-hover-end, #4f8cff) 100%
  );
  box-shadow: 0 4px 16px rgba(0, 207, 255, 0.18);
  cursor: pointer;
}

/* 输出区域 - 卡片化设计 */
.output-section {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 24px;
  margin-top: 0; /* 移除margin，使用grid gap */
  padding-top: 25px; /* 移除之前的border-top样式 */
  border-top: none;
  color: var(--color-text-primary);
}

/* 新增：结果状态提示 */
.result-status {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

.status-icon {
  font-size: 1.1em;
}

.status-text {
  font-size: 0.95em;
  color: var(--color-brand-secondary);
  font-weight: 500;
}

.result-container {
  margin-top: 20px; /* 增加间距 */
  padding: 25px; /* 增加内边距 */
  background: linear-gradient(135deg, var(--color-surface-white, #ffffff) 0%, #fbfcff 100%);
  border-radius: 16px; /* 更大圆角 */
  border: 1px solid rgba(102, 126, 234, 0.1);
  /* 现代化阴影 */
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.1);
  /* 固定容器最大尺寸，防止图片撑大卡片 */
  max-width: 100%;
  overflow: hidden;
}

/* 图片容器优化 - 防止大图撑大卡片 */
.image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.image-container img#generated-image {
  /* 限制图片最大显示尺寸 */
  max-width: 100%;
  max-height: 500px; /* 限制最大高度 */
  width: auto;
  height: auto;
  border-radius: 12px; /* 更大圆角 */
  display: block;
  margin: 0 auto;
  border: 1px solid rgba(102, 126, 234, 0.2);
  /* 图片阴影 */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  /* 平滑过渡效果 */
  transition: all 0.3s ease;
  cursor: pointer;
}

/* 图片悬停效果 */
.image-container img#generated-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 多图片布局优化 */
.image-container .image-grid {
  display: grid;
  gap: 15px;
  width: 100%;
  max-width: 100%;
}

/* 1张图片 */
.image-container .image-grid.single {
  grid-template-columns: 1fr;
  place-items: center;
}

/* 2张图片 */
.image-container .image-grid.double {
  grid-template-columns: 1fr 1fr;
}

/* 4张图片 */
.image-container .image-grid.quad {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

/* 多图片时的单个图片样式 */
.image-container .image-grid img {
  max-width: 100%;
  max-height: 250px; /* 多图时限制更小的高度 */
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.image-container .image-grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 图片信息提示 */
.image-info {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--color-brand-secondary);
  text-align: center;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

/* 图片操作按钮 */
.image-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.image-action-btn {
  padding: 6px 12px;
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: var(--radius-xs);
  font-size: 0.85em;
  color: var(--color-brand-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.image-action-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: var(--color-brand-secondary);
  transform: translateY(-1px);
}

.audio-container audio#generated-audio {
  width: 100%;
  margin-bottom: 15px; /* 增加间距 */
  border-radius: 12px;
}

.audio-container a#download-audio-link {
  display: inline-block;
  margin-top: 15px; /* 增加间距 */
  padding: 12px 24px; /* 增大按钮 */
  background: linear-gradient(
    135deg,
    var(--color-cta-success, #2ecc71) 0%,
    var(--color-cta-success-dark, #27ae60) 100%
  );
  color: var(--color-surface-on-light-white, #fff);
  text-decoration: none;
  border-radius: 12px; /* 更大圆角 */
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 1.05em;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.audio-container a#download-audio-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

/* 加载指示器 */
.spinner {
  border: 4px solid #f3f3f3; /* Light grey */
  border-top: 4px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 现代化跳动点加载器样式 */
.bouncing-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 70px; /* 增加高度 */
}

.bouncing-loader > div {
  width: 16px; /* 增大尺寸 */
  height: 16px;
  margin: 0 8px; /* 增加间距 */
  background: linear-gradient(
    135deg,
    var(--color-brand-secondary) 0%,
    var(--color-accent-purple-strong, #764ba2) 100%
  );
  border-radius: 50%;
  animation: bouncing-loader 1.4s infinite ease-in-out both;
  /* 现代化阴影 */
  box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}

.bouncing-loader > div:nth-child(1) {
  animation-delay: -0.32s;
}

.bouncing-loader > div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bouncing-loader {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  40% {
    transform: scale(1.3); /* 增大跳动幅度 */
    opacity: 1;
  }
}

/* .loading 容器本身样式，用于结果区域内的加载指示 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px; /* 增加内边距 */
  background: linear-gradient(135deg, var(--color-surface-white, #ffffff) 0%, #fbfcff 100%);
  border-radius: 16px; /* 更大圆角 */
  color: var(--color-brand-secondary);
  border: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.1);
}

/* 为 .loading 内的文字单独设置样式 */
.loading p {
  margin-top: 15px; /* 增加间距 */
  font-size: 1.15em; /* 增大字体 */
  font-weight: 500;
  color: var(--color-brand-secondary);
  margin-bottom: 0;
}

/* 错误提示 */
.error-text {
  color: var(--color-error, #e74c3c);
  background: linear-gradient(
    135deg,
    var(--color-error-bg-1, #fdecec) 0%,
    var(--color-error-bg-2, #fdf2f2) 100%
  );
  border: 2px solid var(--color-error, #e74c3c);
  padding: 20px 25px; /* 增加内边距 */
  border-radius: 12px; /* 更大圆角 */
  margin-top: 20px; /* 增加间距 */
  text-align: center;
  font-weight: 500;
  font-size: 1.05em;
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.15);
}

footer {
  text-align: center;
  margin-top: 30px; /* 调整间距 */
  padding-top: 25px; /* 增加内边距 */
  border-top: 2px solid rgba(102, 126, 234, 0.15);
  font-size: 0.95em; /* 稍微增大字体 */
  color: rgba(255, 255, 255, 0.8);
}

.footer-icon svg path,
footer .footer-icon path {
  fill: var(--color-brand-primary, #00cfff);
}

/* 响应式调整 - 增强版 */
@media (max-width: 900px) {
  .container {
    width: 99%;
    padding: 18px 16px;
  }
}

@media (max-width: 1180px) {
  .navbar {
    padding: 0 18px;
    font-size: 1.12em;
  }
  .navbar-menu {
    gap: 24px;
    margin-left: 24px;
  }
  .navbar-right {
    gap: 14px;
    margin-left: 24px;
    margin-right: 18px;
  }
  .lang-select {
    padding: 6px 14px;
    min-width: 84px;
    padding-right: 22px;
  }
  .user-status .user-btn {
    padding: 9px 22px;
    font-size: 1em;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 8px 2vw;
    border-radius: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
  }
  .input-section,
  .output-section,
  .features-section,
  .image-options,
  .options,
  .negative-prompt {
    padding: 16px 8px;
    border-radius: 10px;
    margin-bottom: 14px;
  }
  /* 输入区与按钮 */
  #text-input,
  #negative-prompt {
    font-size: 1.08em;
    padding: 10px 8px;
    min-height: 48px;
    width: 100%;
    box-sizing: border-box;
  }
  .quick-actions,
  .examples-quickfill {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }
  .quick-actions button,
  .example-btn,
  button#generate-button {
    width: 100%;
    font-size: 1.08em;
    min-height: 44px;
    margin-bottom: 6px;
    border-radius: 8px;
  }
  button#generate-button {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    z-index: 1000;
    border-radius: 0;
    font-size: 1.15em;
    min-height: 52px;
  }
  /* 导航栏与菜单 */
  .navbar {
    flex-direction: row;
    padding: 0 8px;
    height: 48px;
  }
  .navbar-menu {
    display: none !important;
  }
  .navbar-left .logo-img {
    height: 28px;
    margin-right: 6px;
  }
  .site-name {
    font-size: 1.08em;
  }
  .navbar-right {
    padding: 0 4px;
    margin-right: 0;
  }
  /* 弹窗全屏化 */
  .modal-content {
    width: 98vw !important;
    min-width: unset !important;
    max-width: 98vw !important;
    min-height: 60vh;
    border-radius: 12px;
    padding: 18px 8px;
    left: 1vw !important;
    top: 2vh !important;
  }
  .modal-content h2 {
    font-size: 1.15em;
  }
  /* 结果区与图片 */
  .image-container img,
  .image-grid img {
    max-width: 100vw !important;
    width: 100vw !important;
    height: auto !important;
    border-radius: 8px;
  }
  .audio-container audio {
    width: 100% !important;
  }
  /* 特性区块 */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .feature-card {
    padding: 12px 6px;
    border-radius: 8px;
    font-size: 1em;
  }
  /* Footer适配 */
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
  }
  .footer-left,
  .footer-center,
  .footer-right {
    text-align: left;
    font-size: 0.98em;
    margin: 0 0 4px 0;
  }
  .footer-icon {
    width: 28px;
    height: 28px;
    margin-right: 8px;
  }
  .footer-link {
    font-size: 1em;
    margin-bottom: 2px;
  }
}

/* 语言切换按钮样式 */
.language-switcher {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: 18px;
}
.lang-btn {
  background: transparent;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border-dark-1, #2d3650);
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.lang-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.lang-btn.active,
.lang-btn.selected {
  background: var(--color-brand-primary);
  color: var(--color-text-contrast);
  border-color: var(--color-brand-primary);
}

.prompt-tip {
  font-size: 0.9em;
  color: var(--color-brand-secondary); /* 深色提示，更醒目 */
  font-style: italic;
  margin: 18px 0; /* 调整上下间距 */
  padding: 10px 15px; /* 调整内边距 */
  background: rgba(102, 126, 234, 0.08); /* 更淡的背景 */
  border-radius: 8px;
  text-align: left; /* 确保左对齐 */
  border: 1px solid rgba(102, 126, 234, 0.15);
}

.examples-quickfill {
  margin-bottom: 18px; /* 与下方输入框的间距 */
  display: flex; /* 使用flex布局 */
  flex-wrap: wrap; /* 允许换行 */
  gap: 10px; /* 按钮之间的间距 */
  align-items: center; /* 垂直居中对齐 */
}

.examples-quickfill .examples-label {
  color: var(--color-brand-primary);
  font-weight: bold;
  font-size: 1.13em;
  margin-bottom: 6px;
  display: inline-block;
  letter-spacing: 1px;
  vertical-align: middle;
}

.example-btn {
  /* 现代化渐变按钮 */
  background: var(--color-surface-dark-alt, #10182a);
  color: var(--color-brand-primary);
  padding: 10px 28px;
  border: 2px solid var(--color-brand-primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition:
    background 0.2s,
    color 0.2s;
  /* min-width: auto;  由下方 flex-basis 和 min-width 控制 */
  flex-shrink: 0; /* 防止按钮被过度压缩 */
  flex-grow: 1; /* 允许按钮增长以填充空间 */
  flex-basis: 140px; /* 建议的基础宽度 */
  min-width: 110px; /* 确保按钮不会太窄 */
  text-align: center; /* 文本居中 */
}

.example-btn:hover {
  background: var(--color-brand-primary);
  color: var(--color-surface-dark-alt, #10182a);
}

/* 模板按钮 */
.template-btn {
  background: linear-gradient(
    135deg,
    var(--color-brand-secondary) 0%,
    var(--color-accent-purple-strong, #764ba2) 100%
  );
  color: var(--color-surface-on-light-white, #fff);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.template-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.template-btn:active {
  transform: translateY(0);
}

.quick-actions {
  display: flex;
  gap: 12px; /* 按钮之间的间距调整 */
  margin: 18px 0; /* 上下间距 */
  justify-content: flex-start; /* 默认左对齐 */
  flex-wrap: wrap; /* 允许换行 */
}

.quick-actions button {
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #2a3a57;
  flex-grow: 0; /* 默认不拉伸 */
  flex-shrink: 0; /* 默认不压缩 */
  background: #0e1424;
  color: #e5e7eb;
}

/* 清空按钮 */
#clear-btn:hover {
  background-color: #1a2332;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 优化和随机按钮hover效果 */
#optimize-btn:hover,
#random-btn:hover {
  background-color: #1a2332;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 为三个快捷按钮设置flex-basis，使其在空间足够时宽度一致 */
#clear-btn,
#optimize-btn,
#random-btn {
  flex-basis: calc(33.333% - 8px); /* 减去gap的影响，(12px * 2 / 3) */
  text-align: center; /* 确保文本居中 */
  min-width: 100px; /* 保证一个最小的可点击宽度 */
}

/* 智能优化按钮 */
.inspiration-gallery {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 18px 12px 12px 12px;
  border: 1px solid rgba(102, 126, 234, 0.12);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.05);
}
.inspiration-title {
  margin: 0 0 14px 0;
  font-weight: 600;
  color: var(--color-accent-purple-strong, #764ba2);
  font-size: 1.08em;
}
.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.inspiration-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface-white, #fff);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.08);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.inspiration-card:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.18);
  transform: translateY(-2px) scale(1.03);
}
.inspiration-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
.inspiration-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 0;
  background: linear-gradient(to top, rgba(118, 75, 162, 0.85), transparent);
  color: #fff;
  font-size: 0.95em;
  font-weight: 500;
  text-align: center;
  letter-spacing: 1px;
}

/* 顶部导航栏 */
.navbar {
  width: 100%;
  min-width: 0;
  background: var(--color-surface-dark-alt, #10182a);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 72px;
  border-radius: 0;
  box-shadow: none;
  font-size: 1.18em;
  margin-bottom: 0;
  position: relative;
  z-index: 20;
}
.navbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.site-name {
  font-size: 1.7em;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--color-text-light-4, #e0e6f8);
  margin-left: 6px;
}
.navbar-menu {
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0 0 0 32px;
  padding: 0;
}
.navbar-menu li a {
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 1.08em;
  font-weight: 600;
  letter-spacing: 1px;
  transition: color 0.2s;
  padding: 2px 6px;
}
.navbar-menu li a:hover {
  color: var(--color-brand-primary);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 32px;
  margin-right: 24px;
}
.login-btn {
  background: transparent;
  color: var(--color-brand-primary);
  border: none; /* 去除蓝色外边框 */
  border-radius: 10px;
  padding: 10px 32px;
  font-size: 1.08em;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  box-shadow: none; /* 去除按钮阴影 */
}
.login-btn:hover {
  background: var(--color-brand-primary);
  color: #181f2e;
  box-shadow: 0 4px 16px rgba(0, 207, 255, 0.18);
}
.highlight-btn {
  border: 2px solid var(--color-brand-primary);
  color: var(--color-brand-primary);
  background: transparent;
  font-weight: 800;
}
@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    height: auto;
    padding: 0 12px;
    border-radius: 0 0 14px 14px;
  }
  .navbar-menu {
    gap: 18px;
    margin: 0;
    padding: 0;
  }
  .login-btn {
    padding: 8px 18px;
    font-size: 1em;
  }
  .site-name {
    font-size: 1.2em;
  }
}

/* 主视觉区 */
.hero-section {
  width: 100%;
  min-width: 0;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0 20px 0;
  position: relative;
  z-index: 1;
}
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-text-primary);
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 32px 20px 32px;
  /* 移除背景、边框、圆角、阴影 */
  background: none;
  border-radius: 0;
  box-shadow: none;
  border: none;
}
.hero-logo {
  font-size: 5em;
  margin-bottom: 18px;
  color: var(--color-brand-primary);
  display: block;
}
.hero-title {
  font-size: 2.8em;
  font-weight: bold;
  color: var(--color-text-brand-soft, #bfc7e6);
  letter-spacing: 2px;
  margin: 0;
  text-align: left;
}
.hero-subtitle {
  font-size: 1.25em;
  font-weight: 400;
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--color-text-primary);
}
.hero-tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.tag,
.tag-free,
.tag-unlimited,
.tag-no-login,
.tag-quality,
.tag-chinese {
  display: inline-block;
  background: #0e1424;
  color: #e5e7eb !important;
  border-radius: 18px;
  padding: 6px 22px;
  font-size: 1em;
  font-weight: 500;
  margin-right: 10px;
  margin-bottom: 4px;
  border: 2px solid #2a3a57;
  transition:
    border-color 0.2s,
    color 0.2s,
    background 0.2s;
}
.tag:last-child {
  margin-right: 0;
}
.tag:hover,
.tag-free:hover,
.tag-unlimited:hover,
.tag-no-login:hover,
.tag-quality:hover,
.tag-chinese:hover {
  border-color: #667eea;
  background: #1a2332;
  color: #667eea !important;
  cursor: pointer;
}

/* 主要特性区块 */
.features-section {
  margin: 48px 0 32px 0;
  text-align: center;
}
.features-title {
  font-size: 2em;
  font-weight: 700;
  margin-bottom: 32px;
  background: linear-gradient(90deg, #ffb86c 0%, #ff6e6e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 28px;
  justify-items: center;
}
.feature-card {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(24, 18, 30, 0.1);
  padding: 32px 18px 24px 18px;
  color: #fff;
  min-height: 180px;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  border: 1.5px solid rgba(255, 255, 255, 0.13);
}
.feature-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 32px rgba(255, 184, 108, 0.18);
}
.feature-icon {
  font-size: 2.2em;
  margin-bottom: 12px;
}
.feature-card h3 {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 8px;
  margin-top: 0;
}
.feature-card p {
  font-size: 0.98em;
  color: #ffe6c7;
  margin: 0;
}

/* 生成器区块卡片化升级 */
.input-section,
.output-section {
  background: var(--color-surface-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px 20px;
  margin-bottom: 20px;
  border: 1.5px solid #2d3650;
  color: var(--color-text-primary);
}

.logo-img {
  height: 38px;
  width: 38px;
  border-radius: 8px;
  margin-right: 10px;
  vertical-align: middle;
  box-shadow: none;
  background: transparent;
}

.hero-logo-img {
  height: 120px;
  width: 120px;
  border-radius: var(--radius-xl);
  margin-bottom: 18px;
  box-shadow: none;
  display: block;
  margin-left: auto;
  margin-right: auto;
  background: transparent;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 0;
}
.hero-logo-img {
  width: 72px;
  height: 72px;
  margin-right: 0;
  display: block;
}
.hero-title {
  font-size: 2.8em;
  font-weight: bold;
  color: var(--color-text-brand-soft, #bfc7e6);
  letter-spacing: 2px;
  margin: 0;
}

.input-section textarea,
.input-section input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border-radius: 10px;
  font-size: 1.1em;
}
.input-section .quick-actions,
.input-section .negative-prompt,
.input-section .prompt-tip {
  width: 100%;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}
.input-section .quick-actions {
  display: flex;
  gap: 12px;
  margin: 12px 0 12px 0;
}
.input-section .quick-actions button {
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
}
.input-section .prompt-tip {
  margin: 18px 0 0 0;
  padding: 8px 0;
}
.input-section .examples-quickfill {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 18px 0;
}
.input-section .examples-quickfill .example-btn {
  min-width: 160px;
}

.lang-select {
  background: transparent;
  color: var(--color-text-primary);
  border: 2px solid var(--color-border-dark-1, #2d3650);
  border-radius: 8px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  outline: none;
  margin-right: 0;
  min-width: 90px;
  padding-right: 28px;
}
.lang-select:focus,
.lang-select:hover {
  background: var(--color-surface-2);
  color: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
}
.lang-select option {
  background: var(--color-surface-2);
  color: var(--color-text-primary);
}
.user-status .user-btn {
  background: var(--color-brand-primary);
  color: #0d1422;
  border: none;
  border-radius: 10px;
  padding: 10px 26px;
  font-size: 1.02em;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
  flex-shrink: 0;
}
.user-status .user-btn:hover,
.user-status .user-btn:focus {
  background: #4de1ff;
  color: #0b0f1a;
  box-shadow: 0 4px 16px rgba(77, 225, 255, 0.3);
  transform: translateY(-1px);
}
.user-status .user-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(77, 225, 255, 0.2);
}

.footer-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 60px;
  padding: 60px 0 40px 0;
  background: none;
  font-size: 1.13em;
}
.footer-left {
  color: var(--color-text-primary);
  font-size: 1.08em;
  letter-spacing: 1px;
  min-width: 220px;
  text-align: left;
}
.footer-center {
  display: flex;
  gap: 28px;
  align-items: center;
  min-width: 180px;
  justify-content: center;
}
.footer-icon {
  display: inline-block;
  transition: transform 0.2s;
  line-height: 1;
}
.footer-icon:hover {
  transform: scale(1.18) translateY(-2px);
}
.footer-right {
  color: var(--color-brand-primary);
  text-align: left;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-links-title {
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--color-brand-primary);
}
.footer-link {
  color: var(--color-brand-primary);
  text-decoration: none;
  font-size: 1.08em;
  display: inline-block;
  margin-bottom: 8px;
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--color-text-primary);
  text-decoration: underline;
}
@media (max-width: 900px) {
  .footer-grid {
    flex-direction: column;
    gap: 24px;
    padding: 40px 0 24px 0;
  }
  .footer-left,
  .footer-right {
    min-width: unset;
    text-align: center;
  }
  .footer-center {
    min-width: unset;
  }
}

/* 关于弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(21, 28, 41, 0.85);
  backdrop-filter: blur(2px);
}
.modal-content {
  background: var(--color-surface-1);
  margin: 7% auto;
  padding: 48px 44px 36px 44px;
  border: 1.5px solid var(--color-border-dark-1, #2d3650);
  border-radius: 22px;
  width: 98%;
  max-width: 820px;
  color: var(--color-text-primary);
  box-shadow: 0 8px 32px rgba(0, 207, 255, 0.1);
  position: relative;
  animation: modal-fade-in 0.3s;
  font-size: 1.18em;
}
.modal-content h2 {
  margin-top: 0;
  color: var(--color-brand-secondary);
  font-size: 1.7em;
  font-weight: 700;
}
.modal-content p,
.modal-content ul,
.modal-content div {
  font-size: 1.18em;
  line-height: 2;
  color: var(--color-text-primary);
}
.close {
  color: var(--color-text-primary);
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 1.8em;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}
.close:hover {
  color: var(--color-brand-primary);
}
@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: translateY(-40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-title {
  display: block;
  font-size: 1.18em;
  font-weight: bold;
  color: var(--color-text-primary);
  margin: 22px 0 10px 0;
  letter-spacing: 1px;
}

.examples-label {
  color: var(--color-text-primary);
  font-size: 1em;
  font-weight: normal;
  margin-bottom: 6px;
  display: inline-block;
  letter-spacing: 0.5px;
  vertical-align: middle;
  opacity: 0.85;
}

#negative-prompt {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #2a3a57;
  border-radius: 8px;
  font-size: 1.1em;
  line-height: 1.5;
  margin-top: 8px;
  margin-bottom: 0;
  box-sizing: border-box;
  background: #0e1424;
  color: #e5e7eb;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}
#negative-prompt:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

@media (max-width: 600px) {
  .hero-row {
    gap: 10px;
  }
  .hero-logo-img {
    width: 48px;
    height: 48px;
  }
  .hero-title {
    font-size: 1.5em;
  }
}

.testimonial-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}
.testimonial-cards {
  display: flex;
  flex-direction: row;
  gap: 18px;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  /* overflow-x: auto; 由外层包裹隐藏 */
  padding: 32px 0 38px 0;
  scroll-snap-type: none;
}
.testimonial-card {
  background: #262b35;
  border-radius: 14px;
  box-shadow: 0 2px 16px #0003;
  padding: 22px 26px;
  min-width: 320px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: box-shadow 0.3s;
  margin: 0 0;
}
.testimonial-card .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 10px;
  object-fit: cover;
}
.testimonial-card .role {
  color: #aab4d4;
  font-size: 0.98em;
  margin-bottom: 4px;
}
.testimonial-card .rating {
  color: #ffd700;
  font-size: 1.2em;
  position: absolute;
  top: 18px;
  right: 18px;
}
.testimonial-card p[data-i18n^="testimonials.user"] {
  color: #e0e6f6;
  font-size: 1.05em;
  text-align: center;
  margin-top: 10px;
}
.testimonial-carousel-fade {
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
}
.testimonial-carousel-fade.left {
  left: 0;
  background: linear-gradient(to right, var(--color-surface-0) 80%, transparent);
}
.testimonial-carousel-fade.right {
  right: 0;
  background: linear-gradient(to left, var(--color-surface-0) 80%, transparent);
}

/* 新页面样式 */
.about-section,
.services-section,
.contact-section {
  background: var(--color-surface-1);
  border-radius: 16px;
  padding: 40px;
  margin: 40px 0;
  border: 1px solid #2d3650;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.about-section h2,
.services-section h2,
.contact-section h2 {
  color: var(--color-brand-primary);
  font-size: 2.2em;
  font-weight: bold;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: 1px;
}

.about-content,
.services-content,
.contact-content {
  color: var(--color-text-primary);
  font-size: 1.18em;
  line-height: 1.8;
  text-align: justify;
}

.about-content a,
.services-content a,
.contact-content a {
  color: var(--color-brand-primary);
  text-decoration: none;
  transition: color 0.3s;
}

.about-content a:hover,
.services-content a:hover,
.contact-content a:hover {
  color: var(--color-brand-secondary);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .about-section,
  .services-section,
  .contact-section {
    padding: 24px;
    margin: 24px 0;
  }

  .about-section h2,
  .services-section h2,
  .contact-section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .about-content,
  .services-content,
  .contact-content {
    font-size: 1.1em;
    line-height: 1.7;
  }
}

/* Google AdSense 广告位样式 */
.ad-section {
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
}

.ad-section .adsbygoogle {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.ad-section .adsbygoogle:hover {
  transform: translateY(-2px);
}

/* 移动设备广告适配 */
@media (max-width: 768px) {
  .ad-section {
    margin: 30px auto;
    padding: 15px;
  }

  .ad-section .adsbygoogle {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  }
}

/* 全局移动端交互优化 */

/* 触摸设备专用样式 */
@media (hover: none) and (pointer: coarse) {
  /* 移除桌面悬停效果，添加触摸反馈 */
  button:hover,
  .btn:hover,
  .nav-link:hover,
  .lang-toggle:hover {
    transform: none;
    box-shadow: none;
  }

  /* 触摸时的视觉反馈 */
  button:active,
  .btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  /* 确保触摸目标至少44x44px */
  button,
  .btn,
  .nav-link,
  .lang-toggle,
  input[type="submit"],
  input[type="button"],
  .download-btn,
  .share-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
  }

  /* 链接的触摸优化 */
  a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
  }

  /* 表单输入的触摸优化 */
  input,
  textarea,
  select {
    min-height: 44px;
    padding: 12px;
    font-size: 16px; /* 防止iOS缩放 */
  }
}

/* 移动设备专用交互增强 */
@media (max-width: 768px) {
  /* 汉堡菜单按钮 */
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    color: #333;
    position: relative;
    z-index: 1001;
  }

  /* 默认隐藏桌面菜单 */
  .nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface-on-light-white, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 12px 12px;
    padding: 20px;
    z-index: 1000;
  }

  /* 显示移动菜单 */
  .nav ul.mobile-menu-open {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  /* 移动端导航链接 */
  .nav ul.mobile-menu-open li a {
    padding: 15px;
    border-radius: 8px;
    background: var(--color-surface-muted, #f8f9fa);
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border-muted, #e9ecef);
  }

  .nav ul.mobile-menu-open li a:hover,
  .nav ul.mobile-menu-open li a:active {
    background: var(--color-link-primary, #007bff);
    color: var(--color-surface-on-light-white, #fff);
    transform: translateY(-2px);
  }

  /* 滑动手势区域指示 */
  .swipe-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-surface-on-light-white, #fff);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    animation: swipeHint 3s ease-in-out infinite;
  }

  @keyframes swipeHint {
    0%,
    100% {
      opacity: 0;
      transform: translateX(-50%) translateY(10px);
    }
    20%,
    80% {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }

  /* 移动端输入框优化 */
  .form-control,
  .input-field,
  textarea {
    font-size: 16px !important; /* 防止iOS自动缩放 */
    border-radius: 12px;
    border: 2px solid var(--color-border-muted, #e9ecef);
    padding: 16px;
    transition: border-color 0.3s ease;
  }

  .form-control:focus,
  .input-field:focus,
  textarea:focus {
    border-color: var(--color-link-primary, #007bff);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  }

  /* 移动端按钮优化 */
  .btn,
  button {
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
  }

  /* 按钮触摸波纹效果 */
  .btn::before,
  button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
      width 0.3s ease,
      height 0.3s ease;
    pointer-events: none;
  }

  .btn:active::before,
  button:active::before {
    width: 300px;
    height: 300px;
  }

  /* 移动端卡片交互 */
  .card,
  .feature-card,
  .info-card {
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .card:active,
  .feature-card:active,
  .info-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  /* 长按菜单样式 */
  .long-press-menu {
    position: fixed;
    background: var(--color-surface-on-light-white, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 10px;
    z-index: 1001;
    display: none;
    animation: popIn 0.2s ease;
  }

  @keyframes popIn {
    from {
      opacity: 0;
      transform: scale(0.8);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .long-press-menu.show {
    display: block;
  }

  .long-press-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 0;
  }

  .long-press-menu button:hover {
    background: var(--color-surface-muted, #f8f9fa);
  }
}

/* 超小屏幕设备（375px以下） */
@media (max-width: 375px) {
  .container,
  .main-content {
    padding: 10px 8px;
  }

  h1 {
    font-size: 1.6em;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.4em;
    line-height: 1.3;
  }

  .btn,
  button {
    font-size: 14px;
    padding: 12px 16px;
  }

  .card,
  .feature-card {
    padding: 15px;
    margin-bottom: 15px;
  }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section,
  .main-banner {
    padding: 20px 0;
    min-height: auto;
  }

  .nav {
    padding: 8px 0;
  }

  .mobile-menu-toggle {
    font-size: 20px;
    padding: 8px;
  }
}

/* 可折叠设备支持 */
@media (max-width: 768px) {
  /* 为可折叠设备优化 */
  @supports (display: flex) {
    .foldable-content {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }

    .foldable-main {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }
  }
}

/* PWA支持增强 */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--color-link-primary, #007bff);
  color: var(--color-surface-on-light-white, #fff);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
  transform: translateY(100px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.pwa-install-prompt.show {
  transform: translateY(0);
}

.pwa-install-prompt button {
  background: var(--color-surface-on-light-white, #fff);
  color: var(--color-link-primary, #007bff);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  margin-left: 10px;
  cursor: pointer;
  font-weight: 600;
}

/* 虚拟键盘适配 */
@media (max-width: 768px) {
  .viewport-height {
    height: 100vh;
    height: 100dvh; /* 动态视口高度 */
  }

  /* 当虚拟键盘出现时调整布局 */
  @supports (-webkit-touch-callout: none) {
    .ios-keyboard-fix {
      padding-bottom: env(keyboard-inset-height, 0);
    }
  }
}

/* 无障碍访问增强 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .btn,
  button {
    border: 2px solid currentColor;
  }

  .card,
  .feature-card {
    border: 1px solid currentColor;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .mobile-menu-open li a {
    background: #2d3748;
    color: var(--color-surface-on-light-white, #fff);
    border-color: #4a5568;
  }

  .long-press-menu {
    background: #2d3748;
    color: var(--color-surface-on-light-white, #fff);
  }

  .form-control,
  .input-field,
  textarea {
    background: #2d3748;
    color: var(--color-surface-on-light-white, #fff);
    border-color: #4a5568;
  }
}

/* 主页优化样式 - 保持现有颜色风格 */
.hero-cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.cta-btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: var(--radius-lg, 12px);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1em;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  min-width: 200px;
  text-align: center;
}

.cta-primary {
  background: var(--color-brand-primary, #007bff);
  color: white;
  border-color: var(--color-brand-primary, #007bff);
}

.cta-primary:hover {
  background: transparent;
  color: var(--color-brand-primary, #007bff);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.2);
}

.cta-secondary {
  background: transparent;
  color: var(--color-brand-primary, #007bff);
  border: 2px solid var(--color-brand-primary, #007bff);
}

.cta-secondary:hover {
  background: var(--color-brand-primary, #007bff);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 123, 255, 0.2);
}

/* tag-quality样式已统一到上方的.tag通用样式中 */

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 123, 255, 0.15);
  border-color: var(--color-brand-primary, #007bff);
}

.service-btn:hover {
  background: transparent;
  color: var(--color-brand-primary, #007bff);
  border: 2px solid var(--color-brand-primary, #007bff);
  transform: translateY(-2px);
}

.feature-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.1);
  border-color: var(--color-brand-secondary, #00cfff);
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
  .hero-cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .cta-btn {
    width: 100%;
    max-width: 280px;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card,
  .feature-item {
    padding: 25px 20px;
  }
}

.cookie-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 9999;
  background: rgba(15, 21, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  color: #f8fafc;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.cookie-banner__content {
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.cookie-banner__content p {
  margin: 0;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cookie-banner__actions button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.cookie-banner__accept {
  background: #38bdf8;
  color: #0f172a;
}

.cookie-banner__accept:hover {
  background: #0ea5e9;
}

.cookie-banner__dismiss {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
}

.cookie-banner__dismiss:hover {
  background: rgba(148, 163, 184, 0.35);
}

@media (max-width: 640px) {
  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 16px;
  }

  .cookie-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner__actions button {
    width: 100%;
  }
}
