/* 中国水墨画风格 - Chinese Ink Painting Style */

/* 导入中文书法字体 - 免费使用 */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=Long+Cang&display=swap');

:root {
  /* 水墨画色彩调色板 */
  --ink-black: #1a1a1a;
  --ink-grey-dark: #4a4a4a;
  --ink-grey-medium: #808080;
  --ink-grey-light: #d0d0d0;
  --paper-white: #fdfdfb;
  --paper-cream: #faf9f7;
  --accent-red: #c41e3a;
  --accent-red-light: rgba(196, 30, 58, 0.1);
  --shadow-ink: rgba(26, 26, 26, 0.15);
  --shadow-soft: rgba(0, 0, 0, 0.05);
}

/* 全局样式重置 */
* {
  box-sizing: border-box;
}

body {
  background: var(--paper-white);
  color: var(--ink-black);
  font-family: 'Noto Serif SC', 'Times New Roman', serif;
  line-height: 1.8;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  position: relative;
}

/* 背景纹理效果 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(128, 128, 128, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(128, 128, 128, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(128, 128, 128, 0.025) 1px, transparent 1px);
  background-size: 200px 200px, 300px 300px, 400px 400px;
  pointer-events: none;
  z-index: -1;
}

/* 导航栏 */
.navbar {
  background: rgba(253, 253, 251, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-grey-light);
  box-shadow: 0 2px 20px var(--shadow-soft);
  padding: 1rem 0;
  min-height: 70px;
}

.navbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.navbar-brand {
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.navbar-brand:hover {
  text-decoration: none;
  color: var(--ink-black);
}

.brand-text {
  font-size: 1.6rem;
  color: var(--ink-black);
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.brand-text-en {
  font-size: 0.8rem;
  color: var(--ink-grey-medium);
  font-weight: 400;
  letter-spacing: 0.8px;
  opacity: 0.9;
}

.nav-link {
  color: var(--ink-grey-dark) !important;
  font-weight: 400;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-red) !important;
}

.nav-btn {
  background: var(--ink-black);
  color: var(--paper-white) !important;
  border: 1px solid var(--ink-black);
  padding: 0.5rem 1.5rem;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 400;
}

.nav-btn:hover {
  background: var(--paper-white);
  color: var(--ink-black) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-ink);
}

/* 导航栏右侧推广链接 */
.navbar .ml-auto a {
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 400;
}

.navbar .ml-auto a:hover {
  color: var(--accent-red) !important;
  text-decoration: none !important;
}

/* 主要内容区域 */
main {
  flex: 1;
  padding: 2rem 0;
}

/* 英雄区域 */
.hero-section {
  background: linear-gradient(
    135deg, 
    var(--paper-white) 0%,
    var(--paper-cream) 50%,
    var(--paper-white) 100%
  );
  padding: 3rem 0 2rem 0;
  margin-bottom: 1.5rem;
  position: relative;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--ink-grey-light) 50%,
    transparent 100%
  );
}

.hero-title {
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.hero-subtitle {
  color: var(--ink-grey-dark);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* 表单区域 */
.form-section {
  background: var(--paper-white);
  border: 1px solid var(--ink-grey-light);
  border-radius: 0;
  padding: 3rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px var(--shadow-soft);
  position: relative;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--accent-red);
  opacity: 0.6;
}

.form-section h3 {
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  font-size: 1.5rem;
  margin-bottom: 2rem;
  letter-spacing: 1px;
  text-align: center;
}

/* 表单元素 */
.form-group label {
  color: var(--ink-black);
  font-weight: 400;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.form-control {
  border: 1px solid var(--ink-grey-light);
  border-radius: 0;
  background: var(--paper-white);
  color: var(--ink-black);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  height: auto;
}

/* 为表单中的下拉框添加额外的右侧内边距，为箭头图标留出更多空间 */
.form-section select.form-control,
#nameGenForm select.form-control {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23808080' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-control:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.1);
  background: var(--paper-white);
  color: var(--ink-black);
}

.form-control::placeholder {
  color: var(--ink-grey-medium);
}

/* 单选按钮 */
.custom-control-label {
  color: var(--ink-grey-dark);
  font-size: 0.9rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
}

/* 按钮 */
.btn-primary {
  background: var(--ink-black);
  border: 1px solid var(--ink-black);
  color: var(--paper-white);
  border-radius: 0;
  padding: 1rem 2rem;
  font-weight: 400;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--paper-white);
  color: var(--ink-black);
  border-color: var(--ink-black);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-ink);
}

