/**
 * 总后台样式文件
 * SaaS系统总后台管理界面样式
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f5f5;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

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

.login-form {
    margin-top: 30px;
}

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

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

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #5568d3;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

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

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left h1 {
    font-size: 20px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #e0e0e0;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 180px;
    height: calc(100vh - 60px);
    background: #1e293b;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-nav {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    justify-content: space-between;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s;
    flex: 1 1 0;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    min-height: 0;
}

.nav-item.nav-parent {
    cursor: pointer;
}

.nav-item:last-child {
    border-bottom: none;
}

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

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

.nav-icon {
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    white-space: nowrap;
    font-weight: 500;
}

/* 二级菜单侧边栏（显示在主菜单右侧） */
.submenu-sidebar {
    position: fixed;
    left: 180px;
    top: 60px;
    width: 200px;
    height: calc(100vh - 60px);
    background: white;
    border-right: 1px solid #e0e0e0;
    display: none;
    flex-direction: column;
    z-index: 99;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.submenu-sidebar.show {
    display: flex;
}

.submenu-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.submenu-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.submenu-nav {
    padding: 10px 0;
    flex: 1;
    overflow-y: auto;
}

.submenu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.submenu-item:hover {
    background: #f5f5f5;
    color: #333;
    border-left-color: #667eea;
}

.submenu-item.active {
    background: #e8f0fe;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 500;
}

.submenu-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.submenu-text {
    font-size: 14px;
}

.admin-main {
    margin-left: 180px;
    margin-top: 60px;
    padding: 30px;
    width: calc(100% - 180px);
    transition: margin-left 0.3s, width 0.3s;
}

/* 当显示二级菜单时，调整主内容区域 */
body.submenu-visible .admin-main {
    margin-left: 380px;
    width: calc(100% - 380px);
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 24px;
    color: #333;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 48px;
    margin-right: 20px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

/* 快捷操作 */
.quick-actions {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #e0e0e0;
}

.action-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.action-text {
    font-size: 14px;
    font-weight: 500;
}

/* 表格样式 */
.table-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

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

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

.data-table th {
    background: #f5f5f5;
    font-weight: 500;
    color: #333;
}

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

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

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

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #fff3e0;
    color: #e65100;
}

.status-suspended {
    background: #ffebee;
    color: #c62828;
}

/* 按钮样式 */
.btn-primary {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-edit,
.btn-view {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.3s;
}

.btn-edit {
    background: #2196f3;
    color: white;
}

.btn-edit:hover {
    background: #1976d2;
}

.btn-view {
    background: #4caf50;
    color: white;
}

.btn-view:hover {
    background: #388e3c;
}

/* 筛选栏 */
.filter-bar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.btn-search {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-search:hover {
    background: #5568d3;
}

.btn-reset {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.btn-reset:hover {
    background: #e0e0e0;
}

/* 表单样式 */
.form-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form {
    max-width: 600px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

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

.card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.card-body {
    padding: 20px;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-danger {
    background: #ffebee;
    color: #c62828;
}

.badge-warning {
    background: #fff3e0;
    color: #e65100;
}

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

.pagination-item {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination-item:hover {
    background: #f5f5f5;
}

.pagination-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 搜索表单 */
.search-form {
    padding: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 信息框 */
.info-box {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 文本颜色 */
.text-danger {
    color: #c62828;
}

.text-warning {
    color: #e65100;
}

.text-success {
    color: #2e7d32;
}

/* 树形指示器 */
.tree-indicator {
    color: #999;
    margin-right: 5px;
}

.required {
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.page-link {
    padding: 8px 12px;
    background: white;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f5f5f5;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 删除按钮 */
.btn-delete {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 8px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    background: #f44336;
    color: white;
    transition: background 0.3s;
}

.btn-delete:hover {
    background: #d32f2f;
}

