/* 中国联通网上营业厅 - 公共样式 */

/* CSS变量 */
:root {
  --primary-red: #D50036;
  --primary-red-dark: #B8002E;
  --primary-red-light: #FFEBEE;
  --primary-blue: #0066CC;
  --gray-dark: #333333;
  --gray-medium: #666666;
  --gray-light: #999999;
  --gray-lighter: #F5F5F5;
  --bg-color: #F5F5F5;
  --white: #FFFFFF;
  --border-color: #E5E5E5;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
  --transition: all 0.3s ease;
}

/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-dark);
  background-color: var(--bg-color);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 按钮样式 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary-red) 0%, #FF1744 100%);
  color: var(--white);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(213, 0, 54, 0.3);
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(213, 0, 54, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(213, 0, 54, 0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background-color: transparent;
  color: var(--primary-red);
  border: 2px solid var(--primary-red);
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-outline:hover {
  background: linear-gradient(135deg, var(--primary-red) 0%, #FF1744 100%);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(213, 0, 54, 0.3);
}

.btn-block {
  display: block;
  width: 100%;
}

/* 卡片样式 */
.card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

/* 头部导航 */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--white);
  border-bottom: 2px solid var(--primary-red);
  box-shadow: 0 2px 10px rgba(213, 0, 54, 0.08);
}

.header-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 85px;
}

.header-logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 50px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.nav-item {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-dark);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  padding: 10px 20px;
  border-radius: 25px;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(213, 0, 54, 0.1), transparent);
  transition: left 0.5s ease;
}

.nav-item::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: #E5E5E5;
}

.nav-item:last-child::after {
  display: none;
}

.nav-item:hover {
  color: var(--primary-red);
  background-color: rgba(213, 0, 54, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(213, 0, 54, 0.15);
}

.nav-item:hover::before {
  left: 100%;
}

.nav-item.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-red) 0%, #FF1744 100%);
  box-shadow: 0 4px 15px rgba(213, 0, 54, 0.3);
  transform: translateY(-2px);
}

.nav-item.active::after {
  background: rgba(255, 255, 255, 0.3);
}

.nav-item.active:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(213, 0, 54, 0.4);
}

.nav-item.active::before {
  width: 100%;
}

/* 下拉菜单 */
.nav-item.has-dropdown {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow {
  font-size: 10px;
  transition: transform 0.3s;
}

.nav-item.has-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 8px 0;
  min-width: 160px;
  z-index: 100;
}

.nav-item.has-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 10px 20px;
  color: var(--gray-dark);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: rgba(213, 0, 54, 0.08);
  color: var(--primary-red);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.phone-number {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-dark);
  font-size: 14px;
}

.phone-icon {
  width: 16px;
  height: 16px;
}

.mobile-menu-btn {
  display: none;
  padding: 8px;
  background: none;
}

/* 移动端菜单 */
.mobile-menu {
  display: none;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
}

.mobile-menu.active {
  display: block;
}

.mobile-menu .nav-item {
  display: block;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

/* 页脚 */
.footer {
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

.footer-content {
  padding: 40px 0;
}

.footer-top {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.footer-section h3 {
  font-size: 16px;
  font-weight: bold;
  color: var(--gray-dark);
  margin-bottom: 16px;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: var(--gray-medium);
  font-size: 14px;
}

.footer-section ul li a:hover {
  color: var(--primary-red);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  font-size: 12px;
  color: var(--gray-light);
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .footer-content {
    padding: 24px 0;
  }
}

/* 悬浮工具栏 */
.floating-bar {
  position: fixed;
  right: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.floating-item {
  width: 44px;
  height: 44px;
  background-color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: var(--transition);
}

.floating-item:hover {
  background-color: var(--primary-red);
  color: var(--white);
}

.floating-item.back-top {
  display: none;
}

.floating-item.back-top.visible {
  display: flex;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  background-color: var(--primary-red-light);
  color: var(--primary-red);
  border-radius: 20px;
  font-size: 12px;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--gray-light);
}

.breadcrumb a:hover {
  color: var(--primary-red);
}

.breadcrumb span {
  color: var(--gray-light);
}

.breadcrumb .current {
  color: var(--primary-red);
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}

.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--gray-dark);
  font-size: 14px;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary-red);
  color: var(--primary-red);
}

.pagination button.active {
  background-color: var(--primary-red);
  border-color: var(--primary-red);
  color: var(--white);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: var(--white);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: bold;
}

.modal-close {
  background: none;
  font-size: 20px;
  color: var(--gray-light);
}

.modal-close:hover {
  color: var(--gray-dark);
}

.modal-body {
  padding: 20px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-red);
}

.form-group textarea {
  resize: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-red {
  color: var(--primary-red);
}

.text-gray {
  color: var(--gray-medium);
}

.text-sm {
  font-size: 12px;
}

.text-lg {
  font-size: 18px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.font-bold {
  font-weight: bold;
}

.font-medium {
  font-weight: 500;
}

.mt-4 {
  margin-top: 16px;
}

.mt-6 {
  margin-top: 24px;
}

.mt-8 {
  margin-top: 32px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.p-4 {
  padding: 16px;
}

.p-6 {
  padding: 24px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.py-6 {
  padding-top: 24px;
  padding-bottom: 24px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.gap-6 {
  gap: 24px;
}

.rounded {
  border-radius: 8px;
}

.rounded-lg {
  border-radius: 12px;
}

.shadow {
  box-shadow: var(--shadow-card);
}

.overflow-hidden {
  overflow: hidden;
}

.hidden {
  display: none;
}

.block {
  display: block;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .header-nav {
    gap: 24px;
  }
  
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-wrapper {
    height: 60px;
  }
  
  .logo-img {
    height: 36px;
  }
  
  .header-nav {
    display: none;
  }
  
  .phone-number span {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .floating-bar {
    right: 12px;
    bottom: 80px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  /* 移动端页面内容两侧间隙 */
  .page-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  /* 移动端容器两侧间隙 */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* 成功提示 */
.success-message {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background-color: #E8F5E9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #4CAF50;
}

.success-icon svg {
  width: 32px;
  height: 32px;
}

/* 星级评分 */
.stars {
  display: flex;
  gap: 2px;
}

.star {
  color: #FFC107;
}

.star.empty {
  color: #E0E0E0;
}

/* 图片轮播 */
.image-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background-color: var(--gray-lighter);
  overflow: hidden;
}

.image-carousel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-btn:hover {
  background-color: var(--white);
}

.carousel-btn.prev {
  left: 16px;
}

.carousel-btn.next {
  right: 16px;
}

.carousel-thumbnails {
  display: flex;
  gap: 8px;
  padding: 16px;
}

.carousel-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.carousel-thumb.active {
  border-color: var(--primary-red);
}

.carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
