import os
import json

domain = "gaternjc.cyou"
reg_url = "https://yinxing4.twilightaff.com/#/?code=37v8Onc7"
rec_url = "https://jichangreview.net"
pbn_1_url = "https://jichangguide.net"
pbn_1_text = "机场测评"
pbn_2_url = "https://clashx.club"
pbn_2_text = "机场教程"

# Write CSS
css_content = """/* Gatern Cloud Modern Dark Theme Stylesheet */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    --gradient-card: linear-gradient(180deg, rgba(30,41,59,0.7) 0%, rgba(15,23,42,0.9) 100%);
    --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: all 0.2s ease; }
a:hover { color: #38bdf8; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.navbar {
    display: flex; justify-content: space-between; align-items: center; height: 75px;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.35rem; font-weight: 700; color: var(--text-main);
}

.brand img.logo-img {
    width: 38px; height: 38px; border-radius: 8px; object-fit: cover;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.nav-links {
    display: flex; align-items: center; gap: 22px; list-style: none;
}

.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--text-main); }

.header-btns { display: flex; align-items: center; gap: 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 0.92rem;
    transition: all 0.25s ease; cursor: pointer; border: none; text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff !important; box-shadow: var(--shadow-glow);
}
.btn-primary:hover {
    transform: translateY(-2px); box-shadow: 0 12px 35px -8px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08); color: var(--text-main) !important;
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }

.btn-recommend {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff !important;
}
.btn-recommend:hover {
    transform: translateY(-2px); box-shadow: 0 8px 25px rgba(236, 72, 153, 0.4);
}

.hero {
    background: var(--gradient-hero); padding: 80px 0 60px 0; text-align: center;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px;
    border-radius: 30px; background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3); color: #a5b4fc;
    font-size: 0.9rem; font-weight: 600; margin-bottom: 24px;
}

.hero h1 {
    font-size: 2.7rem; font-weight: 800; line-height: 1.25; margin-bottom: 20px;
    background: linear-gradient(to right, #ffffff, #cbd5e1, #a5b4fc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem; color: var(--text-muted); max-width: 820px; margin: 0 auto 36px auto;
}

.hero-cta { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-tags { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tag-item {
    background: rgba(30, 41, 59, 0.6); border: 1px solid var(--border-color);
    padding: 6px 14px; border-radius: 6px; font-size: 0.85rem; color: var(--text-muted);
}

.section { padding: 70px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

.section-title { text-align: center; margin-bottom: 45px; }
.section-title h2 { font-size: 2.1rem; font-weight: 700; margin-bottom: 12px; color: #fff; }
.section-title p { color: var(--text-muted); font-size: 1.05rem; }

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px;
}

.feature-card {
    background: var(--gradient-card); border: 1px solid var(--border-color);
    padding: 28px; border-radius: 16px; transition: transform 0.3s ease;
}
.feature-card:hover { transform: translateY(-5px); border-color: rgba(99, 102, 241, 0.4); }

.feature-icon {
    width: 48px; height: 48px; border-radius: 12px; background: rgba(99, 102, 241, 0.15);
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    margin-bottom: 18px; color: var(--primary-light);
}

.feature-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: #f8fafc; }
.feature-card p { color: var(--text-muted); font-size: 0.93rem; }

.pricing-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px;
}

.pricing-card {
    background: var(--gradient-card); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 30px 22px; position: relative;
    display: flex; flex-direction: column; justify-content: space-between; transition: all 0.3s ease;
}

.pricing-card.popular {
    border-color: var(--primary); box-shadow: 0 0 25px rgba(99, 102, 241, 0.25);
}

.badge-popular {
    position: absolute; top: -12px; right: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700;
}

.plan-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; color: #fff; }
.plan-price { font-size: 2.1rem; font-weight: 800; color: #ffffff; margin-bottom: 16px; }
.plan-price span { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; }

.plan-features { list-style: none; margin-bottom: 24px; }
.plan-features li {
    padding: 7px 0; color: var(--text-muted); font-size: 0.92rem; display: flex; align-items: center; gap: 8px;
}
.plan-features li::before { content: "✓"; color: var(--accent); font-weight: bold; }

.articles-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 26px;
}

.article-card {
    background: var(--gradient-card); border: 1px solid var(--border-color);
    border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s ease;
}
.article-card:hover { transform: translateY(-5px); border-color: var(--primary); }

.article-content { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.article-tag { font-size: 0.8rem; color: var(--accent); font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }

.article-card h3 { font-size: 1.15rem; margin-bottom: 12px; line-height: 1.45; }
.article-card h3 a { color: var(--text-main); }
.article-card h3 a:hover { color: var(--accent); }

.article-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; flex-grow: 1; }
.article-meta {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); padding-top: 14px;
}

.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.review-card {
    background: var(--gradient-card); border: 1px solid var(--border-color);
    border-radius: 16px; padding: 24px;
}
.review-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.review-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center; font-weight: bold; color: white;
}
.review-info h4 { font-size: 1rem; color: #fff; }
.review-stars { color: #f59e0b; font-size: 0.88rem; }
.review-card p { color: var(--text-muted); font-size: 0.93rem; font-style: italic; }

.faq-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
    background: var(--gradient-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden;
}
.faq-question {
    padding: 18px 22px; font-size: 1.05rem; font-weight: 600; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; user-select: none; color: #fff;
}
.faq-answer {
    padding: 0 22px 20px 22px; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7;
    display: none; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 10px; padding-top: 15px;
}
.faq-item.active .faq-answer { display: block; }
.faq-toggle { font-size: 1.4rem; color: var(--accent); transition: transform 0.2s ease; }
.faq-item.active .faq-toggle { transform: rotate(45deg); }

.article-page { padding: 50px 0; }
.article-container {
    max-width: 880px; margin: 0 auto; background: var(--gradient-card);
    border: 1px solid var(--border-color); border-radius: 18px; padding: 40px;
}
.breadcrumb { display: flex; gap: 8px; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }
.article-header { margin-bottom: 32px; border-bottom: 1px solid var(--border-color); padding-bottom: 24px; }
.article-header h1 { font-size: 2.1rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px; color: #fff; }
.article-body { font-size: 1.05rem; line-height: 1.85; color: #cbd5e1; }
.article-body h2 { font-size: 1.55rem; color: #ffffff; margin: 36px 0 16px 0; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.article-body h3 { font-size: 1.25rem; color: #f1f5f9; margin: 24px 0 12px 0; }
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin-bottom: 24px; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
.callout-box {
    background: rgba(99, 102, 241, 0.1); border-left: 4px solid var(--primary);
    padding: 20px; border-radius: 0 12px 12px 0; margin: 28px 0;
}
.callout-box p { margin-bottom: 0; }

.article-cta {
    background: linear-gradient(135deg, rgba(99,102,241,0.2) 0%, rgba(6,182,212,0.2) 100%);
    border: 1px solid rgba(99,102,241,0.4); border-radius: 14px; padding: 28px; text-align: center; margin: 40px 0;
}
.article-cta h3 { font-size: 1.4rem; margin-bottom: 12px; color: #fff; }
.article-cta p { margin-bottom: 20px; color: var(--text-muted); }

.related-articles { margin-top: 50px; border-top: 1px solid var(--border-color); padding-top: 30px; }
.related-articles h3 { font-size: 1.3rem; margin-bottom: 20px; color: #fff; }

footer {
    background: #090d16; border-top: 1px solid var(--border-color); padding: 50px 0 30px 0;
    font-size: 0.9rem; color: var(--text-muted); text-align: center;
}
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 900px; margin: 0 auto; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text-main); }

.friendship-links {
    margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 13px; color: #64748b; display: flex; align-items: center; justify-content: center;
    gap: 16px; flex-wrap: wrap;
}
.friendship-links span { color: #475569; }
.friendship-links a { color: #64748b; font-size: 13px; text-decoration: none; transition: color 0.2s ease; }
.friendship-links a:hover { color: #94a3b8; text-decoration: underline; }

@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 15px 0; gap: 15px; }
    .hero h1 { font-size: 2rem; }
    .article-container { padding: 20px; }
}
"""

