* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

/* 导航栏 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    background: #09302f;
    color: #fff;
    padding: 0 40px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    padding: 0 20px;
    font-size: 16px;
}

.nav-menu li a.active {
    color: #4CAF50;
}

.user a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
}

/* 大图背景 */
.banner {
    height: 800px;
    background: url("shouye6.jpg") center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
}

.banner-content {
    width: 80%;
}

.banner-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.banner-title h1 {
    font-size: 40px;
    margin-left: 15px;
}

.banner p {
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.search-box {
    display: flex;
    justify-content: center;
}

.search-box input {
    width: 500px;
    height: 45px;
    padding: 0 20px;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-box button {
    height: 45px;
    width: 80px;
    background: #4CAF50;
    color: #fff;
    border: none;
    cursor: pointer;
}
/* 四个卡片 */
.card-box {
    display: flex;
    justify-content: center;
    gap: 50px;
    padding: 20px 20px;
    /*background: #000000;*/
}

/* 卡片容器：保持原来的flex布局 */
.card-box {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
}

/* 卡片通用样式 */
.card1, .card2 {
  width: 400px;
  height: 500px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止图片溢出圆角 */
  position: relative;
}

/* 图片样式：铺满卡片，适配尺寸 */
.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 保持图片比例，铺满容器 */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* 文字容器：放在图片底部 */
.card-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: rgba(0,0,0,0.4); /* 半透明黑底，让文字更清晰 */
  color: white;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* 链接样式：去掉默认下划线，继承颜色 */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

/* 文字样式：保持原来的排版 */
.card-text h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.card-text p {
  margin: 0;
  line-height: 1.5;
}

.card h3 {
    font-size: 22px;
    flex-direction: column;
    color: #333;
    margin: 0; /* ✅ 加一句，消除默认间距 */
}

.card p {
    font-size: 14px;
    color: #666;
    flex-direction: column;
    margin: 5px 0 0; /* ✅ 加一句，标题和描述分开一点 */
}
/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-btn {
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
}

/* 下拉菜单默认隐藏 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    min-width: 140px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none; /* 默认隐藏 */
    z-index: 999;
}

/* 下拉显示 */
.user-dropdown.active .dropdown-menu {
    display: block;
}

/* 下拉选项样式 */
.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
}

.logout-item {
    color: #e53935 !important;
}
