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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #1a1a1a;
}

:root {
    --header-height: 64px;
}

.header {
    background: linear-gradient(to right, #4f46e5, #7c3aed, #ec4899);
    color: white;
    border-bottom: 1px solid rgba(124, 58, 237, 0.5);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 2rem;
    height: 2rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: bold;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s;
    padding-bottom: 0.25rem;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-link.active {
    color: white;
    font-weight: 600;
    border-bottom: 2px solid white;
}

.header-right {
    display: flex;
    gap: 0.75rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: white;
    color: #7c3aed;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
}

.main-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    margin-top: 1rem;
}

.sidebar {
    width: 20rem;
    border-right: 1px solid #e5e5e5;
    background: white;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.brand-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #ec4899, #7c3aed);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

.brand-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.icon-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.icon {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
}

.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
    color: #9ca3af;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.375rem;
    background: #f9fafb;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: #7c3aed;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.category-item {
    margin-bottom: 0.25rem;
}

.category-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: #1a1a1a;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.category-button:hover {
    background: #f5f5f5;
}

.category-children {
    margin-left: 1.5rem;
    margin-top: 0.25rem;
}

.endpoint-button {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: #1a1a1a;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.endpoint-button:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.endpoint-button.active {
    background: #faf5ff;
    color: #7c3aed;
}

.endpoint-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.endpoint-desc {
    display: block;
    color: #737373;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge-post {
    background: #ef4444;
    color: white;
}

.badge-secondary {
    background: #f5f5f5;
    color: #525252;
}

.badge-required {
    background: white;
    color: #ea580c;
    border: 1px solid #ea580c;
}

.badge-optional {
    background: white;
    color: #737373;
    border: 1px solid #d4d4d4;
}

.content {
    flex: 1;
    overflow-y: auto;
}

