/**
 * 天偌装修平台 - 共享导航栏样式
 * 来源: community.html 导航 CSS
 * 更新: 2026-06-04 - 提取为共享文件
 */

/* ========== 导航栏基础 ========== */
.navbar {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 64px;
}

/* ========== Logo ========== */
.logo {
  font-size: 22px;
  font-weight: bold;
  color: var(--orange);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--orange), #ff9a56);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
}

/* ========== 导航链接 ========== */
.nav-links {
  display: flex;
  list-style: none;
  margin-left: auto;
  gap: 8px;
}

.nav-links li a {
  text-decoration: none;
  color: #555;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all .2s;
  display: block;
}

.nav-links li a:hover,
.nav-links li a.active {
  background: var(--orange-light);
  color: var(--orange);
}

.nav-links li a.highlight {
  background: var(--orange);
  color: #fff;
}

/* ========== 右侧按钮区 ========== */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 20px;
}

/* ========== 用户下拉菜单 ========== */
.nav-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all .2s;
}

.nav-user:hover {
  background: var(--orange-light);
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), #ff9a56);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.nav-user-name {
  font-size: 14px;
  color: #555;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  min-width: 180px;
  padding: 8px 0;
  display: none;
  z-index: 1000;
  margin-top: 8px;
}

.nav-user:hover .nav-user-dropdown {
  display: block;
}

.nav-user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #555;
  font-size: 14px;
  transition: all .2s;
}

.nav-user-dropdown a:hover {
  background: var(--orange-light);
  color: var(--orange);
}

.nav-user-dropdown a i {
  width: 18px;
  text-align: center;
}

.nav-user-dropdown .divider {
  height: 1px;
  background: #eee;
  margin: 6px 0;
}

/* ========== 按钮 ========== */
.btn-outline {
  border: 1.5px solid var(--orange);
  color: var(--orange);
  background: transparent;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}

.btn-primary:hover {
  background: #c96a2d;
}

/* ========== 移动端汉堡菜单 ========== */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #555;
}

/* ========== 页脚 ========== */
.footer {
  background: #f8f9fa;
  color: rgba(0,0,0,.7);
  padding: 12px 0 8px;
  margin-top: 15px;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 40px;
  margin-bottom: 15px;
}

.footer h4 {
  color: #333;
  font-size: 15px;
  margin-bottom: 16px;
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer ul li {
  margin-bottom: 8px;
}

.footer ul a {
  color: #666;
  text-decoration: none;
  font-size: 13px;
  transition: color .2s;
}

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

.footer-bottom {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,.1);
  font-size: 12px;
  color: rgba(0,0,0,.4);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 99;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li a {
    padding: 12px 16px;
    border-radius: 8px;
  }

  .mobile-toggle {
    display: block;
    padding: 8px;
  }

  .nav-right {
    margin-left: auto;
    gap: 8px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .nav-links li a {
    padding: 12px 14px;
    font-size: 14px;
  }
}
