/* ============================================================
   北京司直律师事务所 — style.css
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --red:        #8C1F1F;
  --white:      #F7F7F7;
  --gold-light: #D4AF37;
  --dark:       #1a1a1a;
  --gray-text:  #3a3a3a;
  --gray-light: #e8e8e8;

  --font-serif: 'Noto Serif SC', serif;
  --font-sans:  'Noto Sans SC', sans-serif;

  --tabs-h: 109px;
  --transition: 0.3s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--dark);
  background: var(--white);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a  { text-decoration: none; color: inherit; }

/* ============================================================
   SCREEN 1 — 100vh，banner 70% / about 30%
   ============================================================ */

.screen-1 {
  height: 100vh;
  min-height: 896px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Banner (70%) ---------- */
.banner {
  position: relative;
  height: 70%;
  flex-shrink: 0;
  overflow: hidden;
}
.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28.8px;
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.18) 0%,
    rgba(0,0,0,0.32) 60%,
    rgba(0,0,0,0.50) 100%);
}

/* Logo */
.logo-wrap { display: flex; align-items: center; gap: 22.4px; }
.logo-icon  { width: 86.4px; height: auto; }
.logo-text  { display: flex; flex-direction: column; }
.logo-cn {
  font-family: var(--font-serif);
  font-size: 44.8px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 6.4px;
  line-height: 1.3;
}
.logo-en {
  font-size: 17.6px;
  font-weight: 300;
  color: rgba(255,255,255,0.85);
  letter-spacing: 4.8px;
  margin-top: 4.8px;
}
.banner-slogan { display: flex; align-items: center; gap: 19.2px; }
.slogan-line {
  display: inline-block;
  width: 96px; height: 2px;
  background: rgba(255,255,255,0.7);
}
.slogan-text {
  font-family: var(--font-serif);
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  letter-spacing: 6px;
}

/* ---------- About Section (30%) ---------- */
.about-section {
  position: relative;
  flex: 1;
  background: var(--red);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.about-watermark-svg {
  position: absolute;
  bottom: 55%;
  left: 20%;
  width: 80%;
  height: auto;
  max-height: 100%;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
  display: block;
  object-fit: contain;
  object-position: bottom left;
}
.about-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 128px) 0 clamp(24px, 5vw, 96px);
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 96px);
}
.about-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.about-dash {
  font-family: var(--font-serif);
  font-size: clamp(16px, 3vw, 42px);
  color: rgba(255,255,255,0.8);
}
.about-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 3vw, 72px);
  font-weight: 700;
  color: #f7f7f7;
  white-space: nowrap;
}
.about-text {
  font-size: clamp(10px, 1.2vw, 24px);
  line-height: 2;
  color: rgba(255,255,255,0.85);
  flex: 1;
  max-width: 960px;
}
.about-btn {
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 3vw, 60px);
  border: clamp(1px, 1vw, 3px) solid rgba(255,255,255,1);
  padding: clamp(8px, 1.5vw, 12px) clamp(16px, 3vw, 24px);
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-text {
  font-size: clamp(12px, 1.3vw, 32px);
  color: #f7f7f7;
  letter-spacing: clamp(1px, 0.2vw, 2px);
  transition: color var(--transition);
  white-space: nowrap;
}
.about-btn .btn-arrow {
  position: relative;
  width: clamp(16px, 2vw, 48px); height: clamp(16px, 2vw, 48px);
  display: flex; align-items: center; justify-content: center;
}
.arrow-icon {
  position: absolute;
  width: clamp(16px, 2vw, 36px); height: auto;
  transition: opacity var(--transition);
}
.arrow-white { opacity: 1; }
.arrow-red   { opacity: 0; }
.about-btn:hover { background: var(--white); border-color: var(--white); }
.about-btn:hover .btn-text    { color: var(--red); }
.about-btn:hover .arrow-white { opacity: 0; }
.about-btn:hover .arrow-red   { opacity: 1; }

/* ============================================================
   SCREEN 2 — 100vh
   顺序：team-header (20%) → [card + tabs 等分剩余 80%]
   card 和 tabs 各占 flex:1 → 各得 40vh
   ============================================================ */

.screen-2 {
  height: 100vh;
  min-height: 896px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f7f7;
}

