/* =========================================================
   Base
   ========================================================= */

body {
    background-color: #ffffff;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

hr {
    border: 0;
    border-top: 2px solid #333;
    margin: 20px 0;
}


/* =========================================================
   Fixed header
   ========================================================= */

.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 2px solid #333;
    z-index: 1000;
    padding: 10px 20px;
    box-sizing: border-box;
}

.smb img {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 8px auto;
}

.top-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.top-nav a {
    color: #4169E1;
    font-weight: bold;
    font-size: 16px;
    text-decoration: none;
}

.top-nav a:hover {
    color: #27408B;
    text-decoration: underline;
}

.page-content {
    padding: 150px 20px 20px;
}


/* =========================================================
   Common content box
   ========================================================= */

.content {
    text-align: center;
    font-size: 20px;
    margin: 20px auto;
    max-width: 1100px;
    border: 2px solid black;
    padding: 20px;
    border-radius: 8px;
    background-color: #fff;
    box-sizing: border-box;
}

.content-center {
    display: inline-block;
    text-align: left;
}

.content a {
    color: #4169E1;
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}


/* =========================================================
   Home page
   ========================================================= */

.formbottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.formbottom p {
    margin: 10px;
    padding: 0;
}

.btns,
.btns_Tools {
    padding: 10px 20px;
    background-color: #4169E1;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 24px;
    transition: background-color 0.3s ease;
    margin: 10px;
}

.btns:hover,
.btns_Tools:hover {
    background-color: #27408B;
}

.boxed-section {
    border: 1.5px solid #000;
    border-radius: 6px;
    max-width: 780px;
    margin: 35px auto;
    padding: 15px 25px;
    background-color: #fff;
    text-align: left;
    line-height: 1.5;
    box-sizing: border-box;
}

.top_image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px auto;
    max-width: 700px;
}

.top_image img {
    width: 90%;
    height: auto;
    display: block;
}

.boxed-section a {
    color: #4169E1;
    text-decoration: none;
}

.boxed-section a:hover {
    text-decoration: underline;
}

.reference {
    margin-top: 20px;
}


/* =========================================================
   About page
   ========================================================= */

.about-content h2 {
    margin-top: 28px;
    margin-bottom: 12px;
}

.about-content h2:first-child {
    margin-top: 0;
}

.about-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.about-content p {
    line-height: 1.6;
}

.about-content ul {
    padding-left: 24px;
}

.about-content li {
    margin-bottom: 6px;
}

.researcher {
    margin-bottom: 20px;
    font-family: sans-serif;
}

.researcher p {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

.affiliation {
    margin: 4px 0 8px;
    font-size: 16px;
    font-weight: normal;
    line-height: 1.5;
}

.researcher-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.link-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #ffffff;
    color: #4169E1;
    border: 1px solid #4169E1;
    text-decoration: none;
    border-radius: 20px;
    margin-top: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.link-button:hover {
    background-color: #4169E1;
    color: #ffffff;
}

.contact_image img {
    width: 30%;
    height: auto;
    display: block;
    margin: 10px auto;
}


/* =========================================================
   Structure annotation form
   ========================================================= */

.input-note {
    font-size: 14px;
    color: #555;
}

.example-wrapper {
    margin-bottom: 15px;
}

.btn-example {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 5px;
    border: 2px solid #1e90ff;
    background: #fff;
    color: #1e90ff;
}

.btn-example:hover {
    background: #1e90ff;
    color: #fff;
}

.form-card {
    border: 1px solid #dadada;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin: 30px auto;
    max-width: 800px;
    box-sizing: border-box;
}

.form-card h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
    border-left: 6px solid #F15A24;
    padding-left: 10px;
    text-align: left;
}

.batch-form-card {
    margin-top: 40px;
}

.batch-form-card h2 {
    border-left: 6px solid #4169E1;
}

label {
    font-weight: 600;
    display: block;
    margin: 10px 0 6px;
    font-size: 14px;
    text-align: left;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    border: 2px solid #dadada;
    border-radius: 6px;
    background: #fafafa;
    transition: border-color 0.3s;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: #F15A24;
    background: #fff;
    outline: none;
}

.candidate-structure-img {
    width: 180px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    background: #ffffff;
}

.inchikey-cell {
    font-size: 12px;
    word-break: break-all;
    font-family: Consolas, monospace;
}

