:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --primary-color: #007bff;
    --header-bg: #f8f9fa;
    --footer-bg: #f8f9fa;
    --border-color: #dee2e6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #f0f0f0;
        --primary-color: #4da3ff;
        --header-bg: #2d2d2d;
        --footer-bg: #2d2d2d;
        --border-color: #404040;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

header nav {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
}

header ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    align-items: center;
}

.lang-switcher {
    position: relative;
    margin-left: 20px;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--header-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 80px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.lang-switcher:hover .lang-dropdown {
    display: block;
}

.lang-dropdown a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-color);
    text-align: center;
}

.lang-dropdown a:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.lang-dropdown a.active {
    font-weight: bold;
    color: var(--primary-color);
}

header a {
    text-decoration: none;
    color: var(--text-color);
}

header a:hover {
    color: var(--primary-color);
}

main {
    min-height: calc(100vh - 140px);
}

footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* Markdown Styles */
h1,
h2,
h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

a {
    color: var(--primary-color);
}

code {
    background-color: rgba(127, 127, 127, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

pre {
    background-color: rgba(127, 127, 127, 0.1);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* OAP Onepager Styles */
.oap-page {
    max-width: 100%;
}

.hero-section {
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 40px;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: normal;
    margin-bottom: 2rem;
    color: #ddd;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.split-layout {
    display: flex;
    gap: 40px;
    align-items: center;
    margin-bottom: 60px;
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

.split-image,
.split-text {
    flex: 1;
}

.text-block {
    margin-bottom: 20px;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.principle-card {
    background: var(--header-bg);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.principle-card .icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.architecture-diagram {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.layer {
    padding: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
    border-radius: 4px;
}

.layer-1 {
    background-color: #4da3ff;
    margin: 0 20px;
}

.layer-0 {
    background-color: #0056b3;
}

.cta-section {
    text-align: center;
    background: var(--header-bg);
    padding: 60px 20px;
    border-radius: 8px;
    margin-top: 60px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

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

.btn-secondary {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }

    .split-layout.reverse {
        flex-direction: column;
    }
}

/* Contact Form Styles */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--header-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input {
    margin-top: 5px;
}

.checkbox-group label {
    font-weight: normal;
    font-size: 0.9rem;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert.success {
    background-color: rgba(40, 167, 69, 0.2);
    border: 1px solid #28a745;
    color: #28a745;
}

.alert.error {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid #dc3545;
    color: #dc3545;
}