/* ============================================
   康一康App - Share页面样式
   生生健康 © 2024
   酷炫现代设计
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 动画关键帧 */
@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(93, 181, 160, 0.4); }
  50% { box-shadow: 0 0 40px rgba(93, 181, 160, 0.6), 0 0 60px rgba(93, 181, 160, 0.3); }
}

@keyframes iconPop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(-45deg, #5DB5A0, #7DDBC4, #ACE8D7, #D3E8EA, #7DDBC4);
  background-size: 400% 400%;
  animation: gradientFlow 15s ease infinite;
  min-height: 100vh;
  color: #333;
  padding: 20px;
  padding-bottom: 120px;
  overflow-x: hidden;
}

/* 背景装饰层 */
.decoration {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.decoration::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(93, 181, 160, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(125, 219, 196, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(172, 232, 215, 0.2) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

.decoration::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 8s ease-in-out infinite;
}

/* 主卡片 */
.card {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 28px 20px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 20px 60px rgba(93, 181, 160, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: slideUp 0.6s ease-out;
  overflow: hidden;
}

/* 卡片光效 */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 4s ease-in-out infinite;
}

/* 用户信息区 */
.user-section {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  animation: slideUp 0.6s ease-out 0.1s both;
}

.avatar {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: visible;
  flex-shrink: 0;
}

.avatar::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5DB5A0, #7DDBC4, #ACE8D7);
  z-index: -1;
  animation: glow 3s ease-in-out infinite;
}

.avatar::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: rgba(93, 181, 160, 0.3);
  z-index: -2;
  animation: ripple 3s ease-in-out infinite;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
}

.user-info {
  margin-left: 16px;
  flex: 1;
}

.user-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  background: linear-gradient(135deg, #333, #5DB5A0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.invite-label {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

/* App 信息区 */
.app-section {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid rgba(93, 181, 160, 0.15);
  border-bottom: 1px solid rgba(93, 181, 160, 0.15);
  position: relative;
  animation: slideUp 0.6s ease-out 0.2s both;
}

.app-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 14px;
  box-shadow: 
    0 12px 40px rgba(93, 181, 160, 0.35),
    0 0 0 3px rgba(255, 255, 255, 0.8);
  animation: float 4s ease-in-out infinite;
}

.app-name {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #5DB5A0, #4A9A87, #5DB5A0);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.app-slogan {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============================================
   功能亮点 - 卡片式布局
   ============================================ */
.features {
  padding: 24px 0 8px;
  animation: slideUp 0.6s ease-out 0.3s both;
}

.features-header {
  text-align: center;
  margin-bottom: 20px;
}

.features-tag {
  display: inline-block;
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(93, 181, 160, 0.15) 0%, rgba(125, 219, 196, 0.2) 100%);
  border: 1px solid rgba(93, 181, 160, 0.3);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #5DB5A0;
  margin-bottom: 10px;
}

.features-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  background: linear-gradient(135deg, #333 0%, #5DB5A0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.feature-card {
  background: #fff;
  padding: 16px 12px;
  border-radius: 16px;
  border: 1px solid rgba(93, 181, 160, 0.15);
  text-align: center;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #5DB5A0, #7DDBC4, #ACE8D7);
  background-size: 200% auto;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(93, 181, 160, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
  pointer-events: none;
}

.feature-card:active {
  transform: scale(0.96);
}

.feature-card:hover,
.feature-card:active {
  box-shadow: 0 12px 30px rgba(93, 181, 160, 0.2);
  border-color: rgba(93, 181, 160, 0.3);
}

.feature-card:hover::before,
.feature-card:active::before {
  transform: scaleX(1);
  animation: shimmer 2s infinite;
}

.feature-card:hover::after,
.feature-card:active::after {
  width: 150px;
  height: 150px;
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 10px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.feature-card:hover .feature-icon,
.feature-card:active .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(93, 181, 160, 0.25);
}

/* 不同功能的渐变背景色 */
.feature-icon.shop { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); }
.feature-icon.food { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); }
.feature-icon.ai { background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%); }
.feature-icon.sleep { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); }
.feature-icon.music { background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%); }
.feature-icon.tcm { background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%); }

.feature-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.feature-card:hover h3,
.feature-card:active h3 {
  color: #5DB5A0;
}

.feature-card p {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}

/* 底部按钮区 */
.btn-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(172, 232, 215, 0.98) 0%, transparent 100%);
  z-index: 10;
  animation: slideUp 0.6s ease-out 0.4s both;
}

.btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #5DB5A0 0%, #4A9A87 50%, #5DB5A0 100%);
  background-size: 200% auto;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 
    0 8px 30px rgba(93, 181, 160, 0.5),
    0 0 0 0 rgba(93, 181, 160, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 1px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s ease-in-out infinite;
}

.btn:hover {
  background-position: right center;
  box-shadow: 
    0 12px 40px rgba(93, 181, 160, 0.6),
    0 0 0 4px rgba(93, 181, 160, 0.2);
}

.btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 15px rgba(93, 181, 160, 0.4);
}

/* 微信/QQ 提示蒙层 */
.browser-tip {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 999;
  padding: 20px;
}

.browser-tip.show {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  animation: slideUp 0.3s ease-out;
}

.tip-arrow {
  width: 70px;
  height: 70px;
  margin-right: 20px;
  margin-top: 15px;
  animation: float 2s ease-in-out infinite;
}

.tip-arrow svg {
  width: 100%;
  height: 100%;
  fill: #5DB5A0;
  filter: drop-shadow(0 0 15px rgba(93, 181, 160, 0.6));
}

.tip-text {
  margin-top: 25px;
  text-align: right;
  margin-right: 15px;
}

.tip-text p {
  font-size: 18px;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tip-close {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 50px;
  background: linear-gradient(135deg, rgba(93, 181, 160, 0.3), rgba(125, 219, 196, 0.3));
  border: 1px solid rgba(93, 181, 160, 0.5);
  border-radius: 30px;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.tip-close:hover,
.tip-close:active {
  background: linear-gradient(135deg, rgba(93, 181, 160, 0.5), rgba(125, 219, 196, 0.5));
  box-shadow: 0 0 30px rgba(93, 181, 160, 0.4);
}

/* RTL支持 */
body[dir="rtl"] .user-info {
  margin-left: 0;
  margin-right: 16px;
}

body[dir="rtl"] .browser-tip.show {
  align-items: flex-start;
}

body[dir="rtl"] .tip-arrow {
  margin-right: 0;
  margin-left: 20px;
}

body[dir="rtl"] .tip-text {
  text-align: left;
  margin-right: 0;
  margin-left: 15px;
}

/* 响应式适配 */
@media (min-width: 500px) {
  body {
    max-width: 450px;
    margin: 0 auto;
  }
  
  .btn-container {
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* 小屏幕优化 */
@media (max-width: 360px) {
  .features-grid {
    gap: 8px;
  }
  
  .feature-card {
    padding: 14px 10px;
  }
  
  .feature-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }
  
  .feature-card h3 {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
