/* ==================== 基础样式与变量定义 ==================== */
:root {
  /* 色彩变量定义 */
  --primary-color: #8e6c88;       /* 主色调 - 优雅紫 */
   --primary-color-dark:  #7a5a75; /* 深一点的蓝色 */
  --secondary-color: #d4a59a;     /* 次色调 - 淡粉 */
  --accent-color: #a7c4bc;        /* 点缀色 - 灰绿 */
  --text-color: #333;             /* 正文文字颜色 */
  --light-text: #666;             /* 浅色文字颜色 */
  --bg-color: #f9f3e9;            /* 背景色 - 米白 */
  --white: #fff;                  /* 纯白色 */
  --shadow: 0 2px 10px rgba(0,0,0,0.1); /* 默认阴影效果 */
  --transition: all 0.3s ease;    /* 默认过渡动画效果 */
  --border-radius: 12px;          /* 统一圆角大小 */
}

/* ==================== 基础重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==================== 全局样式 ==================== */
body {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* ==================== 强制滚动条显示 ==================== */
html {
    overflow-y: scroll; /* 始终显示垂直滚动条 */
}

body {
    min-height: 101vh; /* 确保内容高度略微超过视口 */
}

/* ==================== 导航栏样式 ==================== */
.navbar {
  background-color: var(--primary-color);
  padding: 15px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
}

/* ==================== 导航栏活动状态 ==================== */
.nav-links li {
    position: relative;
    margin: 0 15px;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--secondary-color);
}
/* 下划线效果 */
.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

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

/* 当前页面高亮效果 */
.nav-links li a.active {
    color: var(--secondary-color);
    font-weight: 600;
}

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

/* 背景色变化效果（可选） */
.nav-links li.active-item {
    background-color: rgba(212, 165, 154, 0.2);
    border-radius: 20px;
}
/* 首页导航项高亮 */
.index-page .nav-links a[href="index.html"],
.products-page .nav-links a[href="products.html"],
.about-page .nav-links a[href="about.html"],
.aesthetics-page .nav-links a[href="aesthetics.html"],
.contact-page .nav-links a[href="contact.html"] {
    color: var(--secondary-color);
    font-weight: 600;
}

.index-page .nav-links a[href="index.html"]::after,
.products-page .nav-links a[href="products.html"]::after,
.about-page .nav-links a[href="about.html"]::after,
.aesthetics-page .nav-links a[href="aesthetics.html"]::after,
.contact-page .nav-links a[href="contact.html"]::after {
    width: 100%;
}

/* ==================== 页面标题区 ==================== */
.page-header {
  text-align: center;
  padding: 60px 20px 40px;
  margin-bottom: 40px;
}

.page-header h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.page-header p {
  color: var(--light-text);
  font-size: 1.1rem;
}

/* ==================== 主要内容容器 ==================== */
.main-content {
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* ==================== 信息卡片样式 ==================== */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.info-card {
  background: var(--white);
  padding: 25px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.info-card h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.info-card p {
  margin-bottom: 10px;
  line-height: 1.7;
}

/* ==================== 产品网格样式 ==================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.product-card {
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.product-info {
  padding: 20px;
}

.product-info h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.price {
  font-weight: bold;
  color: #e74c3c;
  font-size: 1.2rem;
  margin: 10px 0;
}

/* ==================== 登录相关样式 ==================== */
.login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.login-container {
  background: var(--bg-color);
  padding: 40px;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  position: relative;
}

.nav-login-btn {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  margin-left: 15px;
}

.nav-login-btn:hover {
  background: #c4958a;
  transform: translateY(-2px);
}
/* ==================== 用户菜单样式 ==================== */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: 15px;
}

.user-avatar {
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    transition: var(--transition);
}

.user-avatar:hover img {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 10px 0;
    min-width: 180px;
    display: none;
    z-index: 1001;
}

.user-avatar:hover .user-dropdown {
    display: block;
    animation: fadeIn 0.3s ease;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

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

.user-dropdown a:hover {
    background: rgba(142, 108, 136, 0.1);
    color: var(--primary-color);
}

.user-dropdown a:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 登录按钮样式保持不变 */
.nav-login-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.nav-login-btn:hover {
    background: #c4958a;
    transform: translateY(-2px);
}
/* ==================== 页脚样式 ==================== */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  text-align: center;
  padding: 20px;
  margin-top: auto;
}
/* 页脚样式 */
.site-footer {
    background-color: #f8f8f8;
    color: #333;
    padding: 40px 0 20px;
    font-size: 14px;
    border-top: 1px solid #e7e7e7;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
    padding: 0 15px;
}

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

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

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

.footer-column ul li a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #000;
}

.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background-color: #eee;
    border-radius: 50%;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.social-icon:hover {
    background-color: #ddd;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e7e7e7;
    flex-wrap: wrap;
}

.legal-links {
    display: flex;
    gap: 15px;
}

.legal-links a {
    color: #666;
    text-decoration: none;
}

.legal-links a:hover {
    text-decoration: underline;
}


/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 15px;
  }
  
  .nav-links {
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .nav-links li {
        margin: 5px;
        padding: 5px 10px;
    }
  .nav-links li.active-item {
        background-color: rgba(212, 165, 154, 0.3);
    }
    
    .nav-links li a::after {
        bottom: -3px;
    }
  .info-section {
    grid-template-columns: 1fr;
  }
  
  .login-container {
    padding: 30px 20px;
    max-width: 90%;
  }
  /* 页脚样式*/
  .footer-column {
        flex: 0 0 50%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
    }
 /* .nav-login-btn {
    margin: 10px 0 0 0;
    width: 100%;
  }*/
  /* 添加或修改现有样式 */
.login-form-group {
    margin-bottom: 15px;
    position: relative;
}
.login-form-group label {
    display: inline-block;
    width: 4em;
    text-align: justify;
    text-align-last: justify;
    letter-spacing: 1em; /* 中文字符间距 */
    overflow: hidden;
}
   .login-form-group input {
    width: calc(100% - 100px); /* 调整输入框宽度 */
    padding: 8px;
    box-sizing: border-box;
}
  .user-menu {
        margin: 10px 0 0 0;
        width: 100%;
        justify-content: center;
    }
    
    .user-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-login-btn {
        width: 100%;
        margin: 0;
    }
    /* 密码框额外调整 */
#login-password {
    letter-spacing: 1px; /* 密码字符间距 */
}
}
