/* Template-2 derivative skin — CSS variables drive theme fingerprint */
:root {
    --portal-bg: #1a1114;
    --portal-bg-deep: #120b0e;
    --portal-surface: #281820;
    --card-bg: #ffffff;
    --list-bg: #faf4f6;
    --text-dark: #27161c;
    --text-muted: #967a84;
    --border-color: #dbc8cf;
    --hover-bg: #f6e8ed;
    --accent-red: #861345;
    --accent-orange: #b91c5c;
    --accent-gold: #f472b6;
    --accent-deep: #861345;
    --radius: 8px;
    --grid-gap: 10px;
    --app-cols: 5;
    --shell-pad: 10px;
    --transition-speed: 0.25s;
}
/* 
 * Premium SEO-Optimized Standard CSS - 100% Custom Rewrite
 * Conforming to the latest HTML5 and CSS3 specifications.
 * Uses generic, highly semantic, and standard naming conventions (no site-specific or niche-specific prefixes).
 */

/* Reset & Scrollbar */
* {
    margin: 0;
    padding: 0;
    border: 0;
    box-sizing: content-box; /* Maintain exact pixel-perfect sizing calculations */
}

body {
    background-color: var(--portal-bg);
    font-size: 14px;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden; /* Prevent horizontal scrollbars globally as a robust safety net */
}

