:root {
  --bg-color: #f8f9fa;
  --text-color: #333333;
  --link-color: #333;
  --link-hover-color: #ffb24d;
  --download-bg: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --search-bg: #ffffff;
  --search-border: #e0e0e0;
  --search-focus: rgba(255, 178, 77, 0.3);
  --button-bg: #ffb24d;
  --button-hover: #ff9e26;
  --brand-color: #2c3e50;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--shadow-color);
  transform: translateY(-2px);
}

/* 动画定义 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shadowPulse {
  0% {
    box-shadow: 0 0 0 1px var(--search-border);
  }
  50% {
    box-shadow: 0 0 0 3px var(--search-focus);
  }
  100% {
    box-shadow: 0 0 0 1px var(--search-border);
  }
}

/* 手动深色模式切换 */
html.dark-mode {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --link-color: #ffffff;
  --link-hover-color: #ffb24d;
  --download-bg: #1e1e1e;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --search-bg: #1e1e1e;
  --search-border: #333333;
  --search-focus: rgba(255, 178, 77, 0.3);
  --button-bg: #ff9e26;
  --button-hover: #ff8c00;
  --brand-color: #e0e0e0;
}

html.dark-mode .navbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}

html.dark-mode .nav-search #search-input {
  background: var(--search-bg);
  color: var(--text-color);
}

html.dark-mode .nav-brand {
  color: var(--brand-color);
}

/* 系统深色模式检测 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --link-color: #ffffff;
    --link-hover-color: #ffb24d;
    --download-bg: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --search-bg: #1e1e1e;
    --search-border: #333333;
    --search-focus: rgba(255, 178, 77, 0.3);
    --button-bg: #ff9e26;
    --button-hover: #ff8c00;
    --brand-color: #e0e0e0;
  }

  .navbar {
    background-color: #12121290;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  }

  .nav-search #search-input {
    background: var(--search-bg);
    color: var(--text-color);
  }

  .nav-brand {
    color: var(--brand-color);
  }

  /* 确保系统深色模式和手动深色模式样式一致 */
  html:not(.dark-mode) {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --link-color: #ffffff;
    --link-hover-color: #ffb24d;
    --download-bg: #1e1e1e;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --search-bg: #1e1e1e;
    --search-border: #333333;
    --search-focus: rgba(255, 178, 77, 0.3);
    --button-bg: #ff9e26;
    --button-hover: #ff8c00;
    --brand-color: #e0e0e0;
  }

  html:not(.dark-mode) .navbar {
    background-color: #12121290;
    backdrop-filter: blur(10px);
  }

  html:not(.dark-mode) .nav-search #search-input {
    background: var(--search-bg);
    color: var(--text-color);
  }

  html:not(.dark-mode) .nav-brand {
    color: var(--brand-color);
  }
}

body {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
}

/* 导航栏样式 */
.navbar {
  background-color: #f5f5f590;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0e0e0;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  min-height: 70px;
  display: flex;
  align-items: center;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.nav-brand i {
  color: var(--button-bg);
  margin-right: 0.5rem;
  font-size: 1.3rem;
}

.nav-search {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  position: relative;
}

.nav-search #search-input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--search-border);
  border-radius: 18px 0 0 18px;
  font-size: 1rem;
  background: white;
  transition: all 0.2s ease;
  color: #2c3e50;
  height: 40px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-search #search-input:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 0 3px rgba(255, 178, 77, 0.1);
}

.nav-search #search-input::placeholder {
  color: #8e9aaf;
}

.nav-search #search-button {
  border: none;
  border-radius: 0 18px 18px 0;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  box-sizing: border-box;
  background: linear-gradient(135deg, var(--button-bg), var(--button-hover));
  color: white;
  box-shadow: 0 2px 6px rgba(255, 178, 77, 0.3);
  white-space: nowrap;
}

.nav-search #search-button:hover {
  background: linear-gradient(135deg, var(--button-hover), #ff8c00);
  transform: scale(1.03);
  box-shadow: 0 4px 10px rgba(255, 142, 0, 0.4);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-weight: 500;
}

.nav-link {
  color: #5a6c7d;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease, transform 0.2s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--button-bg);
  transform: translateY(-2px);
}

.nav-link.active {
  color: var(--button-bg);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--button-bg), var(--button-hover));
  border-radius: 1px;
}

/* 主内容区域 */
main {
  flex: 1;
  padding: 3rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

#intro {
  background-color: var(--bg-color);
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 2rem 0;
  gap: 1rem;
  text-align: center;
}

#intro {
  text-align: center;
  animation: fadeIn 0.8s ease-out forwards;
  opacity: 0;
}

#search-container {
  animation: fadeIn 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

#download a {
  display: flex;
  flex-direction: row;
  gap: 4px;
  background-color: var(--download-bg);
  color: var(--text-color);
  padding: 1em 2em;
  text-decoration: none;
  border-radius: 5px;
  text-align: left;
  transition: all 0.3s ease;
  opacity: 0;
}

