:root {
    --blue: #1664ff;
    --blue-dark: #0a4fe0;
    --blue-soft: #eaf1ff;
    --blue-softer: #f5f8ff;
    --teal: #00b4a0;
    --amber: #ff8f1f;
    --ink: #1a1d24;
    --ink-soft: #4a5160;
    --ink-faint: #8a909e;
    --line: #e6e9f0;
    --bg: #ffffff;
    --bg-alt: #f6f8fc;
    --radius: 16px;
    --shadow: 0 4px 24px rgba(22, 100, 255, 0.07);
    --shadow-hover: 0 10px 36px rgba(22, 100, 255, 0.14);
    --maxw: 1280px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 78px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.92em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.narrow-block { max-width: 760px; }

/* ---------- Navbar ---------- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-inner {
    max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
    height: 60px; display: flex; align-items: center; justify-content: center;
}
.nav-links a {
    color: var(--ink-soft); text-decoration: none; margin: 0 16px;
    font-size: 0.92rem; font-weight: 500; transition: color 0.2s;
}
.nav-links a:hover { color: var(--blue); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 52px 0 34px;
    background:
        radial-gradient(60% 120% at 50% -10%, var(--blue-soft) 0%, rgba(234,241,255,0) 60%),
        var(--bg);
}
.venue {
    color: var(--blue); font-weight: 600; font-size: 0.86rem;
    letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 18px;
}
.title {
    font-size: clamp(1.7rem, 4.2vw, 2.85rem);
    font-weight: 800; letter-spacing: -0.025em; line-height: 1.18;
    color: var(--ink); margin-bottom: 22px;
}
.authors { font-size: 1.05rem; font-weight: 500; color: var(--ink); line-height: 1.9; max-width: 820px; margin: 0 auto; }
.authors .author { white-space: nowrap; }
.authors sup { color: var(--blue); font-size: 0.7em; font-weight: 600; }
.affiliations { font-size: 0.92rem; color: var(--ink-soft); margin-top: 10px; }
.affiliations sup { color: var(--blue); }
.affiliations .aff-sep { margin: 0 10px; color: var(--ink-faint); }
.author-notes { font-size: 0.84rem; color: var(--ink-soft); margin-top: 6px; }
.author-notes sup { color: var(--blue); font-weight: 700; }
.author-notes .aff-sep { margin: 0 8px; color: var(--ink-faint); }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink); color: #fff; text-decoration: none;
    padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); background: var(--blue); }
.btn-ico { font-size: 0.95em; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em;
    text-align: center; margin-bottom: 12px; color: var(--ink);
}
.section-title::after {
    content: ""; display: block; width: 46px; height: 3px; border-radius: 3px;
    background: var(--blue); margin: 14px auto 0;
}
.section-sub { color: var(--ink-soft); text-align: center; margin: 0 auto 22px; }
.sub-title {
    font-size: 1.18rem; font-weight: 700; margin: 30px 0 14px; color: var(--ink);
    text-align: center;
}
.lead { font-size: 1.06rem; color: var(--ink-soft); text-align: justify; }
.lead b, p b { color: var(--ink); font-weight: 600; }

/* ---------- Teaser & figures ---------- */
.teaser-section { padding: 8px 0 8px; }
.figure {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow); margin: 18px auto;
}
.figure img { width: 100%; height: auto; display: block; border-radius: 8px; }
.figure figcaption {
    font-size: 0.9rem; color: var(--ink-soft); margin-top: 14px; padding: 0 6px;
    text-align: left; line-height: 1.55;
}

