/* ====================================================================
 * 短剧热剧榜 - 白色主题样式
 * 布局参考 hongguoduanju.com，去掉深色背景，链接统一指向 /search1.php
 * ==================================================================== */

/* ========== 全局基础 ========== */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #f5f6f8;
    color: #1f2329;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        Arial, sans-serif;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: #fa6725;
}

ol,
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1,
h2,
h3,
p {
    margin: 0;
    padding: 0;
}

/* ========== 顶部紫色导航条（复刻 30.90kan.cc/ju/） ========== */
.link-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 110;
    text-align: center;
    background: #6a11cb;
    padding: 8px 0;
    margin: 0;
    width: 100%;
}

.link-container a {
    color: white;
    text-decoration: none;
    margin: 0 2px;
    font-size: 16px;
    padding: 6px 12px;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.link-container a:hover {
    opacity: 0.8;
}

/* 底部导航：与头部一致，但放在文档流里，不固定 */
.link-container.bottom {
    position: static;
    margin-top: 0;
    padding: 8px 0;
}

/* ========== 顶部导航 ========== */
.rank-nav {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid #ececec;
    z-index: 100;
}

.rank-nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

/* ========== 顶部搜索框 ========== */
.rank-search {
    flex: 1;
    display: flex;
    align-items: center;
    height: 44px;
    max-width: 640px;
    margin: 0 auto;
    background: #f5f6f8;
    border-radius: 12px;
    padding: 0 6px 0 16px;
    border: 1px solid #ececec;
    transition: border-color 0.16s ease;
}

.rank-search:focus-within {
    border-color: #fa6725;
}

.rank-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    height: 100%;
    font-size: 14px;
    color: #1f2329;
    font-family: inherit;
}

.rank-search input::placeholder {
    color: #9aa0a6;
}

