/* =====================================================
   JAMES QIN PERSONAL SITE - QCLAW DARK STYLE
   Modern, dark theme, Tencent-inspired
   ===================================================== */

/* --- 变量 --- */
:root {
    --bg-page: #0c1016;
    --bg-card: #141b26;
    --bg-code: #0d1220;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --text-muted: #6c6f7a;
    --accent-blue: #6e9fff;
    --accent-purple: #b78aff;
    --accent-cyan: #22d3ee;
    --gradient-main: linear-gradient(135deg, #6e9fff 0%, #b78aff 50%, #22d3ee 100%);
    --gradient-text: linear-gradient(90deg, #6e9fff 0%, #b78aff 100%);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-card-hover: 0 8px 30px rgba(110, 159, 255, 0.15);
    --shadow-elevated: 0 12px 40px rgba(110, 159, 255, 0.25);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1120px;
}

/* --- 全局 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* --- 粒子背景 --- */
#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-blue); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent-purple); }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* --- 导航栏 --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(20, 27, 38, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(110, 159, 255, 0.15);
    z-index: 1000;
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 36px; height: 36px;
    background: var(--gradient-main);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    font-family: var(--font-sans);
}
.logo-text {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}
.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    position: relative;
    padding: 4px 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: var(--accent-blue);
    border-radius: 2px;
    transition: width 0.3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent-blue); }
.btn-nav {
    background: var(--accent-blue);
    color: #fff !important;
    padding: 6px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
}
.btn-nav:hover {
    background: var(--accent-purple);
    box-shadow: var(--shadow-elevated);
    transform: translateY(-1px);
}

/* --- Hero --- */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 64px 32px 40px;
    display: flex;
    align-items: center;
}
.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 60px;
}
.hero-content { flex: 1; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(110, 159, 255, 0.15);
    border: 1px solid rgba(110, 159, 255, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 24px;
}
.badge-dot {
    width: 6px; height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}
.hero-title {
    font-size: 56px;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}
.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-desc {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 32px;
    max-width: 520px;
}
.hero-actions { display: flex; gap: 14px; margin-bottom: 48px; }
.btn-primary {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-main);
    color: #fff;
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.3s;
}
.btn-primary:hover {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
    color: #fff;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    border: 1.5px solid rgba(110, 159, 255, 0.3);
    text-decoration: none;
    transition: 0.3s;
}
.btn-secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-2px);
}
.hero-stats { display: flex; gap: 40px; }
.stat { display: flex; flex-direction: column; }
.stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Code Window --- */
.hero-illustration { flex: 0 0 420px; }
.hero-code-window {
    background: var(--bg-code);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-elevated);
    border: 1px solid rgba(110, 159, 255, 0.15);
}
.window-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
}
.dot {
    width: 12px; height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28ca41; }
.window-title {
    flex: 1;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-family: var(--font-sans);
}
.code-content {
    padding: 20px 24px;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: #c9d1d9;
}
.code-prompt { color: var(--accent-cyan); }
.code-cmd { color: #e6eeff; }
.code-success { color: #28ca41; }
.cursor-blink {
    animation: blink 1s step-end infinite;
    color: var(--accent-cyan);
}
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Section --- */
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 32px;
}
.section-header { text-align: center; margin-bottom: 48px; }
.section-badge {
    display: inline-block;
    background: rgba(79, 110, 247, 0.25);
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.section-title {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px;
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.about-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    transition: 0.3s;
    border: 1px solid rgba(110, 159, 255, 0.1);
}
.about-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: rgba(110, 159, 255, 0.3);
}
.card-icon { font-size: 36px; margin-bottom: 16px; }
.about-card.feature-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.about-card.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}
.about-card.detail-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}
.detail-grid { display: flex; flex-direction: column; gap: 14px; }
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(110, 159, 255, 0.1);
}
.detail-label {
    font-size: 14px;
    color: var(--text-muted);
}
.detail-val {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.detail-val a { color: var(--accent-blue); }

/* --- Skills --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.skill-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    transition: 0.3s;
    border: 1px solid rgba(110, 159, 255, 0.1);
}
.skill-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: rgba(110, 159, 255, 0.3);
}
.skill-card .skill-emoji { font-size: 32px; margin-bottom: 14px; }
.skill-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text-primary);
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    background: rgba(110, 159, 255, 0.15);
    color: var(--accent-blue);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: 0.2s;
}
.tag:hover {
    background: rgba(110, 159, 255, 0.25);
    color: var(--accent-cyan);
}

/* --- Projects --- */
.projects-list { display: flex; flex-direction: column; gap: 24px; }
.project-main-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(110, 159, 255, 0.1);
}
.project-main-info {
    padding: 40px;
    flex: 1;
}
.project-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--gradient-main);
    color: #fff;
    padding: 5px 14px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}
.label-dot {
    width: 6px; height: 6px;
    background: #fff;
    border-radius: 50%;
}
.project-main-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 14px;
}
.project-main-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.project-tech span {
    background: rgba(110, 159, 255, 0.15);
    color: var(--accent-blue);
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}
.btn-link {
    color: var(--accent-blue);
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}
.btn-link:hover { color: var(--accent-cyan); }

/* Chat bubble */
.project-main-visual {
    flex: 0 0 300px;
    background: var(--bg-code);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-left: 1px solid rgba(110, 159, 255, 0.1);
}
.visual-chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.chat-msg.user {
    flex-direction: row-reverse;
}
.chat-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(110, 159, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.chat-bubble {
    background: var(--bg-card);
    border: 1px solid rgba(110, 159, 255, 0.2);
    border-radius: 12px 12px 2px 12px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
    max-width: 220px;
}
.chat-msg.user .chat-bubble {
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 12px 12px 12px 2px;
}
.chat-msg.has-image .chat-bubble {
    background: rgba(110, 159, 255, 0.15);
}
.chat-image-placeholder {
    background: var(--gradient-main);
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 500;
}
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Projects grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.project-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(110, 159, 255, 0.1);
}
.project-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
    border-color: rgba(110, 159, 255, 0.3);
}
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.project-icon {
    width: 40px; height: 40px;
    background: rgba(110, 159, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.year {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.project-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.project-desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
}
.project-card .project-tech {
    margin-bottom: 14px;
}
.project-card .btn-link {
    font-size: 13px;
    margin-top: auto;
}

/* --- Contact --- */
.contact-intro {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 36px;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.contact-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid rgba(110, 159, 255, 0.1);
}
.contact-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    border-color: rgba(110, 159, 255, 0.3);
}
.contact-emoji {
    font-size: 32px;
    flex-shrink: 0;
}
.contact-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.contact-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.contact-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.contact-card:hover .contact-value {
    color: var(--accent-blue);
}
.feishu-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

/* --- Footer --- */
.footer {
    background: var(--bg-card);
    border-top: 1px solid rgba(110, 159, 255, 0.1);
    padding: 32px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-inner p {
    color: var(--text-muted);
    font-size: 14px;
}
.footer-note {
    background: rgba(110, 159, 255, 0.15);
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    color: var(--accent-blue);
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-desc { max-width: 100%; }
    .hero-actions { justify-content: center; }
    .hero-stats { justify-content: center; }
    .hero-illustration { flex: none; width: 100%; max-width: 500px; }
    .project-main-card { flex-direction: column; }
    .project-main-visual { flex: none; padding: 24px; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .navbar .nav-links { display: none; }
    .hero-title { font-size: 36px; }
    .section-title { font-size: 28px; }
    .about-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 28px; }
    .contact-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr; }
    .project-main-visual { display: none; }
}