:root {
    --bg-color: #f7f9fc;
    --text-primary: #333333;
    --text-secondary: #666666;
    --card-bg: #ffffff;
    --card-hover: #f0f0f0;
    --accent-color: #000000;
    --border-radius: 12px;
    --spacing: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 40px;
}

.profile-section {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.avatar {
    width: 128px;
    height: 128px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.verified {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.verified img {
    width: 16px;
    height: 16px;
}

.tags {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 500;
}

.tags-black {
    color: #000000;
}

.bio {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 320px;
    margin: 0 auto;
}

.bio p {
    margin-bottom: 4px;
    line-height: 2;
    white-space: nowrap;
}

.links-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 16px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.05);
}

.link-left-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.link-content {
    flex: 1;
}

.link-title {
    font-size: 16px;
    font-weight: 500;
}

.link-icon {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none;
}

.modal-box {
    width: 100%;
    max-width: 640px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 16px;
    max-height: 80vh;
    overflow: auto;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.markdown-body { 
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.9;
}
.markdown-body h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 12px 0 8px;
}
.markdown-body h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0 6px;
}
.markdown-body p {
    margin: 4px 0;
    white-space: pre-line;
}
.markdown-body ul {
    margin: 6px 0 10px 18px;
}
.markdown-body li {
    margin: 4px 0;
}
.markdown-body strong {
    font-weight: 700;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-actions button {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #111;
    color: #fff;
}

.contact-bar {
    width: 100%;
    max-width: 360px;
    margin-top: 40px;
    background: #e9ecef;
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f7f7f7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #efefef;
}

.contact-icon img {
    max-width: 24px;
    max-height: 24px;
}

.contact-icon {
    flex-direction: column;
    height: auto;
    padding: 6px 4px;
}

.contact-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
}

.contact-icon.copied {
    background: #d1fae5;
    border-color: #10b981;
}

.mini-box {
    text-align: center;
}

.mini-qr {
    width: 220px;
    height: 220px;
    object-fit: contain;
    margin: 8px auto 12px;
    display: block;
}

@keyframes building-shake {
    0%, 70%, 100% {
        transform: rotate(0deg);
    }
    75% {
        transform: rotate(-2deg);
    }
    80% {
        transform: rotate(2deg);
    }
    85% {
        transform: rotate(0deg);
    }
}

#buildingLink {
    transform-origin: 50% 50%;
    animation: building-shake 1.5s infinite;
}

@media (max-width: 480px) {
    .container {
        padding-top: 20px;
    }
}
