* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (min-width: 768px) and (max-width: 1180px) {
    .modal {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        margin: 5vh auto;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        width: 95%;
        max-width: 43.75rem;
    }

    .modal-body {
        max-height: none;
        overflow-y: visible;
    }

    body,
    html {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #loginModal .modal-content {
        margin: 3vh auto;
        max-height: 90vh;
        overflow-y: auto;
        max-width: 37.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 1rem;
        padding: 0.75rem 0.9375rem;
    }

    .btn {
        min-height: 2.75rem;
        padding: 0 1.25rem;
    }

    .nav-container {
        padding: 0.625rem 1.25rem;
        max-width: 100%;
    }

    .nav-actions {
        gap: 0.75rem;
    }

    .nav-erp-link {
        padding: 0.5rem 1.125rem;
        font-size: 0.8125rem;
    }

    .hero-section {
        height: 17.5rem;
    }

    .categories-grid .category-card {
        min-width: calc(33.333% - 0.875rem);
    }

    .recommend-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .content-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .admin-content {
        padding: 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        position: static;
        height: auto;
    }

    .admin-menu {
        display: flex;
        overflow-x: auto;
        padding: 0.625rem 0.9375rem;
        gap: 0.625rem;
        -webkit-overflow-scrolling: touch;
    }

    .admin-menu li {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0.625rem 0.9375rem;
        border-radius: 0.5rem;
    }

    .admin-content {
        padding: 0.9375rem;
    }

    .user-layout {
        flex-direction: column;
    }

    .user-sidebar {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.875rem;
    }

    .nav-actions {
        gap: 0.9375rem;
    }

    .categories-grid .category-card {
        min-width: calc(33.333% - 0.875rem);
    }

    .recommend-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5625rem;
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5625rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .nav-container {
        padding: 0.625rem 0.75rem;
    }

    .nav-bar {
        margin: 0;
    }

    .logo-wrapper {
        gap: 8px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 100%;
    }

    th, td {
        padding: 0.625rem;
        font-size: 0.8125rem;
    }

    .action-btns {
        flex-wrap: wrap;
    }

    .action-btns .btn {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.9375rem;
    }

    .panel-toolbar {
        flex-wrap: wrap;
    }

    .goods-filter,
    .order-filter,
    .shipping-filter {
        flex-direction: column;
    }

    .goods-filter .search-input,
    .order-filter .search-input,
    .shipping-filter .search-input {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .merchant-stats-grid {
        grid-template-columns: 1fr;
    }

    .logo-text h1 {
        font-size: 1.125rem;
    }

    .logo-text p {
        font-size: 0.6875rem;
    }

    .btn {
        padding: 0 1rem;
        font-size: 0.8125rem;
        height: 2.25rem;
    }

    .panel-header,
    .panel-toolbar {
        padding: 0.9375rem;
    }

    .admin-content {
        padding: 0.625rem;
    }

    .image-upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #detailImageGrid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-section {
        height: 13.75rem;
        margin: 0 0.75rem;
        border-radius: 0.75rem;
    }

    .carousel-slide-title {
        font-size: 0.875rem;
        padding: 0.25rem 0.75rem;
        top: 0.625rem;
    }


    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .categories-section {
        margin-top: -1.875rem;
    }

    .categories-grid {
        gap: 0.75rem;
    }

    .categories-grid .category-card {
        min-width: calc(50% - 0.375rem);
        padding: 1.5625rem 0.9375rem;
    }

    .category-icon {
        width: 4.375rem;
        height: 4.375rem;
        font-size: 1.875rem;
        border-radius: 1rem;
        margin-bottom: 0.9375rem;
    }

    .category-card h3 {
        font-size: 1rem;
    }

    .recommend-card-img {
        height: 9.375rem;
    }

    .office-content h2 {
        font-size: 1.75rem;
    }

    .office-content > p {
        font-size: 1rem;
        margin-bottom: 1.875rem;
    }

    .office-cards {
        gap: 1.25rem;
        flex-direction: column;
        align-items: center;
    }

    .office-card {
        width: 100%;
        max-width: 16.25rem;
        padding: 1.5625rem 1.875rem;
    }

    .office-card i {
        font-size: 2rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5625rem;
    }

    .footer-section h3 {
        font-size: 1rem;
    }

    .footer-links a {
        font-size: 0.875rem;
    }

    .footer-contact-item {
        font-size: 0.875rem;
    }

    .footer-social a {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .nav-actions {
        gap: 0.625rem;
    }

    .nav-erp-link {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .notification-panel {
        width: 18.75rem;
        right: -3.125rem;
    }

    .notification-item {
        padding: 0.75rem 0.9375rem;
        min-height: auto;
        height: auto;
    }

    .notification-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .notification-title {
        font-size: 0.8125rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .notification-text {
        font-size: 0.75rem;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
    }

    .notification-time {
        font-size: 0.6875rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.625rem;
    }

    .nav-container {
        padding: 0.5rem 0.625rem;
    }

    .logo-wrapper {
        gap: 6px;
    }

    .hero-section {
        height: 11.25rem;
        margin: 0 0.5rem;
        border-radius: 0.5rem;
    }

    .hero-title {
        font-size: 1.375rem;
        padding: 0.5rem 1rem;
    }

    .hero-subtitle {
        font-size: 0.8125rem;
    }

    .carousel-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.875rem;
    }

    .carousel-btn.prev {
        left: 0.625rem;
    }

    .carousel-btn.next {
        right: 0.625rem;
    }

    .carousel-dots {
        bottom: 0.9375rem;
    }

    .carousel-dot {
        width: 0.625rem;
        height: 0.625rem;
    }

    .section-title {
        font-size: 1.125rem;
        margin-bottom: 1.5625rem;
    }

    .categories-grid {
        gap: 0.625rem;
    }

    .categories-grid .category-card {
        min-width: calc(50% - 0.3125rem);
        padding: 1.25rem 0.625rem;
    }

    .category-icon {
        width: 3.4375rem;
        height: 3.4375rem;
        font-size: 1.5rem;
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .category-card h3 {
        font-size: 0.875rem;
    }

    .recommended-section {
        padding: 2.5rem 0;
    }

    .recommend-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .recommend-card-img {
        height: 7.5rem;
    }

    .recommend-card-content {
        padding: 0.75rem;
    }

    .recommend-card-title {
        font-size: 0.875rem;
    }

    .recommend-card-price {
        font-size: 1rem;
    }

    .recommend-card-meta {
        font-size: 0.75rem;
    }

    .recommend-card-stats {
        font-size: 0.6875rem;
    }

    .office-section {
        padding: 2.5rem 0;
        margin: 0 0.5rem;
        border-radius: 0.75rem;
    }

    .office-content {
        padding: 2.5rem 0.9375rem;
    }

    .office-content h2 {
        font-size: 1.5rem;
    }

    .office-content > p {
        font-size: 0.875rem;
        margin-bottom: 1.5625rem;
    }

    .office-card {
        padding: 1.25rem 1.5625rem;
        max-width: 15rem;
    }

    .office-card h3 {
        font-size: 1rem;
    }

    .apply-btn {
        padding: 0.75rem 2.1875rem;
        font-size: 1rem;
    }

    .footer {
        padding: 2.5rem 0 1.25rem;
        margin-top: 2.5rem;
    }

    .footer-section h3 {
        font-size: 0.9375rem;
    }

    .footer-links a {
        font-size: 0.8125rem;
    }

    .footer-contact-item {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }

    .footer-social {
        gap: 0.625rem;
    }

    .footer-social a {
        width: 2.125rem;
        height: 2.125rem;
        font-size: 0.875rem;
    }

    .footer-bottom p {
        font-size: 0.75rem;
    }

    .footer-admin-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }

    .logo-image {
        width: 3.125rem;
        height: 3.125rem;
    }

    .logo-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.25rem;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .logo-text p {
        font-size: 0.625rem;
    }

    .login-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .nav-erp-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.6875rem;
    }

    .notification-panel {
        width: 17.5rem;
        right: -5rem;
    }

    .notification-header {
        padding: 0.75rem 0.9375rem;
    }

    .notification-header h3 {
        font-size: 0.875rem;
    }

    .notification-item {
        padding: 0.75rem 0.9375rem;
        min-height: auto;
        height: auto;
    }

    .notification-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1rem;
    }

    .notification-title {
        font-size: 0.8125rem;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .notification-text {
        font-size: 0.75rem;
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
    }

    .notification-time {
        font-size: 0.6875rem;
    }

    .modal-content {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }

    .modal-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.9375rem;
    }

    .modal-header h3 {
        font-size: 0.9375rem;
    }

    .form-group {
        margin-bottom: 0.9375rem;
    }

    .form-group label {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }

    .main-content {
        padding: 0;
    }

    .page-header {
        padding: 0 1.25rem;
        height: 6.25rem;
        margin: 0.9375rem 0.9375rem 1.25rem 0.9375rem;
        border-radius: 0.75rem;
    }

    .page-header .container {
        padding: 0;
        margin: 0;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-content {
        padding: 0 0.9375rem;
    }

    .page-content .container {
        padding: 0;
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .filter-bar {
        padding: 0.9375rem;
        margin-bottom: 1.25rem;
    }

    .card-content {
        padding: 0.9375rem;
    }

    .card-title {
        font-size: 0.875rem;
    }

    .card-price {
        font-size: 1.125rem;
    }
}

@media (max-width: 360px) {
    .logo-image {
        width: 2.5rem;
        height: 2.5rem;
    }

    .logo-text h1 {
        font-size: 0.875rem;
    }

    .logo-text p {
        font-size: 0.5625rem;
    }

    .mobile-menu-toggle {
        width: 2.375rem;
        height: 2.375rem;
    }

    .category-card {
        padding: 0.9375rem 0.5rem;
    }

    .category-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .hero-title {
        font-size: 1.125rem;
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .nav-erp-link {
        padding: 0.3125rem 0.625rem;
        font-size: 0.625rem;
    }

    .notification-panel {
        width: 16.25rem;
        right: -6.25rem;
    }

    .notification-item {
        padding: 0.75rem 0.9375rem;
        min-height: auto;
        height: auto;
    }

    .notification-title {
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .notification-text {
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        overflow: visible;
    }
}

@media (min-width: 1600px) {
    .container,
    .nav-container {
        max-width: 93.75rem;
    }

    .categories-grid,
    .recommend-grid,
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1920px) {
    .container,
    .nav-container {
        max-width: 112.5rem;
    }

    .categories-grid,
    .recommend-grid,
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}
