*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', 'Montserrat', Arial, sans-serif;
    background-color: #F8FAFC;
    color: #334155;
    font-size: clamp(14px, 1vw, 18px);
    line-height: 1.6;
}

h1 { font-size: clamp(1.8rem, 2.5vw, 2.8rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2vw, 2.2rem); font-weight: 700; }
h3 { font-size: clamp(1.25rem, 1.5vw, 1.65rem); font-weight: 600; }
h4 { font-size: clamp(1.1rem, 1.2vw, 1.4rem); font-weight: 600; }
h5, h6 { font-size: clamp(1rem, 1vw, 1.15rem); }

p { font-size: clamp(0.85rem, 1.1vw, 1.1rem); color: var(--text-light); }
a { font-size: clamp(1rem, 1vw, 1.1rem); }
span { font-size: clamp(1rem, 1vw, 1.1rem); }

@media (min-width: 1921px) {
    body {
        font-size: clamp(16px, 0.9vw, 20px);
        line-height: 1.7;
    }
    
    h1 { font-size: clamp(1.8rem, 2.5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 2vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 1.5vw, 1.6rem); }
    h4 { font-size: clamp(1.1rem, 1.2vw, 1.4rem); }
}

@media (min-width: 2561px) {
    body {
        font-size: clamp(16px, 0.9vw, 20px);
        line-height: 1.7;
    }
    
    h1 { font-size: clamp(2rem, 2.8vw, 3rem); }
    h2 { font-size: clamp(1.6rem, 2.2vw, 2.4rem); }
    h3 { font-size: clamp(1.35rem, 1.6vw, 1.8rem); }
    h4 { font-size: clamp(1.15rem, 1.3vw, 1.5rem); }
    
    p { font-size: clamp(1rem, 1.1vw, 1.5rem)!important; }
    a { font-size: clamp(1rem, 1vw, 1.5rem) !important; }
    span { font-size: clamp(1rem, 1vw, 1.5rem)!important; }
}

.container {
    width: 92%;
    max-width: 1600px;
    margin: 0 auto;
    padding-left: clamp(12px, 1.2vw, 24px);
    padding-right: clamp(12px, 1.2vw, 24px);
}

@media (min-width: 1200px) {
    .container {
        width: 100%;
    }
}

@media (min-width: 2000px) {
    .container {
        max-width: 1600px;
    }
}

@media (min-width: 2700px) {
    .container {
        max-width: 2400px;
    }
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.product-detail-card, .article-card, .search-content-card, .form-card {
    padding: clamp(16px, 3vw, 40px) !important;
}

.sticky-top, .sticky-sidebar {
    top: clamp(76px, 9vh, 110px) !important;
}

@media (max-width: 991.98px) {
    h1 { font-size: clamp(1.5rem, 6vw, 2rem)!important; }
    h2 { font-size: clamp(1.25rem, 5vw, 1.7rem)!important; }
    h3 { font-size: clamp(1.1rem, 4.5vw, 1.35rem)!important; }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination a, .pagination span {
        padding: 8px 12px !important;
    }
}

#mytable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
    box-shadow: var(--shadow-sm);
}

#mytable thead th {
    background-color: #F8FAFC;
    color: #475569;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid var(--tb-border-color);
    border-right: 1px solid var(--tb-border-color);
    font-size: 14px;
    text-align: center;
}

#mytable td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--tb-border-color);
    border-right: 1px solid var(--tb-border-color);
    font-size: 14px;
    color: #64748B;
    text-align: center;
    line-height: 1.5;
}

#mytable td:first-child {
    text-align: left;
    color: #1E293B;
    font-weight: 500;
    background-color: #FFFFFF;
}

#mytable tbody tr:nth-child(even) td:first-child {
    color: #94A3B8;
    font-size: 13px;
}

#mytable tbody tr:nth-child(4n+1), #mytable tbody tr:nth-child(4n+2) {
    background-color: #FFFFFF;
}

#mytable tbody tr:nth-child(4n+3), #mytable tbody tr:nth-child(4n) {
    background-color: #FBFCFD;
}

#mytable tr:last-child td {
    border-bottom: none;
}

#mytable tbody tr:hover td {
    background-color: #F1F7FF !important;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-accent:hover {
    background: #F5D576;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }