/* 全局重置与基础样式 - 放在最顶部，确保优先级 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    background-color: #f0f5ff;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* 核心：重置form样式，解决宽度问题 */
form#form1 {
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-sizing: border-box;
    display: block;
}

/* 隐藏ASP.NET自动生成的VIEWSTATE等冗余div */
.aspNetHidden {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
}

/* 主容器样式 */
#mainDiv {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

#form1 > div {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #1e6ed8 0%, #0f54b3 100%);
    color: white;
    padding: 30px 0;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(30, 110, 216, 0.2);
    margin-bottom: 30px;
    width: 100%;
}

.logo {
    text-align: center;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: bold;
}

.logo a {
    color: white !important;
    text-decoration: none !important;
}

.subtitle {
    text-align: center;
    font-size: 16px;
    color: #e0e9ff;
    margin-bottom: 15px;
}

#pcad {
    color: #f0f5ff;
    font-size: 15px;
    padding: 10px 20px;
    text-align: center;
}

/* 导航样式 - 重构布局逻辑，解决错乱问题 */
nav {
    background-color: #1e6ed8;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(30, 110, 216, 0.2);
    margin-bottom: 30px;
    width: 100%;
    overflow: hidden; /* 防止子元素溢出导致错乱 */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-container ul {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0; /* 重置间距，避免多余空白 */
}

.nav-container li {
    padding: 0; /* 重置内边距，由a标签控制 */
}

.nav-container a {
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 15px 20px; /* 把padding放在a标签，确保点击区域完整 */
    border-radius: 8px;
    display: block;
    white-space: nowrap; /* 防止文字换行导致导航项高度不一致 */
}

.nav-container a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 搜索框样式 */
.search-container {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-select {
    padding: 12px 15px;
    border: 2px solid #1e6ed8;
    border-radius: 8px;
    background-color: white;
    color: #0f54b3;
    font-size: 16px;
    font-weight: 500;
    min-width: 100px;
    outline: none;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    border: 2px solid #e0e9ff;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: #1e6ed8;
    box-shadow: 0 0 0 3px rgba(30, 110, 216, 0.1);
}

.search-button {
    padding: 12px 30px;
    background: linear-gradient(135deg, #1e6ed8 0%, #0f54b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 110, 216, 0.3);
}

/* 内容容器样式 */
.container {
    margin-bottom: 40px;
    width: 100%;
    padding: 0 5px;
}

.gallery-title {
    color: #0f54b3;
    font-size: 24px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: bold;
    position: relative;
    padding-bottom: 15px;
}

.gallery-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #1e6ed8, #4a8ef0);
    border-radius: 2px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
    margin: 0 auto;
}

/* 作品卡片样式 - 合并重复定义，解决布局冲突 */
.artwork {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.artwork:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(30, 110, 216, 0.15);
}

/* 作品图片样式 */
.artwork-img {
    width: 100%;
    height: auto;
    min-height: 200px;
    object-fit: contain;
    background-color: #f8fbff;
    border-bottom: 1px solid #f0f5ff;
    display: block;
}

.artwork-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px; /* 补充内边距，避免文字贴边 */
}

.artwork-title {
    color: #0f54b3;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
}

.artist {
    color: #1e6ed8;
    font-weight: 500;
    margin-bottom: 5px;
}

.age {
    color: #666;
    font-size: 14px;
}

/* SU标签样式 */
.su-tags-wrapper {
    margin-top: 15px;
}

.toggle-tags-btn {
    display: none !important;
}

.su-tags-container1 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding: 15px;
    background-color: #f8fbff;
    border-radius: 8px;
    justify-content: center;
    max-height: 120px;
    overflow: hidden;
}

.su-tag {
    padding: 6px 12px;
    background-color: #e0e9ff;
    color: #0f54b3;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    display: inline-block;
}

.su-tag:hover {
    background-color: #1e6ed8;
    color: white;
}

/* 底部样式 */
footer {
    background: linear-gradient(135deg, #1e6ed8 0%, #0f54b3 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 20px 20px 0 0;
    margin-top: 50px;
    text-align: center;
    width: 100%;
}

.footer-logo {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 20px;
}

.copyright {
    margin: 20px 0;
    color: #e0e9ff;
}

.beian-link {
    color: #e0e9ff;
    text-decoration: none;
}

.beian-link:hover {
    color: white;
    text-decoration: underline;
}

/* 回到顶部/底部按钮样式 */
.go-top-bottom {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.go-top, .go-bottom {
    width: 44px;
    height: 44px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    border: none;
}
.go-top:hover, .go-bottom:hover {
    opacity: 1;
}

/* 响应式调整 */
/* 平板端 */
@media (max-width: 768px) {
    .artwork-img {
        min-height: 180px;
    }
    
    /* 移动端隐藏导航栏和标签 */
    nav {
        display: none !important;
    }
    .su-tags-wrapper {
        display: none !important;
    }

    .logo {
        font-size: 24px;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
        padding: 0;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-select, .search-input, .search-button {
        width: 100%;
    }

    .container {
        padding: 0;
    }
    
    .artwork {
        margin: 0 auto;
        max-width: 100%;
    }

    /* 回到顶部按钮适配 */
    .go-top-bottom {
        right: 10px;
        bottom: 20px;
    }
    .go-top, .go-bottom {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}

/* 手机端 */
@media (max-width: 480px) {
    header {
        padding: 20px 0;
    }

    .artwork-img {
        min-height: 160px;
    }

    .gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    footer {
        padding: 30px 15px;
    }
    
    #form1 > div {
        padding: 0 8px;
    }
    
    .search-container {
        padding: 15px 10px;
    }
}