/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* MedlinePlus palette */
    --white:         #ffffff;
    --off-white:     #f6f8fa;
    --pale-gray:     #eef1f4;
    --navy:          #1a4480;   /* deep NIH/MedlinePlus header blue */
    --navy-dk:       #122f5c;
    --navy-lt:       #2659a8;
    --navy-pale:     rgba(26,68,128,.09);
    --navy-ring:     rgba(26,68,128,.26);
    --teal:          #2e8540;   /* MedlinePlus green — icon/CTA green */
    --teal-lt:       #3aaa52;
    --teal-dk:       #246634;
    --teal-pale:     rgba(46,133,64,.10);
    --teal-ring:     rgba(46,133,64,.28);
    --ink:           #212121;
    --ink-mid:       #454545;
    --ink-soft:      #767676;
    --ink-faint:     #aaaaaa;
    --border:        #d6dce4;
    --border2:       #c4ccd8;
    --sh1: 0 1px 4px rgba(26,68,128,.08);
    --sh2: 0 3px 12px rgba(26,68,128,.12);
    --sh3: 0 6px 22px rgba(26,68,128,.17);
    --rr:  6px;
    --rr2: 4px;
    --rr3: 8px;
    --pill: 999px;
}

html { font-size: 15px; }

body {
    background: var(--off-white);
    color: var(--ink);
    font-family: 'PingFang SC','Noto Sans SC','Hiragino Sans GB','Microsoft YaHei',
                 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

a { color: var(--navy-lt); text-decoration: none; transition: color .16s; }
a:hover { color: var(--navy); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.cf::after { content: ''; display: table; clear: both; }

/* ===== OUTER CONTAINER ===== */
.ml-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
/* navy top strip — MedlinePlus top bar */
.ml-topstrip {
    background: var(--navy);
    padding: 0;
    line-height: 0;
}

.ml-header {
    background: var(--white);
    border-bottom: 3px solid var(--teal);
    padding: 8px 0;
    box-shadow: var(--sh1);
}

.ml-header .ml-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.ml-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ml-logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* Bold two-tone logo — navy + teal like MedlinePlus */
.ml-logo-txt {
    font-size: 1.40rem;
    font-weight: 900;
    font-style: normal;
    letter-spacing: -.3px;
    text-decoration: none;
    border-bottom: none;
    color: var(--navy);
}

.ml-logo-txt span {
    color: var(--teal);
}

/* Domain badge: teal pill */
.ml-domain {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--teal);
    border-radius: var(--rr2);
    padding: 4px 14px;
}

.ml-domain .mld-note {
    font-size: 0.67rem;
    color: rgba(255,255,255,.72);
    white-space: nowrap;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ml-domain .mld-val {
    font-size: 1.06rem;
    font-weight: 900;
    color: var(--white);
    white-space: nowrap;
}

/* ===== BANNER ===== */
.ml-banner {
    margin: 4px 0 3px;
}
.ml-banner img { border-radius: var(--rr); width: 100%; }

/* ===== CATEGORY NAV ===== */
.ml-navbox {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.ml-nav-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    min-height: 38px;
}

.ml-nav-row:last-child { border-bottom: none; }

.ml-zone-label {
    background: var(--teal);
    color: rgba(255,255,255,.92);
    font-size: .68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 1px solid rgba(255,255,255,.12);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.ml-zone-anchors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    padding: 4px 8px;
    gap: 3px;
    flex: 1;
}

.ml-zone-anchors a {
    font-size: .82rem;
    color: var(--ink-mid);
    padding: 4px 6px;
    border-radius: var(--rr2);
    transition: all .16s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.ml-zone-anchors a:hover {
    background: var(--teal-pale);
    color: var(--teal-dk);
    border-color: var(--teal-ring);
}

.ml-zone-anchors a.active {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.ml-search {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    padding: 8px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.ml-search form {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.ml-search input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1.5px solid var(--border2);
    border-radius: var(--rr2);
    padding: 0 14px;
    font-size: .88rem;
    color: var(--ink);
    background: var(--off-white);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.ml-search input[type="text"]:focus {
    border-color: var(--navy-lt);
    box-shadow: 0 0 0 3px var(--navy-ring);
    background: var(--white);
}

.ml-search input[type="text"]::placeholder { color: var(--ink-faint); }

.ml-search button {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid var(--border2);
    border-radius: var(--rr2);
    background: var(--pale-gray);
    color: var(--ink-mid);
    font-size: .80rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all .16s;
    flex-shrink: 0;
}

.ml-search button:hover {
    background: var(--border);
    color: var(--ink);
}

/* GO-style green button */
.ml-search button[value="1"] {
    background: var(--teal);
    color: var(--white);
    border-color: var(--teal);
}
.ml-search button[value="1"]:hover { background: var(--teal-lt); border-color: var(--teal-lt); }

/* Navy secondary button */
.ml-search button[value="2"] {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.ml-search button[value="2"]:hover { background: var(--navy-lt); border-color: var(--navy-lt); }

/* ===== HOT TAGS ===== */
.ml-hotwords {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    padding: 7px 12px;
    margin: 3px 0;
    box-shadow: var(--sh1);
}

.ml-hotwords h4 {
    font-size: .79rem;
    font-weight: 700;
    color: var(--ink-soft);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ml-hw-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ml-hw-list .hwt {
    display: inline-block;
    background: var(--off-white);
    color: var(--navy-lt);
    border: 1px solid var(--border2);
    border-radius: var(--rr2);
    padding: 2px 10px;
    font-size: .76rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .16s;
}

.ml-hw-list .hwt:hover {
    background: var(--navy-pale);
    color: var(--navy);
    border-color: var(--navy-ring);
}

/* ===== CONTENT SECTION ===== */
.ml-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr3);
    padding: 12px 13px 10px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ml-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--pale-gray);
    position: relative;
}

.ml-box-head::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 36px;
    height: 2px;
    background: var(--teal);
    border-radius: 2px;
}

.ml-box-head h3 {
    font-size: .98rem;
    font-weight: 800;
    color: var(--ink);
}

.ml-box-head h3 a { color: var(--ink); }
.ml-box-head h3 a:hover { color: var(--teal-dk); }

.ml-box-head h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--ink);
}

/* ===== MEDIA GRID ===== */
.ml-entries {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ml-entries li {
    border-radius: var(--rr);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--off-white);
    transition: box-shadow .2s, transform .2s, border-color .2s;
}

.ml-entries li:hover {
    box-shadow: var(--sh3);
    transform: translateY(-2px);
    border-color: var(--teal-ring);
}

.ml-entry-img {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--pale-gray);
}

.ml-entry-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.ml-entry-img:hover img { transform: scale(1.05); }

.ml-entry-name {
    padding: 5px 7px 7px;
}

.ml-entry-name h5 {
    font-size: .78rem;
    font-weight: 500;
    color: var(--ink-mid);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ml-entry-name h5 a { color: var(--ink-mid); }
.ml-entry-name h5 a:hover { color: var(--teal-dk); }

/* ===== PAGINATION ===== */
.ml-pgn {
    margin: 14px 0 6px;
    display: flex;
    justify-content: center;
}

.ml-pgn-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.ml-pgn-inner a.mpg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--white);
    border: 1px solid var(--border2);
    border-radius: var(--rr2);
    font-size: .84rem;
    color: var(--navy-lt);
    text-decoration: none;
    transition: all .16s;
}

