/* ==========================================================
   律途通 LVtutong - 前台主样式表 home.css
   ========================================================== */

/* ====== 语义化布局 class（替代内联 grid style） ====== */
/* 主区 + 侧栏（桌面两列，移动端单列） */
.layout-main-sidebar { display: grid; grid-template-columns: calc(100% - 300px) 280px; gap: 20px; }
.layout-main-sidebar-wide { display: grid; grid-template-columns: calc(100% - 320px) 300px; gap: 24px; }
/* 筛选表单（5 列） */
.layout-filter { display: grid; grid-template-columns: repeat(4, 1fr) 120px; gap: 16px; align-items: end; }
/* 3 列卡片网格 */
.layout-cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
/* 2 列布局 */
.layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* 地区 3 列 */
.layout-region-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
/* 登录/注册双栏 */
.layout-login { display: grid; grid-template-columns: 1.1fr 1fr; }
.layout-register { display: grid; grid-template-columns: 1fr 1.1fr; }
/* 列表项横向（图片+文字） */
.layout-item-hero { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
/* 专家卡内 3 列数据 */
.layout-stat-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
/* 专家详情头部 auto 宽 */
.layout-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 30px; align-items: center; }
/* 地区统计 4 列 */
.layout-area-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
/* 用户中心 3 列卡片 */
.layout-user-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* 登录/注册表单内 2 列 */
.layout-form-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* ====== 全局重置 ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
    -webkit-font-smoothing: antialiased;
}
a { color: #1e88e5; text-decoration: none; transition: color .2s; }
a:hover { color: #1565c0; }
img { max-width: 100%; border: 0; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea { font-family: inherit; outline: none; }

.container { width: 1200px; max-width: 96%; margin: 0 auto; }
.clearfix::after { content: ""; display: block; clear: both; }
.pull-left { float: left; }
.pull-right { float: right; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; } .mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; } .mb-20 { margin-bottom: 20px; } .mb-30 { margin-bottom: 30px; }

/* ====== 顶部导航 Header ====== */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e8eaec;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 99;
}
.top-bar {
    height: 36px;
    line-height: 36px;
    background: #f8f9fb;
    color: #888;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}
.top-bar a { color: #666; }
.top-bar a:hover { color: #1e88e5; }
.top-bar .top-nav a { margin-left: 16px; }

.navbar { display: flex; align-items: center; height: 70px; }
.logo {
    display: flex; align-items: center; font-size: 22px; font-weight: 700;
    color: #1e88e5;
}
.logo-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: linear-gradient(135deg, #1e88e5, #5e35b1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-right: 10px;
    box-shadow: 0 4px 10px rgba(30,136,229,.25);
}
.logo-text .en { font-size: 11px; color: #999; font-weight: normal; letter-spacing: 1px; }
.nav-menu { margin-left: 60px; display: flex; }
.nav-menu li { margin: 0 20px; }
.nav-menu li a {
    color: #333; font-size: 15px; padding: 24px 4px; position: relative;
    display: inline-block;
}
.nav-menu li a:hover, .nav-menu li a.active { color: #1e88e5; }
.nav-menu li a.active::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 12px;
    height: 3px; border-radius: 2px; background: #1e88e5;
}
/* 桌面端：cta 按钮显示在右侧 user-bar，菜单里隐藏 */
.nav-menu .nav-cta { display: none; }
.user-bar { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn-sm {
    display: inline-block; padding: 6px 18px; border-radius: 6px;
    font-size: 13px; transition: all .2s;
}
.btn-primary-sm { background: #1e88e5; color: #fff; }
.btn-primary-sm:hover { background: #1565c0; color: #fff; }
.btn-outline-sm { border: 1px solid #ddd; color: #666; }
.btn-outline-sm:hover { border-color: #1e88e5; color: #1e88e5; }

/* ====== Hero + 搜索区 ====== */
.hero-section {
    background: linear-gradient(135deg, #1976d2 0%, #673ab7 100%);
    color: #fff;
    padding: 70px 0 90px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: ""; position: absolute; top: -50%; right: -10%;
    width: 600px; height: 600px; border-radius: 50%;
    background: rgba(255,255,255,.05);
}
.hero-section::after {
    content: ""; position: absolute; bottom: -40%; left: -10%;
    width: 500px; height: 500px; border-radius: 50%;
    background: rgba(255,255,255,.04);
}
.hero-content { position: relative; z-index: 2; text-align: center; }
.hero-title {
    font-size: 38px; font-weight: 700; margin-bottom: 16px;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.hero-subtitle { font-size: 16px; opacity: .9; margin-bottom: 40px; }

.search-box {
    max-width: 720px; margin: 0 auto;
    display: flex; background: #fff; border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.search-box select,
.search-box input {
    border: none; padding: 14px 16px; font-size: 15px;
    border-radius: 8px;
}
.search-box select {
    width: 140px; background: #f4f7fb; color: #555; border-right: 1px solid #eee;
    cursor: pointer;
}
.search-box input { flex: 1; color: #333; }
.search-btn {
    background: linear-gradient(135deg, #ff7043, #f4511e);
    color: #fff; font-size: 16px; font-weight: 600;
    padding: 0 36px; border-radius: 8px;
    transition: all .2s;
}
.search-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(244,81,30,.4); }

.hero-tags { margin-top: 24px; font-size: 13px; opacity: .9; }
.hero-tags span { margin: 0 6px; padding: 4px 14px; background: rgba(255,255,255,.15); border-radius: 20px; }

/* ====== 统计条 ====== */
.stats-bar {
    background: #fff; border-radius: 12px;
    margin: -40px auto 0; max-width: 1160px;
    position: relative; z-index: 3;
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
    display: flex;
}
.stat-item {
    flex: 1; padding: 28px 10px; text-align: center; border-right: 1px solid #f0f2f5;
}
.stat-item:last-child { border-right: 0; }
.stat-num { font-size: 28px; font-weight: 700; color: #1e88e5; }
.stat-num .unit { font-size: 14px; color: #888; font-weight: normal; margin-left: 2px; }
.stat-label { color: #888; margin-top: 6px; font-size: 13px; }

/* ====== 通用 Section ====== */
.section { padding: 50px 0; }
.section-white { background: #fff; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.section-title {
    font-size: 22px; font-weight: 700; color: #222;
    padding-left: 12px; position: relative;
}
.section-title::before {
    content: ""; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 22px; background: linear-gradient(180deg, #1e88e5, #673ab7);
    border-radius: 3px;
}
.section-title small { color: #999; font-weight: normal; margin-left: 10px; font-size: 13px; }
.section-more { color: #888; font-size: 13px; }
.section-more:hover { color: #1e88e5; }

/* ====== AI普法专员卡片 ====== */
.lawyer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lawyer-card {
    background: #fff; border-radius: 10px; padding: 24px 18px;
    transition: all .3s;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    border: 1px solid #f0f2f5;
}
.lawyer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,.08);
    border-color: #bbdefb;
}
.lawyer-avatar {
    width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px;
    background: linear-gradient(135deg, #1e88e5, #673ab7);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 26px; font-weight: 600;
    overflow: hidden;
}
.lawyer-name { text-align: center; font-size: 17px; font-weight: 600; color: #222; }
.lawyer-title { text-align: center; color: #666; font-size: 12px; margin: 4px 0 10px; }
.lawyer-title .tag {
    display: inline-block; padding: 2px 8px; border-radius: 4px;
    background: #fff3e0; color: #ef6c00; margin-right: 4px;
}
.lawyer-title .tag.verified { background: #e8f5e9; color: #2e7d32; }
.lawyer-domain {
    margin: 12px 0; text-align: center;
    font-size: 0;
}
.lawyer-domain span {
    display: inline-block; margin: 2px; padding: 3px 10px; font-size: 12px;
    background: #f4f7fb; color: #555; border-radius: 12px;
}
.lawyer-stats {
    display: flex; border-top: 1px dashed #eee; padding-top: 12px;
    margin-top: 12px;
}
.lawyer-stats div { flex: 1; text-align: center; }
.lawyer-stats .num { font-weight: 700; color: #1e88e5; font-size: 15px; }
.lawyer-stats .label { color: #999; font-size: 11px; margin-top: 2px; }

/* ====== 问答/文章 列表 ====== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.panel { background: #fff; border-radius: 10px; padding: 24px; border: 1px solid #f0f2f5; }
.list-item {
    display: flex; padding: 14px 0; border-bottom: 1px dashed #eee;
    align-items: flex-start;
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .rank {
    width: 22px; height: 22px; border-radius: 4px; background: #e3f2fd; color: #1e88e5;
    font-size: 12px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; margin-right: 12px; flex-shrink: 0; margin-top: 3px;
}
.list-item:nth-child(1) .rank { background: #ff5252; color: #fff; }
.list-item:nth-child(2) .rank { background: #ff7043; color: #fff; }
.list-item:nth-child(3) .rank { background: #ffa726; color: #fff; }
.list-item .content { flex: 1; min-width: 0; }
.list-item .title {
    font-size: 14px; color: #333; line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list-item .title:hover { color: #1e88e5; }
.list-item .meta { margin-top: 6px; color: #999; font-size: 12px; display: flex; gap: 14px; }
.list-item .meta .tag {
    display: inline-block; padding: 1px 8px;
    background: #e8f5e9; color: #2e7d32; border-radius: 3px;
}

/* ====== Footer ====== */
.site-footer {
    background: #222b38; color: #c1c7d1; padding: 50px 0 0;
    margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 18px; }
.footer-col ul li { margin: 10px 0; font-size: 13px; }
.footer-col ul li a { color: #c1c7d1; }
.footer-col ul li a:hover { color: #1e88e5; }
.footer-col .contact-line { display: flex; align-items: center; margin: 14px 0; }
.footer-col .contact-line .icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,.06);
    display: flex; align-items: center; justify-content: center;
    margin-right: 10px; font-size: 14px;
}
.footer-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-brand .desc { font-size: 13px; line-height: 1.8; color: #a6adbb; }
.footer-bottom {
    margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.08);
    text-align: center; font-size: 12px; color: #8890a0;
}
.footer-bottom .container { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.footer-bottom .sep { opacity: .5; }

/* ====== 移动端汉堡菜单 ====== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer;
    margin-left: auto;
}
.nav-toggle span {
    display: block; width: 22px; height: 3px; border-radius: 2px;
    background: #333; transition: all .3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ====== 响应式：平板 (≤1024px) ====== */
@media (max-width: 1024px) {
    .lawyer-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
    .footer-brand { grid-column: 1 / -1; }
}

/* ====== 响应式：手机 (≤768px) ====== */
@media (max-width: 768px) {
    .container { width: 100%; max-width: 100%; padding: 0 12px; overflow: hidden; }

    /* 🔑 关键：干掉所有子元素的 min-width，防止 grid 被撑破 */
    [class*="layout-"] > *,
    .layout-filter > div,
    .layout-main-sidebar > div,
    .layout-cards-3 > div,
    .layout-2col > div,
    .layout-region-3 > div,
    .layout-login > div,
    .layout-register > div,
    .layout-user-cards > div,
    .layout-area-stats > div {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    /* 干掉所有内联 min-width/width（只在子元素范围内） */
    [class*="layout-"] [style*="min-width"],
    [class*="layout-"] [style*="width:200"],
    [class*="layout-"] [style*="width:140"],
    [class*="layout-"] [style*="width:120"],
    [class*="layout-"] [style*="width:100"] {
        min-width: 0 !important;
    }

    /* 登录/注册/发布页容器不再 max-width 限制 */
    .container[style*="max-width"] { max-width: 100% !important; }

    /* 布局：主区+侧栏 → 单列，侧栏隐藏 */
    .layout-main-sidebar,
    .layout-main-sidebar-wide { grid-template-columns: 1fr; gap: 0; }
    .layout-main-sidebar > .rsp-sidebar,
    .layout-main-sidebar-wide > .rsp-sidebar,
    .layout-main-sidebar > div:last-child,
    .layout-main-sidebar-wide > div:last-child { display: none; }

    /* 布局：3 列卡片 → 2 列 */
    .layout-cards-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* 布局：筛选表单 → 2 列 */
    .layout-filter { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .layout-filter > * { min-width: 0; }

    /* 布局：登录/注册 → 单列，品牌区隐藏 */
    .layout-login,
    .layout-register { grid-template-columns: 1fr; gap: 0; }
    .layout-login > .rsp-login-brand,
    .layout-register > .rsp-login-brand { display: none; }

    /* 布局：地区 3 列 → 单列 */
    .layout-region-3 { grid-template-columns: 1fr; gap: 12px; }

    /* 布局：2 列 → 单列 */
    .layout-2col { grid-template-columns: 1fr; gap: 12px; }

    /* 布局：地区统计 4 列 → 2 列 */
    .layout-area-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* 布局：专家详情头部 → 堆叠 */
    .layout-hero { grid-template-columns: 1fr; gap: 16px; }

    /* 布局：用户中心卡片 → 2 列 */
    .layout-user-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* 布局：列表项横向 → 纵向堆叠 */
    .layout-item-hero { grid-template-columns: 1fr; gap: 12px; }
    .layout-item-hero > div:first-child { width: 100%; height: auto; aspect-ratio: 16/9; }

    /* 顶栏 */
    .top-bar { height: auto; line-height: 1.8; padding: 6px 0; font-size: 11px; }
    .top-bar .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; }
    .top-bar .top-nav a { margin-left: 0; }

    /* 导航栏 */
    .navbar { flex-wrap: wrap; height: auto; padding: 10px 0; }
    .logo { font-size: 18px; }
    .logo-icon { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
    .logo-text .en { font-size: 10px; }

    .nav-toggle { display: flex; }
    .nav-menu {
        display: none; width: 100%; flex-direction: column;
        margin-left: 0; padding: 10px 0; gap: 0;
        order: 3;
    }
    .nav-menu.open { display: flex; }
    .nav-menu li { margin: 0; width: 100%; text-align: center; }
    .nav-menu li a { display: block; padding: 14px 4px; border-bottom: 1px solid #f0f2f5; position: static; }
    .nav-menu li a.active::after { display: none; }
    .nav-menu li a.active { background: #f0f7ff; }

    .user-bar { gap: 8px; order: 2; }
    .btn-sm { padding: 5px 12px; font-size: 12px; }

    /* 移动端菜单里显示 cta 项，隐藏 user-bar 按钮 */
    .nav-menu .nav-cta { display: list-item; }
    .user-bar { display: none; }

    /* Hero 搜索区 */
    .hero-section { padding: 40px 0 50px; }
    .hero-title { font-size: 24px; letter-spacing: 1px; }
    .hero-subtitle { font-size: 13px; margin-bottom: 24px; }
    .search-box {
        flex-direction: column; border-radius: 10px; padding: 6px;
    }
    .search-box select { width: 100%; border-right: none; border-bottom: 1px solid #eee; }
    .search-box input { padding: 12px; }
    .search-btn { padding: 12px; margin-top: 4px; }
    .hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
    .hero-tags span { margin: 0; }

    /* 统计条 */
    .stats-bar { flex-wrap: wrap; border-radius: 10px; }
    .stat-item { flex: 1 1 50%; padding: 16px 8px; border-right: 1px solid #f0f2f5; border-bottom: 1px solid #f0f2f5; }
    .stat-item:nth-child(odd) { border-right: 1px solid #f0f2f5; }
    .stat-item:nth-child(even) { border-right: 0; }
    .stat-item:nth-last-child(-n+2) { border-bottom: 0; }
    .stat-item:nth-last-child(1) { border-right: 0; }
    .stat-num { font-size: 22px; }
    .stat-label { font-size: 12px; }

    /* Section */
    .section { padding: 30px 0; }
    .section-header { flex-wrap: wrap; gap: 8px; }
    .section-title { font-size: 18px; }
    .section-title small { display: none; }

    /* 卡片网格 → 2 列 */
    .lawyer-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    .lawyer-card { padding: 16px 12px; }
    .lawyer-avatar { width: 56px; height: 56px; font-size: 20px; }
    .lawyer-name { font-size: 15px; }
    .lawyer-stats .num { font-size: 13px; }
    .lawyer-stats .label { font-size: 10px; }

    /* 双栏 → 单列 */
    .two-col { grid-template-columns: 1fr !important; gap: 20px; }

    .panel { padding: 16px; }
    .list-item { padding: 12px 0; }
    .list-item .rank { width: 18px; height: 18px; font-size: 10px; margin-right: 8px; margin-top: 2px; }
    .list-item .title { font-size: 13px; white-space: normal !important; overflow: visible; text-overflow: unset; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .list-item .content { min-width: 0; overflow: hidden; word-break: break-word; }
    .list-item .content * { word-break: break-word; overflow-wrap: break-word; }
    .list-item .meta { gap: 6px 10px; font-size: 11px; flex-wrap: wrap; }
    .list-item .meta .tag { padding: 1px 6px; font-size: 11px; }
    .list-item .meta > span { white-space: nowrap; }

    .section-header { gap: 6px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-col h4 { font-size: 14px; margin-bottom: 12px; }
    .footer-col ul li { margin: 6px 0; font-size: 12px; }
    .footer-col .contact-line { margin: 8px 0; font-size: 12px; }
    .footer-bottom { padding: 14px 0; }
    .footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 11px; }
    .footer-bottom .container .sep { display: none; }

    /* 面包屑 */
    .breadcrumb { padding: 10px 0; }
    .breadcrumb .container { font-size: 12px; }

    /* 文章内容 */
    .article-content { font-size: 14px !important; line-height: 1.8 !important; }

    /* 上一篇/下一篇 → 单列 */
    .layout-2col.prev-next { grid-template-columns: 1fr; }

    /* 回复区/面板 横向霸满：压缩 padding，隐藏楼层号 */
    .rsp-panel-full { padding: 16px !important; border-radius: 10px !important; }
    .rsp-panel-full h3 { font-size: 16px !important; }
    .rsp-reply-item { padding: 14px 0 !important; }
    .rsp-reply-row { gap: 8px !important; }
    .rsp-reply-floor { display: none !important; }
    .reply-content { padding: 10px 12px !important; font-size: 14px !important; line-height: 1.8 !important; border-left-width: 3px !important; }
}

/* ====== 响应式：小手机 (≤480px) ====== */
@media (max-width: 480px) {
    .lawyer-grid { grid-template-columns: 1fr !important; }
    .layout-cards-3 { grid-template-columns: 1fr; }
    .layout-filter { grid-template-columns: 1fr; }
    .layout-user-cards { grid-template-columns: 1fr; }
    .layout-area-stats { grid-template-columns: 1fr; }
    .stats-bar { flex-direction: column; }
    .stat-item { flex: 1 1 100%; border-right: 0 !important; border-bottom: 1px solid #f0f2f5; }
    .stat-item:last-child { border-bottom: 0; }
    .stat-num { font-size: 18px; }

    .hero-title { font-size: 20px; }
    .hero-subtitle { font-size: 12px; }
    .hero-tags span { font-size: 11px; padding: 3px 10px; }

    .logo { font-size: 16px; }
    .logo-icon { width: 28px; height: 28px; font-size: 14px; }
    .logo-text .en { display: none; }

    .lawyer-card { padding: 14px 10px; }
    .lawyer-avatar { width: 48px; height: 48px; font-size: 18px; }

    .footer-col ul li { font-size: 12px; }
    .footer-brand .desc { font-size: 12px; line-height: 1.6; }
}
