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

/* Language Switch Styles */
.flip-switch-container {
  --card-width: 55px;
  --card-height: 60px;
  --switch-bg: rgba(255, 255, 255, 0.1);
  --switch-border-color: rgba(255, 255, 255, 0.2);
  --text-color: #ffffff;
  --inactive-text-color: rgba(255, 255, 255, 0.6);
  --icon-shadow-color: rgba(0, 0, 0, 0.3);
  --card-bg: linear-gradient(
    135deg,
    rgba(155, 237, 45, 0.3),
    rgba(155, 237, 45, 0.1)
  );
  --highlight-color: #9bed2d;

  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.flip-switch {
  display: flex;
  position: relative;
  width: calc(var(--card-width) * 2);
  height: var(--card-height);
  background: var(--switch-bg);
  border-radius: 15px;
  border: 1px solid var(--switch-border-color);
  box-shadow:
    0 8px 32px 0 rgba(31, 38, 135, 0.37),
    inset 0 4px 8px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  perspective: 1000px;
}

.flip-switch input[type="radio"] {
  display: none;
}

.flip-switch .switch-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  z-index: 2;
  color: var(--inactive-text-color);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.flip-switch .switch-button:hover {
  color: var(--text-color);
}

.flip-switch .switch-button:hover svg {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 6px var(--icon-shadow-color)) brightness(1.2);
}

.flip-switch .switch-button svg {
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 2px 3px var(--icon-shadow-color));
  width: 20px;
  height: 20px;
}

.flip-switch .switch-button span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-1"],
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-2"] {
  color: var(--text-color);
  text-shadow: 0 0 8px rgba(155, 237, 45, 0.5);
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-2"],
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-1"] {
  color: var(--inactive-text-color);
}

.flip-switch .switch-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-width);
  height: var(--card-height);
  z-index: 1;
  transform-style: preserve-3d;
}

.flip-switch .card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 15px;
  background: var(--card-bg);
  border: 1px solid rgba(155, 237, 45, 0.3);
  box-shadow:
    0 4px 20px rgba(155, 237, 45, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-switch .card-back {
  transform: rotateY(180deg);
}

.flip-switch #switch-opt-2:checked ~ .switch-card {
  animation: flipRight 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.flip-switch #switch-opt-1:checked ~ .switch-card {
  animation: flipLeft 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes flipRight {
  0% {
    transform: translateX(0%) rotateY(0deg);
  }
  50% {
    transform: translateX(50%) rotateY(90deg) scale(1.05);
  }
  100% {
    transform: translateX(100%) rotateY(180deg) scale(1);
  }
}

@keyframes flipLeft {
  0% {
    transform: translateX(100%) rotateY(180deg);
  }
  50% {
    transform: translateX(50%) rotateY(90deg) scale(1.05);
  }
  100% {
    transform: translateX(0%) rotateY(0deg) scale(1);
  }
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-1"]::after,
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-2"]::after {
  content: "";
  position: absolute;
  bottom: -3px;
  width: 20px;
  height: 2px;
  background: var(--highlight-color);
  border-radius: 2px;
  animation: glow 1.5s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px var(--highlight-color);
  }
  to {
    box-shadow:
      0 0 10px var(--highlight-color),
      0 0 15px var(--highlight-color);
  }
}

/* Mobile responsive for language switch */
@media screen and (max-width: 768px) {
  .flip-switch-container {
    top: 10px;
    right: 10px;
  }
  
  .flip-switch {
    transform: scale(0.9);
  }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('bg.jpg') center center / cover no-repeat;
    background-attachment: scroll;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: auto;
}