select {
    cursor: pointer;
    appearance: auto;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.batch-form-card textarea {
    min-height: 140px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
}

.btn-primary {
    border: 2px solid #F15A24;
    background: #fff;
    color: #F15A24;
}

.btn-primary:hover {
    background: #F15A24;
    color: #fff;
}


/* =========================================================
   Analysis result page
   ========================================================= */

.result-content {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.result-summary {
    text-align: center;
    margin-bottom: 20px;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.info-list li {
    background-color: #3C3B6E;
    color: white;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease;
    cursor: default;
}

.info-list li:hover {
    background-color: #27408B;
}

.download-wrapper {
    display: flex;
    justify-content: flex-start;
    margin: 18px 0 24px;
}

.download-btn {
    display: inline-block;
    min-width: 140px;
    padding: 10px 18px;
    background-color: #4169E1;
    color: #ffffff !important;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: #27408B;
    color: #ffffff !important;
    text-decoration: none;
}


/* =========================================================
   Analysis result table
   Public DB ID / Total Score / Annotation Score
   / NL Score / Frag. Match Rate / E. Mass
   ========================================================= */

.table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.result-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
}

.result-table th,
.result-table td {
    padding: 12px 10px;
    text-align: left;
    border: none;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    vertical-align: middle;
}

.result-table thead th {
    background-color: #3C3B6E;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: normal;
    font-size: 15px;
    line-height: 1.2;
}

.result-table tbody tr:nth-child(even) {
    background-color: #E6E6FA;
}

.result-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.result-table tbody tr:hover {
    background-color: #B0C4DE;
}

.compact-result-table th:nth-child(1),
.compact-result-table td:nth-child(1) {
    width: 22%;
}

.compact-result-table th:nth-child(2),
.compact-result-table td:nth-child(2) {
    width: 14%;
}

.compact-result-table th:nth-child(3),
.compact-result-table td:nth-child(3) {
    width: 17%;
}

.compact-result-table th:nth-child(4),
.compact-result-table td:nth-child(4) {
    width: 12%;
}

.compact-result-table th:nth-child(5),
.compact-result-table td:nth-child(5) {
    width: 21%;
}

.compact-result-table th:nth-child(6),
.compact-result-table td:nth-child(6) {
    width: 14%;
}

.btns_search {
    display: inline-block;
    padding: 6px 12px;
    background-color: #4169E1;
    color: #ffffff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    transition: background-color 0.3s ease;
}

.btns_search:hover {
    background-color: #27408B;
    color: #ffffff !important;
    text-decoration: none;
}


/* =========================================================
   Detail / raw result
   ========================================================= */

.result-pre {
    white-space: pre-wrap;
    text-align: left;
    background: #ffffff;
    border: 1px solid #dadada;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    font-size: 13px;
}


/* =========================================================
   Footer
   ========================================================= */

.site-footer {
    margin-top: 50px;
    padding: 24px 20px;
    border-top: 2px solid #333;
    background-color: #ffffff;
    text-align: center;
}

.footer-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.footer-logo {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

.jst-logo {
    max-height: 42px;
}

.nbdc-logo {
    max-height: 42px;
}

.footer-text {
    font-size: 13px;
    line-height: 1.6;
    color: #555;
}

.footer-text p {
    margin: 4px 0;
}

.footer-note {
    font-size: 12px;
    color: #777;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
    .content {
        padding: 16px;
        font-size: 17px;
    }

    .page-content {
        padding: 150px 12px 20px;
    }

    .result-table thead th {
        font-size: 13px;
    }

    .result-table th,
    .result-table td {
        padding: 10px 6px;
        font-size: 14px;
    }

    .btns_search {
        font-size: 12px;
        padding: 5px 8px;
    }
}


.fragment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.fragment-card {
    border: 1px solid #dadada;
    border-radius: 8px;
    padding: 12px;
    background-color: #ffffff;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.fragment-card p {
    margin: 6px 0;
    font-size: 14px;
}

.fragment-img {
    width: 100%;
    max-width: 260px;
    height: auto;
    display: block;
    margin: 10px auto;
    background-color: #ffffff;
}

.fragment-smiles {
    word-break: break-all;
    font-size: 12px !important;
    color: #555;
}

.fragment-error {
    color: #cc0000;
    font-size: 13px;
    text-align: center;
    margin: 8px 0;
}

/* =========================================================
   Candidate detail dark layout
   ========================================================= */

.detail-dark-page {
    background: #000000;
    color: #ffffff;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto 30px;
    padding: 20px;
    box-sizing: border-box;
}

.detail-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    align-items: stretch;
}

.mirror-panel {
    position: relative;
    min-height: 560px;
}

.detail-score-badge {
    position: absolute;
    top: 20px;
    left: 58%;
    transform: translateX(-50%);
    background: red;
    color: #ffffff;
    font-weight: bold;
    padding: 10px 20px;
    z-index: 2;
    min-width: 120px;
    text-align: center;
}

.mirror-chart {
    width: 100%;
    height: 520px;
    display: block;
}

.fragment-side-panel h2 {
    margin: 0 0 8px;
    color: #444444;
    font-size: 28px;
    font-weight: bold;
}

.fragment-scroll-list {
    border: 3px solid #aaaaaa;
    border-radius: 14px;
    height: 590px;
    overflow-y: auto;
    padding: 12px;
    box-sizing: border-box;
    background: #000000;
}

.fragment-click-card {
    width: 100%;
    border: none;
    background: transparent;
    color: #ffffff;
    padding: 8px 4px;
    margin-bottom: 18px;
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
}

.fragment-click-card:hover,
.active-fragment-card {
    background: rgba(65, 105, 225, 0.35);
    outline: 2px solid #4169E1;
}

.detail-fragment-img {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto;
    background: #000000;
}

.fragment-image-error {
    display: block;
    color: #ff8888;
    font-size: 12px;
    word-break: break-word;
}

.fragment-card-meta {
    display: block;
    color: #cccccc;
    font-size: 11px;
    margin-top: 6px;
}

.detail-bottom-buttons {
    border: 3px solid #aaaaaa;
    border-radius: 10px;
    margin: 14px auto 0;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.detail-blue-btn {
    display: inline-block;
    background: #4169E1;
    color: #ffffff !important;
    font-size: 28px;
    font-weight: bold;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 7px;
    line-height: 1.1;
}

.detail-blue-btn:hover {
    background: #27408B;
    color: #ffffff !important;
    text-decoration: none;
}

.detail-wide-btn {
    min-width: 440px;
    text-align: center;
}

@media (max-width: 900px) {
    .detail-main-grid {
        grid-template-columns: 1fr;
    }

    .fragment-scroll-list {
        height: 360px;
    }

    .detail-blue-btn {
        font-size: 20px;
    }

    .detail-wide-btn {
        min-width: auto;
        width: 100%;
    }
}