:root {
    --paper: #fff;
    --ink: #1b2430;
    --muted: #596779;
    --blue: #1f5fae;
    --line: #d8dee6;
}

.twin-demo {
    max-width: 860px;
    margin: auto;
    padding: 72px 28px;
    color: var(--ink);
    font-family: "Noto Sans TC", Arial, sans-serif;
}

.demo-hero {
    padding: 22px 0 64px;
    border-bottom: 1px solid var(--line);
}

.demo-hero p,
.step-no {
    color: var(--blue);
    font: 500 .75rem "DM Mono", monospace;
    letter-spacing: .12em;
}

.demo-hero h1 {
    margin: 14px 0;
    font-size: clamp(2.25rem, 6vw, 4rem);
    letter-spacing: -.05em;
}

.demo-title-highlight {
    color: var(--blue);
}

.demo-hero div {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.8;
}

.twin-demo section {
    position: relative;
    padding: 25px 0 0;
}

.twin-demo h2 {
    margin: 8px 0 18px;
    font-size: 1.65rem;
}

.twin-demo h3 {
    margin: 25px 0 10px;
    font-size: 1rem;
}

.twin-demo p {
    color: var(--muted);
    line-height: 1.9;
}

.specs,
.two {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.specs article,
.two article,
.result {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 -3px 0 var(--blue);
}

.specs b {
    display: block;
    color: var(--blue);
    font: .7rem "DM Mono", monospace;
}

.specs strong {
    display: block;
    margin: 12px 0 4px;
    font-size: 1.1rem;
}

.specs small {
    color: var(--muted);
}

.walkthrough {
    margin: 22px 0;
    padding: 0;
    list-style: none;
    counter-reset: item;
}

.walkthrough li {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.code-details summary {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.code-details summary::-webkit-details-marker {
    display: none;
}

.code-details summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 7px;
    font-size: .7em;
    transform: rotate(0deg);
    transition: transform .3s ease;
}

.code-details.is-open summary::before {
    transform: rotate(90deg);
}

.code-details-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows .3s ease, opacity .3s ease;
}

.code-details.is-open .code-details-content {
    grid-template-rows: 1fr;
    opacity: 1;
}

.code-details-inner {
    min-height: 0;
    overflow: hidden;
}

code,
pre {
    font-family: "DM Mono", monospace;
}

code {
    color: #16477d;
}

pre {
    overflow: auto;
    margin: 20px 0;
    padding: 18px;
    background: #0d2445;
    color: #e6f0ff;
    border-radius: 10px;
    font-size: .78rem;
    line-height: 1.7;
}

pre code {
    color: inherit;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--blue);
    background: #f3f7fc;
}

blockquote {
    margin: 18px 0;
    padding: 18px;
    border-left: 3px solid var(--blue);
    background: #edf4fc;
    color: #33465e;
    line-height: 1.8;
}

.result {
    margin-top: 20px;
}

.result b {
    color: var(--blue);
}

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

.twin-demo footer {
    position: relative;
    left: 50%;
    width: calc(100vw - 68px);
    max-width: 1052px;
    padding-bottom: 32px;
    transform: translateX(-50%);
}

@media (max-width: 620px) {
    .twin-demo {
        padding: 48px 20px;
    }

    .demo-hero {
        padding-bottom: 42px;
    }

    .demo-title-tail {
        display: block;
    }

    .specs,
    .two {
        grid-template-columns: 1fr;
    }

    .walkthrough li {
        grid-template-columns: 1fr;
    }

    .walkthrough code {
        font-size: .75rem;
    }

    .twin-demo section {
        padding-top: 40px;
    }

}

@media (max-width: 650px) {
    .twin-demo footer {
        width: calc(100vw - 40px);
        padding-bottom: 26px;
    }
}

.research-questions {
    color: var(--muted);
}

.research-questions li {
    margin-bottom: 12px;
}

.research-figure {
    margin: 28px 0 0;
}

.research-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #000;
}

.research-figure figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.6;
    text-align: center;
}

.tips {
    color: var(--muted);
}

.tips li {
    margin-bottom: 12px;
}

.references {
    margin-bottom: 0;
    color: var(--muted);
}

.references li {
    margin-bottom: 12px;
    font-size: .85rem;
}

.references li:last-child {
    margin-bottom: 0;
}

.twin-demo {
    padding-top: 36px;
    padding-bottom: 0;
}

.demo-hero {
    padding-top: 12px;
    padding-bottom: 42px;
}

.restored {
    position: relative;
    padding: 52px 0 0;
}

.restored h2 {
    margin: 8px 0 18px;
    font-size: 1.65rem;
}

.restored p {
    color: var(--muted);
    line-height: 1.9;
}

@media (prefers-reduced-motion: reduce) {
    .code-details summary::before,
    .code-details-content {
        transition: none;
    }
}
