/* 충돌 방지형 심플 테마: s-* 네임스페이스만 사용 */
:root {
    --s-bg: #0b1220;
    --s-panel: #111827;
    --s-panel-2: #1f2937;
    --s-line: #334155;
    --s-text: #e5e7eb;
    --s-muted: #94a3b8;
    --s-accent: #2563eb;
    --s-accent-soft: rgba(37, 99, 235, 0.16);
    --s-positive: #22c55e;
    --s-negative: #ef4444;
}

.s-body {
    margin: 0;
    background: var(--s-bg);
    color: var(--s-text);
    font-family: Inter, "Noto Sans KR", sans-serif;
}

.s-layout {
    display: flex;
    min-height: 100vh;
}

.s-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: var(--s-panel);
    border-right: 1px solid var(--s-line);
    overflow-y: auto;
    z-index: 1000;
}

.s-brand {
    padding: 16px 14px 14px;
    border-bottom: 1px solid var(--s-line);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.14), rgba(17, 24, 39, 0.12));
}

.s-brand-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), rgba(30, 41, 59, 0.42));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.s-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dbeafe;
    font-size: 17px;
    border: 1px solid rgba(191, 219, 254, 0.35);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.45), rgba(15, 23, 42, 0.6));
}

.s-brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.s-brand-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1.05;
}

.s-brand-subtitle {
    margin-top: 3px;
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.s-brand-slogan {
    margin-top: 10px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(14, 165, 233, 0.11);
    color: #e0f2fe;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.s-brand-meta {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.s-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}

.s-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid transparent;
    color: var(--s-text);
    text-decoration: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.s-nav-item i {
    width: 18px;
    min-width: 18px;
    font-size: 14px;
    color: var(--s-muted);
    text-align: center;
}

.s-nav-item:hover {
    background: var(--s-accent-soft);
    border-color: rgba(37, 99, 235, 0.32);
}

.s-nav-item.active {
    background: var(--s-accent-soft);
    border-color: rgba(37, 99, 235, 0.4);
    color: #ffffff;
}

.s-nav-item.active i {
    color: #93c5fd;
}

.s-nav-group {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.04);
}

.s-nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    min-height: 40px;
    border: 0;
    background: transparent;
    color: var(--s-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.s-nav-group-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.s-nav-group-label i {
    width: 18px;
    min-width: 18px;
    font-size: 14px;
    color: var(--s-muted);
    text-align: center;
}

.s-nav-group-arrow {
    color: var(--s-muted);
    transition: transform 0.15s ease;
}

.s-subnav {
    display: none;
    padding: 0 8px 8px 8px;
}

.s-subnav-item {
    display: block;
    padding: 8px 10px 8px 20px;
    margin-top: 4px;
    border-radius: 8px;
    color: var(--s-text);
    text-decoration: none;
    font-size: 13px;
    border: 1px solid transparent;
    position: relative;
}

.s-subnav-item::before {
    content: "•";
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--s-muted);
    font-size: 10px;
    line-height: 1;
}

.s-subnav-item:hover {
    background: var(--s-accent-soft);
    border-color: rgba(37, 99, 235, 0.32);
}

.s-subnav-item.active {
    background: var(--s-accent-soft);
    border-color: rgba(37, 99, 235, 0.4);
    color: #ffffff;
}

.s-subnav-item.active::before {
    color: #93c5fd;
}

.s-nav-group.is-open .s-subnav {
    display: block;
}

.s-nav-group.is-open .s-nav-group-arrow {
    transform: rotate(180deg);
}

.s-sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--s-line);
}

.s-lang-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--s-line);
    background: var(--s-panel-2);
    color: var(--s-text);
    font-weight: 600;
    cursor: pointer;
}

.s-main-shell {
    margin-left: 260px;
    width: calc(100% - 260px);
}

.s-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(11, 18, 32, 0.92);
    backdrop-filter: blur(4px);
    padding: 10px;
}

.s-header-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 10px;
}

.s-header-block {
    border: 1px solid var(--s-line);
    border-radius: 12px;
    background: var(--s-panel);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.s-header-title {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.3px;
    min-height: 16px;
    width: 100%;
    text-align: center;
    text-shadow: 0 0 10px rgba(37, 99, 235, 0.35);
}

.s-header-topline {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    column-gap: 10px;
    min-height: 22px;
}

.s-header-topline .s-header-title {
    width: auto;
    text-align: center;
}

.s-header-topline .s-header-value {
    margin: 0;
    min-height: auto;
    text-align: center;
}

.s-header-epoch {
    display: grid;
    grid-template-rows: auto auto auto;
    row-gap: 0;
}

.s-header-epoch .s-header-topline {
    grid-row: 1;
    margin-bottom: 4px;
}

.s-header-epoch .s-progress-track {
    grid-row: 2;
    align-self: stretch;
}

.s-header-epoch .s-header-muted {
    grid-row: 3;
    align-self: start;
    margin-top: 0;
}

.s-header-title-row {
    position: relative;
    display: block;
    min-height: 16px;
}

.s-header-title-row .s-header-title {
    margin: 0;
    min-height: auto;
    text-align: center;
}

.s-header-meta {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--s-muted);
    white-space: nowrap;
}

