body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    /* 移除body的padding，交给container处理 */
}

/* 新增：主容器样式 */
.container {
    max-width: 1920px; /* 内容最大宽度 */
    margin: 0 auto;    /* 水平居中 */
    padding: 20px;     /* 提供内边距，实现“留白”效果 */
    box-sizing: border-box; /* 防止padding影响总宽度 */
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.controls select,
.controls input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 16px;
    min-width: 220px;
}

#cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 0 10%;
    justify-content: center;
}

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    padding: 0 0 10px; /* 顶部padding设为0，因为图片会填满 */
    display: flex; /* 使用flex布局让内容垂直排列 */
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card img {
    width: 100%;
    height: auto;
    display: block;
}

.card p {
    margin: 10px 5px 0; /* 调整分区名称的margin */
    font-weight: 500;
    font-size: 15px;
    /* 让p标签在flex布局中占据多余空间，将ID推到底部（如果需要） */
    flex-grow: 1; 
}

/* 新增：分区ID样式 */
.card .card-id {
    font-size: 13px;
    color: #888;
    margin: 5px 5px 0; /* 调整ID的margin */
    font-weight: normal;
    word-break: break-all; /* 防止长ID破坏布局 */
    flex-grow: 0; /* ID不拉伸 */
}

#pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #00a1d6;
    color: #fff;
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-info {
    margin: 0 15px;
    font-weight: 500;
}

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: bottom 0.5s ease-in-out;
    opacity: 0;
}

.toast.show {
    bottom: 30px;
    opacity: 1;
}
