:root {
    --background: 0 0% 100%;
    --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: 148, 63%, 28%;
    --primary-foreground: 0, 0%, 100%;
    --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: 222.2 84% 4.9%;
    --radius: 0.5rem;
    --nav-height: 60px;
    --nav-bg: hsl(var(--background));
    --nav-border: hsl(var(--border));
    --nav-text: hsl(var(--foreground));
    --nav-hover: hsl(var(--muted));
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, hsl(var(--background)) 0%, hsl(var(--muted)) 100%);
    color: hsl(var(--foreground));
    padding-top: var(--nav-height);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* 防止横向滚动 */
    width: 100%;
}

.container {
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem; /* 减小内边距 */
    background-color: hsl(var(--card));
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    flex: 1;
    box-sizing: border-box; /* 确保padding不会导致宽度溢出 */
}

.title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;  /* 减小底部边距 */
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 600px; /* 调整这个值来改变表单的最大宽度 */
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.label {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

/* 合并原有的输入框样式和新的对齐样式 */
.input, .select, .button, .form-input-aligned {
    width: 100%;
    max-width: 600px; /* 调整这个值来改变输入框的最大宽度 */
    margin: 0 auto;
    display: block;
    padding: 0.5rem;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-sizing: border-box;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.input:focus, .select:focus, .form-input-aligned:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* 特别处理 select 元素 */
select.form-input-aligned, .select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.button,
button[type="submit"],
#generateButton {
    background-color: hsl(148, 63%, 28%) !important;
    color: #ffffff !important;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.button:hover,
button[type="submit"]:hover,
#generateButton:hover,
.button:focus,
button[type="submit"]:focus,
#generateButton:focus {
    background-color: hsl(148, 48%, 37%) !important;
    color: #ffffff !important;
}

.button:active,
button[type="submit"]:active,
#generateButton:active {
    background-color: hsl(148, 32%, 27%) !important;
    color: #ffffff !important;
}

/* 为暗模式添加特定样式 */
body.dark .button {
    background-color: hsl(var(--primary));
    color: hsl(var(--background));
}

body.dark .button:hover, 
body.dark .button:focus {
    background-color: hsl(var(--primary) / 0.8);
    color: hsl(var(--background));
}

body.dark .button:active {
    background-color: hsl(var(--primary) / 0.9);
    color: hsl(var(--background));
}

.results {
    margin-top: 2rem;
}

.hidden {
    display: none;
}

.subtitle {
    font-size: 1rem;
    text-align: center;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;  /* 增加底部边距与表单分开 */
}

.subtitle a, .footer a {
    color: hsl(148, 63%, 28%);
    text-decoration: none;
    transition: color 0.2s ease;
}

.subtitle a:hover, .footer a:hover {
    color: hsl(148, 48%, 37%);
    text-decoration: underline;
}

body.dark .subtitle a, body.dark .footer a {
    color: hsl(148, 63%, 48%);
}

body.dark .subtitle a:hover, body.dark .footer a:hover {
    color: hsl(148, 63%, 58%);
}

.title-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.title-list div {
    padding: 1rem;
    background-color: hsl(var(--secondary));
    border-radius: var(--radius);
    color: hsl(var(--secondary-foreground));
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.title-list div:hover {
    background-color: hsl(var(--accent));
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 1000;
}

body.dark .top-nav {
    background-color: hsl(var(--card));
    border-bottom-color: hsl(var(--border));
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--nav-text);
    cursor: pointer;
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector {
    position: relative;
    display: flex;
}

.language-button {
    background: none;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
}

.language-menu {
    position: absolute;
    min-width: 100px;
    top: 100%;
    right: 0;
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1001;
}

body.dark .language-menu {
    background-color: hsl(var(--card));
}

.language-selector:hover .language-menu {
    display: block;
}

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

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

/* 暗黑模式样式 */
body.dark .language-button {
    color: hsl(var(--foreground));
}

body.dark .language-menu {
    background-color: hsl(var(--card));
    border-color: hsl(var(--border));
}

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

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

.theme-toggle {
    background: none;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.dark-mode-icon {
    display: none;
}

body.dark .light-mode-icon {
    display: none;
}

body.dark .dark-mode-icon {
    display: inline;
}

/* Dark mode styles */
body.dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;
    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;
    --primary: 210 40% 98%;
    --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: 212.7 26.8% 83.9%;
}

/* 保留原有的其他样式 */

/* 在文件末尾添加以下样式 */

.footer {
    background-color: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.875rem;
}

.footer p {
    margin: 0.5rem 0;
}

/* 确保页面内容不会被 footer 遮挡 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
}

.form-group {
    position: relative;
    margin-bottom: 10px;
}

.char-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
}

.logo-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo-image {
    height: 30px; /* 根据您的 logo 大小调整 */
    width: auto;
    margin-right: 10px;
}

