/* ==== 全局基础 ==== */
body {
    background: #f4f6f9;
}

/* ==== 导航栏 ==== */
.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: bolder !important;
}

.menu-title {
    padding: 10px 10px;
    margin: 10px 0;
    text-decoration: none;
    color: #262626 !important;
    font-weight: bolder !important;
    transition: .5s;
    font-size: 1.3rem !important;
    display: block;
    padding: 0.5rem 1rem;
    position: relative;
    z-index: 1;
}

.menu-title:hover {
    color: #fff !important;
    text-decoration: none;
}

.menu-title:after {
    content: "";
    position: absolute;
    top: 1px;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    transform: scale(0);
    transition: .5s;
    z-index: -1;
}

.menu-title:hover:after {
    transform: scale(1);
}

/* ==== 下拉菜单 ==== */
.nav-item.dropdown .dropdown-menu {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.7s ease;
    font-size: 1.1rem;
    color: #fff;
    list-style: none;
    background-color: #000;
    background-clip: padding-box;
    border-radius: 0;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
}

.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    min-width: 10rem;
    padding: 0;
    margin: 0.125rem 0 0;
    border-radius: 0.25rem;
    opacity: 1;
    max-height: 1000px;
    transition: max-height 0.7s ease, opacity 0.3s ease;
}

.dropdown-item {
    padding: 0.5rem 1.5rem;
    clear: both;
    font-weight: bolder;
    font-size: 1.1rem;
    color: #fff;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
}

/* ==== 首页卡片网格 ==== */
.show-func {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ==== 工具页面通用顶部 ==== */
.TopstoryTop {
    min-height: 4rem;
    background: #fff;
    display: flex;
    align-items: center;
}

.Topstory-name {
    display: flex;
    align-items: center;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
}

.TopstoryMiddle {
    display: flex;
    margin-top: 3px;
}

/* ==== 工具页面表格 ==== */
.func-table {
    margin: 1rem 0 0;
    width: 100%;
}

.func-table tbody tr th {
    text-align: left;
    font-size: 1.1rem;
    font-weight: 400;
    width: 10rem;
    min-width: 6rem;
    vertical-align: middle;
    padding-left: 1.5rem;
}

.table-ver-center {
    vertical-align: middle;
}

/* ==== 工具栏控件 ==== */
.pop-select {
    width: 20rem;
    max-width: 100%;
}

.chr-select {
    width: 4.9rem;
}

.start-input,
.end-input {
    width: 5rem;
}

.form-control-filter {
    width: 6rem;
    margin-left: 1rem;
}

.form-filter,
.form-region {
    margin-top: 0.3rem;
    flex-wrap: wrap;
}

.genename-text,
.generegion-text {
    width: 100%;
    max-width: 25rem;
    margin-top: 0.5rem;
    min-height: 7rem;
}

label {
    margin-bottom: 0;
}

td {
    vertical-align: middle !important;
}

.func-table tbody tr td div input {
    margin-right: 0.3rem;
}

.form-type-label {
    margin-right: 1rem;
}

.chr-select-label,
.start-input-label,
.end-input-label,
.area-select-label {
    margin-left: 1rem;
    margin-right: 0.5rem;
}

/* ==== 提交按钮区域 ==== */
.submit-button-area {
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    margin-top: 3px;
    padding: 1.5rem 1rem;
}

.submit-button {
    width: 10rem;
    max-width: 100%;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ==== 搜索结果区域 ==== */
#search-result {
    background: #fff;
    margin-top: 1rem;
    padding: 1rem 0;
    display: none;
}

#resultGenename,
#resultRegion {
    font-size: 1.3rem;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.result-marker-table {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    margin-top: 1rem;
    max-height: 40rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

#search-result-single,
#search-result-region {
    display: none;
}

/* ==== 搜索/下载结果区域 ==== */
.search-result {
    display: none;
}

/* ==== 响应式布局 - 平板 (≤768px) ==== */
@media (max-width: 768px) {
    .navbar-brand img {
        width: 40px;
        height: 40px;
    }

    .navbar-brand {
        font-size: 1.2rem !important;
    }

    .menu-title {
        font-size: 1.1rem !important;
    }

    .show-func .card {
        width: 100%;
        margin: 0.5rem 0;
    }

    .func-table tbody tr th {
        font-size: 0.95rem;
        padding-left: 1rem;
        width: auto;
        min-width: 5rem;
    }

    .pop-select {
        width: 100%;
    }

    .form-region {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }

    .chr-select-label,
    .start-input-label,
    .end-input-label,
    .area-select-label {
        margin-left: 0;
    }

    .form-chr,
    .form-start,
    .form-end {
        width: 100%;
    }

    .chr-select,
    .start-input,
    .end-input {
        width: 100%;
    }

    .genename-text,
    .generegion-text {
        max-width: 100%;
    }

    .submit-button {
        width: 100%;
    }

    .Topstory-name {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    #resultGenename,
    #resultRegion {
        font-size: 1.1rem;
    }

    .result-marker-table {
        max-height: 30rem;
    }

    .dropdown-item {
        font-size: 0.95rem;
    }
}

/* ==== 响应式布局 - 手机 (≤576px) ==== */
@media (max-width: 576px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }

    .func-table tbody tr {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #dee2e6;
        padding: 0.5rem 0;
    }

    .func-table tbody tr th {
        padding-left: 0.5rem;
        width: 100%;
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .func-table tbody tr td {
        padding-left: 0.5rem !important;
    }

    .TopstoryTop {
        min-height: 3rem;
    }

    .result-marker-table table {
        font-size: 0.8rem;
    }

    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
    }
}