.ml-pgn-inner a.mpg:hover {
    background: var(--teal-pale);
    border-color: var(--teal-ring);
    color: var(--teal-dk);
}

.ml-pgn-inner a.mpg-here {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--teal);
    border: 1px solid var(--teal);
    border-radius: var(--rr2);
    font-size: .84rem;
    font-weight: 700;
    color: var(--white);
    cursor: default;
}

/* ===== FOOTER ===== */
.ml-flinks {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    padding: 9px 13px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ml-fl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ml-fl-row dd { display: inline; }

.ml-fl-row a {
    display: inline-block;
    font-size: .77rem;
    color: var(--ink-faint);
    padding: 2px 9px;
    border-radius: var(--rr2);
    border: 1px solid var(--border);
    background: var(--off-white);
    text-decoration: none;
    transition: all .16s;
}

.ml-fl-row a:hover { color: var(--teal-dk); border-color: var(--teal-ring); }

.ml-copyright {
    text-align: center;
    padding: 8px 0 14px;
    color: var(--ink-faint);
    font-size: .76rem;
}

/* ===== DETAIL PAGES ===== */
.ml-dtl-title {
    line-height: 1.8;
    text-align: center;
    padding: 11px 15px;
    font-size: .98rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: var(--rr);
    box-shadow: var(--sh1);
}

.ml-dtl-title a {
    color: var(--teal-dk);
    font-weight: 700;
    margin-right: 6px;
}

.ml-dtl-specs {
    font-size: .9rem;
    line-height: 1.95;
    padding: 14px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    box-shadow: var(--sh1);
    margin: 4px 0;
    color: var(--ink-mid);
}

.ml-screen {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.ml-screen picture,
.ml-screen img {
    width: 100%;
    height: auto;
    border-radius: var(--rr2);
    display: block;
}

/* ===== DOWNLOAD BUTTONS ===== */
.ml-btn-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.ml-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--teal);
    color: var(--white);
    border: 2px solid var(--teal);
    border-radius: var(--rr2);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .14s;
    text-decoration: none;
}

