/* ==========================================================================
   layout.css —— 版式外壳：header / nav（含 2~5 级下拉）/ 搜索框 / 用户中心 /
   main / sidebar（fold · hide）/ content / content-section / 通用标题 / footer。
   本文件为原稿逐字迁移，仅删除了 body 的固定最小宽度，其余保持不动。
   ========================================================================== */

/* ---------- 顶部导航栏 ---------- */
.header {
  width: 100%;
  height: 80px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  transition: all 0.3s ease;
}

.header.scroll {
  height: 60px;
  line-height: 60px !important;
  box-shadow: var(--shadow-deep);
}

.header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- LOGO 区域（原 PNG 位图 → 内联 SVG） ---------- */
.logo {
  display: flex;
  align-items: center;
  height: 100%;
  transition: all 0.3s ease;
  width: 80px;
}

.logo .logo-svg {
  height: 40px;
  width: auto;
  transition: all 0.3s ease;
}

.header.scroll .logo .logo-svg {
  height: 35px;
}

/* ---------- 核心导航菜单 ---------- */
.nav {
  display: flex;
  height: 100%;
  margin: 0 20px;
  flex: 1;
  justify-content: center;
}

.nav > li {
  position: relative;
  line-height: 80px;
  padding: 0 15px;
  font-size: 16px;
  color: var(--blue-deep);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header.scroll .nav > li {
  line-height: 60px;
}

.nav > li:hover {
  color: var(--orange);
  background-color: #F8F9FA;
  transform: scale(1.05);
}

.nav > li.is-active {
  color: var(--orange);
}

/* 二级下拉菜单 */
.nav .subnav2 {
  position: absolute;
  top: 80px;
  left: 0;
  width: 200px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  display: none;
  z-index: 998;
  border-top: 2px solid var(--orange);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.header.scroll .nav .subnav2 {
  top: 60px;
}

.nav > li:hover .subnav2 {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.nav .subnav2 > li {
  line-height: 45px;
  padding: 0 15px;
  position: relative;
  border-bottom: 1px solid #F5F7FA;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav .subnav2 > li:hover {
  background-color: #F8F9FA;
  padding-left: 20px;
  color: var(--orange);
}

/* 三级下拉菜单 */
.nav .subnav3 {
  position: absolute;
  top: 0;
  left: 200px;
  width: 200px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  display: none;
  z-index: 997;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.nav .subnav2 > li:hover .subnav3 {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* 四级下拉菜单 */
.nav .subnav4 {
  position: absolute;
  top: 0;
  left: 200px;
  width: 200px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  display: none;
  z-index: 996;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.nav .subnav3 > li:hover .subnav4 {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* 五级下拉菜单 */
.nav .subnav5 {
  position: absolute;
  top: 0;
  left: 200px;
  width: 200px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  display: none;
  z-index: 995;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.nav .subnav4 > li:hover .subnav5 {
  display: block;
  opacity: 1;
  transform: translateX(0);
}

/* ---------- 搜索框 + 用户中心 ---------- */
.header-right {
  display: flex;
  align-items: center;
  width: 400px;
  justify-content: flex-end;
}

.search {
  position: relative;
  margin-right: 20px;
}

.search input {
  width: 250px;
  height: 38px;
  padding: 0 15px 0 35px;
  border: 1px solid var(--silver);
  border-radius: 20px;
  outline: none;
  transition: all 0.3s ease;
}

.search input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 8px rgba(255, 122, 47, 0.2);
  width: 300px;
}

.search i {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--gray-light);
  transition: all 0.3s ease;
  font-size: 16px;
  cursor: pointer;
}

.search input:focus + i {
  color: var(--orange);
}

.search i:hover {
  color: var(--orange);
}

.user-center {
  display: flex;
  align-items: center;
}

.user-center a {
  margin: 0 10px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.user-center a:hover {
  color: var(--orange);
}

.user-center .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--silver);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-center .avatar:hover {
  transform: rotate(10deg);
  border-color: var(--orange);
}

/* 头像：原 PNG 位图 → CSS 渐变圆 + 首字母 */
.user-center .avatar .avatar-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-light) 100%);
  user-select: none;
}

.user-center .service {
  font-size: 20px;
  color: var(--blue-deep);
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: 10px;
}

.user-center .service:hover {
  color: var(--orange);
  transform: scale(1.1);
}

/* 头像下拉菜单 */
.avatar-dropdown li:hover {
  background-color: #F8F9FA;
  color: var(--orange);
}

.avatar-dropdown li i {
  margin-right: 8px;
  color: var(--blue-light);
}

/* ---------- 主内容区 ---------- */
.main {
  margin-top: 80px;
  display: flex;
  min-height: calc(100vh - 80px - 350px);
  transition: all 0.3s ease;
}

/* ---------- 左侧功能快捷栏 ---------- */
.sidebar {
  width: 200px;
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 350px;
  z-index: 990;
  transition: all 0.3s ease;
  overflow-y: auto;
  transform: translateX(0);
}

.sidebar.hide {
  transform: translateX(-100%);
}

.header.scroll + .main .sidebar {
  top: 60px;
}

.sidebar .fold-btn {
  width: 100%;
  height: 50px;
  line-height: 50px;
  text-align: center;
  background-color: var(--blue-deep);
  color: var(--white);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar .fold-btn:hover {
  background-color: var(--blue-light);
}

/* 折叠态：箭头翻转 */
.sidebar.fold .fold-btn .iconfont {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}

.sidebar .sidebar-menu {
  padding: 10px 0;
}

.sidebar .sidebar-menu > li {
  line-height: 48px;
  padding: 0 20px;
  position: relative;
  cursor: pointer;
  color: var(--gray-dark);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.sidebar.fold .sidebar-menu > li {
  padding: 0;
  text-align: center;
  justify-content: center;
}

.sidebar .sidebar-menu > li:hover {
  background-color: #F8F9FA;
  color: var(--orange);
  border-left-color: var(--orange);
}

.sidebar .sidebar-menu > li.active {
  color: var(--orange);
  background-color: #F8F9FA;
  border-left-color: var(--orange);
}

.sidebar .sidebar-menu > li i {
  margin-right: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.sidebar.fold .sidebar-menu > li span {
  display: none;
}

.sidebar.fold .sidebar-menu > li i {
  margin-right: 0;
}

/* 快捷栏二级菜单 */
.sidebar .sidebar-sub {
  padding-left: 30px;
  display: none;
  background-color: #F8F9FA;
  transition: all 0.3s ease;
}

.sidebar .sidebar-menu > li.active .sidebar-sub {
  display: block;
  animation: fadeIn 0.3s ease;
}

.sidebar.fold .sidebar-sub {
  display: none !important;
}

.sidebar .sidebar-sub > li {
  line-height: 36px;
  font-size: 13px;
  color: var(--gray-dark);
  cursor: pointer;
}

.sidebar .sidebar-sub > li:hover {
  color: var(--orange);
}

/* ---------- 右侧主内容区 ---------- */
.content {
  flex: 1;
  margin-left: 200px;
  transition: all 0.3s ease;
  min-width: 0;
}

.sidebar.fold + .content {
  margin-left: 60px;
}

.sidebar.hide + .content {
  margin-left: 0;
}

/* ---------- 板块通用样式 ---------- */
.content-section {
  width: 100%;
  padding: 30px 0;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.content-section.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: 32px;
  color: var(--blue-light);
  font-weight: 600;
  margin-bottom: 30px;
  text-align: center;
}

.section-desc {
  font-size: 14px;
  color: var(--gray-dark);
  margin-bottom: 30px;
  line-height: 1.8;
}

/* ---------- 底部页脚区 ---------- */
.footer {
  width: 100%;
  background-color: #1A1A1A;
  color: var(--silver);
  padding: 50px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #333;
}

.footer-column {
  width: 23%;
}

.footer-column h4 {
  font-size: 18px;
  color: var(--white);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
  display: inline-block;
}

.footer-column p,
.footer-column a {
  font-size: 14px;
  color: var(--silver);
  line-height: 1.8;
  display: block;
  transition: all 0.3s ease;
}

.footer-column a:hover {
  color: var(--orange);
  padding-left: 5px;
}

.footer-column .contact-info {
  margin-top: 15px;
}

.footer-column .contact-info li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.footer-column .contact-info li i {
  color: var(--orange);
}

.footer-qrcode {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.footer-qrcode .qrcode {
  width: 80px;
  height: 80px;
  background-color: var(--white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

/* 二维码：原 PNG 位图 → 内联程序化 SVG */
.footer-qrcode .qrcode .qrcode-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.footer-qrcode .qrcode-text {
  font-size: 12px;
  text-align: center;
  margin-top: 5px;
}

.footer-copyright {
  text-align: center;
  font-size: 13px;
  color: var(--gray-light);
  padding-top: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.footer-links a {
  display: inline-block;
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--orange);
}

/* ---------- 移动端汉堡按钮（默认隐藏，<768px 显示，见 responsive.css） ---------- */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--silver);
  border-radius: 4px;
  background-color: var(--white);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: none;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--blue-deep);
  transition: all 0.3s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
