/* 共用样式文件 - page.css */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: "Microsoft YaHei", Arial, sans-serif; 
  background: linear-gradient(135deg, #faf9f7 0%, #f5f3f0 50%, #faf9f7 100%);
  color: #222; 
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* 背景装饰元素 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(184, 31, 45, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184, 31, 45, 0.02) 0%, transparent 50%),
    repeating-linear-gradient(45deg, transparent, transparent 100px, rgba(184, 31, 45, 0.01) 100px, rgba(184, 31, 45, 0.01) 101px);
  pointer-events: none;
  z-index: -1;
}

/* 古典装饰边框 */
body::after {
  content: '';
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px solid rgba(184, 31, 45, 0.08);
  border-radius: 15px;
  pointer-events: none;
  z-index: -1;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Header */
.header { 
  position: sticky; 
  top: 0; 
  z-index: 100; 
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(184, 31, 45, 0.1); 
  box-shadow: 0 4px 20px rgba(0,0,0,0.08); 
}

.header-top {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 16px 32px; 
}

.brand { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
}
.brand img { 
  width: 48px; 
  height: 48px; 
  border-radius: 12px; 
  object-fit: cover; 
  box-shadow: 0 4px 12px rgba(184, 31, 45, 0.2);
}
.brand .title { 
  font-weight: 800; 
  letter-spacing: 1px; 
  font-size: 20px; 
  color: #b81f2d; 
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: -100px;
}

.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  color: #2f3640;
  transition: all .3s ease;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.nav-menu a.active,
.nav-menu a:hover {
  background: linear-gradient(135deg, #f4e9ea, #ede0e1);
  color: #b81f2d;
  transform: translateY(-1px);
}

.user-section {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.btn-primary { 
  padding: 12px 24px; 
  background: linear-gradient(135deg, #b81f2d, #9f1925); 
  color: #fff; 
  border: none; 
  border-radius: 12px; 
  cursor: pointer; 
  transition: all .3s ease; 
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(184, 31, 45, 0.3);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #9f1925, #8a1520);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(184, 31, 45, 0.4);
}

.user-avatar-container {
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  border: 3px solid #e3e6ec;
  transition: all .3s ease;
}

.user-avatar:hover {
  border-color: #b81f2d;
  transform: scale(1.05);
}

/* 用户菜单下拉框 */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid rgba(184, 31, 45, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.user-avatar-container:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 12px 16px;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, #f4e9ea, #ede0e1);
  color: #b81f2d;
}

.dropdown-item:first-child {
  border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 12px 12px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-menu-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background: #b81f2d;
  border-radius: 1px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(184, 31, 45, 0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  z-index: 999;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-content {
  padding: 20px;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-menu li {
  margin-bottom: 16px;
}

.mobile-nav-menu a {
  display: block;
  padding: 12px 16px;
  color: #2f3640;
  font-size: 16px;
  font-weight: 500;
  border-radius: 8px;
  transition: all .3s ease;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
  background: linear-gradient(135deg, #f4e9ea, #ede0e1);
  color: #b81f2d;
}

.mobile-user-section {
  padding-top: 16px;
  border-top: 1px solid rgba(184, 31, 45, 0.1);
  margin-top: 16px;
}

.mobile-auth-buttons {
  display: flex;
  justify-content: center;
}

.mobile-user-info {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.mobile-user-info.show {
  display: flex;
}

.mobile-user-menu {
  margin-top: 12px;
}

.mobile-user-menu a {
  display: block;
  padding: 8px 12px;
  color: #374151;
  font-size: 14px;
  text-align: center;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.mobile-user-menu a:hover {
  background: linear-gradient(135deg, #f4e9ea, #ede0e1);
  color: #b81f2d;
}

/* Main Content */
.main { 
  padding: 24px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px;
  color: #6b7280;
  font-size: 16px;
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #b81f2d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 90%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  text-align: center;
  margin-bottom: 32px;
}

.modal-title {
  font-size: 22px;
  font-weight: 600;
  color: #222;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  transition: all .3s ease;
}

.modal-close:hover {
  color: #b81f2d;
  transform: scale(1.1);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dfe3ea;
  border-radius: 12px;
  font-size: 14px;
  transition: all .3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #b81f2d;
  box-shadow: 0 0 0 3px rgba(184,31,45,0.12);
}

.form-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #b81f2d, #9f1925);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s ease;
  margin-bottom: 16px;
}

.form-submit:hover {
  background: linear-gradient(135deg, #9f1925, #8a1520);
  transform: translateY(-1px);
}

.form-link {
  text-align: center;
  color: #b81f2d;
  cursor: pointer;
  font-size: 14px;
  transition: all .3s ease;
}

.form-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Footer */
.footer { 
  padding: 32px; 
  color: #8a94a4; 
  font-size: 14px; 
  text-align: center;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid rgba(184, 31, 45, 0.1);
  margin-top: 48px;
}

/* Responsive - 基础响应式样式 */
@media (max-width: 768px) {
  .header-top {
    padding: 12px 20px;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .header-nav {
    display: none;
    margin-left: 0;
  }
  
  .user-section .auth-buttons,
  .user-section .user-info {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }
  
  .brand .title {
    font-size: 16px;
  }
  
  .main {
    padding: 16px 20px;
  }
}

@media (max-width: 480px) {
  .brand .title {
    font-size: 14px;
  }
}