:root {
    --ac-primary: #1d4ed8;
    --ac-secondary: #111827;
    --ac-muted: #6b7280;
    --ac-bg: #f9fafb;
    --ac-card: #ffffff;
    --ac-border: #e5e7eb;
}

.academic-page {
    font-family: "Inter", "Poppins", Arial, sans-serif;
    background: var(--ac-bg);
}

.academic-page h1,
.academic-page h2,
.academic-page h3 {
    color: var(--ac-secondary);
}

.academic-page p {
    color: var(--ac-muted);
    line-height: 1.6;
}

.academic-page .rb-card {
    border: 1px solid var(--ac-border);
    background: var(--ac-card);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.academic-page .rb-card h3 {
    margin: 0 0 6px;
}

.academic-page .rb-card p {
    margin: 0;
    font-size: 0.95rem;
}
.academic-page .ac-repo-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 16px;
}
.academic-page .ac-repo-meta span {
    background: #e0f2fe;
    color: #0f766e;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}
.academic-page .ac-repo-sample {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 6px;
    color: #374151;
    font-size: 0.88rem;
}
.academic-page .ac-repo-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.academic-page .ac-repo-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}
.academic-page .ac-repo-card p {
    margin: 0 0 6px;
    color: #4b5563;
    font-size: 0.9rem;
}
.academic-page .ac-repo-link {
    display: inline-block;
    margin-top: 8px;
    background: #0f766e;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
}
.academic-page .ac-repo-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}
.academic-page .ac-repo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.12);
}
.academic-page .ac-repo-card h3 {
    color: #0f766e;
    line-height: 1.3;
}
.academic-page .ac-repo-meta {
    margin-bottom: 14px;
}
.academic-page .rb-repo-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}
.academic-page .rb-repo-pagination a {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: #374151;
    background: #ffffff;
    font-size: 0.9rem;
}
.academic-page .rb-repo-pagination a.active {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}
.academic-page .rb-repo-pagination .nav {
    background: #f9fafb;
    font-weight: 600;
}
.academic-page .rb-repo-pagination .dots {
    padding: 6px 6px;
    color: #9ca3af;
}

.academic-page .rb-section h2 {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 12px;
}

.academic-page .rb-hero {
    background: #fff;
    border: 1px solid var(--ac-border);
    border-radius: 16px;
    padding: 20px;
}

.academic-page .rb-hero h1 {
    margin-top: 0;
}

.academic-page .ac-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.academic-page .ac-meta span {
    background: #e0e7ff;
    color: #1e3a8a;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.academic-page .rb-hero {
    background: #fff7ed;
    border: 2px dashed #fed7aa;
}

.academic-page .rb-card {
    border: 2px solid #fde68a;
    background: #fff;
}

.ac-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ac-tab-btn {
    border: 1px solid var(--ac-border);
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.ac-tab-btn.active {
    background: #e0e7ff;
    border-color: #c7d2fe;
    color: #1e3a8a;
    font-weight: 600;
}

.ac-tab-panel {
    display: none;
}

.ac-tab-panel.active {
    display: block;
}

.ac-math-card {
    border: 1px solid var(--ac-border);
    border-radius: 12px;
    padding: 12px;
}

.ac-math-sum {
    background: #e0f2fe;
}

.ac-math-sub {
    background: #fef9c3;
}

.ac-math-row {
    margin: 6px 0;
    font-size: 0.95rem;
}

.ac-write-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ac-write-tools button,
.ac-write-tools input[type="color"] {
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--ac-border);
    padding: 0 12px;
    background: #fff;
    cursor: pointer;
}

.ac-write-stage {
    position: relative;
    width: 100%;
    height: 320px;
    border: 2px dashed var(--ac-border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    touch-action: none;
}

.ac-write-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

@media (max-width: 768px) {
    .academic-page .rb-hero {
        padding: 16px;
    }
}