/* 生成按钮加载状态 */
.btn-primary.generating {
  background: var(--paper-white) !important;
  color: var(--ink-black) !important;
  border: 2px solid var(--ink-black) !important;
  font-style: italic !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 2px 8px var(--shadow-ink) !important;
  transform: none !important;
  cursor: not-allowed !important;
}

.btn-primary.generating:hover {
  background: var(--paper-white) !important;
  color: var(--ink-black) !important;
  transform: none !important;
}

.btn-outline-primary {
  background: var(--paper-white);
  border: 1px solid var(--ink-black);
  color: var(--ink-black);
  border-radius: 0;
  padding: 1rem 2rem;
  font-weight: 400;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--ink-black);
  color: var(--paper-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-ink);
}

/* 名片轮播容器 */
.name-carousel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 2rem 0;
  margin: 2rem 0;
  perspective: 1200px;
}

/* 名片样式 */
.name-card {
  width: 280px;
  height: 400px;
  background: linear-gradient(135deg, var(--paper-white) 0%, var(--paper-cream) 100%);
  border: 1px solid var(--ink-grey-light);
  position: relative;
  transition: all 0.5s ease;
  cursor: pointer;
  overflow: hidden;
}

.name-card.active {
  transform: scale(1.05);
  z-index: 3;
  filter: none;
  box-shadow: 0 15px 40px rgba(26, 26, 26, 0.2);
}

.name-card:not(.active) {
  transform: scale(0.9);
  filter: blur(2px);
  opacity: 0.7;
  z-index: 1;
}

/* 名片背景水墨效果 */
.name-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 200px 150px at 20% 20%, 
      rgba(196, 30, 58, 0.08) 0%, 
      transparent 60%),
    radial-gradient(ellipse 150px 100px at 80% 80%, 
      rgba(128, 128, 128, 0.05) 0%, 
      transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* 名片内容 */
.name-card-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 1.5rem;
}

/* 中文名字显示 */
.chinese-name-display {
  font-family: 'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: 4rem;
  font-weight: 400;
  color: var(--ink-black);
  text-align: center;
  letter-spacing: 8px;
  position: relative;
  margin: 1rem 0;
  line-height: 1.1;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.chinese-name-display::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--accent-red);
  opacity: 0.8;
}

/* 拼音显示 */
.pinyin-display {
  font-family: 'Times New Roman', serif;
  font-size: 1.1rem;
  color: var(--ink-grey-dark);
  text-align: center;
  letter-spacing: 1px;
  font-style: italic;
  margin-bottom: 1rem;
}

/* 中文名字与拼音组合显示 */
.chinese-name-with-pinyin {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.char-pinyin-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.2rem;
}

.pinyin-top {
  font-family: 'Times New Roman', serif;
  font-size: 0.9rem;
  color: var(--ink-grey-dark);
  font-style: italic;
  line-height: 1.2;
  min-height: 1.2rem;
  text-align: center;
  margin-bottom: 0.3rem;
}

.chinese-char {
  font-family: 'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: 4rem;
  font-weight: 400;
  color: var(--ink-black);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  line-height: 1;
}

/* 音频按钮在名片内 */
.name-card .audio-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
  margin: 0;
}

/* 字符含义区域 */
.characters-meaning {
  margin-top: auto;
  padding-top: 1rem;
}

