@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Noto+Sans+SC:wght@400;500;700;800&display=swap');

:root {
    --brand-blue: #2b6de9;
    --brand-deep: #0f4da6;
    --brand-cyan: #68d2ff;
    --ink-main: #1f2a3a;
    --ink-soft: #5a6b83;
    --surface-soft: #f5f7fb;
    --line-soft: rgba(43, 109, 233, 0.14);
    --line-soft-strong: rgba(43, 109, 233, 0.22);
    --card-shadow: 0 6px 16px rgba(14, 34, 66, 0.08);
    --card-shadow-strong: 0 12px 28px rgba(14, 34, 66, 0.14);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-pill: 999px;
    --space-section: 52px;
    --space-section-mobile: 40px;
    --title-color: #1d3357;
    --transition-normal: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    --motion-fast: 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
    --motion-soft: 360ms cubic-bezier(0.22, 0.61, 0.36, 1);
    --text-base: 16px;
    --text-reading: 15px;
    --text-reading-mobile: 14px;
    --text-reading-small: 13px;
}

html,
body {
    scroll-behavior: smooth;
    overflow-x: clip;
    overscroll-behavior-x: none;
}

body {
    font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: var(--text-base);
    line-height: 1.68;
    color: var(--ink-main);
    background:
        radial-gradient(circle at 84% -14%, rgba(124, 211, 255, 0.18), transparent 34%),
        radial-gradient(circle at 8% 22%, rgba(43, 109, 233, 0.1), transparent 30%),
        var(--surface-soft);
}

a,
button,
[role="button"],
.btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

main.container,
.navbar .container,
footer .container {
    max-width: 1240px;
}

main.container {
    padding-left: 20px;
    padding-right: 20px;
}

.navbar {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 1px solid rgba(43, 109, 233, 0.1);
    box-shadow: 0 10px 26px rgba(14, 33, 61, 0.1);
    transition:
        background-color var(--motion-fast),
        box-shadow var(--motion-fast),
        border-color var(--motion-fast);
    backdrop-filter: saturate(140%) blur(6px);
    -webkit-backdrop-filter: saturate(140%) blur(6px);
}

.navbar-brand {
    font-family: 'Barlow Condensed', 'Noto Sans SC', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 0.03em;
    font-weight: 700;
    color: #102c58;
}

.navbar-brand:hover {
    color: var(--brand-deep);
}

.nav-link {
    color: #3f5068 !important;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.52rem 0.98rem;
    transition: var(--transition-normal);
}

.nav-link:after {
    display: none;
}

.nav-link:hover,
.nav-link.active {
    color: var(--brand-deep) !important;
    background: rgba(43, 109, 233, 0.1);
    border-color: rgba(43, 109, 233, 0.14);
}

.btn {
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.56rem 1.16rem;
    transition:
        transform var(--motion-fast),
        box-shadow var(--motion-fast),
        background-color var(--motion-fast),
        border-color var(--motion-fast);
}

@keyframes checkin-breath {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-1px) scale(1.012);
    }
}

.checkin-btn:not(:disabled) {
    animation: checkin-breath 2.6s ease-in-out infinite;
}

.checkin-btn {
    transition:
        transform var(--motion-fast),
        box-shadow var(--motion-fast),
        background-color var(--motion-fast),
        border-color var(--motion-fast) !important;
}

.checkin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:after {
    display: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(14, 34, 66, 0.14);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.page-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.22rem rgba(43, 109, 233, 0.2);
}

