/* themes/light.css */

:root {
    --bg: #ffffff;
    --card: #f7f9fc;
    --text: #1f2937;
    --muted: #6b7280;
    --border: rgba(0, 0, 0, 0.08);
    --accent: #2563eb;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system,
    Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.45;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 18px 60px;
}

header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

h1 {
    font-size: 28px;
    margin: 0;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 22px;
}

.stat {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
}

.stat .label {
    color: var(--muted);
    font-size: 12px;
}

.stat .value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 6px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.grid > * {
    min-width: 0;
}

.card {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 16px;
    padding: 14px;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

@media (max-width: 860px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.card h2 {
    font-size: 18px;
    margin: 0;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.plot-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.plot-frame {
    width: 100%;
    min-width: 0;
    min-height: 700px;
    border: 0;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 520px) {
    .plot-frame {
        height: 560px !important;
        min-height: 200px !important;
    }
}

@media (max-width: 375px) {
    .plot-frame {
        height: 480px !important;
        min-height: 200px !important;
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 720px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
    border-top: 1px solid var(--border);
    padding: 10px;
    vertical-align: top;
}

.table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    border-top: 0;
}

.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--accent);
    font-size: 12px;
    margin-left: 8px;
}

@media (max-width: 375px) {
    .pill {
        font-size: 10.5px;
        margin-left: 5px;
    }
}


.cluster-block {
    margin-top: 14px;
}

.cluster-title {
    margin: 10px 0 8px;
    font-size: 16px;
}

/* Collapsible details card */
.details-card {
    margin: 14px 0 22px 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.details-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    user-select: none;
}

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

.details-title {
    font-weight: 700;
}

.details-hint {
    color: rgba(0, 0, 0, 0.55);
    font-size: 13px;
}

/* "+" icon on the right */
.details-summary::after {
    content: "+";
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    opacity: 0.75;
    transform: translateY(1px);
}

.details-card[open] > .details-summary::after {
    content: "–";
}

.details-body {
    padding: 0 16px 16px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
}

.details-block h3 {
    margin: 10px 0 8px;
    font-size: 15px;
}

.small {
    font-size: 12px;
}

/* lists */
.clean-list {
    margin: 6px 0 0;
    padding-left: 18px;
}

.clean-list li {
    margin: 4px 0;
}


/* tag cloud (simple word cloud) */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 10px;
}

.tag {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    line-height: 1;
}

/* Language toggle */
html[data-lang="en"] [lang="zh"] {
    display: none !important;
}

html[data-lang="zh"] [lang="en"] {
    display: none !important;
}

.lang-switch {
    align-self: flex-start;
}

.lang-select {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Top 10% Crossref score highlight */
.top-score-title {
    font-weight: 600;
    padding-left: 0.4em;
    border-left: 3px solid #f59e0b;
}

.top-score-title::before {
    content: "★ ";
    color: #f59e0b;
    font-weight: 700;
}

.legend {
    margin-top: 0.25rem;
    font-size: 0.85em;
}

/* Translation */
.paper-title-zh {
    opacity: 0.8;
    font-size: 0.95em;
    font-style: italic;
}