.character-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.character-char {
  font-family: 'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--ink-black);
  min-width: 50px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.character-meaning {
  font-size: 0.9rem;
  color: var(--ink-grey-dark);
  text-align: right;
  flex: 1;
  margin-left: 1rem;
}

/* 轮播导航 */
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-grey-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--accent-red);
  transform: scale(1.2);
}

/* 旧的单名字显示样式保留作为备用 */
.single-name-display .chinese-name-display {
  font-size: 4rem;
  margin: 3rem 0;
  letter-spacing: 8px;
}

.single-name-display .pinyin-display {
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

/* 名字含义 */
.name-meaning {
  background: var(--paper-cream);
  border-left: 3px solid var(--accent-red);
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 0;
}

.name-meaning h5 {
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

/* 音频按钮 */
.audio-button {
  background: var(--paper-white);
  border: 2px solid var(--accent-red);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem auto;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--accent-red);
}

.audio-button:hover {
  background: var(--accent-red);
  color: var(--paper-white);
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(196, 30, 58, 0.3);
}

/* 加载动画 */
.loading-spinner {
  display: none;
  text-align: center;
  margin: 3rem 0;
}

.spinner-border {
  border-color: var(--ink-grey-light);
  border-top-color: var(--accent-red);
}

/* 卡片 */
.card {
  border: 1px solid var(--ink-grey-light);
  border-radius: 0;
  background: var(--paper-white);
  box-shadow: 0 4px 16px var(--shadow-soft);
}

.card-title {
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.card-text {
  color: var(--ink-grey-dark);
  line-height: 1.6;
}

/* 页脚 */
.footer {
  background: var(--paper-cream);
  border-top: 1px solid var(--ink-grey-light);
  padding: 2rem 0;
  color: var(--ink-grey-dark);
  font-size: 0.9rem;
}

/* 提示信息 */
.alert-info {
  background: var(--accent-red-light);
  border: 1px solid rgba(196, 30, 58, 0.2);
  border-radius: 0;
  color: var(--ink-black);
}

.text-muted {
  color: var(--ink-grey-medium) !important;
}

.text-danger {
  color: var(--accent-red) !important;
}

/* 隐藏所有FontAwesome图标，保持简洁 */
.fa, .fas, .far, .fab {
  display: none !important;
}

/* 例外：音频按钮中的播放图标 */
.audio-button .fa-volume-up {
  display: inline-block !important;
}

/* 水墨画装饰元素 */
.hero-section::before {
  content: '';
  position: absolute;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, var(--accent-red) 2px, transparent 2px);
  background-size: 20px 20px;
  opacity: 0.3;
  border-radius: 50%;
}

/* 右下角水墨渐变效果 */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  right: 0;
  width: 400px;
  height: 400px;
  background: 
    radial-gradient(ellipse 160px 120px at 85% 85%, 
      rgba(196, 30, 58, 0.25) 0%, 
      rgba(196, 30, 58, 0.15) 25%, 
      rgba(196, 30, 58, 0.08) 50%, 
      transparent 75%),
    radial-gradient(ellipse 120px 160px at 90% 70%, 
      rgba(196, 30, 58, 0.18) 0%, 
      rgba(196, 30, 58, 0.08) 35%, 
      transparent 65%),
    radial-gradient(ellipse 80px 120px at 75% 90%, 
      rgba(128, 128, 128, 0.12) 0%, 
      rgba(128, 128, 128, 0.06) 40%, 
      transparent 70%),
    radial-gradient(ellipse 100px 80px at 95% 95%, 
      rgba(196, 30, 58, 0.1) 0%, 
      transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* 左上角水墨渐变效果 */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 280px;
  background: 
    radial-gradient(ellipse 140px 90px at 15% 15%, 
      rgba(196, 30, 58, 0.15) 0%, 
      rgba(196, 30, 58, 0.08) 40%, 
      rgba(196, 30, 58, 0.04) 60%, 
      transparent 80%),
    radial-gradient(ellipse 90px 110px at 25% 10%, 
      rgba(128, 128, 128, 0.10) 0%, 
      rgba(128, 128, 128, 0.05) 50%, 
      transparent 75%),
    radial-gradient(ellipse 80px 60px at 5% 25%, 
      rgba(196, 30, 58, 0.08) 0%, 
      transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* 为表单添加传统的印章效果 */
.form-section h3::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--accent-red);
  border-radius: 2px;
  margin-left: 10px;
  opacity: 0.8;
  vertical-align: middle;
}

/* 页面左下角水墨效果 */
.footer::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 320px;
  height: 200px;
  background: 
    radial-gradient(ellipse 120px 80px at 10% 90%, 
      rgba(196, 30, 58, 0.18) 0%, 
      rgba(196, 30, 58, 0.10) 40%, 
      rgba(196, 30, 58, 0.05) 60%, 
      transparent 80%),
    radial-gradient(ellipse 80px 60px at 25% 95%, 
      rgba(128, 128, 128, 0.10) 0%, 
      rgba(128, 128, 128, 0.04) 50%, 
      transparent 75%),
    radial-gradient(ellipse 60px 40px at 5% 85%, 
      rgba(196, 30, 58, 0.08) 0%, 
      transparent 65%);
  pointer-events: none;
  z-index: 1;
}

