* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f1419 0%, #1a2332 100%);
    color: #e0e0e0;
    line-height: 1.6;
}

.header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    padding: 10px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rune-container {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rune-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-radius: 50%;
    animation: orbitRotate 6s linear infinite;
}

.rune-orbit::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #d4af37, #b8860b);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
    animation: dotPulse 2s ease-in-out infinite;
}

.rune-orbit::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: linear-gradient(45deg, #deb887, #cd853f);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(222, 184, 135, 0.5);
    animation: dotPulse 2s ease-in-out infinite 1s;
}

.rune-symbol {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b35, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.3));
    animation: runeGlow 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes orbitRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes dotPulse {
    0%, 100% { 
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translateX(-50%) scale(1.3);
    }
}

@keyframes runeGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(255, 107, 53, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.5));
    }
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b35, #d4af37);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
}

.sidebar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.sidebar.scrolling {
    pointer-events: none !important;
    user-select: none !important;
}

.sidebar.scrolling * {
    pointer-events: none !important;
    user-select: none !important;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.6);
}

.sidebar-title {
    color: #d4af37;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section-title {
    color: #d4af37;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link {
    display: block;
    padding: 8px 12px;
    color: #b0b0b0;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    margin-bottom: 5px;
}

.nav-link:hover:not(.active) {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    padding-left: 16px;
}

.nav-link.active {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border-left: 3px solid #d4af37;
}

.content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 40px;
}

.content h1 {
    color: #d4af37;
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.content h2 {
    color: #d4af37;
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 10px;
}

.content h3 {
    color: #d4af37;
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 12px;
    font-weight: 600;
}

.content p {
    margin-bottom: 16px;
    color: #c0c0c0;
    font-size: 16px;
}

.content ul, .content ol {
    margin-left: 25px;
    margin-bottom: 20px;
    color: #c0c0c0;
}

.content li {
    margin-bottom: 8px;
}

.content code {
    background: rgba(0, 0, 0, 0.3);
    color: #ff6b35;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.content pre {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.content pre code {
    background: none;
    padding: 0;
    color: #d4af37;
}

.info-box {
    background: rgba(212, 175, 55, 0.1);
    border-left: 4px solid #d4af37;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.warning-box {
    background: rgba(255, 107, 53, 0.1);
    border-left: 4px solid #ff6b35;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.tip-box {
    background: rgba(139, 69, 19, 0.1);
    border-left: 4px solid #8b4513;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: #ff6b35;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
    transform: translateY(-3px);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.feature-title {
    color: #d4af37;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-description {
    color: #b0b0b0;
    font-size: 14px;
}

.foundation-concept {
    margin-bottom: 30px;
    padding-left: 20px;
    border-left: 3px solid rgba(212, 175, 55, 0.3);
    transition: border-color 0.3s ease;
}

.foundation-concept:hover {
    border-left-color: #d4af37;
}

.concept-header {
    color: #d4af37;
    font-size: 20px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.market-params-header ~ p {
    padding-left: 12px;
    border-left: 2px solid #d4af37be;
    margin-bottom: 16px;
}

.market-params-header ~ p:hover {
    border-left-color: #d4af37;
}

.builder-section h4 {
    margin-bottom: 20px;
}

#strategy-builder h4 + ul {
    margin-top: 15px;
}

.content h4 + ul {
    margin-top: 15px;
}

.content h4 {
    margin-top: 30px;
    margin-bottom: 12px;
}

.content h3 + h4 {
    margin-top: 20px;
}

.content h4 + p,
.content h4 + ul,
.content h4 + ol {
    margin-top: 12px;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }
}

.sidebar-toggle {
    display: none;
}

body.is-mobile-device {
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

body.is-mobile-device .header {
    padding: 10px 15px;
}

body.is-mobile-device .logo-text {
    font-size: 20px;
    letter-spacing: 1px;
}

body.is-mobile-device .rune-container {
    width: 30px;
    height: 30px;
}

body.is-mobile-device .rune-symbol {
    font-size: 1.4rem;
}

body.is-mobile-device .container {
    padding: 10px;
    grid-template-columns: 1fr;
    gap: 15px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body.is-mobile-device .sidebar {
    position: static;
    max-height: none;
    padding: 12px;
    margin-bottom: 15px;
    width: 100%;
    overflow: visible;
}

body.is-mobile-device .sidebar-toggle {
    display: block !important;
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    padding: 14px 16px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    width: 100%;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

body.is-mobile-device .sidebar-toggle:active {
    background: rgba(212, 175, 55, 0.3);
    transform: scale(0.98);
}

body.is-mobile-device .sidebar-content {
    display: none;
}

body.is-mobile-device .sidebar-content.active {
    display: block;
}

body.is-mobile-device .content {
    padding: 15px 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.is-mobile-device .content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

body.is-mobile-device .content h1 {
    font-size: 24px;
    line-height: 1.3;
}

body.is-mobile-device .content h2 {
    font-size: 20px;
    margin-top: 25px;
    line-height: 1.3;
}

body.is-mobile-device .content h3 {
    font-size: 18px;
    margin-top: 20px;
    line-height: 1.3;
}

body.is-mobile-device .content h4 {
    font-size: 16px;
    line-height: 1.3;
}

body.is-mobile-device .content p,
body.is-mobile-device .content li {
    font-size: 14px;
    line-height: 1.6;
}

body.is-mobile-device .feature-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

body.is-mobile-device .content pre {
    padding: 12px;
    font-size: 12px;
    max-width: calc(100vw - 44px);
    overflow-x: auto;
}

body.is-mobile-device .info-box,
body.is-mobile-device .warning-box,
body.is-mobile-device .tip-box {
    padding: 12px 15px;
    font-size: 14px;
}

body.is-mobile-device .content table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

body:not(.is-mobile-device) .sidebar-content {
    display: block !important;
}