/* ============================================
   Apple-Style Design System
   Jing Wu's Personal Website
   ============================================ */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    color: #1d1d1f;
    background: #ffffff;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Navigation ---- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255,255,255,0.82);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    z-index: 99999;
    display: flex;
    align-items: center;
    padding: 0 32px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.header .logo-wrap {
    flex-shrink: 0;
    margin-right: 8px;
}

.header img.logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 10px;
}

.header .buttons {
    display: flex;
    gap: 4px;
    align-items: center;
    flex: 1;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.header .buttons::-webkit-scrollbar {
    display: none;
}

.header .buttons button {
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 400;
    color: rgba(0,0,0,0.7);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.header .buttons button:hover {
    color: #1d1d1f;
    background: rgba(0,0,0,0.05);
}

/* Active page highlight */
.header .buttons button.active {
    color: #1d1d1f;
    font-weight: 600;
    font-size: 1.08em;
    background: rgba(0,0,0,0.1);
    border-radius: 6px;
}

/* ---- Main Container ---- */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 88px;
}

/* ---- Hero Section (News page) ---- */
.hero-news {
    text-align: center;
    padding: 60px 0 50px;
}

.hero-news h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.hero-news .hero-sub {
    font-size: 21px;
    font-weight: 400;
    color: #86868b;
    letter-spacing: -0.01em;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.4;
}

/* ---- News Card Style ---- */
.news-card {
    background: #fbfbfd;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 28px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.news-card .news-date {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}

.news-card .news-title {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
    color: #1d1d1f;
}

.news-card .news-body {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.news-card .news-body .news-image {
    flex-shrink: 0;
    width: 280px;
    border-radius: 16px;
    overflow: hidden;
}

.news-card .news-body .news-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-card .news-body .news-text {
    flex: 1;
    font-size: 16px;
    color: #515154;
    line-height: 1.65;
}

.news-card .news-body .news-text p {
    margin-bottom: 8px;
}

.news-card .news-body .news-text p strong,
.news-card .news-body .news-text p span[style*="font-weight: bold"] {
    color: #1d1d1f;
    font-weight: 600;
}

.news-card .news-body .news-text a {
    color: #06c;
    text-decoration: none;
}

.news-card .news-body .news-text a:hover {
    text-decoration: underline;
}

/* ---- Page Section Title ---- */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h1 {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #1d1d1f;
    margin-bottom: 12px;
}

.section-header .section-desc {
    font-size: 21px;
    color: #86868b;
    max-width: 600px;
    margin: 0 auto;
}

/* ---- Team Page ---- */
.pi-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 56px;
}

.pi-profile img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.pi-profile .pi-name {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.pi-profile .pi-bio {
    font-size: 16px;
    color: #515154;
    line-height: 1.65;
    max-width: 700px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 56px;
}

.info-card {
    background: #fbfbfd;
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(0,0,0,0.04);
}

.info-card h3 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    color: #1d1d1f;
}

.info-card p {
    font-size: 15px;
    color: #515154;
    line-height: 1.65;
    margin-bottom: 8px;
}

/* Student Grid */
.subsection-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 28px;
    color: #1d1d1f;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.student-card {
    text-align: center;
    background: #fbfbfd;
    border-radius: 20px;
    padding: 28px 20px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.student-card:hover {
    transform: translateY(-3px);
}

.student-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

.student-card .student-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1f;
}

.student-card .student-info {
    font-size: 13px;
    color: #86868b;
    line-height: 1.5;
}

/* Alumni List */
.alumni-list {
    background: #fbfbfd;
    border-radius: 20px;
    padding: 36px;
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: 48px;
}

.alumni-list ol {
    padding-left: 20px;
    font-size: 15px;
    color: #515154;
    line-height: 1.8;
}

/* ---- Publication Page ---- */
.pub-section {
    margin-bottom: 56px;
}

.pub-section h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: #1d1d1f;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.pub-section ol {
    padding-left: 20px;
}

.pub-section li {
    font-size: 15px;
    color: #515154;
    line-height: 1.65;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.pub-section li:last-child {
    border-bottom: none;
}

.pub-section li a {
    color: #06c;
    text-decoration: none;
}

.pub-section li a:hover {
    text-decoration: underline;
}

.pub-section li strong,
.pub-section li span[style*="font-weight: bold"] {
    color: #1d1d1f;
}

/* Status Badges */
.pub-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 980px;
    margin-left: 8px;
    vertical-align: middle;
}

.pub-badge.ongoing {
    background: #e8f4fd;
    color: #0071e3;
}

.pub-badge.accepted {
    background: #e8fdf0;
    color: #34c759;
}

.pub-badge.patent-badge {
    background: #fef3e2;
    color: #ff9f0a;
}

.pub-badge.book-badge {
    background: #f0e8fd;
    color: #bf5af2;
}

