/* ============================================
   芒果视频 - 主样式表
   CSS前缀: mg-
   配色: 芒果黄 #FFBF00 / 青柠绿 #A7D21A / 西瓜红 #FC6C85 / 椰奶白 #F5F5DC
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    background-color: #F5F5DC;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #FFBF00;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Rounded Mplus 1c", "Microsoft YaHei", sans-serif;
    font-weight: 700;
    line-height: 1.3;
}

/* === Layout === */
.mg-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* === Header & Navigation === */
.mg-header {
    background: #fff;
    border-bottom: 3px solid #FFBF00;
    padding: 0;
    position: relative;
    z-index: 100;
}

.mg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mg-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFBF00;
}

.mg-logo img {
    height: 40px;
    width: auto;
}

.mg-nav {
    display: flex;
    align-items: center;
}

.mg-nav-list {
    display: flex;
    gap: 0;
}

.mg-nav-list li a {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mg-nav-list li a:hover,
.mg-nav-list li a.mg-active {
    background-color: #FFBF00;
    color: #fff;
}

/* Hamburger Menu */
.mg-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    border: none;
    background: transparent;
}

.mg-hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

/* Mobile Nav Overlay */
.mg-mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 1000;
    padding: 2rem 1.5rem;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.mg-mobile-nav.mg-open {
    left: 0;
}

.mg-mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: #333;
}

.mg-mobile-nav-list {
    margin-top: 2rem;
}

.mg-mobile-nav-list li {
    border-bottom: 1px solid #eee;
}

.mg-mobile-nav-list li a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    color: #333;
}

.mg-mobile-nav-list li a:hover {
    color: #FFBF00;
}

.mg-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.mg-overlay.mg-open {
    display: block;
}

/* === Hero Banner === */
.mg-hero-banner {
    position: relative;
    width: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.mg-hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,191,0,0.7) 0%, rgba(167,210,26,0.5) 100%);
    z-index: 1;
}

.mg-hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    padding: 2rem;
}

.mg-hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mg-hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* === Section Common === */
.mg-section {
    padding: 3rem 0;
}

.mg-section-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 4px solid #FFBF00;
}

.mg-section-desc {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* === Video Card Grid === */
.mg-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.mg-video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(255,191,0,0.2);
}

.mg-video-card-thumb {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
}

.mg-video-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-video-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(255,191,0,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-video-card-play::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
    margin-left: 3px;
}

.mg-video-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.mg-video-card-info {
    padding: 0.75rem 1rem;
}

.mg-video-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mg-video-card-meta {
    font-size: 0.8rem;
    color: #999;
}

/* === Trending List === */
.mg-trending-list {
    counter-reset: trending;
}

.mg-trending-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.mg-trending-item::before {
    counter-increment: trending;
    content: counter(trending);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #FFBF00;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.mg-trending-item:nth-child(1)::before { background: #FC6C85; }
.mg-trending-item:nth-child(2)::before { background: #FF8C00; }
.mg-trending-item:nth-child(3)::before { background: #FFBF00; }

.mg-trending-item-title {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
}

.mg-trending-item-views {
    font-size: 0.8rem;
    color: #999;
}

/* === Category Section === */
.mg-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.mg-category-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255,191,0,0.15);
}

.mg-category-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.mg-category-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

/* === Short Clips === */
.mg-clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.mg-clip-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 9/16;
    background: #eee;
}

.mg-clip-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-clip-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 0.75rem 0.75rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.8rem;
}

/* === UGC Section === */
.mg-ugc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.mg-ugc-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mg-ugc-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mg-ugc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFBF00, #A7D21A);
}

.mg-ugc-username {
    font-weight: 600;
    font-size: 0.9rem;
}

.mg-ugc-card-content {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.75rem;
}

