/* 通用样式文件 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #374151;
    line-height: 1.6;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #ffffff;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="%23f3f4f6" stroke-width="0.5" opacity="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.6;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    border: 1px solid #f3f4f6;
}

.login-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: #347FF0;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 32px;
    font-size: 1.125rem;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: #347FF0;
    box-shadow: 0 0 0 4px rgba(52, 127, 240, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: #347FF0;
    color: white;
    width: 100%;
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(52, 127, 240, 0.3);
}

.btn-primary:hover {
    background: #2c6ce6;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(52, 127, 240, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669, #047857);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4);
}

/* 主布局样式 */
.main-container {
    display: flex;
    min-height: 100vh;
    background: #ffffff;
}

.sidebar {
    width: 280px;
    background: #ffffff;
    color: #374151;
    padding: 24px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    border-right: 1px solid #f3f4f6;
    position: relative;
}

.sidebar-header {
    padding: 0 24px 24px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #347FF0;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    list-style: none;
    padding: 0 12px;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    margin-right: 12px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #347FF0;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-nav a:hover {
    background: #f8fafc;
    color: #347FF0;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(52, 127, 240, 0.15);
}

.sidebar-nav a:hover::before {
    transform: scaleY(1);
}

.sidebar-nav a.active {
    background: #f0f9ff;
    color: #347FF0;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 127, 240, 0.2);
}

.sidebar-nav a.active::before {
    transform: scaleY(1);
}

.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: #ffffff;
}

.content-header {
    background: #ffffff;
    padding: 24px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #f3f4f6;
    position: relative;
    overflow: hidden;
}

.content-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #347FF0;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: #347FF0;
    margin: 0;
    letter-spacing: -0.02em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: #475569;
    font-weight: 600;
    font-size: 1rem;
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* 卡片样式 */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: 1px solid #f3f4f6;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #347FF0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #347FF0;
    margin: 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    color: #374151;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #347FF0;
}

.stat-card-content {
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #347FF0;
}

.stat-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: #64748b;
    opacity: 0.9;
}

.stat-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.8;
    color: #347FF0;
}

/* 表格样式 */
.table-container {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    color: #347FF0;
    padding: 20px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    border-bottom: 2px solid #f3f4f6;
    position: relative;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #347FF0;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    color: #475569;
    font-weight: 500;
}

.table tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.table tr:last-child td {
    border-bottom: none;
}

/* 表单样式 */
.form-container {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: 1px solid #f3f4f6;
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #347FF0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #1e293b;
    font-weight: 500;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #347FF0;
    box-shadow: 0 0 0 4px rgba(52, 127, 240, 0.1);
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: #475569;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination button:hover {
    border-color: #347FF0;
    color: #347FF0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 127, 240, 0.2);
}

.pagination button.active {
    background: #347FF0;
    color: white;
    border-color: #347FF0;
    box-shadow: 0 4px 12px rgba(52, 127, 240, 0.3);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 搜索和筛选 */
.search-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.search-input {
    flex: 1;
    max-width: 320px;
}

.filter-select {
    min-width: 180px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid #f3f4f6;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #347FF0;
    border-radius: 12px 12px 0 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.modal-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #347FF0;
    margin: 0;
}

.close-btn {
    background: #f8fafc;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.close-btn:hover {
    background: #e2e8f0;
    color: #374151;
    transform: scale(1.05);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #347FF0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.message.success {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.message.error {
    background: linear-gradient(135deg, #fee2e2, #fca5a5);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message.info {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #347FF0;
    border: 1px solid #93c5fd;
}

/* Toast 消息弹窗样式 */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e5e7eb;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    position: relative;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message-text {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    animation: toastProgress 4s linear forwards;
}

/* Toast 类型样式 */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

/* 进度条动画 */
@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .toast-message {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }
    
    .sidebar-nav li {
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .sidebar-nav a {
        white-space: nowrap;
        border-radius: 25px;
        margin-right: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        max-width: none;
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
