/* ============================================================
   Protocols / Core Principles Page Styles
   Extends main.css — protocols-specific components only
   ============================================================ */

/* ── Hero ─────────────────────────────────────────────────── */
.proto-hero {
    padding: 120px 24px 64px;
    text-align: center;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, #e8f2ff 0%, #ffffff 60%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.proto-hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.proto-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 113, 227, 0.07);
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 40px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--accent-blue);
    margin-bottom: 24px;
}

.proto-hero h1 {
    font-size: clamp(36px, 5.5vw, 60px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 20px;
    background: linear-gradient(170deg, #1d1d1f 0%, #3a3a3a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.proto-hero-desc {
    font-size: clamp(15px, 2vw, 17px);
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.proto-hero-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.proto-toc-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.09);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.proto-toc-chip:hover {
    background: rgba(0, 113, 227, 0.08);
    border-color: rgba(0, 113, 227, 0.25);
    color: var(--accent-blue);
}

/* ── Sections ─────────────────────────────────────────────── */
.proto-section {
    padding: 80px 24px;
}

.proto-section--alt {
    background: #f8f8fa;
}

.proto-section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.proto-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.proto-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.proto-step-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-blue);
}

.proto-section h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 20px;
}

.proto-section-lead {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 760px;
    margin-bottom: 48px;
}

/* ── Content Grid ─────────────────────────────────────────── */
.proto-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: center;
}

.proto-content-grid--flow {
    grid-template-columns: 5fr 4fr;
}

.proto-copy h2 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    line-height: 1.25;
}

