:root {
    --sky-deep:   #121212;
    --sky-mid:    #1e1e1e;
    --sky-high:   #2a2a2a;
    --sky-dawn:   #333333;
    --steel:      #ff4d4d; /* Red Accent */
    --cyan:       #e0e0e0; /* Light Gray Text */
    --cyan-d:     #cc3333; /* Darker Red */
    --white:      #ffffff;
    --text-lo:    rgba(255,255,255,.55);
    --glow-steel: rgba(255, 77, 77, 0.4); /* Red Glow */
    --card-bg:    rgba(255,255,255,.05);
    --card-bd:    rgba(255, 77, 77, .3); /* Red Border */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky-mid) 40%, var(--sky-high) 100%);
    background-attachment: fixed;
    color: var(--white);
    font-family: 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Nav Bar (from master.html) */
/*
.sw-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
    height: 66px;
    background: rgba(18, 18, 18, 0.95) !important;
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(255, 77, 77, 0.3) !important;
    display: flex; align-items: center; padding: 0 48px; gap: 2px;
}
.sw-nav-brand {
    display: flex; align-items: center; gap: 10px;
    margin-right: auto; text-decoration: none;
    z-index: 10000; 
    position: relative;
}
.sw-nav-brand img { 
    height: 38px; 
    z-index: 10001;
    position: relative;
    dispaly: block; 
}
.sw-nav-wordmark {
    font-size: 1.18rem; font-weight: 900; letter-spacing: 3px;
    background: linear-gradient(90deg, #ff4d4d 0%, #ff8080 60%, #fff 100%) !important;
    -webkit-background-clip: text !important; 
    -webkit-text-fill-color: transparent !important; 
    background-clip: text !important;
}
.sw-nav a.nav-link {
    color: rgba(255,255,255,.7) !important; 
    text-decoration: none;
    padding: 7px 13px; border-radius: 8px; font-size: .88rem;
    transition: color .2s, background .2s; white-space: nowrap; cursor: pointer;
}
.sw-nav a.nav-link:hover { 
    color: #ff4d4d !important; 
    background: rgba(255, 77, 77, .1) !important; 
}


.sw-nav a.nav-link[href*="d5.html"] {
    color: #ff4d4d !important;
    background: rgba(255, 77, 77, .1) !important;
}
*/
/* Layout */
.main-container {
    display: flex;
    padding-top: 80px; /* space for navbar */
    min-height: 100vh;
    gap: 20px;
}

.canvas-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#editor-container {
    border: 2px solid var(--card-bd);
    box-shadow: 0 0 20px var(--glow-steel);
    background: #000;
}

.sidebar {
    flex: 1;
    min-width: 350px;
    background: var(--card-bg);
    border-left: 1px solid var(--card-bd);
    display: flex;
    flex-direction: column;
    padding: 20px;
    backdrop-filter: blur(10px);
    max-height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.search-bar {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--card-bd);
    background: rgba(0,0,0,0.2);
    color: var(--white);
    font-size: 1rem;
}

.filter-group {
    display: flex;
    gap: 10px;
}

select {
    flex: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--card-bd);
    background: rgba(0,0,0,0.5);
    color: var(--white);
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding-right: 5px;
    flex: 1;
    min-height: 0;
}

.skin-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
    text-align: center;
}

.skin-item:hover {
    background: rgba(135,206,235,0.15);
    border-color: var(--cyan);
}

.skin-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.skin-name {
    font-size: 0.75rem;
    margin-top: 5px;
    color: var(--text-lo);
    word-break: break-word;
}

/* Quality Colors */
.quality-虛妄傑作 { border-color: #ff0000; }
.quality-稀世 { border-color: #ffa500; }
.quality-奇珍 { border-color: #a020f0; }
.quality-獨特 { border-color: #00bfff; }
.quality-罕見 { border-color: #90ee90; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: var(--cyan-d); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
