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

:root {
    --primary-blue: #0d47a1;
    --tech-blue: #1a3a5c;
    --dark-blue: #0a1628;
    --light-blue: #2196f3;
    --accent-cyan: #00bcd4;
    --silver-light: #e0e0e0;
    --silver-dark: #9e9e9e;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 188, 212, 0.3);
    --gradient-tech: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0d47a1 100%);
    --gradient-btn: linear-gradient(135deg, #1a3a5c 0%, #0d47a1 100%);
    --gradient-hover: linear-gradient(135deg, #2196f3 0%, #00bcd4 100%);
}

html, body {
    height: 100%;
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-blue);
    color: var(--silver-light);
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 100px;
}

.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--gradient-tech);
    transition: background 0.5s ease;
}

.gradient-bg.custom-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite ease-in-out;
    box-shadow: 0 0 10px var(--accent-cyan);
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.card-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 20px auto;
    perspective: 1000px;
}

.digital-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(0, 188, 212, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateZ(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardEntrance 0.8s ease-out;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.digital-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(0, 188, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.avatar-container {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.avatar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(var(--dark-blue), var(--dark-blue)) padding-box,
                linear-gradient(135deg, var(--accent-cyan), var(--primary-blue)) border-box;
    animation: ringPulse 2s infinite ease-in-out;
}

@keyframes ringPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 188, 212, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(0, 188, 212, 0);
    }
}

.avatar-upload-btn {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--gradient-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.avatar-upload-btn svg {
    width: 32px;
    height: 32px;
    color: var(--silver-light);
    transition: transform 0.3s ease;
}

.avatar-upload-btn:hover {
    background: var(--gradient-hover);
    transform: scale(1.05);
}

.avatar-upload-btn:hover svg {
    transform: scale(1.1);
}

.avatar-upload-btn:active {
    transform: scale(0.95);
}

.avatar-img {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    z-index: 1;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    outline: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.user-name:focus {
    border-bottom-color: var(--accent-cyan);
}

.user-title {
    font-size: 14px;
    color: var(--silver-dark);
    outline: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.user-title:focus {
    border-bottom-color: var(--accent-cyan);
}

.company-logo-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
}

.company-logo-upload {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.company-logo-upload svg {
    width: 20px;
    height: 20px;
    color: var(--silver-dark);
    margin-bottom: 2px;
}

.company-logo-upload span {
    font-size: 10px;
    color: var(--silver-dark);
}

.company-logo-upload:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 188, 212, 0.1);
}

.company-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    cursor: move;
}

.card-body {
    margin-bottom: 20px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 188, 212, 0.3);
    transform: translateX(5px);
}

.info-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-btn);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 20px;
    height: 20px;
    color: var(--silver-light);
}

.info-content {
    flex: 1;
    min-width: 0;
}

.info-label {
    display: block;
    font-size: 12px;
    color: var(--silver-dark);
    margin-bottom: 2px;
}

.info-value {
    display: block;
    font-size: 14px;
    color: #fff;
    outline: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
    word-break: break-all;
}

.info-value:focus {
    border-bottom-color: var(--accent-cyan);
}

.action-btn {
    width: 40px;
    height: 40px;
    background: var(--gradient-btn);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    color: var(--silver-light);
}

.action-btn:hover {
    background: var(--gradient-hover);
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--shadow-color);
}

.action-btn:active {
    transform: scale(0.95);
}

.company-intro-section,
.video-section {
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--silver-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header h3::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--accent-cyan);
    border-radius: 2px;
}

.section-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    color: var(--silver-dark);
}

.icon-btn:hover {
    background: rgba(0, 188, 212, 0.1);
    border-color: var(--accent-cyan);
}

.icon-btn:hover svg {
    color: var(--accent-cyan);
}

.company-intro-content {
    padding: 15px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--silver-light);
    min-height: 80px;
    outline: none;
    transition: all 0.3s ease;
}

.company-intro-content:focus {
    border-color: var(--accent-cyan);
    background: rgba(0, 188, 212, 0.05);
}

.company-intro-content[contenteditable="true"] {
    cursor: text;
}

.video-upload-area {
    position: relative;
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.video-upload-area:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 188, 212, 0.05);
}

.video-upload-area.drag-over {
    border-color: var(--accent-cyan);
    background: rgba(0, 188, 212, 0.1);
    transform: scale(1.02);
}

.upload-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--silver-dark);
    margin-bottom: 10px;
}

.upload-placeholder p {
    font-size: 14px;
    color: var(--silver-light);
    margin-bottom: 5px;
}

.upload-placeholder span {
    font-size: 12px;
    color: var(--silver-dark);
}

.video-preview {
    position: relative;
}

