:root {
    --bg: #070b16;
    --card: rgba(15, 23, 42, 0.9);
    --card-border: #273858;
    --text: #edf5ff;
    --muted: #91a5c7;
    --accent: #48e5ff;
    --accent-2: #a879ff;
    --tag-bg: #14213a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 12% 0%, rgba(32, 113, 170, 0.22), transparent 38%),
        radial-gradient(ellipse at 92% 18%, rgba(116, 64, 190, 0.15), transparent 34%),
        linear-gradient(rgba(91, 178, 221, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 178, 221, 0.035) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px, 40px 40px;
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 11, 22, 0.88);
    border-bottom: 1px solid rgba(72, 229, 255, 0.18);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    padding: 0.85rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}
.brand-heading { margin: 0; }
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
}
.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 24px rgba(72, 229, 255, 0.24);
}
.brand-mark svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: #07111f;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
}
.brand-name {
    overflow: hidden;
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-tagline, .header-section {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
nav a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: rgba(20, 33, 58, 0.8);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}
nav a:hover, nav a.primary {
    border-color: rgba(72, 229, 255, 0.5);
    background: rgba(72, 229, 255, 0.12);
    color: var(--accent);
    box-shadow: 0 0 18px rgba(72, 229, 255, 0.1);
}
nav .stats-trigger {
    display: inline-flex;
    width: auto;
    min-height: 40px;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(72, 229, 255, 0.25);
    border-radius: 8px;
    background: rgba(20, 33, 58, 0.8);
    color: var(--text);
    box-shadow: none;
}
nav .stats-trigger svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
nav .stats-trigger:hover {
    border-color: rgba(72, 229, 255, 0.5);
    background: rgba(72, 229, 255, 0.12);
    color: var(--accent);
}
main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 1rem auto;
    padding: 0 1rem;
}
.filters {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.filter-sensitive, .filter-favorites {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    color: var(--text);
}
.filter-sensitive input, .filter-favorites input {
    width: auto;
    min-height: 0;
    margin: 0;
    accent-color: var(--accent);
}
@media (min-width: 640px) {
    .filters {
        grid-template-columns: repeat(2, 1fr);
        padding: 1rem;
        gap: 0.75rem;
    }
}
@media (min-width: 960px) {
    .filters {
        grid-template-columns: 2fr repeat(4, 1fr) auto auto;
    }
    .filter-sensitive, .filter-favorites {
        grid-column: 1 / -1;
    }
}
input, select, button {
    width: 100%;
    min-height: 44px;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: rgba(8, 15, 29, 0.92);
    color: var(--text);
    font-size: 0.95rem;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
button {
    background: linear-gradient(120deg, var(--accent), #8aa8ff 55%, var(--accent-2));
    border-color: transparent;
    color: #07111f;
    font-weight: 600;
    cursor: pointer;
    padding-inline: 1rem;
    box-shadow: 0 5px 20px rgba(72, 229, 255, 0.16);
    transition: transform 160ms ease, filter 160ms ease;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-decoration: none;
    background: var(--tag-bg);
    color: var(--text);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
    white-space: nowrap;
}
.tag-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 0.45rem;
    padding-bottom: 0.35rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .tag-bar {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
    }
}
.tag-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
}
.tag-pill.active, .tag-pill:hover {
    background: var(--accent);
    color: #07111f;
}
.result-count {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0 0 0.85rem;
}
.stats-dialog {
    width: min(940px, calc(100% - 1.25rem));
    max-width: none;
    max-height: min(88dvh, 840px);
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(72, 229, 255, 0.38);
    border-radius: 18px;
    background: transparent;
    color: var(--text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 40px rgba(72, 229, 255, 0.1);
}
.stats-dialog::backdrop {
    background: rgba(3, 7, 16, 0.78);
    backdrop-filter: blur(9px);
}
.stats-modal {
    display: flex;
    max-height: min(88dvh, 840px);
    flex-direction: column;
    overflow: hidden;
    border-radius: inherit;
    background:
        radial-gradient(ellipse at 92% 0%, rgba(116, 64, 190, 0.2), transparent 34%),
        linear-gradient(145deg, #111d35, #080e1c 78%);
}
.stats-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.15rem 0.9rem;
    border-bottom: 1px solid rgba(72, 229, 255, 0.18);
}
.stats-kicker {
    margin: 0 0 0.2rem;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.stats-modal-header h2 {
    margin: 0;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
}
.stats-close {
    display: grid;
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--card-border);
    border-radius: 50%;
    background: rgba(8, 15, 29, 0.82);
    color: var(--text);
    font-size: 1.45rem;
    box-shadow: none;
}
.stats-modal-content {
    overflow: auto;
    padding: 1rem 1.15rem 1.2rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}
@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 920px) {
    .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.stats-card {
    position: relative;
    min-width: 0;
    min-height: 96px;
    padding: 0.8rem;
    overflow: hidden;
    border: 1px solid rgba(72, 229, 255, 0.17);
    border-radius: 11px;
    background: linear-gradient(150deg, rgba(17, 31, 56, 0.95), rgba(8, 15, 29, 0.78));
}
.stats-card::after {
    position: absolute;
    right: -24px;
    bottom: -34px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(72, 229, 255, 0.08);
    content: "";
    filter: blur(2px);
}
.stats-label, .stats-detail {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}
.stats-value {
    display: block;
    margin-top: 0.2rem;
    overflow-wrap: anywhere;
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    font-weight: 800;
    line-height: 1.2;
}
.stats-card--top .stats-value { font-size: 1rem; }
.stats-detail { margin-top: 0.25rem; }
.daily-views-panel {
    margin-top: 1.15rem;
    padding: 0.9rem;
    overflow: hidden;
    border: 1px solid rgba(72, 229, 255, 0.18);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(17, 31, 56, 0.78), rgba(8, 15, 29, 0.72));
}
.daily-views-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.4rem;
}
.daily-views-heading h3 {
    margin: 0;
    font-size: 0.95rem;
}
.daily-views-heading p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}
.daily-views-peak {
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border: 1px solid rgba(72, 229, 255, 0.25);
    border-radius: 999px;
    color: var(--accent);
    font-size: 0.72rem;
    white-space: nowrap;
}
.daily-views-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.daily-views-gridline {
    stroke: rgba(145, 165, 199, 0.14);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.daily-views-axis-label {
    fill: var(--muted);
    font-size: 11px;
    text-anchor: end;
}
.daily-views-date-label {
    fill: var(--muted);
    font-size: 11px;
    text-anchor: middle;
}
.daily-views-area { fill: url(#daily-views-gradient); }
.daily-views-line {
    fill: none;
    stroke: #54e6ff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    filter: drop-shadow(0 0 5px rgba(72, 229, 255, 0.55));
}
.daily-views-point {
    fill: #c5f7ff;
    stroke: #101a2d;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}
.quality-heading {
    margin: 1.25rem 0 0.6rem;
    font-size: 0.95rem;
}
.quality-breakdown {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}
@media (min-width: 640px) {
    .quality-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.quality-row {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(145, 165, 199, 0.14);
    border-radius: 10px;
    background: rgba(8, 15, 29, 0.65);
}
.quality-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}
.quality-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(145, 165, 199, 0.14);
}
.quality-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    transition: width 180ms ease;
}
.quality-fill.quality-very-good { background: #72f2ad; }
.quality-fill.quality-good { background: #48e5ff; }
.quality-fill.quality-medium { background: #f5dc72; }
.quality-fill.quality-okay { background: #ffb86b; }
.quality-fill.quality-poor { background: #ff7b88; }
.quality-fill.quality-unknown { background: #91a5c7; }
.quality-criteria {
    margin: 0.75rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}
.quality-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.18rem 0.5rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1.4;
}
.quality-very-good { color: #72f2ad; background: rgba(37, 162, 99, 0.12); }
.quality-good { color: #48e5ff; background: rgba(72, 229, 255, 0.1); }
.quality-medium { color: #f5dc72; background: rgba(245, 220, 114, 0.1); }
.quality-okay { color: #ffb86b; background: rgba(255, 184, 107, 0.1); }
.quality-poor { color: #ff7b88; background: rgba(255, 123, 136, 0.1); }
.quality-unknown { color: var(--muted); background: rgba(145, 165, 199, 0.1); }
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}
@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.sticker-card {
    background: linear-gradient(145deg, rgba(17, 29, 53, 0.94), rgba(9, 15, 30, 0.97));
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.sticker-card:hover {
    transform: translateY(-3px);
    border-color: rgba(72, 229, 255, 0.42);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), 0 0 22px rgba(72, 229, 255, 0.08);
}
.sticker-card[hidden] { display: none; }
.sticker-preview {
    position: relative;
    background: radial-gradient(circle at 50% 40%, #182849, #0b1222 72%);
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.4rem;
}
.sticker-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.sensitive-preview:not(.is-revealed) img {
    filter: blur(16px);
    transform: scale(1.05);
}
.sensitive-preview.is-revealed img {
    filter: none;
    transform: none;
}
.sensitive-toggle {
    position: absolute;
    z-index: 1;
    right: 0.55rem;
    bottom: 0.55rem;
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(72, 229, 255, 0.55);
    border-radius: 50%;
    background: rgba(5, 10, 22, 0.92);
    color: #fff;
    box-shadow: 0 0 18px rgba(72, 229, 255, 0.2);
}
.sensitive-toggle svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.sensitive-toggle .eye-closed,
.sensitive-preview.is-revealed .sensitive-label {
    display: none;
}
.sensitive-preview.is-revealed .sensitive-toggle .eye-open {
    display: none;
}
.sensitive-preview.is-revealed .sensitive-toggle .eye-closed {
    display: block;
}
.sensitive-label {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    max-width: calc(100% - 1.5rem);
    padding: 0.55rem 0.8rem;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(72, 229, 255, 0.32);
    border-radius: 9px;
    background: rgba(5, 10, 22, 0.9);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}
.sticker-title a, .detail-link {
    color: var(--text);
    text-decoration: none;
}
.sticker-title a:hover, .detail-link:hover {
    color: var(--accent);
}
.detail-link {
    font-size: 0.88rem;
    font-weight: 600;
}
.detail-view {
    max-width: 820px;
    margin: 0 auto;
}
.detail-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, rgba(17, 29, 53, 0.94), rgba(9, 15, 30, 0.97));
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}
@media (min-width: 700px) {
    .detail-card {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
        align-items: start;
        padding: 1.25rem;
    }
}
.detail-preview {
    position: relative;
    display: flex;
    min-height: 280px;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: radial-gradient(circle at 50% 40%, #182849, #0b1222 72%);
}
.detail-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.detail-info h2 {
    margin: 0 0 0.5rem;
}
.detail-form, .tag-suggestion-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}
.tag-suggestion-form {
    padding: 0.85rem;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(8, 15, 29, 0.55);
}
.detail-form label, .detail-form legend {
    font-size: 0.9rem;
    font-weight: 600;
}
.detail-form input[type="text"], .detail-form select {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(8, 15, 29, 0.92);
    color: var(--text);
}
.detail-form fieldset {
    padding: 0;
    border: 0;
}
.detail-form .tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 150px;
    overflow-y: auto;
    padding: 0.5rem;
    border: 1px solid var(--card-border);
    border-radius: 8px;
}
.tag-suggestion-form .tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.detail-form .tag-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    background: var(--tag-bg);
}
.detail-form .tag-option input {
    width: auto;
    min-height: 0;
    margin: 0;
}
.tag-suggestion-form .tag-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    background: var(--tag-bg);
}
.tag-suggestion-form .tag-option input {
    width: auto;
    min-height: 0;
    margin: 0;
}
.sensitive-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sensitive-setting input {
    width: auto;
    min-height: 0;
}
.detail-notice {
    padding: 0.75rem 1rem;
    background: rgba(31, 27, 15, 0.9);
    border: 1px solid rgba(255, 204, 102, 0.45);
    color: #ffe4a3;
    border-radius: 8px;
}
.sticker-title {
    font-weight: 700;
    font-size: 0.96rem;
    word-break: break-word;
}
.sticker-meta {
    font-size: 0.8rem;
    color: var(--muted);
    word-break: break-word;
}
.sticker-meta a {
    color: var(--accent);
    text-decoration: none;
}
.sticker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.25rem;
}
.mini-tag {
    font-size: 0.75rem;
    padding: 0.22rem 0.5rem;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--text);
    text-decoration: none;
}
.mini-tag:hover {
    background: var(--accent);
    color: #07111f;
}
footer {
    margin-top: 2.5rem;
    padding: 1.15rem 1rem calc(1.15rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--card-border);
    text-align: center;
    font-size: 0.9rem;
}
footer a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
}
footer a:hover { color: var(--text); }
