/* 基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

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

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

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

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

.btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.btn-link {
    color: #007bff;
    background-color: transparent;
    border: none;
}

.btn-link:hover {
    color: #0056b3;
    text-decoration: underline;
    background-color: transparent;
    border: none;
}

/* 表单样式 */
.form-control {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

.form-control:focus {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
}

.form-group {
    margin-bottom: 15px;
}

.form-check {
    position: relative;
    display: block;
    margin-bottom: 10px;
}

.form-check-input {
    position: absolute;
    margin-top: 4px;
    margin-left: -20px;
}

.form-check-label {
    padding-left: 20px;
    margin-bottom: 0;
}

/* 警告框 */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* 表格样式 */
.data-table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

.data-table th {
    vertical-align: bottom;
    border-bottom: 2px solid #ddd;
    text-align: left;
}

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

/* 必填字段标记 */
.required {
    color: #dc3545;
}

/* 登录页面样式 */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    margin-bottom: 20px;
    text-align: center;
}

/* 后台管理布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-header {
    background-color: #343a40;
    color: white;
    padding: 15px;
    display: block; /* 从flex改为block */
}

.admin-header h1 {
    margin: 0 0 10px 0; /* 只设置下边距 */
    display: block;
}

.admin-info {
    color: rgba(255, 255, 255, 0.75);
    display: block; /* 改为块级元素 */
    margin-bottom: 10px; /* 添加下边距 */
}

.admin-info a {
    color: white;
}

.admin-sidebar {
    width: 220px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.admin-sidebar ul {
    list-style: none;
    padding: 0;
}

.admin-sidebar li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    border-left: 3px solid transparent;
}

.admin-sidebar li a:hover {
    background-color: #e9ecef;
    text-decoration: none;
}

.admin-sidebar li a.active {
    background-color: #e9ecef;
    border-left: 3px solid #007bff;
    color: #007bff;
}

.admin-content {
    flex: 1;
    padding: 20px;
    background-color: #fff;
}

/* 仪表板统计卡片 */
.dashboard-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    text-align: center;
}

.stat-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #6c757d;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

/* 表单容器 */
.form-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-header, .form-footer {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

/* 表单管理页面 */
.form-management {
    display: flex;
    gap: 20px;
}

.form-list {
    flex: 1;
}

.form-edit {
    flex: 2;
}

.field-group {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.col {
    flex: 1;
}

.col-auto {
    flex: 0 0 auto;
}

.field-options {
    margin-top: 10px;
}

/* 标签页 */
.nav-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    border-bottom: 1px solid #dee2e6;
}

.nav-tabs li {
    margin-bottom: -1px;
}

.nav-tabs li a {
    display: block;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    color: #007bff;
}

.nav-tabs li a:hover {
    border-color: #e9ecef #e9ecef #dee2e6;
    text-decoration: none;
}

.nav-tabs li.active a {
    color: #495057;
    background-color: #fff;
    border-color: #dee2e6 #dee2e6 #fff;
}

.tab-content {
    padding: 15px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.data-details {
    width: 100%;
}

.data-details th {
    width: 30%;
    text-align: right;
    padding-right: 15px;
}

.data-details td {
    width: 70%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .form-management {
        flex-direction: column;
    }
    
    .dashboard-stats {
        flex-direction: column;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col, .col-auto {
        width: 100%;
    }
/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

.loading-state .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 错误状态 */
.error-state {
    padding: 20px;
    background: #fff8f8;
    border-left: 4px solid #dc3545;
}

.error-state h4 {
    color: #dc3545;
    margin-bottom: 10px;
}

.error-state ul {
    padding-left: 20px;
    margin-top: 10px;
}

/* 空值显示 */
.empty-value {
    color: #999;
    font-style: italic;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 30px;
    color: #999;
    font-style: italic;
}
}