body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; margin: 0; background-color: #09090b; color: #e4e4e7; }
#viewer-jump-input::-webkit-inner-spin-button,
#viewer-jump-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#viewer-jump-input {
    -moz-appearance: textfield;
    background: #27272a;
    color: #fff;
}
#char-selector-ui {
    background: #18181b;
    border: 1px solid #27272a;
}
#char-selector-ui strong { color: #e4e4e7; }
.light-mode #char-selector-ui strong { color: #18181b ; }
#viewer-jump-wrapper {
    border: 1px solid #3f3f46;
}
#scroll-to-top-btn.v-tab-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 4px;
}
#scroll-to-top-btn.v-tab-icon svg {
    width: 16px;
    height: 16px;
}
#viewer-jump-list-btn {
    background: #18181b;
    color: #a1a1aa;
    border-left: 1px solid #3f3f46 ;
}
#jump-dropdown-container {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #18181b;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    z-index: 3000;
    max-height: 208px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.jump-opt {
    padding: 6px 10px;
    font-size: 12px;
    color: #e4e4e7;
    cursor: pointer;
    border-bottom: 1px solid #27272a;
}
.jump-opt:hover {
    background: #3b82f6;
    color: #fff;
}
body.initializing {
    overflow-y: scroll ;
    pointer-events: none ;
}
body.initializing #g-content {
    pointer-events: none;
}
.gallery-item {
    background: #18181b;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.gallery-item img:not([src]) {
    opacity: 0;
}
.gallery-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #18181b 25%, #27272a 50%, #18181b 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    z-index: 0;
}
.gallery-item img.loaded {
    position: relative;
    z-index: 1;
    opacity: 1;
    cursor: pointer;
}
.gallery-item:has(img.loaded)::before, .gallery-item.load-error::before {
    content: none ;
    animation: none ;
    display: none ;
}
.error-msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    color: #71717a;
    font-size: 0.75rem;
    z-index: 2;
}
.light-mode .error-msg { background: #f4f4f5 ; color: #71717a; }
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
#viewer-app { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.search-ui-container { margin: 0 auto 2rem auto; width: 100%; max-width: 800px; background: #18181b; border: 1px solid #27272a; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.search-mode-tabs { display: flex; background: #121212; border-bottom: 1px solid #27272a; justify-content: center; position: relative; }
.search-tab { padding: 0.8rem 2rem; border: none; background: transparent; cursor: pointer; color: #71717a; font-weight: 600; font-size: 0.9rem; transition: all 0.2s; border-bottom: 2px solid transparent; }
.search-tab.active { color: #fff; border-bottom-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.search-tab:hover:not(.active) { color: #d4d4d8; }
#search-mode-edit-hide { position: absolute; right: 0; top: 0; height: 100%; border-bottom: none ; display: flex; align-items: center; justify-content: center; padding: 0 1.2rem; }
.search-rows { display: flex; flex-wrap: wrap; padding: 1rem; gap: 0.5rem; justify-content: center; }
.search-row-btn { width: 3rem; height: 2.5rem; display: flex; align-items: center; justify-content: center; border: 1px solid #3f3f46; background: #27272a; cursor: pointer; font-weight: 500; color: #d4d4d8; font-size: 0.9rem; transition: all 0.2s; border-radius: 6px; }
.search-row-btn:hover { background: #3f3f46; color: #fff; transform: translateY(-2px); }
.search-row-btn.active { border-color: #3b82f6; background: #2563eb; color: #fff; box-shadow: 0 2px 4px rgba(37,99,235,0.3); }
.viewer-header { margin-bottom: 2rem; border-bottom: 1px solid #27272a; padding-bottom: 1rem; display:flex; justify-content: space-between; align-items: center; max-width: 100%; gap: 1rem; }
.header-login-container { display: flex; gap: 0.5rem; align-items: center; position: relative; }
.header-login-container input { background: #18181b; border: 1px solid #3f3f46; color: #fff; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.8rem; width: 160px; }
.header-login-container button { background: #2563eb; color: #fff; border: none; padding: 0.4rem 0.8rem; border-radius: 4px; font-size: 0.8rem; cursor: pointer; transition: background 0.2s; width: auto; }
.header-login-container button:hover { background: #3b82f6; }
.header-status-msg { position: absolute; top: 100%; right: 0; font-size: 0.7rem; margin-top: 2px; white-space: nowrap; }
.back-link { cursor: pointer; color: #60a5fa; text-decoration: none; font-weight: bold; display: flex; align-items: center; gap: 0.5rem; }
.back-link:hover { text-decoration: underline; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 2rem; justify-content: center; }
.nav-cards-container { display: flex; gap: 1rem; margin: 1rem auto 2rem auto; justify-content: center; flex-wrap: wrap; max-width: 1000px; }
.nav-card { background: #18181b; padding: 1.2rem 1.5rem; border-radius: 8px; text-align: center; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: all 0.2s; border: 2px solid #27272a; color: #e4e4e7; min-width: 140px; }
.nav-card:hover { transform: translateY(-3px); border-color: #3b82f6; color: #fff; background: #27272a; box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3); }
.char-card { background: #18181b; padding: 0.5rem; border-radius: 8px; display: flex; align-items: center; gap: 1rem; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: all 0.2s; border: 2px solid #3f3f46; color: #e4e4e7; overflow: hidden; height: 60px; text-align: left; }
.char-card span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.char-thumb { height: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; background: #000; }
.char-card:hover { transform: translateY(-3px); border-color: #3b82f6; color: #fff; background: #27272a; }
.char-card { position: relative; transition: opacity 0.2s, filter 0.2s; }
.edit-mode-active .char-card.is-hidden { opacity: 0.7; filter: grayscale(0.6); }
.card-hide-x { position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; background: #ef4444; color: #fff; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; z-index: 5; border: 2px solid #18181b; }
.edit-mode-active .card-hide-x { display: flex; }
.light-mode .card-hide-x { border-color: #ffffff; }
.is-hidden .card-hide-x { background: #10b981; }
.g-btn {
    background-color: rgba(10, 10, 10, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.g-btn:disabled { opacity: 0.3; pointer-events: none; }
.fav-btn { color: #e4e4e7; fill: transparent; font-size: 1.6rem; }
.fav-btn.loved { color: #f472b6; fill: #f472b6; }
.dl-btn { color: #60a5fa; }
.jump-char-btn svg { stroke: #facc15; }
.hide-btn { color: #a1a1aa; }
.similar-btn { color: #c084fc; }
.hide-btn:hover { color: #ef4444; }
.unhide-btn { color: #10b981; }
.unhide-btn:hover { color: #059669; }
#top-ui-wrapper { display:block; position:fixed; top:60px; right:12px; width:auto; max-width:calc(100vw - 24px); z-index:1400; background:rgba(24,24,27,0.95); border:1px solid #27272a; padding:0.8rem; box-sizing:border-box; border-radius:8px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); }
.viewer-tabs { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.v-tabs-nav { display: flex; gap: 0.5rem; align-items: center; }
#pdf-dl-btn { order: -3; margin-left: 0 ; }
#zip-dl-btn { order: -2; }
#back-to-char-list-btn {
    order: -1;
    background-color: #10b981;
    border-color: #10b981;
    width: 44px;
    height: 44px;
}
#back-to-char-list-btn:hover {
    background-color: #059669;
    border-color: #059669;
}
.bookmark-panel { position: absolute; top: calc(100% + 10px); right: 0; width: 300px; background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,0.6); z-index: 10; }
.bookmark-panel h4 { margin: 0 0 0.8rem 0; font-size: 0.9rem; color: #cbd5e1; }
.bookmark-panel hr { border: none; border-top: 1px solid #334155; margin: 1rem 0; }
.bookmark-save-form { display: flex; gap: 0.5rem; }
.bookmark-save-form input { flex-grow: 1; background: #27272a; }
.bookmark-save-form button { width: auto; padding: 0 1rem; }
.bookmark-list { list-style: none; padding: 0; margin: 0; max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.3rem;  }
.bookmark-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; }
.bookmark-item a {
    color: #e4e4e7;
    text-decoration: none;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    padding: 0.4rem 0.6rem;
    background: #3f3f46;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.bookmark-item a:hover {
    background: #52525b;
}
.bookmark-delete-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-weight: bold; padding: 0.2rem; width: auto; }
.bookmark-empty { color: #64748b; font-size: 0.8rem; text-align: center; padding: 1rem 0; }
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #27272a;
    color: #e4e4e7;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 12000;
    font-size: 0.9rem;
    border: 1px solid #3f3f46;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: toast-fade 3s forwards;
}
@keyframes toast-fade {
    0% { transform: translate(-50%, -20px); opacity: 0; }
    10% { transform: translate(-50%, 0); opacity: 1; }
    90% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, -20px); opacity: 0; }
}
.v-tabs-actions { display: flex; align-items: center; gap: 0.5rem; }
.v-tab { background: transparent; border: 2px solid #52525b; padding: 0.5rem 1rem; border-radius: 8px; color: #e4e4e7; font-size: 0.8rem; width: auto; font-weight: 600; cursor:pointer; }
.v-tab-icon { padding: 0.5rem; width: 40px; height: 40px; display:flex; justify-content:center; align-items:center; border-radius: 50%; }
#settings-menu-btn { padding: 0; }
.v-tab-icon svg { width: 20px; height: 20px; }
.v-tab.active { background: #3b82f6; color: #fff; border-color: #3b82f6; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.v-tab:hover:not(.active) { border-color: #a1a1aa; color: #fff; background-color: rgba(255, 255, 255, 0.1); }
#theme-toggle-btn {
    background-color: #09090b ;
    border: none ;
}
#theme-toggle-btn:hover {
    background-color: #09090b ;
}
#fav-rr-btn {
    border: 2px solid #6366f1 ;
    color: #818cf8 ;
    background: rgba(99, 102, 241, 0.1) ;
}
#fav-rr-btn.active {
    background: #6366f1 ;
    color: #ffffff ;
}
.light-mode #fav-rr-btn {
    color: #4f46e5 ;
    background: #ffffff ;
}
.light-mode #fav-rr-btn.active {
    background: #4f46e5 ;
    color: #ffffff ;
}
.light-mode #theme-toggle-btn {
    background-color: #ffffff ;
}
.light-mode #theme-toggle-btn:hover {
    background-color: #ffffff ;
}
.menu-jump-box { display:flex; align-items:center; gap:4px; position:relative; }
.view-mode-toggle { display:flex; gap:0; border:1px solid #3f3f46; border-radius:8px; overflow:hidden; }
.view-mode-toggle .v-tab-sm { border-radius:0; border:none; padding:0.5rem 1rem; }
.view-mode-toggle .v-tab-sm:not(:first-child) { border-left:1px solid #3f3f46; }
.no-data { text-align: center; color: #71717a; margin-top: 2rem; }
.product-link-btn { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) ; border-color: #f59e0b ; color: #fff ; animation: pulse-gold 2s infinite; display: flex ; align-items: center; justify-content: center; }
@keyframes pulse-gold { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.force-center-layout {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.loading { text-align: center; margin-top: 2rem; color: #666; }
.hidden { display: none ; }
#home-app {
    min-height: 100vh;
    display: flex ;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #18181b 0%, #09090b 100%);
}
.home-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}
.login-box {
    background: #18181b;
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid #27272a;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.login-box h1 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #fff;
}
.login-box p {
    font-size: 0.9rem;
    color: #a1a1aa;
    line-height: 1.5;
    margin-bottom: 2rem;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.login-form input {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #3f3f46;
    background: #09090b;
    color: #fff;
    font-size: 1rem;
}
.login-form button {
    padding: 0.8rem;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.login-form button:hover {
    background: #3b82f6;
}
.login-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.status-msg {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
:root { --viewer-width: 1100px; }
#gallery-view.gallery-grid { display: flex; flex-direction: column; gap: 12px; max-width: var(--viewer-width); width: 100%; margin: 0 auto; transition: max-width 0.2s; }
#gallery-view .gallery-item { width: 100%; min-height: 100px; box-sizing: border-box; position: relative; background: #000; }
#g-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    min-height: 101vh;
    padding-bottom: 150px;
    box-sizing: border-box;
}
#g-content.virtual-scroll-active {
    display: block;
    height: 100vh ;
    overflow: hidden ;
    min-height: 100vh;
}
#g-content.view-spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 150px;
}
#g-content.view-spread .gallery-item {
    min-height: auto;
    aspect-ratio: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}
#g-content.view-spread .gallery-item img {
    max-height: 100vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0px;
}
.v-tab-sm { background: #18181b; color: #71717a; border: 1px solid #3f3f46; cursor: pointer; transition: all 0.2s; font-size: 0.9rem; font-weight: 600; }
.char-tag { background: #27272a; color: #e4e4e7; padding: 0.3rem 0.6rem; border-radius: 4px; font-size: 0.85rem; display: flex; align-items: center; gap: 0.3rem; border: 1px solid #3f3f46; }
.v-tab-sm:hover { background: #27272a; color: #fff; }
.v-tab-sm.active { background: #3b82f6; color: #fff; }
#gallery-view .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    border-radius: 4px;
}
.gallery-item { position: relative; overflow: hidden; }
.gallery-footer { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); padding: 2rem 1rem 1rem 1rem; display: flex; justify-content: center; gap: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.1s; z-index: 10; }
.gallery-footer.visible { opacity: 1; pointer-events: auto; }
#lightbox { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #0c0c0c; z-index: 10000; display: none; flex-direction: column; justify-content: center; align-items: center; }
#lightbox:not(.hidden) { display: flex; }
.fs-img-wrapper { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; position: relative; }
#fs-footer { position:absolute; bottom:0; width:100%; padding:2rem 0; background:linear-gradient(to top, rgba(0,0,0,0.8), transparent); }
.fs-img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: grab; user-select: none; transform-origin: 0 0; }
.fs-img:active { cursor: grabbing; }
.ad-promo-grid-wrapper { position: relative; width: 100%; cursor: pointer; border-radius: 8px; overflow: hidden; border: 2px solid #3b82f6; transition: transform 0.2s; background: #000; }
.ad-promo-grid-wrapper:hover { transform: scale(1.01); box-shadow: 0 0 20px rgba(59, 130, 246, 0.4); }
.ad-promo-grid { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; gap: 2px; }
.ad-promo-grid img { width: 100%; height: auto; display: block; }
.ad-promo-overlay { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; background: rgba(0,0,0,0.4); padding: 1rem; text-align: center; z-index: 10; }
.ad-promo-overlay span { background: #2563eb; color: #fff; padding: 0.8rem 1.5rem; border-radius: 4px; font-weight: bold; font-size: 1.2rem; box-shadow: 0 4px 6px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); }
.ad-flex-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; width: 100%; }
.related-section { margin: 2rem 0; width: 100%; }
.related-section h3 { font-size: 1.1rem; color: #a1a1aa; margin-bottom: 1rem; border-left: 4px solid #3b82f6; padding-left: 0.8rem; text-align: left; }
.light-mode { background-color: #ffffff ; color: #18181b ; }
.light-mode .viewer-header, .light-mode .viewer-tabs { border-bottom-color: #e4e4e7; }
.light-mode .char-card, .light-mode .search-ui-container, .light-mode .menu-popup, .light-mode #top-ui-wrapper, .light-mode .bookmark-panel { background: #ffffff ; color: #18181b ; border-color: #e4e4e7 ; box-shadow: none ; }
.light-mode .nav-card { background: #ffffff ; color: #18181b ; box-shadow: none ; }
.rec-inline-wrapper, .rec-grid-row { background: #18181b; border: 1px solid #27272a; }
#next-char-rec { border-top: 1px solid #27272a; }
.light-mode .rec-inline-wrapper, .light-mode .rec-grid-row { background: #ffffff ; border-color: #e4e4e7 ; }
.light-mode #next-char-rec { border-top-color: #e4e4e7 ; }
.light-mode .search-mode-tabs { background: #f4f4f5; border-bottom-color: #e4e4e7; }
.light-mode .search-tab.active { color: #2563eb; background: rgba(37, 99, 235, 0.1); }
.light-mode .search-row-btn { background: #ffffff; border-color: #e4e4e7; color: #18181b; }
.light-mode .search-row-btn:hover { background: #f4f4f5; }
.light-mode .login-box, .light-mode .header-login-container input { background: #ffffff ; border-color: #e4e4e7 ; color: #18181b ; }
.light-mode .login-box h1 { color: #18181b; }
.light-mode .v-tab { border-color: #e4e4e7; color: #18181b; background: #ffffff; }
.light-mode .v-tab:hover:not(.active) { color: #18181b ; border-color: #71717a ; background-color: #e4e4e7 ; }
.light-mode #back-to-char-list-btn:hover { background-color: #059669 ; border-color: #059669 ; }
.light-mode .v-tab.active { color: #fff ; background: #2563eb ; border-color: #2563eb ; }
.light-mode #back-to-char-list-btn { background-color: #10b981 ; color: #ffffff ; border-color: #10b981 ; }
.light-mode .v-tab-sm { background: #ffffff; color: #71717a; border-color: #e4e4e7; }
.light-mode .v-tab-sm:hover { background: #f4f4f5; color: #18181b; }
.light-mode .v-tab-sm.active { background: #2563eb ; color: #ffffff ; border-color: #2563eb ; }
.light-mode .char-tag { background: #ffffff; color: #18181b; border-color: #e4e4e7; }
.light-mode #char-selector-ui { background: #ffffff ; border-color: #e4e4e7 ; }
.light-mode #viewer-jump-wrapper { border-color: #e4e4e7; }
.light-mode #viewer-jump-input { background: #ffffff; color: #18181b; }
.light-mode #viewer-jump-list-btn { background: #f4f4f5; color: #71717a; border-left-color: #e4e4e7 ; }
.light-mode #jump-dropdown-container { background: #ffffff; border-color: #e4e4e7; }
.light-mode .jump-opt { color: #18181b; border-bottom-color: #f4f4f5; }
.light-mode .gallery-item, .light-mode #g-content, .light-mode .fs-img-wrapper, .light-mode #lightbox, .light-mode .char-thumb, .light-mode .ad-promo-grid-wrapper, .light-mode #gallery-view .gallery-item, .light-mode #g-content.view-spread .gallery-item { background: #ffffff ; }
.light-mode .gallery-item::before { background-image: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%); background-size: 200% 100%; }