/* style.css - 主样式文件 v20 */

* { margin:0; padding:0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #ffffff; color: #222; }
a { color: inherit; }

/* ====== 导航栏 ====== */
.navbar { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 0.6rem 2rem; display: flex; align-items: center; justify-content: center; position: fixed; width: 100%; top: 0; z-index: 1000; gap: 2rem; }
.navbar .logo { font-size: 1.2rem; font-weight: 700; color: #e50914; text-decoration: none; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; flex-shrink: 0; margin-left: -20rem; }
.navbar .nav-links { display: flex; align-items: center; gap: 0.4rem; }
.navbar .nav-links a { color: #333; text-decoration: none; font-size: 0.85rem; padding: 5px 12px; border-radius: 16px; transition: all 0.2s; display: flex; align-items: center; white-space: nowrap; }
.navbar .nav-links a:hover { background: #fef0ef; color: #e50914; }
.nav-search { display: flex; align-items: center; flex-shrink: 0; height: 34px; border: 1px solid #e0e0e0; border-radius: 17px; overflow: hidden; transition: border-color 0.2s; }
.nav-search input {
    width: 160px;
    height: 100%;
    padding: 0 12px;
    border: none;
    font-size: 0.85rem;
    outline: none;
    color: #333;
    transition: width 0.25s;
}
.nav-search input:focus { width: 220px; }
.nav-search input::placeholder { color: #bbb; }
.nav-search button {
    height: 100%;
    padding: 0 13px;
    border: none;
    border-left: 1px solid #e0e0e0;
    background: #e50914;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav-search button:hover { background: #c00810; }

/* 登录链接：搜索框右边，隔开 */
.navbar .auth-links { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.navbar .auth-links a { color: #999; text-decoration: none; font-size: 0.82rem; white-space: nowrap; transition: color 0.2s; }
.navbar .auth-links a:hover { color: #e50914; }

.wide-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }

.hot-section { margin-top: 56px; padding: 1.5rem 0; }
.hot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.hot-header-left { display: flex; align-items: baseline; gap: 0.65rem; flex-wrap: wrap; }
.hot-header h2 { font-size: 1.4rem; border-left: 4px solid #e50914; padding-left: 0.8rem; margin: 0; }
.hot-header .mode-tag { font-size: 0.75rem; color: #999; background: #f5f5f5; padding: 0.15rem 0.55rem; border-radius: 999px; }
.hot-scroll-wrap { position: relative; }
.hot-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; padding-bottom: 0.5rem; scrollbar-width: thin; scrollbar-color: #e50914 #f0f0f0; -webkit-overflow-scrolling: touch; }
.hot-scroll::-webkit-scrollbar { height: 5px; }
.hot-scroll::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 3px; }
.hot-scroll::-webkit-scrollbar-thumb { background: #e50914; border-radius: 3px; }
.hot-card { flex: 0 0 150px; scroll-snap-align: start; text-decoration: none; color: inherit; display: block; transition: transform 0.22s; }
.hot-card:hover { transform: translateY(-3px); }
.hot-card .cover-wrap { position: relative; width: 150px; height: 210px; border-radius: 10px; overflow: hidden; background: #ececec; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.hot-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.hot-card:hover .cover-wrap img { transform: scale(1.04); }
.hot-card .cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, #2a2a2a, #444); color: #fff; font-size: 2rem; font-weight: 700; }
.hot-card .rank-badge { position: absolute; top: 6px; left: 6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center; line-height: 1; }
.hot-card .rank-badge.rank-1 { background: linear-gradient(135deg, #f5c518, #d4a012); }
.hot-card .rank-badge.rank-2 { background: linear-gradient(135deg, #b8c0cc, #8a939f); }
.hot-card .rank-badge.rank-3 { background: linear-gradient(135deg, #cd7f32, #a86428); }
.hot-card .hot-info { width: 150px; padding: 0.5rem 0.15rem 0; }
.hot-card .hot-title { margin: 0; font-size: 0.8rem; font-weight: 600; color: #222; line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.2em; word-break: break-all; }
.hot-card .hot-meta-row { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.38rem; min-height: 1.25rem; }
.hot-card .hot-cat { flex-shrink: 0; max-width: 4.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.68rem; line-height: 1.2; color: #e50914; background: rgba(229,9,20,.08); padding: 0.12rem 0.42rem; border-radius: 4px; }
.hot-card .hot-score { flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: #d4a012; white-space: nowrap; line-height: 1; }
.hot-card .hot-score::before { content: '★'; margin-right: 0.15rem; font-size: 0.62rem; }
.hot-card .hot-views { margin-top: 0.28rem; font-size: 0.68rem; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }

.content-section { padding: 1.5rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.4rem; border-left: 4px solid #e50914; padding-left: 0.8rem; }
.section-header .more-link { color: #e50914; text-decoration: none; font-size: 0.85rem; }
.section-header .more-link:hover { text-decoration: underline; }
.section-header .post-count { font-size: 0.82rem; color: #aaa; }

/* 默认网格布局（首页） */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem 0.6rem; }

/* 分类页布局 - 5列 */
.content-grid.category-view {
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem 0.4rem;
}

/* 卡片样式 */
.content-card {
    text-decoration: none; color: inherit;
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}
.content-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(229,9,20,0.25); }

.content-card .cover {
    width: 100%;
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
    display: block;
}

/* 分类页卡片优化 - 更小更紧凑 */
.content-grid.category-view .content-card {
    border-radius: 6px;
}
.content-grid.category-view .content-card .cover {
    aspect-ratio: 2 / 3;
}
.content-grid.category-view .content-card .info {
    padding: 0.35rem 0.4rem 0.4rem;
}
.content-grid.category-view .content-card .title {
    font-size: 0.78rem;
}
.content-grid.category-view .content-card .subtitle {
    font-size: 0.65rem;
}

.content-card .info {
    padding: 0.5rem 0.6rem 0.6rem;
    background: linear-gradient(180deg, transparent, rgba(26,26,26,0.95));
}
.content-card .title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.1rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.content-card .subtitle {
    font-size: 0.7rem;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.2rem;
    min-height: 1em;
}
.content-card .tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 0.25rem;
}
.content-card .tag-pill {
    font-size: 0.55rem;
    color: #bbb;
    background: rgba(255,255,255,0.08);
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.5;
}
.content-card .meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
}
.content-card .rating-badge {
    color: #f5c518;
    font-weight: 700;
    font-size: 0.75rem;
}
.content-card .rating-badge .no-rating { color: #666; font-weight: 400; font-size: 0.65rem; }
.content-card .views-count {
    color: #888;
    font-size: 0.58rem;
}
.content-card .corner-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(229,9,20,0.92);
    color: #fff;
    font-size: 0.58rem;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 1px;
}

.wide-container .breadcrumb { padding: 4.5rem 0 0.8rem; font-size: 0.84rem; color: #aaa; }
.wide-container .breadcrumb a { color: #888; text-decoration: none; }
.wide-container .breadcrumb a:hover { color: #e50914; }
.wide-container .breadcrumb .sep { margin: 0 0.4rem; color: #ccc; }
.wide-container .breadcrumb .current { color: #e50914; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 0.4rem; padding: 1.5rem 0 2rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 0.38rem 0.85rem; border-radius: 6px; font-size: 0.85rem; text-decoration: none; }
.pagination a { background: #f5f5f5; color: #333; }
.pagination a:hover { background: #e50914; color: #fff; }
.pagination .current { background: #e50914; color: #fff; }
.pagination .disabled { color: #ccc; }

.empty-tip { padding: 2rem 1rem; color: #aaa; font-size: 0.9rem; text-align: center; }

.footer { background: #f7f7f7; border-top: 1px solid #eee; padding: 1.5rem 0; text-align: center; color: #aaa; font-size: 0.84rem; margin-top: 2rem; }
.footer a { color: #e50914; text-decoration: none; }

/* ====== 页脚 ====== */
.site-footer {
    margin-top: 2.5rem;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border-top: 1px solid #e8e8e8;
    color: #888;
    font-size: 0.84rem;
}
.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.75rem 2rem 1.5rem;
    text-align: center;
}
.site-footer-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
}
.site-footer-nav a {
    color: #666;
    text-decoration: none;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.site-footer-nav a:hover {
    color: #e50914;
    background: rgba(229, 9, 20, 0.06);
}
.site-footer-dot {
    color: #ccc;
    user-select: none;
}
.site-footer-main {
    line-height: 1.65;
}
.site-footer-copy {
    margin: 0;
    color: #777;
    font-size: 0.84rem;
}
.site-footer-name {
    color: #444;
    font-weight: 600;
}
.site-footer-sep {
    margin: 0 0.35rem;
    color: #ccc;
}
.site-footer-extra {
    color: #999;
}
.site-footer-icp {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
}
.site-footer-icp a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer-icp a:hover {
    color: #e50914;
}
.site-footer-powered {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ebebeb;
    font-size: 0.78rem;
    color: #aaa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.site-footer-powered a {
    color: #e50914;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
}
.site-footer-powered a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .site-footer-inner { padding: 1.4rem 1rem 1.2rem; }
    .site-footer-nav { gap: 0.2rem 0.35rem; font-size: 0.82rem; }
    .site-footer-copy { font-size: 0.8rem; }
}

/* ====== 汉堡菜单按钮 ====== */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 0.5rem;
}
.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* 手机端导航菜单遮罩 */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1999;
}
.nav-overlay.show { display: block; }

/* 手机端侧边菜单 */
.nav-mobile-menu {
    position: fixed;
    top: 0; left: 0;
    width: 78vw;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.nav-mobile-menu.show { transform: translateX(0); }

.nav-mobile-menu .nav-mobile-header {
    padding: 1.2rem 1.2rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e50914;
}
.nav-mobile-menu .nav-mobile-links {
    flex: 1;
    padding: 0.5rem 0;
}
.nav-mobile-menu .nav-mobile-links a {
    display: block;
    padding: 0.82rem 1.2rem;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: background 0.15s;
}
.nav-mobile-menu .nav-mobile-links a:hover,
.nav-mobile-menu .nav-mobile-links a.active {
    background: #fef0ef;
    color: #e50914;
    border-left-color: #e50914;
}
.nav-mobile-menu .nav-mobile-links .nav-sep {
    height: 1px;
    background: #f0f0f0;
    margin: 0.3rem 1.2rem;
}
.nav-mobile-menu .nav-mobile-user {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #999;
}
.nav-mobile-menu .nav-mobile-user a {
    color: #e50914;
    text-decoration: none;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .wide-container { padding: 0 0.8rem; }
    .navbar { padding: 0.5rem 1rem; gap: 0; justify-content: flex-start; }
    .navbar .logo { display: none; }
    .nav-hamburger { display: flex; }
    .navbar .nav-links { display: none; }
    .nav-search { margin-left: auto; flex-shrink: 1; min-width: 0; }
    .navbar .auth-links { display: none; }
    .nav-search input { width: 90px !important; }
    .nav-search input:focus { width: 130px !important; }
    .hot-section { margin-top: 56px; }
    .hot-header h2 { font-size: 1.15rem; }
    .hot-scroll { gap: 0.7rem; }
    .hot-card { flex: 0 0 120px; }
    .hot-card .cover-wrap { width: 120px; height: 170px; }
    .hot-card .hot-info { width: 120px; }
    .hot-card .hot-title { font-size: 0.76rem; min-height: 2.1em; }
    .hot-card .hot-cat { font-size: 0.64rem; max-width: 3.6em; }
    .hot-card .hot-score { font-size: 0.68rem; }
    .hot-card .hot-views { font-size: 0.64rem; }
    .content-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
    .content-grid.category-view { grid-template-columns: repeat(2, 1fr); }
    .content-card .cover { border-radius: 8px; }
    .content-card .info { padding: 0.4rem 0.45rem 0.5rem; }
    .content-card .title { font-size: 0.8rem; }
    .content-card .subtitle { font-size: 0.64rem; }
    .content-card .tag-pill { font-size: 0.58rem; padding: 1px 5px; }
    .content-card .corner-badge { font-size: 0.58rem; padding: 2px 6px; top: 6px; left: 6px; }
    .section-header h2 { font-size: 1.1rem; }
    .wide-container .breadcrumb { padding-top: 5.5rem; }
}

@media (min-width: 769px) and (max-width: 1100px) {
    .content-grid.category-view { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1101px) {
    .content-grid.category-view { grid-template-columns: repeat(5, 1fr); }
}
