/*
Theme Name: RiPro-V5 Child
Description: RiPro-V5 子主题，用于自定义网站样式。
Template: ripro-v5
Version: 1.0.0
Text Domain: ripro-v5-child
*/

/* 在下方添加自定义 CSS，保存后刷新前台查看效果。 */

/* 文章顶部动态标题区，与首页共用游戏背景引擎。 */
.archive-hero.ripro-article-hero {
    isolation: isolate;
    overflow: hidden;
    background: #0b1321;
    border-bottom: 1px solid #253449;
}

.ripro-article-hero-content {
    position: relative;
    z-index: 1;
    min-height: 180px;
    padding-top: 32px;
    padding-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ripro-article-hero .article-header { min-width: 0; max-width: 100%; }
.archive-hero.ripro-article-hero .post-title {
    overflow-wrap: anywhere;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.archive-hero.ripro-article-hero .article-meta a:hover { color: #8ff4d8; }
.ripro-article-hero .article-meta a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

[data-bs-theme="light"] .archive-hero.ripro-article-hero {
    background: #f1f7fc;
    border-bottom-color: #cddfe9;
}

[data-bs-theme="light"] .archive-hero.ripro-article-hero .post-title {
    color: #203b60;
    text-shadow: none;
}

[data-bs-theme="light"] .archive-hero.ripro-article-hero .article-meta a,
[data-bs-theme="light"] .archive-hero.ripro-article-hero .article-meta span {
    color: #506b83;
}

[data-bs-theme="light"] .archive-hero.ripro-article-hero .article-meta a:hover { color: #087e6b; }

@media (max-width: 767px) {
    .ripro-article-hero-content { min-height: 150px; padding: 28px 20px; }
    .ripro-article-hero .post-title { font-size: 1.5rem; line-height: 1.4; }
}

/* 文章页使用更清晰的背景与卡片层次。 */
body.single-post .ri-down-warp .down-msg {
    display: none;
}

[data-bs-theme="light"] body.single-post {
    background-color: #e5ebf3;
}

[data-bs-theme="light"] body.single-post .content-wrapper > .card,
[data-bs-theme="light"] body.single-post .sidebar .widget {
    background-color: #fff;
    border: 1px solid #d0d9e5;
    box-shadow: 0 6px 22px rgba(39, 58, 88, .08);
}

[data-bs-theme="dark"] body.single-post {
    background-color: #12161e;
}

[data-bs-theme="dark"] body.single-post .content-wrapper > .card,
[data-bs-theme="dark"] body.single-post .sidebar .widget {
    background-color: #262e3b;
    border: 1px solid #394558;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

[data-bs-theme="dark"] body.single-post .ri-down-warp .down-buy-info .list-group-item {
    background-color: transparent !important;
    border-color: #3c4656;
}

.home-search-box .ripro-game-hero {
    isolation: isolate;
    overflow: hidden;
    background: #0b1321;
    border-bottom: 1px solid rgba(96, 230, 207, .14);
}

.ripro-game-canvas,
.ripro-game-vignette {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ripro-game-vignette {
    background: radial-gradient(ellipse at center, rgba(11, 19, 33, .45), transparent 65%),
        linear-gradient(0deg, rgba(11, 19, 33, .65), transparent 30%);
}

.home-search-box .ripro-game-hero .search-warp {
    position: relative;
    z-index: 1;
    padding-top: clamp(90px, 9vw, 150px);
    padding-bottom: clamp(90px, 9vw, 150px);
}

.ripro-game-hero .search-title {
    text-shadow: 0 2px 24px rgba(0, 0, 0, .6);
}

.ripro-game-hero .search-desc,
.ripro-game-hero .search-hots {
    color: #b5c9db;
}

.ripro-game-hero .search-form {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .24);
}

.ripro-game-collectibles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.ripro-game-crystal {
    position: absolute;
    top: 22%;
    left: 21%;
    width: 30px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: auto;
    cursor: pointer;
    animation: ripro-crystal-float 4s ease-in-out infinite;
}

.ripro-game-crystal::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: linear-gradient(135deg, #e0fff4, #60e6cf 35%, #328ecc 65%, #9d8dff);
    clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%);
    filter: drop-shadow(0 0 10px #60e6cf);
}

.ripro-game-crystal::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid rgba(96, 230, 207, .35);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(96, 230, 207, .15);
}

.ripro-game-crystal:nth-child(2) { left: 79%; top: 18%; animation-delay: -1.3s; }
.ripro-game-crystal:nth-child(3) { left: 64%; top: 82%; animation-delay: -2.6s; }
.ripro-game-crystal:focus-visible { outline: 2px solid #fff; outline-offset: 10px; }
.ripro-game-crystal:disabled { opacity: 0; pointer-events: none; }
.ripro-game-hero .ripro-game-hint { margin: 16px 0 0; color: #96b7c9; font-size: 13px; }
.ripro-game-score { color: #8ff4d8; margin-left: 8px; }

/* 亮色模式使用浅蓝、薄荷绿和深蓝文字。 */
[data-bs-theme="light"] .home-search-box .ripro-game-hero {
    background: #f1f7fc;
    border-bottom-color: #d3e4ed;
}

[data-bs-theme="light"] .ripro-game-vignette {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, .5), transparent 65%),
        linear-gradient(0deg, rgba(236, 245, 251, .75), transparent 35%);
}

[data-bs-theme="light"] .home-search-box .ripro-game-hero .search-title {
    color: #203b60;
    text-shadow: none;
}

[data-bs-theme="light"] .ripro-game-hero .search-desc,
[data-bs-theme="light"] .ripro-game-hero .search-hots,
[data-bs-theme="light"] .ripro-game-hero .ripro-game-hint {
    color: #506b83;
}

[data-bs-theme="light"] .ripro-game-hero .search-hots a {
    color: #2c6390;
}

[data-bs-theme="light"] .ripro-game-hero .search-form {
    box-shadow: 0 8px 30px rgba(42, 85, 131, .12);
    border-color: #cbdfe9;
}

[data-bs-theme="light"] .ripro-game-score { color: #087e6b; }
[data-bs-theme="light"] .ripro-game-crystal:focus-visible { outline-color: #245f9b; }
[data-bs-theme="light"] .ripro-game-crystal::before {
    background: linear-gradient(135deg, #edfff9, #2cbea5 35%, #357ecc 65%, #8670dc);
    filter: drop-shadow(0 3px 5px rgba(36, 103, 132, .2));
}

[data-bs-theme="light"] .ripro-game-crystal::after {
    border-color: rgba(25, 132, 128, .32);
    background: rgba(255, 255, 255, .2);
    box-shadow: 0 0 18px rgba(38, 149, 143, .12);
}

@keyframes ripro-crystal-float {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-10px) rotate(6deg); }
}

@media (max-width: 767px) {
    .ripro-game-crystal { left: 12%; top: 12%; width: 25px; height: 30px; }
    .ripro-game-crystal:nth-child(2) { left: 83%; top: 14%; }
    .ripro-game-crystal:nth-child(3) { left: 72%; top: 85%; }
}

@media (prefers-reduced-motion: reduce) {
    .ripro-game-crystal { animation: none; }
}

@media (max-width: 767px) {
    .home-search-box .ripro-game-hero .search-warp {
        padding-top: 80px;
        padding-bottom: 80px;
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* 卡片封面完整显示，覆盖父主题 bg-cover 的裁切模式。 */
.post-item .entry-media.ripro-natural-cover::before {
    display: none;
}

.post-item .entry-media.ripro-natural-cover > .media-img {
    position: relative;
    display: block;
    height: auto;
    background: transparent;
}

.post-item .ripro-natural-cover .ripro-cover-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border: 0;
}

.post-item .ripro-natural-cover .post-format-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.post-item .ripro-natural-cover .media-preview {
    top: 0;
    left: 0;
}

.post-item .entry-media > .media-img,
.post-item:hover .entry-media > .media-img {
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    transform: none !important;
}

.post-item .entry-media .media-preview > video {
    object-fit: contain;
    transform: none;
}

/* 侧栏标签云，兼容经典小工具和区块小工具。 */
.sidebar .tagcloud,
.sidebar .wp-block-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar .tagcloud a,
.sidebar .wp-block-tag-cloud a {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: linear-gradient(135deg, #10b981, #0ea372);
    color: #fff;
    font-size: 13px !important;
    line-height: 1.5;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.sidebar .tagcloud a:hover,
.sidebar .tagcloud a:focus-visible,
.sidebar .wp-block-tag-cloud a:hover,
.sidebar .wp-block-tag-cloud a:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, #0e9d6e, #0c8b61);
    color: #fff;
}

[data-bs-theme="dark"] .sidebar .tagcloud a,
[data-bs-theme="dark"] .sidebar .wp-block-tag-cloud a {
    border-color: transparent;
    background: linear-gradient(135deg, #10b981, #0ea372);
    color: #fff;
}

[data-bs-theme="dark"] .sidebar .tagcloud a:hover,
[data-bs-theme="dark"] .sidebar .tagcloud a:focus-visible,
[data-bs-theme="dark"] .sidebar .wp-block-tag-cloud a:hover,
[data-bs-theme="dark"] .sidebar .wp-block-tag-cloud a:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, #0e9d6e, #0c8b61);
    color: #fff;
}

/* 覆盖 WordPress 短代码外层的内联固定宽度，仅作用于文章正文。 */
body.single-post article.post-content .wp-video {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

body.single-post article.post-content .wp-video .mejs-container {
    width: 100% !important;
    max-width: 100%;
}

body.single-post article.post-content .wp-video video.wp-video-shortcode {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

body.single-post article.post-content .wp-video .mejs-mediaelement video {
    height: 100% !important;
}

.ripro-child-support {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.ripro-child-support > .ripro-child-support-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.ripro-child-support-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 4px;
}

.ripro-child-support > .ripro-child-support-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1100;
    display: none;
    box-sizing: border-box;
    width: 156px;
    max-width: calc(100vw - 24px);
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #333;
    box-shadow: 0 8px 28px rgb(0 0 0 / 18%);
    text-align: center;
    line-height: 1.5;
}

.ripro-child-support:focus-within > .ripro-child-support-panel {
    display: block;
}

@media (hover: hover) {
    .ripro-child-support:hover > .ripro-child-support-panel {
        display: block;
    }
}

.ripro-child-support > .ripro-child-support-panel > img {
    box-sizing: border-box;
    display: block;
    width: 134px;
    max-width: 100%;
    height: 134px;
    object-fit: contain;
    margin: 0 auto 6px;
}

.ripro-child-support-panel span {
    display: block;
    font-size: 12px;
    font-weight: 400;
}

.ri-down-warp .ripro-child-password {
    display: block;
    width: 100%;
    margin-top: 0;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #10b981, #0ea372);
    color: #fff;
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.ri-down-warp .ripro-child-password:hover,
.ri-down-warp .ripro-child-password:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, #0e9d6e, #0c8b61);
    color: #fff;
}

[data-bs-theme="dark"] .ri-down-warp .ripro-child-password {
    border-color: transparent;
    background: linear-gradient(135deg, #10b981, #0ea372);
    color: #fff;
}

[data-bs-theme="dark"] .ri-down-warp .ripro-child-password:hover,
[data-bs-theme="dark"] .ri-down-warp .ripro-child-password:focus-visible {
    border-color: transparent;
    background: linear-gradient(135deg, #0e9d6e, #0c8b61);
    color: #fff;
}