.footer {
  position: relative;
  overflow: hidden;
}

/* 表单卡片周围的微妙水墨效果 */
.form-section::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: 
    radial-gradient(circle at 70% 30%, 
      rgba(196, 30, 58, 0.08) 0%, 
      rgba(196, 30, 58, 0.04) 50%, 
      transparent 70%),
    radial-gradient(circle at 30% 70%, 
      rgba(128, 128, 128, 0.06) 0%, 
      rgba(128, 128, 128, 0.02) 60%, 
      transparent 80%);
  pointer-events: none;
  z-index: -1;
}

/* 中文名字显示区域的水墨背景 */
.chinese-name-display::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250%;
  height: 150%;
  background: 
    radial-gradient(ellipse 250px 80px at 50% 50%, 
      rgba(196, 30, 58, 0.05) 0%, 
      rgba(196, 30, 58, 0.02) 60%, 
      transparent 80%),
    radial-gradient(ellipse 180px 60px at 30% 60%, 
      rgba(128, 128, 128, 0.04) 0%, 
      rgba(128, 128, 128, 0.01) 70%, 
      transparent 85%),
    radial-gradient(ellipse 200px 50px at 70% 40%, 
      rgba(196, 30, 58, 0.03) 0%, 
      transparent 75%);
  pointer-events: none;
  z-index: -1;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
  }
  
  .navbar .ml-auto {
    margin-left: 0 !important;
    text-align: center;
  }
  
  .navbar .ml-auto a {
    font-size: 0.8rem;
  }
  
  .brand-text {
    font-size: 1.3rem;
    letter-spacing: 1px;
  }
  
  .brand-text-en {
    font-size: 0.75rem;
    letter-spacing: 0.6px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .chinese-name-display {
    font-size: 3rem;
    letter-spacing: 4px;
  }
  
  .form-section {
    padding: 2rem;
  }
  
  .hero-section {
    padding: 2rem 0 1.5rem 0;
    margin-bottom: 1rem;
  }
  
  /* 移动端水墨效果调整 */
  body::after {
    width: 280px;
    height: 280px;
  }
  
  .hero-section::after {
    width: 200px;
    height: 200px;
  }
  
  .footer::before {
    width: 240px;
    height: 150px;
  }
  
  .form-section::after {
    width: 90px;
    height: 90px;
    top: -20px;
    right: -20px;
  }
  
  /* 移动端名片轮播 */
  .name-carousel-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  .name-card {
    width: calc(100vw - 4rem);
    max-width: 280px;
    height: 350px;
  }
  
  .name-card.active {
    transform: scale(1);
  }
  
  .name-card:not(.active) {
    transform: scale(0.95);
    filter: blur(1px);
  }
  
  .name-card-content {
    padding: 1.5rem 1rem;
  }
  
  .chinese-name-display {
    font-size: 2.8rem;
    letter-spacing: 4px;
  }
  
  .chinese-char {
    font-size: 2.8rem;
  }
  
  .pinyin-top {
    font-size: 0.8rem;
  }
  
  .char-pinyin-pair {
    margin: 0 0.1rem;
  }
  
  .pinyin-display {
    font-size: 1rem;
  }
  
  .character-char {
    font-size: 1.3rem;
  }
  
  .character-meaning {
    font-size: 0.8rem;
  }
  
  /* 移动端按钮间距修复 */
  .text-center.mt-4 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .text-center.mt-4 .btn {
    margin-right: 0 !important;
    margin-bottom: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .chinese-name-display {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }
  
  .chinese-char {
    font-size: 2.5rem;
  }
  
  .pinyin-top {
    font-size: 0.75rem;
  }
  
  .chinese-name-with-pinyin {
    gap: 0.3rem;
  }
  
  .form-section {
    padding: 1.5rem;
  }
  
  .form-section::before {
    left: 1rem;
    right: 1rem;
  }
  
  /* 超小屏幕按钮优化 */
  .text-center.mt-4 {
    gap: 0.875rem;
  }
  
  .text-center.mt-4 .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
  }
  
  /* 超小屏幕名片模板 */
  .name-card-template {
    width: 280px !important;
    height: 420px !important;
    min-width: 280px !important;
    min-height: 420px !important;
    max-width: 280px !important;
    max-height: 420px !important;
  }
  
  #nameCardModal .modal-body {
    padding: 0.5rem 0.25rem;
  }
}

