/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #4361ee, #3f37c9);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    margin-left: 20px;
    font-weight: 600;
}

/* 导航栏样式 */
.navbar {
    background-color: white;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e9ecef;
}

.navbar ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
}

.navbar li {
    margin: 0;
    position: relative;
}

.navbar a {
    color: #495057;
    padding: 16px 20px;
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}

.navbar a:hover {
    color: #4361ee;
    background-color: #f8f9fa;
    border-bottom-color: #4361ee;
}

/* 汉堡菜单按钮 */
.navbar-toggle {
    display: none;
    background-color: white;
    color: #495057;
    border: 1px solid #e9ecef;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 4px;
    margin: 8px;
    transition: all 0.3s ease;
}

.navbar-toggle:hover {
    background-color: #f8f9fa;
    border-color: #4361ee;
    color: #4361ee;
}

/* 汉堡菜单图标 */
.navbar-toggle::before {
    content: '☰';
}

/* 响应式导航 */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }
    
    .navbar ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: white;
        box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    }
    
    .navbar ul.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    .navbar li {
        width: 100%;
        text-align: left;
        border-bottom: 1px solid #f1f3f5;
    }
    
    .navbar a {
        padding: 14px 20px;
        border-bottom: none;
    }
    
    .navbar a:hover {
        background-color: #f8f9fa;
        padding-left: 25px;
    }
}

/* 动画效果 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

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

/* 子菜单样式 */
.submenu {
    margin: 20px 0;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.submenu ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    color: #4361ee;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    background-color: #f8f9ff;
    border: 1px solid #e3e7ff;
}

.submenu a:hover {
    background-color: #4361ee;
    color: white;
    transform: translateY(-1px);
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #343a40;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 12px;
    font-weight: 600;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: #4361ee;
    color: white;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background-color: #3a0ca3;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 4px 6px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(108, 117, 125, 0.4);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(220, 53, 69, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tr {
    transition: all 0.3s ease;
}

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

.table tr:last-child td {
    border-bottom: none;
}

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

.pagination a {
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pagination a:hover {
    background-color: #f8f9fa;
    border-color: #4361ee;
    color: #4361ee;
    transform: translateY(-1px);
}

.pagination .active {
    background-color: #4361ee;
    color: white;
    border-color: #4361ee;
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
    position: relative;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f3f5;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #343a40;
    border-bottom: none;
    padding-bottom: 0;
}

.close {
    color: #6c757d;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.close:hover {
    color: #343a40;
    transform: rotate(90deg);
}

/* 消息提示样式 */
.alert {
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background-color: #f0f9ff;
    color: #03543f;
    border-left-color: #059669;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
        margin-left: 15px;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .card h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 12px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 24px;
    }
    
    .submenu ul {
        flex-direction: column;
        gap: 6px;
    }
    
    .submenu li {
        width: 100%;
    }
    
    .submenu a {
        display: block;
        text-align: center;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4361ee;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #343a40;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 卡片阴影变体 */
.card-shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.card-shadow-md {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.card-shadow-lg {
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

/* 文本颜色 */
.text-primary {
    color: #4361ee;
}

.text-secondary {
    color: #6c757d;
}

.text-success {
    color: #059669;
}

.text-danger {
    color: #dc2626;
}

.text-warning {
    color: #d97706;
}

.text-info {
    color: #0284c7;
}

/* 背景颜色 */
.bg-primary {
    background-color: #4361ee;
    color: white;
}

.bg-secondary {
    background-color: #6c757d;
    color: white;
}

.bg-success {
    background-color: #059669;
    color: white;
}

.bg-danger {
    background-color: #dc2626;
    color: white;
}

.bg-warning {
    background-color: #d97706;
    color: white;
}

.bg-info {
    background-color: #0284c7;
    color: white;
}

/* 边距工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 1rem; }
.ml-4 { margin-left: 1.5rem; }
.ml-5 { margin-left: 3rem; }

.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 1rem; }
.mr-4 { margin-right: 1.5rem; }
.mr-5 { margin-right: 3rem; }

/* 内边距工具类 */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }

.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3rem; }

.pl-1 { padding-left: 0.25rem; }
.pl-2 { padding-left: 0.5rem; }
.pl-3 { padding-left: 1rem; }
.pl-4 { padding-left: 1.5rem; }
.pl-5 { padding-left: 3rem; }

.pr-1 { padding-right: 0.25rem; }
.pr-2 { padding-right: 0.5rem; }
.pr-3 { padding-right: 1rem; }
.pr-4 { padding-right: 1.5rem; }
.pr-5 { padding-right: 3rem; }

/* 文本对齐 */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* 文本大小 */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }

/* 字体权重 */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* 显示/隐藏 */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.grid { display: grid; }

/* 弹性布局 */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

/* 响应式显示 */
@media (max-width: 768px) {
    .sm:hidden { display: none; }
    .sm:block { display: block; }
    .sm:flex { display: flex; }
}

@media (min-width: 769px) {
    .md:hidden { display: none; }
    .md:block { display: block; }
    .md:flex { display: flex; }
}
