/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6; /* 明亮蓝，提高对比度 */
    --primary-dark: #1e40af;
    --secondary-color: #6b7280;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --card-bg: #ffffff;
    --card-border: #e5e7eb;
    --card-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-logo h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255,255,255,0.24);
    transform: translateY(-2px);
}

.nav-link:focus-visible {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* 主要内容区域 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 160px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 600;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-outline {
    background: #fff;
    color: var(--primary-dark);
    border: 2px solid var(--primary-dark);
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-search {
    background: var(--primary-color);
    color: #fff;
    padding: 0.75rem;
    border-radius: 0 8px 8px 0;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-dark);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 通用卡片与区块样式（提升统一性） */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    padding: 1rem;
}

.section {
    margin-bottom: 1.5rem;
}

.section h2, .section h3 {
    color: #2c3e50;
}

/* 仪表盘样式 */
.dashboard-header h1 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 1rem;
}

/* 筛选栏样式 */
.filter-section {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.filter-group input[type="text"] {
    min-width: 200px;
}

/* 房源卡片样式 */
.property-list,
.customer-list,
.community-list {
    display: grid;
    gap: 1.5rem;
}

.property-card,
.customer-card,
.community-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.property-card:hover,
.customer-card:hover,
.community-card:hover {
    transform: translateY(-5px);
}

.property-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.property-image {
    position: relative;
    flex-shrink: 0;
}

.property-image img {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.property-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.property-status.active {
    background: #28a745;
}

.property-status.inactive {
    background: #dc3545;
}

.property-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.property-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.property-header h3 {
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.property-grade {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.grade-A {
    background: #d4edda;
    color: #155724;
}

.grade-B {
    background: #fff3cd;
    color: #856404;
}

.grade-C {
    background: #f8d7da;
    color: #721c24;
}

.property-details p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.property-details i {
    color: #667eea;
    margin-right: 0.5rem;
    width: 16px;
}

.property-stats {
    display: flex;
    gap: 1.5rem;
    margin: 0.5rem 0;
}

.property-stats span {
    color: #6c757d;
    font-size: 0.875rem;
}

.property-stats i {
    color: #667eea;
    margin-right: 0.25rem;
}

.property-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
}

.unit-price {
    color: #6c757d;
    font-size: 0.875rem;
}

.property-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

/* 客户卡片样式 */
.customer-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
}

.customer-avatar {
    flex-shrink: 0;
}

.customer-avatar i {
    font-size: 3rem;
    color: #667eea;
}

.customer-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customer-header h3 {
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.customer-quality {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.customer-quality.high {
    background: #d4edda;
    color: #155724;
}

.customer-quality.medium {
    background: #fff3cd;
    color: #856404;
}

.customer-quality.low {
    background: #f8d7da;
    color: #721c24;
}

.customer-details p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.customer-details i {
    color: #667eea;
    margin-right: 0.5rem;
    width: 16px;
}

.customer-stats {
    display: flex;
    gap: 1.5rem;
    margin: 0.5rem 0;
}

.customer-stats span {
    color: #6c757d;
    font-size: 0.875rem;
}

.customer-stats i {
    color: #667eea;
    margin-right: 0.25rem;
}

.customer-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

/* 小区卡片样式 */
.community-card {
    padding: 1.5rem;
}

.community-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.community-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.community-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.community-score {
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.community-details p {
    margin-bottom: 0.5rem;
    color: #6c757d;
}

.community-details i {
    color: #667eea;
    margin-right: 0.5rem;
    width: 16px;
}

.community-stats {
    display: flex;
    justify-content: space-around;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

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

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

.community-actions {
    display: flex;
    gap: 1rem;
}

/* 数据分析页面样式 */
.analytics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.chart-container h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
}

.chart-placeholder {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
    color: #6c757d;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* 人事财务页面样式 */
.hr-finance-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn.active,
.nav-btn:hover {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.salary-calculation {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.calculation-form h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

/* 页脚样式 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content p {
    margin: 0;
}

/* 通用表格样式（提升可读性与对比度） */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    background: #f9fafb;
    color: #111827;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .main-content {
        padding: 1rem;
        margin-top: 70px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .property-card,
    .customer-card {
        flex-direction: column;
    }

    .property-image img {
        width: 100%;
        height: 200px;
    }

    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .analytics-dashboard {
        grid-template-columns: 1fr;
    }

    .hr-finance-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

    .main-content {
        padding: 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}