/* 名片分享按钮 */
.name-card {
  width: 280px;
  height: 400px;
  background: linear-gradient(135deg, var(--paper-white) 0%, var(--paper-cream) 100%);
  border: 1px solid var(--ink-grey-light);
  position: relative;
  transition: all 0.5s ease;
  cursor: pointer;
  overflow: hidden;
}

.share-button {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 40px;
  height: 40px;
  background: var(--paper-white);
  border: 2px solid var(--accent-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  color: var(--accent-red);
  font-size: 0.9rem;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.2);
}

.name-card:hover .share-button {
  opacity: 1;
  transform: translateY(0);
}

.share-button:hover {
  background: var(--accent-red);
  color: var(--paper-white);
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(196, 30, 58, 0.4);
}

.share-button:active {
  transform: scale(0.95);
}

/* 分享按钮图标 */
.share-button::before {
  content: '分';
  font-family: 'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
  font-size: 0.8rem;
  font-weight: 400;
}

/* 分享加载状态 */
.share-button.loading {
  pointer-events: none;
}

.share-button.loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 移动端适配 */
@media (max-width: 768px) {
  .share-button {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    top: 0.75rem;
    left: 0.75rem;
  }
  
  .share-button::before {
    font-size: 0.7rem;
  }
  
  /* 移动端总是显示分享按钮 */
  .name-card .share-button {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 名片模板样式 - 添加更强的隔离保护 */
.name-card-template {
  width: 400px !important;
  height: 600px !important;
  min-width: 400px !important;
  min-height: 600px !important;
  max-width: 400px !important;
  max-height: 600px !important;
  position: relative !important;
  background: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
  margin: 0 auto !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  border: none !important;
  outline: none !important;
  transform: none !important;
  /* 重置可能影响的CSS属性 */
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
}

/* 确保名片模板内的所有子元素不受外部样式影响 */
.name-card-template * {
  box-sizing: border-box !important;
}

.card-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/namecardbg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.card-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 30px 20px 30px;
}

/* 垂直中文名字容器 */
.chinese-name-vertical {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: row;
    gap: 40px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    z-index: 10;
    justify-content: center;
    align-items: center;
    width: 80%;
}

.chinese-name-vertical .char-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.chinese-name-vertical .chinese-char {
    font-family: 'AR PL UKai CN', 'Ma Shan Zheng', 'Long Cang', 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    font-size: 90px;
    font-weight: 400;
    color: #000000;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.chinese-name-vertical .meaning-text {
    font-family: 'Times New Roman', serif;
    font-size: 14px;
    color: var(--accent-red);
    font-style: italic;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    text-align: center;
    line-height: 1.3;
    max-width: 90px;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 30%;
}

.chinese-name-vertical .pinyin-text {
    font-family: 'Times New Roman', serif;
    font-size: 20px;
    color: #666;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    text-align: center;
    font-style: italic;
    width:30%;
}

/* 隐藏旧的垂直容器 */
.pinyin-vertical,
.meanings-vertical {
  display: none;
}

/* 底部区域 */
.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* QR码区域 */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#qrCodeContainer {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#qrCodeContainer canvas,
#qrCodeContainer img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 2px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

#qrCodeContainer > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #999;
    text-align: center;
    background: #f8f8f8;
    border-radius: 2px;
}

