/* 自定义样式 */
.hero-section {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    min-height: 500px;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #004085;
}

pre {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
}

.code-block {
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.endpoint-card {
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
}

.endpoint-card.put {
    border-left-color: #fd7e14;
}

.endpoint-card.post {
    border-left-color: #28a745;
}

.endpoint-card.delete {
    border-left-color: #dc3545;
}

.method-badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
}

.method-get {
    background-color: #007bff;
}

.method-post {
    background-color: #28a745;
}

.method-put {
    background-color: #fd7e14;
}

.method-delete {
    background-color: #dc3545;
}

/* 固定侧边栏 */
.sidebar {
    position: fixed;
    top: 56px; /* 导航栏高度 */
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    overflow-y: auto;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 56px);
    padding-top: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
}

.sidebar .nav-link.active {
    color: #007bff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    /* 移动端隐藏侧边栏 */
    .sidebar {
        position: static;
        height: auto;
        box-shadow: none;
        background-color: transparent;
        padding: 0;
        margin-top: 1rem;
    }
    
    .sidebar-sticky {
        height: auto;
        padding-top: 0;
    }
    
    .sidebar .nav-link {
        padding: 0.5rem 0;
        border-bottom: 1px solid #eee;
    }
    
    /* 移动端导航栏调整 */
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin: 0.5rem 0;
    }
}

/* 主题切换相关样式 */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: white;
    bottom: 2px;
    content: "";
    height: 20px;
    left: 2px;
    position: absolute;
    transition: .4s;
    width: 20px;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #007bff;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 深色主题样式 */
body.dark-theme {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-theme .navbar {
    background-color: #1f1f1f !important;
}

body.dark-theme .card {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.25);
}

body.dark-theme .sidebar {
    background-color: #1e1e1e;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.1);
}

body.dark-theme .sidebar .nav-link {
    color: #e0e0e0;
}

body.dark-theme .sidebar .nav-link.active {
    color: #4dabf7;
}

body.dark-theme .accordion-button {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-theme .accordion-button:not(.collapsed) {
    background-color: #3a3a3a;
    color: #4dabf7;
}

body.dark-theme .accordion-body {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-theme .table {
    color: #e0e0e0;
}

body.dark-theme .table-bordered {
    border-color: #444;
}

body.dark-theme .table-bordered th,
body.dark-theme .table-bordered td {
    border-color: #444;
}

body.dark-theme pre {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-theme .hero-section {
    background: linear-gradient(135deg, #4b0082 0%, #191970 100%);
}

body.dark-theme .card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

body.dark-theme .endpoint-card {
    border-left-color: #4dabf7;
}

body.dark-theme footer {
    background-color: #1f1f1f !important;
}

/* 折叠面板默认关闭 */
.accordion-collapse:not(.show) {
    display: none;
}

/* 平滑过渡效果 */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}