/* ============================================================
   site.css
   作用：网站全局自定义样式
   说明：
     1. 基于 Bootstrap 5 进行扩展和覆盖
     2. 采用数据/网络风格的配色方案（蓝紫渐变、科技蓝）
     3. 所有样式均考虑移动端适配
   ============================================================ */

/* -------------------- 基础变量定义 -------------------- */
:root {
    --primary-color: #1a56db;        /* 主色调：科技蓝 */
    --secondary-color: #7e3af2;      /* 辅助色：紫 */
    --dark-bg: #1f2937;              /* 深色背景 */
    --light-bg: #f3f4f6;             /* 浅色背景 */
    --text-primary: #111827;         /* 主文字色 */
    --text-secondary: #6b7280;       /* 次要文字色 */
}

/* -------------------- 全局样式 -------------------- */
html {
    /* 平滑滚动 */
    scroll-behavior: smooth;
    /* 始终预留滚动条空间，避免后台菜单展开/收起时页面左右晃动 */
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-primary);
    line-height: 1.7;
    background-color: #ffffff;
}

/* -------------------- 站点布局（顶部 Header + 左侧 hover 展开深色导航） -------------------- */
:root {
    --header-height: 56px;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 64px;
    --sidebar-bg: #3f4fbf;
    --sidebar-text: rgba(255, 255, 255, 0.85);
    --sidebar-text-hover: #ffffff;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --sidebar-active-bg: rgba(255, 255, 255, 0.15);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1050;
    padding: 0 1rem 0 1.25rem;
}

.site-header .site-brand-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    letter-spacing: -0.3px;
}