/* 针对移动设备的背景优化 */
@media screen and (max-width: 768px) {
    body {
        background: url('bg.jpg') center center / cover no-repeat, #0a0a0a;
        background-attachment: scroll;
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        min-height: 100vh;
        min-height: 100dvh; /* 动态视口高度 */
        padding: 10px;
        align-items: flex-start;
    }
    
    .container {
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .card-preview-section {
        min-height: 300px;
        padding: 20px;
    }
    
    .editor-section {
        flex: 1;
        max-width: 100%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: -1;
}

/* 移动端背景修复 */
@media screen and (max-width: 768px) {
    body::before {
        position: absolute;
        background: rgba(0, 0, 0, 0.2);
    }
    
    /* iOS Safari 特殊处理 */
    @supports (-webkit-touch-callout: none) {
        body {
            background: #0a0a0a url('bg.jpg') center center / cover no-repeat;
            background-attachment: scroll !important;
            position: relative;
        }
        
        body::after {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('bg.jpg') center center / cover no-repeat;
            z-index: -2;
        }
    }
}

.container {
    max-width: 1200px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

header p {
    color: #cccccc;
    font-size: 16px;
}

.ca-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ca-label {
    color: #9bed2d;
    font-weight: 600;
    font-size: 14px;
}

.ca-value {
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    flex: 1;
    text-align: center;
}

.copy-btn {
    background: rgba(155, 237, 45, 0.2);
    border: 1px solid rgba(155, 237, 45, 0.4);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #9bed2d;
}

.copy-btn:hover {
    background: rgba(155, 237, 45, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(155, 237, 45, 0.3);
}

.main-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.card-preview-section {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
    backdrop-filter: blur(10px);
}

.card-container {
    position: relative;
    width: 400px;
    height: 400px;
    background: transparent;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#idCardCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 15px;
}

.editor-section {
    flex: 0 0 420px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.camera-icon {
    background: #9bed2d;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
}

.camera-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.editor-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

.upload-section, .input-section, .save-section {
    margin-bottom: 25px;
}

label {
    display: block;
    color: #cccccc;
    font-size: 14px;
    margin-bottom: 12px;
}

.upload-button {
    width: 100%;
}

.select-photo-btn {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: #ffffff;
}

.select-photo-btn:hover {
    border-color: #9bed2d;
    background: rgba(155, 237, 45, 0.2);
    box-shadow: 0 0 20px rgba(155, 237, 45, 0.3);
}

.input-group {
    position: relative;
    margin-bottom: 12px;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #cccccc;
    font-size: 18px;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.input-group input::placeholder, .input-group textarea::placeholder {
    color: #999999;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: #9bed2d;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(155, 237, 45, 0.2);
}

.add-profession-btn {
    width: 100%;
    padding: 10px;
    background: rgba(155, 237, 45, 0.1);
    border: 2px dashed rgba(155, 237, 45, 0.6);
    border-radius: 10px;
    color: #9bed2d;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

.add-profession-btn:hover {
    background: rgba(155, 237, 45, 0.2);
    box-shadow: 0 0 20px rgba(155, 237, 45, 0.3);
}

.export-btn {
    width: 100%;
    padding: 14px 20px;
    background: #9bed2d;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: #000000;
}

.export-btn:hover {
    background: #8bd424;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 237, 45, 0.4);
}

.tips-section {
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.tips-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    color: #ffffff;
}

.tips-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tips-content {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.tips-content ul {
    list-style: none;
    padding: 0;
}

.tips-content li {
    padding: 8px 0;
    color: #cccccc;
    font-size: 14px;
    position: relative;
    padding-left: 20px;
}

.tips-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #9bed2d;
}

.privacy-notice {
    margin-top: 20px;
    padding: 12px;
    background: rgba(92, 107, 192, 0.1);
    border: 1px solid rgba(92, 107, 192, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #9fa8da;
}

.arrow {
    transition: transform 0.3s ease;
}

.tips-toggle.active .arrow {
    transform: rotate(180deg);
}

/* 项目展示Gallery */
.projects-gallery {
    margin-top: 60px;
    width: 100%;
    overflow: hidden;
}

/* Gallery 头部样式 */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.projects-gallery h3 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    margin: 0;
}

.gallery-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.refresh-btn {
    background: rgba(155, 237, 45, 0.1);
    border: 2px solid rgba(155, 237, 45, 0.6);
    border-radius: 10px;
    color: #9bed2d;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.refresh-btn:hover {
    background: rgba(155, 237, 45, 0.2);
    box-shadow: 0 0 15px rgba(155, 237, 45, 0.3);
    transform: translateY(-2px);
}

.update-info {
    text-align: right;
    font-size: 12px;
}

.last-update {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 4px;
}

.auto-refresh-info {
    color: #9bed2d;
    font-size: 11px;
    opacity: 0.8;
}

.gallery-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.gallery-track {
    display: flex;
    gap: 20px;
    animation: autoScroll 30s linear infinite;
    width: max-content;
}

@keyframes autoScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.project-card {
    flex: 0 0 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(155, 237, 45, 0.5);
    box-shadow: 0 10px 30px rgba(155, 237, 45, 0.2);
}

.project-image {
    width: 100%;
    height: 100px;
    border-radius: 10px;
    background: rgba(155, 237, 45, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.project-placeholder {
    font-size: 48px;
    opacity: 0.8;
}

/* Token 真实图片样式 */
.token-logo-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(155, 237, 45, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.project-info h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-info p {
    color: #cccccc;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.project-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.project-status.live {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.project-status.beta {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
}

.project-status.coming {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.4);
}

/* 暂停动画在悬停时 */
.gallery-track:hover {
    animation-play-state: paused;
}

/* Token 相关样式 */
.loading-card {
    flex: 0 0 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cccccc;
    font-size: 16px;
}

.token-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.token-price {
    font-weight: 600;
    color: #ffffff;
    font-size: 16px;
}

.token-change {
    font-size: 14px;
    font-weight: 500;
}

.token-change.positive {
    color: #27ae60;
}

.token-change.negative {
    color: #e74c3c;
}

/* Token 排名样式 */
.token-ranking {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(155, 237, 45, 0.9);
    color: #000000;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(155, 237, 45, 0.3);
}

/* Token 市值样式 */
.token-marketcap {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.marketcap-label {
    color: #cccccc;
    font-weight: 500;
}

.marketcap-value {
    color: #9bed2d;
    font-weight: 600;
    margin-left: 5px;
}

/* Token 详情模态框 */
.token-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(20px);
    color: #ffffff;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #9bed2d;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #cccccc;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.modal-body p {
    margin: 12px 0;
    font-size: 16px;
    line-height: 1.5;
}

.modal-body strong {
    color: #9bed2d;
}

.modal-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.trade-btn {
    width: 100%;
    padding: 12px 20px;
    background: #9bed2d;
    border: none;
    border-radius: 10px;
    color: #000000;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trade-btn:hover {
    background: #8bd424;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 237, 45, 0.4);
}

/* 合约地址样式 */
.contract-address {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(155, 237, 45, 0.3);
    border-radius: 10px;
}

.address-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.address-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #9bed2d;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    flex: 1;
    word-break: break-all;
    border: 1px solid rgba(155, 237, 45, 0.2);
}

.copy-address-btn {
    background: rgba(155, 237, 45, 0.2);
    border: 1px solid rgba(155, 237, 45, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #9bed2d;
}

.copy-address-btn:hover {
    background: rgba(155, 237, 45, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(155, 237, 45, 0.3);
}

/* 复制成功提示动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 968px) {
    .main-content {
        flex-direction: column;
    }
    
    .editor-section {
        flex: 1;
        max-width: 100%;
    }
    
    .card-preview-section {
        width: 100%;
    }
    
    .projects-gallery {
        margin-top: 40px;
    }
    
    .project-card {
        flex: 0 0 250px;
        padding: 15px;
    }
    
    .gallery-track {
        gap: 15px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .gallery-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .update-info {
        text-align: left;
    }
}