/**
 * 公共CSS样式
 * 功能反馈:15058593138@qq.com
 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    max-width: 1200px;
    margin: 0 auto;
}

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

/* 头部样式 */
.header {
    background-color: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.header-title {
    font-size: 18px;
    font-weight: bold;
    line-height: 40px;
}

.header-right {
    position: absolute;
    right: 15px;
    top: 10px;
}

.logout-btn {
    display: inline-block;
    padding: 0 15px;
    height: 40px;
    line-height: 40px;
    background-color: #f5f5f5;
    color: #666;
    border-radius: 4px;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.navbar-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    color: #666;
}

.navbar-item.active {
    color: #0066cc;
    border-bottom: 2px solid #0066cc;
}

/* 内容区域样式 */
.container {
    padding: 15px;
    background-color: #fff;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

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

.table tr:hover {
    background-color: #f5f5f5;
}

.table-action {
    white-space: nowrap;
}

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

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

.form-control {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

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

textarea.form-control {
    height: auto;
    padding: 10px;
    resize: vertical;
}

.form-select {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0 5px;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background-color: #0055b3;
    border-color: #0055b3;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

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

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-default {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.btn-default:hover {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 搜索栏样式 */
.search-bar {
    display: flex;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-select {
    width: 120px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 0;
    margin-right: -1px;
}

.search-btn {
    height: 40px;
    padding: 0 15px;
    color: #fff;
    background-color: #0066cc;
    border: 1px solid #0066cc;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 分页样式 */
.page {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.page-btn {
    display: inline-block;
    padding: 0 10px;
    height: 32px;
    line-height: 32px;
    margin: 0 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.page-btn:hover {
    background-color: #f5f5f5;
}

.page-btn.disabled {
    color: #ccc;
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.page-select {
    height: 32px;
    padding: 0 10px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 遮罩层样式 */
.mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mask-container {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mask-title {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: bold;
    position: relative;
}

.mask-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 20px;
    color: #999;
    cursor: pointer;
}

.mask-content {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

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

.mask-button {
    padding: 0 15px;
    height: 36px;
    line-height: 36px;
    margin-left: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    cursor: pointer;
}

.mask-button-primary {
    color: #fff;
    background-color: #0066cc;
    border-color: #0066cc;
}

.mask-button-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s;
}

.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background-color: rgba(40, 167, 69, 0.9);
}

.toast-error {
    background-color: rgba(220, 53, 69, 0.9);
}

.toast-warning {
    background-color: rgba(255, 193, 7, 0.9);
}

/* 访客码样式 */
.visit-code {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    padding: 20px;
    margin: 15px 0;
    background-color: #f5f5f5;
    border-radius: 4px;
    letter-spacing: 2px;
}

/* 响应式布局 */
@media (max-width: 480px) {
    .table-responsive {
        overflow-x: auto;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-select {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .search-input {
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .search-btn {
        border-radius: 4px;
        width: 100%;
    }
}
