/* ========== Reset & Base ========== */
*, *:before, *:after { margin:0; padding:0; box-sizing:border-box; }
html, body {
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    color: #1e293b;
    background: #f8fafc;
    max-width: 100vw;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; border: 0; }
.clear { clear: both; height: 0; overflow: hidden; }

/* ========== Animations ========== */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* ========== Header ========== */
.m-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 14px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.m-header .m-logo {
    display: flex;
    align-items: center;
    gap: 6px;
}
.m-header .m-logo .m-logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}
.m-header .m-logo .m-logo-text {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(to right, #ef4444, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.m-header .m-nav-links { display: flex; gap: 2px; }
.m-header .m-nav-links a {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    color: #64748b;
    border-radius: 6px;
    transition: all .15s;
}
.m-header .m-nav-links a.m-btn-hot {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-weight: 600;
}

/* ========== Section Title ========== */
.m-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    margin: 18px 0 10px;
}
.m-sec-title::before {
    content: "";
    width: 3px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}
.m-sec-title.is-hot::before { background: linear-gradient(180deg, #ef4444, #f97316); }
.m-sec-title::before { background: #cbd5e1; }
.m-sec-title h2 { font-size: 17px; font-weight: 700; color: #0f172a; }
.m-sec-title .m-sec-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: #f1f5f9;
    color: #94a3b8;
    border-radius: 4px;
}
.m-sec-title .m-sec-more {
    margin-left: auto;
    font-size: 12px;
    color: #f97316;
}

/* ========== Hero Grid (2-col channel image cards) ========== */
.m-hero {
    padding: 0 14px;
}
.m-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.m-hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 16/10;
    cursor: pointer;
    background: #e2e8f0;
}
.m-hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.m-hero-card:active img { transform: scale(1.05); }
.m-hero-card .m-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}
.m-hero-card .m-hero-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
}
.m-hero-card .m-hero-badge .m-dot {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}
.m-hero-card .m-hero-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
}
.m-hero-card .m-hero-code {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 5px;
    margin-bottom: 4px;
}
.m-hero-card .m-hero-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* no-image fallback */
.m-hero-card.m-hero-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
}
.m-hero-card.m-hero-noimg .m-hero-overlay { display: none; }
.m-hero-card.m-hero-noimg .m-hero-badge {
    position: static;
    margin-bottom: 8px;
}
.m-hero-card.m-hero-noimg .m-hero-info {
    position: static;
    text-align: center;
}
.m-hero-card.m-hero-noimg .m-hero-code {
    background: #f1f5f9;
    color: #f97316;
}
.m-hero-card.m-hero-noimg .m-hero-name {
    color: #334155;
}

/* ========== Category Section ========== */
.m-cat-section {
    padding: 0 14px;
    margin-bottom: 6px;
}
.m-cat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.m-cat-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    transition: all .15s;
    overflow: hidden;
}
.m-cat-card:active {
    border-color: #f97316;
    box-shadow: 0 2px 8px rgba(249,115,22,0.08);
}
.m-cat-card .m-cat-accent {
    width: 4px;
    height: 28px;
    border-radius: 2px;
    flex-shrink: 0;
}
.m-cat-card .m-cat-accent.c0 { background: #ef4444; }
.m-cat-card .m-cat-accent.c1 { background: #f97316; }
.m-cat-card .m-cat-accent.c2 { background: #3b82f6; }
.m-cat-card .m-cat-accent.c3 { background: #22c55e; }
.m-cat-card .m-cat-accent.c4 { background: #8b5cf6; }
.m-cat-card .m-cat-accent.c5 { background: #06b6d4; }
.m-cat-card .m-cat-accent.c6 { background: #ec4899; }
.m-cat-card .m-cat-accent.c7 { background: #84cc16; }

.m-cat-card .m-cat-info { min-width: 0; }
.m-cat-card .m-cat-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.m-cat-card .m-cat-live {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
    color: #94a3b8;
}
.m-cat-card .m-cat-live .m-dot {
    width: 5px;
    height: 5px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

/* ========== Province Tags ========== */
.m-province-section {
    padding: 0 14px;
    margin-bottom: 10px;
}
.m-province-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
}
.m-province-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.m-province-tags a {
    display: inline-block;
    padding: 6px 13px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    transition: all .15s;
}
.m-province-tags a:active {
    background: #fff7ed;
    color: #f97316;
    border-color: #fed7aa;
}

/* ========== Footer ========== */
.m-footer {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    padding: 18px 14px 14px;
    margin-top: 20px;
    text-align: center;
}
.m-footer .m-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}
.m-footer .m-footer-links a {
    font-size: 12px;
    color: #94a3b8;
}
.m-footer .m-footer-links a.m-current { color: #f97316; font-weight: 600; }
.m-footer .m-copyright {
    font-size: 11px;
    color: #cbd5e1;
}
