/* ===== Base Styles ===== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --highlight-color: #fef3c7;
    --max-width: 900px;
}

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

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
}

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

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

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

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Header Section ===== */
.header {
    padding: 60px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.venue {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.authors {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.author a {
    color: var(--text-color);
}

.author a:hover {
    color: var(--primary-color);
}

.affiliations {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.affiliation {
    margin: 0 10px;
}

.author-note {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 25px;
}

/* ===== Resource Links ===== */
.links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--text-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn i {
    font-size: 1.1rem;
}

/* ===== Teaser Section ===== */
.teaser {
    padding: 40px 0;
}

.teaser-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.caption {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 15px;
    padding: 0 20px;
}

/* ===== Platform Figure ===== */
.platform-figure {
    margin: 30px 0;
}

.platform-img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

/* ===== Image Placeholder ===== */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    min-height: 300px;
}

.image-placeholder.teaser-placeholder {
    min-height: 400px;
}

.image-placeholder i {
    font-size: 4rem;
    color: #9ca3af;
    margin-bottom: 20px;
}

.image-placeholder p {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}

.image-placeholder span {
    font-size: 0.85rem;
    color: #9ca3af;
    max-width: 400px;
}

/* ===== Section Styles ===== */
section {
    padding: 50px 0;
}

section:nth-child(even) {
    background-color: var(--bg-secondary);
}

section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-color);
}

section h3 {
    font-size: 1.3rem;
    margin: 30px 0 15px;
    color: var(--text-color);
}

/* ===== Abstract Section ===== */
.abstract p {
    margin-bottom: 15px;
    text-align: justify;
}

/* ===== Method Section ===== */
.method-figure {
    margin: 30px 0;
}

.method-figure img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
}

.components {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.component-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: box-shadow 0.2s ease;
}

.component-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.component-card h3 {
    font-size: 1.1rem;
    margin: 0 0 12px 0;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.component-card h3 i {
    font-size: 1.2rem;
}

.component-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== Inference Info ===== */
.inference-info {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.inference-info h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.inference-info p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Results Section ===== */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0 30px;
}

.table-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    margin: -10px 0 15px 0;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.results-table th,
.results-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--text-color);
    color: white;
    font-weight: 600;
}

.results-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.results-table tbody tr:hover {
    background-color: var(--bg-secondary);
}

.results-table .average-row {
    background-color: #f0f9ff;
}

.results-table .average-row:hover {
    background-color: #e0f2fe;
}

.results-table .highlight-row {
    background-color: #eff6ff;
}

.results-table .highlight-row:hover {
    background-color: #dbeafe;
}

.improvement {
    color: var(--success-color);
    font-size: 0.85rem;
}

/* ===== Achievements Section ===== */
.achievements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.achievement-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.15);
}

.achievement-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.achievement-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 10px 0 5px;
}

.achievement-note {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===== Real World Info ===== */
.real-world-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.real-world-info > div {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.real-world-info h4 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.real-world-info h4 i {
    font-size: 1.1rem;
}

.real-world-info ul {
    list-style: none;
    padding: 0;
}

.real-world-info li {
    font-size: 0.9rem;
    color: var(--text-light);
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}

.real-world-info li:last-child {
    border-bottom: none;
}

.method-note {
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

/* ===== Table Category Headers ===== */
.results-table .category-header td {
    background: #f3f4f6;
    font-style: italic;
    font-weight: 500;
    text-align: left !important;
    color: var(--text-light);
    padding: 8px 15px;
    border-bottom: 1px solid var(--border-color);
}

.results-table .separator-row td {
    padding: 3px;
    background: var(--border-color);
    border-bottom: none;
}

.results-table .two-level-header th {
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.results-table .sub-header th {
    background: #374151;
    font-weight: 500;
    font-size: 0.85rem;
}

.results-table td.unavailable {
    color: #9ca3af;
}

/* ===== Table Highlight Styles ===== */
.results-table td u {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.results-table td b {
    font-weight: 700;
}

/* ===== Bar Chart Styles ===== */
.bar-chart-container {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin: 25px 0;
}

.bar-chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
}

.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 280px;
    padding: 20px 10px;
    position: relative;
}

.bar-chart::before {
    content: '';
    position: absolute;
    left: 40px;
    right: 20px;
    bottom: 60px;
    top: 20px;
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.bar-group {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    z-index: 1;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bar {
    width: 36px;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

.bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.02);
}

.bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.bar-label {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
    max-width: 100px;
}

.bar-pi0 {
    background: linear-gradient(180deg, #6495ED 0%, #4169E1 100%);
}

.bar-3dfdp {
    background: linear-gradient(180deg, #F0E68C 0%, #DAA520 100%);
}

.bar-lamp {
    background: linear-gradient(180deg, #90EE90 0%, #32CD32 100%);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-pi0 {
    background: #6495ED;
}

.legend-3dfdp {
    background: #F0E68C;
}

/* ===== Bar Chart V2 Styles (Improved) ===== */
.bar-chart-container-v2 {
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 30px 30px;
    margin: 25px 0;
}

.chart-legend-v2 {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.legend-item-v2 {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color-v2 {
    width: 14px;
    height: 14px;
    border: 1px solid #333;
    border-radius: 2px;
}

.bar-chart-title-v2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.bar-chart-v2 {
    display: flex;
    height: 280px;
}

.y-axis-container {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.y-axis-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.75rem;
    color: var(--text-color);
    font-weight: 500;
    white-space: nowrap;
    margin-right: 5px;
}

.y-axis-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
    height: 100%;
    padding: 5px 0;
}

.chart-area {
    flex: 1;
    position: relative;
    padding: 5px 0 30px 0;
}

.grid-lines {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid-lines > div {
    height: 1px;
    background-color: #d0d0d0;
}

.bars-container {
    position: relative;
    height: 245px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
}

.bar-group-v2 {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    position: relative;
}

.bar-wrapper-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bar-value-top {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.bar-v2 {
    width: 32px;
    min-height: 3px;
    border: 1px solid #333;
    border-radius: 2px 2px 0 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.15);
}

.bar-label-v2 {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    white-space: nowrap;
}

.legend-lamp {
    background: #90EE90;
}

.chart-y-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* ===== Citation Section ===== */
.citation {
    padding: 50px 0;
}

.citation p {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-light);
}

.bibtex {
    position: relative;
    background: #1e293b;
    border-radius: 10px;
    padding: 20px;
    overflow: hidden;
}

.bibtex pre {
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: var(--success-color);
}

/* ===== Footer ===== */
.footer {
    padding: 30px 0;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

.footer a {
    color: var(--primary-color);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .title {
        font-size: 1.6rem;
    }

    .authors {
        font-size: 1rem;
    }

    section {
        padding: 35px 0;
    }

    section h2 {
        font-size: 1.5rem;
    }

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

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

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

    .results-table {
        font-size: 0.8rem;
    }

    .results-table th,
    .results-table td {
        padding: 8px 10px;
    }

    .image-placeholder {
        min-height: 200px;
        padding: 40px 20px;
    }

    .image-placeholder.teaser-placeholder {
        min-height: 250px;
    }

    .image-placeholder i {
        font-size: 3rem;
    }

    .bar-chart {
        height: 220px;
        padding: 15px 5px;
    }

    .bar {
        width: 28px;
    }

    .bar-group {
        gap: 5px;
    }

    .bar-value {
        font-size: 0.65rem;
    }

    .bar-label {
        font-size: 0.7rem;
        max-width: 70px;
    }

    .chart-legend {
        gap: 15px;
        flex-wrap: wrap;
    }

    .legend-item {
        font-size: 0.75rem;
    }

    /* Bar Chart V2 Mobile Adjustments */
    .bar-chart-v2 {
        height: 220px;
    }

    .bars-container {
        height: 190px;
    }

    .bar-group-v2 {
        gap: 4px;
    }

    .bar-v2 {
        width: 20px;
    }

    .bar-value-top {
        font-size: 0.65rem;
    }

    .bar-label-v2 {
        font-size: 0.7rem;
        bottom: -22px;
    }

    .chart-legend-v2 {
        gap: 12px;
        flex-wrap: wrap;
    }

    .legend-item-v2 {
        font-size: 0.75rem;
    }

    .legend-color-v2 {
        width: 14px;
        height: 14px;
    }

    .y-axis-labels {
        font-size: 0.7rem;
    }

    .y-axis-title {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.4rem;
    }

    .links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
        max-width: 200px;
    }

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

    .achievement-number {
        font-size: 1.8rem;
    }

    /* Bar Chart V2 Small Screen Adjustments */
    .bar-chart-v2 {
        height: 200px;
    }

    .bars-container {
        height: 170px;
    }

    .bar-group-v2 {
        gap: 2px;
    }

    .bar-v2 {
        width: 16px;
    }

    .bar-value-top {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }

    .bar-label-v2 {
        font-size: 0.6rem;
        bottom: -20px;
        white-space: normal;
        max-width: 60px;
        line-height: 1.2;
    }

    .chart-legend-v2 {
        gap: 8px;
    }

    .legend-item-v2 {
        font-size: 0.7rem;
    }

    .legend-color-v2 {
        width: 12px;
        height: 12px;
    }

    .y-axis-labels {
        font-size: 0.65rem;
    }

    .y-axis-title {
        font-size: 0.65rem;
    }

    .bar-chart-title-v2 {
        font-size: 1rem;
    }
}