.proto-copy p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.proto-steps-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.proto-steps-list li {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.proto-steps-list li strong {
    color: var(--text-main);
}

/* ── Flow Diagram ─────────────────────────────────────────── */
.proto-visual--flow {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flow-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    max-width: 320px;
}

.flow-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    width: 100%;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.flow-node i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.flow-node small {
    display: block;
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.flow-node--app { border-color: rgba(0, 113, 227, 0.2); }
.flow-node--app i { color: #0071e3; }
.flow-node--clash { border-color: rgba(0, 200, 100, 0.3); background: rgba(0, 200, 100, 0.04); }
.flow-node--clash i { color: #34c759; }
.flow-node--dns { border-color: rgba(255, 149, 0, 0.3); }
.flow-node--dns i { color: #ff9500; }
.flow-node--rule { border-color: rgba(88, 86, 214, 0.3); }
.flow-node--rule i { color: #5856d6; }

.flow-arrow {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 4px 0;
    opacity: 0.5;
}

.flow-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
}

.flow-branch-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 6px;
}

.flow-branch-icon { font-size: 18px; }

.flow-branch--direct {
    background: rgba(52, 199, 89, 0.08);
    border: 1.5px solid rgba(52, 199, 89, 0.25);
}

.flow-branch--direct .flow-branch-label {
    background: rgba(52, 199, 89, 0.15);
    color: #1a8c3c;
}

.flow-branch--direct .flow-branch-icon { color: #34c759; }

.flow-branch--proxy {
    background: rgba(0, 113, 227, 0.06);
    border: 1.5px solid rgba(0, 113, 227, 0.2);
}

.flow-branch--proxy .flow-branch-label {
    background: rgba(0, 113, 227, 0.12);
    color: var(--accent-blue);
}

.flow-branch--proxy .flow-branch-icon { color: var(--accent-blue); }

/* ── Rule Engine ──────────────────────────────────────────── */
.rule-types-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.rule-type-card {
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 28px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.rule-type-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 113, 227, 0.2);
}

.rule-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.rule-type-icon--domain { background: rgba(0, 113, 227, 0.1); color: var(--accent-blue); }
.rule-type-icon--ip { background: rgba(52, 199, 89, 0.12); color: #27a84a; }
.rule-type-icon--process { background: rgba(88, 86, 214, 0.1); color: #5856d6; }
.rule-type-icon--ruleset { background: rgba(255, 149, 0, 0.1); color: #d97706; }

.rule-type-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}

.rule-type-card > p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.rule-code-block {
    background: var(--code-bg);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rule-code-block .comment {
    color: #636366;
    font-style: italic;
}

.rule-code-line {
    display: flex;
    gap: 8px;
}

.rc-type {
    color: #ff9f0a;
    font-weight: 500;
}

.rc-val {
    color: #30d158;
}

.rc-action {
    color: #64d2ff;
}

.rule-type-notes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rule-type-notes li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 12px;
    position: relative;
}

.rule-type-notes li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.rule-type-notes li code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
}

/* Rule Priority Box */
.rule-priority-box {
    background: linear-gradient(135deg, #fff8e6 0%, #fffdf5 100%);
    border: 1.5px solid rgba(255, 149, 0, 0.25);
    border-radius: 16px;
    padding: 28px 32px;
}

.rule-priority-box h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-priority-box p {
    font-size: 14px;
    color: #78350f;
    line-height: 1.65;
    margin-bottom: 16px;
}

.rule-priority-box code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 5px;
}

.priority-order {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.priority-order li {
    font-size: 14px;
    color: #78350f;
    line-height: 1.55;
}

.priority-order li code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: rgba(180, 83, 9, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── TUN Mode ─────────────────────────────────────────────── */
.tun-compare-table {
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    margin-bottom: 28px;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tun-compare-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tun-compare-row:last-child { border-bottom: none; }

.tun-compare-row > div {
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.55;
}

.tun-compare-row--header > div {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.025);
    padding: 10px 16px;
}

.tun-row-label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px !important;
}

.tun-compare-row > div:nth-child(3) {
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 113, 227, 0.025);
}

.tun-config-note {
    margin-top: 8px;
}

.tun-config-note h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.tun-note-tip {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
}

.tun-note-tip code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
}

/* TUN Visual Diagram */
.proto-visual--tun {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tun-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
}

.tun-layer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 14px;
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    width: 100%;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tun-layer i {
    font-size: 20px;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

.tun-layer strong { display: block; font-size: 14px; }
.tun-layer small { font-size: 11.5px; color: var(--text-secondary); }

.tun-layer--app i { color: #0071e3; }
.tun-layer--clash { border-color: rgba(52, 199, 89, 0.3); background: rgba(52, 199, 89, 0.04); }
.tun-layer--clash i { color: #34c759; }
.tun-layer--net i { color: #5856d6; }

.tun-layer-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.tun-mode-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.tun-mode-badge--sys {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-secondary);
}

.tun-mode-badge--tun {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
}

.tun-vs {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.tun-arrow {
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.45;
}

/* ── Proto Code Block ─────────────────────────────────────── */
.proto-code-block {
    border-radius: 14px;
    overflow: hidden;
    background: var(--code-bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    min-width: 0;
}

.proto-code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.proto-code-dots {
    display: flex;
    gap: 5px;
}

.dot-r, .dot-y, .dot-g {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.proto-code-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-line {
    font-size: 13px;
    line-height: 1.7;
    color: #e5e5e7;
}

.ck { color: #64d2ff; }
.cv { color: #30d158; }
.cc { color: #636366; font-style: italic; }

/* ── DNS Section ──────────────────────────────────────────── */
.dns-modes-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.dns-mode-card {
    border-radius: 18px;
    padding: 28px;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    background: #fff;
}

.dns-mode-card--fakeip {
    border-color: rgba(0, 113, 227, 0.2);
    background: linear-gradient(145deg, #f5f9ff 0%, #fff 100%);
}

.dns-mode-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.dns-mode-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
}

.dns-mode-card--redir .dns-mode-icon {
    background: rgba(88, 86, 214, 0.1);
    color: #5856d6;
}

.dns-mode-head h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.dns-mode-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.dns-mode-tag--recommended {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
}

.dns-mode-tag:not(.dns-mode-tag--recommended) {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

.dns-mode-card > p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.dns-flow {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 14px;
}

.dns-flow-step {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dns-flow-step code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    background: rgba(0, 0, 0, 0.07);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--text-main);
}

.dns-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.dns-flow-arrow {
    color: var(--accent-blue);
    font-size: 11px;
    padding-left: 26px;
    opacity: 0.5;
}

.dns-pros {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.dns-pros .fa-check { color: #34c759; }

.dns-config-example {
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 28px;
}

.dns-config-example h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.dns-config-tip {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 14px;
}

.dns-config-tip code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ── Protocols Grid ───────────────────────────────────────── */
.protocols-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.protocol-detail-card {
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 24px;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.protocol-detail-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 113, 227, 0.2);
    transform: translateY(-2px);
}

.pd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pd-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

.pd-icon--ss { background: rgba(255, 149, 0, 0.12); color: #d97706; }
.pd-icon--vmess { background: rgba(0, 113, 227, 0.1); color: var(--accent-blue); }
.pd-icon--trojan { background: rgba(52, 199, 89, 0.12); color: #27a84a; }
.pd-icon--hy2 { background: rgba(255, 59, 48, 0.1); color: #dc2626; }
.pd-icon--tuic { background: rgba(88, 86, 214, 0.1); color: #5856d6; }
.pd-icon--wg { background: rgba(100, 210, 255, 0.15); color: #0284c7; }

.pd-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pd-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.pd-tag--stable { background: rgba(255, 149, 0, 0.1); color: #b45309; }
.pd-tag--v2ray { background: rgba(0, 113, 227, 0.1); color: var(--accent-blue); }
.pd-tag--tls { background: rgba(52, 199, 89, 0.1); color: #166534; }
.pd-tag--new { background: rgba(88, 86, 214, 0.1); color: #5856d6; }

.protocol-detail-card > p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.pd-specs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 14px;
}

.pd-spec {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
}

.pd-spec-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 56px;
    flex-shrink: 0;
}

/* ── Proxy Groups ─────────────────────────────────────────── */
.pg-types-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.pg-type-card {
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    padding: 28px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.pg-type-card--highlight {
    border-color: rgba(0, 113, 227, 0.25);
    background: linear-gradient(145deg, #f5f9ff 0%, #fff 100%);
}

.pg-type-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 113, 227, 0.2);
}

.pg-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.pg-type-icon--select { background: rgba(0, 0, 0, 0.06); color: var(--text-secondary); }
.pg-type-icon--urltest { background: rgba(0, 113, 227, 0.1); color: var(--accent-blue); }
.pg-type-icon--fallback { background: rgba(255, 59, 48, 0.1); color: #dc2626; }
.pg-type-icon--lb { background: rgba(52, 199, 89, 0.1); color: #27a84a; }

.pg-type-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pg-type-card > p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.pg-config {
    background: var(--code-bg);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pg-config-line {
    color: #e5e5e7;
    line-height: 1.6;
}

/* ── Kernel Compare ───────────────────────────────────────── */
.kernel-compare-wrap {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid rgba(0, 0, 0, 0.09);
    margin-bottom: 32px;
    background: #fff;
}

.kernel-card {
    flex: 1;
    padding: 32px;
}

.kernel-card--meta {
    background: linear-gradient(145deg, #f5f9ff 0%, #fff 100%);
    border-left: 1px solid rgba(0, 113, 227, 0.12);
}

.kernel-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.kernel-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.kernel-icon--meta {
    background: rgba(0, 113, 227, 0.1);
    color: var(--accent-blue);
}

.kernel-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.kernel-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.kernel-tag--meta {
    color: var(--accent-blue);
}

.kernel-feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kernel-feature-list li {
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

.kf-yes { color: var(--text-main); }
.kf-no { color: var(--text-secondary); opacity: 0.6; }

.kf-yes .fa-check { color: #34c759; flex-shrink: 0; margin-top: 2px; }
.kf-no .fa-times { color: #ff3b30; flex-shrink: 0; margin-top: 2px; }

.kernel-vs-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.025);
    border-left: 1px solid rgba(0, 0, 0, 0.07);
    border-right: 1px solid rgba(0, 0, 0, 0.07);
    letter-spacing: 0.04em;
}

.kernel-conclusion {
    background: rgba(0, 113, 227, 0.04);
    border: 1.5px solid rgba(0, 113, 227, 0.15);
    border-radius: 14px;
    padding: 24px 28px;
}

.kernel-conclusion p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.kernel-conclusion strong { color: var(--text-main); }

.kernel-cta {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── FAQ Section ──────────────────────────────────────────── */
.proto-faq-section {
    padding: 80px 24px;
    background: #f8f8fa;
}

.proto-faq-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.proto-faq-inner h2 {
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 40px;
    text-align: center;
}

.proto-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.proto-faq-item {
    background: #fff;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 22px 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.proto-faq-item:hover {
    border-color: rgba(0, 113, 227, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.proto-faq-q {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-main);
}

.proto-faq-q .fa-chevron-right {
    color: var(--accent-blue);
    margin-top: 3px;
    flex-shrink: 0;
    font-size: 12px;
}

.proto-faq-a {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.proto-faq-a code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.06);
    padding: 1px 5px;
    border-radius: 4px;
    color: var(--text-main);
}

/* ── CTA Banner ───────────────────────────────────────────── */
.proto-cta-banner {
    padding: 80px 24px;
    background: linear-gradient(135deg, #0a1628 0%, #1a2d4a 100%);
    text-align: center;
}

.proto-cta-inner {
    max-width: 640px;
    margin: 0 auto;
}

.proto-cta-text h2 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    line-height: 1.2;
}

.proto-cta-text p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 32px;
    line-height: 1.65;
}

.proto-cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.proto-cta-banner .btn-link {
    color: rgba(255, 255, 255, 0.8);
}

.proto-cta-banner .btn-link:hover {
    color: #fff;
}

/* ── Scroll reveal animation classes ─────────────────────── */
.proto-hidden {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.proto-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Active TOC chip state */
.proto-toc-chip--active {
    background: rgba(0, 113, 227, 0.1);
    border-color: rgba(0, 113, 227, 0.3);
    color: var(--accent-blue);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
    .proto-content-grid,
    .proto-content-grid--flow {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .proto-visual--tun {
        order: -1;
    }

    .rule-types-grid {
        grid-template-columns: 1fr;
    }

    .protocols-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .kernel-compare-wrap {
        flex-direction: column;
    }

    .kernel-vs-badge {
        width: 100%;
        height: 36px;
        border-left: none;
        border-right: none;
        border-top: 1px solid rgba(0, 0, 0, 0.07);
        border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    }

    .kernel-card--meta {
        border-left: none;
        border-top: none;
    }

    .proto-faq-grid {
        grid-template-columns: 1fr;
    }

    .dns-modes-wrap {
        grid-template-columns: 1fr;
    }

    .pg-types-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .proto-hero {
        padding: 100px 20px 48px;
    }

    .proto-section {
        padding: 56px 20px;
    }

    .protocols-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tun-compare-row {
        grid-template-columns: 72px 1fr;
    }

    .tun-compare-row > div {
        padding: 10px 12px;
        font-size: 12.5px;
    }

    .tun-compare-row--header > div:nth-child(3),
    .tun-compare-row > div:nth-child(3) {
        display: none;
    }

    .rule-code-block {
        font-size: 11px;
    }

    .pg-config {
        font-size: 11px;
    }

    .rule-code-line {
        white-space: nowrap;
    }

    .flow-split {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 16px;
    }

    .kernel-cta {
        flex-direction: column;
    }

    .proto-cta-actions {
        flex-direction: column;
        align-items: center;
    }
}