.logo-text {
    font-size: 18px; /* 根据需要调整字体大小 */
    font-weight: bold;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.loading.hidden {
    display: none;
}

.spinner {
    border: 4px solid hsl(var(--muted));
    border-top: 4px solid hsl(var(--primary));
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* 反馈区块样式 */
.feedback-container {
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
}

.feedback-section {
    padding: 2rem;
    background-color: hsl(var(--card));
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    text-align: center;
}

.feedback-title {
    font-size: 1.2rem; /* 修改基础字号 */
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 1rem;
}

.feedback-text {
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.qr-code {
    max-width: 200px;
    margin: 0 auto;
    padding: 1rem;
    background-color: white;
    border-radius: var(--radius);
}

.qr-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Testimonials 样式 */
.testimonials-container {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 0;
}

.testimonials-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 2rem;
}

@media (max-width: 640px) {
    .testimonials-title,
    .feedback-title {
        font-size: 1.25rem;
    }
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.testimonial-card {
    background-color: hsl(var(--card));
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.testimonial-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.testimonial-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.6;
    color: hsl(var(--foreground));
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.author-title {
    color: hsl(var(--muted-foreground));
    font-size: 0.9rem;
    margin: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .testimonial-card {
        padding: 1.5rem;
    }

    .testimonial-text {
        font-size: 1rem;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    padding: 12px 24px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid hsl(var(--border));
}

.toast.show {
    opacity: 1;
}

body.dark .toast {
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
}

/* CTA Section */
.cta-container {
    width: 90%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.1) 0%, hsl(var(--secondary)) 100%);
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    box-sizing: border-box;  /* 确保 padding 不会增加总宽度 */
}

.cta-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 100%;  /* 确保内容不会超出容器 */
}

.cta-text {
    font-size: 1rem;
    line-height: 1.6;
    color: hsl(var(--foreground));
}

.cta-button {
    background-color: hsl(148, 63%, 28%);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cta-button:hover {
    background-color: hsl(148, 48%, 37%);
}

.cta-button:active {
    background-color: hsl(148, 32%, 27%);
}

/* Dark mode styles */
body.dark .cta-container {
    background: linear-gradient(135deg, hsl(var(--primary) / 0.2) 0%, hsl(var(--secondary) / 0.1) 100%);
}

body.dark .cta-button {
    background-color: hsl(var(--primary));
    color: hsl(var(--background));
}

body.dark .cta-button:hover {
    background-color: hsl(var(--primary) / 0.8);
}

body.dark .cta-button:active {
    background-color: hsl(var(--primary) / 0.9);
}

/* Responsive styles */
@media (max-width: 640px) {
    .cta-container {
        padding: 1.5rem;
    }

    .cta-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cta-button {
        display: block;
        width: 100%;
        padding: 0.75rem;
    }
}

@media (max-width: 640px) {
    .container {
        width: 95%;
        padding: 1rem 0.5rem;
        margin: 1rem auto;
    }
    
    .title {
        font-size: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .subtitle {
        padding: 0 0.5rem;
    }
    
    .form {
        padding: 0 0.5rem;
    }
    
    .input, .select, .button, .form-input-aligned {
        max-width: 100%;
    }
}