/* ============================================================
   法聘法律服务 - 主样式表
   风格：66law.cn 仿站 · 蓝色主调 · 卡片式 · 响应式
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --primary-bg: #f0f7ff;
  --accent: #ff6b35;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text-1: #1f2937;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: #e5e7eb;
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --header-h: 56px;
  --nav-h: 48px;
  --max-w: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
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: var(--text-1);
  background: var(--bg-page); min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------- 布局容器 ---------- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 0; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-title h2 {
  font-size: 20px; font-weight: 700; color: var(--text-1);
  position: relative; padding-left: 12px;
}
.section-title h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; background: var(--primary); border-radius: 2px;
}
.section-title .more { font-size: 13px; color: var(--text-3); }
.section-title .more:hover { color: var(--primary); }

/* ---------- 顶部栏（城市/登录/平台切换） ---------- */
.topbar {
  background: #f8f9fb; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); height: 32px; line-height: 32px;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar a { color: var(--text-2); }
.topbar a:hover { color: var(--primary); }
.city-selector { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.city-selector:hover { color: var(--primary); }
.platform-switch {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border: 1px solid var(--primary); border-radius: 12px;
  color: var(--primary); font-weight: 500; transition: all .2s;
}
.platform-switch:hover { background: var(--primary); color: #fff; }

/* ---------- 主导航 ---------- */
.header {
  background: #fff; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100;
}
.header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.logo {
  display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800;
  color: var(--primary); letter-spacing: -.5px;
}
.logo-icon {
  width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; font-weight: 700;
}
.logo span { color: var(--text-1); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  display: inline-flex; align-items: center; padding: 8px 16px;
  font-size: 15px; font-weight: 500; color: var(--text-1);
  border-radius: var(--radius-sm); transition: all .2s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--primary); background: var(--primary-light);
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 20px; font-size: 14px; font-weight: 500; border-radius: var(--radius-sm);
  transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 12px 32px; font-size: 16px; border-radius: var(--radius-md); }

/* 移动端菜单按钮 */
.menu-toggle { display: none; font-size: 24px; color: var(--text-1); padding: 4px 8px; }

/* ---------- Hero 搜索区 ---------- */
.hero {
  background: linear-gradient(135deg, #0958d9 0%, #1677ff 50%, #4096ff 100%);
  padding: 48px 0 56px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; bottom: -30%; left: -5%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; text-align: center; }
.hero h1 {
  font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.hero .subtitle { font-size: 16px; color: rgba(255,255,255,.85); margin-bottom: 32px; }
.search-box {
  max-width: 680px; margin: 0 auto; display: flex; background: #fff;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-box input {
  flex: 1; padding: 16px 20px; font-size: 15px; border: none; outline: none;
  color: var(--text-1);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box button {
  padding: 0 32px; font-size: 16px; font-weight: 600; color: #fff;
  background: var(--primary); border: none; transition: background .2s;
}
.search-box button:hover { background: var(--primary-dark); }
.hot-tags {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 16px; flex-wrap: wrap;
}
.hot-tags .label { color: rgba(255,255,255,.7); font-size: 13px; }
.hot-tags a {
  color: rgba(255,255,255,.9); font-size: 13px; padding: 2px 10px;
  background: rgba(255,255,255,.15); border-radius: 12px; transition: all .2s;
}
.hot-tags a:hover { background: rgba(255,255,255,.3); color: #fff; }

/* ---------- 统计数据区 ---------- */
.stats-bar {
  background: #fff; margin-top: -28px; position: relative; z-index: 2;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 24px 0;
}
.stat-item { text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-num {
  font-size: 28px; font-weight: 800; color: var(--primary);
  line-height: 1.2; margin-bottom: 4px;
}
.stat-num .unit { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.stat-label { font-size: 13px; color: var(--text-2); }

/* ---------- 快速入口图标区 ---------- */
.quick-entry {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.quick-card {
  background: var(--bg-card); border-radius: var(--radius-md); padding: 24px 16px;
  text-align: center; box-shadow: var(--shadow-sm); transition: all .25s;
  border: 1px solid transparent;
}
.quick-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.quick-icon {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.quick-icon.c1 { background: #e6f4ff; color: #1677ff; }
.quick-icon.c2 { background: #f6ffed; color: #52c41a; }
.quick-icon.c3 { background: #fff7e6; color: #fa8c16; }
.quick-icon.c4 { background: #f9f0ff; color: #722ed1; }
.quick-icon.c5 { background: #fff1f0; color: #ff4d4f; }
.quick-card h3 { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.quick-card p { font-size: 12px; color: var(--text-3); }

/* ---------- 精选解答列表 ---------- */
.qa-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.qa-item {
  background: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 16px;
  transition: background .2s;
}
.qa-item:hover { background: var(--primary-bg); }
.qa-category {
  flex-shrink: 0; padding: 3px 10px; font-size: 12px; font-weight: 500;
  background: var(--primary-light); color: var(--primary); border-radius: 4px;
}
.qa-title {
  flex: 1; font-size: 14px; color: var(--text-1); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qa-title:hover { color: var(--primary); }
.qa-meta { flex-shrink: 0; display: flex; gap: 16px; font-size: 12px; color: var(--text-3); }

/* ---------- 律师推荐卡片 ---------- */
.lawyer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lawyer-card {
  background: #fff; border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all .25s; border: 1px solid transparent;
}
.lawyer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.lawyer-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lawyer-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #0958d9);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.lawyer-info h4 { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; }
.lawyer-info .title { font-size: 12px; color: var(--text-3); }
.lawyer-rating { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.lawyer-rating .stars { color: #faad14; font-size: 12px; }
.lawyer-rating .score { font-size: 12px; font-weight: 600; color: var(--text-2); }
.lawyer-specialty {
  font-size: 13px; color: var(--text-2); margin-bottom: 8px; line-height: 1.5;
}
.lawyer-stats {
  display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.lawyer-stats strong { color: var(--text-1); font-weight: 600; }
.lawyer-card .btn { width: 100%; margin-top: 12px; padding: 6px; font-size: 13px; }

/* ---------- 法律常识 / 知识推荐 ---------- */
.knowledge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.knowledge-card {
  background: #fff; border-radius: var(--radius-md); padding: 20px;
  box-shadow: var(--shadow-sm); transition: all .25s;
}
.knowledge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.knowledge-card .tag {
  display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 500;
  background: var(--primary-bg); color: var(--primary); border-radius: 4px; margin-bottom: 10px;
}
.knowledge-card h4 {
  font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 8px;
  line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.knowledge-card p {
  font-size: 13px; color: var(--text-2); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.knowledge-card .meta { margin-top: 12px; font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; }

/* ---------- CTA 横幅 ---------- */
.cta-banner {
  background: linear-gradient(135deg, #1677ff, #0958d9);
  border-radius: var(--radius-lg); padding: 32px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  color: #fff;
}
.cta-banner h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.cta-banner p { font-size: 14px; color: rgba(255,255,255,.8); }
.cta-banner .btn { background: #fff; color: var(--primary); font-weight: 600; }
.cta-banner .btn:hover { background: var(--primary-bg); }

/* ---------- 底部 ---------- */
.footer {
  background: #1f2937; color: rgba(255,255,255,.6); padding: 40px 0 24px; margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand .logo span { color: #fff; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-col h5 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,.6); font-size: 13px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px;
  text-align: center; font-size: 12px; color: rgba(255,255,255,.4);
}

/* ---------- 子页面通用 ---------- */
.page-hero {
  background: linear-gradient(135deg, #0958d9, #1677ff);
  padding: 36px 0; color: #fff;
}
.page-hero h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.page-hero p { font-size: 14px; color: rgba(255,255,255,.8); }
.breadcrumb { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }
.skeleton-card {
  background: #fff; border-radius: var(--radius-md); padding: 40px;
  text-align: center; box-shadow: var(--shadow-sm);
}
.skeleton-card .icon { font-size: 48px; margin-bottom: 16px; }
.skeleton-card h3 { font-size: 18px; color: var(--text-1); margin-bottom: 8px; }
.skeleton-card p { font-size: 14px; color: var(--text-3); margin-bottom: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
  .quick-entry { grid-template-columns: repeat(3, 1fr); }
  .lawyer-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 16px 0; }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(1), .stat-item:nth-child(2) { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
}

@media (max-width: 768px) {
  .topbar { display: none; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 8px; box-shadow: var(--shadow-md); gap: 0; }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; padding: 12px 16px; }
  .menu-toggle { display: block; }
  .hero { padding: 32px 0 40px; }
  .hero h1 { font-size: 24px; }
  .hero .subtitle { font-size: 14px; }
  .search-box { flex-direction: column; border-radius: var(--radius-md); }
  .search-box input { padding: 14px 16px; }
  .search-box button { padding: 12px; }
  .quick-entry { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .quick-card { padding: 16px 12px; }
  .lawyer-grid { grid-template-columns: 1fr; }
  .knowledge-grid { grid-template-columns: 1fr; }
  .section { padding: 24px 0; }
  .section-title h2 { font-size: 17px; }
  .cta-banner { flex-direction: column; text-align: center; padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .qa-meta { display: none; }
  .header-actions .btn-outline { display: none; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 22px; }
  .quick-entry { grid-template-columns: repeat(2, 1fr); }
}


/* ============================================================
   v2 新增：用户下拉菜单 / 平台切换遮罩 / 用户区域
   ============================================================ */

/* ---------- 按钮变体 ---------- */
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-text { background: none; color: var(--text-2); padding: 6px 10px; }
.btn-text:hover { color: var(--primary); background: var(--primary-light); }
.hide-mobile { display: inline-flex; }

/* ---------- 头部用户区域 ---------- */
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-auth { display: flex; align-items: center; gap: 8px; }

/* 用户头像按钮 */
.header-user { position: relative; }
.user-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid transparent; transition: border-color .2s;
  background: none; cursor: pointer;
}
.user-avatar-btn:hover { border-color: var(--primary); }

/* ---------- 用户下拉菜单 ---------- */
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 240px; background: #fff; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all .2s ease; z-index: 200; overflow: hidden;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.user-dropdown-head {
  display: flex; align-items: center; gap: 12px; padding: 16px;
  background: linear-gradient(135deg, var(--primary-bg), #fff);
  border-bottom: 1px solid var(--border);
}
.user-dropdown-ava { flex-shrink: 0; }
.user-dropdown-meta { flex: 1; min-width: 0; }
.user-dropdown-name {
  font-size: 15px; font-weight: 700; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-dropdown-role {
  display: inline-block; margin-top: 4px; font-size: 11px;
  padding: 1px 8px; border-radius: 10px; background: var(--primary-light);
  color: var(--primary); font-weight: 500;
}

.user-dropdown-link {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  font-size: 13.5px; color: var(--text-1); text-decoration: none;
  transition: all .15s; border-left: 3px solid transparent;
}
.user-dropdown-link:hover {
  background: var(--primary-bg); color: var(--primary);
  border-left-color: var(--primary); padding-left: 20px;
}

/* 切换到知识库：醒目样式 */
.user-dropdown-link.switch-highlight {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600; border-left-color: var(--primary);
  margin: 4px 8px; border-radius: var(--radius-sm);
  padding-left: 13px;
}
.user-dropdown-link.switch-highlight:hover {
  background: var(--primary); color: #fff;
  padding-left: 17px;
}

/* ---------- 平台切换遮罩 ---------- */
.switch-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(255,255,255,.95);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .3s ease;
  backdrop-filter: blur(4px);
}
.switch-overlay.show { opacity: 1; visibility: visible; }
.switch-spinner {
  width: 40px; height: 40px; border: 3px solid #e5e7eb;
  border-top-color: var(--primary); border-radius: 50%;
  animation: svcSpin .8s linear infinite; margin-bottom: 16px;
}
@keyframes svcSpin { to { transform: rotate(360deg); } }
.switch-text {
  font-size: 15px; color: var(--text-1); font-weight: 500;
}

/* ---------- 页脚专业版入口（低调） ---------- */
.footer-pro-entry {
  color: rgba(255,255,255,.35); font-size: 11px; text-decoration: none;
  transition: color .2s;
}
.footer-pro-entry:hover { color: rgba(255,255,255,.7); }

/* ---------- 响应式补充 ---------- */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .header-auth .btn-text { padding: 4px 8px; font-size: 13px; }
  .user-dropdown { right: -8px; width: 220px; }
  .topbar-right a[href*="APP"] { display: none; }
}

/* 20260906n 任务5：IM 浮窗对齐子站——FAB 改 Ant 蓝品牌渐变；子站不加载倒计时悬浮球，FAB 不必高位让位，降回底部 */
.im-fab{background:linear-gradient(135deg,#1677ff,#0958d9);bottom:20px;}
@media(max-width:600px){.im-fab{bottom:16px;right:16px;}}
