:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #121214;
    --bg-tertiary: #1a1a1d;
    --bg-hover: #222225;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #f97316;
    --border: #2a2a2d;
    --code-bg: #0f0f10;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout */
.container {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    width: 220px;
    height: 100vh;
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.logo {
    padding: 0 16px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.logo h1 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.version {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
}

/* Navigation */
.nav-section { padding: 4px 12px; }

.nav-section-title {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 6px;
    margin-bottom: 2px;
}

.nav-item {
    display: block;
    padding: 5px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--accent);
}

.nav-item.page-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    margin-bottom: 4px;
}

.nav-item.page-item:hover { border-color: var(--accent); }

.nav-item.page-item.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
    font-weight: 500;
}

.nav-item.tool-item {
    padding-left: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.search-container { padding: 4px 6px 8px; }

.search-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 11px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.search-input::placeholder { color: var(--text-muted); }

/* Main Content */
.main {
    grid-column: 2;
    padding: 24px 40px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

.header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.header-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* Ultrathink Rainbow */
.ultrathink {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff0000, #ff8000, #ffff00, #00ff00, #00ffff, #0080ff, #8000ff, #ff0080, #ff0000);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Sections */
.section {
    margin-bottom: 32px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 3px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 10px;
}

.section-toggle.collapsed { transform: rotate(-90deg); }

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section-content.collapsed { max-height: 0 !important; }

/* Summary */
.summary {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.summary strong {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* Code Blocks */
.code-block {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 8px 0;
    white-space: pre;
}

.code-block::-webkit-scrollbar { height: 6px; }
.code-block::-webkit-scrollbar-track { background: transparent; }
.code-block::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.data-table tbody tr:nth-child(even) td {
    background: var(--bg-tertiary);
}

.data-table tr:hover td { background: var(--bg-hover); }

.data-table tr.total td {
    background: var(--bg-primary);
    border-top: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

/* Callouts */
.callout,
.important {
    background: var(--bg-secondary);
    border-left: 2px solid var(--accent);
    padding: 10px 14px;
    margin: 12px 0;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    line-height: 1.5;
}

.callout-label,
.important-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 4px;
}

/* Inline Code */
code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--accent);
}

/* Lists */
.content-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0;
}

.content-list li {
    position: relative;
    padding-left: 14px;
    margin: 6px 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.content-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
}

/* Definition List */
.def-list {
    margin: 8px 0;
}

.def-list dt {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 12px;
    margin-top: 12px;
}

.def-list dt:first-child { margin-top: 0; }

.def-list dd {
    color: var(--text-secondary);
    font-size: 12px;
    margin-left: 14px;
    padding-left: 0;
}

/* Typography */
h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 8px;
}

h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 16px 0 6px;
}

p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 8px 0;
    line-height: 1.6;
}

strong { color: var(--text-primary); font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Tool Cards */
.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 6px 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tool-card:hover { border-color: var(--accent); }

.tool-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.tool-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.tool-toggle {
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.tool-toggle.open { transform: rotate(180deg); }

.tool-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tool-body.open {
    padding: 12px;
    max-height: 2000px;
}

.tool-description {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.tool-params {
    background: var(--code-bg);
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
}

/* JSON Syntax */
.json-key { color: var(--accent); }
.json-string { color: #22c55e; }
.json-number { color: #3b82f6; }
.json-boolean { color: #a855f7; }
.json-null { color: var(--text-muted); }

/* Utilities */
.hidden { display: none; }

/* Responsive */
@media (max-width: 1024px) {
    .container { display: block; }
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 24px; }
}
