/* 响应式设计与美化样式 */
:root {
    --primary-color: #5d8c6e;
    --primary-light: #7ba98c;
    --primary-dark: #3e6b4f;
    --secondary-color: #6a8caf;
    --accent-color: #e6a954;
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-light: #666;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --card-shadow: 0 6px 16px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: "Microsoft Yahei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    background-attachment: fixed;
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header p {
    color: var(--text-light);
    font-size: 16px;
}

.input-group {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 100px 1fr;
    align-items: center;
    gap: 15px;
}

.input-group label {
    font-weight: 500;
    color: var(--text-color);
}

select, input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    width: 100%;
    transition: var(--transition);
    background-color: var(--light-bg);
}

.short-input {
    width: 60%;
    min-width: 120px;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 140, 110, 0.2);
}

/* 输入错误时的闪烁效果 */
.input-error {
    animation: errorBlink 1.5s ease-in-out infinite;
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

@keyframes errorBlink {
    0% { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2); }
    50% { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.4); }
    100% { border-color: #e74c3c; box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2); }
}

button {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    margin: 25px 0;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

button:hover {
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 加载更多按钮样式 */
#load-more-btn {
    margin: 25px auto;
    width: auto;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--secondary-color), #8aa7c5);
    display: block;
    transition: var(--transition);
}

#load-more-btn:hover {
    background: linear-gradient(to right, #5a7a9a, var(--secondary-color));
}

#load-more-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#result-container {
    margin-top: 35px;
    animation: fadeIn 0.5s ease-in-out;
}

#result-container h3 {
    color: var(--primary-dark);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

#result-container h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

.name-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.name-card {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardAppear 0.4s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    border-color: rgba(93, 140, 110, 0.3);
}

.name-card:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    opacity: 0.8;
}

.name-card .name {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 12px;
    color: var(--text-color);
    text-align: center;
    letter-spacing: 1px;
}

.name-card .attributes {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    color: var(--text-light);
    font-size: 14px;
}

.name-meaning {
    margin-top: 12px;
    font-size: 15px !important;
    color: var(--text-light) !important;
    line-height: 1.6;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary-light);
}

.loading {
    text-align: center;
    padding: 25px;
    animation: fadeIn 0.3s ease-in-out;
}

.loading-spinner {
    border: 4px solid rgba(93, 140, 110, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    width: 36px;
    height: 36px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading p {
    color: var(--text-light);
    font-size: 16px;
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        padding: 20px;
        border-radius: 12px;
    }
    
    .input-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .name-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .name-card {
        padding: 15px;
    }
    
    .name-card .name {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .name-list {
        grid-template-columns: 1fr;
    }
    
    .name-meaning {
        font-size: 14px !important;
    }
    
    .header h2 {
        font-size: 24px;
    }
    
    button {
        padding: 12px 20px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* 页脚样式 */
.site-footer {
    margin-top: 40px;
    background-color: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.18);
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin-right: 20px;
}

.footer-section:last-child {
    margin-right: 0;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.footer-section p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    margin-top: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--light-bg);
    border-radius: 50%;
    margin-right: 10px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    padding: 15px 30px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    background-color: var(--light-bg);
}

.footer-bottom a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}