* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0c111d;
  color: #e7ecf3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(12, 17, 29, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.brand { 
  display: flex; 
  align-items: flex-start; 
  gap: 14px; 
  flex-shrink: 0;
  flex-direction: row;
}
.brand > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}
/* Logo动画关键帧 */
@keyframes logoRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes logoPulse {
  0%, 100% { 
    box-shadow: 
      0 4px 16px rgba(124, 77, 255, 0.4),
      0 0 0 2px rgba(124, 77, 255, 0.1),
      inset 0 2px 4px rgba(255, 255, 255, 0.2),
      inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
  50% { 
    box-shadow: 
      0 6px 24px rgba(124, 77, 255, 0.6),
      0 0 0 3px rgba(124, 77, 255, 0.2),
      inset 0 2px 4px rgba(255, 255, 255, 0.3),
      inset 0 -2px 8px rgba(0, 0, 0, 0.3);
  }
}
@keyframes logoGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* 移除从上到下的扫光效果 */
@keyframes logoShine {
  0%, 100% { opacity: 0; }
}

.logo-circle {
  width: 56px; 
  height: 56px; 
  border-radius: 50%;
  display: grid; 
  place-items: center;
  position: relative;
  background: linear-gradient(135deg, #7c4dff 0%, #5e35b1 25%, #2d9cdb 75%, #1e88e5 100%);
  background-size: 200% 200%;
  font-weight: 900; 
  font-size: 32px;
  font-family: 'Arial Black', 'Helvetica Neue', sans-serif;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 
    0 6px 20px rgba(124, 77, 255, 0.5),
    0 0 0 3px rgba(124, 77, 255, 0.2),
    0 0 30px rgba(124, 77, 255, 0.4),
    inset 0 2px 6px rgba(255, 255, 255, 0.3),
    inset 0 -2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  animation: logoGradient 3s ease infinite, logoPulse 2s ease-in-out infinite;
  z-index: 1;
  text-shadow: 
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 20px rgba(124, 77, 255, 0.6),
    0 0 30px rgba(124, 77, 255, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3);
  filter: drop-shadow(0 0 8px rgba(124, 77, 255, 0.6));
}
.logo-circle::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 25%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 75%
  );
  animation: none;
  opacity: 0;
  pointer-events: none;
  border-radius: 50%;
}
.logo-circle::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(124, 77, 255, 0.3) 0deg,
    rgba(45, 156, 219, 0.3) 90deg,
    rgba(124, 77, 255, 0.3) 180deg,
    rgba(45, 156, 219, 0.3) 270deg,
    rgba(124, 77, 255, 0.3) 360deg
  );
  pointer-events: none;
  animation: logoRotate 6s linear infinite;
  z-index: -1;
  opacity: 0.8;
}
.brand:hover .logo-circle {
  transform: scale(1.1);
  animation: logoGradient 1.5s ease infinite, logoPulse 1s ease-in-out infinite;
}
.brand:hover .logo-circle::before {
  animation: none;
  opacity: 0;
}
/* 品牌标题动画 */
@keyframes titleGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes titleGlow {
  0%, 100% { 
    text-shadow: 
      0 0 10px rgba(124, 77, 255, 0.5),
      0 0 20px rgba(124, 77, 255, 0.3),
      0 0 30px rgba(45, 156, 219, 0.2);
  }
  50% { 
    text-shadow: 
      0 0 15px rgba(124, 77, 255, 0.7),
      0 0 25px rgba(124, 77, 255, 0.5),
      0 0 35px rgba(45, 156, 219, 0.4);
  }
}

