/**
 * 本文件功能：公共CSS样式
 * 版权声明：保留发行权和署名权
 * 作者信息：15058593138@qq.com
 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    max-width: 100%;
    overflow-x: hidden;
}

a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, li {
    list-style: none;
}

/* 主布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header {
    background-color: #fff;
    border-bottom: 1px solid #e1e1e1;
    padding: 1px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.right-btns a {
    margin-left: 10px;
    padding: 5px 10px;
    background: #0066cc;
    color: #fff;
    border-radius: 3px;
}

/* 导航栏 */
.nav {
    display: flex;
    padding: 2px 0;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.nav a {
    padding: 8px;
    color: #333;
    text-align: center;
    transition: all 0.3s;
}

.nav a:hover, .nav a.active {
    background: #0066cc;
    color: #fff;
    text-decoration: none;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 1px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-wrap: wrap;
}

.search-item {
    margin: 5px 10px 5px 0;
}

.search-item select,
.search-item input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 100px;
}

.search-btns {
    margin-left: auto;
}

.btn {
    padding: 5px 9px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    background: #0066cc;
    color: #fff;
}

.btn-primary {
    background: #0066cc;
}

.btn-success {
    background: #28a745;
}

.btn-danger {
    background: #dc3545;
}

.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn:hover {
    opacity: 0.9;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e1e1e1;
}

.table th {
    background: #f5f5f5;
    font-weight: bold;
}

.table tr:hover {
    background: #f9f9f9;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #0066cc;
    outline: none;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.pagination a, .pagination span {
    padding: 5px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #333;
}

.pagination a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.pagination span.current {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.pagination .disabled {
    color: #aaa;
    cursor: not-allowed;
}

/* 卡片式列表 */
.card-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.card {
    width: calc(33.333% - 20px);
    margin: 10px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.card-img {
    height: 160px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 10px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-text {
    margin-bottom: 10px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    padding: 10px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

/* 遮罩层 */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    position: relative;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 15px;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.modal-footer .btn {
    margin-left: 10px;
}

/* 吐司提示 */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 4px;
    z-index: 1000;
    animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

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

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

/* 底部 */
.footer {
    padding: 5px;
    border-top: 1px solid #e1e1e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background: #fff;
    margin-top: 12px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

/* 响应式 */
@media (max-width: 768px) {
    .card {
        width: calc(50% - 20px);
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-btns {
        margin-top: 10px;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .nav a {
        flex: 1 1 33.333%;
    }
}
