* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #1f2937;
    font-size: 14px;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 5px;
}

.login-header p {
    color: #6b7280;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-default {
    background: #e5e7eb;
    color: #374151;
}

.btn-default:hover {
    background: #d1d5db;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
}

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

/* 主布局 */
.main-app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    font-size: 28px;
}

.sidebar-header .title h2 {
    font-size: 16px;
    margin-bottom: 2px;
}

.sidebar-header .title p {
    font-size: 11px;
    color: #94a3b8;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: #334155;
    color: white;
}

.nav-item.active {
    background: #3b82f6;
    color: white;
}

.nav-item .icon {
    font-size: 18px;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #334155;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-info .avatar {
    font-size: 28px;
}

.admin-name {
    font-size: 14px;
    font-weight: 500;
}

.admin-role {
    font-size: 12px;
    color: #94a3b8;
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    color: #f87171;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(248, 113, 113, 0.1);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.top-header {
    background: white;
    padding: 0 30px;
    height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.content-area {
    padding: 24px 30px;
    flex: 1;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-card.small {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.stat-card.small .stat-value {
    font-size: 24px;
}

.stat-value.green { color: #10b981; }
.stat-value.blue { color: #3b82f6; }
.stat-value.orange { color: #f59e0b; }
.stat-value.purple { color: #8b5cf6; }
.stat-value.red { color: #ef4444; }
.stat-value.gray { color: #6b7280; }

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* 工具栏 */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 280px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.select-input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 120px;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

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

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

.text-center {
    text-align: center;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.green { background: #dcfce7; color: #166534; }
.status-badge.red { background: #fee2e2; color: #991b1b; }
.status-badge.orange { background: #ffedd5; color: #9a3412; }
.status-badge.blue { background: #dbeafe; color: #1e40af; }
.status-badge.gray { background: #f1f5f9; color: #475569; }
.status-badge.purple { background: #ede9fe; color: #5b21b6; }

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

.pagination button {
    padding: 8px 14px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.pagination button:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.pagination button.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 授权码统计 */
.license-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.license-stat-item {
    text-align: center;
    flex: 1;
}

.license-stat-item .label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.license-stat-item .value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单 */
.form-row {
    margin-bottom: 18px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row-inline {
    display: flex;
    gap: 12px;
}

.form-row-inline .form-row {
    flex: 1;
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .search-input {
        width: 100%;
    }
}
