:root {
    --bg: #f4f7fb;
    --glass: rgba(255, 255, 255, 0.95);
    --glass-alt: rgba(255, 255, 255, 0.85);
    --text: #1f2433;
    --text-dim: #7b879f;
    --accent: #ff8f5c;
    --border: rgba(15, 23, 42, 0.08);
    --radius: 22px;
    font-family: 'Manrope', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.sg-body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #ffffff 0%, #dfe7fb 60%);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.sg-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sg-sidebar {
    width: 300px;
    background: var(--glass);
    backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 12px 0 35px rgba(15, 23, 42, 0.08);
}

.sg-brand a {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.sg-brand span {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffb59d, #ffd976);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #442200;
    font-size: 1.1rem;
    box-shadow: 0 12px 28px rgba(255, 159, 95, 0.35);
}

.sg-brand strong {
    display: block;
    font-size: 1.1rem;
}

.sg-brand small {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.sg-search {
    display: flex;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: var(--glass-alt);
    border: 1px solid rgba(15, 23, 42, 0.08);
    gap: 0.4rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.sg-search input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    flex: 1;
}

.sg-search button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(255, 143, 92, 0.35);
    cursor: pointer;
}

.sg-nav {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    color: var(--text-dim);
}

.sg-nav p {
    margin: 0 0 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: #2f3448;
}

.sg-nav a {
    padding: 0.25rem 0.4rem;
    border-radius: 8px;
}

.sg-nav a:hover {
    background: rgba(255, 143, 92, 0.12);
    color: var(--accent);
}

.sg-nav__empty {
    font-size: 0.85rem;
}

.sg-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--glass);
    backdrop-filter: blur(8px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.sg-nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text);
}

.sg-content {
    flex: 1;
    padding: 2rem clamp(1.5rem, 4vw, 3.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sg-panel {
    background: var(--glass);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.6rem;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
}

.sg-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.sg-panel__head p {
    margin: 0;
    font-size: 1.2rem;
}

.sg-panel__head span {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.sg-panel__head a {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 143, 92, 0.35);
    color: var(--accent);
}

.sg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1rem;
}

.sg-card {
    background: var(--glass-alt);
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sg-card__thumb {
    position: relative;
}

.sg-card__thumb img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.sg-card__thumb span {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #3d2a1c;
    font-size: 0.75rem;
}

.sg-card__info {
    padding: 0.9rem 1rem 1.2rem;
}

.sg-card__title {
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-card__info p {
    margin: 0.3rem 0 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.sg-empty {
    text-align: center;
    color: var(--text-dim);
}

.sg-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sg-list__item {
    display: flex;
    gap: 1rem;
    background: var(--glass-alt);
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.8rem;
}

.sg-list__item .thumb {
    flex: 0 0 140px;
}

.sg-list__item img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 12px;
}

.sg-list__item .info {
    flex: 1;
}

.sg-list__item .title {
    font-size: 1.1rem;
    font-weight: 600;
}

.sg-list__item p {
    margin: 0.3rem 0;
    color: var(--text-dim);
}

.sg-list__item .meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sg-list__item .meta span {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
}

.sg-pager {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.sg-pager a {
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 143, 92, 0.4);
    color: var(--accent);
}

.sg-pager .disabled {
    opacity: 0.4;
    pointer-events: none;
}

.sg-panel--detail .sg-detail {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
}

.sg-detail__cover {
    position: relative;
}

.sg-detail__cover img {
    width: 100%;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sg-detail__cover span {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    padding: 0.2rem 0.85rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
}

.sg-detail__info h1 {
    margin: 0.5rem 0 0.3rem;
    font-size: 2rem;
}

.sg-detail__info .badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.sg-detail__info .actors {
    margin: 0.4rem 0;
    color: var(--text-dim);
}

.sg-detail__info .meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sg-detail__info .meta span {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.sg-detail__info .tags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}

.sg-detail__info dt {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 0;
}

.sg-detail__info dd {
    margin: 0.2rem 0 0;
}

.sg-detail__content {
    color: var(--text-dim);
    line-height: 1.8;
}

.sg-player__screen {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #000;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15);
}

#artplayer-container {
    width: 100%;
    height: clamp(260px, 50vw, 520px);
}

.sg-player__controls {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.control p {
    margin: 0 0 0.3rem;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pill {
    border: 1px solid rgba(255, 143, 92, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #60331c;
    padding: 0.25rem 0.9rem;
    cursor: pointer;
}

.pill.active,
.pill:hover {
    background: var(--accent);
    color: #412215;
    border-color: transparent;
}

.sg-footer {
    text-align: center;
    color: var(--text-dim);
    padding: 1.3rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 1024px) {
    .sg-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 10;
    }
    .sg-sidebar[data-open="true"] {
        transform: translateX(0);
    }
    .sg-nav-toggle {
        display: flex;
        z-index: 11;
    }
    .sg-content {
        padding-top: 5rem;
    }
}

@media (max-width: 640px) {
    .sg-panel--detail .sg-detail {
        grid-template-columns: 1fr;
    }
    .sg-list__item {
        flex-direction: column;
    }
}