.btn-primary {
    background: linear-gradient(140deg, #2b6de9 0%, #1f62dd 100%);
    border: 1px solid transparent;
}

.btn-primary:hover {
    background: linear-gradient(140deg, #245fc7 0%, #1954c4 100%);
}

.btn-outline-primary {
    border-color: rgba(43, 109, 233, 0.32);
    color: var(--brand-blue);
    background: rgba(255, 255, 255, 0.88);
}

.btn-outline-primary:hover {
    color: var(--brand-deep);
    border-color: rgba(43, 109, 233, 0.42);
    background: rgba(43, 109, 233, 0.1);
}

.btn-light {
    background: linear-gradient(180deg, #ffffff 0%, #f2f8ff 100%);
    color: #134b99;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.58);
    background: rgba(8, 31, 66, 0.2);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.14);
}

.hero-section,
.category-header,
.search-header,
.resource-header,
.upload-header {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 32px 32px;
    margin-bottom: 36px;
    box-shadow: 0 14px 34px rgba(13, 31, 60, 0.18);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.24), transparent 34%),
        radial-gradient(circle at 80% -8%, rgba(120, 212, 255, 0.18), transparent 38%),
        linear-gradient(138deg, #0c428f 0%, #2b6de9 50%, #2f8ee7 100%);
    color: #ffffff;
}

.hero-section::before,
.category-header::before,
.search-header::before,
.resource-header::before,
.upload-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.14;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 44px 44px;
}

.hero-section > .container,
.category-header > .container,
.search-header > .container,
.resource-header > .container,
.upload-header > .container {
    position: relative;
    z-index: 1;
}

.category-header,
.search-header,
.upload-header {
    padding: 72px 0 88px;
    min-height: 248px;
}

.resource-header {
    padding: 76px 0 82px;
}

.resource-header h1,
.search-header h1,
.category-header h1,
.upload-header h1 {
    font-family: 'Barlow Condensed', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    line-height: 1.14;
}

.hero-section p,
.category-header p,
.search-header p,
.resource-header p,
.upload-header p {
    position: relative;
    z-index: 2;
    color: rgba(235, 244, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.62;
    margin-top: 0;
    margin-bottom: 0;
}

.hero-section .sign-in-section {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(43, 109, 233, 0.14);
    box-shadow: var(--card-shadow);
}

.hero-section .sign-in-section h4,
.hero-section .sign-in-section h2 {
    color: #1d3354;
}

.hero-section .sign-in-section p,
.hero-section .sign-in-section .small {
    color: #60728e;
}

.hero-section .sign-in-section a:not(.btn) {
    color: var(--brand-blue);
    font-weight: 600;
}

section {
    margin-bottom: var(--space-section);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--title-color);
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.search-box,
.filters-card,
.resource-card,
.category-card,
.upload-form-container,
.form-section,
.uploader-card,
.ratings-card,
.comments-card,
.resource-preview,
.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-soft);
    box-shadow: var(--card-shadow);
    background: #ffffff;
}

.filters-card,
.search-box,
.form-section,
.resource-preview,
.uploader-card,
.ratings-card,
.comments-card,
.card {
    transition: var(--transition-normal);
}

.filters-card:hover,
.search-box:hover,
.form-section:hover,
.resource-preview:hover,
.uploader-card:hover,
.ratings-card:hover,
.comments-card:hover,
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-strong);
}

.filter-title,
.section-title,
.form-section h4,
.card-header {
    font-family: 'Barlow Condensed', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.03em;
}

.section-title {
    line-height: 1.14;
}

.filter-title,
.card-header {
    background: linear-gradient(135deg, #1f62dd 0%, #318cf0 100%);
    color: #ffffff;
}

.search-box .form-control,
.form-control,
.input-group-text,
.tags-input,
.drop-area,
.dropdown-menu,
.pagination .page-link,
.filter-option,
.tag,
.category-option label {
    border-radius: var(--radius-md);
}

.form-control,
.form-select,
.input-group-text,
.tags-input,
.drop-area {
    border-color: var(--line-soft-strong);
}

.form-control:focus,
.form-select:focus,
.search-box .form-control:focus,
.tags-input:focus-within,
.drop-area.highlight {
    border-color: rgba(43, 109, 233, 0.46);
    box-shadow: 0 0 0 0.2rem rgba(43, 109, 233, 0.16);
}

.category-card,
.resource-card {
    overflow: hidden;
}

.hero-section::before,
.category-header::before,
.search-header::before,
.resource-header::before,
.upload-header::before,
.profile-header::before {
    animation: none !important;
}

.category-card .card-body {
    height: auto;
    min-height: 0;
}

.category-card .card-body > p:first-of-type {
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card .card-body > .text-muted {
    font-size: 13px;
    margin-bottom: 0.35rem !important;
}

.category-card:hover,
.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-strong);
    border-color: var(--line-soft-strong);
}

