/* wave7 - MH Magazine 风格 */
:root {
    --primary: #2196f3;
    --primary-dark: #1976d2;
    --secondary: #E53935;
    --accent: #B71C1C;
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --text: #333333;
    --text-muted: #FFCDD2;
    --border: #e0e0e0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--primary-dark); }
[class~="mh-container"] { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
[class~="mh-clearfix"]::after { content: ""; display: table; clear: both; }
[class~="mh-skip-link"] { position: absolute; top: -40px; left: 0; background: var(--primary); color: #fff; padding: 8px; z-index: 9999; }
[class~="mh-skip-link"]:focus { top: 0; }

/* Header */
[class~="mh-header"] { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
[class~="mh-header-content"] { display: flex; justify-content: space-between; align-items: center; height: 60px; }
[class~="mh-site-branding"] [class~="mh-logo"] { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
[class~="mh-site-branding"] [class~="site-description"] { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
[class~="mh-menu"] { display: flex; list-style: none; gap: 24px; }
[class~="mh-menu"] a { color: var(--text); font-weight: 500; padding: 8px 0; border-bottom: 2px solid transparent; }
[class~="mh-menu"] a:hover { color: var(--primary); border-bottom-color: var(--primary); }

/* Main */
[class~="mh-wrapper"] { display: grid; grid-template-columns: 1fr 300px; gap: 30px; padding: 30px 0; max-width: 1200px; margin: 0 auto; }
@media (max-width: 992px) { [class~="mh-wrapper"] { grid-template-columns: 1fr; } }
[class~="mh-content"] { min-width: 0; }
[class~="mh-sidebar"] { background: #fff; padding: 20px; border-radius: 8px; height: fit-content; }
[class~="mh-widget-title"] { font-size: 1rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); color: var(--primary); }
[class~="mh-recent-posts"] { list-style: none; }
[class~="mh-recent-posts"] li { padding: 8px 0; border-bottom: 1px solid var(--border); }

/* Sections */
[class~="mh-section-title"] { font-size: 1.3rem; margin-bottom: 20px; padding-left: 12px; border-left: 4px solid var(--primary); }
[class~="mh-posts-grid"] { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
[class~="mh-posts-grid"] ul[class~="pic-list"] { list-style: none; padding: 0; margin: 0; display: contents; }
/* min-width:0 prevents 1fr tracks from expanding to fit wide content */
[class~="mh-posts-grid"] [class~="pic-list"] li { margin: 0; padding: 0; min-width: 0; overflow: hidden; }
@media (max-width: 768px) { [class~="mh-posts-grid"] { grid-template-columns: repeat(2, 1fr); } }
/* Card Elements for pic-list */
[class~="mh-posts-grid"] [class~="pic-img"] { display: block; position: relative; aspect-ratio: 2/3; background: var(--bg-card); border-radius: 8px; overflow: hidden; }
[class~="mh-posts-grid"] [class~="pic-img"] img { width: 100%; height: 100%; object-fit: cover; }
[class~="mh-posts-grid"] [class~="pic-img"] [class~="score"] { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; }
[class~="mh-posts-grid"] [class~="pic-img"] [class~="tips"] { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff; font-size: 0.7rem; padding: 14px 6px 6px; }
/* .title and .hits are inside .pic-img normal flow — hide them (already clipped by overflow:hidden visually) */
[class~="mh-posts-grid"] [class~="pic-img"] [class~="title"], [class~="mh-posts-grid"] [class~="pic-img"] [class~="hits"] { display: none; }
/* h3[class~="name"] and .card-meta below the image */
[class~="mh-posts-grid"] [class~="pic-list"] li h3[class~="name"] { font-size: 0.85rem; font-weight: 500; margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="mh-posts-grid"] [class~="pic-list"] li h3[class~="name"] a { color: var(--text); }
[class~="mh-posts-grid"] [class~="pic-list"] li h3[class~="name"] a:hover { color: var(--primary); }
[class~="mh-posts-grid"] [class~="pic-list"] li [class~="card-meta"] { display: flex; gap: 6px; font-size: 0.72rem; color: var(--text-muted); overflow: hidden; }
[class~="mh-posts-grid"] [class~="pic-list"] li [class~="card-meta"] span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="mh-posts-grid"] [class~="pic-list"] li p { margin-top: 8px; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="mh-more-link"] { display: inline-block; margin-top: 16px; color: var(--primary); }

/* Cards */
[class~="mh-card"] { background: var(--bg-card); border-radius: 8px; overflow: hidden; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
[class~="mh-card"]:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
[class~="mh-card"] img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
[class~="mh-card"] [class~="title"] { padding: 12px; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="mh-remarks"] { background: var(--secondary); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }
[class~="mh-score"] { color: var(--accent); font-weight: 700; }

/* Footer */
[class~="footer"] { background: #1a1a1a; color: #ccc; padding: 40px 20px 20px; margin-top: 40px; }
[class~="footer"] [class~="container"] { max-width: 1200px; margin: 0 auto; }
[class~="footer-sitemaps"], [class~="footer-links"], [class~="footer-partners"] { padding: 12px 0; border-bottom: 1px solid #333; text-align: center; }
[class~="footer-sitemaps"] a, [class~="footer-partners"] a { margin: 0 10px; color: #aaa; font-size: 0.85rem; }
[class~="footer-partners"] a { color: #888; }
[class~="footer-copyright"] { text-align: center; padding-top: 16px; }
[class~="footer-copyright"] p { color: #888; font-size: 0.85rem; margin: 4px 0; }
[class~="mh-copyright-wrap"] { background: var(--primary); color: #fff; padding: 12px 0; text-align: center; }

/* Pagination */
[class~="mh-pagination"] { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
[class~="mh-pagination"] a, [class~="mh-pagination"] span { padding: 8px 14px; background: #fff; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); }
[class~="mh-pagination"] a:hover, [class~="mh-pagination"] [class~="current"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Filter */
[class~="mh-filter-bar"] { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; background: var(--bg-card); padding: 16px; border-radius: 8px; }
[class~="mh-filter-group"] { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
[class~="mh-filter-label"] { color: var(--text-muted); font-size: 0.875rem; min-width: 44px; flex-shrink: 0; }
[class~="mh-filter-bar"] a { padding: 4px 12px; border-radius: 4px; border: 1px solid var(--border); font-size: 0.85rem; color: var(--text); background: #fff; transition: all 0.2s; }
[class~="mh-filter-bar"] a:hover, [class~="mh-filter-bar"] a[class~="active"] { background: var(--primary); color: #fff; border-color: var(--primary); }
[class~="mh-filter-group"] li { list-style: none; padding: 0; margin: 0; }

/* Back to Top */
[class~="back-to-top"] { display: none; position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--primary, #1e88e5); color: #fff; border: none; cursor: pointer; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,[class~="25"]); z-index: 999; transition: opacity [class~="2s"]; }
[class~="back-to-top"]:hover { opacity: [class~="85"]; }

/* ===== Legacy page structure (search/404/news/sitemap) ===== */
[class~="header"] { background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 100; }
[class~="header-inner"] { display: flex; justify-content: space-between; align-items: center; height: 60px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
[class~="logo"] { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
[class~="nav"] { display: flex; gap: 20px; list-style: none; }
[class~="nav"] a { color: var(--text); font-weight: 500; }
[class~="nav"] a:hover { color: var(--primary); }
[class~="skip-link"] { position: absolute; top: -40px; left: 0; background: var(--primary); color: #fff; padding: 8px; z-index: 9999; }
[class~="skip-link"]:focus { top: 0; }
[class~="footer-inner"] { max-width: 1200px; margin: 0 auto; padding: 20px; }
[class~="footer"] [class~="footer-links"] { padding: 12px 0; border-bottom: 1px solid #333; text-align: center; }
[class~="footer"] [class~="footer-links"] a { margin: 0 10px; color: #aaa; font-size: 0.85rem; }
[class~="copyright"] { text-align: center; padding-top: 12px; color: #888; font-size: 0.85rem; }

/* ===== Pagination (legacy .pagination) ===== */
[class~="pagination"] { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
[class~="pagination"] a, [class~="pagination"] span { padding: 8px 14px; background: #fff; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); }
[class~="pagination"] a:hover, [class~="pagination"] [class~="current"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== Search page ===== */
[class~="search-form"] { display: flex; gap: 8px; }
[class~="search-form"] input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; flex: 1; min-width: 160px; }
[class~="search-form"] button { padding: 8px 16px; background: var(--primary); color: #fff; border: none; border-radius: 4px; cursor: pointer; }
[class~="search-page"] { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
[class~="search-page"] h1 { font-size: 1.2rem; margin-bottom: 20px; color: var(--text-muted); }
[class~="movie-grid"] { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 992px) { [class~="movie-grid"] { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { [class~="movie-grid"] { grid-template-columns: repeat(2, 1fr); } }
/* pic-list wrapper from generateMovie2Cards() must be transparent to grid */
[class~="movie-grid"] ul[class~="pic-list"] { list-style: none; padding: 0; margin: 0; display: contents; }
[class~="movie-grid"] [class~="pic-list"] li { margin: 0; padding: 0; min-width: 0; overflow: hidden; }
[class~="movie-grid"] [class~="pic-img"] { display: block; position: relative; aspect-ratio: 2/3; background: var(--bg-card); border-radius: 8px; overflow: hidden; }
[class~="movie-grid"] [class~="pic-img"] img { width: 100%; height: 100%; object-fit: cover; display: block; }
[class~="movie-grid"] [class~="pic-img"] [class~="score"] { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; }
[class~="movie-grid"] [class~="pic-img"] [class~="tips"] { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #fff; font-size: 0.7rem; padding: 14px 6px 6px; }
[class~="movie-grid"] [class~="pic-img"] [class~="title"], [class~="movie-grid"] [class~="pic-img"] [class~="hits"] { display: none; }
[class~="movie-grid"] [class~="pic-list"] li h3[class~="name"] { font-size: 0.85rem; font-weight: 500; margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="movie-grid"] [class~="pic-list"] li h3[class~="name"] a { color: var(--text); }
[class~="movie-grid"] [class~="pic-list"] li h3[class~="name"] a:hover { color: var(--primary); }
[class~="movie-grid"] [class~="pic-list"] li [class~="card-meta"] { display: flex; gap: 6px; font-size: 0.72rem; color: var(--text-muted); overflow: hidden; }
[class~="movie-grid"] [class~="pic-list"] li [class~="card-meta"] span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="movie-grid"] [class~="pic-list"] li p { margin-top: 8px; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[class~="movie-card"] { display: block; background: var(--bg-card); border-radius: 8px; overflow: hidden; transition: all 0.3s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); color: var(--text); }
[class~="movie-card"]:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); color: var(--text); }
[class~="movie-poster"] { position: relative; aspect-ratio: 2/3; overflow: hidden; background: #eee; }
[class~="movie-poster"] img { width: 100%; height: 100%; object-fit: cover; display: block; }
[class~="movie-score"] { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; }
[class~="movie-badge"] { position: absolute; top: 6px; right: 6px; background: var(--secondary); color: #fff; font-size: 0.7rem; padding: 2px 6px; border-radius: 3px; }
[class~="movie-play-overlay"] { position: absolute; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s; }
[class~="movie-card"]:hover [class~="movie-play-overlay"] { opacity: 1; }
[class~="movie-play-overlay"] svg { width: 44px; height: 44px; fill: #fff; }
[class~="movie-info"] { padding: 8px 10px; }
[class~="movie-title"] { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
[class~="movie-meta"] { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Rank page ===== */
[class~="rank-page"] { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
[class~="rank-page"] > h1 { font-size: 1.5rem; margin-bottom: 24px; padding-left: 12px; border-left: 4px solid var(--primary); }
[class~="rank-wrapper"] { display: flex; flex-direction: column; gap: 40px; }
[class~="rank-section"] h2 { font-size: 1.1rem; margin-bottom: 16px; padding-left: 10px; border-left: 3px solid var(--primary); color: var(--primary); }
[class~="rank-list"] { display: flex; flex-direction: column; gap: 4px; }
[class~="rank-list"] a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border-radius: 6px; color: var(--text); transition: background 0.2s; text-decoration: none; }
[class~="rank-list"] a:hover { background: #f0f4ff; color: var(--primary); }
[class~="rank-list"] a i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--border); font-style: normal; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
[class~="rank-list"] a:nth-child(1) i { background: #f5a623; color: #fff; }
[class~="rank-list"] a:nth-child(2) i { background: #9b9b9b; color: #fff; }
[class~="rank-list"] a:nth-child(3) i { background: #c86b2d; color: #fff; }
[class~="rank-list"] a h3 { flex: 1; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; margin: 0; }
[class~="rank-list"] a [class~="title"] { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }

/* ===== Update page ===== */
[class~="update-page"] { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
[class~="update-page"] h1 { font-size: 1.5rem; margin-bottom: 24px; padding-left: 12px; border-left: 4px solid var(--primary); }

/* ===== 404 error page ===== */
[class~="error-page"] { max-width: 800px; margin: 60px auto; padding: 40px 20px; text-align: center; }
[class~="error-page"] h1 { font-size: 6rem; color: var(--primary); margin-bottom: 8px; }
[class~="error-page"] p { color: var(--text-muted); margin-bottom: 16px; }
[class~="error-page"] a { color: var(--primary); }
[class~="recommend-section"] { margin-top: 40px; text-align: left; }
[class~="recommend-section"] h2 { font-size: 1.2rem; margin-bottom: 16px; }

/* ===== News pages ===== */
[class~="news-list-page"], [class~="news-detail-page"] { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }
[class~="news-list-page"] h1 { font-size: 1.5rem; margin-bottom: 20px; }
[class~="news-categories"] { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
[class~="news-categories"] a { padding: 6px 16px; border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 0.9rem; }
[class~="news-categories"] a:hover, [class~="news-categories"] a[class~="active"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[class~="news-list"] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) { [class~="news-list"] { grid-template-columns: 1fr; } }
[class~="news-article"] h1 { font-size: 1.6rem; margin-bottom: 16px; }
[class~="news-meta"] { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 20px; display: flex; gap: 16px; }
[class~="news-content"] { line-height: 1.8; }
[class~="news-content"] p { margin-bottom: 1em; }
[class~="related-news"] h2 { font-size: 1.2rem; margin: 32px 0 16px; padding-left: 10px; border-left: 3px solid var(--primary); }

/* ===== Sitemap page ===== */
[class~="sitemap-list"] a { display: block; padding: 10px 14px; background: #fff; border-radius: 6px; color: var(--primary); transition: background 0.2s; }
[class~="sitemap-list"] a:hover { background: #f0f4ff; }

/* Player source/episode buttons */
[class~="mh-play-sources"] { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
[class~="mh-source-btn"] { padding: 6px 16px; border: 1px solid var(--border, #ddd); border-radius: 4px; background: #f5f5f5; cursor: pointer; font-size: 13px; }
[class~="mh-source-btn"][class~="active"] { background: var(--primary, #1e88e5); color: #fff; border-color: var(--primary, #1e88e5); }
[class~="mh-episode-list"] { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
[class~="mh-ep-btn"] { padding: 5px 12px; border: 1px solid var(--border, #ddd); border-radius: 4px; background: #f5f5f5; cursor: pointer; font-size: 12px; }
[class~="mh-ep-btn"][class~="active"] { background: var(--primary, #1e88e5); color: #fff; border-color: var(--primary, #1e88e5); }

/* Logo text fallback */
[class~="logo-text"] {
    font-size: 1.5rem;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
    display: inline-block;
}