.content-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: #737373;
    margin-bottom: 0.5rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.endpoint-header {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.endpoint-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.endpoint-path {
    font-family: monospace;
    font-size: 0.875rem;
    color: #7c3aed;
}

.badge-method {
    background: #ec4899;
    color: white;
    padding: 0.25rem 0.75rem;
}

.btn-debug {
    background: #7c3aed;
    color: white;
    padding: 0.5rem 1rem;
}

.btn-debug:hover {
    background: #6d28d9;
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.description {
    font-size: 0.875rem;
    color: #737373;
    line-height: 1.6;
}

.description p {
    margin-bottom: 0.5rem;
}

.collapsible-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    user-select: none;
}

.collapsible-header:hover {
    opacity: 0.7;
}

.parameter-table {
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    overflow: hidden;
}

.parameter-table-header {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    font-size: 0.875rem;
    font-weight: 500;
}

.parameter-row {
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    transition: background 0.2s;
}

.parameter-row:hover {
    background: #fafafa;
}

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

.parameter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.parameter-name-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expand-icon {
    cursor: pointer;
    padding: 0.125rem;
}

.parameter-name {
    font-family: monospace;
    font-size: 0.875rem;
    color: #2563eb;
}

.parameter-description {
    font-size: 0.875rem;
    color: #737373;
}

.parameter-example {
    margin-top: 0.25rem;
}

.example-value {
    font-family: monospace;
    font-size: 0.75rem;
    background: #f5f5f5;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    word-break: break-all;
}

.tabs {
    margin-bottom: 2rem;
}

.tabs-list {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    background: #f9fafb;
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.tab-trigger {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tab-trigger:hover {
    background: #f5f5f5;
}

.tab-trigger.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.code-block {
    background: #f9fafb;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    padding: 1rem;
}

.code-block pre {
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.json-viewer {
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.json-key {
    color: #1a1a1a;
}

.json-string {
    color: #16a34a;
}

.json-number {
    color: #2563eb;
}

.json-boolean {
    color: #7c3aed;
}

.json-null {
    color: #737373;
}

.json-bracket {
    cursor: pointer;
    padding: 0 0.125rem;
    border-radius: 0.125rem;
}

.json-bracket:hover {
    background: rgba(0, 0, 0, 0.05);
}

.hidden {
    display: none;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translate(-50%, -60%);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 10000;
    max-width: 420px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.toast.show { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.toast.success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.toast.error { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.toast.info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

/* Quota purchase card */
.quota-cards { background: transparent; border: none; border-radius: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; }
.quota-card { width: 160px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.quota-card-box { background: #fff7ed; border: 2px solid #f5d0a9; border-radius: 10px; padding: 12px; text-align: center; box-shadow: 0 3px 10px rgba(245, 158, 11, 0.12); width: 100%; }
.quota-price { font-size: 20px; font-weight: 800; color: #f59e0b; line-height: 1.2; }
.quota-quota { margin-top: 6px; font-size: 14px; font-weight: 700; color: #6b7280; }
.quota-card.selected .quota-card-box { border-color: #7c3aed; box-shadow: 0 6px 18px rgba(124,58,237,0.25); }
.quota-buy-main { margin-top: 8px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; border: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; box-shadow: 0 6px 16px rgba(124,58,237,0.2); }
.quota-buy-main:hover { filter: brightness(1.05); }
.quota-area{ background:transparent; border:none; border-radius:0; padding:0; }
.quota-actions{ display:flex; align-items:center; gap:12px; padding-top:8px; }
.order-confirm{ padding:12px; }
.order-summary{ display:grid; grid-template-columns: 100px 1fr; row-gap:8px; column-gap:12px; }
.order-summary label{ color:#6b7280; }
.order-summary .val{ font-weight:600; color:#1f2937; }
.order-actions{ display:flex; gap:12px; margin-top:12px; }
.error-banner{ background:#fee2e2; color:#7f1d1d; border:1px solid #fecaca; border-radius:8px; padding:10px 12px; margin-top:10px; }
.api-card .btn-outline.btn-sm{ color:#4f46e5; border:1px solid #4f46e5; background:#eef2ff; }
.api-card .btn-outline.btn-sm:hover{ background:#e0e7ff; }
.api-card-header .btn-outline.btn-sm{ color:#4f46e5; border:1px solid #4f46e5; background:#eef2ff; }
.api-card-header .btn-outline.btn-sm:hover{ background:#e0e7ff; }
.member-header .btn-outline{ color:#4f46e5; border:1px solid #4f46e5; background:#eef2ff; }
.member-header .btn-outline:hover{ background:#e0e7ff; }
.member-header .btn-outline.btn-sm{ color:#4f46e5; border:1px solid #4f46e5; background:#eef2ff; }
.top-grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap:16px; }

.params-table{width:100%;border-collapse:collapse;border:1px solid #e5e5e5;border-radius:8px;overflow:hidden}
.params-table thead th{background:#f5f5f5;color:#374151;text-align:left;padding:10px;border-right:1px solid #e5e5e5}
.params-table tbody td{padding:10px;border-top:1px solid #eee;border-right:1px solid #f0f0f0;color:#374151}
.params-table .req-true{color:#ef4444;font-weight:600}
.params-table .req-false{color:#6b7280}
.param-name-cell{display:flex;align-items:center;gap:6px}
.param-name-indent{display:inline-block}
.param-toggle{width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.param-toggle .icon{width:14px;height:14px}
.param-toggle-box{width:16px;height:16px;border:1px solid #d4d4d4;border-radius:2px;display:inline-flex;align-items:center;justify-content:center;font-size:12px;color:#6b7280;background:#fff;}
.param-toggle-box.clickable{cursor:pointer}
.param-leaf-dash{width:16px;display:inline-block;text-align:center;color:#6b7280;font-size:12px;}
.params-table tr.group-row td{background:#f9fafb}
.param-name-cell.level-1{border-left:2px solid #eee}
.param-name-cell.level-2{border-left:2px solid #eee}
.param-name-cell.level-3{border-left:2px solid #eee}