body.is-scrolling .category-card,
body.is-scrolling .resource-card {
    transition: none !important;
    transform: none !important;
}

body.is-scrolling .category-card:hover,
body.is-scrolling .resource-card:hover {
    box-shadow: var(--card-shadow);
    border-color: var(--line-soft);
    transform: none;
}

body.is-scrolling .navbar {
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 6px 18px rgba(14, 33, 61, 0.08);
}

body.is-scrolling .checkin-btn:not(:disabled) {
    animation-play-state: paused;
}

.category-card .card-header {
    padding: 16px 18px;
    font-weight: 600;
}

.category-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(43, 109, 233, 0.12);
    color: var(--brand-deep);
    font-size: 26px;
}

.resource-card .card-img-top {
    height: 194px;
    object-fit: cover;
}

.resource-card .card-body {
    padding: 20px;
    border-top: 1px solid rgba(20, 55, 103, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-card .card-title,
.related-resource-title {
    font-size: 18px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #24364f;
}

.resource-card .card-title a,
.related-resource-title a {
    color: #24364f;
    transition: var(--transition-normal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card .card-title a:hover,
.related-resource-title a:hover {
    color: var(--brand-blue);
}

.resource-card .card-text {
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-card .card-text,
.resource-info,
.comment-content,
.form-text,
.small,
small,
p {
    color: var(--ink-soft);
    font-size: var(--text-reading);
    line-height: 1.72;
}

.resource-meta {
    color: #7e8fa6;
    font-size: 12px;
    padding-top: 6px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.resource-meta > div {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.resource-meta i {
    margin-right: 4px;
    opacity: 0.9;
}

.resource-rating {
    letter-spacing: 0.04em;
}

.badge {
    border-radius: 999px;
    padding: 0.45em 0.75em;
    font-weight: 600;
}

.pagination .page-link {
    border: 1px solid rgba(43, 109, 233, 0.2);
    color: #2a4e7e;
    padding: 0.5rem 0.82rem;
}

.pagination .page-link:hover {
    background: rgba(43, 109, 233, 0.1);
    border-color: rgba(43, 109, 233, 0.34);
    color: var(--brand-deep);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(140deg, #2b6de9 0%, #1f62dd 100%);
    border-color: transparent;
}

.filter-option,
.tag,
.category-option label {
    border: 1px solid var(--line-soft);
    background: #ffffff;
    transition: var(--transition-normal);
}

.search-box {
    padding: 14px;
}

.filters-card {
    border-radius: 20px;
}

.filter-option {
    font-size: 14px;
    line-height: 1.55;
    padding: 0.58rem 0.72rem;
}

.filter-option:hover,
.filter-option.active,
.tag:hover,
.category-option label:hover,
.category-option input[type='radio']:checked + label {
    border-color: rgba(43, 109, 233, 0.28);
    background: rgba(43, 109, 233, 0.08);
    color: var(--brand-deep);
}

.category-option input[type='radio']:checked + label .category-icon,
.category-option label:hover .category-icon {
    background: rgba(43, 109, 233, 0.2);
}

.drop-area {
    background: linear-gradient(180deg, #f7f9ff 0%, #f0f5ff 100%);
}

.drop-area:hover,
.drop-area.highlight {
    background: linear-gradient(180deg, #f3f7ff 0%, #eaf2ff 100%);
}

.file-info {
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: #f8fbff;
}

.comment {
    border: 1px solid rgba(43, 109, 233, 0.14);
    border-radius: 16px;
    padding: 16px;
    background: #ffffff;
}

.comment-reply {
    border-left: 3px solid rgba(43, 109, 233, 0.26);
    border-radius: 0 14px 14px 0;
    background: #f8fbff;
}

.related-resource {
    border-radius: 15px;
    border: 1px solid var(--line-soft);
    background: #ffffff;
}

.dropdown-menu {
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    box-shadow: 0 14px 30px rgba(18, 40, 73, 0.14);
}

.dropdown-item {
    border-radius: 10px;
}

.dropdown-item:hover {
    background: rgba(43, 109, 233, 0.08);
    color: var(--brand-deep);
}

.filter-option:active {
    transform: scale(0.992);
}

.profile-header {
    padding: 74px 0 82px;
    min-height: 242px;
}

.profile-header .container {
    position: relative;
    z-index: 1;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    margin-right: 18px;
    color: #144b98;
    background: linear-gradient(180deg, #ffffff 0%, #edf5ff 100%);
    border: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: 0 14px 26px rgba(7, 28, 59, 0.18);
}

.profile-info h1 {
    margin: 0 0 8px;
    font-size: clamp(2rem, 4vw, 2.65rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.profile-meta {
    color: rgba(237, 245, 255, 0.9);
    font-size: 0.98rem;
    line-height: 1.65;
}

.sidebar-nav {
    border-radius: 22px;
    border: 1px solid var(--line-soft);
    box-shadow: var(--card-shadow);
    background: #ffffff;
    overflow: hidden;
}

.sidebar-nav .nav-link {
    margin: 0;
    border-radius: 0;
    border: 0;
    border-left: 3px solid transparent;
    color: #4b5f7d !important;
    padding: 13px 18px;
}

.sidebar-nav .nav-link:hover {
    transform: none;
    background: rgba(43, 109, 233, 0.06);
    border-left-color: rgba(43, 109, 233, 0.28);
}

.sidebar-nav .nav-link.active {
    background: rgba(43, 109, 233, 0.1);
    border-left-color: var(--brand-blue);
    color: var(--brand-deep) !important;
}

.content-card {
    border-radius: 22px;
    border: 1px solid var(--line-soft);
    box-shadow: var(--card-shadow);
    background: #ffffff;
}

.content-title {
    color: #1f3558;
    font-size: 1.45rem;
    line-height: 1.22;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(43, 109, 233, 0.12);
}

.content-title::after {
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-cyan));
}

.stats-grid {
    gap: 14px;
}

.stat-card {
    border-radius: 16px;
    border: 1px solid rgba(43, 109, 233, 0.14);
    background: linear-gradient(180deg, #f8fbff 0%, #f3f8ff 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 26px rgba(16, 43, 83, 0.12);
}

.stat-value {
    color: var(--brand-blue);
}

.stat-label {
    color: #627492;
}

.calendar {
    border-radius: 18px;
    border: 1px solid var(--line-soft);
    box-shadow: var(--card-shadow);
}

.day.checked {
    background: rgba(43, 109, 233, 0.14);
    color: var(--brand-deep);
}

.login-container {
    margin: 92px auto;
    max-width: 470px;
    border-radius: 24px;
    border: 1px solid var(--line-soft);
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.97);
    padding: 34px 32px;
}

.logo-container {
    margin-bottom: 24px;
}

.logo-text {
    font-family: 'Barlow Condensed', 'Noto Sans SC', sans-serif;
    letter-spacing: 0.02em;
    font-size: 2rem;
    color: #113765;
    margin-bottom: 6px;
}

.logo-container p {
    color: #60728e;
    margin-bottom: 0;
}

.upload-btn {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(145deg, #2b6de9 0%, #1d5bd3 100%);
    box-shadow: 0 14px 28px rgba(17, 45, 88, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.upload-btn:hover {
    background: linear-gradient(145deg, #245ec4 0%, #194ebd 100%);
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 20px 34px rgba(17, 45, 88, 0.32);
}

.loading-spinner,
.spinner-border {
    border-right-color: var(--brand-blue) !important;
}

footer {
    margin-top: 68px;
    padding: 52px 0 34px;
    background: #0f1a2b;
    color: #d7e5f8;
}

footer:before {
    display: none;
}

.footer-links a {
    color: #c7d6eb;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

.footer-links a:after {
    background: rgba(255, 255, 255, 0.9);
}

.copyright {
    color: #9ab0ce;
    margin-top: 24px;
}

.page-actions {
    margin-bottom: 26px !important;
}

.page-actions .btn {
    min-width: 152px;
}

.mobile-app-tabbar {
    display: none;
}

@media (max-width: 900px) {
    body.mobile-shell-enabled .hero-section .col-lg-7,
    body.mobile-shell-enabled .hero-section .col-lg-5,
    body.mobile-shell-enabled .hero-section .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    body.mobile-shell-enabled .hero-section .sign-in-section {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 10px !important;
    }

    body.mobile-shell-enabled .upload-btn {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-section .sign-in-section,
    .category-card,
    .resource-card {
        animation: none !important;
    }

    .fade-in {
        animation: none !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: translateY(1px) scale(0.985);
        box-shadow: 0 8px 16px rgba(14, 34, 66, 0.12);
    }

    .nav-link:active {
        background: rgba(43, 109, 233, 0.14);
        border-color: rgba(43, 109, 233, 0.2);
    }

    .category-card:active,
    .resource-card:active {
        transform: translateY(-1px) scale(0.996);
        box-shadow: 0 12px 24px rgba(14, 34, 66, 0.14);
    }
}

@media (max-width: 991px) {
    .hero-section,
    .category-header,
    .search-header,
    .resource-header,
    .upload-header {
        padding-top: 66px;
        padding-bottom: 78px;
        min-height: 214px;
        border-radius: 0 0 26px 26px;
        margin-bottom: 24px;
    }

    .resource-card .card-img-top {
        height: 176px;
    }

    .profile-header {
        padding: 64px 0 74px;
        min-height: 0;
    }

    .navbar-toggler {
        border-radius: 12px;
        border: 1px solid rgba(43, 109, 233, 0.26);
        padding: 0.35rem 0.58rem;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.18rem rgba(43, 109, 233, 0.24);
    }

    .navbar-collapse {
        margin-top: 10px;
        padding: 12px;
        border-radius: 16px;
        border: 1px solid var(--line-soft);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 12px 26px rgba(15, 34, 63, 0.11);
    }

    .navbar-collapse .navbar-nav {
        gap: 4px;
    }

    .navbar-collapse .d-flex.align-items-center {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
        margin-top: 8px;
    }

    .navbar-collapse .user-menu,
    .navbar-collapse .login-buttons {
        width: 100%;
    }

    .navbar-collapse .login-buttons {
        display: flex;
        gap: 8px;
    }

    .navbar-collapse .login-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    body.mobile-shell-enabled {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled .navbar {
        display: none !important;
    }

    body.mobile-shell-enabled main {
        padding-top: 0 !important;
    }

    body.mobile-shell-enabled.mobile-embedded-app .navbar {
        display: none !important;
    }

    body.mobile-shell-enabled.mobile-embedded-app main {
        padding-top: 0 !important;
    }

    body.mobile-shell-enabled.mobile-embedded-app .hero-section,
    body.mobile-shell-enabled.mobile-embedded-app .category-header,
    body.mobile-shell-enabled.mobile-embedded-app .search-header,
    body.mobile-shell-enabled.mobile-embedded-app .resource-header,
    body.mobile-shell-enabled.mobile-embedded-app .upload-header,
    body.mobile-shell-enabled.mobile-embedded-app .profile-header {
        padding-top: calc(22px + env(safe-area-inset-top));
    }

    body.mobile-shell-enabled .hero-section,
    body.mobile-shell-enabled .category-header,
    body.mobile-shell-enabled .search-header,
    body.mobile-shell-enabled .resource-header,
    body.mobile-shell-enabled .upload-header,
    body.mobile-shell-enabled .profile-header {
        height: auto !important;
        min-height: max-content !important;
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell {
        padding-bottom: calc(82px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-shell-keyboard-open {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    main.container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .nav-link {
        margin: 2px 0;
        font-size: 14px;
        padding: 0.48rem 0.82rem;
    }

    .hero-section,
    .category-header,
    .search-header,
    .resource-header,
    .upload-header {
        padding-top: 56px;
        padding-bottom: 98px;
        min-height: 0;
        border-radius: 0 0 22px 22px;
    }

    .hero-section {
        overflow-x: clip;
        overflow-y: visible;
    }

    .profile-header {
        padding: 56px 0 66px;
        min-height: 0;
        border-radius: 0 0 22px 22px;
    }

    .profile-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        border-radius: 20px;
        font-size: 28px;
        margin-right: 0;
    }

    .profile-meta span {
        display: block;
        margin-right: 0 !important;
    }

    .hero-section h1,
    .category-header h1,
    .search-header h1,
    .resource-header h1,
    .upload-header h1 {
        margin-bottom: 6px;
        font-size: clamp(1.8rem, 8.2vw, 2.25rem);
        line-height: 1.15;
    }

    .content-title {
        font-size: 1.3rem;
    }

    .search-box {
        padding: 12px;
        border-radius: 16px;
    }

    .filters-card {
        border-radius: 16px;
    }

    .filter-title {
        font-size: 1.02rem;
    }

    .filter-option {
        font-size: 13px;
        padding: 0.54rem 0.64rem;
    }

    .sidebar-nav .nav-link {
        padding: 11px 14px;
    }

    .content-card {
        border-radius: 16px;
        padding: 16px;
    }

    .pagination {
        gap: 6px;
        flex-wrap: wrap;
    }

    .pagination .page-link {
        padding: 0.42rem 0.72rem;
    }

    .login-container {
        margin: 26px auto 34px;
        padding: 28px 22px;
        border-radius: 20px;
    }

    .hero-section .d-flex {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .hero-section .btn-lg {
        width: 100%;
        margin-right: 0 !important;
    }

    .hero-section .lead {
        max-width: none;
        font-size: 0.98rem;
        line-height: 1.62;
        margin-bottom: 14px !important;
    }

    .resource-card .card-text,
    .resource-info,
    .comment-content,
    .form-text,
    .small,
    small,
    p {
        font-size: var(--text-reading-mobile);
    }

    .hero-section .sign-in-section {
        margin-top: 8px;
        margin-bottom: 0;
        padding: 20px 16px;
        border-radius: 18px;
    }

    .category-card {
        height: auto;
    }

    .category-card .card-body {
        height: auto;
        gap: 8px;
        padding: 18px 15px;
    }

    .category-icon {
        width: 58px;
        height: 58px;
        border-radius: 16px;
        font-size: 24px;
        margin-bottom: 8px;
    }

    .latest-resources .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    .latest-resources .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        width: 100%;
    }

    .checkin-btn {
        width: 100%;
    }

    section {
        margin-bottom: var(--space-section-mobile);
    }

    .category-card .card-body,
    .resource-card .card-body {
        padding: 18px 16px;
        gap: 8px;
    }

    .resource-card .card-img-top {
        height: 168px;
    }

    .page-actions .btn {
        min-width: 0;
        width: 100%;
    }

    .upload-btn {
        width: 54px;
        height: 54px;
        border-radius: 16px;
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled .upload-btn {
        bottom: calc(82px + env(safe-area-inset-bottom));
    }

    .mobile-app-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-radius: 18px 18px 0 0;
        border: 1px solid rgba(43, 109, 233, 0.2);
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 -8px 24px rgba(14, 34, 66, 0.16);
        backdrop-filter: blur(9px);
        -webkit-backdrop-filter: blur(9px);
        z-index: 1190;
        transition:
            transform var(--motion-fast),
            opacity var(--motion-fast),
            box-shadow var(--motion-fast);
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell .mobile-app-tabbar {
        bottom: 0;
    }

    body.mobile-shell-enabled.mobile-embedded-app .mobile-app-tabbar {
        bottom: 0;
    }

    .mobile-app-tabbar .mobile-tab-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 54px;
        text-decoration: none;
        color: #60708a;
        border-radius: 12px;
        border: 1px solid transparent;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.01em;
        transition: var(--transition-normal);
    }

    .mobile-app-tabbar .mobile-tab-link i {
        font-size: 17px;
        line-height: 1;
    }

    .mobile-app-tabbar .mobile-tab-link.active {
        color: var(--brand-deep);
        background: rgba(43, 109, 233, 0.14);
        border-color: rgba(43, 109, 233, 0.18);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34);
    }

    body.mobile-shell-keyboard-open .mobile-app-tabbar {
        transform: translateY(calc(100% + 24px));
        opacity: 0;
        pointer-events: none;
        box-shadow: none;
    }

    body.mobile-shell-keyboard-open .upload-btn {
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell .upload-btn {
        bottom: calc(82px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-embedded-app .upload-btn {
        bottom: calc(82px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell.mobile-shell-keyboard-open .upload-btn {
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    footer {
        margin-top: 48px;
        padding-top: 42px;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px 14px;
    }

    .footer-links a {
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    main.container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero-section,
    .category-header,
    .search-header,
    .resource-header,
    .upload-header {
        padding-top: 52px;
        padding-bottom: 92px;
        border-radius: 0 0 20px 20px;
    }

    .hero-section h1,
    .category-header h1,
    .search-header h1,
    .resource-header h1,
    .upload-header h1 {
        font-size: clamp(1.62rem, 8.8vw, 2rem);
        line-height: 1.18;
    }

    .hero-section .lead {
        font-size: 0.92rem;
        line-height: 1.56;
    }

    .filter-title {
        font-size: 0.96rem;
    }

    .filter-option {
        font-size: 12px;
        padding: 0.48rem 0.58rem;
    }

    .content-title {
        font-size: 1.16rem;
        margin-bottom: 14px;
    }

    .resource-card .card-text,
    .resource-info,
    .comment-content,
    .form-text,
    .small,
    small,
    p {
        font-size: var(--text-reading-small);
    }

    .resource-meta {
        gap: 8px;
        font-size: 11px;
        padding-top: 4px;
    }

    .hero-section .sign-in-section {
        margin-top: 6px;
        padding: 18px 14px;
    }

    .category-card .card-body {
        padding: 16px 14px;
    }

    .category-icon {
        width: 54px;
        height: 54px;
        border-radius: 14px;
        font-size: 22px;
    }

    .section-title {
        font-size: clamp(1.46rem, 7.6vw, 1.82rem);
    }

    .resource-card .card-title,
    .related-resource-title {
        font-size: 16px;
    }

    .upload-btn {
        width: 48px;
        height: 48px;
        border-radius: 13px;
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled .upload-btn {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell .upload-btn {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-enabled.mobile-embedded-app .upload-btn {
        bottom: calc(76px + env(safe-area-inset-bottom));
    }

    body.mobile-shell-keyboard-open .upload-btn {
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .mobile-app-tabbar {
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        bottom: 0;
        gap: 6px;
        padding: 7px 8px calc(8px + env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
    }

    body.mobile-shell-enabled.mobile-ios-browser-shell .mobile-app-tabbar {
        bottom: 0;
    }

    body.mobile-shell-enabled.mobile-embedded-app .mobile-app-tabbar {
        bottom: 0;
    }

    body.mobile-shell-enabled.mobile-embedded-app .hero-section,
    body.mobile-shell-enabled.mobile-embedded-app .category-header,
    body.mobile-shell-enabled.mobile-embedded-app .search-header,
    body.mobile-shell-enabled.mobile-embedded-app .resource-header,
    body.mobile-shell-enabled.mobile-embedded-app .upload-header,
    body.mobile-shell-enabled.mobile-embedded-app .profile-header {
        padding-top: calc(18px + env(safe-area-inset-top));
    }

    .mobile-app-tabbar .mobile-tab-link {
        min-height: 50px;
        font-size: 10px;
    }

    .mobile-app-tabbar .mobile-tab-link i {
        font-size: 16px;
    }
}
