/* --- CSS 变量 --- */
:root {
    --bg-color: #f0f2f5;
    --card-color: #ffffff;
    --font-color: #1c1e21;
    --secondary-font-color: #606770;
    --accent-color-start: #007BFF;
    --accent-color-end: #007BFF; /* 使用单色 */
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --breathing-glow-color: rgba(0, 123, 255, 0.7);
}
/* 浅色模式下需要调整部分元素的颜色 */
.contact-item .account {
    background-color: #f0f2f5;
    color: #333;
}
.qr-btn {
    background-color: #e4e6eb;
    color: #1c1e21;
    border: none;
}

/* --- 全局与重置 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* --- 卡片布局 --- */
.card {
    width: 100%;
    max-width: 420px; /* 稍微加宽以适应桌面端布局 */
    background-color: var(--card-color);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--accent-color-start);
    margin-bottom: 15px;
    /* [新增] 应用呼吸灯动画 */
    animation: breathe 4s ease-in-out infinite;
}

.title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9em;
    color: var(--secondary-font-color);
}

/* --- 联系方式列表 --- */
.contact-list {
    padding: 15px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}
.contact-item:last-child {
    border-bottom: none;
}

.contact-item .info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    min-width: 0; /* 防止flex item内容溢出 */
}

.contact-item .icon {
    font-size: 1.5em;
    margin-right: 15px;
}

.contact-item .name {
    font-weight: 500;
    margin-right: 10px;
    white-space: nowrap; /* 防止名称换行 */
}

.contact-item .account {
    font-family: 'Courier New', Courier, monospace;
    background-color: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 5px;
    color: var(--font-color);
    text-decoration: none; /* For QQ link */
    overflow: hidden; /* 防止长账号溢出 */
    text-overflow: ellipsis; /* 用省略号显示溢出部分 */
    white-space: nowrap;
}

/* --- 操作按钮 --- */
.actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    background-size: 200% auto;
}
.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}
.action-btn:active {
    transform: translateY(0);
}

.copy-btn {
    background-image: linear-gradient(to right, var(--accent-color-start) 0%, var(--accent-color-end) 51%, var(--accent-color-start) 100%);
}

.qr-btn {
    background-color: #333;
    border: 1px solid var(--border-color);
}

/* --- 二维码弹窗 --- */
.modal {
    display: none; /* Initially hidden */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex; /* Show with flexbox for centering */
}

.modal-content {
    background-color: var(--card-color);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 300px;
    animation: zoomIn 0.3s ease;
}

#qr-image {
    max-width: 100%;
    /* [新增] 确保大图片也能完整显示 */
    max-height: 70vh; 
    object-fit: contain;
    border-radius: 10px;
}

.modal-caption {
    margin-top: 15px;
    color: var(--secondary-font-color);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover {
    color: white;
}

/* --- 动画 --- */
@keyframes zoomIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* [新增] 呼吸灯动画 */
@keyframes breathe {
    0%, 100% {
        box-shadow: 0 0 10px var(--breathing-glow-color), 0 0 20px var(--breathing-glow-color);
    }
    50% {
        box-shadow: 0 0 25px var(--breathing-glow-color), 0 0 50px var(--breathing-glow-color);
    }
}

/* --- 桌面端适配 --- */
@media (min-width: 768px) {
    /* [已修改] 使用 Grid 布局，更稳定 */
    .contact-item {
        display: grid;
        grid-template-columns: 1fr auto; /* 左侧自动填充，右侧根据内容决定宽度 */
        align-items: center;
        gap: 15px; /* 设置列间距 */
    }
    .contact-item .info {
        margin-bottom: 0;
    }
    .actions {
        flex-shrink: 0; 
    }
    .action-btn {
        width: 90px;
        flex-grow: 0;
    }
}