/* === Announcements === */
.mg-announcements {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mg-announcement-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.mg-announcement-item:last-child {
    border-bottom: none;
}

.mg-announcement-tag {
    background: #FFBF00;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.mg-announcement-text {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.mg-announcement-date {
    font-size: 0.8rem;
    color: #999;
}

/* === Creator Guide === */
.mg-guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.mg-guide-step {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mg-guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FFBF00, #A7D21A);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.mg-guide-step h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.mg-guide-step p {
    font-size: 0.85rem;
    color: #666;
}

/* === VIP Section === */
.mg-vip-section {
    background: linear-gradient(135deg, #FFBF00 0%, #FF8C00 100%);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    color: #fff;
}

.mg-vip-section h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.mg-vip-section p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.mg-vip-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.mg-vip-plan {
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.mg-vip-plan h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.mg-vip-plan .mg-vip-price {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.mg-vip-plan ul {
    text-align: left;
    font-size: 0.85rem;
}

.mg-vip-plan ul li {
    padding: 0.25rem 0;
}

.mg-vip-plan ul li::before {
    content: '✓ ';
    color: #A7D21A;
}

/* === Contact === */
.mg-contact {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mg-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.mg-contact-item h4 {
    font-size: 1rem;
    color: #FFBF00;
    margin-bottom: 0.5rem;
}

.mg-contact-item p {
    font-size: 0.9rem;
    color: #666;
}

/* === Footer === */
.mg-footer {
    background: #2d2d2d;
    color: #ccc;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.mg-footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mg-footer-col h4 {
    color: #FFBF00;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.mg-footer-col ul li {
    margin-bottom: 0.5rem;
}

.mg-footer-col ul li a {
    color: #ccc;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.mg-footer-col ul li a:hover {
    color: #FFBF00;
}

.mg-footer-award {
    text-align: center;
    padding: 1.5rem 0;
    border-top: 1px solid #444;
    margin-top: 2rem;
}

.mg-footer-award img {
    display: inline-block;
    height: 50px;
    margin-bottom: 0.5rem;
}

.mg-footer-award p {
    font-size: 0.8rem;
    color: #999;
}

.mg-footer-license {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #444;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
}

.mg-footer-license a {
    color: #FFBF00;
    margin: 0 0.5rem;
}

.mg-footer-copyright {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #777;
}

/* === Buttons === */
.mg-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.mg-btn:active {
    transform: scale(0.97);
}

.mg-btn-primary {
    background: #FFBF00;
    color: #fff;
}

.mg-btn-primary:hover {
    background: #e6ac00;
    color: #fff;
}

.mg-btn-secondary {
    background: #A7D21A;
    color: #fff;
}

.mg-btn-secondary:hover {
    background: #96bd17;
    color: #fff;
}

.mg-btn-outline {
    background: transparent;
    border: 2px solid #FFBF00;
    color: #FFBF00;
}

.mg-btn-outline:hover {
    background: #FFBF00;
    color: #fff;
}

/* === Page Banner (Category Pages) === */
.mg-page-banner {
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.mg-page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
}

.mg-page-banner h1 {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* === APP Download Page === */
.mg-app-section {
    text-align: center;
    padding: 4rem 1rem;
}

.mg-app-section h2 {
    font-size: 2rem;
    color: #FFBF00;
    margin-bottom: 1rem;
}

.mg-app-section p {
    font-size: 1.1rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.mg-app-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.mg-app-qrcode {
    display: inline-block;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.mg-app-qrcode img {
    width: 200px;
    height: 200px;
}

/* === Juice Workshop (果汁工坊) === */
.mg-workshop {
    padding: 2rem 0;
}

.mg-workshop-tool {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.mg-workshop-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mg-workshop-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.mg-workshop-search input:focus {
    border-color: #FFBF00;
}

.mg-workshop-timeline {
    min-height: 100px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px dashed #ddd;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.mg-workshop-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mg-workshop-option {
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.mg-workshop-option label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.mg-workshop-option select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.mg-workshop-preview {
    background: #000;
    border-radius: 8px;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-bottom: 1.5rem;
}

/* === Loading Animation === */
.mg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.mg-mango-spin {
    width: 50px;
    height: 50px;
    border-radius: 50% 50% 50% 0;
    background: linear-gradient(135deg, #FFBF00 50%, #A7D21A 50%);
    animation: mg-spin 1s linear infinite;
}

@keyframes mg-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Responsive Design === */

/* Tablet (768px - 992px) */
@media (max-width: 992px) {
    .mg-hero-content h2 {
        font-size: 2rem;
    }

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

    .mg-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .mg-nav {
        display: none;
    }

    .mg-hamburger {
        display: flex;
    }

    .mg-mobile-nav {
        display: block;
    }

    .mg-hero-banner {
        min-height: 300px;
    }

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

    .mg-hero-content p {
        font-size: 1rem;
    }

    .mg-section-title {
        font-size: 1.4rem;
    }

    .mg-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .mg-footer-grid {
        grid-template-columns: 1fr;
    }

    .mg-clips-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .mg-vip-plans {
        grid-template-columns: 1fr;
    }

    .mg-category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .mg-video-grid {
        grid-template-columns: 1fr;
    }

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

    .mg-guide-steps {
        grid-template-columns: 1fr;
    }
}

/* Large Desktop (> 1200px) */
@media (min-width: 1200px) {
    .mg-container {
        max-width: 1200px;
    }

    .mg-video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