/* 为每个下载链接添加不同的动画延迟 */
#download a:nth-child(1) {
  animation: fadeIn 0.5s ease-out 0.4s forwards;
}
#download a:nth-child(2) {
  animation: fadeIn 0.5s ease-out 0.5s forwards;
}
#download a:nth-child(3) {
  animation: fadeIn 0.5s ease-out 0.6s forwards;
}
#download a:nth-child(4) {
  animation: fadeIn 0.5s ease-out 0.7s forwards;
}
#download a:nth-child(5) {
  animation: fadeIn 0.5s ease-out 0.8s forwards;
}
#download a:nth-child(6) {
  animation: fadeIn 0.5s ease-out 0.9s forwards;
}
#download a:nth-child(7) {
  animation: fadeIn 0.5s ease-out 1s forwards;
}
#download a:nth-child(8) {
  animation: fadeIn 0.5s ease-out 1.1s forwards;
}
#download a:nth-child(9) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(10) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(11) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(12) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(13) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(14) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}
#download a:nth-child(15) {
  animation: fadeIn 0.5s ease-out 1.2s forwards;
}

#intro h1 {
  font-size: 4em;
  margin: 0;
  padding: 0;
}

#intro h2 {
  font-size: 2em;
  margin: 0;
  padding: 0;
}

#intro p {
  font-size: 1.2em;
  color: var(--text-color);
  margin: 0;
  padding: 0;
}

#intro a {
  margin: 0;
  padding: 0;
  color: var(--link-color);
  transition: 0.3s;
}

#intro a:hover {
  color: var(--link-hover-color);
}

#download {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#download a {
  display: flex;
  flex-direction: row;
  gap: 4px;
  background-color: var(--download-bg);
  color: var(--text-color);
  padding: 1em 2em;
  text-decoration: none;
  border-radius: 5px;
  text-align: left;
  transition: 0.3s;
}

#download a:hover {
  box-shadow: var(--shadow-color) 0px 0px 20px;
  transform: scale(1.03);
}

/* 搜索框容器样式 - 现代简洁设计 */
#search-container > div {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 1.5rem auto;
  display: flex;
  align-items: center;
  background: var(--download-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#search-container > div:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

#search-container > div:focus-within {
  box-shadow: 0 0 0 3px var(--search-focus), 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--button-bg);
}

/* 搜索框样式 */
#search-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: var(--text-color);
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

#search-input:focus::placeholder {
  opacity: 0.3;
}

/* 搜索按钮样式 */
#search-button {
  padding: 0.75rem 1rem;
  margin: 0.25rem;
  background: linear-gradient(135deg, var(--button-bg), var(--button-hover));
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 80px;
}

#search-button:hover {
  background: linear-gradient(135deg, rgb(255, 190, 90), rgb(255, 178, 77));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 178, 77, 0.4);
}

#search-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

#search-button i {
  font-size: 1rem;
}

/* 移动端适配 - 重新设计 */
@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 0;
    min-height: 70px;
  }

  .nav-container {
    padding: 0 1rem;
    gap: 1rem;
  }

  .nav-brand {
    font-size: 1.3rem;
  }

  .nav-search {
    max-width: 300px;
  }

  .nav-search #search-input {
    padding: 0.75rem 1rem;
    padding-right: 3.5rem;
    font-size: 0.95rem;
    height: 40px;
  }

  .nav-search #search-button {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    height: 32px;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.9rem;
  }

  main {
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0.75rem 0;
    min-height: 70px;
  }

  .nav-container {
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .nav-brand {
    order: 1;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
  }

  .nav-search {
    order: 2;
    max-width: 100%;
    margin: 0;
    flex: 1 1 100%;
  }

  .nav-search #search-input {
    padding: 0.75rem 1rem;
    padding-right: 3.5rem;
    height: 40px;
  }

  .nav-search #search-button {
    height: 32px;
  }

  .nav-links {
    order: 3;
    gap: 1rem;
    margin-top: 0.5rem;
    width: 100%;
    justify-content: center;
  }

  #intro {
    margin-top: 1rem;
  }

  #intro h1 {
    font-size: 2.2em;
  }

  #intro h2 {
    font-size: 1.4em;
  }

  #intro p {
    font-size: 1em;
  }

  #download a {
    transition: all 0.3s ease;
  }

  #download a:hover {
    box-shadow: rgba(255, 255, 255, 0.5) 0px 0px 20px;
    transform: scale(1.03);
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.75rem 0;
    min-height: 70px;
    /* 移除硬编码的深色背景 */
  }

  .nav-container {
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .nav-brand {
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .nav-search {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .nav-search #search-input {
    padding: 0.65rem 0.9rem;
    padding-right: 3.5rem;
    font-size: 0.9rem;
    height: 38px;
  }

  .nav-search #search-button {
    padding: 0.35rem 0.5rem;
    height: 30px;
  }

  .nav-links {
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }
}

/* 搜索结果动画 */
.search-result-enter {
  animation: resultSlideIn 0.4s ease-out forwards;
}

.search-result-exit {
  animation: resultSlideOut 0.3s ease-in forwards;
}

/* 搜索结果进入动画 */
@keyframes resultSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 搜索结果退出动画 */
@keyframes resultSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

/* 无结果提示动画 */
#no-results {
  display: none;
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
  animation: scaleIn 0.3s ease-out forwards;
}

#download a i {
  color: rgb(255, 178, 77);
  margin: 0;
}

/* 滚动条美化 */
/* WebKit 浏览器 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--search-bg);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--button-bg);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--button-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--button-bg) var(--search-bg);
}
