* {
    box-sizing: border-box;
}

body {
    margin: 0;

    font-family:
        "Noto Serif TC",
        "PingFang TC",
        "Microsoft JhengHei",
        serif;

    color: #222;
    background: #fafafa;
}

/* ======================================================
   Site Header / Menu（與 index.html / home-ink 一致）
====================================================== */

:root {
    /* 調小此寬度 → logo／選單更靠中；調大 → 更靠兩邊 */
    --site-header-width: 1100px;
    --site-header-side-inset: 82%;
}

.site-header {
    height: 72px;

    position: relative;
    z-index: 100;

    border-top: 3px solid #262626;
    border-bottom: 1px solid #ddd;

    background: rgba(255, 255, 255, .97);
}

/* 等 Auth 就緒並寫入會員連結後再顯示，避免「會員登入／會員中心」字串跳動 */
.site-header[aria-busy="true"] .header-inner {
    visibility: hidden;
}

.header-inner {
    width: min(var(--site-header-width), var(--site-header-side-inset));
    height: 100%;

    margin-left: auto;
    margin-right: auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: #111;
    text-decoration: none;

    font-family:
        "Noto Serif TC",
        "Songti TC",
        "PMingLiU",
        serif;

    font-size: 29px;
    font-weight: 700;
    letter-spacing: .13em;
}

.logo-seal {
    width: 20px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #777;
    border-radius: 10px;

    font-size: 9px;
    letter-spacing: 0;
}

.site-nav {
    height: 100%;

    display: flex;
    align-items: center;
    gap: 34px;
}

.site-nav > a {
    height: 100%;

    position: relative;

    display: inline-flex;
    align-items: center;

    color: #333;
    text-decoration: none;

    font-family:
        "Noto Serif TC",
        "Songti TC",
        "PMingLiU",
        serif;

    font-size: 14px;
}

.site-nav > a::after {
    content: "";

    width: 0;
    height: 2px;

    position: absolute;
    left: 50%;
    bottom: 13px;

    background: #222;

    transform: translateX(-50%);
    transition: width .2s ease;
}

.site-nav > a:hover::after,
.site-nav > a.active::after {
    width: 100%;
}

.nav-search-button {
    width: 25px;
    height: 25px;

    padding: 3px;
    border: 0;

    background: transparent;
    cursor: pointer;
}

.nav-search-button svg {
    width: 100%;
    height: 100%;

    fill: none;
    stroke: #222;
    stroke-width: 1.6;
}

/* ======================================================
   Mobile Header / Menu
====================================================== */

.mobile-menu-button {
    width: 42px;
    height: 42px;

    display: none;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    padding: 0;
    border: 1px solid #cfc8bc;
    background: rgba(255, 255, 255, .72);
    color: #222;
    cursor: pointer;
}

.mobile-menu-button span {
    width: 19px;
    height: 1px;

    display: block;
    background: currentColor;

    transition:
        transform .2s ease,
        opacity .2s ease;
}

.mobile-menu-button[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.mobile-menu-button[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.mobile-site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 120;

    padding: 8px 0 14px;
    border-bottom: 1px solid #d8d1c5;

    background: rgba(250, 248, 244, .985);
    box-shadow: 0 14px 26px rgba(49, 42, 34, .08);
}

.mobile-site-nav[hidden] {
    display: none !important;
}

.mobile-site-nav > a {
    min-height: 48px;

    display: flex;
    align-items: center;

    padding: 0 26px;
    border-left: 3px solid transparent;

    color: #2d2a26;
    text-decoration: none;

    font-family:
        "Noto Serif TC",
        "Songti TC",
        "PMingLiU",
        serif;

    font-size: 15px;
    letter-spacing: .08em;
}

.mobile-site-nav > a + a {
    border-top: 1px solid rgba(167, 153, 135, .14);
}

.mobile-site-nav > a.active {
    border-left-color: #8f4e3b;
    background: rgba(143, 78, 59, .055);
    color: #7e3f30;
}

.mobile-site-nav > a:active {
    background: rgba(143, 78, 59, .08);
}

@media (max-width: 1120px) {
    .site-nav {
        gap: 18px;
    }
}

@media (max-width: 860px) {
    .site-header {
        height: 70px;
    }

    .header-inner {
        width: auto;
        margin: 0;
        padding: 0 20px;
    }

    .site-nav {
        display: none;
    }

    .mobile-menu-button {
        display: inline-flex;
    }
}

@media (max-width: 560px) {
    .header-inner {
        padding: 0 18px;
    }

    .site-logo {
        gap: 8px;
        font-size: 22px;
        letter-spacing: .1em;
        white-space: nowrap;
    }

    .logo-seal {
        width: 22px;
        height: 32px;
        border-radius: 12px;
        font-size: 10px;
    }

    .mobile-site-nav > a {
        min-height: 50px;
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 390px) {
    .header-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    .site-logo {
        font-size: 20px;
        letter-spacing: .07em;
    }

    .mobile-menu-button {
        width: 40px;
        height: 40px;
    }
}

.logo {
    font-size: 28px;
    font-weight: bold;
}

nav a {
    margin-left: 32px;

    text-decoration: none;

    color: #333;
}

/* 覆蓋上方 nav a 的 margin，改以 gap 控制選單間距 */
.site-nav > a {
    margin-left: 0;
}

.hero {
    min-height: 400px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    border-bottom: 1px solid #ddd;
}

.hero h1 {
    font-size: 56px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 22px;
}

.latest {
    width: 1200px;
    max-width: 90%;

    margin: 50px auto;
}


/* ======================================================
   會員限定文章：列表鎖定標示
====================================================== */

.ink-latest-thumb,
.article-card-thumbnail,
.shanghan-card-thumbnail,
.case-card-thumbnail {
    position: relative;
}

.member-lock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 999px;
    background: rgba(24, 24, 24, .82);
    color: #fff;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
    backdrop-filter: blur(2px);
}

.member-lock-meta {
    font-weight: 700;
    color: #6f4d2e;
}

.member-lock-inline {
    display: inline-block;
    margin-right: 3px;
    font-size: .9em;
    line-height: 1;
    vertical-align: .02em;
}

.member-locked-card {
    position: relative;
}