.qr-text {
    font-family: 'Times New Roman', serif;
    font-size: 9px;
    color: #666;
    text-align: center;
    line-height: 1.2;
    max-width: 78px;
    opacity: 0.8;
}

/* 版权信息 */
.copyright-text {
    font-family: 'Times New Roman', serif;
    font-size: 8px;
    color: #999;
    opacity: 0.7;
    text-align: right;
}

/* 模态框样式调整 */
#nameCardModal .modal-dialog {
  max-width: 600px;
  width: 95%;
  margin: 1rem auto;
}

#nameCardModal .modal-body {
  padding: 2rem;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端模态框优化 */
    #nameCardModal .modal-dialog {
        width: 98%;
        max-width: none;
        margin: 0.5rem auto;
    }
    
    #nameCardModal .modal-body {
        padding: 1rem 0.5rem;
    }
    
    /* 移动端名片模板保持固定比例缩放 */
    .name-card-template {
        width: 320px !important;
        height: 480px !important;
        min-width: 320px !important;
        min-height: 480px !important;
        max-width: 320px !important;
        max-height: 480px !important;
        margin: 0 auto !important;
        transform: none !important;
    }
    
    .card-content {
        padding: 20px 20px 15px 20px;
    }
    
    .name-card-intro {
        font-size: 0.8rem;
        margin-bottom: 20px;
        padding: 0 15px;
    }
    
    .chinese-name-vertical .char-group {
        gap: 8px;
        min-width: 100px;
    }
    
    .chinese-name-vertical .chinese-char {
        font-size: 70px;
    }
    
    .chinese-name-vertical .meaning-text {
        font-size: 13px;
    }
    
    .chinese-name-vertical .pinyin-text {
        font-size: 14px;
    }
    
    #qrCodeContainer {
        width: 60px;
        height: 60px;
    }
    
    .qr-text {
        font-size: 8px;
        max-width: 60px;
    }
    
    .copyright-text {
        font-size: 7px;
    }
    
    /* Modal按钮在移动端的优化 */
    .modal-footer {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* 名片介绍句样式 (在名片内部) */
.name-card-intro {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-style: normal;
    opacity: 0.9;
    line-height: 1.3;
    font-family: 'Times New Roman', serif;
    text-align: center;
    margin-bottom: 25px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
    font-weight: 500;
}

.name-card-intro .highlight-name {
    color: var(--accent-red);
    font-weight: 600;
    font-style: normal;
}

/* 高级音频控件样式 */
.audio-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.audio-button,
.settings-button {
  background: rgba(253, 253, 251, 0.95);
  border: 1px solid var(--ink-grey-light);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-grey-dark);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-soft);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.audio-button:hover,
.settings-button:hover {
  background: var(--accent-red)!important;
  color: var(--paper-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-ink);
  border-color: var(--accent-red);
}

.audio-button:focus,
.settings-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.2);
  color: var(--ink-grey-light);
}

