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

:root {
  --header-height: 60px;
  --footer-height: 80px;
  --primary-color: #3DDC84;
  --secondary-color: #1E88E5;
  --dark-color: #1F2937;
  --light-color: #F9FAFB;
  --bg-color: #1F2937;
  --bg-overlay: linear-gradient(to bottom, rgba(15, 23, 42, .45), rgba(15, 23, 42, .35));
  --bg-image: none;
  --button-radius: 26px;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.mobile-device,
body.desktop-device {
  background-color: var(--bg-color);
  background-image: var(--bg-overlay), var(--bg-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.mobile-view,
.desktop-view {
  display: none;
}

.glass-header,
.glass-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-header {
  top: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.glass-footer {
  bottom: 0;
  padding: 12px 16px;
}

.header-content,
.mobile-content,
.download-button {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto;
}

.header-content,
.header-left,
.download-button,
.desktop-view,
.desktop-container,
.desktop-right {
  display: flex;
  align-items: center;
}

.header-content {
  justify-content: space-between;
}

.header-left,
.download-button {
  gap: 8px;
}

.header-icon {
  font-size: 24px;
}

.header-icon.fa-android {
  color: #3DDC84;
}

.header-icon.fa-apple {
  color: #1a1a1a;
}

.header-title {
  color: #1F2937;
  font-size: 18px;
  font-weight: 600;
}

.mobile-main {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  padding: calc(var(--header-height) + 20px) 16px calc(var(--footer-height) + 20px);
}

.mobile-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 3vh, 24px);
}

.app-icon-wrapper {
  animation: float 3s ease-in-out infinite;
}

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

.app-icon-container {
  width: clamp(80px, 20vw, 112px);
  height: clamp(80px, 20vw, 112px);
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
}

.app-icon,
.desktop-icon {
  object-fit: cover;
}

.app-icon {
  width: 100%;
  height: 100%;
}

.app-name,
.desktop-app-name {
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}

.app-name {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 700;
  text-align: center;
}

.app-info,
.qrcode-tip,
.desktop-qrcode-tip {
  text-align: center;
  color: rgba(255, 255, 255, .85);
}

.app-info {
  font-size: clamp(12px, 3vw, 14px);
  color: rgba(255, 255, 255, .9);
}

.download-hint {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: clamp(11px, 2.5vw, 14px);
  font-weight: 500;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.qrcode-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qrcode-box,
.desktop-qrcode-wrapper {
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}

.qrcode-box {
  padding: clamp(8px, 2vw, 12px);
  border-radius: 16px;
}

.qrcode-box canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.qrcode-tip {
  font-size: clamp(10px, 2vw, 12px);
}

.download-button {
  justify-content: center;
  padding: 16px;
  border: 0;
  border-radius: var(--button-radius);
  background: var(--primary-color);
  color: var(--dark-color);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 4px 16px rgba(61, 220, 132, .35);
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(61, 220, 132, .45);
}

.download-button:active {
  transform: scale(.97);
}

body.ios-device .download-button {
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

body.ios-device .download-button:hover {
  background: #2d2d2d;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}

.desktop-view {
  min-height: 100vh;
  justify-content: center;
  padding: 40px 20px;
}

.desktop-container {
  width: 100%;
  max-width: 750px;
  gap: 60px;
  padding: 50px 60px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 24px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.desktop-left {
  flex: 1;
}

.desktop-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

.desktop-app-name {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 600;
}

.desktop-app-info {
  margin-bottom: 28px;
  color: rgba(255, 255, 255, .8);
  font-size: 14px;
  line-height: 1.6;
}

.desktop-app-info span {
  display: inline-block;
  margin-right: 20px;
}

.desktop-buttons {
  display: flex;
  max-width: 320px;
  flex-direction: column;
  gap: 16px;
}

.desktop-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, .75);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: all .3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

.desktop-btn:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, .85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}

.desktop-btn img,
.desktop-btn svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.desktop-btn img {
  filter: brightness(0) invert(1);
}

.desktop-btn-text {
  flex: 1;
  text-align: left;
}

.desktop-btn-title,
.desktop-btn-subtitle {
  display: block;
}

.desktop-btn-title {
  margin-bottom: 1px;
  font-size: 15px;
  font-weight: 500;
}

.desktop-btn-subtitle {
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 400;
}

.desktop-right {
  flex-direction: column;
}

.desktop-qrcode-wrapper {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 16px;
  background: rgba(255, 255, 255, .95);
}

.desktop-qrcode {
  width: 180px;
  height: 180px;
}

.desktop-qrcode canvas {
  width: 100% !important;
  height: 100% !important;
}

.desktop-qrcode-tip {
  font-size: 13px;
}

.download-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  z-index: 9999;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 12px;
  background: #1F2937;
  color: #3DDC84;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

@media (max-width: 768px) {
  .desktop-container {
    flex-direction: column;
    gap: 40px;
    padding: 40px 30px;
  }

  .desktop-right {
    order: -1;
  }
}