/* ---------- Team Header (20%) ---------- */
.team-header {
  position: relative;
  height: 20%;
  flex-shrink: 0;
  background: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}
.team-watermark-svg {
  position: absolute;
  top: 60%;
  left: 38%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  max-height: 80%;
  opacity: 0.28;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
}
.team-title-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 24px);
  padding-right: clamp(20px, 10vw, 240px);
}
.team-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 3vw, 72px);
  font-weight: 700;
  color: #f7f7f7;
}
.team-dash {
  font-family: var(--font-serif);
  font-size: 22px;
  color: rgba(255,255,255,1);
}

/* ============================================================
   card-area — member-card 和 tabs-wrap 的等分容器
   占 screen-2 剩余 80%，内部两者各 flex:1（各 40vh）
   ============================================================ */
.card-area {
  flex: 1;               /* 占 team-header 以外的全部高度 */
  display: flex;
  flex-direction: column;
  min-height: 0;         /* 允许 flex 子项收缩 */
  overflow: hidden;
  padding: 3vw 0;
}

/* ---------- Member Card (card-area 的 50%) ---------- */
.member-card {
  flex: 1;               /* 与 tabs-wrap 平分 card-area */
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;  /* ← 关键：左右列等高 */
  gap: 0;
  padding: clamp(8px, 1vw, 16px) clamp(8px, 1vw, 16px);
  width: 100%;
  max-width: 85%;
  margin: 0 auto;
  align-self: stretch;
  overflow: hidden;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0px 4px 12px rgba(0,0,0,0.16);
  /* box-shadow 在 card-area 内，需要给 card-area 留一点 padding 才能显示阴影 */
}

/* Photo — 左列，高度 = card 高度（由 stretch 撑满）*/
.member-photo-wrap {
  flex: 0 0 clamp(260px, 28vw, 680px);
  /* aspect-ratio: 389/466; */
  position: relative;
  overflow: hidden;
  border-radius: 0.25rem;
  /* background-color: #F7F7F7; */
  /* aspect-ratio 不再设置，高度由父 stretch 决定 */
}
.member-photo {
  position: static;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Info — 右列，height: 100% 使内部 flex 布局生效 */
.member-info {
  flex: 1;
  min-width: 0;
  /* height: 100%; */          /* ← 关键：与左列等高 */
  padding-left: clamp(8px, 1.2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vw, 12px);
  overflow: hidden;
}

.member-name-wrap { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.member-name {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 48px);
  font-weight: 700;
  color: var(--dark);
}
.member-tag {
  background: var(--red);
  color: #f7f7f7;
  font-size: clamp(10px, 1vw, 18px);
  padding: clamp(2px, 0.3vw, 8px) clamp(10px, 1.2vw, 24px);
  border-radius: 30px;
  letter-spacing: 1px;
  display: inline-block;
  max-width: fit-content;
  margin-top: 0.3vh;
  white-space: nowrap;
  flex-shrink: 0;
}
.member-contacts {
  display: flex;
  gap: clamp(10px, 2vw, 16px);
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(12px, 1vw, 20px);
  color: #4A4A4A;
  line-height: 1.9;
}
.contact-icon {
  width: clamp(12px, 1.3vw, 28px);
  height: clamp(12px, 1.3vw, 28px);
}

/* ---- 上半区：执业领域 & 执业资格（等高）---- */
/* 用 flex:1 让 mg-top-row + mg-bottom-row 撑满 member-info 剩余高度 */
.mg-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
  padding-top: 10px;
  align-items: stretch;
  flex-shrink: 0;
}
.mg-top-row .mg-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mg-top-row.full-width { grid-template-columns: 1fr; }

/* ---- 下半区：代表项目 & 学术成果 ---- */
.mg-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(12px, 2vw, 24px);
  flex: 1;              /* 撑满 member-info 剩余高度 */
  min-height: 0;
  padding-top: 1.5rem;
}
.mg-bottom-row.full-width { grid-template-columns: 1fr; }
.mg-bottom-row .mg-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