.audio-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.settings-button {
  background: rgba(253, 253, 251, 0.9);
}

.settings-button i {
  font-size: 0.9rem;
}

/* TTS设置面板 */
.tts-settings-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper-white);
  border: 1px solid var(--ink-grey-light);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  min-width: 350px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.settings-header {
  background: var(--paper-cream);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ink-grey-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h5 {
  margin: 0;
  color: var(--ink-black);
  font-family: 'Noto Serif SC', serif;
  font-weight: 400;
}

.close-settings {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink-grey-medium);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-settings:hover {
  background: var(--ink-grey-light);
  color: var(--ink-black);
}

.settings-content {
  padding: 1.5rem;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink-black);
  font-weight: 500;
  font-size: 0.9rem;
}

#speedSlider {
  width: 100%;
  margin: 0.5rem 0;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--ink-grey-light);
  outline: none;
}

#speedSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-red);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

#speedSlider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(196, 30, 58, 0.4);
}

#speedSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-red);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#speedValue {
  display: inline-block;
  min-width: 3ch;
  text-align: center;
  font-weight: 600;
  color: var(--accent-red);
}

#voiceSelect {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--ink-grey-light);
  border-radius: 4px;
  background: var(--paper-white);
  color: var(--ink-black);
  font-size: 0.9rem;
}

#voiceSelect:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.1);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.form-check-input {
  margin: 0;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.form-check-label {
  font-size: 0.9rem;
  color: var(--ink-black);
  cursor: pointer;
  flex: 1;
}

.settings-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink-grey-light);
}

.settings-actions .btn {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.settings-actions .btn-outline-primary {
  border-color: var(--ink-grey-medium);
  color: var(--ink-grey-dark);
}

.settings-actions .btn-outline-primary:hover {
  background: var(--ink-grey-medium);
  color: var(--paper-white);
  border-color: var(--ink-grey-medium);
}

.settings-actions .btn-primary {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--paper-white);
}

.settings-actions .btn-primary:hover {
  background: #a31729;
  border-color: #a31729;
}

.settings-actions .btn-success {
  background: #28a745;
  border-color: #28a745;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .audio-controls {
    top: 0.5rem;
    right: 0.5rem;
    gap: 0.25rem;
  }
  
  .audio-button,
  .settings-button {
    width: 36px;
    height: 36px;
  }
  
  .tts-settings-panel {
    min-width: 320px;
    margin: 1rem;
  }
  
  .settings-content {
    padding: 1rem;
  }
  
  .settings-header {
    padding: 0.75rem 1rem;
  }
}

/* 设置面板的背景遮罩 */
.tts-settings-panel::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
  backdrop-filter: blur(2px);
}

/* 改进原有audio-button样式以配合新的控件 */
.name-card .audio-button {
  position: static;
  background: rgba(253, 253, 251, 0.95);
  backdrop-filter: blur(10px);
}

/* SEO Enhancement Styles */
.hero-features {
    margin-top: 1rem;
}

.hero-features .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin: 0.25rem;
}

.breadcrumb {
    background-color: transparent;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--accent-red);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.step-icon i {
    transition: transform 0.3s ease;
}

.step-icon:hover i {
    transform: scale(1.1);
}

.feature-box {
    padding: 1.5rem;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.feature-box:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-links a {
    color: var(--accent-red);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--ink-black);
    text-decoration: none;
}

.faq-section .card {
    border: none;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.faq-section .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.faq-section .btn-link {
    color: var(--ink-black);
    text-decoration: none;
    font-weight: 500;
    text-align: left;
    width: 100%;
    padding: 1rem;
}

.faq-section .btn-link:hover {
    color: var(--accent-red);
    text-decoration: none;
}

.benefits-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.seo-content {
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
}

@media (max-width: 768px) {
    .hero-features {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-features .badge {
        margin: 0.25rem 0;
        display: block;
        text-align: center;
    }
    
    .feature-box {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .step-icon {
        margin-bottom: 1rem;
    }
} 