/* ---------- Keywords ---------- */
.keywords { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.chip {
    background: var(--blue-soft); color: var(--blue-dark);
    padding: 6px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 24px; transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-num {
    font-family: 'JetBrains Mono', monospace; font-weight: 500;
    color: var(--blue); font-size: 0.95rem; opacity: 0.7; margin-bottom: 10px;
}
.card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: 0.94rem; }

/* ---------- Video demos (carousel) ---------- */
.carousel { position: relative; }
.transfer-flow {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 10px; max-width: 820px; margin: -2px auto 20px;
    color: var(--ink-soft); font-size: 0.9rem; font-weight: 600;
}
.transfer-flow span:not(.transfer-arrow) {
    padding: 7px 12px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.transfer-flow span:first-child { color: var(--amber); border-color: rgba(255, 143, 31, 0.28); }
.transfer-flow span:last-child { color: var(--teal); border-color: rgba(0, 180, 160, 0.28); }
.transfer-arrow {
    color: var(--blue); font-family: 'JetBrains Mono', monospace; font-weight: 700;
}
.video-track {
    display: flex; flex-wrap: nowrap; gap: 20px; overflow-x: auto; overflow-y: hidden;
    scroll-behavior: smooth; scroll-snap-type: x mandatory;
    padding: 18px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 16px;
    scrollbar-width: thin; scrollbar-color: var(--blue) var(--blue-soft);
}
.video-track::-webkit-scrollbar { height: 8px; }
.video-track::-webkit-scrollbar-track { background: var(--blue-soft); border-radius: 999px; }
.video-track::-webkit-scrollbar-thumb { background: var(--blue); border-radius: 999px; }
.video-card {
    flex: 0 0 340px; scroll-snap-align: center; margin: 0;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 10px; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.video-pair-card { flex-basis: min(840px, calc(100vw - 72px)); }
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.video-card video {
    width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
    border-radius: 10px; background: #0f1320; display: block;
}
.video-pair {
    position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.video-pair::before {
    content: "Head-camera frame 3D wrist bridge";
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 2; max-width: 190px; padding: 8px 12px; border-radius: 999px;
    background: linear-gradient(135deg, var(--blue), var(--teal)); color: #fff;
    box-shadow: 0 10px 30px rgba(22, 100, 255, 0.28);
    font-size: 0.72rem; font-weight: 800; line-height: 1.2; text-align: center;
}
.video-pair::after {
    content: "";
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 46px; height: 46px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow);
}
.video-demo {
    position: relative; border-radius: 12px; overflow: hidden; background: #0f1320;
}
.video-label {
    position: absolute; top: 8px; left: 8px; z-index: 1;
    padding: 4px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.9); color: var(--blue-dark);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.video-demo:first-child .video-label { color: #ad5f00; }
.video-demo:last-child .video-label { color: #007c70; }
.video-card figcaption {
    text-align: center; margin-top: 12px; margin-bottom: 4px;
    font-weight: 600; font-size: 0.9rem; color: var(--ink); line-height: 1.4;
}
.task-index {
    display: inline-block; margin-right: 8px; padding: 2px 8px;
    border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark);
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 700;
}
.carousel-btn {
    position: absolute; top: 38%; transform: translateY(-50%); z-index: 5;
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
    background: rgba(255,255,255,0.95); color: var(--blue); font-size: 1.5rem; line-height: 1;
    cursor: pointer; box-shadow: var(--shadow); transition: background 0.2s, transform 0.2s, opacity 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.carousel-btn:hover { background: var(--blue); color: #fff; }
.carousel-btn.prev { left: -10px; }
.carousel-btn.next { right: -10px; }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }
.carousel-btn:disabled:hover { background: rgba(255,255,255,0.95); color: var(--blue); }
@media (max-width: 640px) {
    .video-card { flex-basis: 80vw; }
    .video-pair-card { flex-basis: 86vw; }
    .video-pair { grid-template-columns: 1fr; gap: 22px; }
    .video-pair::before { top: 50%; max-width: 210px; }
    .video-pair::after { width: 42px; height: 42px; }
    .carousel-btn { display: none; }
}

/* ---------- Bridging action visualization ---------- */
.bridge-legend {
    display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
    margin: -8px auto 28px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft);
}
.bridge-legend span { display: inline-flex; align-items: center; gap: 8px; }
.bridge-legend sup { color: var(--blue); font-size: 0.68em; }
.bridge-legend i { width: 24px; height: 0; border-top: 4px solid; border-radius: 2px; }
.bridge-legend .lg-wrist i { border-color: #f5b301; }
.bridge-legend .lg-eef i { border-color: var(--amber); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 auto; }
.data-table {
    width: 100%; border-collapse: collapse; background: #fff;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
    font-size: 0.94rem;
}
.data-table.compact { font-size: 0.9rem; }
.data-table th {
    background: var(--blue-soft); color: var(--blue-dark); font-weight: 600;
    text-align: center; padding: 12px 14px;
}
.data-table th:first-child { text-align: left; }
.data-table td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-soft); }
.data-table td:first-child { text-align: left; color: var(--ink); font-weight: 500; }
.data-table .yes { color: var(--blue); font-weight: 700; }
.data-table .no { color: var(--ink-faint); }
.data-table tr.highlight { background: var(--blue-softer); }
.data-table tr.highlight td { color: var(--ink); }

/* ---------- Stages ---------- */
.stages { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; justify-content: center; }
.stage {
    flex: 1 1 240px; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; padding: 22px; border-top: 3px solid var(--blue);
}
.stage-tag {
    display: inline-block; background: var(--blue); color: #fff; font-weight: 600;
    font-size: 0.76rem; letter-spacing: 0.04em; padding: 3px 10px; border-radius: 6px; margin-bottom: 10px;
}
.stage h4 { font-size: 1.02rem; margin-bottom: 8px; }
.stage p { color: var(--ink-soft); font-size: 0.9rem; }
.stage-arrow { display: flex; align-items: center; color: var(--blue); font-size: 1.4rem; font-weight: 700; }
@media (max-width: 760px) { .stage-arrow { display: none; } }

/* ---------- Findings ---------- */
.findings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 8px; }
.finding {
    background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue);
    border-radius: 12px; padding: 22px 24px;
}
.finding h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--blue-dark); }
.finding p { color: var(--ink-soft); font-size: 0.94rem; }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: center; }
.split-text p { color: var(--ink-soft); margin-bottom: 18px; }
.split-fig { margin: 0; }

/* ---------- Table grid ---------- */
.table-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.table-card {
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px;
}
.table-card h4 { font-size: 1rem; margin-bottom: 4px; }
.table-note { color: var(--ink-faint); font-size: 0.82rem; margin-bottom: 14px; }

/* ---------- Callout ---------- */
.callout {
    margin-top: 24px; background: var(--blue-softer); border: 1px solid var(--blue-soft);
    border-radius: 12px; padding: 18px 22px; color: var(--ink-soft); font-size: 0.95rem;
}
.callout b { color: var(--blue-dark); }

/* ---------- BibTeX ---------- */
.bibtex-wrap { position: relative; }
.bibtex-wrap pre {
    background: #0f1320; color: #d7e0f5; border-radius: 12px; padding: 24px;
    overflow-x: auto; font-family: 'JetBrains Mono', monospace; font-size: 0.86rem; line-height: 1.6;
}
.copy-btn {
    position: absolute; top: 12px; right: 12px; background: var(--blue); color: #fff;
    border: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 0.82rem;
    cursor: pointer; transition: background 0.2s;
}
.copy-btn:hover { background: var(--blue-dark); }
.copy-btn.copied { background: var(--teal); }

/* ---------- Footer ---------- */
.footer { background: #0f1320; color: #aab3c5; text-align: center; padding: 36px 0; }
.footer p { font-size: 0.9rem; }
.footer-sub { color: #6b7488; font-size: 0.82rem; margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .cards, .findings, .table-grid { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
}