with open("style.css", "w", encoding="utf-8") as f:
    f.write(css_content)

print("style.css successfully created!")

.brand, a.brand, .brand span {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.35rem; font-weight: 800; color: #ffffff !important;
    text-decoration: none; text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.nav-links a { color: #f1f5f9 !important; font-weight: 600; font-size: 0.98rem; }
.nav-links a:hover { color: #38bdf8 !important; }


/* Fix Visibility & Contrast Enhancements */
body {
    background-color: #0f172a !important;
    color: #f8fafc !important;
}

.hero {
    background: #0f172a linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #0f172a 100%) !important;
    padding: 80px 0 60px 0 !important;
    color: #ffffff !important;
}

.hero h1 {
    font-size: 2.8rem !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    margin-bottom: 20px !important;
    color: #ffffff !important;
    background: linear-gradient(to right, #ffffff, #e2e8f0, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.15rem !important;
    color: #cbd5e1 !important;
    max-width: 820px !important;
    margin: 0 auto 36px auto !important;
    font-weight: 500 !important;
}

.hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 8px 20px !important;
    border-radius: 30px !important;
    background: rgba(99, 102, 241, 0.25) !important;
    border: 1.5px solid #818cf8 !important;
    color: #e0e7ff !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    margin-bottom: 24px !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.7) !important;
}

.btn-recommend {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

.tag-item {
    background: #1e293b !important;
    border: 1px solid #475569 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    color: #f1f5f9 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