/* 通用 */
.mg-section { box-sizing: border-box;width: 100%;min-width: 0;display: flex;flex-direction: column; }
.mg-title {
  font-size: clamp(16px, 1.53vw, 42px);
  font-weight: 500;
  color: var(--red);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.mg-line {
  width: 100%;
  height: 2px;
  background: var(--red);
  flex-shrink: 0;
}
.mg-text {
  font-size: clamp(10px, 1vw, 24px);
  line-height: 1.9;
  color: #4A4A4A;
}

/* 执业资格 */
.qual-content {
  font-size: clamp(10px, 1vw, 24px);
  color: #4A4A4A;
  line-height: 1.9;
  column-gap: 16px;
}
.qual-content.multi-col { columns: 2; }

/* 滚动列表 */
.project-list,
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;              /* 撑满 mg-section 剩余高度 */
  min-height: 110px;        /* 允许收缩，不撑破父容器 */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-light) transparent;
  padding-right: 2px;
}
.project-list::-webkit-scrollbar,
.pub-list::-webkit-scrollbar { width: 4px; }
.project-list::-webkit-scrollbar-track,
.pub-list::-webkit-scrollbar-track { background: transparent; }
.project-list::-webkit-scrollbar-thumb,
.pub-list::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 4px; }

/* 列表子项 */
.project-item,
.pub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3vw 0;
  font-size: clamp(10px, 1vw, 24px);
  color: #444;
  gap: 8px;
  flex-shrink: 0;
}
.project-name,
.pub-name { flex: 1; line-height: 1.5; }
.dl-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity var(--transition);
}
.dl-btn:hover { opacity: 1; }
.dl-btn img { width: 1.2em; height: 1.2em; }

