/* CSS for Wu Xie Portfolio */

:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --container-width: 1100px;
    --transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes icon-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

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

body {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

/* Header */
.main-header {
    background: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.main-header.header-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-top {
    padding: 22px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.header-nav {
    background: #030712;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.header-nav .container {
    display: flex;
    justify-content: center;
}

.logo-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo-left, .logo-right {
    flex: 1;
}

.logo-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-right {
    display: flex;
    justify-content: flex-end;
}

.logo-center {
    flex: 2;
    display: flex;
    justify-content: center;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.logo-sun {
    color: #f59e0b;
}

.logo-snow {
    color: #3b82f6;
}

.logo-sep {
    color: #cbd5e1;
    font-size: 1rem;
    margin: 0 12px;
    font-weight: 300;
}

.logo-cn {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    letter-spacing: 2px;
    white-space: nowrap;
}

.logo-tagline {
    font-size: 0.8rem;
    color: #64748b;
    letter-spacing: 1px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    opacity: 0.8;
}

.logo-tagline::before {
    content: '/';
    margin-right: 10px;
    color: #cbd5e1;
    font-weight: 300;
    font-size: 1.1rem;
}

.logo-tagline::after {
    content: '/';
    margin-left: 10px;
    color: #cbd5e1;
    font-weight: 300;
    font-size: 1.1rem;
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.login-link {
    font-size: 0.85rem;
    color: #64748b;
    text-decoration: none;
    padding: 6px 16px;
    background: #f1f5f9;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.login-link:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.register-link {
    font-size: 0.85rem;
    color: #3b82f6;
    text-decoration: none;
    padding: 6px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.register-link:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.nav-menu > ul {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-menu ul li {
    position: relative;
}

.nav-menu a {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    padding: 15px 25px;
    font-size: 0.95rem;
    transition: color 0.25s ease, background-color 0.25s ease;
}

.nav-menu a i {
    font-size: 0.7rem;
    margin-left: 5px;
    opacity: 0.7;
}

.nav-menu > ul > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-menu > ul > li > a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Dropdown Base Styles */
.nav-menu ul ul {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #ffffff;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    z-index: 1001;
    border-radius: 8px;
    padding: 10px 0;
}

/* 增加透明占位层，防止鼠标移动时菜单消失 */
.nav-menu ul ul::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.nav-menu li:hover > ul {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-menu ul ul li a {
    color: var(--text-primary) !important;
    padding: 10px 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu ul ul li a i {
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
    color: #3b82f6;
    opacity: 1;
    margin-left: 0;
}

.nav-menu ul ul li a i.fa-chevron-right {
    margin-left: auto;
    font-size: 0.7rem;
    color: #cbd5e1;
    width: auto;
}

.nav-menu ul ul li a:hover {
    background: #f8fafc;
    color: var(--primary-color) !important;
}

/* Level 2 and 3: 向右侧展开 */
.nav-menu ul ul ul {
    top: 0;
    left: 100%;
    margin-top: -10px;
    border-radius: 8px;
}

.btn-contact-small {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 22px !important;
    border-radius: 8px;
    margin: 10px 0 10px 20px;
}

.btn-contact-small:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* 更丝滑的过渡 */
    text-align: center;
    border: none;    /* 彻底消除默认边框 */
    outline: none;   /* 消除激活后的轮框 */
    line-height: 1;  /* 确保垂直对齐更精准 */
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: #eff6ff;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Sidebar Layout Section */
.details-section {
    padding: 80px 0;
    background: white;
}

.grid-sidebar {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}

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

.sidebar-box {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.sidebar-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: #dbe4f0;
}

.sidebar-name {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.sidebar-intro {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.sidebar-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.box-title {
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    letter-spacing: 1px;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 500;
}

.check-list i {
    color: var(--primary-color);
}

.contact-hint {
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.contact-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* New styles for tech-stack-item variants */
/* Vue3 Style */
.tech-stack-item.hot-tech i {
    color: #42b883 !important;
    opacity: 1;
}

/* Python Style */
.tech-stack-item.core-tech i {
    color: #3776ab !important;
    opacity: 1;
}

.tech-stack-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* Emoji Badge Style - Clean */
.tech-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 1rem;
    z-index: 5;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
    background: none !important; /* 强制去除蓝色背景 */
    box-shadow: none !important; /* 强制去除残留阴影 */
    border: none !important;
}

.tech-stack-item:hover .tech-badge {
    transform: scale(1.2) rotate(10deg);
}

@keyframes badge-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px rgba(59, 130, 246, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(59, 130, 246, 0.7); }
    100% { transform: scale(1); box-shadow: 0 0 5px rgba(59, 130, 246, 0.4); }
}

.tech-stack-item:hover .tech-badge {
    background: #000;
    transform: translateY(-2px) scale(1.1);
}
.contact-btn {
    padding: 10px;
    background: white;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.contact-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.15);
}

/* Main Content Area */
.main-content-area {
    background: var(--bg-color);
    border-radius: 20px;
    padding: 40px 40px 20px 40px;
    border: 1px solid var(--border-color);
}

.content-header h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

/* Github Activity Style for Sidebar */
.github-activity {
    padding: 5px 0;
    text-align: center;
}

.activity-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 12px;
}

.cube {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: #ebedf0;
}

.level-0 { background: #ebedf0; }
.level-1 { background: #9be9a8; }
.level-2 { background: #40c463; }
.level-3 { background: #30a14e; }
.level-4 { background: #216e39; }

.activity-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.activity-stat b {
    color: #216e39;
}



/* FAQ in Content Area */
.content-faq-area {
    margin-top: 40px;
    padding-top: 0;
}

.content-faq-area h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 700;
}

.faq-item {
    margin-bottom: 10px;
}

.faq-question {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.faq-question::after {
    content: "+";
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item:hover .faq-question {
    color: var(--primary-color);
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    padding-top: 10px;
    max-height: 200px;
}

/* Final CTA - Clean Minimal */
.final-cta {
    padding: 100px 0;
    background: #f8fafc;
    text-align: center;
}

.final-cta h2 {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 20px;
    color: #1e293b;
}

.final-cta p {
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.final-cta .btn-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.final-cta .btn-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.main-footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    color: var(--text-secondary);
}

.main-footer p {
    margin: 5px 0;
    display: block;
}

/* Scroll Reveal Classes */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* 兼容由于脚本未及时执行时的可见性 */
.service-card, .portfolio-item, .sidebar-box, .main-content-area {
    visibility: visible;
}

/* Responsive */
@media (max-width: 968px) {
    .grid-container, .grid-sidebar {
        grid-template-columns: 1fr;
    }
    
    .hero-content {
        text-align: center;
    }
    
    .hero-btns {
        justify-content: center;
    }
    
    .services-grid, .portfolio-grid, .services-row {
        grid-template-columns: 1fr;
    }
}

/* Contact Button Tooltips */
.contact-btn {
    position: relative;
    cursor: pointer;
}

.contact-btn.has-tooltip {
    cursor: default;
}

.tooltip-content {
    position: absolute;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    opacity: 0;
    display: none; /* 使用 display: none 彻底解决初始化占位问题 */
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 100;
    width: max-content; /* 改回根据内容自适应宽度 */
    min-width: 140px;
    max-width: 250px; /* 同时也设定一个最大宽度，防止极端情况 */
    border: 1px solid var(--border-color);
    text-align: center;
}

/* Tooltip Arrow Base */
.tooltip-content::after {
    content: '';
    position: absolute;
    border: 8px solid transparent;
}

/* Default: Top Position */
.contact-btn:not(.tooltip-left):not(.tooltip-bottom) .tooltip-content {
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}
.contact-btn:not(.tooltip-left):not(.tooltip-bottom) .tooltip-content::after {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
}
.contact-btn:not(.tooltip-left):not(.tooltip-bottom):hover .tooltip-content {
    transform: translateX(-50%) translateY(0);
}

/* Left Position (for WeChat) */
.contact-btn.tooltip-left .tooltip-content {
    right: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
}
.contact-btn.tooltip-left .tooltip-content::after {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: white;
}
.contact-btn.tooltip-left:hover .tooltip-content {
    transform: translateY(-50%) translateX(0);
}

/* Bottom Position (for QQ) */
.contact-btn.tooltip-bottom .tooltip-content {
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}
.contact-btn.tooltip-bottom .tooltip-content::after {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}
.contact-btn.tooltip-bottom:hover .tooltip-content {
    transform: translateX(-50%) translateY(0);
}

.contact-btn:hover .tooltip-content {
    opacity: 1;
    display: block;
}

.tooltip-content img {
    width: 110px !important; 
    height: 110px !important;
    max-width: 100% !important;
    display: block;
    margin: 0 auto 8px;
    border-radius: 6px;
    object-fit: contain;
}

.tooltip-text {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary) !important;
    font-weight: 700;
    margin-top: 2px;
}

.tooltip-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary) !important;
    margin-top: 4px;
}

/* --- Verification Modal Styles --- */
.v-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.v-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.v-modal-card {
    background: white;
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.v-modal-overlay.active .v-modal-card {
    transform: scale(1);
}

.v-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.v-modal-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.v-captcha-box {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.v-question {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.v-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    outline: none;
    transition: border-color 0.3s ease;
}

.v-input:focus {
    border-color: var(--primary-color);
}


/* --- Toast/Notification System --- */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 移动到屏幕正中央 */
    z-index: 4000; /* 确保在模态框之上 */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.toast-item {
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; /* 弹性放大进入 */
    pointer-events: auto;
    min-width: 280px;
    transition: all 0.3s ease;
}

.toast-item.toast-out {
    animation: toast-out 0.4s ease forwards;
}

.toast-item i {
    font-size: 1.1rem;
}

.toast-item.success i { color: #10b981; }
.toast-item.error i { color: #ef4444; }
.toast-item.warning i { color: #f59e0b; }
.toast-item.info i { color: var(--primary-color); }

.toast-item .toast-msg {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: scale(0.6); /* 从中心缩放弹出 */
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.grid-sidebar-rev {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wide Mode Layout */
body.wide-mode .grid-sidebar-rev {
    grid-template-columns: 1fr;
}

body.wide-mode .sidebar {
    display: none;
}

body.wide-mode .main-content-area-wrapper {
    max-width: 100%;
}

body.wide-mode .article-container {
    /* 移除之前的 1000px 限制，让它完美对齐顶部的 1100px 容器 */
    max-width: 100%; 
}
