:root {
    --sw-bg: #0b1120;
    --sw-bg-elevated: #020617;
    --sw-border-subtle: #1f2937;
    --sw-border-strong: #374151;
    --sw-text: #e5e7eb;
    --sw-text-subtle: #9ca3af;
    --sw-accent: #22c55e;
    --sw-accent-soft: rgba(34, 197, 94, 0.12);
    --sw-danger: #f97373;
    --sw-danger-soft: rgba(248, 113, 113, 0.12);
    --sw-primary: #3b82f6;
    --sw-primary-soft: rgba(59, 130, 246, 0.12);
    --sw-radius-lg: 16px;
    --sw-radius-full: 999px;
}

/* 기본 레이아웃 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
    background: radial-gradient(circle at top, #111827, #020617 60%, #000000);
    color: var(--sw-text);
}

button,
input,
select {
    font-family: inherit;
}

/* 헤더 */

.sw-header {
    border-bottom: 1px solid var(--sw-border-subtle);
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.92);
    position: sticky;
    top: 0;
    z-index: 20;
}

.sw-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sw-header__logo {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    margin-right: 8px;
    color: var(--sw-primary);
}

.sw-header__subtitle {
    font-size: 0.9rem;
    color: var(--sw-text-subtle);
}

.sw-header__actions {
    display: flex;
    gap: 8px;
}

/* 메인 */

.sw-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 16px 40px;
}

/* 상단 툴바 */

.sw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 18px;
}

.sw-toolbar__title {
    margin: 0 0 4px;
    font-size: 1.4rem;
}

.sw-toolbar__desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--sw-text-subtle);
}

.sw-toolbar__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.sw-toolbar__search input {
    width: 260px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: var(--sw-radius-full);
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sw-text);
}

.sw-toolbar__search input::placeholder {
    color: var(--sw-text-subtle);
}

.sw-toolbar__tabs {
    display: flex;
    gap: 4px;
}

/* 레이아웃 */

.sw-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
}

@media (max-width: 960px) {
    .sw-layout {
        grid-template-columns: 1fr;
    }

    .sw-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sw-toolbar__right {
        align-items: flex-start;
        width: 100%;
    }

    .sw-toolbar__search input {
        width: 100%;
    }
}

/* 카드 */

.sw-card {
    background: var(--sw-bg-elevated);
    border-radius: var(--sw-radius-lg);
    border: 1px solid var(--sw-border-subtle);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

.sw-card--filter {
    padding: 14px 14px 16px;
}

.sw-card--results {
    padding: 14px 16px 16px;
}

.sw-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.sw-card__header h2 {
    margin: 0;
    font-size: 1rem;
}

.sw-card__header--results h2 {
    font-size: 1.05rem;
}

.sw-link {
    border: none;
    background: none;
    color: var(--sw-text-subtle);
    font-size: 0.8rem;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

/* 필터 패널 */

.sw-filter-group {
    margin-bottom: 12px;
}

.sw-filter-label {
    display: block;
    font-size: 0.8rem;
    color: var(--sw-text-subtle);
    margin-bottom: 6px;
}

.sw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sw-chip {
    border-radius: var(--sw-radius-full);
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sw-text-subtle);
    font-size: 0.8rem;
    padding: 4px 10px;
    cursor: pointer;
}

.sw-chip--selected {
    border-color: var(--sw-primary);
    background: var(--sw-primary-soft);
    color: var(--sw-text);
}

.sw-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sw-range input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sw-text);
    font-size: 0.85rem;
}

.sw-range span {
    color: var(--sw-text-subtle);
    font-size: 0.8rem;
}

.sw-filters select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sw-text);
    font-size: 0.85rem;
}

/* 버튼 */

.sw-btn {
    border-radius: var(--sw-radius-full);
    font-size: 0.85rem;
    padding: 6px 12px;
    border: 1px solid transparent;
    cursor: pointer;
    background: none;
    color: var(--sw-text);
}

.sw-btn--primary {
    background: var(--sw-primary);
    border-color: var(--sw-primary);
    color: #0b1120;
    font-weight: 500;
}

.sw-btn--primary:hover {
    filter: brightness(1.08);
}

.sw-btn--ghost {
    border-color: var(--sw-border-strong);
    background: rgba(15, 23, 42, 0.8);
    color: var(--sw-text-subtle);
}

.sw-btn--ghost:hover {
    border-color: var(--sw-primary);
    color: var(--sw-text);
}

.sw-btn--block {
    width: 100%;
    margin-top: 8px;
}

.sw-btn--xs {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* 탭 */

.sw-tab {
    border-radius: var(--sw-radius-full);
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.8);
    color: var(--sw-text-subtle);
    font-size: 0.8rem;
    padding: 4px 10px;
    cursor: pointer;
}

.sw-tab--active {
    border-color: var(--sw-primary);
    background: var(--sw-primary-soft);
    color: var(--sw-text);
}

/* 결과 영역 */

.sw-results__meta {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--sw-text-subtle);
}

.sw-results__controls {
    font-size: 0.8rem;
    color: var(--sw-text-subtle);
}

.sw-results__controls select {
    margin-left: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--sw-border-subtle);
    background: rgba(15, 23, 42, 0.9);
    color: var(--sw-text);
}

/* 테이블 */

.sw-table-wrapper {
    border-radius: 12px;
    border: 1px solid var(--sw-border-subtle);
    overflow: auto;
}

.sw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 720px;
}

.sw-table thead {
    background: rgba(15, 23, 42, 0.95);
}

.sw-table th,
.sw-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.8);
    text-align: left;
    white-space: nowrap;
}

.sw-table th {
    font-weight: 500;
    color: var(--sw-text-subtle);
    font-size: 0.8rem;
}

.sw-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.5);
}

.sw-table tbody tr:hover {
    background: rgba(30, 64, 175, 0.25);
}

.sw-table__name {
    white-space: normal;
}

.sw-table__name .name {
    display: block;
    font-weight: 500;
}

.sw-table__name .sub {
    display: block;
    font-size: 0.75rem;
    color: var(--sw-text-subtle);
}

/* 뱃지 / 점수 */

.sw-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--sw-radius-full);
    font-size: 0.75rem;
}

.sw-badge--pos {
    background: var(--sw-accent-soft);
    color: var(--sw-accent);
}

.sw-badge--neg {
    background: var(--sw-danger-soft);
    color: var(--sw-danger);
}

.sw-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--sw-border-strong);
}

.sw-score--high {
    border-color: var(--sw-accent);
    color: var(--sw-accent);
    background: var(--sw-accent-soft);
}

.sw-score--mid {
    border-color: var(--sw-primary);
    color: var(--sw-primary);
    background: var(--sw-primary-soft);
}