/* ---------- Team Tabs（card-area 的另一半）---------- */
.team-tabs-wrap {
  flex: none;              /* 与 member-card 等分 card-area */
  min-height: 0;
  /* background: #fff; */
  padding: 0 clamp(16px, 8vw, 12vw);
  overflow-x: auto;
  scrollbar-width: none;
  display: flex;
  align-items: stretch;
  margin-top: auto;
  margin-bottom: clamp(16px, 3vw, 40px);
}
.team-tabs-wrap::-webkit-scrollbar { display: none; }
.team-tabs {
  display: flex;
  min-width: max-content;
  height: 100%;
  align-items: stretch;
}
.team-tab {
  position: relative;
  padding: 16px 12px;
  background-color: #fff;
  border: 1px solid #E5E5E5 ;
  border-radius: 4px;
  margin-right: clamp(8px,1.2vw,24px);;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  /* align-items: center; */
  justify-content: center;
  gap: 6px;
  /* height: 100%; */
  transition: all var(--transition);
}
.tab-name {
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.5vw, 42px);
  font-weight: 500;
  color: var(--gray-text);
  transition: color var(--transition);
  white-space: nowrap;
}
.tab-role {
  font-size: clamp(8px, 1vw, 18px);
  color: #999;
  transition: color var(--transition);
  white-space: nowrap;
}
.tab-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--red);
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s;
  opacity: 0;
}
.team-tab:not(.active):hover .tab-name { color: var(--red); }
.team-tab.active .tab-indicator { transform: translateX(-50%) scaleX(1); opacity: 1; }
/* .team-tab.active .tab-name { color: var(--red); font-weight: 700; }
.team-tab.active .tab-role { color: var(--red); } */
.team-tab.active .tab-name,
.team-tab.active .tab-role {
  color: inherit;
  font-weight: inherit;
	}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background: var(--red);
  padding: clamp(30px, 5vw, 50px) clamp(20px, 6vw, 80px) 30px;
  color: rgba(255,255,255,0.85);
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: clamp(12px, 1.7vw, 36px);
  /* margin-bottom: clamp(16px, 3vw, 28px); */
}
.footer-logo-wrap { display: flex; align-items: center; gap: 12px; }
.footer-logo-icon { width: clamp(278px, 20.8vw, 400px); height: auto; filter: brightness(10); }
/* .footer-logo-text { display: flex; flex-direction: column; }
.footer-logo-cn {
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.5vw, 22px);
  font-weight: 600;
  color: #fff;
  letter-spacing: 3px;
}
.footer-logo-en {
  font-size: clamp(8px, 0.8vw, 12px);
  color: rgba(255,255,255,0.65);
  letter-spacing: 2px;
  margin-top: 2px;
} */
.back-top-btn {
  background: none;
  /* border: 1.5px solid rgba(255,255,255,0.5); */
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  border: none;outline: none;
  /* transition: background var(--transition), border-color var(--transition); */
}
.back-top-btn img { width: clamp(14px, 1.6vw, 36px); filter: brightness(10); }
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: clamp(11px, 1.2vw, 16px);
  line-height: 1.8;
  color: rgba(255,255,255,0.8);
  margin-bottom: clamp(8px, 1.7vw, 24px);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,1);
}
.footer-links { display: flex; align-items: center; gap: 8px; font-size: clamp(11px, 1.2vw, 16px); }
.footer-link  { color: rgba(255,255,255,0.8); transition: color var(--transition); }
.footer-link:hover { color: #fff; }
.footer-sep   { color: rgba(255,255,255,0.4); }
.footer-social { display: flex; gap: 14px; align-items: center; }
.social-icon-btn {
  width: clamp(24px, 2.5vw, 40px); height: clamp(24px, 2.5vw, 40px);
  display: flex; align-items: center; justify-content: center;
  /* border: 1px solid rgba(255,255,255,0.4);
  border-radius: 2px; */
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.social-icon-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.8); }
.social-icon-btn img { width: clamp(14px, 1.5vw, 22px); filter: brightness(10); }
.footer-icp {
  margin-top: 16px;
  font-size: clamp(10px, 1vw, 13px);
  color: rgba(255,255,255,0.5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 竖屏平板 / 大手机（≤860px）：取消 100vh，card-area 改自然高度 */
@media (max-width: 860px) {
  .screen-1, .screen-2 {
    height: auto;
    min-height: unset;
    overflow: visible;
  }

  /* Screen 1 */
  .banner { height: 50vw; min-height: 240px; max-height: 460px; }
  .about-section { min-height: 200px; padding: 28px 0; }
  .about-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 24px;
    gap: 14px;
  }
  .about-text { max-width: 100%; }

  /* Screen 2 */
  .team-header { height: auto; min-height: 110px; padding: 20px 24px; }
  .team-title-wrap { padding-right: 24px; }

  /* card-area 改为自然高度，取消等分 */
  .card-area { flex: none; overflow: visible; }

  .member-card {
    flex-direction: column;
    align-items: flex-start;   /* 移动端不等高，照片固定高 */
    padding: 20px 16px;
    max-width: 100%;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
  }
  .member-photo-wrap {
    flex: none;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 4px;
  }
  .member-info {
    height: auto;
    padding-left: 0;
    padding-top: 16px;
    overflow: visible;
  }
  .mg-top-row,
  .mg-bottom-row { grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px; }
  .mg-bottom-row { flex: none; }

  /* tabs 移动端恢复固定高 */
  .team-tabs-wrap {
    flex: none;
    height: var(--tabs-h);
    overflow-x: auto;
  }

  /* 列表移动端取消 flex:1，改固定 min-height */
  .project-list,
  .pub-list {
    flex: none;
    min-height: 100px;
    max-height: 150px;
  }
}

/* 手机（≤580px）*/
@media (max-width: 580px) {
  .about-title { font-size: 24px; }
  .team-title  { font-size: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
   /* 1. 卡片本身：强制占满屏幕宽度 */
    .member-card {
      width: 100vw !important;       /* 视口宽度，确保顶到头 */
      max-width: 100vw !important;
      margin: 0 !important;          /* 清除左右外边距 */
      padding: 20px !important;      /* 给一点内边距，防止内容贴边 */
      box-sizing: border-box;        /* 关键：让padding包含在宽度内 */
      left: 0 !important;            /* 防止定位偏移 */
      right: 0 !important;
    }
  
    /* 2. 卡片内部子元素：只针对“非图标”元素进行拉伸 */
    /* 这里假设你的图标类名包含 'icon' 或 'svg'，如果类名不同请告诉我 */
    .member-card > :not(.icon):not(svg):not(img) {
      width: 100% !important;
      max-width: 100% !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
      box-sizing: border-box;
      text-align: left; /* 文字强制左对齐，或者 center 居中 */
    }
  
    /* 3. 保护图标：明确禁止图标被拉伸 */
    .member-card .icon,
    .member-card svg,
    .member-card img {
      width: auto !important;   /* 恢复自动宽度 */
      max-width: none !important; /* 取消最大宽度限制 */
      flex: none !important;    /* 取消弹性伸缩 */
      /* 如果图标太小想稍微调大一点点，可以在这里加 font-size */
    }
  }
}