.rank-search-btn {
    flex: 0 0 auto;
    border: 0;
    cursor: pointer;
    background: linear-gradient(92.27deg, #ff7e0d 0.32%, #ff9233);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    height: 34px;
    padding: 0 20px;
    border-radius: 9px;
    transition: filter 0.16s ease;
    font-family: inherit;
}

.rank-search-btn:hover {
    filter: brightness(1.05);
}

/* ========== Hero 标题区 ========== */
.rank-hero {
    margin: 0 auto;
    padding: 178px 24px 24px;
    max-width: 1240px;
}

.rank-hero-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rank-hero h1 {
    font-size: 32px;
    font-weight: 500;
    line-height: 45px;
    color: #1f2329;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.rank-hero h1::before,
.rank-hero h1::after {
    content: "";
    flex: 0 0 auto;
    width: 6px;
    height: 28px;
    background: linear-gradient(180deg, #ff7e0d, #ff9233);
    border-radius: 2px;
}

.rank-hero h1::after {
    transform: rotate(180deg);
    order: 3;
}

.rank-update {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff5ec;
    color: #fa6725;
    font-size: 12px;
    line-height: 20px;
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid #ffd7b8;
    white-space: nowrap;
}

.rank-update b {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rank-hero p {
    margin-top: 16px;
    color: #86909c;
    font-size: 14px;
    line-height: 20px;
}

/* ========== Tabs 切换 ========== */
.rank-tabs {
    margin: 0 auto;
    padding: 8px 24px 0;
    max-width: 1240px;
    display: flex;
    gap: 12px;
}

.rank-tabs a {
    color: #5b6573;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    padding: 12px 26px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #ececec;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.rank-tabs a:hover {
    color: #fa6725;
    border-color: #ffd7b8;
    background: #fff5ec;
}

.rank-tabs a.active {
    color: #fff;
    font-weight: 600;
    background: linear-gradient(92.27deg, #ff7e0d 0.32%, #ff9233);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(250, 103, 37, 0.26);
}

/* ========== 列表区 ========== */
.rank-main {
    margin: 0 auto;
    padding: 24px 24px 80px;
    max-width: 1240px;
    min-height: 600px;
}

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ========== 单个短剧卡片 ========== */
.rank-item {
    display: flex;
    gap: 24px;
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.rank-cover-link {
    flex: 0 0 auto;
    width: 160px;
    height: 224px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: block;
    background: #f0f1f3;
}

.rank-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    display: block;
}

.rank-cover-link:hover .rank-cover {
    transform: scale(1.06);
}

.rank-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #fa6725, #ff9233);
    color: #fff;
    font-family: "DIN Alternate", Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px 0 8px 0;
}

.rank-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.rank-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 28px;
}

.rank-title {
    color: #1f2329;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-title a {
    color: inherit;
}

.rank-heat {
    color: #fa6725;
    font-size: 14px;
    line-height: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.rank-heat::before {
    content: "";
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fa6725'><path d='M13.5 1.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 0 12 0s1.5.67 1.5 1.5zM12 9c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zM8 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-6-6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm12-6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z'/></svg>")
        no-repeat center / contain;
    display: inline-block;
}

.rank-tags {
    display: flex;
    gap: 6px;
    align-items: center;
    color: #86909c;
    font-size: 14px;
    line-height: 20px;
    margin-top: 12px;
    height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-tag {
    color: #86909c;
}

.rank-tag-divider {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #c9cdd4;
    flex: 0 0 auto;
}

.rank-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 24px;
    margin-top: 12px;
}

.rank-meta-item {
    background: rgba(215, 164, 97, 0.12);
    border-radius: 4px;
    color: #b27e3d;
    font-size: 12px;
    line-height: 16px;
    padding: 4px 8px;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-meta-item.score {
    background: rgba(250, 119, 5, 0.1);
    color: rgba(250, 119, 5, 0.95);
}

.rank-meta-item.status {
    background: rgba(0, 208, 160, 0.1);
    color: #00a37e;
}

.rank-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding-top: 0;
}

.rank-desc {
    width: 100%;
    min-width: 0;
    color: #5b6573;
    font-size: 14px;
    line-height: 22px;
    max-height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.rank-info .rank-desc {
    margin-top: 8px;
}

.rank-btn-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(92.27deg, #ff7e0d 0.32%, #ff9233);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    height: 38px;
    padding: 0 22px;
    border-radius: 10px;
    transition: filter 0.16s ease, transform 0.16s ease;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    flex: 0 0 auto;
}

.rank-btn-detail:hover {
    color: #fff;
    filter: brightness(1.05);
    transform: translateY(-1px);
}

/* ========== 分页 ========== */
.rank-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 60px auto 0;
    width: fit-content;
    color: #5b6573;
    font-size: 14px;
    height: 36px;
}

.rank-page-btn,
.rank-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ececec;
    transition: all 0.16s ease;
    font-size: 14px;
    white-space: nowrap;
}

.rank-page-btn {
    padding: 0 14px;
    gap: 2px;
}

.rank-page-btn:hover,
.rank-page-num:hover {
    background: #fff5ec;
    color: #fa6725;
    border-color: #ffd7b8;
}

.rank-page-num.current {
    color: #fa6725;
    background: #fff5ec;
    border-color: #ffb985;
    font-weight: 500;
}

.rank-page-btn:disabled,
.rank-page-num:disabled {
    color: #c9cdd4;
    cursor: not-allowed;
    background: #f5f6f8;
}

.rank-page-ellipsis {
    color: #86909c;
    padding: 0 4px;
}

/* ========== 加载/错误状态 ========== */
.rank-loading,
.rank-error,
.rank-empty {
    text-align: center;
    color: #86909c;
    font-size: 14px;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rank-loading::before {
    content: "";
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 3px solid #ececec;
    border-top-color: #fa6725;
    border-radius: 50%;
    animation: rank-spin 0.8s linear infinite;
}

@keyframes rank-spin {
    to {
        transform: rotate(360deg);
    }
}

.rank-error {
    color: #fa6725;
}

/* ========== 响应式：移动端 ========== */
@media screen and (max-width: 768px) {
    .rank-nav {
        height: 56px;
    }

    .rank-nav-inner {
        padding: 0 16px;
    }

    .rank-search {
        width: 100%;
        flex: 1;
        max-width: none;
        margin: 0;
        height: 40px;
    }

    .rank-search-btn {
        height: 30px;
        padding: 0 14px;
        font-size: 13px;
    }

    .rank-hero {
        padding: 140px 16px 16px;
    }

    .rank-hero h1 {
        font-size: 22px;
        line-height: 31px;
    }

    .rank-hero-head {
        gap: 10px;
    }

    .rank-hero p {
        font-size: 13px;
        line-height: 19px;
        margin-top: 12px;
    }

    .rank-tabs {
        padding: 8px 16px 0;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }

    .rank-tabs::-webkit-scrollbar {
        display: none;
    }

    .rank-tabs a {
        font-size: 14px;
        padding: 9px 18px;
        border-radius: 9px;
    }

    .rank-main {
        padding: 16px 12px 60px;
    }

    .rank-item {
        gap: 12px;
        padding: 12px;
    }

    .rank-cover-link {
        width: 96px;
        height: 134px;
    }

    .rank-badge {
        width: 22px;
        height: 20px;
        font-size: 12px;
        border-radius: 6px 0 6px 0;
    }

    .rank-title {
        font-size: 15px;
        line-height: 22px;
        max-width: 100%;
        flex: 1 1;
        min-width: 0;
    }

    .rank-heading .rank-heat {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .rank-heat {
        font-size: 12px;
    }

    .rank-tags {
        font-size: 12px;
        line-height: 16px;
        margin-top: 6px;
    }

    .rank-meta {
        margin-top: 6px;
        gap: 5px;
    }

    .rank-desc {
        flex: 1;
        width: auto;
        font-size: 12px;
        line-height: 18px;
        height: 36px;
        max-height: 36px;
        -webkit-line-clamp: 2;
    }

    .rank-bottom {
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
        padding-top: 10px;
    }

    .rank-btn-detail {
        flex: 0 0 auto;
        height: 32px;
        padding: 0 14px;
        font-size: 12px;
        border-radius: 8px;
    }
}

@media screen and (max-width: 420px) {
    .rank-cover-link {
        width: 84px;
        height: 118px;
    }
}