:root {
    /* Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --accent-red: #ef4444;
    --accent-lg: #e11d48;
    --accent-kt: #0284c7;

    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Layout */
    --sidebar-width: 280px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-sidebar: rgba(30, 41, 59, 0.8);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: #334155;
}

[data-theme="dark"] .logo-image {
    filter: brightness(0) invert(1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: break-word;
}

img,
video {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 72px;
    box-sizing: border-box;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    padding: 0;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.logo i {
    font-size: 28px;
}

.logo-image {
    height: 100%;
    width: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 16px;
    z-index: 10;
}

.sidebar-nav {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.nav-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 600;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    text-decoration: none;
}

.nav-cta-wrapper {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, background 0.2s;
}

.cta-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    text-decoration: none;
}

.pulse-effect {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.cta-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevents flexbox from forcing width based on content like tables */
    padding-top: 72px;
}

.topbar {
    height: 72px;
    box-sizing: border-box;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 90;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-main);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    width: 200px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-main);
}

/* Article */
.wiki-article {
    padding: 48px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.article-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 24px;
}

.article-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hero Section */
.hero-section {
    width: 100%;
    margin-bottom: 48px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Typography in Article */
.article-body h2 {
    font-size: 24px;
    margin: 48px 0 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-body p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.article-body strong {
    color: var(--text-primary);
}

/* Intro Card */
.intro-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.02) 100%);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 48px;
}

.intro-card h2 {
    margin-top: 0;
    border: none;
    color: var(--primary);
    font-size: 22px;
}

.intro-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-surface);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

.badge i {
    color: #10b981;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.info-box {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.info-box:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.info-box i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 16px;
}

.info-box h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.info-box p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Pricing Table */
.pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.pricing-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.pricing-card.highlight {
    border: 2px solid var(--primary);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.popular-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.network-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.network-badge.kt {
    background: var(--accent-kt);
}

.network-badge.lg {
    background: var(--accent-lg);
}

.network-badge.both {
    background: #8b5cf6;
}

.pricing-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.price span {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-secondary);
}

.features i {
    color: var(--primary);
    font-size: 18px;
}

/* Tabs */
.plan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    overflow-x: auto;
    /* Hide scrollbar for cleaner look but keep it scrollable */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.plan-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wiki Table */
.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 65vh;
    margin-bottom: 48px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.wiki-table th,
.wiki-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
    .wiki-table th,
    .wiki-table td {
        padding: 16px 12px;
    }
}

.wiki-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-sidebar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: inset 0 -1px 0 var(--border);
    /* Ensures border is sticky too */
}

.wiki-table td {
    font-size: 15px;
    color: var(--text-primary);
    vertical-align: middle;
    /* Removed white-space: nowrap to allow wrapping on PC */
}

/* Specific column widths to help layout */
.wiki-table td:nth-child(1) { min-width: 140px; white-space: normal; } /* 요금제명 */
.wiki-table td:nth-child(2) { white-space: nowrap; } /* 월 요금 */
.wiki-table td:nth-child(3),
.wiki-table td:nth-child(4) { white-space: normal; min-width: 80px; } /* 통화, 문자 */
.wiki-table td:nth-child(5) { white-space: normal; min-width: 180px; } /* 데이터 */

.wiki-table tr:last-child td {
    border-bottom: none;
}

.wiki-table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.wiki-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.wiki-table tbody tr.selected {
    background: rgba(37, 99, 235, 0.1);
}

.wiki-table .price-col {
    color: var(--primary);
    font-weight: 700;
    font-size: 16px;
}

/* Partner Background Colors for Table Rows */
.wiki-table tbody tr.partner-millie { background-color: rgba(250, 204, 21, 0.1); }
.wiki-table tbody tr.partner-daiso { background-color: rgba(239, 68, 68, 0.08); }
.wiki-table tbody tr.partner-olive { background-color: rgba(132, 204, 22, 0.1); }
.wiki-table tbody tr.partner-cu { background-color: rgba(168, 85, 247, 0.08); }
.wiki-table tbody tr.partner-naver { background-color: rgba(34, 197, 94, 0.08); }
.wiki-table tbody tr.partner-coupang { background-color: rgba(59, 130, 246, 0.08); }

a:hover {
    text-decoration: underline;
}

/* Internal Wiki Link Style */
.wiki-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    font-weight: 500;
    transition: all 0.2s ease;
}

.wiki-link:hover {
    background-color: rgba(37, 99, 235, 0.1);
    border-bottom-style: solid;
    text-decoration: none;
}

/* Primary Button */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: white;
}

/* Terminology Grid */
.term-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}

.term-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: block;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.term-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.term-card h3 {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 8px;
}

.term-card p {
    font-size: 14px;
    margin-bottom: 0;
    color: var(--text-secondary);
}

/* Steps */
.step-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.step {
    display: flex;
    gap: 24px;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.step-content p {
    margin-bottom: 0;
    font-size: 15px;
}

.inline-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    color: var(--primary);
    font-weight: 600;
}

.inline-cta i {
    transition: transform 0.2s;
}

.inline-cta:hover i {
    transform: translateX(4px);
}

/* Promotion Banner */
.promotion-banner {
    background: linear-gradient(to right, #1e3a8a, #3b82f6);
    border-radius: var(--radius-xl);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    color: white;
    margin-top: 64px;
}

.banner-content h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.banner-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

.btn-primary {
    background: white;
    color: var(--primary);
    padding: 16px 32px;
    border-radius: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: scale(1.05);
}

/* Footer */
.footer {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.disclaimer {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
    .promotion-banner {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
        left: 0;
    }

    .topbar .mobile-toggle {
        display: block;
        margin-right: 16px;
    }

    .search-bar {
        display: none;
    }

    .wiki-article {
        padding: 24px 16px;
    }

    .article-title {
        font-size: 28px;
    }

    .step {
        flex-direction: column;
        gap: 16px;
    }

    .pricing-table {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .plan-tabs {
        padding-bottom: 4px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .pricing-card.highlight {
        transform: none;
    }
}