/* CSS Reset & Variables */
:root {
    --primary: #00d4ff;
    --secondary: #7c3aed;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #05050a;
    color: var(--text-main);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    padding-bottom: 100px; /* 留出底部导航栏的空间 */
}

/* Tech Background */
.bg-tech {
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    z-index: -2;
    background: radial-gradient(ellipse at 30% 20%, rgba(0,212,255,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(124,58,237,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 50%, rgba(0,212,255,0.03) 0%, transparent 70%);
    animation: bgMove 20s ease-in-out infinite;
}

@keyframes bgMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-3%, -3%); }
}

.bg-lines {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}

/* 装饰粒子 (Floating Dots) */
.dot {
    position: fixed;
    width: 3px; height: 3px;
    background: rgba(0, 212, 255, 0.4);
    border-radius: 50%;
    z-index: -1;
    animation: float 6s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}
.dot:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.dot:nth-child(2) { top: 70%; left: 85%; animation-delay: 2s; }
.dot:nth-child(3) { top: 40%; left: 75%; animation-delay: 4s; }
.dot:nth-child(4) { top: 80%; left: 20%; animation-delay: 1s; }
.dot:nth-child(5) { top: 25%; left: 60%; animation-delay: 3s; }
.dot:nth-child(6) { top: 10%; left: 80%; animation-delay: 1.5s; background: rgba(124, 58, 237, 0.4); box-shadow: 0 0 10px rgba(124, 58, 237, 0.8); }
.dot:nth-child(7) { top: 60%; left: 15%; animation-delay: 2.5s; background: rgba(124, 58, 237, 0.4); box-shadow: 0 0 10px rgba(124, 58, 237, 0.8); }

@keyframes float {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 0.8; transform: translateY(-20px); }
}

/* Glassmorphism Classes */
.liquid-glass {
    background: rgba(255, 255, 255, 0.02);
    background-blend-mode: luminosity;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 16px;
}

.liquid-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.02) 75%, rgba(255,255,255,0.4) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.liquid-glass-strong {
    background: rgba(255, 255, 255, 0.04);
    background-blend-mode: luminosity;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    position: relative;
    border-radius: 24px;
}

.liquid-glass-strong::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(135deg, rgba(0,212,255,0.8) 0%, rgba(124,58,237,0.1) 25%, rgba(0,212,255,0.4) 50%, rgba(124,58,237,0.1) 75%, rgba(0,212,255,0.8) 100%);
    background-size: 200% 200%;
    animation: flowLight 4s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.liquid-glass > *, .liquid-glass-strong > * {
    position: relative;
    z-index: 2;
}

@keyframes flowLight {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 200%; }
}

/* Layout */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Header */
.profile-header {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 500;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 20px;
    color: var(--text-muted);
}

/* Section Cards */
.section-card {
    padding: 25px;
}

