/* VAST 마스터 명세서 — GY-ENGINE 글로벌 docs 표준 (RFC-UI-V4 docs pattern) */
/* 좌측 fixed 사이드바 제거 → 상단 목차 카드 + (PC) 우측 sticky mini-rail */

/* ── Page Wrapper ─────────────────────────────────── */
.vast-wrap { background: #f8fafc; min-height: 100vh; }

/* ── Main Content ─────────────────────────────────── */
.vast-main  { padding: 28px 20px; }
@media (min-width: 1100px) { .vast-main { padding: 36px 32px; } }

.vast-inner { max-width: 1600px; margin: 0 auto; }

/* ── 2-Column Grid (PC 한정): main + sticky TOC ─── */
@media (min-width: 1100px) {
    .vast-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 36px;
        align-items: start;
    }
}
.vast-content { min-width: 0; }

/* ── Page Header ──────────────────────────────────── */
.vast-page-header {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 50%, #f0fdf4 100%);
    border: 1px solid #e0f2fe;
    border-radius: 24px;
    padding: 32px 36px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.vast-page-header::before {
    content: '';
    position: absolute;
    top: -40px; right: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(59,130,246,0.07) 0%, transparent 70%);
    pointer-events: none;
}
.vast-page-header .badge-row {
    display: flex; align-items: center; gap: 8px;
    color: #3b82f6; font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.vast-page-header h2 {
    font-size: 1.8rem; font-weight: 900;
    color: #1e293b; margin: 0 0 10px; letter-spacing: -0.5px;
    line-height: 1.25;
}
.vast-page-header p { font-size: 0.95rem; color: #64748b; margin: 0; line-height: 1.7; max-width: 600px; }

/* ── Search ───────────────────────────────────────── */
.vast-search-wrap {
    position: sticky;
    top: 70px;
    z-index: 20;
    margin-bottom: 24px;
    padding-top: 10px;
    background: #f8fafc;
}
.vast-search-inner { position: relative; }
.vast-search-inner::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
}
.vast-search-wrap input {
    width: 100%;
    padding: 13px 20px 13px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 0.93rem;
    font-family: 'Noto Sans KR', sans-serif;
    color: #334155;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.vast-search-wrap input:focus {
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59,130,246,0.12);
}
.search-count {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem; font-weight: 700;
    color: #94a3b8; background: #f1f5f9;
    padding: 2px 8px; border-radius: 10px;
}

