/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    background-color: #f8f5f0;
    color: #333;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 30px 0;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.title {
    font-size: 2.5rem;
    color: #8B9D5E;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-link {
    color: #8B7355;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.nav-link:hover,
.nav-link.active {
    background-color: #8B9D5E;
    color: white;
}

/* 主内容样式 */
.main-content {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    min-height: 500px;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 控制区域样式 */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
}

.controls .form-group {
    flex: 1;
    min-width: 150px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #8B7355;
    font-weight: bold;
}

.book-select,
#family-name,
.gender-select,
.name-length {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #E6D5B8;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #f8f5f0;
    transition: border-color 0.3s ease;
}

.book-select:focus,
#family-name:focus,
.gender-select:focus,
.name-length:focus {
    outline: none;
    border-color: #8B9D5E;
}

.generate-btn {
    background-color: #8B9D5E;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.generate-btn:hover {
    background-color: #7A8A4E;
}

.generate-btn:active {
    transform: scale(0.98);
}

/* 加载样式 */
.loading {
    text-align: center;
    padding: 50px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8B9D5E;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 名字容器样式 */
.names-container {
    margin-top: 30px;
}

.section-title {
    color: #8B7355;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* 名字卡片样式 */
.name-card {
    background-color: #f8f5f0;
    border: 1px solid #E6D5B8;
    border-radius: 10px;
    padding: 20px;
}

/* 高亮诗句中的名字部分 */
.highlight-name {
    color: #CD5C5C;
    font-weight: bold;
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.name-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.full-name {
    font-size: 1.8rem;
    color: #8B9D5E;
    font-weight: bold;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ccc;
    transition: color 0.3s ease;
}

.favorite-btn.favorited {
    color: #e74c3c;
}

.favorite-btn:hover {
    color: #e74c3c;
}

.name-details {
    color: #666;
    font-size: 0.95rem;
}

.name-details p {
    margin-bottom: 8px;
}

.name-details .sentence {
    font-style: normal;
    color: #8B7355;
    font-family: 'SimSun', serif;
}

.name-details .source {
    font-size: 0.9rem;
    color: #999;
    font-family: 'SimSun', serif;
}

/* 收藏页面样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.clear-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.favorites-container {
    min-height: 300px;
}

.no-favorites {
    text-align: center;
    padding: 50px 0;
    color: #999;
}

/* 关于页面样式 */
.about-content {
    line-height: 1.8;
}

.about-content h3 {
    color: #8B7355;
    margin: 25px 0 15px;
}

.about-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.about-content li {
    margin-bottom: 10px;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    color: #8B7355;
    font-size: 0.9rem;
}

/* 简化样式，移除了不再使用的通知样式 */

/* 加载提示文本样式 */
.loading-text {
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    margin: 10px 0;
    transition: all 0.3s ease;
}

/* 搜索中状态样式 */
.loading-text.searching {
    color: #4a6fa5; /* 蓝色系，代表探索 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* 成功状态样式 */
.loading-text.success {
    color: #28a745; /* 绿色系，代表成功 */
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    animation: pulse 0.6s ease-in-out;
}

/* 简单的脉冲动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 容器和整体布局调整 */
    .container {
        padding: 10px;
    }
    
    .header {
        padding: 20px 0;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    .title {
        font-size: 1.8rem;
        margin-bottom: 15px;
        gap: 8px;
    }
    
    .main-content {
        padding: 20px;
        min-height: auto;
        border-radius: 8px;
    }
    
    .nav {
        gap: 10px;
    }
    
    .nav-link {
        padding: 6px 15px;
        font-size: 1rem;
    }
    
    /* 控制区域调整 */
    .controls {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        align-items: stretch;
    }
    
    .form-group {
        width: 100%;
        min-width: auto;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .book-select,
    #family-name {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .generate-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 1.1rem;
    }
    
    /* 加载状态调整 */
    .loading {
        padding: 30px 0;
    }
    
    .loading-spinner {
        width: 30px;
        height: 30px;
        margin-bottom: 15px;
    }
    
    /* 名字卡片区域调整 */
    .names-container {
        margin-top: 20px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .names-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .name-card {
        padding: 15px;
    }
    
    .full-name {
        font-size: 1.6rem;
    }
    
    .name-details {
        font-size: 0.9rem;
    }
    
    /* 页面头部调整 */
    .page-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        margin-bottom: 15px;
    }
    
    .clear-btn {
        justify-content: center;
    }
    
    /* 收藏页面调整 */
    .favorites-container {
        min-height: 200px;
    }
    
    .no-favorites {
        padding: 30px 0;
    }
    
    /* 关于页面调整 */
    .about-content h3 {
        margin: 20px 0 10px;
        font-size: 1.2rem;
    }
    
    .about-content ul {
        margin-left: 15px;
        margin-bottom: 15px;
    }
    
    .about-content li {
        margin-bottom: 8px;
        font-size: 0.9rem;
    }
    
    /* 页脚调整 */
    .footer {
        padding: 15px 0;
        margin-top: 20px;
        font-size: 0.8rem;
    }
}

/* 小屏幕手机额外优化 */
@media (max-width: 480px) {
    .title {
        font-size: 1.6rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .full-name {
        font-size: 1.4rem;
    }
    
    .name-details .sentence {
        font-size: 0.85rem;
    }
    
    .loading-text {
        font-size: 1rem;
    }
}