li {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Custom Scrollbars for SEO-friendly modern browsers */
::-webkit-scrollbar {
    width: 10px;
    background-color: var(--portal-bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--accent-orange);
    border-radius: 5px;
}

/* Header brand (base) */
.wv-brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.wv-brand a {
    color: #f7f3ea;
    text-shadow: none;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    transition: color .2s ease;
}
.wv-brand a:hover {
    color: var(--accent-gold);
}

.wv-logoico {
    color: var(--accent-gold);
}
.site-logo,
img.site-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    vertical-align: middle;
    display: inline-block;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* Shared shell width: topbar aligns with grid content edges */
body {
    --vp-cols: 7;
    /* fewer cards than viewport slots → shrink shell; never exceed viewport slots */
    --shell-max: min(calc(min(var(--cols, 7), var(--vp-cols)) * 250px - 10px + 20px), 1760px);
}

/* Main Grid Layout - fixed column count per viewport; equal row heights */
.wv-grid {
    box-sizing: border-box;
    max-width: var(--shell-max);
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(min(var(--cols, 7), var(--vp-cols)), minmax(0, 1fr));
    gap: 10px;
    justify-content: stretch;
    align-items: stretch;
}

/* Banner Ads */
.wv-banners {
    grid-column: 1 / -1; /* Span all columns of the grid layout */
    display: flex;
    gap: 10px;
    width: 100%;
}

.wv-banitem {
    flex: 1;
    min-width: 0; /* Prevent flex items from overflowing */
}

.wv-bancard {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wv-bancard {
    position: relative;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 6px 16px rgba(0,0,0,0.12);
    transform: translateZ(0);
    transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s cubic-bezier(.2,.8,.2,1);
}
.wv-bancard::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow .22s ease;
}
.wv-bancard img {
    width: 100%;
    display: block;
    transform: scale(1);
    transition: transform .28s cubic-bezier(.2,.8,.2,1), filter .22s ease;
}
@media (hover: hover) and (pointer: fine) {
    .wv-bancard:hover,
    .wv-bancard:focus-visible {
        transform: translateY(-4px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.12), 0 16px 32px rgba(255,153,0,0.22);
        outline: none;
    }
    .wv-bancard:hover::after,
    .wv-bancard:focus-visible::after {
        box-shadow: inset 0 0 0 2px rgba(255,153,0,0.55);
    }
    .wv-bancard:hover img,
    .wv-bancard:focus-visible img {
        transform: scale(1.03);
        filter: saturate(1.06) contrast(1.02);
    }
}

/* Base Card Box */
.wv-card {
    --card-accent: var(--accent-orange);
    --card-accent-soft: color-mix(in srgb, var(--card-accent) 16%, #ffffff);
    --card-accent-soft-2: color-mix(in srgb, var(--card-accent) 8%, #ffffff);
    --card-accent-ring: color-mix(in srgb, var(--card-accent) 42%, #ffffff);
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* APP Card Box (Double column span) */
.wv-card.wv-cardwide {
    grid-column: span 2;
    width: 100%;
}

/* APP Grid Scroller */
.wv-appscroll {
    flex: 1 1 0;
    min-height: 814px;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--list-bg);
    border-radius: 8px 8px 0 0;
    transition: background-color var(--transition-speed);
}

.wv-appscroll ul {
    padding: 10px 15px 20px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.wv-appitem {
    text-align: center;
    overflow: visible;
}

.wv-appitem a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 4px 7px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--text-dark);
    font-size: 13px;
    line-height: 1.2;
    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        transform .2s ease;
}

.wv-appitem img {
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 3px 8px rgba(0, 0, 0, 0.1);
    transition:
        transform .22s ease,
        box-shadow .22s ease,
        outline-color .22s ease;
}

.wv-appitem span {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 6px;
    font-weight: 700;
    transition: color .2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .wv-appitem:hover a,
    .wv-appitem a:focus-visible {
        color: var(--card-accent);
        background: linear-gradient(180deg, var(--card-accent-soft) 0%, var(--card-accent-soft-2) 100%);
        border-color: var(--card-accent-ring);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
        outline: none;
        transform: translateY(-1px);
    }
    .wv-appitem:hover img,
    .wv-appitem a:focus-visible img {
        transform: translateY(-2px) scale(1.04);
        box-shadow:
            0 0 0 2px var(--card-accent-ring),
            0 6px 14px color-mix(in srgb, var(--card-accent) 28%, transparent),
            0 2px 6px rgba(0, 0, 0, 0.12);
    }
    .wv-appitem:hover span,
    .wv-appitem a:focus-visible span {
        color: var(--card-accent);
    }
    .wv-appitem a:active {
        transform: translateY(0);
        background: var(--card-accent-soft);
        border-color: var(--card-accent-ring);
    }
    .wv-appitem a:active img {
        transform: translateY(0) scale(1.02);
    }
}
@media (prefers-reduced-motion: reduce) {
    .wv-bancard, .wv-bancard img, .wv-appitem a, .wv-appitem img { transition: none; }
    .wv-bancard:hover, .wv-appitem:hover a, .wv-appitem:hover img { transform: none; }
}

/* Card Header */
.wv-cardhd {
    height: 54px;
    line-height: 54px;
    width: 100%;
    color: #000000;
    border-radius: 8px 8px 0 0;
    position: relative;
    text-align: center;
    background-color: var(--card-bg);
    font-size: 15px;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}
.wv-cardhd .fa {
    margin-right: 6px;
    font-size: 15px;
    vertical-align: baseline;
    color: var(--card-accent, #333);
}

.wv-cardhd::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    border-radius: 1px;
    left: 50%;
    margin-left: -25px;
    bottom: 0;
    transition: all 0.3s;
}

.wv-card:hover .wv-cardhd::after {
    width: 100%;
    left: 0;
    margin-left: 0;
}

.wv-card:hover .wv-linkscroll,
.wv-card:hover .wv-appscroll {
    background-color: var(--card-bg);
}

/* Links Scroller — flex fill so same-row cards share equal height */
.wv-linkscroll {
    box-sizing: border-box;
    width: 100%;
    flex: 1 1 0;
    min-height: 360px;
    height: auto;
    padding: 10px 0;
    background-color: var(--list-bg);
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color var(--transition-speed);
}

.wv-linkscroll::-webkit-scrollbar,
.wv-appscroll::-webkit-scrollbar {
    width: 3px;
    background-color: var(--card-bg);
}

.wv-linkrow {
    height: 28px;
    line-height: 28px;
    width: 100%;
    position: relative;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, color .15s ease;
}

.wv-linkrow a {
    display: block;
    width: 100%;
    height: 100%;
    color: var(--text-dark);
    border-radius: inherit;
    -webkit-tap-highlight-color: transparent;
}

.wv-linkbody {
    height: 28px;
    line-height: 28px;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.wv-rank {
    height: 28px;
    width: 25px;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    padding-right: 5px;
    font-weight: bold;
}

.wv-favmark {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 6px 0 4px;
    border-radius: 50%;
    flex-shrink: 0;
    background-image: url("/shared/img/logolist.png");
    background-repeat: no-repeat;
    background-position: 0 0; /* overridden per-link via logoPos */
    overflow: hidden;
}

.wv-linktxt {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: bold;
}

.wv-linkrow:hover,
.wv-linkrow:hover a,
.wv-linkrow:active,
.wv-linkrow:active a,
.wv-linkrow:focus-within,
.wv-linkrow:focus-within a {
    background-color: var(--card-accent-soft);
    color: var(--card-accent);
}

.wv-linkrow:hover .wv-rank,
.wv-linkrow:active .wv-rank,
.wv-linkrow:focus-within .wv-rank {
    color: color-mix(in srgb, var(--card-accent) 72%, #222222) !important;
}

/* Override inline link colors (style="color:...") on hover / touch */
.wv-linkrow:hover .wv-linktxt,
.wv-linkrow:hover .wv-linktxt *,
.wv-linkrow:active .wv-linktxt,
.wv-linkrow:active .wv-linktxt *,
.wv-linkrow:focus-within .wv-linktxt,
.wv-linkrow:focus-within .wv-linktxt * {
    color: var(--card-accent) !important;
}

/* Card Bottom Action Pill */
.wv-cardft {
    box-sizing: content-box;
    height: 30px;
    border: 10px solid var(--card-bg);
    cursor: pointer;
    background: var(--list-bg);
    border-radius: 0 0 8px 8px;
    position: relative;
}

.wv-pill {
    color: #ffffff;
    margin: auto;
    display: block;
    height: 30px;
    line-height: 30px;
    width: 100%;
    border-radius: 15px;
    text-align: center;
    position: relative;
    font-weight: bold;
}

@keyframes pulse-scale-animation {
    0% { transform: scale(1); }
    50%, 75% { transform: scale(1.04, 1.4); }
    78%, 100% { opacity: 0; }
}

.wv-pill::before {
    content: '';
    display: block;
    width: 100%;
    height: 30px;
    border-radius: 15px;
    opacity: 0.7;
    position: absolute;
    left: 0;
    top: 0;
}

.wv-pill:hover::before {
    animation: pulse-scale-animation 1s 1 cubic-bezier(0, 0, .49, 1.02);
}

.wv-pill p {
    width: 100%;
    height: 30px;
    line-height: 30px;
    text-align: center;
    color: #ffffff;
    position: absolute;
    left: 0;
    top: 0;
}

.wv-cardhd,
.wv-cardft {
    flex-shrink: 0;
}

/* Dynamic Color Themes - accent drives border, underline, pills, and header icons */
.wv-card:nth-of-type(1)  { --card-accent: #009999; }
.wv-card:nth-of-type(2)  { --card-accent: #ff6666; }
.wv-card:nth-of-type(3)  { --card-accent: #f0ab09; }
.wv-card:nth-of-type(4)  { --card-accent: #339933; }
.wv-card:nth-of-type(5)  { --card-accent: #ff6fb7; }
.wv-card:nth-of-type(6)  { --card-accent: #c9bc25; }
.wv-card:nth-of-type(7)  { --card-accent: #ff80c0; }
.wv-card:nth-of-type(8)  { --card-accent: var(--accent-orange); }
.wv-card:nth-of-type(9)  { --card-accent: #36b2cd; }
.wv-card:nth-of-type(10) { --card-accent: #ff6666; }
.wv-card:nth-of-type(11) { --card-accent: #d8b445; }
.wv-card:nth-of-type(12) { --card-accent: #ea6c9e; }
.wv-card:nth-of-type(13) { --card-accent: #f8d549; }
.wv-card:nth-of-type(14) { --card-accent: #c79650; }
.wv-card:nth-of-type(15) { --card-accent: #c173db; }
.wv-card:nth-of-type(16) { --card-accent: #8ac842; }
.wv-card:nth-of-type(17) { --card-accent: #2ebbcf; }
.wv-card:nth-of-type(18) { --card-accent: #bfbc2d; }
.wv-card:nth-of-type(19) { --card-accent: #ff6666; }
.wv-card:nth-of-type(20) { --card-accent: var(--accent-orange); }
.wv-card,
.wv-card .wv-cardhd::after,
.wv-card .wv-appscroll::-webkit-scrollbar-thumb,
.wv-card .wv-linkscroll::-webkit-scrollbar-thumb,
.wv-card .wv-pill,
.wv-card .wv-pill::before {
    background-color: var(--card-accent);
}

/* Responsive column counts — shell width tracks column count */
@media screen and (min-width: 1851px) {
    body { --vp-cols: 7; }
}

@media screen and (min-width: 1600px) and (max-width: 1850px) {
    body { --vp-cols: 6; }
}

@media screen and (min-width: 1350px) and (max-width: 1599px) {
    body { --vp-cols: 5; }
}

@media screen and (min-width: 1100px) and (max-width: 1349px) {
    body { --vp-cols: 4; }
}

@media screen and (min-width: 800px) and (max-width: 1099px) {
    body { --vp-cols: 3; }
    .wv-appscroll { min-height: 640px; }
}

@media screen and (min-width: 551px) and (max-width: 799px) {
    body { --vp-cols: 2; }
    .wv-grid {
        padding: 10px 8px;
        gap: 10px;
    }
    .wv-appscroll { min-height: 480px; }
    .wv-appscroll ul {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        padding: 10px 10px 14px;
    }
    .wv-linkscroll { min-height: 280px; }
    .wv-cardhd {
        height: 48px;
        line-height: 48px;
        font-size: 14px;
    }
}

/* Phone: one card per row; inside each card, 3 link items per row */
@media screen and (max-width: 550px) {
    body {
        --vp-cols: 1;
        --shell-max: 100%;
    }
    .wv-banners {
        flex-direction: column;
        margin-bottom: 4px;
        gap: 8px;
    }
    .wv-banitem { width: 100%; }
    .wv-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 10px 10px 4px;
        gap: 12px;
        align-items: start;
    }
    .wv-card {
        width: 100% !important;
        height: auto;
        min-width: 0;
        box-sizing: border-box;
        border-radius: 12px;
        padding: 3px;
    }
    .wv-card.wv-cardwide {
        grid-column: span 1;
        width: 100% !important;
    }
    .wv-cardhd {
        height: 46px;
        line-height: 46px;
        font-size: 14px;
        border-radius: 10px 10px 0 0;
    }
    .wv-cardhd .fa { font-size: 14px; }
    .wv-appscroll {
        height: auto;
        flex: none;
        min-height: 0;
        max-height: none;
        border-radius: 10px 10px 0 0;
    }
    .wv-appscroll ul {
        padding: 8px 8px 12px;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px 4px;
    }
    .wv-appitem a {
        padding: 8px 2px 6px;
        border-radius: 10px;
    }
    .wv-appitem img {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }
    .wv-appitem span {
        margin-top: 5px;
        font-size: 11px;
    }
    .wv-linkscroll {
        width: 100%;
        height: auto !important;
        flex: none;
        min-height: 0;
        max-height: 360px;
        padding: 6px 4px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }
    #featured .wv-linkscroll,
    #tuijian .wv-linkscroll {
        max-height: 420px;
    }
    .wv-linkscroll ul {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px 4px;
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    .wv-linkscroll ul li,
    .wv-linkrow {
        float: none;
        width: auto;
        min-width: 0;
        box-sizing: border-box;
        height: 36px;
        line-height: 36px;
        border-radius: 8px;
    }
    .wv-linkrow a { height: 100%; }
    .wv-linkbody {
        height: 36px;
        line-height: 36px;
        padding: 0 4px;
        box-sizing: border-box;
    }
    .wv-rank {
        height: 36px;
        line-height: 36px;
        width: 16px;
        font-size: 10px;
        padding-right: 1px;
        flex-shrink: 0;
    }
    .wv-favmark {
        display: inline-block;
        width: 14px;
        height: 14px;
        margin: 0 2px 0 1px;
        flex-shrink: 0;
    }
    .wv-linktxt { font-size: 12px; min-width: 0; }
    /* Mobile content select: same accent soft fill as PC hover */
    .wv-card {
        --card-accent-soft: color-mix(in srgb, var(--card-accent) 20%, #ffffff);
        --card-accent-soft-2: color-mix(in srgb, var(--card-accent) 10%, #ffffff);
    }
    .wv-linkrow:hover,
    .wv-linkrow:active,
    .wv-linkrow:focus-within {
        background-color: var(--card-accent-soft);
        box-shadow: inset 0 0 0 1px var(--card-accent-ring);
    }
    .wv-appitem {
        -webkit-tap-highlight-color: transparent;
    }
    .wv-appitem a {
        border: 1px solid transparent;
        transition:
            background-color .15s ease,
            color .15s ease,
            border-color .15s ease,
            box-shadow .15s ease;
    }
    .wv-appitem:hover a,
    .wv-appitem:active a,
    .wv-appitem a:focus-visible {
        color: var(--card-accent);
        background: linear-gradient(180deg, var(--card-accent-soft) 0%, var(--card-accent-soft-2) 100%);
        border-color: var(--card-accent-ring);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
        outline: none;
    }
    .wv-appitem:hover img,
    .wv-appitem:active img,
    .wv-appitem a:focus-visible img {
        box-shadow:
            0 0 0 2px var(--card-accent-ring),
            0 4px 12px color-mix(in srgb, var(--card-accent) 26%, transparent);
    }
    .wv-appitem:hover span,
    .wv-appitem:active span,
    .wv-appitem a:focus-visible span {
        color: var(--card-accent);
    }
    .wv-cardft {
        border-width: 8px;
        height: 28px;
    }
    .wv-pill,
    .wv-pill::before,
    .wv-pill p {
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
}

@media screen and (max-width: 460px) {
    .wv-grid { padding: 8px 8px 2px; gap: 10px; }
    .wv-appscroll ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px 2px;
    }
    .wv-appitem img { width: 44px; height: 44px; }
    .wv-appitem span { font-size: 10px; }
    .wv-linkscroll { max-height: 320px; }
    #featured .wv-linkscroll,
    #tuijian .wv-linkscroll { max-height: 380px; }
    .wv-linktxt { font-size: 11px; }
    .wv-rank { width: 16px; font-size: 9px; }
}

/* ---- Portal chrome: header + footer ---- */
.wv-header {
    position: relative;
    padding: 18px 0 16px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, var(--portal-surface) 0%, var(--portal-bg) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.wv-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent-orange) 35%, var(--accent-gold) 50%, var(--accent-orange) 65%, var(--accent-deep));
    opacity: 0.9;
    pointer-events: none;
}
.wv-header::after {
    content: none;
}
.wv-topbar {
    /* Keep header usable even when content shell shrinks to 2–3 cols */
    max-width: min(100%, max(var(--shell-max), 1080px));
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 14px 16px;
    box-sizing: border-box;
    padding: 0 14px;
    min-height: 52px;
}
.wv-topbar .wv-brand {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(320px, 34%);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wv-topbar .wv-brand a {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wv-topacts {
    --top-ctrl-h: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 14px;
    margin-left: auto;
    flex: 1 1 auto;
    min-width: 0;
}
.wv-search {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 248px;
    width: 248px;
    min-width: 140px;
    max-width: 280px;
    height: var(--top-ctrl-h);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.wv-search:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: color-mix(in srgb, var(--accent-orange) 55%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-orange) 16%, transparent);
}
.wv-searchinp {
    flex: 1;
    border: 0;
    padding: 0 12px;
    height: 100%;
    font-size: 13px;
    line-height: var(--top-ctrl-h);
    outline: none;
    background: transparent;
    box-sizing: border-box;
    min-width: 0;
    color: #f2f2f2;
}
.wv-searchinp::placeholder {
    color: rgba(255, 255, 255, 0.42);
}
.wv-searchbtn {
    border: 0;
    align-self: stretch;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--accent-orange);
    padding: 0 12px;
    cursor: pointer;
    font-size: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: background .2s ease, color .2s ease;
}
.wv-searchbtn:hover {
    background: color-mix(in srgb, var(--accent-orange) 16%, transparent);
    color: var(--accent-gold);
}
.wv-toplinks {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0;
    height: var(--top-ctrl-h);
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.wv-toplinks a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-sizing: border-box;
    height: var(--top-ctrl-h);
    color: #e6e6e6;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    transition: color .18s ease, background .18s ease;
}
.wv-toplinks a .fa {
    color: inherit;
    font-size: 12px;
    flex-shrink: 0;
}
.wv-toplinks a:hover {
    color: var(--accent-orange);
    background: color-mix(in srgb, var(--accent-orange) 10%, transparent);
}
.wv-toplinks a.active {
    color: var(--accent-orange);
    background: color-mix(in srgb, var(--accent-orange) 14%, transparent);
}

/* Footer — same quiet chrome language as header */
.wv-footer {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin-top: 36px;
    padding: 22px 0 26px;
    clear: both;
    text-align: center;
    color: #c8c8c8;
    font-size: 13px;
    background: linear-gradient(180deg, var(--portal-surface) 0%, var(--portal-bg) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: none;
}
.wv-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-deep), var(--accent-orange) 35%, var(--accent-gold) 50%, var(--accent-orange) 65%, var(--accent-deep));
    opacity: 0.9;
    pointer-events: none;
}
.wv-footinner {
    max-width: min(100%, max(var(--shell-max), 1080px));
    width: 100%;
    margin: 0 auto;
    padding: 0 14px;
    box-sizing: border-box;
}
.wv-footlinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2px 4px;
    margin-bottom: 14px;
}
.wv-footlinks a {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    height: 36px;
    color: #e6e6e6;
    font-weight: 600;
    font-size: 13px;
    padding: 0 12px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    transition: color .18s ease, background .18s ease;
}
.wv-footlinks a:hover {
    color: var(--accent-orange);
    background: color-mix(in srgb, var(--accent-orange) 10%, transparent);
    transform: none;
}
.wv-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    color: #b0b0b0;
    margin: 0 0 10px;
}
.wv-contitem {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
}
.wv-contitem .fa {
    color: var(--accent-orange);
    opacity: 0.9;
    font-size: 12px;
}
.wv-contact a {
    color: #e6e6e6;
    font-weight: 600;
    transition: color .18s ease;
}
.wv-contact a:hover { color: var(--accent-orange); }
.wv-copy {
    margin: 0 0 10px;
    color: #8f8f8f;
    font-size: 12px;
}
.wv-copy a {
    color: #cfcfcf;
    font-weight: 600;
    transition: color .18s ease;
}
.wv-copy a:hover { color: var(--accent-orange); }
.wv-warn {
    max-width: 920px;
    margin: 0 auto;
    padding: 0;
    color: #8a8a8a;
    font-size: 12px;
    line-height: 1.65;
    border-radius: 0;
    border: 0;
    background: transparent;
}
.wv-warn .fa {
    color: var(--accent-orange);
    opacity: 0.85;
    margin-right: 4px;
}

.portal-sidebar {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 70vh;
    overflow: auto;
}
.portal-sidebtn {
    display: block;
    min-width: 72px;
    background: rgba(30,30,30,0.92);
    color: #eee;
    border: 1px solid rgba(255,153,0,0.35);
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.portal-sidebtn:hover {
    background: var(--accent-orange);
    color: #111;
}
.portal-sidetop { font-size: 14px; }

/* ---- Subpages (match homepage chrome) ---- */
.wv-subpage {
    box-sizing: border-box;
    max-width: min(100%, max(var(--shell-max), 1080px));
    width: 100%;
    margin: 0 auto;
    padding: 18px 14px 8px;
}
.wv-subshell {
    max-width: 860px;
    margin: 0 auto 28px;
    padding: 0;
}
.wv-homebar {
    max-width: 860px;
    margin: 0 auto 12px;
    padding: 0;
}
.wv-homebar a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    color: #e6e6e6;
    font-weight: 600;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.wv-homebar a:hover {
    color: var(--accent-orange);
    background: color-mix(in srgb, var(--accent-orange) 10%, transparent);
    border-color: color-mix(in srgb, var(--accent-orange) 28%, transparent);
}
.wv-subpanel {
    background: #fff;
    border-radius: 12px;
    padding: 22px 24px 26px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    color: #222;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.wv-subpanel h2 {
    font-size: 18px;
    margin: 0 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid #ececec;
    color: var(--portal-bg-deep);
    display: flex;
    align-items: center;
    gap: 8px;
}
.wv-subpanel h2 .fa {
    color: var(--accent-orange);
}
.wv-subpanel h3 {
    font-size: 15px;
    margin: 18px 0 8px;
    color: #222;
}
.wv-subpanel h3 .fa {
    color: var(--accent-orange);
    margin-right: 4px;
}
.wv-subpanel p,
.wv-subpanel li {
    font-size: 13px;
    line-height: 1.75;
    color: #444;
}
.wv-subpanel a {
    color: var(--accent-deep);
    font-weight: 600;
    transition: color .18s ease;
}
.wv-subpanel a:hover {
    color: var(--accent-orange);
}
.wv-subpanel ul { padding-left: 18px; margin: 8px 0; }
.wv-subpanel li { list-style: disc; margin: 5px 0; }
.wv-subpanel .wv-tipbox {
    background: linear-gradient(180deg, #fff8eb 0%, #fff4df 100%);
    border: 1px solid color-mix(in srgb, var(--accent-orange) 28%, transparent);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.wv-subpanel .wv-tipbox h3 {
    margin-top: 0;
}
.wv-subpanel .wv-chip {
    display: inline-block;
    background: #fff;
    border: 1px solid #ead7b3;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #8a4b00;
}
.wv-subpanel .wv-contcard {
    background: #faf7f2;
    border: 1px solid color-mix(in srgb, var(--accent-orange) 18%, transparent);
    border-radius: 10px;
    padding: 14px 16px;
}
.wv-subpanel .wv-contcard p {
    margin: 6px 0;
}
.wv-subpanel .wv-contcard .fa {
    color: var(--accent-orange);
    margin-right: 4px;
}
.wv-subpanel .wv-subnote {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 153, 0, 0.08);
    border: 1px solid color-mix(in srgb, var(--accent-orange) 16%, transparent);
    color: #666;
}
.wv-subpanel .wv-rules {
    list-style: none;
    padding-left: 0;
}
.wv-subpanel .wv-rules li {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    margin: 0 0 6px;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #efefef;
}
.wv-subpanel .wv-rules li .fa {
    color: var(--accent-orange);
    margin-top: 2px;
}
.wv-searchrow {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.wv-subpin {
    flex: 1;
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 14px;
    height: 42px;
    font-size: 14px;
    box-sizing: border-box;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.wv-subpin:focus {
    border-color: rgba(255, 153, 0, 0.65);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-orange) 15%, transparent);
}
.wv-subpbtn {
    border: 0;
    border-radius: 8px;
    background: var(--accent-orange);
    color: var(--portal-bg-deep);
    padding: 0 18px;
    height: 42px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .18s ease;
}
.wv-subpbtn:hover {
    background: var(--accent-gold);
}
.wv-restitle {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e8e8e8;
}
.wv-resgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.wv-resitem a,
.wv-resitem .wv-reslink {
    display: block;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 12px 14px;
    background: #fafafa;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.wv-resitem a:hover,
.wv-resitem .wv-reslink:hover {
    border-color: rgba(255, 153, 0, 0.4);
    background: color-mix(in srgb, var(--accent-orange) 10%, #ffffff);
    transform: translateY(-1px);
}
.wv-resname {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    color: #222;
}
.wv-resdesc {
    display: block;
    font-size: 12px;
    color: #777;
    line-height: 1.5;
}
.wv-resempty {
    grid-column: 1 / -1;
    list-style: none;
    padding: 16px;
    border-radius: 10px;
    background: #fff8eb;
    border: 1px solid color-mix(in srgb, var(--accent-orange) 22%, transparent);
    color: #666;
}
.wv-resempty .fa {
    color: var(--accent-orange);
    margin-right: 6px;
}

@media screen and (max-width: 900px) {
    .wv-subpage { padding: 12px 12px 4px; }
    .wv-subshell,
    .wv-homebar { max-width: 100%; }
    .wv-subpanel { padding: 16px 14px 20px; border-radius: 12px; }
    .wv-subpanel h2 { font-size: 16px; }
    .wv-searchrow { flex-direction: column; gap: 8px; }
    .wv-subpin,
    .wv-subpbtn { height: 40px; }
    .wv-subpbtn { width: 100%; justify-content: center; }
    .wv-resgrid { grid-template-columns: 1fr; gap: 8px; }
}

/* Wide-mid: tighten spacing, keep one row */
@media screen and (max-width: 1400px) and (min-width: 1201px) {
    .wv-toplinks a { font-size: 12px; padding: 0 7px; gap: 4px; }
    .wv-search { flex: 0 0 220px; width: 220px; }
}

/* Mid desktop: hide link icons to keep one complete row */
@media screen and (max-width: 1200px) and (min-width: 1101px) {
    .wv-topbar .wv-brand { max-width: min(260px, 28%); }
    .wv-search { flex: 0 0 180px; width: 180px; max-width: 200px; }
    .wv-toplinks a { font-size: 12px; padding: 0 6px; gap: 0; }
    .wv-toplinks a .fa { display: none; }
}

/*
 * Narrow desktop / large tablet:
 * row1 = brand + search, row2 = full nav (no overflow / no clipping)
 */
@media screen and (max-width: 1100px) and (min-width: 901px) {
    .wv-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
        grid-template-areas:
            "brand search"
            "links links";
        column-gap: 14px;
        row-gap: 12px;
        align-items: center;
        max-width: min(100%, max(var(--shell-max), 100%));
    }
    .wv-topbar .wv-brand {
        grid-area: brand;
        max-width: 100%;
        font-size: 22px;
    }
    .wv-topacts {
        display: contents;
    }
    .wv-search {
        grid-area: search;
        width: 100%;
        max-width: none;
        flex: none;
        min-width: 0;
    }
    .wv-toplinks {
        grid-area: links;
        width: 100%;
        height: auto;
        min-height: 36px;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px 2px;
        overflow: visible;
    }
    .wv-toplinks a {
        font-size: 12px;
        height: var(--top-ctrl-h);
        padding: 0 10px;
    }
}

/* Mobile / small tablet: stacked header, PC-like quiet chrome */
@media screen and (max-width: 900px) {
    .portal-sidebar { display: none; }
    .wv-header {
        padding: 12px 0 14px;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
    }
    .wv-topbar {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: stretch;
        gap: 10px;
        min-height: 0;
        max-width: 100%;
        padding: 0 12px;
    }
    .wv-topbar .wv-brand {
        text-align: center;
        font-size: 20px;
        letter-spacing: 0.03em;
        max-width: 100%;
        margin: 0 auto;
    }
    .wv-topbar .wv-brand a {
        justify-content: center;
        gap: 8px;
    }
    .wv-topbar .site-logo,
    .wv-topbar img.site-logo {
        width: 30px;
        height: 30px;
    }
    .wv-topacts {
        --top-ctrl-h: 40px;
        display: flex;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-left: 0;
        gap: 10px;
    }
    .wv-search {
        width: 100%;
        max-width: none;
        min-width: 0;
        flex: none;
        height: var(--top-ctrl-h);
        border-radius: 8px;
    }
    .wv-toplinks {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 2px;
        width: 100%;
        height: auto;
        justify-content: stretch;
        align-items: start;
        overflow: visible;
        flex: none;
        padding: 0;
    }
    .wv-toplinks a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 3px;
        min-width: 0;
        height: auto;
        min-height: 0;
        padding: 6px 1px;
        font-size: 10px;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
        word-break: keep-all;
        border-radius: 8px;
        background: transparent;
        border: 0;
    }
    .wv-toplinks a .fa {
        display: block;
        margin: 0;
        font-size: 15px;
        line-height: 1;
        color: var(--accent-orange);
    }
    .wv-toplinks a.active {
        background: color-mix(in srgb, var(--accent-orange) 14%, transparent);
        color: #fff;
    }
    .wv-toplinks a.active .fa { color: var(--accent-orange); }
    .wv-footer { padding: 18px 0 22px; margin-top: 20px; }
    .wv-footinner { padding: 0 12px; }
    .wv-footlinks {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 2px;
        margin-bottom: 12px;
        width: 100%;
        flex-wrap: nowrap;
    }
    .wv-footlinks a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 34px;
        padding: 6px 2px;
        font-size: 10px;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
        word-break: keep-all;
        background: transparent;
        border: 0;
        border-radius: 8px;
    }
    .wv-contact { gap: 8px 14px; }
    .wv-warn { margin: 0; font-size: 11px; line-height: 1.55; }
}

@media screen and (max-width: 420px) {
    .wv-toplinks a {
        font-size: 9px;
        padding: 5px 0;
    }
    .wv-toplinks a .fa { font-size: 14px; }
    .wv-searchinp { padding: 0 10px; font-size: 12px; }
    .wv-searchinp::placeholder { font-size: 12px; }
}

/* Touch devices: PC-equivalent accent select on press / sticky hover */
@media (hover: none) and (pointer: coarse) {
    .wv-linkrow:hover,
    .wv-linkrow:active,
    .wv-linkrow:focus-within {
        background-color: var(--card-accent-soft);
        box-shadow: inset 0 0 0 1px var(--card-accent-ring);
    }
    .wv-linkrow:hover a,
    .wv-linkrow:active a,
    .wv-linkrow:focus-within a,
    .wv-linkrow:hover .wv-linktxt,
    .wv-linkrow:active .wv-linktxt,
    .wv-linkrow:focus-within .wv-linktxt,
    .wv-linkrow:hover .wv-linktxt *,
    .wv-linkrow:active .wv-linktxt *,
    .wv-linkrow:focus-within .wv-linktxt * {
        color: var(--card-accent) !important;
    }
    .wv-linkrow:hover .wv-rank,
    .wv-linkrow:active .wv-rank,
    .wv-linkrow:focus-within .wv-rank {
        color: color-mix(in srgb, var(--card-accent) 72%, #222222) !important;
    }
    .wv-appitem:hover a,
    .wv-appitem:active a {
        color: var(--card-accent);
        background: linear-gradient(180deg, var(--card-accent-soft) 0%, var(--card-accent-soft-2) 100%);
        border-color: var(--card-accent-ring);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    }
    .wv-appitem:hover img,
    .wv-appitem:active img {
        box-shadow:
            0 0 0 2px var(--card-accent-ring),
            0 4px 12px color-mix(in srgb, var(--card-accent) 26%, transparent);
    }
    .wv-appitem:hover span,
    .wv-appitem:active span {
        color: var(--card-accent);
    }
    .wv-toplinks a:active,
    .wv-footlinks a:active,
    .wv-homebar a:active {
        color: var(--accent-orange);
        background: color-mix(in srgb, var(--accent-orange) 14%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wv-brand a,
    .wv-search,
    .wv-searchbtn,
    .wv-toplinks a,
    .wv-footlinks a {
        transition: none;
    }
}

/* Skin geometry fingerprint */
.wv-grid { gap: var(--grid-gap) !important; padding: var(--shell-pad) !important; }
.wv-card,
.wv-subpanel,
.wv-search,
.wv-bancard,
.wv-tipbox,
.wv-contcard {
    border-radius: var(--radius) !important;
}
.wv-appscroll ul {
    grid-template-columns: repeat(var(--app-cols), minmax(0, 1fr)) !important;
}
.wv-header,
.wv-footer {
    border-radius: 0;
}
.wv-cardhd {
    border-radius: var(--radius) var(--radius) 0 0 !important;
}
.wv-cardft {
    border-radius: 0 0 var(--radius) var(--radius) !important;
}
.wv-pill,
.wv-pill::before {
    border-radius: calc(var(--radius) + 8px) !important;
}
.wv-toplinks a,
.wv-footlinks a,
.wv-homebar a,
.wv-linkrow {
    border-radius: var(--radius) !important;
}
