/* styles.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
}

header {
    background-color: #003366;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
}

header nav {
    margin-top: 1rem;
}

header nav a {
    color: white;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid white;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

header nav a:hover {
    background-color: white;
    color: #003366;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    header nav a {
        display: block;
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    main h2 {
        font-size: 1.5rem;
    }
    
    .database-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .database-card {
        padding: 1rem;
    }
    
    /* 数据库国产化进行时模块在手机模式下的样式 */
    .db-evolution-header {
        flex-direction: column;
        text-align: center;
    }
    
    .db-evolution-header h2 {
        font-size: 1.2rem;
        margin: 5px 0;
    }
    
    .db-evolution-header img {
        height: 15px;
        margin: 5px 0;
    }
}

main h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #003366;
    text-align: center;
}

.database-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.database-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.database-card:hover {
    transform: translateY(-5px);
}

.database-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    background-color: #0066cc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.database-name {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.database-services {
    text-align: left;
}

.database-services h3 {
    color: #003366;
    margin-bottom: 0.5rem;
}

.database-services ul {
    list-style-type: none;
}

.database-services li {
    padding: 0.3rem 0;
    border-bottom: 1px solid #eee;
}

.database-services li:last-child {
    border-bottom: none;
}

.database-services li:before {
    content: "✓";
    color: #00cc66;
    margin-right: 0.5rem;
}

.database-services a {
    color: #0066cc;
    text-decoration: none;
}

.database-services a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 1rem 0;
    background-color: #003366;
    color: white;
    margin-top: 2rem;
}

/* 数据库国产化进行时模块样式 */
.db-evolution-header {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    flex-wrap: wrap;
}

.db-evolution-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #003366;
}

.db-evolution-header img {
    height: 30px;
    margin: 0 10px;
}

/* 重要客户图片悬停效果 */
.item {
    transition: transform 0.3s ease;
}

.item:hover {
    transform: translateY(-10px);
}

/* 回到顶端按钮样式 */
#backToTop {
    display: none; /* 默认隐藏 */
    position: fixed; /* 固定位置 */
    bottom: 20px; /* 距离底部20px */
    right: 30px; /* 距离右侧30px */
    z-index: 99; /* 确保在最上层 */
    border: none; /* 无边框 */
    outline: none; /* 无轮廓 */
    background-color: #003366; /* 背景色 */
    color: white; /* 文字颜色 */
    cursor: pointer; /* 鼠标指针 */
    padding: 10px; /* 内边距 */
    border-radius: 10px; /* 圆角 */
    font-size: 14px; /* 字体大小 */
    width: auto; /* 宽度自适应 */
    height: auto; /* 高度自适应 */
    text-align: center; /* 文字居中 */
}

#backToTop:hover {
    background-color: #0066cc; /* 悬停时的背景色 */
}

/* About and Cases section styles */
#about, #cases {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 2rem;
}

#about h2, #cases h2 {
    color: #003366;
    margin-bottom: 1rem;
    text-align: center;
}

#about p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

#cases table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#cases td {
    padding: 1rem;
    vertical-align: top;
}

#cases img {
    max-width: 100px;
    height: auto;
    display: block;
    margin-bottom: 0.5rem;
}

/* New grid styles for cases */
#cases .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

#cases .item {
    padding: 0 10px;
    margin-bottom: 20px;
    width: 50%; /* 默认每行2个 */
}

@media (min-width: 768px) {
    #cases .item {
        width: 25%; /* 中等屏幕每行4个 */
    }
}

@media (min-width: 992px) {
    #cases .item {
        width: 16.666%; /* 大屏幕每行6个 */
    }
}

#cases .item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

#cases .zoom {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

#cases .zoom .valign-center {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    text-decoration: none;
}

#cases .zoom:hover .valign-center {
    opacity: 1;
}

#cases .valign-center-elem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

#cases .valign-center-elem h2 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

#cases .valign-center-elem b {
    color: #4CAF50;
}

#products, #cases, #join, #contact, #projects {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 2rem;
}

#products h2, #cases h2, #join h2, #contact h2, #projects h2 {
    color: #003366;
    margin-bottom: 1rem;
    text-align: center;
}

#products p, #cases p, #join p, #contact p, #projects p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

#products ul, #cases ul, #join ul, #contact ul, #projects ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

#products li, #join li, #contact li, #projects li {
    margin-bottom: 5px;
}