.ml-action-btn:hover {
    background: var(--teal-lt);
    border-color: var(--teal-lt);
    color: var(--white);
    transform: translateY(-1px);
}

.ml-client-note {
    text-align: center;
    padding: 7px;
    font-size: .82rem;
}

.ml-client-note a { color: var(--teal-dk); font-weight: 700; }
.ml-client-note a:hover { color: var(--teal); }

/* ===== SHARE BAR ===== */
.ml-share-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--rr);
    padding: 8px 13px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.ml-share-bar .msb-lbl  { font-size: .77rem; color: var(--ink-faint); white-space: nowrap; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.ml-share-bar .msb-link { font-size: .79rem; color: var(--ink-soft); flex: 1; min-width: 0; word-break: break-all; }

.ml-share-bar .msb-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: var(--rr2);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .16s;
    flex-shrink: 0;
}

.ml-share-bar .msb-copy:hover { background: var(--navy-lt); }

/* ===== VISIBILITY ===== */
.ml-pc { display: block; }
.ml-mb { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ml-entries { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .ml-pc { display: none; }
    .ml-mb { display: block; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .ml-logo-txt { font-size: 1.10rem; }
    .ml-domain .mld-val { font-size: .92rem; }

    .ml-nav-row { align-items: stretch; }

    .ml-zone-label {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 4px 2px;
        letter-spacing: 0;
        line-height: 1.5;
        word-break: break-all;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ml-zone-anchors {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 4px 5px;
        align-items: center;
    }

    .ml-zone-anchors a {
        font-size: 13px;
        padding: 5px 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .ml-search form { flex-wrap: nowrap; gap: 4px; }

    .ml-search input[type="text"] {
        height: 34px;
        font-size: .79rem;
        padding: 0 10px;
    }

    .ml-search button {
        height: 34px;
        padding: 0 8px;
        font-size: .74rem;
    }

    .ml-entries { grid-template-columns: repeat(2, 1fr); gap: 7px; }

    .ml-entry-img { aspect-ratio: 600 / 350; }
    .ml-entry-name h5 { font-size: .72rem; }
    .ml-box { padding: 9px 9px 7px; }
    .ml-action-btn { padding: 9px 16px; font-size: .84rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ml-zone-label { font-size: 10px; }
    .ml-zone-anchors a { font-size: 13px; }
}

@media (max-width: 380px) {
    .ml-zone-label { font-size: 10px; }
    .ml-zone-anchors a { font-size: 12px; }
    .ml-search button { padding: 0 5px; font-size: .68rem; }
}
