/* ===========================
   YS Tools Public Styles
   Theme Compatible Style
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ys-tools-wrapper {
    background: var(--body-bg-color, #f5f6f7);
    min-height: 100vh;
    padding: 20px 0;
}

.ys-tools-container {
    max-width: var(--mian-max-width, 1200px);
    margin: 0 auto;
    padding: 0 10px;
}

.ys-tools-hero {
    padding: 20px 0 16px;
    text-align: center;
}

.ys-tools-search-title {
    color: var(--key-color, #333);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}

.ys-tools-search-desc {
    color: var(--muted-color, #777);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

/* Search Box */
.ys-tools-search-box {
    background: var(--main-bg-color, #fff);
    padding: 15px;
    border-radius: var(--main-radius, 8px);
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.ys-tools-search-input {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    height: 38px;
    padding: 0 15px;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: var(--main-radius, 8px);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: var(--body-bg-color, #f5f6f7);
    color: var(--main-color, #4e5358);
    -webkit-appearance: none;
    appearance: none;
}

.ys-tools-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.ys-tools-search-input:focus {
    border-color: var(--focus-color, #f04494);
    box-shadow: 0 0 2px 3px var(--focus-shadow-color, rgba(253, 83, 161, 0.4));
}

.ys-tools-search-btn {
    flex: 0 0 auto;
    height: 38px;
    min-width: 82px;
    padding: 0 25px;
    background: var(--focus-color, #f04494);
    color: #fff;
    border: none;
    border-radius: var(--main-radius, 8px);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ys-tools-search-btn:hover {
    opacity: 0.8;
}

/* Header */
.ys-tools-header {
    margin-bottom: 20px;
}

.ys-tools-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--key-color, #333);
    margin: 0;
    line-height: 1.2;
    padding-bottom: 8px;
    position: relative;
}

.ys-tools-title::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 3px;
    background: var(--theme-color, #f04494);
    left: 0;
    bottom: 3px;
    border-radius: 5px;
    box-shadow: 1px 1px 3px -1px var(--theme-color, #f04494);
}

/* Grid Layout */
.ys-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ys-tools-load-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.ys-tools-load-more {
    align-items: center;
    background: var(--theme-color, #f04494);
    border: 1px solid var(--theme-color, #f04494);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    justify-content: center;
    min-width: 120px;
    padding: 0 22px;
    transition: opacity .2s, transform .2s;
}

.ys-tools-load-more:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.ys-tools-load-more:disabled {
    cursor: default;
    opacity: .72;
    transform: none;
}

/* ===========================
   Tool Widgets (Grid with Icon+Title)
   =========================== */
.ys-tool-widgets {
    margin-bottom: 18px;
}

.ys-tool-widgets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--main-bg-color, #fff);
    padding: 12px 14px;
    border-radius: var(--main-radius, 8px);
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
    margin-bottom: 12px;
}

.ys-tool-widgets-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--key-color, #333);
}

.ys-tool-widgets-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ys-tool-widgets-btn {
    height: 32px;
    padding: 0 12px;
    background: var(--focus-color, #f04494);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.ys-tool-widgets-btn.is-ghost {
    background: transparent;
    color: var(--key-color, #333);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.08));
}

.ys-tool-widgets-btn:hover {
    opacity: 0.9;
}

.ys-tool-widgets-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.ys-tool-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 10px);
    text-decoration: none;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.06));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ys-tool-widget:hover {
    transform: translateY(-2px);
    border-color: rgba(240, 68, 148, 0.35);
}

.ys-tool-widget-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.03));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-tool-widget-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ys-tool-widget-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--key-color, #333);
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 1100px) {
    .ys-tool-widgets-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .ys-tool-widgets-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .ys-tool-widgets-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .ys-tool-widgets-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Card Base - Theme Style */
.ys-tools-card {
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    overflow: hidden;
    text-decoration: none;
    display: block;
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
    transition: all 0.3s ease;
}

.ys-tools-card:hover {
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
    transform: translateY(-4px);
}

/* Card Thumbnail */
.ys-tools-card-thumb {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.03));
}

.ys-tools-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ys-tools-card:hover .ys-tools-card-thumb img {
    transform: scale(1.05);
}

/* Card Body - Hidden but searchable */
.ys-tools-card-body {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    margin: 0 !important;
}

.ys-tools-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--key-color, #333);
    margin: 0 0 8px;
    line-height: 1.4;
}

.ys-tools-card-desc {
    font-size: 13px;
    color: var(--muted-color, #777);
    margin: 0;
    line-height: 1.5;
}

/* Empty State */
.ys-tools-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.ys-tools-empty p {
    font-size: 14px;
    color: var(--muted-2-color, #999);
}

/* ===========================
   Skins (Public)
   =========================== */

.ys-skins-actions {
    display: flex;
    justify-content: flex-end;
    margin: 10px 0 16px;
}

.ys-skins-upload-btn {
    height: 38px;
    padding: 0 18px;
    background: var(--focus-color, #f04494);
    color: #fff;
    border: none;
    border-radius: var(--main-radius, 8px);
    font-size: 14px;
    cursor: pointer;
}

.ys-skins-upload-card {
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    padding: 14px;
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
    margin-bottom: 16px;
}

.ys-skins-upload-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.ys-skins-upload-row label {
    width: 120px;
    color: var(--main-color, #4e5358);
    font-size: 14px;
}

.ys-skins-upload-row input[type="text"],
.ys-skins-upload-row select,
.ys-skins-upload-row input[type="file"] {
    flex: 1;
    height: 38px;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: var(--main-radius, 8px);
    padding: 0 12px;
    background: var(--body-bg-color, #f5f6f7);
}

.ys-skins-upload-row-actions {
    justify-content: flex-end;
}

.ys-skins-primary,
.ys-skins-secondary {
    height: 36px;
    padding: 0 14px;
    border-radius: var(--main-radius, 8px);
    cursor: pointer;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    background: #fff;
}

.ys-skins-primary {
    background: var(--focus-color, #f04494);
    border-color: var(--focus-color, #f04494);
    color: #fff;
}

.ys-skins-status {
    margin-left: 10px;
    font-size: 13px;
    color: var(--muted-2-color, #999);
}

.ys-skins-status.is-error {
    color: #c62828;
}

.ys-skins-status.is-ok {
    color: #2e7d32;
}

.ys-skins-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 960px) {
    .ys-skins-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .ys-skins-grid {
        grid-template-columns: 1fr;
    }

    .ys-skins-upload-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ys-skins-upload-row label {
        width: auto;
    }
}

.ys-skin-card {
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    padding: 12px;
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ys-skin-thumb {
    height: 160px;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.03));
    border-radius: var(--main-radius, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ys-skin-thumb img {
    width: 128px;
    height: 128px;
    image-rendering: pixelated;
}

.ys-skin-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--key-color, #333);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ys-skins-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(240, 68, 148, 0.12);
    color: var(--focus-color, #f04494);
}

.ys-skin-sub {
    font-size: 12px;
    color: var(--muted-2-color, #999);
}

.ys-skin-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ys-skin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--main-radius, 8px);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    color: var(--main-color, #4e5358);
}

.ys-skin-btn:hover {
    border-color: var(--focus-color, #f04494);
}

/* ===========================
   Skin View (Public)
   =========================== */

.ys-skin-view-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
}

@media (max-width: 960px) {
    .ys-skin-view-grid {
        grid-template-columns: 1fr;
    }
}

.ys-skin-view-card {
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    padding: 12px;
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.ys-skin-view-title {
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--key-color, #333);
}

.ys-skin-3d {
    height: 420px;
    background: var(--body-bg-color, #f5f6f7);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: var(--main-radius, 8px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-skin-3d canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.ys-skin-3d-placeholder {
    color: var(--muted-2-color, #999);
    font-size: 13px;
}

.ys-skin-2d-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ys-skin-2d-item img {
    max-width: 100%;
    border-radius: var(--main-radius, 8px);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    background: var(--body-bg-color, #f5f6f7);
}

#ys-skin-head {
    width: 128px;
    height: 128px;
    image-rendering: pixelated;
}

.ys-skin-2d-label {
    font-size: 13px;
    color: var(--muted-2-color, #999);
    margin-bottom: 6px;
}

.ys-skin-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--main-color, #4e5358);
}

.ys-skin-info-line {
    margin: 4px 0;
}

.ys-skin-view-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}


/* Pagination - Theme Style */
.ys-tools-pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 15px 0;
}

.ys-tools-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 12px;
    background: var(--main-bg-color, #fff);
    color: var(--main-color, #4e5358);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    border-radius: var(--main-radius, 8px);
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.ys-tools-pagination .page-numbers:hover {
    background: var(--focus-color, #f04494);
    color: #fff;
    border-color: var(--focus-color, #f04494);
}

.ys-tools-pagination .page-numbers.current {
    background: var(--focus-color, #f04494);
    color: #fff;
    border-color: var(--focus-color, #f04494);
}

.ys-tools-pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    cursor: default;
    color: var(--muted-2-color, #999);
}

.ys-tools-pagination .page-numbers.dots:hover {
    background: transparent;
    color: var(--muted-2-color, #999);
    border-color: transparent;
}

/* Responsive */
@media (max-width: 992px) {
    .ys-tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ys-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .ys-tools-search-box {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 12px;
    }

    .ys-tools-hero {
        padding: 14px 0 12px;
    }

    .ys-tools-search-title {
        font-size: 20px;
    }

    .ys-tools-search-desc {
        font-size: 12px;
    }

    .ys-tools-search-input {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        height: 42px;
        font-size: 16px;
    }

    .ys-tools-search-btn {
        flex: 0 0 auto;
        width: 72px;
        height: 42px;
        min-width: 0;
        padding: 0;
        font-size: 15px;
    }

    .ys-tools-card-thumb {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .ys-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ys-tools-card-thumb {
        height: auto;
    }
}

/* ===========================
   Widget Shortcode Styles
   =========================== */

.ys-tools-widget {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* Icon grid widget */
.ys-icon-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Desktop columns */
.ys-icon-grid[data-cols-desktop="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ys-icon-grid[data-cols-desktop="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ys-icon-grid[data-cols-desktop="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ys-icon-grid[data-cols-desktop="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ys-icon-grid[data-cols-desktop="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Backward compatible (old class still works) */
.ys-icon-grid.ys-icon-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ys-icon-grid.ys-icon-grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ys-icon-grid.ys-icon-grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ys-icon-grid.ys-icon-grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ys-icon-grid.ys-icon-grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Mobile override */
@media (max-width: 600px) {
    .ys-icon-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .ys-icon-grid[data-cols-mobile="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ys-icon-grid[data-cols-mobile="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ys-icon-grid[data-cols-mobile="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.ys-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 10px);
    text-decoration: none;
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, 0.06));
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.06));
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.ys-icon-item:hover {
    transform: translateY(-2px);
    border-color: var(--focus-color);
}

.ys-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.03));
    display: flex;
    align-items: center;
    justify-content: center;
}

.ys-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ys-icon-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--key-color, #333);
    text-align: center;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ys-widgets-empty {
    text-align: center;
    padding: 40px 20px;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.ys-widgets-empty p {
    font-size: 14px;
    color: var(--muted-color, #777);
    margin: 0;
}

.ys-tools-widget-template {
    background: var(--body-bg-color, #f5f6f7);
    min-height: 100vh;
    padding: 20px 0;
}

.ys-tools-widget-template-container {
    max-width: var(--mian-max-width, 1200px);
    margin: 0 auto;
    padding: 0 10px 32px;
}

.ys-tools-widget-template-hero {
    padding: 20px 0 16px;
    text-align: center;
}

.ys-tools-widget-template-title {
    color: var(--key-color, #333);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}

.ys-tools-widget-template-desc {
    color: var(--muted-color, #777);
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

.ys-tools-widget-template-empty {
    max-width: var(--mian-max-width, 1200px);
    margin: 20px auto;
    padding: 40px 20px;
    text-align: center;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 8px);
    box-shadow: 0 0 10px var(--main-shadow, rgba(116, 116, 116, 0.08));
}

.ys-tools-widget-template-empty p {
    color: var(--muted-color, #777);
    font-size: 14px;
    margin: 0;
}

.ys-widget-template-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.ys-widget-template-load-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.ys-widget-template-load-more {
    align-items: center;
    background: var(--theme-color, #f04494);
    border: 1px solid var(--theme-color, #f04494);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
    justify-content: center;
    min-width: 120px;
    padding: 0 22px;
    transition: opacity .2s, transform .2s;
}

.ys-widget-template-load-more:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.ys-widget-template-load-more:disabled {
    cursor: default;
    opacity: .72;
    transform: none;
}

.ys-widgets-grid {
    display: grid;
    gap: 20px;
}

.ys-widgets-cols-1 { grid-template-columns: repeat(1, 1fr); }
.ys-widgets-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ys-widgets-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ys-widgets-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ys-widgets-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ys-widgets-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Widget Card - Portrait Style (400x600) */
.ys-widget-card {
    display: block;
    text-decoration: none;
    background: var(--main-bg-color, #fff);
    border-radius: var(--main-radius, 12px);
    overflow: hidden;
    box-shadow: 0 0 15px var(--main-shadow, rgba(116, 116, 116, 0.1));
    transition: all 0.3s ease;
    position: relative;
}

.ys-widget-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px var(--main-shadow, rgba(116, 116, 116, 0.2));
}

.ys-widget-card-image {
    width: 100%;
    aspect-ratio: 400 / 600;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

.ys-widget-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ys-widget-card:hover .ys-widget-card-image img {
    transform: scale(1.05);
}

.ys-widget-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    gap: 12px;
}

.ys-widget-card-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.ys-widget-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 16px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}

.ys-widget-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    word-break: break-word;
}

/* Widget Title (matches zibll theme .box-body .title-theme layout) */
.ys-widget .box-body {
    padding: 15px;
}

.ys-widget .box-body.notop {
    padding-top: 0;
}

.ys-widget .title-theme {
    position: relative;
    padding-left: 1.2em;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ys-widget .title-theme:before {
    position: absolute;
    content: '';
    width: 4px;
    height: 16px;
    background: var(--theme-color, #f04494);
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 2px;
}

.ys-widget .pull-right {
    float: right;
}

.ys-widget .em09 {
    font-size: 0.9em;
}

.ys-widget .mt3 {
    margin-top: 3px;
}

.ys-widget .muted-2-color {
    color: var(--muted-2-color, #999);
    text-decoration: none;
    transition: color 0.2s;
}

.ys-widget .muted-2-color:hover {
    color: var(--theme-color, #f04494);
}

/* Responsive Widget Grid */
@media (max-width: 992px) {
    .ys-widget-template-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ys-widgets-cols-4,
    .ys-widgets-cols-5,
    .ys-widgets-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ys-widget-template-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .ys-widgets-cols-3,
    .ys-widgets-cols-4,
    .ys-widgets-cols-5,
    .ys-widgets-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ys-widgets-grid {
        gap: 12px;
    }

    .ys-widgets-cols-2,
    .ys-widgets-cols-3,
    .ys-widgets-cols-4,
    .ys-widgets-cols-5,
    .ys-widgets-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =====================
   推荐小工具横向导航
   ===================== */
.ys-tools-recommend-widget{
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.tool-nav {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    justify-content: center;
}

.tool-nav::-webkit-scrollbar {
    height: 6px;
}

.tool-nav::-webkit-scrollbar-thumb {
    background: var(--main-bg-color);
    border-radius: 10px;
}

.tool-card {
    width: 190px;
    height: 54px;
    background: var(--main-bg-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    color: inherit;
}

.banner-card {
    width: 110px;
    height: 54px;
    padding: 0;
    overflow: hidden;
    background: transparent;
}

.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
    display: block;
}

.tool-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.tool-info {
    overflow: hidden;
}

.tool-game {
    font-size: 12px;
    color: var(--key-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.tool-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--key-color, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ys-recommend-widget-title {
    margin-bottom: 12px;
}

/* =====================
   游戏发售表小工具
   ===================== */
.ys-tools-game-release-widget {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.ys-game-release-panel {
    width: 100%;
    overflow: hidden;
    background: var(--body-bg-color, #f5f6f7);
    border-radius: 8px;
}

.ys-game-release-panel-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 0 2px 8px;
}

.ys-game-release-title-wrap {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 !important;
}

.ys-game-release-panel-title {
    margin: 0;
}

.ys-game-release-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ys-game-release-panel-more {
    flex: 0 0 auto;
    color: var(--muted-color, #777);
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.ys-game-release-panel-more:hover {
    color: var(--key-color, #111820);
}

.ys-game-release-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: var(--main-bg-color, #fff);
    color: #69717a;
    cursor: pointer;
    font-size: 25px;
    font-family: Arial, sans-serif;
    line-height: 1;
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}

.ys-game-release-nav-btn:hover {
    border-color: rgba(0, 0, 0, 0.18);
    color: var(--key-color, #111820);
    transform: translateY(-1px);
}

.ys-game-release-timeline {
    position: relative;
    display: flex;
    gap: 22px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 44px 2px 0;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ys-game-release-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 32px;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
}

.ys-game-release-timeline::-webkit-scrollbar {
    display: none;
}

.ys-game-release-slot {
    position: relative;
    z-index: 1;
    flex: 0 0 182px;
    min-width: 182px;
    scroll-snap-align: start;
}

.ys-game-release-node {
    position: absolute;
    left: 0;
    top: -50px;
    width: 100%;
    height: 38px;
    display: flex;
    justify-content: center;
}

.ys-game-release-node-label {
    position: absolute;
    left: 50%;
    top: 24px;
    z-index: 1;
    max-width: calc(100% - 16px);
    height: 21px;
    padding: 0 8px;
    transform: translateX(-50%);
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 999px;
    background: var(--body-bg-color, #f5f6f7);
    color: #4f565d;
    font-size: 12px;
    line-height: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ys-game-release-card {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    border-radius: 10px;
    background: var(--main-bg-color, #fff);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ys-game-release-card:hover {
    color: inherit;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.ys-game-release-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 226px;
    overflow: hidden;
    background: var(--muted-border-color, rgba(0, 0, 0, 0.04));
}

.ys-game-release-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .2s ease;
}

.ys-game-release-card:hover .ys-game-release-cover img {
    transform: scale(1.05);
}

.ys-game-release-cover-empty {
    color: var(--muted-2-color, #999);
    font-size: 18px;
    font-weight: 900;
}

.ys-game-release-info {
    display: flex;
    min-width: 0;
    min-height: 36px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--main-bg-color, #fff);
}

.ys-game-release-name {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--key-color, #333);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.ys-game-release-panel.no-cover .ys-game-release-card {
    min-height: 118px;
    display: flex;
    align-items: center;
}

.ys-game-release-panel.no-cover .ys-game-release-info {
    width: 100%;
}

.ys-game-release-empty {
    padding: 24px 14px;
    text-align: center;
    color: var(--muted-color, #777);
}

.ys-game-release-empty p {
    margin: 0 0 4px;
    font-size: 14px;
}

.ys-game-release-empty span {
    display: block;
    font-size: 12px;
}

@media (max-width: 480px) {
    .ys-game-release-panel-hd {
        padding: 0 2px 8px;
    }

    .ys-game-release-panel-more {
        display: inline-flex;
    }

    .ys-game-release-nav-btn {
        display: none;
    }

    .ys-game-release-timeline {
        gap: 14px;
        padding-top: 42px;
    }

    .ys-game-release-timeline::before {
        top: 31px;
    }

    .ys-game-release-slot {
        flex-basis: 150px;
        min-width: 150px;
    }

    .ys-game-release-cover {
        height: 186px;
    }

    .ys-game-release-node-label {
        max-width: calc(100% - 10px);
        padding: 0 6px;
    }

    .ys-game-release-name {
        font-size: 13px;
    }

}