.section-title {
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.text-content {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.text-content p {
    margin-bottom: 10px;
}

.text-content p:last-child {
    margin-bottom: 0;
}

/* Timeline / Experience / Awards */
.timeline-item {
    margin-bottom: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 5px;
    width: 9px;
    height: 9px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--secondary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 5px;
    gap: 10px;
}

.timeline-title {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(0, 212, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.timeline-subtitle {
    font-size: 0.85rem;
    color: #a5b4fc;
    margin-bottom: 8px;
}

.award-text {
    color: #e2e8f0;
    margin-bottom: 8px;
}

.award-text strong {
    color: #f59e0b;
}

/* Skills */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill {
    padding: 8px 15px;
    font-size: 0.85rem;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.skill:active {
    transform: scale(0.95);
}

/* Toast Notification */
#toast {
    visibility: hidden;
    min-width: 250px;
    max-width: 80%;
    background-color: rgba(15, 23, 42, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: translate(-50%, -40%) scale(0.8); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Confirm Modal */
#confirm-modal {
    visibility: hidden;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

#confirm-modal.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    width: 85%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#confirm-modal.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 12px;
    font-weight: 600;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn-cancel, .btn-confirm {
    flex: 1;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-cancel:active {
    background: rgba(255, 255, 255, 0.1);
}

.btn-confirm {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.8), rgba(124, 58, 237, 0.8));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-confirm:active {
    transform: scale(0.95);
}

/* Accordion System */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.project-card {
    display: block;
    text-decoration: none;
    padding: 20px;
    color: inherit;
    transition: transform 0.3s ease, background 0.3s ease;
    cursor: pointer;
}

.project-card:active {
    transform: scale(0.98);
}

.project-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title::after {
    content: "↗";
    font-size: 1rem;
    color: var(--text-muted);
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

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

.accordion-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    user-select: none;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid transparent;
}

.accordion-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.accordion-icon {
    font-size: 0.8rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
    background: rgba(0, 0, 0, 0.2);
}

.accordion-inner {
    padding: 15px;
}

.accordion-item.active .accordion-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-item.active .accordion-content {
    max-height: 2000px; /* 大到足以容纳所有内容 */
    transition: max-height 0.6s ease-in-out;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-icon {
    font-size: 1.4rem;
}

.contact-text {
    font-size: 0.95rem;
    color: #e2e8f0;
    text-decoration: none;
    word-break: break-all;
}

.github-link {
    color: var(--primary);
    font-weight: 600;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 5px;
    z-index: 1000;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 44px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active span {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 5px var(--primary));
    font-weight: 700;
}

.nav-item.nav-projects span {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.nav-item.nav-projects.active span {
    color: var(--primary);
    text-shadow: none;
}

.nav-item span {
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.3s ease, font-weight 0.3s ease;
}

/* -------------------------------------
   Article / Project Detail Page Styles
------------------------------------- */

/* Top Navigation for Article Page */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-radius: 0 0 20px 20px;
}

.back-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.back-btn:active {
    transform: translateX(-5px);
}

.article-container {
    padding-top: 80px; /* 留出顶部导航的空间 */
    padding-bottom: 40px;
}

.article-header {
    margin-bottom: 30px;
    text-align: center;
}

.article-title {
    font-size: 2rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.article-body {
    padding: 30px 25px;
}

.article-body h2 {
    font-size: 1.3rem;
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body p {
    font-size: 1rem;
    color: #cbd5e1;
    line-height: 1.8;
    margin-bottom: 15px;
}

.article-body ul {
    margin-bottom: 20px;
    padding-left: 20px;
    color: #cbd5e1;
}

.article-body li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.article-body strong {
    color: #fff;
}

.article-image-wrap {
    margin: 25px 0;
    text-align: center;
}

.zoomable-image {
    max-width: 100%;
    border-radius: 12px;
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zoomable-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.image-caption {
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Lightbox (Image Modal) */
.lightbox {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 4000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: auto;
}

.lightbox.show {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

#lightbox-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 15px 0;
    font-size: 1rem;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

/* Articles Grid */
.section-more {
    margin-left: auto;
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--primary);
    text-decoration: none;
}

.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.article-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 14px 16px;
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, var(--primary), var(--secondary)) 1;
    background: transparent;
    transition: background 0.3s ease;
    cursor: pointer;
    opacity: 0;
    transform: translateY(15px);
    animation: articleFadeIn 0.5s ease forwards;
}

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.15s; }
.article-card:nth-child(3) { animation-delay: 0.25s; }
.article-card:nth-child(4) { animation-delay: 0.35s; }
.article-card:nth-child(5) { animation-delay: 0.45s; }

@keyframes articleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card + .article-card {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.article-card:active {
    background: rgba(0, 212, 255, 0.05);
}

.article-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.article-row .article-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.article-row .meta-views {
    flex-shrink: 0;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--primary);
    font-size: 0.68rem;
}

.article-row .meta-date {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.page-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.page-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.6), rgba(124, 58, 237, 0.6));
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.2);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: default;
}

.page-btn:not(.active):not(.disabled):active {
    background: rgba(255, 255, 255, 0.1);
}