:root {
    --background: 210 40% 98%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 221.2 83.2% 53.3%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 221.2 83.2% 53.3%;
    --radius: 0.5rem;
  }
  
  .dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 223 47% 11%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 217.2 91.2% 59.8%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --secondary: 217.2 32.6% 17.5%;
    --secondary-foreground: 210 40% 98%;
    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;
    --accent: 217.2 32.6% 17.5%;
    --accent-foreground: 210 40% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 210 40% 98%;
    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;
    --ring: 224.3 76.3% 48%;
  }
  
  * {
    border-color: hsl(var(--border));
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    padding-top: 60px; /* 添加上边距，值应该大于或等于导航栏的高度 */
  }
  
  .container {
    max-width: 65ch;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    background-color: hsl(var(--background));
  }
  
  .card {
    background-color: hsl(var(--card));
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    text-align: left;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s, color 0.2s;
    border: none; /* 确保没有边框 */
    outline: none; /* 移除焦点时的轮廓 */
    cursor: pointer; /* 添加鼠标指针样式 */
    height: 2.5rem; /* 统一高度 */
    line-height: 2.5rem;
  }
  
  .btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
  }
  
  .btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
  }
  
  .btn-primary:focus {
    box-shadow: 0 0 0 2px hsl(var(--ring)); /* 添加焦点样式 */
  }
  
  .input, .select {
    width: 100%;
    border-radius: var(--radius);
    padding: 0.5rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--input));
    height: 2.5rem; /* 统一高度 */
    line-height: 2.5rem;
  }
  
  .input:focus, .select:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
  }
  
  .label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: block;
  }
  
  .form-item {
    margin-bottom: 1rem;
  }
  
  .map {
    width: 100%;
    height: 300px;
    border-radius: var(--radius);
  }
  
  .toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 1rem;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  }
  
  .hidden {
    display: none;
  }
  
  .text-4xl {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }
  
  .font-bold {
    font-weight: 700;
  }
  
  .mb-2 {
    margin-bottom: 0.5rem;
  }
  
  .mb-4 {
    margin-bottom: 1rem;
  }
  
  .mb-6 {
    margin-bottom: 1.5rem;
  }
  
  .mt-4 {
    margin-top: 1rem;
  }
  
  .mt-8 {
    margin-top: 2rem;
  }
  
  .text-muted-foreground {
    color: hsl(var(--muted-foreground));
  }
  
  .text-destructive {
    color: hsl(var(--destructive));
  }
  
  .grid {
    display: grid;
  }
  
  .gap-4 {
    gap: 1rem;
  }
  
  .flex {
    display: flex;
  }
  
  .items-center {
    align-items: center;
  }
  
  .space-x-2 > * + * {
    margin-left: 0.5rem;
  }
  
  .text-sm {
    font-size: 0.875rem;
  }
  
  .underline {
    text-decoration: underline;
  }

  .address-block {
    margin-bottom: 1.5rem;
  }
  
  .generated-address {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 1.1rem;
    line-height: 1.5;
    cursor: pointer;
    border: 1px solid hsl(var(--border));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .generated-address > div {
    margin-bottom: 0.5rem;
    transition: background-color 0.2s;
  }

  .generated-address > div:hover {
    background-color: hsl(var(--accent));
  }

  .generated-address > div:last-child {
    margin-bottom: 0;
  }
  
  .toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0.9;
  }
  
  .hidden {
    display: none;
  }
  
  .btn-secondary {
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
  }

  .btn-secondary:hover {
    background-color: hsl(var(--secondary) / 0.8);
  }
  
  .btn-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
  }

  .btn-group .btn {
    flex: 0 0 48%; /* 调整按钮宽度 */
  }

  .top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: white; /* 改为白色 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: fixed; /* 固定位置 */
    top: 0; /* 置顶 */
    left: 0; /* 确保左对齐 */
    right: 0; /* 确保右对齐 */
    z-index: 1000; /* 确保在最上层 */
  }

  /* 为暗黑模式添加特定样式 */
  .dark .top-nav {
    background-color: hsl(var(--card)); /* 使用暗色主题的卡片颜色 */
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1); /* 调整阴影颜色 */
  }

  /* 调整 logo 颜色以适应不同背景 */
  .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: hsl(var(--foreground));
    padding-left: 1rem;
    cursor: pointer;
  }

  .dark .logo {
    color: hsl(var(--card-foreground));
  }

  /* 确保其他导航元素在暗黑模式下也可见 */
  .dark .language-button,
  .dark .theme-toggle {
    color: hsl(var(--card-foreground));
  }

  /* 调整语言菜单在暗黑模式下的样式 */
  .dark .language-menu {
    background-color: hsl(var(--card));
    border-color: hsl(var(--border));
  }

  .dark .language-menu a {
    color: hsl(var(--card-foreground));
  }

  .dark .language-menu a:hover {
    background-color: hsl(var(--accent));
  }

  .language-selector {
    position: relative;
    margin-right: 1rem;
  }

  .language-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: hsl(var(--foreground));
  }

  .language-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.5rem 0;
    z-index: 10;
    min-width: 120px; /* 增加宽度 */
  }

  .language-menu.show {
    display: block;
  }

  .language-menu li {
    list-style: none;
  }

  .language-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: hsl(var(--foreground));
    text-decoration: none;
  }

  .language-menu a:hover {
    background-color: hsl(var(--accent));
  }

  .theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding-right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .light-mode-icon, .dark-mode-icon {
    display: none;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
  }

  .nav-controls {
    display: flex; /* 确保使用 flexbox */
    align-items: center; /* 垂直居中对齐 */
    gap: 1rem; /* 添加间距 */
  }