@charset "utf-8";

:root {
    --max-width: 2048px;
    --min-width: 200px; /* 当列的宽度小于此值时，部分行内容会被从横向改变纵向排列。 */
    --padding: 1rem;
    --article-padding: calc(var(--padding) / 2);

    --color: black;
    --accent-color: #0074d9;
    --background: white;
    --border-color: #e0e0e0;
    --delete-color: red;

    /* method */
    --method-get-color: green;
    --method-options-color: green;
    --method-post-color: darkorange;
    --method-put-color: darkorange;
    --method-patch-color: darkorange;
    --method-delete-color: red;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color: #b0b0b0;
        --accent-color: #0074d9;
        --background: black;
        --border-color: #303030;
        --delete-color: red;

        /* method */
        --method-get-color: green;
        --method-options-color: green;
        --method-post-color: darkorange;
        --method-put-color: darkorange;
        --method-patch-color: darkorange;
        --method-delete-color: red;
    }
}

body {
    padding: 0;
    margin: 0;
    color: var(--color);
    background: var(--background);
    text-align: center;
}

table {
    width: 100%;
}

table th, table td {
    font-weight: normal;
    text-align: left;
    border-bottom: 1px solid transparent;
}

table tr:hover th,
table tr:hover td {
    border-bottom: 1px solid var(--border-color);
}

ul, ol, ul li, ol li {
    padding: 0;
    margin: 0;
    list-style-position: inside;
}

p {
    margin: 0;
}

summary, input {
    outline: none;
}

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

a:hover {
    opacity: .7;
}

.del {
    text-decoration: line-through;
    text-decoration-color: var(--delete-color);
}

.hidden {
    display: none;
}

/*************************** header ***********************/

header {
    position: sticky;
    top: 0;
    display: block;
    z-index: 1000;
    box-sizing: border-box;
    background: var(--background);
    box-shadow: 2px 2px 2px var(--border-color);
}

header .wrap {
    margin: 0 auto;
    text-align: left;
    max-width: var(--max-width);
    padding: 0 var(--padding);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: var(--padding) 0 var(--article-padding);
    display: inline-block;
}

header h1 .version {
    font-size: 1rem;
}

header h1 img {
    height: 1.5rem;
    margin-right: .5rem;
}


header .menus {
    display: flex;
}

header .menu {
    cursor: pointer;
    position: relative;
    margin-left: var(--padding);
    display: none; /* 默认不可见，只有在有 JS 的情况下，通过 JS 控制其可见性 */
}

header .menu:hover span {
    opacity: .7;
}

header .menu ul {
    position: absolute;
    min-width: 4rem;
    right: 0;
    display: none;
    list-style: none;
    background: var(--background);
    border: 1px solid var(--border-color);
    padding: var(--article-padding);
}

header .menu ul li {
    padding-bottom: var(--article-padding);
}

/* 可以保证 label 的内容在同一行 */
header .menu ul li label {
    display: inline-flex;
    align-items: baseline;
    word-break: keep-all;
    white-space: nowrap;
}

header .menu ul li:last-of-type {
    padding-bottom: 0;
}

header .menu:hover ul {
    display: block;
}

/*************************** main ***********************/

main {
    padding: 0 var(--padding);
    margin: 0 auto;
    max-width: var(--max-width);
    text-align: left;
}

main .content {
    margin: var(--padding) 0;
}

/****************** .servers *******************/

main .servers {
    display: flex;
    flex-flow: wrap;
    justify-content: space-between;
    margin-bottom: var(--padding);
}

main .servers .server {
    flex-grow: 1;
    min-width: var(--min-width);
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    padding: var(--padding) var(--article-padding);
}

main .servers .server:hover {
    border: 1px solid var(--accent-color);
}

main .servers .server h4 {
    margin: 0 0 var(--padding);
}

/********************** .api **********************/

main .api {
    margin-bottom: var(--article-padding);
    border: 1px solid var(--border-color);
}