.brand-title { 
  font-family: 'Noto Sans SC', 'ZCOOL KuaiLe', 'Microsoft YaHei Bold', 'PingFang SC', 'Hiragino Sans GB', 'STHeiti', 'SimHei', '黑体', 'Arial Black', sans-serif;
  font-weight: 900; 
  font-size: 24px;
  line-height: 1.15;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 20%, #c7d2fe 40%, #a5b4fc 60%, #818cf8 80%, #6366f1 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.1em;
  animation: titleGradient 3s ease infinite, titleGlow 2s ease-in-out infinite;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 30px rgba(124, 77, 255, 0.3);
  transform: scale(1);
  transition: all 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.brand:hover .brand-title {
  animation: titleGradient 1.5s ease infinite, titleGlow 1s ease-in-out infinite;
  transform: scale(1.05);
  letter-spacing: 0.1em;
}
/* 副标题动画 */
@keyframes subtitleGlow {
  0%, 100% { 
    text-shadow: 
      0 0 8px rgba(124, 77, 255, 0.3),
      0 0 12px rgba(124, 77, 255, 0.2),
      0 0 16px rgba(45, 156, 219, 0.15);
  }
  50% { 
    text-shadow: 
      0 0 12px rgba(124, 77, 255, 0.5),
      0 0 18px rgba(124, 77, 255, 0.3),
      0 0 24px rgba(45, 156, 219, 0.25);
  }
}
@keyframes subtitleGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.brand-sub { 
  font-size: 14px; 
  font-weight: 600;
  font-family: 'Ma Shan Zheng', 'ZCOOL QingKe HuangYou', 'ZCOOL XiaoWei', 'KaiTi', 'STKaiti', '楷体', '华文楷体', 'SimKai', serif;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 30%, #a5b4fc 50%, #818cf8 70%, #6366f1 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.6;
  margin-top: 6px;
  letter-spacing: 0.12em;
  animation: subtitleGradient 4s ease infinite, subtitleGlow 3s ease-in-out infinite;
  position: relative;
  display: inline-block;
  opacity: 0.95;
  transition: all 0.3s ease;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-style: normal;
}
.brand:hover .brand-sub {
  animation: subtitleGradient 2s ease infinite, subtitleGlow 1.5s ease-in-out infinite;
  opacity: 1;
  transform: translateY(1px);
  letter-spacing: 0.14em;
}
.nav { display: flex; gap: 12px; flex-wrap: wrap; }
.link {
  background: transparent;
  color: #e2e8f0;
  padding: 8px 10px;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-weight: 500;
}
.link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.actions { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  height: auto;
}
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  height: auto;
  margin: 0;
  padding: 10px 16px;
}
.actions .user-box {
  display: flex;
  align-items: center;
  height: auto;
}
#login-toggle { margin-top: 0; }
.pill {
  background: rgba(255, 255, 255, 0.1);
  color: #e7ecf3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.primary-btn, .ghost-btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.01em;
  height: auto;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.primary-btn {
  background: linear-gradient(120deg, #7c4dff, #2d9cdb);
  box-shadow: 0 8px 24px rgba(124, 77, 255, 0.25);
}
.ghost-btn { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.1); }
.ghost-btn:hover { background: rgba(255, 255, 255, 0.15); }

main { padding: 0 32px 48px; }
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  padding: 48px 0 24px;
  align-items: center;
}
.hero-text h1 { 
  font-size: 48px; 
  margin: 8px 0 12px; 
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.hero-text .lead { 
  color: #d1d9e6; 
  line-height: 1.7; 
  font-size: 18px;
}
.hero-actions { display: flex; gap: 12px; margin: 18px 0; flex-wrap: wrap; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; color: #cbd5e1; }
.stats strong { display: block; color: #fff; font-size: 20px; }
.hero-card {
  background: linear-gradient(145deg, rgba(124, 77, 255, 0.15), rgba(45, 156, 219, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.hero-card .tag { display: inline-block; margin-bottom: 8px; background: rgba(255, 255, 255, 0.12); padding: 6px 10px; border-radius: 999px; }
.hero-card h3 { margin: 6px 0; }
.hero-card .price { font-size: 24px; margin: 10px 0 14px; }

.section { padding: 48px 0; }
.section.alt { background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)); border-radius: 18px; padding: 48px 24px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
  max-width: 320px;
  margin-top: 8px;
}
.filters .input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
}
.section-head h2 {
  color: #ffffff;
  font-weight: 700;
  font-size: 32px;
  margin: 8px 0;
}
.eyebrow { 
  text-transform: uppercase; 
  letter-spacing: 0.18em; 
  font-size: 12px; 
  color: #94a3b8;
  font-weight: 600;
}
.muted { color: #b8c4d8; }
.grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.card h2, .card h3 {
  color: #ffffff;
  font-weight: 600;
}
.card p {
  color: #d1d9e6;
  line-height: 1.6;
}
.gift-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gift-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.gift-card img {
  width: 100%; 
  height: 240px; 
  object-fit: cover;
  border-radius: 12px; 
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.1), rgba(45, 156, 219, 0.1));
  transition: transform 0.3s ease;
}
.gift-card:hover img {
  transform: scale(1.02);
}
.gift-card h3 { 
  margin: 6px 0 4px; 
  color: #ffffff;
  font-weight: 600;
}
.gift-card .price { 
  font-weight: 700; 
  margin: 6px 0; 
  color: #7c4dff;
  font-size: 18px;
}
.gift-card p {
  color: #cbd5e1;
}
.gift-card .tags { display: flex; gap: 8px; flex-wrap: wrap; color: #cbd5e1; font-size: 12px; }
.gift-card .actions { margin-top: 12px; justify-content: space-between; }

.empty { text-align: center; margin: 24px 0; color: #aab7cc; }
.hidden { display: none !important; visibility: hidden !important; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 16px; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; align-items: start; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field label { 
  display: block; 
  margin-bottom: 8px; 
  color: #e2e8f0;
  font-weight: 500;
  font-size: 14px;
}
.field {
  margin-bottom: 16px;
}
.field:last-of-type {
  margin-bottom: 20px;
}
.input, textarea.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 15px;
  transition: all 0.2s ease;
}
.input::placeholder {
  color: #94a3b8;
}
.input:focus { 
  outline: 2px solid #7c4dff; 
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.1);
}
.order-summary { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.helper { font-size: 13px; }
.contact-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.note { margin-top: 10px; background: rgba(255, 255, 255, 0.04); }
.full { width: 100%; }

.footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: #cbd5e1; }
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }

.modal {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  padding: 16px; z-index: 50;
}
.modal.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.modal-content {
  max-width: 1040px; width: 100%; position: relative;
  background: #0f172a; border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; padding: 18px;
}
/* 登录/注册模态框宽度缩短一半 */
.modal-content.auth-modal {
  max-width: 400px;
}
.close {
  position: absolute; top: 10px; right: 12px;
  font-size: 20px; background: rgba(255, 255, 255, 0.08);
  border-radius: 50%; width: 32px; height: 32px; color: #e7ecf3;
}
.modal-body { display: grid; gap: 12px; }
.modal-body .form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: -4px;
}
.modal-body .form .primary-btn {
  margin-top: 4px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
}
.modal img { width: 100%; border-radius: 12px; }
.modal .price { font-size: 20px; font-weight: 700; }
.modal-body h3 {
  color: #ffffff;
  font-size: 24px;
  margin: 0 0 8px 0;
  font-weight: 700;
}
.auth-switch {
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.link-btn {
  background: none;
  border: none;
  color: #7c4dff;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-left: 4px;
  font-weight: 500;
}
.link-btn:hover {
  color: #2d9cdb;
}
.helper.error {
  color: #f97066;
  background: rgba(249, 112, 102, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(249, 112, 102, 0.2);
}
.helper.success {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.cart-panel { display: grid; gap: 8px; }
.cart-item { display: flex; gap: 10px; align-items: center; }
.cart-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.cart-item .info { flex: 1; }
.cart-item .qty { display: flex; gap: 8px; align-items: center; }
.badge { padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); font-size: 12px; }
.user-box { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  height: 100%;
}
.user-box button {
  margin-top: 0;
}
.user-email { color: #cbd5e1; font-size: 14px; }

/* Admin - Fullscreen Panel */
.admin-panel-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0c111d;
  overflow-y: auto;
  display: none;
}
.admin-panel-content {
  min-height: 100vh;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-header h3 {
  color: #ffffff;
  font-size: 28px;
  margin: 0;
  font-weight: 700;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.admin-tabs .ghost-btn.active {
  background: rgba(124, 77, 255, 0.2);
  border-color: #7c4dff;
  color: #ffffff;
}
.admin-content {
  margin-top: 8px;
}
.admin-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.admin-section h4 {
  color: #ffffff;
  font-size: 20px;
  margin: 0 0 16px 0;
  font-weight: 600;
}
.admin-form {
  display: grid;
  gap: 12px;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.admin-table {
  margin-top: 16px;
  overflow-x: auto;
}
.table-grid {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}
.table-grid input,
.table-grid select {
  width: 100%;
  min-width: 0;
}
.table-gifts {
  grid-template-columns: 1.5fr 0.8fr 0.8fr 1fr 2fr 1fr;
  min-width: 1000px;
}
.table-orders {
  grid-template-columns: 1fr 2fr 2fr 1fr 1.2fr 1fr;
  min-width: 1100px;
}
.table-head {
  font-weight: 600;
  color: #e2e8f0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .brand-title { font-size: 16px; }
  .brand-sub { font-size: 12px; }
  .logo-circle { width: 50px; height: 50px; font-size: 28px; }
  .hero { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 18px; }
  main { padding: 0 18px 32px; }
  .hero-text h1 { font-size: 36px; }
}

/* 减少动画（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
  .logo-circle,
  .logo-circle::before,
  .logo-circle::after,
  .brand-title {
    animation: none !important;
  }
}

@media (max-width: 600px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; }
  .hero-text h1 { font-size: 30px; }
  .brand { gap: 10px; }
  .brand-title { font-size: 17px; }
  .brand-sub { font-size: 11px; }
  .logo-circle { width: 48px; height: 48px; font-size: 30px; }
}
