/* ========== 公共样式 ========== */

/* 变量定义 */
:root {
  /* 清新优雅的红色系 */
  --red-50: #FFF1F2;
  --red-100: #FFE4E6;
  --red-200: #FECDD3;
  --red-300: #FDA4AF;
  --red-400: #FB7185;
  --red-500: #F43F5E;
  --red-600: #E11D48;
  --red-700: #BE123C;
  --red-800: #9F1239;
  --red-900: #881337;
  --pink-50: #FDF2F8;
  --pink-100: #FCE7F3;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-300: #D4D4D4;
  --gray-400: #A3A3A3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  --white: #FFFFFF;
  --black: #000000;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.10);
  --shadow-pink: 0 8px 30px rgba(244,63,94,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--white);
  color: var(--gray-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Header ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo img {
  height: 50px;
  width: auto;
  display: block;
}

.logo-text a {
  display: flex;
  align-items: center;
}

/* Nav Menu */
.nav {
  height: 100%;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  height: 100%;
  margin: 0;
  padding: 0;
}

.navbar-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar-item > a {
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  border-radius: var(--radius-md);
  transition: all 0.2s;
  white-space: nowrap;
}

.navbar-item > a:hover,
.navbar-item.active > a {
  color: var(--red-600);
  background: var(--red-50);
}

/* Dropdown Menu */
.menu-item-has-children {
  position: relative;
}

.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.6;
}

.menu-item-has-children ul {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 160px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  list-style: none;
  z-index: 101;
}

.menu-item-has-children:hover ul {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.menu-item-has-children ul li a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.menu-item-has-children ul li a:hover {
  background: var(--gray-50);
  color: var(--red-500);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-action-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-700);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  text-decoration: none;
}

.header-action-icon:hover {
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-600);
  transform: translateY(-1px);
}

.header-action-icon.header-action-icon-logged {
  background: transparent;
  border-color: var(--gray-200);
  color: var(--gray-700);
}

.header-action-icon.header-action-icon-logged:hover {
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-600);
  transform: translateY(-1px);
}

.header-action-icon:focus-visible {
  outline: 2px solid var(--red-300);
  outline-offset: 2px;
}

.header-action-icon svg {
  display: block;
}

.header-action-icon .header-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  display: block;
}

.header-user-menu {
  position: relative;
  cursor: pointer;
}

.header-user-menu .user-drop {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 310;
  display: none;
  width: 160px;
  padding-top: 10px;
}

.header-user-menu.open .user-drop {
  display: block;
}

.header-user-menu .user-drop ul {
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.header-user-menu .user-drop li a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s;
}

.header-user-menu .user-drop li a:hover {
  background: var(--gray-50);
  color: var(--red-500);
}

.header-search-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 300;
}

.header-search-modal.open {
  display: block;
}

.header-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.header-search-panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 96px auto 0;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.header-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-search-input {
  flex: 1 1 auto;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--gray-800);
  outline: none;
}

.header-search-input:focus {
  border-color: var(--red-300);
  box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.15);
}

.header-search-submit {
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.breadcrumb {
  padding: 100px 0 24px;
  background: var(--gray-50);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--gray-500);
}

.breadcrumb-list a {
  color: var(--gray-500);
}

.breadcrumb-list a:hover {
  color: var(--red-500);
}

.breadcrumb-list span {
  color: var(--gray-900);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--gray-700);
  background: linear-gradient(180deg, var(--white), var(--gray-50));
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.checkbox-group:focus-within {
  border-color: var(--red-400);
  box-shadow: 0 0 0 3px rgba(244,63,94,0.1);
}

.checkbox-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.checkbox-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: var(--shadow-sm);
  color: var(--gray-700);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.2s;
}

.checkbox-text::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  border-radius: 4px;
  border: 1.5px solid rgba(0,0,0,0.18);
  background: var(--white);
  transition: background 0.2s, border-color 0.2s;
}

.checkbox-text::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 50%;
  width: 5px;
  height: 9px;
  border: 2px solid var(--white);
  border-top: 0;
  border-left: 0;
  transform: translateY(-56%) rotate(45deg);
  opacity: 0;
  transition: opacity 0.2s;
}

.checkbox-item:hover .checkbox-text {
  transform: translateY(-1px);
  background: var(--white);
  border-color: rgba(0,0,0,0.12);
  box-shadow: var(--shadow-md);
}

.checkbox-input:focus-visible + .checkbox-text {
  outline: 2px solid var(--red-300);
  outline-offset: 2px;
}

