/**
 * F-CRM 样式文件
 * Requirements: 9.1
 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #667eea;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.layout {
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* 顶部导航 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.navbar-brand {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.navbar-brand:hover {
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-menu a {
    color: white;
    opacity: 0.9;
}

.navbar-menu a:hover {
    opacity: 1;
    text-decoration: none;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    background: #fafafa;
    border-radius: 8px 8px 0 0;
}

.card-body {
    padding: 20px;
}

/* 侧边栏导航 */
.nav-list {
    list-style: none;
}

.nav-list li {
    border-bottom: 1px solid #eee;
}

.nav-list li:last-child {
    border-bottom: none;
}

.nav-list a {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    color: #555;
    transition: background 0.2s;
}

.nav-list a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.nav-list a.active {
    background: #667eea;
    color: white;
}

.nav-count {
    background: #eee;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.nav-list a.active .nav-count {
    background: rgba(255,255,255,0.3);
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background: #f9f9f9;
}

.table-actions a {
    margin-right: 10px;
    color: #667eea;
}

.table-actions a:hover {
    color: #764ba2;
}


/* 表单 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* 搜索表单 */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.search-form .form-group {
    margin-bottom: 0;
}

.search-form input,
.search-form select {
    padding: 8px 12px;
    min-width: 120px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.page-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #667eea;
}

.page-link:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.page-ellipsis {
    padding: 8px 5px;
    color: #999;
}

/* 消息提示 */
.alert {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-link:hover {
    color: #667eea;
    text-decoration: none;
}

.tab-link.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