.s-header-value {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.1px;
    min-height: 22px;
}

.s-header-muted {
    margin-top: 4px;
    color: var(--s-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    min-height: 16px;
}

.s-progress-track {
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--s-line);
    background: #0f172a;
    overflow: hidden;
}

.s-progress-fill {
    width: 0;
    height: 100%;
    background: var(--s-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

.s-progress-label {
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
}

.s-metric-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    font-size: 12px;
    line-height: 1.25;
    min-height: 20px;
}

.s-metric-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.s-metric-row-price {
    grid-template-columns: 44px repeat(3, minmax(76px, 1fr));
}

.s-metric-row-price .s-label {
    text-align: center;
    font-weight: 600;
    color: var(--s-text);
}

.s-metric-row .s-label {
    color: var(--s-muted);
    font-weight: 500;
    text-align: left;
}

.s-metric-row > strong {
    font-size: 12px;
    font-weight: 600;
    color: var(--s-text);
    text-align: right;
}

.s-header .price-usd,
.s-header .price-krw,
.s-header .change-rate {
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    line-height: 1.25;
}

.s-header .price-usd,
.s-header .price-krw {
    color: var(--s-text);
    min-width: 76px;
    white-space: nowrap;
}

.s-header .change-rate {
    min-width: 54px;
}

.s-header #active-stake-rate,
.s-header #total-address-rate,
.s-header #active-pools-rate,
.s-header #circulating-supply-rate,
.s-header #treasury-amount-rate,
.s-header #reserve-amount-rate,
.s-header .change-rate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    border: 1px solid transparent;
}

.s-header .change-rate.positive,
.s-header #active-stake-rate.positive,
.s-header #total-address-rate.positive,
.s-header #active-pools-rate.positive,
.s-header #circulating-supply-rate.positive,
.s-header #treasury-amount-rate.positive,
.s-header #reserve-amount-rate.positive {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
}

.s-header .change-rate.negative,
.s-header #active-stake-rate.negative,
.s-header #total-address-rate.negative,
.s-header #active-pools-rate.negative,
.s-header #circulating-supply-rate.negative,
.s-header #treasury-amount-rate.negative,
.s-header #reserve-amount-rate.negative {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
}

.s-header .change-rate.neutral,
.s-header #active-stake-rate.neutral,
.s-header #total-address-rate.neutral,
.s-header #active-pools-rate.neutral,
.s-header #circulating-supply-rate.neutral,
.s-header #treasury-amount-rate.neutral,
.s-header #reserve-amount-rate.neutral {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.35);
}

.s-content {
    padding: 12px;
}

/* 기존 템플릿에서 사용하는 상태 컬러는 유지 */
.positive {
    color: var(--s-positive) !important;
}

.negative {
    color: var(--s-negative) !important;
}

.neutral {
    color: var(--s-muted) !important;
}

/* 메인 영역 카드/테이블 느낌만 가볍게 통일 */
.s-content .grid-section,
.s-content .notice-latest-section,
.s-content .notice-container,
.s-content .notice-list,
.s-content .board-content,
.s-content .links-table,
.s-content .link-card,
.s-content .mobile-section,
.s-content .mobile-info-card {
    background: var(--s-panel);
    border: 1px solid var(--s-line);
    border-radius: 12px;
    box-shadow: none;
}

.s-content .token-table th,
.s-content .epoch-table th,
.s-content .notice-table th,
.s-content .notice-latest-table thead th,
.s-content .news-table thead th,
.s-content .links-table th {
    background: var(--s-panel-2);
    color: var(--s-text);
    border-color: var(--s-line);
}

.s-content .token-table td,
.s-content .epoch-table td,
.s-content .notice-table td,
.s-content .notice-latest-table td,
.s-content .news-table td,
.s-content .links-table td {
    color: var(--s-text);
}

.s-menu-toggle {
    display: none;
}

.mobile-slide-nav {
    display: none;
}

@media (max-width: 1024px) {
    .s-menu-toggle {
        display: none !important;
    }

    .mobile-top-controls.mobile-slide-nav,
    .mobile-icon-menu-grid.mobile-slide-nav {
        display: block !important;
    }

    .mobile-icon-menu-grid.mobile-slide-nav {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: 1200;
        background: rgba(7, 11, 20, 0.92);
        backdrop-filter: blur(8px);
    }

    .mobile-top-controls.mobile-slide-nav {
        position: sticky;
        top: 0;
        z-index: 1201;
        margin-bottom: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .mobile-submenu-container.mobile-slide-nav {
        display: none !important;
    }

    .mobile-submenu-container.mobile-slide-nav.open {
        display: block !important;
    }

    .s-sidebar {
        display: none !important;
    }

    .s-main-shell {
        margin-left: 0;
        width: 100%;
    }

    /* 상단 아이콘 메뉴(모바일)와 동시에 PC용 지표 헤더가 겹쳐 보이지 않도록 숨김 */
    .s-header {
        display: none !important;
    }

    .s-header-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .s-content {
        padding-top: 8px;
    }
}
