/* Romanization comparison — /tools/pinyin-diff (content pipeline 2026-09-20, item 11). */

.pd-input { font-size: 1.15rem; min-height: 5.5rem; }
.pd-side-label { font-weight: 700; letter-spacing: .02em; }
.pd-side-a .pd-side-label { color: #0f766e; }
.pd-side-b .pd-side-label { color: #7c3aed; }

.pd-summary { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.pd-reading { font-size: .9rem; }
.pd-meter { height: .6rem; border-radius: 1rem; background: var(--bs-secondary-bg, #e9ecef); overflow: hidden; }
.pd-meter span {
    display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #22c55e);
    animation: pd-grow .7s cubic-bezier(.2, .8, .2, 1) both;
    transform-origin: left center;
}
.pd-counts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pd-count { font-size: 1.1rem; margin-right: .25rem; }
.pd-chip { font-size: .78rem; padding: .15rem .5rem; border-radius: 1rem; border: 1px solid currentColor; }

.pd-verdict {
    margin-bottom: .75rem; padding: .5rem .75rem; border-radius: .5rem;
    background: rgba(34, 197, 94, .12); color: #15803d; font-weight: 600;
    animation: pd-pop .5s .3s both;
}

/* The strip: one column per syllable, A above, B below, meeting in the middle. */
.pd-strip {
    display: flex; gap: .5rem; overflow-x: auto; padding: .5rem .25rem 1rem;
    scroll-snap-type: x proximity; position: relative;
}
.pd-col {
    flex: 0 0 auto; min-width: 5.5rem; scroll-snap-align: start;
    display: flex; flex-direction: column; align-items: stretch; gap: .25rem;
    padding: .4rem; border-radius: .6rem; border: 2px solid transparent;
    background: var(--bs-body-bg, #fff); box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.pd-tile {
    position: relative; text-align: center; font-size: 1.1rem; font-weight: 600;
    padding: .35rem .5rem; border-radius: .4rem; background: var(--bs-tertiary-bg, #f8f9fa);
    white-space: nowrap;
}
.pd-col > .pd-tile:first-child { color: #0f766e; animation: pd-drop .45s calc(var(--i) * 45ms) both; }
.pd-col > .pd-tile:nth-child(3) { color: #7c3aed; animation: pd-rise .45s calc(var(--i) * 45ms) both; }
.pd-tile-empty { color: var(--bs-secondary-color, #6c757d) !important; font-weight: 400; border: 1px dashed currentColor; background: none; }
.pd-tile-note { display: block; font-size: .65rem; font-weight: 400; color: var(--bs-secondary-color, #6c757d); }

.pd-link {
    align-self: center; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center;
    border-radius: 50%; font-weight: 700; color: #fff; background: #6c757d;
    animation: pd-pop .35s calc(var(--i) * 45ms + .3s) both;
}
.pd-same { border-color: rgba(34, 197, 94, .45); }
.pd-same .pd-link { background: #16a34a; }
.pd-tone { border-color: rgba(245, 158, 11, .55); }
.pd-tone .pd-link { background: #d97706; }
.pd-different, .pd-unknown { border-color: rgba(220, 38, 38, .45); }
.pd-different .pd-link, .pd-unknown .pd-link { background: #dc2626; }
.pd-only-a .pd-link, .pd-only-b .pd-link { background: #94a3b8; }

.pd-chip.pd-same { color: #15803d; }
.pd-chip.pd-tone { color: #b45309; }
.pd-chip.pd-different, .pd-chip.pd-unknown { color: #b91c1c; }
.pd-chip.pd-only-a, .pd-chip.pd-only-b { color: #475569; }

/* Every column, written in all four systems. */
.pd-rosetta { margin: .25rem 0 0; font-size: .75rem; animation: pd-fade .4s calc(var(--i) * 45ms + .45s) both; }
.pd-rosetta div { display: flex; justify-content: space-between; gap: .4rem; }
.pd-rosetta dt { font-weight: 400; color: var(--bs-secondary-color, #6c757d); }
.pd-rosetta dd { margin: 0; font-weight: 600; }
.pd-alt { font-size: .7rem; color: var(--bs-secondary-color, #6c757d); text-align: center; }

/* Everything lines up: one sweep of light across the strip. */
.pd-all::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, rgba(34, 197, 94, .18) 50%, transparent 70%);
    background-size: 250% 100%; animation: pd-sweep 1.4s .5s ease-out both;
}

.pd-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem 0; border-top: 1px solid var(--bs-border-color, #dee2e6); }
.pd-line-label { width: 6.5rem; font-size: .8rem; color: var(--bs-secondary-color, #6c757d); }
.pd-line-text { flex: 1 1 0; min-width: 0; font-size: 1.05rem; font-weight: 600; word-break: break-word; }
.pd-use { white-space: nowrap; }
@media (max-width: 575.98px) { .pd-line-label { width: 100%; } }

.pd-table-wrap { max-height: 28rem; overflow: auto; }
.pd-table-wrap thead th { position: sticky; top: 0; background: var(--bs-body-bg, #fff); }

@keyframes pd-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes pd-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pd-pop { from { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.15); } to { opacity: 1; transform: none; } }
@keyframes pd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pd-sweep { from { background-position: 150% 0; opacity: 1; } to { background-position: -50% 0; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    .pd-col > *, .pd-meter span, .pd-verdict, .pd-all::after, .pd-rosetta { animation: none !important; }
}
