* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 登录页 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1e40af 100%);
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: #2563eb;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 5px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

/* 表单组件 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }
.btn-info { background: #0284c7; color: white; }
.btn-info:hover { background: #0369a1; }

.error-msg {
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 13px;
    display: none;
    text-align: center;
}

.error-msg:not(:empty) {
    display: block;
}

/* 后台主布局 */
.admin-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-nav {
    background: #1e293b;
    color: white;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-user {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-logout {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.2);
}

/* 侧边栏 */
.admin-body {
    display: flex;
    margin-top: 60px;
    flex: 1;
}

.sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 20px 0;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-menu li {
    padding: 12px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    font-size: 14px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu li:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sidebar-menu li.active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 500;
}

.sidebar-menu i {
    width: 18px;
    text-align: center;
}

/* 内容区 */
.content {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
    min-height: calc(100vh - 60px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.tab-header h2 {
    font-size: 22px;
    color: #1e293b;
}

/* 统计卡片 */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.green { background: #f0fdf4; color: #059669; }
.stat-icon.orange { background: #fff7ed; color: #d97706; }
.stat-icon.red { background: #fef2f2; color: #dc2626; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 13px;
    color: #64748b;
}

.dashboard-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dashboard-section h3 {
    margin-bottom: 16px;
    color: #1e293b;
    font-size: 16px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    max-width: 350px;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar input:focus {
    border-color: #2563eb;
}

.search-bar select {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: white;
    cursor: pointer;
}

/* 表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr:hover {
    background: #f8fafc;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.status-active {
    background: #f0fdf4;
    color: #059669;
}

.status-disabled,
.status-revoked {
    background: #fef2f2;
    color: #dc2626;
}

.status-expired {
    background: #fff7ed;
    color: #d97706;
}

/* 操作按钮组 */
.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    width: 450px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #1e293b;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 18px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar-menu li span {
        display: none;
    }
    .content {
        margin-left: 60px;
    }
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    .search-bar {
        flex-direction: column;
    }
    .search-bar input {
        max-width: 100%;
    }
}