/* ── Top TOC Card (상단 목차) ─────────────────────── */
.vast-toc-card {
    background: #ffffff;
    border: 1px solid #e0f2fe;
    border-radius: 20px;
    padding: 22px 24px 18px;
    margin-bottom: 36px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.vast-toc-title {
    margin: 0 0 14px;
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.2px;
}
.vast-toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.vast-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.18s;
}
.vast-toc-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(59,130,246,0.10);
}
.vast-toc-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.toc-num {
    width: 26px; height: 26px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.74rem; font-weight: 900; color: #fff;
    background: #3b82f6;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(59,130,246,0.18);
}
.toc-num.red    { background: #ef4444; box-shadow: 0 3px 8px rgba(239,68,68,0.18); }
.toc-num.green  { background: #10b981; box-shadow: 0 3px 8px rgba(16,185,129,0.18); }
.toc-num.purple { background: #8b5cf6; box-shadow: 0 3px 8px rgba(139,92,246,0.18); }
.toc-num.slate  { background: #475569; box-shadow: none; }
.toc-label { line-height: 1.3; }

/* ── Right Sticky TOC (PC 한정 mini-rail) ─────────── */
.vast-sticky-toc {
    display: none;
}
@media (min-width: 1100px) {
    .vast-sticky-toc {
        display: flex;
        flex-direction: column;
        gap: 2px;
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        padding: 16px 0 16px 18px;
        border-left: 1px solid #e2e8f0;
        font-size: 0.78rem;
    }
}
.vast-sticky-title {
    font-size: 0.66rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    padding: 4px 10px 8px;
}
.vast-sticky-item {
    padding: 7px 10px;
    color: #64748b;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: all 0.15s;
    border-radius: 0 6px 6px 0;
    line-height: 1.4;
}
.vast-sticky-item:hover {
    color: #334155;
    background: #f8fafc;
}
.vast-sticky-item.active {
    color: #2563eb;
    border-left-color: #3b82f6;
    font-weight: 700;
    background: #eff6ff;
}
.vast-sticky-toc::-webkit-scrollbar       { width: 4px; }
.vast-sticky-toc::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

/* ── Sections ─────────────────────────────────────── */
.vast-section { margin-bottom: 56px; scroll-margin-top: 140px; }
.vast-section-title {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.15rem; font-weight: 800; color: #1e293b;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 20px;
}
.vast-section-num {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 900; color: #fff;
    background: #3b82f6; flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(59,130,246,0.2);
}
.vast-section-num.red    { background: #ef4444; box-shadow: 0 4px 10px rgba(239,68,68,0.2); }
.vast-section-num.green  { background: #10b981; box-shadow: 0 4px 10px rgba(16,185,129,0.2); }
.vast-section-num.purple { background: #8b5cf6; box-shadow: 0 4px 10px rgba(139,92,246,0.2); }
.vast-section-num.slate  { background: #475569; box-shadow: none; }

/* ── Cards ────────────────────────────────────────── */
.vast-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 24px;
    margin-bottom: 16px;
    overflow-x: auto;
    transition: box-shadow 0.2s;
}
.vast-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.07); }

.vast-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.88rem; font-weight: 800; color: #334155;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f8fafc;
}
.vast-card-title i { font-size: 0.84rem; }

/* ── Link Grid ────────────────────────────────────── */
.vast-link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.vast-link-card {
    display: flex; flex-direction: column; text-decoration: none;
    padding: 16px 18px;
    background: #ffffff; border: 1px solid #f1f5f9;
    border-radius: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: all 0.2s; color: #334155; gap: 4px;
}
.vast-link-card:hover { border-color: #3b82f6; box-shadow: 0 6px 20px rgba(59,130,246,0.1); transform: translateY(-2px); }
.vast-link-card h4 { margin: 0; font-size: 0.93rem; font-weight: 700; }
.vast-link-card p  { margin: 0; font-size: 0.74rem; color: #94a3b8; }

/* ── Table ────────────────────────────────────────── */
.vast-table { width: 100%; border-collapse: collapse; font-size: 0.81rem; color: #475569; }
.vast-table thead th {
    background: #f8fafc; padding: 10px 14px; text-align: left;
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    color: #94a3b8; letter-spacing: 0.5px; border-bottom: 1px solid #f1f5f9;
    position: sticky; top: 0;
}
.vast-table tbody tr { border-bottom: 1px solid #f8fafc; transition: background 0.1s; }
.vast-table tbody tr:hover { background: #fafbfc; }
.vast-table td { padding: 9px 14px; vertical-align: top; }
.vast-table td:first-child { white-space: nowrap; }

/* ── Badges & Types ───────────────────────────────── */
.v-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 0.61rem; font-weight: 700; background: #f1f5f9; color: #64748b; white-space: nowrap; }
.v-badge.new { background: #dcfce7; color: #15803d; }

.v-type { display: inline-block; padding: 2px 7px; background: #f1f5f9; color: #64748b; border-radius: 6px; font-size: 0.64rem; font-family: 'Consolas', monospace; font-weight: 700; text-transform: uppercase; white-space: nowrap; }

/* ── Inline Code ──────────────────────────────────── */
.vast-wrap code { font-family: 'Consolas', 'Monaco', monospace; background: #f1f5f9; color: #dc2626; padding: 1px 5px; border-radius: 4px; font-size: 0.82em; word-break: break-all; }

/* ── Row Variants ─────────────────────────────────── */
.row-indent         { padding-left: 32px !important; font-style: italic; color: #94a3b8; }
.row-indent.green   { color: #16a34a; font-style: normal; font-weight: 600; }
.row-indent.orange  { color: #d97706; font-style: normal; font-weight: 600; }
.row-bold-blue      { font-weight: 700; color: #2563eb; }
.row-bold-red       { font-weight: 700; color: #dc2626; }
.row-bold-green     { font-weight: 700; color: #16a34a; }

/* ── Tracking Grid ────────────────────────────────── */
.tracking-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.tracking-chip { padding: 8px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #f1f5f9; font-size: 0.75rem; font-family: 'Consolas', monospace; color: #475569; }
.tracking-chip.blue  { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; font-weight: 700; }
.tracking-chip.red   { background: #fff1f2; border-color: #fecdd3; color: #be123c; font-weight: 700; }
.tracking-chip.green { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* ── Macro Grid ───────────────────────────────────── */
.macro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.macro-chip { padding: 10px 8px; border-radius: 12px; background: #f8fafc; border: 1px solid #f1f5f9; text-align: center; font-size: 0.71rem; }
.macro-chip.highlight { background: #f0fdf4; border-color: #bbf7d0; }
.macro-chip code { display: block; margin-top: 4px; }

/* ── Error Grid ───────────────────────────────────── */
.error-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.error-item { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; background: #f8fafc; border-radius: 10px; font-size: 0.81rem; border: 1px solid #f1f5f9; }
.error-item code { font-size: 0.78rem; white-space: nowrap; }

/* ── Footer ───────────────────────────────────────── */
.vast-footer {
    margin-top: 56px; padding: 28px 0;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    font-size: 0.78rem; color: #cbd5e1; line-height: 2;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1099px) {
    .vast-main        { padding: 20px 16px; }
    .vast-page-header { padding: 24px 20px; }
    .vast-page-header h2 { font-size: 1.4rem; }
    .vast-toc-card    { padding: 18px 18px 14px; }
}

@media (max-width: 767px) {
    .vast-link-grid  { grid-template-columns: 1fr 1fr; }
    .vast-card       { padding: 14px; }
    .tracking-grid, .macro-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .error-grid      { grid-template-columns: 1fr; }
    .vast-table td:first-child { white-space: normal; }
    .vast-toc-grid   { grid-template-columns: 1fr; }
}
