:root {
    --main-theme-color: #3E9CC0; /** #6b8e6b **/;
    --chapter-color: #337AB7; /** #5a7c5a **/;
    --chapter-border-color: #81BFD6; /** #a3bca3 **/
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    color: #555;
    background-color: #f5f7f5;
    margin: 0;
    padding: 10px;
    font-size: 14px;
    overflow: hidden;
}
table {
    width: 100%;
    border: solid 1px var(--main-theme-color);
    border-collapse: collapse;
}
th {
    background-color: #E0EFF6;
}
td, th {
    font-size: 0.9em;
    border:  solid 1px var(--chapter-border-color);
    padding: 3px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.1);
    overflow-y: scroll;
    height: 98vh;
}
header {
    background-color: var(--main-theme-color);
    color: white;
    line-height: 3.5em;
    padding: 5px 5px;
    text-align: center;
}
header a {
    text-decoration: none;
    cursor: pointer;
    color: white;
}
h1 {
    margin: 0;
    font-size: 1.4em;
}
a {
    color: var(--main-theme-color);
}
sub, sup {
    font-size: 0.7em;
}
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
::-webkit-scrollbar-track {
  background: #f0f0f0;
}

::-webkit-scrollbar-button {
  display: none;
}
::-webkit-scrollbar-corner {
  background: #f0f0f0;
}
.desc-title {
    font-weight: bold;
}
.desc-item::before {
    content: '【';
}
.desc-item::after {
    content: '】';
}
.desc-source {
    color: #777;
}
.desc-source::before {
    content: '— ';
}
.journal {
    font-style: italic;
}
.remark {
    margin: 0.3em 0;
    color: #ed7d31;
}
.remark-quote {
    text-decoration: underline;
    text-decoration-color: #ed7d31;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.content-wrapper {
    min-height: calc(100vh - 120px);
}
.term {
    font-style: italic;
}
.term::before {
    content: ' 「 '
}
.term::after {
    content: ' 」 '
}

.main-content {
    min-width: 200px;
    flex: 1;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}
.sidebar {
    width: 320px;
    background-color: #f9f9f9;
    padding: 20px;
    overflow-y: auto;
}
.section {
    margin-bottom: 18px;
    border-bottom: dotted 1px rgb(0, 0, 0, .2);
}
.section-content {
    padding: 0 1em 0 1em;
}
.measurements {
    margin-left: 1em;
    width: fit-content;
}
.measurements th, .measurements td{
    text-align: center;
    vertical-align: middle;
    min-width: 50px;
    padding: 1px 3px 1px 3px;
}
h2 {
    background: linear-gradient(90deg, rgba(129, 191, 219, .3), transparent);
    color: var(--chapter-color);
    border-left: 3px solid var(--chapter-border-color);
    padding-left: 10px;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    padding-bottom: 3px;
}

.para {
    text-indent: 2em;
    padding: 0px 20px;
}

.scientific-name {
    font-weight: bold;
}
.scientific-name span {
    display: block;
}
.scientific-name > :nth-child(1) {
    font-style: italic;
}
.scientific-name > :nth-child(2) {
    font-size: 0.8em;
}
.scientific-name > :nth-child(1)::after {
    content: '\00a0\00a0';
}

.name-info {
    grid-template-columns: 5fr 2fr;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.field {
    display: flex;
    margin-bottom: 8px;
}
.label {
    font-weight: 600;
    color: #555;
    /*display: inline-block;*/
    min-width: 80px;
}
.value {
    /*display: inline-block;*/
}
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
}
.tab {
    font-weight: normal;
    cursor: pointer;
    padding: 10px 10px;
    margin-right: -1px;
    background-color: #fff;
}
.tab.active {
    font-weight: bold;
    background-color: #f3f3f3;
    border-bottom: 2px solid var(--main-theme-color);
}
.tab-content {
    display: none;
    padding: 20px;
}
.tab-content.active {
    display: block;
}
.image-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.image-black {
    background-color: black;
}
.image-white {
    background-color: white;
}
.image-item {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.image-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.image-item img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    display: block;
}
.caption {
    padding: 8px;
    background-color: #f0f0f0;
    font-size: 0.9em;
    color: #555;
}

.no-scroll {
    overflow: hidden;
}
.modal {
    display: none;
    scroll-behavior: co;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    background-color: rgba(0,0,0,0.6);
    overflow: auto;
}
.modal-content {
    margin: 5% auto;
    max-width: 90%;
    max-height: 90%;
    container-type: inline-size;
}
.modal-img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border: none;
    border-radius: 6px;
    user-select: none;
}
.modal-caption {
    text-align: left;
    color: #CCC;
    padding: 15px;
    font-size: 1.1em;
}
.close {
    position: absolute;
    top: 20px;
    right: 34px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}
@container (min-width: 600px) {
    .modal-caption {
        text-align: center;
    }
}

ul {
    margin: 5px 0 5px 20px;
    padding: 0;
}
footer {
    background-color: var(--main-theme-color);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.9em;
}
.classification {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 5px 10px;
}

.taxon-label {
    font-weight: 600;
    color: #555;
    text-align: right;
}
.taxon-value {
    font-weight: 500;
}

.favicon {
    stroke: #555;
    stroke-width: 6;
}
.favicon path:nth-child(1) {
    d: path("m42.50522,98.67449c0,0 160,-28 340,35");
}
.favicon path:nth-child(2) {
    d: path("m158.50522,125.67449c0,0 60,-11 152,32");
}
.favicon path:nth-child(3) {
    d: path("m187.50522,154.67449c48,18 102,27 201,127");
}
.favicon path:nth-child(4) {
    d: path("m222.50522,188.67449c-7,10 -18,37 -13,68");
}
.favicon path:nth-child(5) {
    d: path("m209.50522,255.67449c-67,33 -111,73 -110,73");
}
.favicon path:nth-child(6) {
    d: path("m209.50522,254.67449c1,0 56,7 113,83");
}

/** mobile **/
@media (min-width: 900px) {
    .classification {
        grid-template-columns: 80px 1fr 50px 1fr 50px 1fr;
    }
}
@media (min-width: 768px) {
    .name-info {
        display: grid;
    }
    .scientific-name span {
        display: inline;
    }
    .content-wrapper {
        display: flex;
    }
    .tab {
        padding: 10px 20px;
    }
}

/** floating box **/
.floating-box {
    position: fixed;
    bottom: 55px;
    right: 3vw;
    
    transition: background-color 0.3s, transform 0.2s;
    z-index: 1000;
}
.floating-box button {
    width: 36px;
    height: 36px;
    margin: 5px;
    opacity: 0.7;
    background-color: var(--main-theme-color);
    color: white;
    border: none;
    border-radius: 10%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.floating-box button:hover {
    opacity: 1;
    transform: scale(1.1);
}
.floating-box.hidden {
    opacity: 0;
    pointer-events: none;
}