/* 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; }

/* ====== 导航栏（参考乐搜电影风格：logo左 | 菜单中 | 搜索框右）====== */
.navbar { background: #fff; border-bottom: 1px solid #e8e8e8; padding: 0.7rem 1.5rem; display: flex; align-items: center; position: fixed; width: 100%; top: 0; z-index: 1000; }
.navbar .logo { font-size: 1.3rem; font-weight: 700; color: #e50914; text-decoration: none; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; flex-shrink: 0; order: 1; }

/* 菜单居中 */
.navbar .nav-links { display: flex; align-items: center; position: absolute; left: 50%; transform: translateX(-50%); }
.navbar .nav-links a { color: #333; text-decoration: none; font-size: 0.9rem; padding: 6px 14px; border-radius: 20px; 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; margin-left: auto; order: 2; height: 36px; border: 1px solid #e0e0e0; border-radius: 18px; overflow: hidden; transition: border-color 0.2s; }
.nav-search:focus-within { border-color: #e50914; }
.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; margin-left: 0.8rem; 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 h2 { font-size: 1.4rem; border-left: 4px solid #e50914; padding-left: 0.8rem; }
.hot-header .more-link { color: #e50914; text-decoration: none; font-size: 0.85rem; }
.hot-header .more-link:hover { text-decoration: underline; }
.hot-header .mode-tag { font-size: 0.78rem; color: #aaa; }
.hot-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; padding-bottom: 1rem; 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; overflow: hidden; border-radius: 10px; transition: transform 0.25s; }
.hot-card:hover { transform: translateY(-4px); }
.hot-card .cover-wrap { position: relative; width: 150px; height: 210px; border-radius: 10px; overflow: hidden; background: #f0f0f0; }
.hot-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.hot-card:hover .cover-wrap img { transform: scale(1.05); }
.hot-card .cover-wrap .rank-badge { position: absolute; top: 6px; left: 6px; background: rgba(229,9,20,0.92); color: #fff; font-size: 0.72rem; font-weight: bold; padding: 2px 7px; border-radius: 4px; }
.hot-card .info { padding: 0.5rem 0.2rem; }
.hot-card .title { font-size: 0.83rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #222; line-height: 1.4; }
.hot-card .meta { font-size: 0.73rem; color: #999; display: flex; justify-content: space-between; margin-top: 3px; }
.hot-card .category-tag { color: #e50914; background: rgba(229,9,20,0.1); padding: 1px 6px; border-radius: 3px; font-size: 0.7rem; }

.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;
}

.breadcrumb { padding: 4.5rem 0 0.8rem; font-size: 0.84rem; color: #aaa; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { color: #e50914; }
.breadcrumb .sep { margin: 0 0.4rem; color: #ccc; }
.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; }

/* 响应式布局 */
@media (max-width: 768px) {
    .wide-container { padding: 0 0.8rem; }
    .navbar { padding: 0.5rem 1rem; gap: 0; }
    .navbar .logo { display: none; }
    .navbar .nav-links { position: static; left: auto; transform: none; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-shrink: 1; min-width: 0; justify-content: flex-start; }
    .navbar .nav-links::-webkit-scrollbar { display: none; }
    .navbar .nav-links a { font-size: 0.82rem; padding: 5px 10px; }
    .navbar .auth-links { display: none; }
    .nav-search { order: unset; }
    .nav-search input { width: 110px !important; }
    .nav-search input:focus { width: 140px !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 .title { font-size: 0.78rem; }
    .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; }
    .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); }
}