/* ---- Project Page ---- */
.project-card {
    background: #fbfbfd;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 28px;
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}

.project-card .project-source {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.project-card h3 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin-bottom: 20px;
    line-height: 1.2;
}

.project-detail {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    font-size: 15px;
    color: #515154;
    line-height: 1.65;
    margin-bottom: 0;
}

.project-detail .detail-label {
    font-weight: 600;
    color: #1d1d1f;
}

.project-detail .detail-value {
    grid-column: 2;
}

.project-detail .detail-value-full {
    grid-column: 1 / -1;
}

/* ---- Research & Join Pages ---- */
.content-center {
    text-align: center;
    padding: 40px 0;
}

.content-center p {
    font-size: 21px;
    color: #515154;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 40px;
}

.content-center p a {
    color: #06c;
    text-decoration: none;
    font-weight: 500;
}

.content-center p a:hover {
    text-decoration: underline;
}

.content-center img {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

/* ---- Footer ---- */
footer {
    text-align: center;
    padding: 32px 24px;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

footer p {
    font-size: 13px;
    color: #86868b;
}

/* ---- Utility ---- */
.wide-text { /* kept for compatibility, content styled via parent containers */ }

.two-columns,
.narrow-content-wrapper,
.half-content-wrapper {
    display: contents; /* flatten for new layout */
}

.narrow-content,
.half-content {
    max-width: 100%;
    text-align: left;
}

.left-column,
.right-column {
    max-width: none;
    padding: 0;
}

.left-column img {
    width: 100%;
    margin: 0;
}

.right-column p {
    margin: 0 0 8px 0;
}

.welcome-image-container img {
    border-radius: 20px;
}

/* Table override */
.responsive-table {
    width: 100% !important;
    border: none !important;
    border-collapse: separate;
    border-spacing: 24px;
    margin: 0 auto;
}

.responsive-table tr {
    display: flex !important;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: none !important;
}

.responsive-table td {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 24px !important;
    background: #fbfbfd;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.04);
    width: 200px;
    box-shadow: none !important;
}

.responsive-table td img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
}

.responsive-table td b {
    font-size: 17px;
    font-weight: 600;
    color: #1d1d1f;
}

.responsive-table td br + br {
    display: none;
}

/* section override */
section {
    margin: 0 !important;
    margin-bottom: 0 !important;
}

/* ---- Language Switcher ---- */
.lang-switcher {
    position: relative;
    flex-shrink: 0;
    margin-left: 8px;
}

.globe-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.04);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    color: #1d1d1f;
}

.globe-btn:hover {
    background: rgba(0,0,0,0.1);
}

.globe-btn svg {
    width: 20px;
    height: 20px;
}

.lang-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 6px;
    min-width: 140px;
    display: none;
    z-index: 100000;
}

.lang-menu.open {
    display: block;
}

.lang-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #1d1d1f;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    text-align: left;
    transition: background 0.2s;
}

.lang-menu button:hover {
    background: rgba(0,0,0,0.06);
}

.lang-menu button.active {
    font-weight: 600;
    background: rgba(0,113,227,0.08);
    color: #0071e3;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card,
.project-card,
.info-card,
.student-card {
    animation: fadeInUp 0.6s ease-out;
}

/* ---- Responsive ---- */
@media (max-width: 1068px) {
    .hero-news h1,
    .section-header h1 {
        font-size: 48px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .student-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-card .news-body {
        flex-direction: column;
    }

    .news-card .news-body .news-image {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 12px;
    }

    .header .logo-wrap {
        margin-right: 4px;
    }

    .header .buttons {
        gap: 2px;
    }

    .header .buttons button {
        font-size: 12px;
        padding: 5px 8px;
    }

    .lang-switcher {
        margin-left: 4px;
    }

    .container {
        padding: 0 16px;
        padding-top: 72px;
    }

    .news-card,
    .project-card {
        padding: 24px;
    }

    .news-card .news-title {
        font-size: 22px;
    }

    .pi-profile .pi-name {
        font-size: 22px;
    }

    .student-grid {
        grid-template-columns: 1fr;
    }

    .subsection-title {
        font-size: 24px;
    }

    .pub-section h2 {
        font-size: 24px;
    }

    .pub-section li {
        font-size: 14px;
    }

    .responsive-table td {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 8px;
    }

    .header .logo-wrap {
        margin-right: 2px;
    }

    .header img.logo {
        width: 32px;
        height: 32px;
    }

    .header .buttons {
        gap: 0;
    }

    .header .buttons button {
        font-size: 11px;
        padding: 4px 6px;
    }

    .lang-switcher {
        margin-left: 2px;
    }

    .globe-btn {
        width: 30px;
        height: 30px;
    }

    .globe-btn svg {
        width: 16px;
        height: 16px;
    }
}
