/* 市场主体登记代办系统 - 现代化政务风格 */

:root {
    --primary-color: #0052d9;
    --primary-dark: #003d9e;
    --primary-light: #266fe8;
    --secondary-color: #6b7280;
    --success-color: #059669;
    --danger-color: #e34d59;
    --warning-color: #ed7b2f;
    --info-color: #0284c7;
    --light-bg: #f3f4f6;
    --border-color: #e5e7eb;
    --text-color: #111827;
    --text-muted: #6b7280;
    --white: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

/* 顶部导航栏 */
.top-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 24px;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.navbar-user a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s;
}

.navbar-user a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 主容器 */
.main-container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px 0;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu a i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
    color: var(--text-muted);
}

.sidebar-menu a:hover {
    background: var(--light-bg);
    border-left-color: var(--primary-color);
}

.sidebar-menu a.active {
    background: #eff6ff;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.sidebar-menu a.active i {
    color: var(--primary-color);
}

/* 主内容区 */
.main-content {
    flex: 1;
}

/* 页面标题 */
.page-header {
    background: var(--white);
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    color: var(--primary-color);
}

/* 卡片 */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #0052d9 0%, #0078d4 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-bg);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

table tbody tr:hover {
    background: var(--light-bg);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: #b45309;
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: #0369a1;
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-primary {
    background: #dbeafe;
    color: var(--primary-color);
}

.badge-success {
    background: #d1fae5;
    color: var(--success-color);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning-color);
}

.badge-info {
    background: #e0f2fe;
    color: var(--info-color);
}

.badge-secondary {
    background: #f3f4f6;
    color: var(--secondary-color);
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box .form-control {
    flex: 1;
    max-width: 300px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: var(--warning-color);
    border: 1px solid #fde68a;
}

.alert-info {
    background: #e0f2fe;
    color: var(--info-color);
    border: 1px solid #bae6fd;
}

/* 登录页面 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0052d9 0%, #0078d4 100%);
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-box .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

/* 详情页面 */
.detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item {
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
}

.detail-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: static;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .sidebar-menu li {
        margin-bottom: 0;
    }
    
    .sidebar-menu a {
        padding: 10px 16px;
        border-left: none;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    .user-name {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box .form-control {
        max-width: 100%;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* 工具提示 */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
