/* ========================================
   Common Styles - Header & Footer
   ======================================== */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #155ef0;
  --primary-light: #e6f0ff;
  --text-dark: #1e1f24;
  --text-gray: #8b8d98;
  --text-gray-light: #80828d;
  --text-secondary: #62636c;
  --border-gray: #e7e8ec;
  --bg-gray: #eff0f3;
  --bg-light: #f9f9fb;
  --green-bg: #e6f6eb;
  --green-text: #218358;
  --red-bg: #feebec;
  --red-text: #ce2c31;
  --white: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.5;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gray);
  z-index: 1000;
}

.navbar-container {
  width: 1360px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 1400px) {
  .navbar-container {
    width: 100%;
    padding: 0 40px;
  }
}

.navbar-top {
  display: contents;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 1;
}

.logo img {
  height: 32px;
}

.nav-links {
  display: flex;
  gap: 16px;
  order: 2;
}

.nav-link {
  padding: 10px;
  font-size: 14px;
  color: var(--text-gray-light);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link.active {
  font-weight: 600;
  font-size: 16px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  order: 3;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-gray);
  padding: 0 4px 0 16px;
  border-radius: 12px;
  width: 200px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--primary-color);
  background: white;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  width: 100%;
  padding-left: 12px;
  height: 42px;
}

.search-input::placeholder {
  color: var(--text-gray-light);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.search-btn img {
  width: 16px;
  height: 16px;
}

.login-btn {
  font-size: 14px;
  color: var(--primary-color);
  text-decoration: none;
  padding: 10px;
}

.register-btn {
  background: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.3s;
}

.register-btn:hover {
  opacity: 0.9;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  border-top: 1px solid #efefef;
  background: white;
}

.footer-container {
  width: 1360px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
}

@media (max-width: 1400px) {
  .footer-container {
    width: 100%;
    padding: 24px 40px;
  }
}

.footer-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.footer-logo img {
  height: 32px;
}

.footer-logo span {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
}

.footer-slogan {
  font-size: 14px;
  color: var(--text-gray);
  margin-bottom: 8px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.social-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.social-link img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  position: absolute;
  transition: opacity 0.2s ease;
}

.social-link .icon-default {
  opacity: 1;
}

.social-link .icon-hover {
  opacity: 0;
}

.social-link:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.social-link:hover .icon-default {
  opacity: 0;
}

.social-link:hover .icon-hover {
  opacity: 1;
}

.social-link.x-icon img {
  width: 16px;
  height: 16px;
}

.footer-copyright {
  font-size: 14px;
  color: var(--text-gray);
}

.footer-right {
  display: flex;
  gap: 64px;
}

.footer-column {
  min-width: 120px;
}

.footer-column-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 24px;
  text-align: right;
}

.footer-link {
  display: block;
  font-size: 14px;
  color: #afafaf;
  text-decoration: none;
  margin-bottom: 16px;
  text-align: right;
}

.footer-link:hover {
  color: var(--primary-color);
}

/* ========================================
   Common Responsive
   ======================================== */

/* Medium screens - reduce spacing */
@media (max-width: 1200px) {
  .nav-links {
    gap: 8px;
  }

  .nav-link {
    padding: 8px;
    font-size: 13px;
  }

  .nav-link.active {
    font-size: 14px;
  }

  .search-box {
    width: 160px;
  }

  .nav-right {
    gap: 8px;
  }

  .login-btn {
    padding: 8px;
  }

  .register-btn {
    padding: 8px 16px;
  }
}

/* Smaller medium screens - further reduce */
@media (max-width: 1050px) {
  .navbar-container {
    padding: 0 20px;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-link {
    padding: 6px;
    font-size: 12px;
  }

  .nav-link.active {
    font-size: 13px;
  }

  .search-box {
    width: 120px;
  }

  .search-input {
    font-size: 12px;
  }

  .nav-right {
    gap: 6px;
  }

  .login-btn {
    padding: 6px;
    font-size: 12px;
  }

  .register-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  /* ===== Mobile Navigation ===== */
  .navbar {
    height: 96px;
  }
  
  .navbar-container {
    flex-wrap: wrap;
    height: auto;
    padding: 0 16px;
  }
  
  .navbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    order: 1;
  }
  
  .logo {
    order: unset;
  }
  
  .logo img {
    height: 24px;
  }
  
  .nav-links {
    display: flex;
    width: 100%;
    height: 48px;
    gap: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    order: 2;
  }
  
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  
  .nav-link {
    padding: 8px 0;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .nav-link.active {
    font-size: 14px;
  }
  
  .nav-right {
    order: unset;
    gap: 4px;
  }
  
  .search-box {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border-radius: 12px;
    justify-content: center;
  }
  
  .search-input {
    display: none;
  }
  
  .search-btn {
    width: 20px;
    height: 20px;
  }
  
  .search-btn img {
    width: 20px;
    height: 20px;
  }
  
  .login-btn {
    padding: 8px;
    font-size: 14px;
  }
  
  .register-btn {
    padding: 8px 14px;
    height: 32px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* ===== Mobile Footer ===== */
  .footer-container {
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
  }
  
  .footer-left {
    order: 2;
  }
  
  .footer-right {
    order: 1;
    justify-content: space-between;
    gap: 16px;
  }
  
  .footer-column {
    min-width: auto;
  }
  
  .footer-column-title {
    font-size: 16px;
    margin-bottom: 24px;
    text-align: left;
  }
  
  .footer-link {
    text-align: left;
    margin-bottom: 24px;
  }
  
  .footer-logo {
    margin-bottom: 24px;
  }
  
  .footer-logo img {
    height: 32px;
  }
  
  .footer-slogan {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .social-links {
    gap: 8px;
    margin-bottom: 24px;
  }
  
  .social-link {
    width: 24px;
    height: 24px;
  }
  
  .social-link img {
    width: 24px;
    height: 24px;
  }
  
  .social-link.x-icon img {
    width: 16px;
    height: 16px;
  }
  
  .footer-copyright {
    font-size: 14px;
  }
}