.site-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-collapsed-width);
    background: var(--sidebar-bg);
    border-right: none;
    z-index: 1040;
    padding: 0.75rem 0;
    transition: width 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.site-sidebar:hover {
    width: var(--sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.sidebar-menu li {
    margin: 0 0.5rem;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-hover-bg);
}

.sidebar-menu li.active a {
    background: var(--sidebar-active-bg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.sidebar-menu li a i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu li a .menu-text,
.sidebar-footer .user-item .menu-text {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.site-sidebar:hover .sidebar-menu li a .menu-text,
.site-sidebar:hover .sidebar-footer .user-item .menu-text {
    opacity: 1;
}

.sidebar-footer {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 0.5rem;
}

.sidebar-footer .user-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    padding: 0.5rem 0.35rem;
    border-radius: 0.5rem;
}

.sidebar-footer .user-item:hover {
    color: var(--sidebar-text-hover);
    background: var(--sidebar-hover-bg);
}

.site-main {
    margin-left: var(--sidebar-collapsed-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main > main[role="main"] {
    flex: 1;
    padding-top: 0 !important;
}

.site-footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 3rem 0 1.5rem;
}

.site-footer h5 {
    color: #ffffff;
}

.mobile-menu li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-menu li a:hover {
    color: var(--primary-color);
}

@media (max-width: 991.98px) {
    .site-sidebar {
        display: none !important;
    }

    .site-main {
        margin-left: 0;
    }
}

/* -------------------- 首屏 Banner -------------------- */
.hero-banner {
    /* 蓝紫渐变背景，体现数据科技感 */
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

/* 在 Banner 上添加 subtle 的网格纹理 */
.hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 20px 20px;
    pointer-events: none;
}

.hero-banner .container {
    position: relative;
    z-index: 1;
}

/* -------------------- 卡片统一样式 ---------------    ----- */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* -------------------- 工具卡片特殊样式 -------------------- */
.tool-card {
    transition: all 0.2s ease;
}

.tool-card:hover {
    border-color: var(--primary-color) !important;
    background-color: #f8fafc;
}

/* -------------------- 资讯正文样式 -------------------- */
.news-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
}

.news-content p {
    margin-bottom: 1.2rem;
}

.news-content h2,
.news-content h3,
.news-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 1.5rem 0;
}

/* -------------------- 分页样式微调 -------------------- */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #e5e7eb;
}

.pagination .page-item.active .page-link {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item.disabled .page-link {
    color: #9ca3af;
    background-color: #fff;
    border-color: #e5e7eb;
}

.pagination .page-link:hover {
    background-color: #eff6ff;
    border-color: var(--primary-color);
}

/* -------------------- 导航栏样式微调 -------------------- */
.navbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

/* -------------------- 页脚链接样式 -------------------- */
footer a.text-secondary:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* -------------------- 子页面顶部 Banner -------------------- */
/* 与主导航 bg-primary 颜色区分，避免视觉粘连 */
.page-banner {
    background: linear-gradient(135deg, #4361ee 0%, #7e3af2 100%);
    color: #fff;
}
.page-banner.banner-success { background: linear-gradient(135deg, #16a085 0%, #2ecc71 100%); }
.page-banner.banner-danger { background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); }
.page-banner.banner-info { background: linear-gradient(135deg, #2980b9 0%, #6dd5fa 100%); }
.page-banner.banner-dark { background: linear-gradient(135deg, #2c3e50 0%, #4a6079 100%); }


/* ============================================================
   首页优化样式
   ============================================================ */

/* 统一的区域标题 */
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header .section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.75rem;
}

.section-header .section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.section-header.text-start .section-title::after {
    left: 0;
    transform: none;
}

/* 首屏 Hero 优化 */
.hero-banner {
    min-height: 520px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #0f4dc7 0%, #1a56db 50%, #7e3af2 100%);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.35rem;
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0.95;
}

.hero-desc {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-search {
    max-width: 640px;
    margin: 0 auto;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-search .form-control,
.hero-search .btn {
    border: none;
    box-shadow: none;
}

.hero-search .form-control {
    background: rgba(255,255,255,0.95);
    border-radius: 0.75rem 0 0 0.75rem;
    padding: 0.85rem 1.25rem;
}

.hero-search .btn {
    border-radius: 0 0.75rem 0.75rem 0;
    padding: 0.85rem 1.75rem;
    font-weight: 600;
}

.hero-stats {
    margin-top: 3rem;
}

.hero-stat-item {
    text-align: center;
    padding: 0 1rem;
}

.hero-stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    display: block;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-top: 0.5rem;
    display: block;
}

/* 信任背书条 */
.trust-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.5rem 0;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
}

.trust-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(26,86,219,0.1) 0%, rgba(126,58,242,0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.trust-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.trust-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 服务卡片 */
.service-card {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(26,86,219,0.12);
    border-color: transparent;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(26,86,219,0.08) 0%, rgba(126,58,242,0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.service-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.service-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 内容列表卡片 */
.content-list-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    height: 100%;
    border: 1px solid #e5e7eb;
}

.content-list-card .card-header-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
}

.content-list-card .card-header-custom h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

.content-list-card .list-group-item {
    border: none;
    padding: 0.9rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.content-list-card .list-group-item:last-child {
    border-bottom: none;
}

.content-list-card .item-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.content-list-card .item-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-list-card a:hover .item-title {
    color: var(--primary-color);
}

/* 资讯卡片 */
.news-card {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    height: 100%;
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.08);
}

.news-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.news-card-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(26,86,219,0.08) 0%, rgba(126,58,242,0.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-body {
    padding: 1.25rem;
}

.news-card-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.news-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA 区域 */
.cta-section {
    background: linear-gradient(135deg, #0f4dc7 0%, #7e3af2 100%);
    color: #fff;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.12) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

/* 合规专题 - Topics 样式 */
.topics-section {
    background: #ffffff;
}

.topics-header {
    margin-bottom: 3rem;
}

.topics-icon {
    font-size: 3.5rem;
    color: #e5e7eb;
    margin-bottom: 1rem;
    line-height: 1;
}

.topics-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.topics-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 auto;
    max-width: 500px;
}

.topic-tile {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    height: 100%;
    transition: all 0.2s ease;
}

.topic-tile:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.topic-tile-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.topic-tile-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.topic-tile-content {
    flex: 1;
    min-width: 0;
}

.topic-tile-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.topic-tile-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 576px) {
    .topics-icon {
        font-size: 2.75rem;
    }

    .topics-title {
        font-size: 1.6rem;
    }

    .topic-tile {
        padding: 1rem;
    }
}

/* 关于我们 - 律师介绍 */
.about-section {
    background: #f8fafc;
}

.about-header {
    margin-bottom: 2.5rem;
}

.about-title {
    color: var(--primary-color);
    font-size: 1.75rem;
    font-weight: 700;
    display: inline-block;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 1.25rem;
}

.about-summary {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

.about-leader {
    max-width: 800px;
    margin: 0 auto;
}

.leader-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.leader-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.leader-name {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-left: 0.875rem;
    border-left: 4px solid var(--primary-color);
    display: inline-block;
}

.leader-phone {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.leader-detail {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    text-align: justify;
    text-align-last: center;
}

@media (max-width: 576px) {
    .leader-photo {
        width: 130px;
        height: 130px;
    }

    .leader-name {
        font-size: 1.25rem;
    }

    .leader-detail {
        text-align: left;
        text-align-last: auto;
    }
}

/* 工具卡片 */
.tool-card {
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
    transform: translateY(-3px);
}

/* 按钮优化 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-banner {
        min-height: auto;
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-search .form-control {
        border-radius: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .hero-search .btn {
        border-radius: 0.75rem;
        width: 100%;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .hero-stat-number {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .service-card {
        padding: 1.5rem 1rem;
    }
}

/* -------------------- 后台列表交互 -------------------- */
.admin-list-table tbody tr { cursor: pointer; }
.admin-list-table tbody tr:hover { background-color: #f8fafc; }
.admin-list-table tbody tr.row-selected { background-color: #eff6ff; }
.admin-list-table .row-actions { opacity: 0; transition: opacity 0.2s ease; pointer-events: none; }
.admin-list-table tbody tr.row-selected .row-actions { opacity: 1; pointer-events: auto; }
.admin-list-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.admin-list-table th.sortable .sort-indicator { font-size: 0.75rem; opacity: 0.4; margin-left: 4px; }
.admin-list-table th.sortable.sort-asc .sort-indicator,
.admin-list-table th.sortable.sort-desc .sort-indicator { opacity: 1; color: var(--primary-color); }

/* -------------------- 移动端适配 -------------------- */
@media (max-width: 768px) {
    .hero-banner {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }

    .hero-banner .display-4 {
        font-size: 1.75rem;
    }

    .hero-banner .lead {
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .news-content {
        font-size: 1rem;
    }
}

/* -------------------- 打印样式 -------------------- */
@media print {
    .navbar,
    footer,
    .btn {
        display: none !important;
    }

    .news-content {
        font-size: 12pt;
        line-height: 1.5;
    }
}
