/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 首页横幅 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-block;
    background-color: #ff6b6b;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.cta-button:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 通用区块样式 */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 1rem auto;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 3rem;
}

/* 知识板块样式 */
.knowledge-section {
    padding: 4rem 0;
    background-color: white;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.knowledge-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.knowledge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.knowledge-card h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.knowledge-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.knowledge-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.knowledge-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.calculation-method,
.lucky-numbers,
.industry-principles {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    border-left: 4px solid #667eea;
}

.calculation-method h4,
.lucky-numbers h4,
.industry-principles h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.calculation-method ol {
    margin-left: 1.5rem;
}

.calculation-method li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 起名表单样式 */
.calculator-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.naming-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.8rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.submit-btn,
.reset-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background-color: #6c757d;
    color: white;
}

.reset-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

/* 结果显示样式 */
.results-section {
    margin-top: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.results-section h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.name-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.name-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.name-item:hover {
    transform: translateY(-3px);
}

.name-item h4 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.name-analysis {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

.name-analysis .analysis-item {
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    background-color: white;
    border-radius: 6px;
}

.name-analysis .analysis-label {
    font-weight: bold;
    color: #667eea;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 关于我们样式 */
.about-section {
    padding: 4rem 0;
    background-color: white;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #555;
}

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.feature-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.feature-item h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #666;
    line-height: 1.6;
}

/* 页脚样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

/* 友情链接样式 */
.footer-links {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links h4 {
    color: #ecf0f1;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.8rem;
    max-width: 1000px;
    margin: 0 auto;
}

.links-grid a {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.links-grid a:hover {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
    border-color: rgba(52, 152, 219, 0.3);
    transform: translateY(-2px);
}

/* 版权和备案信息样式 */
.footer-info {
    text-align: center;
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: #bdc3c7;
}

.beian-info {
    margin-top: 0.5rem;
}

.beian-info a {
    color: #95a5a6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.beian-info a:hover {
    color: #ecf0f1;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .knowledge-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .knowledge-card {
        padding: 1.5rem;
    }

    .naming-form {
        padding: 2rem 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: center;
    }

    .submit-btn,
    .reset-btn {
        width: 100%;
        max-width: 300px;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .name-results {
        grid-template-columns: 1fr;
    }

    /* 友情链接移动端样式 */
    .links-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.6rem;
    }

    .links-grid a {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .footer-links h4 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-content h2 {
        font-size: 1.6rem;
    }

    .knowledge-section,
    .calculator-section,
    .about-section {
        padding: 2rem 0;
    }

    .knowledge-card {
        padding: 1rem;
    }

    .naming-form {
        padding: 1.5rem 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    /* 小屏幕友情链接样式 */
    .footer {
        padding: 2rem 0 1rem;
    }

    .footer-links {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .links-grid a {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .footer-links h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .footer-info p {
        font-size: 0.9rem;
    }

    .beian-info a {
        font-size: 0.8rem;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择框美化 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

/* 输入框聚焦效果 */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: translateY(-1px);
}

/* 卡片悬停效果增强 */
.knowledge-card,
.feature-item,
.name-item {
    position: relative;
    overflow: hidden;
}

.knowledge-card::before,
.feature-item::before,
.name-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.knowledge-card:hover::before,
.feature-item:hover::before,
.name-item:hover::before {
    left: 100%;
}

/* 按钮点击效果 */
.submit-btn:active,
.reset-btn:active,
.cta-button:active {
    transform: translateY(0);
}

/* 错误提示样式 */
.error-message {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.error .error-message {
    display: block;
}

/* 成功提示样式 */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin-bottom: 1rem;
    display: none;
}

/* 加载状态按钮 */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}