/* ====================================================
   Docs (Tutorial) Page Styles — clash configuration guide
   ==================================================== */

/* ---- Page Hero ---- */
.docs-hero {
    background: linear-gradient(160deg, #ffffff 0%, #fafafa 100%);
    border-bottom: 1px solid var(--color-border);
    padding: 72px 20px 60px;
    text-align: center;
}

.docs-hero h1 {
    font-size: 42px;
    font-weight: 400;
    color: var(--color-text-main);
    margin-bottom: 16px;
    line-height: 1.3;
}

.docs-hero h1 em {
    font-style: normal;
    color: var(--color-brand-orange);
}

.docs-hero-desc {
    font-size: 16px;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.75;
}

.docs-hero-stats {
    display: inline-flex;
    gap: 32px;
    background: #f5f5f7;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: 13px;
    color: var(--color-text-muted);
    flex-wrap: wrap;
    justify-content: center;
}

.docs-hero-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.docs-hero-stats i { color: var(--color-brand-orange); }

/* ---- Sticky Platform Tab Bar ---- */
.docs-tabs-wrap {
    position: -webkit-sticky;
    position: sticky;
    top: 80px;
    z-index: 90;
    background: #fff;
    border-bottom: 2px solid var(--color-border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.docs-tabs {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.docs-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 22px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
    flex-shrink: 0;
}

.docs-tab i { font-size: 16px; }
.docs-tab:hover { color: var(--color-brand-orange); }

.docs-tab.active {
    color: var(--color-brand-orange);
    border-bottom-color: var(--color-brand-orange);
    font-weight: 600;
}

/* ---- Scroll Anchor Offset ---- */
.platform-anchor {
    display: block;
    height: 70px;
    margin-top: -70px;
    visibility: hidden;
    pointer-events: none;
}

/* ---- Tutorial Section Wrapper ---- */
.docs-section {
    padding: 80px 20px;
    background: #ffffff;
}

.docs-section--alt {
    background: #f9f9f9;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.docs-section-inner {
    max-width: 960px;
    margin: 0 auto;
}

/* ---- Platform Section Header ---- */
.docs-platform-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.docs-platform-icon {
    font-size: 36px;
    color: var(--color-text-main);
    flex-shrink: 0;
    line-height: 1;
}

.docs-platform-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.docs-platform-header p {
    font-size: 14px;
    color: var(--color-text-muted);
}

.docs-platform-header > div:not(.docs-platform-icon) { flex: 1; min-width: 180px; }

.docs-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-brand-orange);
    color: #fff;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s;
}

.docs-dl-btn:hover { background: var(--color-brand-orange-hover); }

/* ---- Client Intro Card ---- */
.client-intro-card {
    display: flex;
    gap: 20px;
    background: #fff;
    border: 2px solid var(--color-brand-orange);
    border-radius: 4px;
    padding: 28px 32px;
    margin-bottom: 44px;
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.08);
}

.docs-section--alt .client-intro-card {
    background: #fff;
}

.client-intro-icon {
    font-size: 44px;
    color: var(--color-brand-orange);
    flex-shrink: 0;
    line-height: 1;
    padding-top: 4px;
}

.client-intro-body { flex: 1; }

.client-intro-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.client-intro-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-main);
}

.client-intro-body > p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

.client-intro-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Tutorial Steps Timeline ---- */
.tutorial-steps {
    display: flex;
    flex-direction: column;
}

.tutorial-step {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 24px;
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-num {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-brand-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--color-brand-orange);
    flex-shrink: 0;
    background: #fff;
    position: relative;
    z-index: 1;
}

.docs-section--alt .step-num {
    background: #f9f9f9;
}

.step-line {
    width: 2px;
    flex: 1;
    background: var(--color-border);
    margin: 8px 0;
    min-height: 40px;
}

.step-body {
    padding-bottom: 52px;
    min-width: 0;
}

.tutorial-step:last-child .step-body {
    padding-bottom: 0;
}

.step-body h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 12px;
    margin-top: 10px;
    line-height: 1.4;
}

.step-body p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 14px;
}

.step-body p:last-child { margin-bottom: 0; }

/* ---- Step Lists ---- */
.step-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.step-list li {
    font-size: 14px;
    color: var(--color-text-muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.7;
}

.step-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-brand-orange);
    font-size: 11px;
    top: 3px;
}