.checkbox-input:checked + .checkbox-text {
  background: linear-gradient(180deg, var(--red-50), rgba(255,255,255,0.9));
  border-color: rgba(244,63,94,0.35);
  box-shadow: 0 10px 26px rgba(244,63,94,0.14);
  color: var(--red-700);
  font-weight: 600;
}

.checkbox-input:checked + .checkbox-text::before {
  background: var(--red-500);
  border-color: var(--red-500);
}

.checkbox-input:checked + .checkbox-text::after {
  opacity: 1;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-700);
  cursor: pointer;
  z-index: 201; /* Above mobile menu overlay */
}

.mobile-menu-btn.active {
  background: var(--red-50);
  border-color: var(--red-200);
  color: var(--red-500);
  position: fixed;
  right: 24px;
  top: 16px;
}

/* Mobile Menu Overlay */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-menu.open {
  display: block;
  opacity: 1;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--white);
  padding: 80px 24px 24px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-menu.open .mobile-menu-content {
  transform: translateX(0);
}

/* Mobile Menu Items */
.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid var(--gray-100);
}

/* Reset desktop styles for mobile menu items */
.mobile-nav-list .navbar-item {
  display: block;
  height: auto;
}

.mobile-nav-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 12px;
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-700);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.mobile-nav-list li a:hover,
.mobile-nav-list .menu-item-has-children > a.active {
  color: var(--red-600);
  background-color: var(--red-50);
}

/* Arrow rotation */
.mobile-nav-list .menu-item-has-children > a::after {
  transition: transform 0.3s;
}

.mobile-nav-list .menu-item-has-children > a.active::after {
  transform: rotate(180deg);
}

/* Mobile Submenu */
/* Higher specificity to override desktop styles */
.mobile-nav-list .menu-item-has-children ul {
  display: none;
  background: transparent;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  
  /* Reset dropdown styles */
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: none;
  width: 100%;
  min-width: 0;
}

.mobile-nav-list .menu-item-has-children ul.open {
  display: block;
}

.mobile-nav-list .menu-item-has-children ul li {
  border-bottom: none;
  padding-left: 0; /* Indentation handled by link padding */
}

.mobile-nav-list .menu-item-has-children ul li a {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--gray-600);
}

.mobile-nav-list .menu-item-has-children ul li a:hover {
  background-color: var(--gray-50);
  color: var(--red-600);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .nav {
    gap: 16px;
  }
  
  .navbar-item > a {
    padding: 8px 8px;
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .nav { display: none; }
  
  .mobile-menu-btn { display: flex; }
  
  .header-actions .btn-primary { display: none; }

  .header-search-panel {
    margin-top: 84px;
    width: calc(100% - 24px);
  }

  .header-search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .header-search-input,
  .header-search-submit {
    width: 100%;
  }
}

/* ========== Footer ========== */
.footer {
  background: var(--gray-900);
  color: var(--white);
  padding: 60px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.8;
  margin-top: 16px;
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--white);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

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

.footer-contact p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-pink);
  transition: all 0.3s;
  z-index: 99;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 35px rgba(244,63,94,0.30);
}

/* ========== Responsive Footer ========== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 12px;
  }
  
  .footer-brand {
    grid-column: 1 / -1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .footer-title {
    text-align: left;
    margin-bottom: 12px;
  }
  
  .footer-links {
    text-align: left;
  }
  
  .footer-contact {
    text-align: left;
    display: block;
  }
  
  .footer-contact p {
    justify-content: flex-start;
  }

  .footer-contact img {
    max-width: 100%;
    height: auto !important;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline {
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  background: var(--white);
}

.btn-outline:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: var(--white);
  box-shadow: var(--shadow-pink);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(244,63,94,0.30);
}

/* ========== Helper Classes ========== */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-hero {
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 999px;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: var(--white);
  box-shadow: var(--shadow-pink);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(244,63,94,0.30);
}

.btn-hero-ghost {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-hero-ghost:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}

/* ========== Page Hero ========== */
.page-hero {
  background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 100%);
  padding: 120px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='30' cy='30' r='1' fill='%23F43F5E' fill-opacity='0.08'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(244,63,94,0.1);
  color: var(--red-600);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 24px;
}

.page-hero h1 {
  font-size: 40px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.page-hero p {
  font-size: 16px;
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== CTA Section ========== */
.cta {
  padding: 80px 0;
  background: linear-gradient(135deg, #FFF1F2 0%, #FFE4E6 50%, #FECDD3 100%);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(244,63,94,0.08), transparent);
}

.cta-content {
  position: relative;
  text-align: center;
  color: var(--gray-800);
}

.cta h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--gray-900);
}

.cta p {
  font-size: 16px;
  color: var(--gray-500);
  margin-bottom: 32px;
}
