body {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    margin: 0;
    background-color: #f7f7f7;
}

header {
    background-color: #2563eb;
    color: #fff;
    padding: 12px 20px;
}
.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.site-title {
    text-align: center;
    font-size: 1.9em;
    font-weight: bold;
    margin: 0;
}
.site-subtitle {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    font-weight: normal;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.2px;
}
.download-prompt {
    text-align: center;
    margin-top: 8px;
}
.download-message {
    font-size: 1.05em;
    margin-bottom: 8px;
}
.download-btn {
    display: inline-block;
    background: #fff;
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 18px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #fff;
}
.download-btn:hover {
    background: #f0f4ff;
}

.search-bar {
    display: flex;
    justify-content: center;
    margin: 15px;
}
.search-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 1000px;
    justify-content: center;
    flex-wrap: wrap;
}
.search-status {
    padding: 4px 0;
    border: none;
    background: transparent;
    font-size: 0.9em;
    white-space: nowrap;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.status-pill {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}
.status-pill-vip {
    background: #2563eb;
}
.status-pill-member {
    background: #6b7280;
}
.status-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.status-btn-guest {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fb923c;
}
.status-btn-guest:hover {
    background: #ffedd5;
    color: #9a3412;
    border-color: #f97316;
}
.search-status.status-vip {
    background: transparent;
    border-color: transparent;
    color: #ecfdf5;
}
.search-status.status-normal {
    background: transparent;
    border-color: transparent;
    color: #f8fafc;
}
.search-status.status-guest {
    background: transparent;
    border-color: transparent;
    color: #b91c1c;
}
.search-bar form {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 640px;
}
.search-bar input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    background: #fff;
}
.search-bar button {
    padding: 10px 20px;
    border: none;
    background-color: #2563eb;
    color: white;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.age-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 15px auto 10px;
    padding: 0 20px;
    max-width: 900px;
}
.age-buttons button {
    background-color: #2563eb;
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.9em;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 90px;
    text-align: center;
    border: none;
    cursor: pointer;
}
.age-buttons button.age-filter-btn {
    padding: 8px 18px;
    min-width: 90px;
    font-size: 0.9em;
}
.age-buttons button:hover {
    background-color: #1d4fd8;
    transform: translateY(-1px);
}
.age-buttons.has-active button {
    background-color: #e5e7eb;
    color: #374151;
}
.age-buttons.has-active button:hover {
    background-color: #d1d5db;
    color: #1f2937;
}
.age-buttons.home-state button {
    background-color: #e5e7eb;
    color: #374151;
}
.age-buttons.home-state button:hover {
    background-color: #d1d5db;
    color: #1f2937;
}
.age-buttons button.active {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}
.age-buttons.has-active button.active:hover {
    background-color: #1d4fd8;
    color: #fff;
}
.age-buttons.home-state button.active,
.age-buttons.home-state button.active:hover {
    background-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}
.age-buttons.search-state button {
    background-color: #e5e7eb;
    color: #6b7280;
    cursor: default;
}
.age-buttons.search-state button:hover {
    background-color: #e5e7eb;
    color: #6b7280;
    transform: none;
}

.hot-header {
    text-align: center;
    max-width: 900px;
    margin: 10px auto 12px;
    padding: 0 20px;
}

.kids-pagination {
    margin: 0 auto 30px;
    max-width: 900px;
    text-align: center;
    padding: 10px 20px;
}
.kids-pagination a,
.kids-pagination span {
    display: inline-block;
    margin: 0 4px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    text-decoration: none;
    font-size: 0.9em;
}
.kids-pagination a:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.kids-pagination .active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.kids-empty {
    text-align: center;
    color: #6b7280;
    margin: 20px auto 40px;
    padding: 0 20px;
}

/* 通用返回按钮（视频播放、会员中心、升级页复用） */
.vip-back-btn,
a.vip-back-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    background: #e0e7ff;
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.vip-back-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.vip-back-icon {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 6px solid #1d4ed8;
}

@media (max-width: 480px) {
    .search-bar {
        padding: 0 10px;
    }
    .search-bar form {
        width: 100%;
        max-width: none;
        flex: 1;
    }
    .site-title {
        font-size: 1.6em;
    }
}

/* Reusable modal (WebView-safe replacement for alert/confirm). */
.kd-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.kd-modal.is-open {
    display: flex;
}
.kd-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}
.kd-modal__dialog {
    position: relative;
    width: min(92vw, 360px);
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 16px 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
    border: 1px solid #e2e8f0;
    z-index: 1;
}
@supports (-webkit-overflow-scrolling: touch) {
    .kd-modal__dialog {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}
.kd-modal__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}
.kd-modal__message {
    margin: 0 0 14px;
    color: #334155;
    line-height: 1.5;
    font-size: 0.98rem;
}
.kd-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.kd-modal__btn {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
}
.kd-modal__btn--primary {
    border-color: #0ea5e9;
    background: #0ea5e9;
    color: #ffffff;
}
body.dark-mode .kd-modal__dialog {
    background: #111827;
    border-color: #1f2937;
}
body.dark-mode .kd-modal__title,
body.dark-mode .kd-modal__message {
    color: #e5e7eb;
}
body.dark-mode .kd-modal__btn {
    background: #0b1220;
    color: #e5e7eb;
    border-color: #1f2937;
}
body.dark-mode .kd-modal__btn--primary {
    background: #38bdf8;
    color: #0b1220;
    border-color: #38bdf8;
}
