/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-gray: #f8fafc;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--text);
}

/* ==================== 导航栏 ==================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 15px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* ==================== Hero ==================== */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--border);
    margin-bottom: 24px;
    background: var(--bg-gray);
}

.hero-name {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero-tagline {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 28px;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-link {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}

.btn-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

/* 顶部按钮悬停提示 */
.btn-with-tip {
    position: relative;
}

.btn-with-tip::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.btn-with-tip::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(30, 41, 59, 0.95);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.btn-with-tip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.btn-with-tip:hover::before {
    opacity: 1;
}

/* ==================== 关于我 ==================== */
.about {
    padding: 80px 0;
    background: var(--bg-gray);
}

.about-content {
    max-width: 720px;
    margin: 0 auto 36px;
}

.about-content p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 20px;
    text-indent: 2em;
    line-height: 1.8;
}

.about-content .hl {
    color: var(--primary);
    font-weight: 600;
    background: linear-gradient(transparent 60%, rgba(59, 130, 246, 0.15) 60%);
    padding: 0 2px;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.skill-tag {
    display: inline-block;
    padding: 8px 22px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.skill-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

/* ==================== 产品展示 ==================== */
.products {
    padding: 80px 0;
}

.products-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 16px;
    padding: 60px 0;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}

.product-card,
.product-card * {
    text-decoration: none !important;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-img {
    width: 100%;
    height: 180px;
    background: var(--bg-gray);
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-desc {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.5;
}

.product-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.product-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.product-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.product-link:hover {
    text-decoration: underline;
}

/* ==================== 联系方式 ==================== */
.contact {
    padding: 80px 0;
    background: var(--bg-gray);
    text-align: center;
}

.contact-text {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 40px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 780px;
    margin: 0 auto;
}

.contact-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    cursor: pointer;
}

.contact-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.contact-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    transition: opacity 0.2s;
}

/* 邮箱 - 蓝色 */
.icon-mail {
    filter: brightness(0) saturate(100%) invert(42%) sepia(85%) saturate(2150%) hue-rotate(204deg) brightness(98%) contrast(92%);
}

/* 微信 - 绿色 */
.icon-wechat {
    filter: brightness(0) saturate(100%) invert(60%) sepia(72%) saturate(493%) hue-rotate(85deg) brightness(95%) contrast(88%);
}

/* 公众号 - 深绿 */
.icon-wechat-public {
    filter: brightness(0) saturate(100%) invert(45%) sepia(93%) saturate(384%) hue-rotate(87deg) brightness(92%) contrast(90%);
}

/* B站 - 粉色 */
.icon-bilibili {
    filter: brightness(0) saturate(100%) invert(60%) sepia(43%) saturate(4985%) hue-rotate(293deg) brightness(100%) contrast(90%);
}

/* 抖音 - 黑色 */
.icon-douyin {
    filter: brightness(0) saturate(100%);
}

/* 小红书 - 红色 */
.icon-redbook {
    filter: brightness(0) saturate(100%) invert(22%) sepia(95%) saturate(5878%) hue-rotate(348deg) brightness(93%) contrast(105%);
}

.contact-item:hover .contact-icon-img {
    opacity: 0.8;
}

.contact-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* 悬停弹窗 */
.contact-popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
    min-width: 220px;
    white-space: nowrap;
}

.contact-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #fff;
}

.contact-item:hover .contact-popover {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.contact-popover img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
    background: #fafafa;
}

.contact-popover-text {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
    word-break: break-all;
    white-space: normal;
    max-width: 220px;
    margin: 0 auto;
}

.contact-tip {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 12px;
    color: var(--primary);
    text-align: center;
}

.contact-item[data-copy] {
    cursor: pointer;
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    max-width: 80%;
    word-break: break-all;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==================== 一键置顶 ==================== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease, color 0.2s ease;
    transform: translateY(10px);
    z-index: 900;
    font-size: 20px;
    font-weight: 700;
}

.back-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.25);
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 24px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
}

/* ==================== 页脚 ==================== */
.footer {
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 14px;
    color: var(--text-light);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero-name {
        font-size: 28px;
    }

    .section-title {
        font-size: 24px;
    }

    .about-content p {
        text-indent: 1.5em;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-links {
        gap: 16px;
    }
}