.step-ol {
    list-style: decimal;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.step-ol li {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.75;
    padding-left: 4px;
}

.step-ol li strong { color: var(--color-text-main); }

/* ---- Inline Link ---- */
.inline-link {
    color: var(--color-brand-orange);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.inline-link:hover { color: var(--color-brand-orange-hover); }

/* ---- Step Notes / Callouts ---- */
.step-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 4px;
    padding: 14px 16px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.65;
    margin-top: 14px;
}

.step-note i { flex-shrink: 0; margin-top: 1px; }
.step-note > span { flex: 1; min-width: 0; }

.step-note--tip {
    background: rgba(16, 185, 129, 0.04);
    border-color: rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.step-note--warn {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.25);
    border-left: 4px solid #f59e0b;
    color: #78350f;
}

/* ---- Info Box ---- */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-radius: 4px;
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.7;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

.info-box i { flex-shrink: 0; margin-top: 2px; color: var(--color-brand-orange); }

.info-box--blue {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.info-box--blue i { color: #2563eb; }

.info-box--blue strong { color: #1e3a8a; }

.info-box--purple {
    background: rgba(99, 102, 241, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
    color: #3730a3;
}

.info-box--purple i { color: #6366f1; }

.info-box--purple strong { color: #312e81; }

/* ---- Code Block ---- */
.code-block {
    background: var(--color-darker-bg);
    border: 1px solid var(--color-border-dark);
    border-left: 3px solid var(--color-brand-orange);
    border-radius: 4px;
    overflow: hidden;
    overflow-x: auto;
    margin-top: 16px;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--color-border-dark);
    font-size: 12px;
    color: #666;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1px solid #444;
    color: #888;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: color 0.2s, border-color 0.2s;
}

.copy-btn:hover { color: var(--color-brand-orange); border-color: var(--color-brand-orange); }
.copy-btn.copied { color: #10b981; border-color: #10b981; }

.code-block pre {
    padding: 18px 22px;
    font-family: 'Courier New', 'Consolas', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.9;
    color: #a0a4b8;
    overflow-x: auto;
    margin: 0;
}

.code-block code { font-family: inherit; }

.code-key     { color: #79b8ff; }
.code-val     { color: #f7931a; }
.code-comment { color: #4a5568; }

/* ---- Mode Comparison ---- */
.mode-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 16px 0;
}

.mode-item {
    background: #f9f9f9;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 18px 20px;
}

.mode-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
}

.mode-title i { color: var(--color-brand-orange); }

.mode-item > p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.65;
    margin-bottom: 12px;
}

.mode-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.mode-tag--green {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.mode-tag--blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---- Success Banner ---- */
.success-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 4px;
    padding: 16px 20px;
    font-size: 14px;
    color: #065f46;
    font-weight: 500;
    margin-top: 18px;
    line-height: 1.6;
}

.success-banner i {
    font-size: 18px;
    color: #10b981;
    flex-shrink: 0;
}

/* ---- iOS App Row ---- */
.ios-apps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 8px;
}

.ios-app-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 20px 20px 18px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ios-app-card:hover {
    border-color: var(--color-brand-orange);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.ios-app-card--active {
    border-color: var(--color-brand-orange);
    box-shadow: 0 4px 16px rgba(247,147,26,0.1);
}

.ios-app-icon {
    font-size: 32px;
    color: var(--color-text-muted);
}

.ios-app-card--active .ios-app-icon { color: var(--color-brand-orange); }

.ios-app-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-main);
}

.ios-app-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ---- Advanced Section Center Title ---- */
.docs-section-title-center {
    text-align: center;
    margin-bottom: 52px;
}

.docs-section-title-center h2 {
    font-size: 32px;
    font-weight: 400;
    color: var(--color-text-main);
    margin-bottom: 12px;
}

.docs-section-sub {
    font-size: 15px;
    color: var(--color-text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ---- Advanced Blocks ---- */
.advanced-block {
    margin-bottom: 56px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--color-border);
}

.advanced-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.advanced-block > h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
}

.advanced-block > h3 i { color: var(--color-brand-orange); }

/* ---- Mode Table ---- */
.mode-table {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    font-size: 14px;
}

.mode-table-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr 140px;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
}

.mode-table-row:last-child { border-bottom: none; }

.mode-table-head {
    background: #f5f5f7;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.mode-table-row > div {
    padding: 14px 18px;
    border-right: 1px solid var(--color-border);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.mode-table-row > div:last-child { border-right: none; }
.mode-table-row > div strong { color: var(--color-text-main); }
.mode-table-row:hover > div { background: #fafafa; }

/* ---- Protocol Grid ---- */
.protocol-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.protocol-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f7;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.proto-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.proto-ss     { background: #f7931a; }
.proto-vmess  { background: #3b82f6; }
.proto-trojan { background: #8b5cf6; }
.proto-vless  { background: #ec4899; }
.proto-hy2    { background: #10b981; }
.proto-tuic   { background: #14b8a6; }
.proto-ssr    { background: #6b7280; }
.proto-snell  { background: #f59e0b; }

/* ---- Rule Table ---- */
.rule-table {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    overflow: hidden;
    font-size: 13px;
}

.rule-row {
    display: grid;
    grid-template-columns: 200px 220px 1fr;
    border-bottom: 1px solid var(--color-border);
}

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

.rule-head {
    background: #f5f5f7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

.rule-row > div {
    padding: 12px 16px;
    border-right: 1px solid var(--color-border);
    line-height: 1.55;
    color: var(--color-text-muted);
}

.rule-row > div:last-child { border-right: none; }
.rule-row:not(.rule-head):hover > div { background: #fafafa; }

.rule-row code {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 12px;
    color: var(--color-brand-orange);
    background: rgba(247,147,26,0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ---- FAQ Section ---- */
.docs-faq {
    background: #fff;
    padding: 80px 20px;
    border-top: 1px solid var(--color-border);
}

.docs-faq-inner {
    max-width: 860px;
    margin: 0 auto;
}

.docs-faq-inner h2 {
    font-size: 32px;
    font-weight: 400;
    text-align: center;
    margin-bottom: 14px;
    color: var(--color-text-main);
}

.docs-faq-inner p.subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 15px;
    margin-bottom: 52px;
}

/* ---- CTA Section ---- */
.docs-cta {
    background: linear-gradient(135deg, var(--color-darker-bg) 0%, #1c1206 100%);
    border-top: 1px solid rgba(247, 147, 26, 0.18);
    padding: 80px 20px;
}

.docs-cta-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.docs-cta-text .section-label { margin-bottom: 12px; }

.docs-cta-text h2 {
    font-size: 32px;
    font-weight: 400;
    color: #fff;
    margin-bottom: 14px;
}

.docs-cta-text p {
    color: var(--color-text-light-muted);
    font-size: 15px;
    max-width: 480px;
    line-height: 1.75;
}

.docs-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.docs-cta-actions .btn {
    min-width: 220px;
    justify-content: center;
}

/* ====================================================
   Responsive Design
   ==================================================== */
@media (max-width: 992px) {
    .docs-hero h1 { font-size: 32px; }
    .mode-table-row { grid-template-columns: 180px 1fr 1fr; }
    .mode-table-row > div:nth-child(4) { display: none; }
    .rule-row { grid-template-columns: 180px 1fr; }
    .rule-row > div:nth-child(3) { display: none; }
    .ios-apps-row { grid-template-columns: 1fr; gap: 12px; }
    .docs-cta-inner { flex-direction: column; text-align: center; }
    .docs-cta-text p { margin: 0 auto; }
    .docs-cta-actions { width: 100%; max-width: 360px; }
}

@media (max-width: 768px) {
    .docs-hero h1 { font-size: 26px; }
    .docs-hero-stats { gap: 16px; padding: 14px 20px; }
    .docs-tabs { gap: 0; }
    .docs-tab { padding: 14px 14px; font-size: 12px; }
    .docs-tab span { display: none; }
    .docs-tab i { font-size: 18px; }

    .docs-section { padding: 52px 16px; }
    .docs-platform-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .docs-dl-btn { align-self: flex-start; }

    .client-intro-card { flex-direction: column; gap: 14px; padding: 20px; }
    .client-intro-icon { font-size: 32px; }

    .tutorial-step { grid-template-columns: 44px 1fr; gap: 16px; }
    .step-num { width: 38px; height: 38px; font-size: 13px; }
    .step-body h3 { font-size: 17px; }

    .mode-compare { grid-template-columns: 1fr; }
    .mode-table { overflow-x: auto; }
    .mode-table-row { grid-template-columns: 160px 1fr; min-width: 480px; }
    .mode-table-row > div:nth-child(3),
    .mode-table-row > div:nth-child(4) { display: none; }

    .rule-table { overflow-x: auto; }
    .rule-row { min-width: 480px; }

    .protocol-grid { gap: 8px; }
    .protocol-pill { font-size: 12px; padding: 5px 12px; }

    .docs-cta-actions .btn { width: 100%; }

    .docs-section-title-center h2 { font-size: 26px; }
    .advanced-block > h3 { font-size: 18px; }
}