.video-preview video {
    width: 100%;
    border-radius: 12px;
    max-height: 200px;
    object-fit: cover;
}

.remove-video-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-video-btn svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.remove-video-btn:hover {
    background: #ff4444;
    transform: scale(1.1);
}

.upload-progress {
    padding: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--glass-bg);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-hover);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--accent-cyan);
}

.card-footer {
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn svg {
    width: 22px;
    height: 22px;
    color: var(--silver-light);
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.social-btn.wechat:hover {
    background: #07c160;
    border-color: #07c160;
}

.social-btn.weibo:hover {
    background: #e6162d;
    border-color: #e6162d;
}

.social-btn.xiaohongshu:hover {
    background: #ff2442;
    border-color: #ff2442;
}

.social-btn:hover svg {
    color: #fff;
}

.toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 100;
    animation: toolbarSlide 0.5s ease-out 0.3s both;
}

@keyframes toolbarSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toolbar-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background: transparent;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toolbar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.toolbar-btn svg {
    width: 22px;
    height: 22px;
    color: var(--silver-light);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.toolbar-btn span {
    font-size: 11px;
    color: var(--silver-dark);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.toolbar-btn:hover::before {
    opacity: 1;
}

.toolbar-btn:hover svg,
.toolbar-btn:hover span {
    color: #fff;
}

.toolbar-btn:active {
    transform: scale(0.95);
}

.toolbar-btn.primary {
    background: var(--gradient-btn);
}

.toolbar-btn.primary::before {
    background: var(--gradient-hover);
}

.toolbar-btn.primary svg,
.toolbar-btn.primary span {
    color: #fff;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(145deg, rgba(26, 58, 92, 0.95), rgba(10, 22, 40, 0.98));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn svg {
    width: 18px;
    height: 18px;
    color: var(--silver-dark);
}

.close-btn:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
}

.close-btn:hover svg {
    color: #ff4444;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.bg-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.bg-option-group h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--silver-dark);
    margin-bottom: 12px;
}

.gradient-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.gradient-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gradient-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 20px;
    height: 20px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
    transition: transform 0.3s ease;
}

.gradient-btn.active {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--shadow-color);
}

.gradient-btn.active::after {
    transform: translate(-50%, -50%) scale(1);
}

.gradient-btn:hover {
    transform: scale(1.05);
}

.upload-bg-btn {
    width: 100%;
    padding: 20px;
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-bg-btn svg {
    width: 32px;
    height: 32px;
    color: var(--silver-dark);
}

.upload-bg-btn span {
    font-size: 14px;
    color: var(--silver-light);
}

.upload-bg-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 188, 212, 0.1);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-option:hover {
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
    box-shadow: 0 5px 20px rgba(0, 188, 212, 0.2);
}

.share-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-icon svg {
    width: 24px;
    height: 24px;
}

.share-icon.wechat {
    background: #07c160;
}

.share-icon.moments {
    background: linear-gradient(135deg, #07c160, #1aad19);
}

.share-icon.xiaohongshu {
    background: #ff2442;
}

.share-icon.link {
    background: var(--gradient-btn);
}

.share-icon.image {
    background: var(--gradient-hover);
}

.share-icon svg {
    color: #fff;
}

.share-option span {
    font-size: 12px;
    color: var(--silver-light);
}

.qrcode-modal {
    max-width: 320px;
}

.qrcode-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    margin-bottom: 15px;
}

.qrcode-container canvas {
    max-width: 200px;
    height: auto;
}

.qrcode-tip {
    text-align: center;
    font-size: 14px;
    color: var(--silver-dark);
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    background: rgba(0, 188, 212, 0.95);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 5px 20px rgba(0, 188, 212, 0.4);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner span {
    color: var(--silver-light);
    font-size: 14px;
}

@media (max-width: 480px) {
    .app-container {
        padding: 15px;
        padding-bottom: 90px;
    }

    .digital-card {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .card-header {
        gap: 15px;
    }

    .avatar-container {
        width: 70px;
        height: 70px;
    }

    .user-name {
        font-size: 20px;
    }

    .toolbar {
        padding: 10px 15px;
        gap: 5px;
    }

    .toolbar-btn {
        padding: 8px 12px;
    }

    .toolbar-btn svg {
        width: 20px;
        height: 20px;
    }

    .toolbar-btn span {
        font-size: 10px;
    }

    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.3s ease-in-out;
}

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

.pulse {
    animation: pulse 0.3s ease-in-out;
}

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

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--accent-cyan), 0 0 10px var(--accent-cyan);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-cyan), 0 0 30px var(--accent-cyan);
    }
}

.glow {
    animation: glow 1s ease-in-out infinite;
}
