/* 主题变量 */
:root {
    --bg-gradient: radial-gradient(1200px 600px at 10% -10%, #e0f7fa 0%, transparent 60%),
                   radial-gradient(900px 600px at 100% 0%, #f3e5f5 0%, transparent 60%),
                   linear-gradient(180deg, #ffffff, #f9fbff);
    --text-main: #1a1a1a;
    --text-muted: #61707a;
    --card-bg: #ffffff;
    --card-border: #e6eef3;
    --primary: #2962ff;
    --primary-weak: #e8f0fe;
    --shadow: 0 10px 30px rgba(0,0,0,0.06);
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 全局与背景 */
* { box-sizing: border-box; }
html, body {
    height: 100%;
}
body {
    margin: 0;
    color: var(--text-main);
    background: var(--bg-gradient);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Ubuntu, "Noto Sans", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 20%);
    z-index: -1;
    animation: slowlyRotate 30s linear infinite;
}

@keyframes slowlyRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 顶部个人信息区域 */
.hero {
    padding: 48px 0 24px;
    position: relative;
}
.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}
.avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: var(--shadow);
    object-fit: cover;
    background: #f0f4f8;
    animation: pulse 2s infinite;
}
.nickname {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.socials {
    display: flex;
    gap: 10px;
}
.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: var(--shadow);
    cursor: pointer;
    position: relative;
}
.social-btn svg { 
    flex-shrink: 0; 
}
.social-btn span {
    font-weight: 500;
}
.social-btn.wechat span { color: #0f9d58; }
.social-btn.qq span { color: #2962ff; }

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    padding: 8px 0 16px;
    justify-content: center; /* 水平居中 */
}
.tab-btn {
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.tab-btn.active {
    color: var(--text-main);
    background: var(--primary-weak);
    box-shadow: var(--shadow);
}
.tab-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(232, 240, 254, 0.7);
}

/* 面板 */
.tab-panel { 
    display: none; 
    animation: fadeIn 0.5s ease forwards;
}
.tab-panel.active { 
    display: block; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
}

/* 导航卡片网格 */
.link-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    position: relative;
}
.link-grid::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(118, 75, 162, 0.03) 0%, transparent 20%);
    z-index: -1;
    border-radius: 20px;
}
.link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
    text-decoration: none;
    color: var(--text-main);
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(41, 98, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    z-index: -1;
}

@keyframes ripple {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}
.link-card:hover::before {
    opacity: 0.05;
}
.link-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: #d0dbe4;
}
.link-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f5f8ff 0%, #e3eeff 100%);
    font-size: 24px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}
.link-card:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}
/* 新增：图片图标样式（保持布局） */
.link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}
.link-info {
    position: relative;
    z-index: 1;
}
.link-info h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}
.link-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* 动态列表 */
.feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 20px;
}
.feed-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: start;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}
.feed-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(0,0,0,0.1);
    border-color: #d0dbe4;
}
.feed-item time {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    background: var(--primary-weak);
    border-radius: 8px;
    text-align: center;
    align-self: center;
    min-width: 100px;
}
.feed-content {
    font-size: 16px;
    line-height: 1.7;
    position: relative;
}
.feed-content::before {
    content: '"';
    font-size: 60px;
    position: absolute;
    left: -20px;
    top: -20px;
    color: var(--primary-weak);
    font-family: Georgia, serif;
    line-height: 1;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.show { 
    display: flex; 
    animation: fadeIn 0.3s ease forwards;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease forwards;
}
.modal-content {
    position: relative;
    z-index: 2;
    width: min(90vw, 420px);
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    padding: 24px;
    text-align: center;
    transform: scale(0.9);
    animation: scaleIn 0.3s ease forwards;
}
@keyframes scaleIn {
    to { transform: scale(1); }
}
.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    background: #fff;
    border: 2px solid var(--card-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.modal-close {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 24px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    isolation: isolate;
}
.modal-close:hover {
    background: #f5f5f5;
    transform: rotate(90deg);
}
.qr-title {
    margin: 16px 0 0;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero { padding: 36px 0 18px; }
    .avatar { 
        width: 96px; 
        height: 96px; 
    }
    .nickname { font-size: 22px; }
    .link-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 16px;
    }
    .link-card {
        padding: 16px;
    }
    .feed-item { 
        grid-template-columns: 100px 1fr;
        padding: 20px;
        gap: 16px;
    }
}
@media (max-width: 480px) {
    .link-grid { 
        grid-template-columns: 1fr; 
        gap: 16px;
    }
    .link-card {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 16px;
        min-height: auto;
        justify-content: flex-start;
    }
    .link-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    .feed-item { 
        grid-template-columns: 1fr; 
        gap: 12px;
    }
    .feed-item time {
        min-width: auto;
    }
}

/* 页脚 */
.footer {
    padding: 30px 0 50px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    position: relative;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    top: 10px; /* 向上移动10px，使其与上方内容分离 */
}

/* 主题切换按钮 */
.theme-toggle {
    margin-top: 6px;
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}
.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0,0,0,0.08);
    background: var(--primary-weak);
}

/* 主题切换开关（Switch） */
.theme-switch {
    margin-top: 6px;
}
.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.switch-text {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}
.switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.track {
    position: relative;
    width: 56px;
    height: 30px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-weak);
    transition: transform .18s ease, background .18s ease;
}
.icon {
    font-size: 16px;
    line-height: 1;
}
.icon.sun { position: absolute; left: 10px; }
.icon.moon { position: absolute; right: 10px; color: var(--primary); }
.switch input:checked + .track .thumb {
    transform: translateX(26px);
    background: var(--primary);
}
.switch:hover .track {
    box-shadow: 0 12px 26px rgba(0,0,0,0.08);
}
/* 暗黑主题变量覆盖（保持不变，可已存在） */
:root.dark {
    --bg-gradient: radial-gradient(1200px 600px at 10% -10%, #0b1220 0%, transparent 60%),
                   radial-gradient(900px 600px at 100% 0%, #141a2a 0%, transparent 60%),
                   linear-gradient(180deg, #0f172a, #0b1220);
    --text-main: #e6ebf0;
    --text-muted: #a0a7b4;
    --card-bg: #0f172a;
    --card-border: #1f2b3a;
    --primary: #8ab4f8;
    --primary-weak: #1f2b3a;
    --shadow: 0 10px 30px rgba(0,0,0,0.5);
}
:root.dark .link-icon { background: #1f2937; }
:root.dark .modal-backdrop { background: rgba(0,0,0,0.55); }

/* 平滑的主题切换过渡 */
body, .link-card, .tab-btn, .social-btn, .modal-content, .theme-switch .track, .theme-switch .thumb {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}