main .api summary {
    margin: 0;
    padding: var(--article-padding);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    line-height: 1;
}


main details.api:not([open]) summary {
    border: none;
}

main .api summary .action {
    min-width: 4rem;
    font-weight: bold;
    display: inline-block;
    margin-right: 1rem;
}

main .api summary .link {
    margin-right: 10px;
    text-decoration: none;
}

main .api .callback .summary,
main .api summary .summary {
    float: right;
    font-weight: 400;
    opacity: .5;
}

main .api .description {
    padding: var(--article-padding);
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

main .api[data-method='GET,'][open],
main .api[data-method='GET,']:hover,
main .callback[data-method='GET,'] h3 {
    border: 1px solid var(--method-get-color);
}
main .api[data-method='GET,'] summary {
    border-bottom: 1px solid var(--method-get-color);
}

main .api[data-method='POST,'][open],
main .api[data-method='POST,']:hover,
main .callback[data-method='POST,'] h3 {
    border: 1px solid var(--method-post-color);
}
main .api[data-method='POST,'] summary {
    border-bottom: 1px solid var(--method-post-color);
}

main .api[data-method='PUT,'][open],
main .api[data-method='PUT,']:hover,
main .callback[data-method='PUT,'] h3 {
    border: 1px solid var(--method-put-color);
}
main .api[data-method='PUT,'] summary {
    border-bottom: 1px solid var(--method-put-color);
}

main .api[data-method='PATCH,'][open],
main .api[data-method='PATCH,']:hover,
main .callback[data-method='PATCH,'] h3 {
    border: 1px solid var(--method-patch-color);
}
main .api[data-method='PATCH,'] summary {
    border-bottom: 1px solid var(--method-patch-color);
}

main .api[data-method='DELETE,'][open],
main .api[data-method='DELETE,']:hover,
main .callback[data-method='DELETE,'] h3 {
    border: 1px solid var(--method-delete-color);
}
main .api[data-method='DELETE,'] summary {
    border-bottom: 1px solid var(--method-delete-color);
}

main .api[data-method='OPTIONS,'][open],
main .api[data-method='OPTIONS,']:hover,
main .callback[data-method='OPTIONS,'] h3 {
    border: 1px solid var(--method-options-color);
}
main .api[data-method='OPTIONS,'] summary {
    border-bottom: 1px solid var(--method-options-color);
}

main .callback h3 {
    padding: var(--article-padding) var(--padding);
    margin: 0;
    border-left: none !important;
    border-right: none !important;
    cursor: pointer;
    line-height: 1;
}

main .api .body {
    display: flex;
    flex-flow: wrap;
}

main .api .body .requests,
main .api .body .responses {
    flex: 1 1 50%;
    box-sizing: border-box;
    min-width: var(--min-width);
    padding: var(--article-padding);
}
main .api .body .requests {
    border-right: 1px dotted var(--border-color);
}

main .api .body .requests .title,
main .api .body .responses .title {
    margin: 0;
    opacity: .5;
}

main .api .param {
    margin-top: var(--padding);
}

main .api .param .title,
main .api .param .title {
    margin: 0;
    opacity: 1 !important;
    font-weight: normal;
}

main .api .param .example {
    display: none;
    margin: 0;
}

main .api .param .toggle-example {
    cursor: pointer;
}

main .api .body .responses .status,
main .api .body .requests .status {
    margin: calc(var(--padding) + var(--article-padding)) 0 var(--article-padding);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px;
}

main .api .param .parent-type,
main .api .status .mimetype {
    opacity: .5;
}

/*************************** footer ***********************/

footer {
    border-top: 1px solid var(--border-color);
    padding: var(--padding) var(--padding);
    text-align: left;
    margin-top: var(--padding);
}

footer .wrap {
    margin: 0 auto;
    max-width: var(--max-width);
    display: flex;
    flex-flow: wrap;
    justify-content: space-between;
}
