/**
 * MacCompute 中文站 — 「纸脊」壳层（雾青灰底 + 青绿主色 + 直角线框）
 * body.zh-apple 页面在 common.css 之后引入；博客详情页请勿引用。
 */
body.zh-apple {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #b45309;
    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --bg-subtle: #e8f2f0;
    --border-light: #cfe0dc;
    --nav-active-bg: transparent;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
        ui-sans-serif, system-ui, sans-serif;
    background-color: #eef6f4 !important;
    background-image:
        radial-gradient(ellipse 130% 85% at 50% -32%, rgba(15, 118, 110, 0.09), transparent 55%),
        radial-gradient(ellipse 80% 55% at 100% 8%, rgba(20, 184, 166, 0.055), transparent 50%),
        linear-gradient(180deg, #f7fcfb 0%, #eef6f4 38%, #e4f0ec 100%) !important;
    background-attachment: fixed !important;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

body.zh-apple .glass {
    background: rgba(247, 252, 251, 0.94) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid var(--border-light) !important;
    box-shadow: none !important;
}

/*
 * 固定顶栏 h-14（3.5rem）+ 安全区：主内容需整体下移，避免大标题与顶栏叠在一起。
 * 首页单独保留约 6rem 视觉偏移（与原 pt-24 一致）并叠加安全区。
 */
body.zh-apple main#home-page {
    padding-top: calc(6rem + env(safe-area-inset-top, 0px)) !important;
}

body.zh-apple main:not(#home-page) {
    padding-top: calc(3.5rem + 3.75rem + env(safe-area-inset-top, 0px)) !important;
}

body.zh-apple nav .nav-link,
body.zh-apple .rm-nav-link {
    border-radius: 0 !important;
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
    margin-left: 0.35rem;
    margin-right: 0.35rem;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
}

body.zh-apple #authBtn {
    background: var(--primary) !important;
    border-radius: 2px !important;
    color: #fff !important;
    box-shadow: 2px 2px 0 #1c1917 !important;
}

body.zh-apple #authBtn:hover {
    opacity: 0.92;
}

body.zh-apple .rm-btn-ghost {
    background: #f7fcfb !important;
    border-color: var(--border-light) !important;
    box-shadow: 2px 2px 0 rgba(15, 90, 85, 0.05) !important;
}

body.zh-apple .rm-btn-ghost:hover {
    background: #f9fdfc !important;
    border-color: #b5ccc6 !important;
}

/* 小节标签：左侧色条，非全大写 */
body.zh-apple .apple-eyebrow {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--primary);
    border-left: 3px solid var(--primary);
    padding-left: 0.65rem;
    margin-bottom: 0.75rem;
}

body.zh-apple .apple-surface {
    background: #f9fdfc;
    border-radius: 2px;
    border: 1px solid var(--border-light);
    box-shadow: 4px 4px 0 rgba(15, 90, 85, 0.05);
}

body.zh-apple .apple-surface-soft {
    background: rgba(247, 252, 251, 0.92);
    border-radius: 2px;
    border: 1px solid var(--border-light);
    box-shadow: none;
}

body.zh-apple footer.bg-slate-900 {
    background: #d8e6e2 !important;
    color: #44403c !important;
    border-top: 1px solid #b9cec9 !important;
}

body.zh-apple footer .text-white,
body.zh-apple footer h5.text-white {
    color: #1c1917 !important;
}

body.zh-apple footer a {
    color: #57534e !important;
}

body.zh-apple footer a:hover {
    color: var(--primary) !important;
}

body.zh-apple footer .bg-slate-800 {
    background: #c5d9d4 !important;
    color: #1c1917 !important;
}

body.zh-apple footer .border-slate-800 {
    border-color: #9eb8b2 !important;
}

body.zh-apple .plan-duration-M4_16-selected,
body.zh-apple .plan-duration-M4_24-selected {
    background: rgba(15, 118, 110, 0.1) !important;
}

body.zh-apple #blog-list-container article.group {
    border-radius: 2px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 3px 3px 0 rgba(28, 25, 23, 0.05) !important;
}

body.zh-apple #blog-list-container article.group:hover {
    border-color: var(--primary) !important;
    box-shadow: 4px 4px 0 rgba(15, 118, 110, 0.15) !important;
}

body.zh-apple #blog-pagination .bg-blue-600,
body.zh-apple #blog-pagination .bg-\[\#1d1d1f\] {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 2px !important;
}

body.zh-apple #blog-category-tabs .bg-blue-600,
body.zh-apple #blog-category-tabs .bg-\[\#1d1d1f\] {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 2px !important;
}

body.zh-apple .jiage-hero-card-dark {
    background: linear-gradient(165deg, #134e4a 0%, #0f3d3a 55%, #042f2e 100%) !important;
    color: #f5f5f4 !important;
    border: 1px solid #0a3d39 !important;
    border-radius: 2px !important;
    box-shadow: 6px 6px 0 rgba(28, 25, 23, 0.12) !important;
}

body.zh-apple .jiage-hero-card-dark .text-slate-700,
body.zh-apple .jiage-hero-card-dark [style*="color: var(--text-primary)"] {
    color: #f5f5f4 !important;
}

body.zh-apple .kongzhi-panel {
    background: #f9fdfc !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 2px !important;
    box-shadow: 3px 3px 0 rgba(15, 90, 85, 0.045) !important;
}

body.zh-apple #instance-details.kongzhi-panel .text-slate-400,
body.zh-apple #noInstanceCard {
    border-style: solid !important;
    border-color: var(--border-light) !important;
}

body.zh-apple .help-apple-item {
    border-radius: 2px;
    border: 1px solid var(--border-light);
    background: #f9fdfc;
    box-shadow: none;
    border-left: 3px solid var(--primary);
    overflow: hidden;
}

body.zh-apple .help-apple-item button {
    font-weight: 600;
    color: var(--text-primary);
}

/* noVNC */
body.zh-apple.novnc-page {
    background: #eef6f4 !important;
    color: #1c1917;
}

body.zh-apple.novnc-page .novnc-chrome {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 160px) minmax(120px, 160px) auto auto;
    gap: 8px;
    padding: 10px 12px;
    align-items: center;
    background: #f9fdfc;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

body.zh-apple.novnc-page .novnc-chrome input {
    background: #f9fdfc !important;
    color: #1c1917 !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 2px;
    padding: 8px 10px;
    font-size: 13px;
}

body.zh-apple.novnc-page .novnc-chrome button {
    border-radius: 2px;
    border: 1px solid #115e59;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 2px 2px 0 #1c1917;
}

body.zh-apple.novnc-page .novnc-chrome button:last-of-type {
    background: var(--bg-subtle);
    color: #1c1917;
    border-color: var(--border-light);
    box-shadow: 2px 2px 0 rgba(28, 25, 23, 0.08);
}

body.zh-apple.novnc-page #status {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    background: #f9fdfc;
    border-bottom: 1px solid var(--border-light);
}

body.zh-apple.novnc-page #log {
    margin: 0;
    min-height: 72px;
    max-height: 120px;
    background: #1c1917;
    color: #a8a29e;
    border-top: 1px solid #44403c;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    padding: 8px 12px;
    overflow: auto;
    white-space: pre-wrap;
}

body.zh-apple.novnc-page #screen {
    background: #000;
}

/* 页面内遗留的 Tailwind 蓝色按钮 → 主色（避免与旧苹果蓝冲突） */
body.zh-apple .bg-blue-600 {
    background-color: var(--primary) !important;
}

body.zh-apple .hover\:bg-blue-600:hover {
    background-color: var(--primary) !important;
}

body.zh-apple .hover\:bg-blue-700:hover {
    background-color: var(--primary-dark) !important;
}

/* —— 中文站页脚（与首页同款；不限于 body.zh-apple，博客等页也可复用） —— */
footer.rm-footer-zh-home {
    margin-top: 0;
    background: linear-gradient(180deg, #ddeae6 0%, #d3e2dd 48%, #cadbd6 100%);
    color: #3d4543;
    border-top: 1px solid #aec4be;
    -webkit-font-smoothing: antialiased;
}

.rm-footer-zh-home__hairline {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.35) 42%, rgba(17, 94, 89, 0.45) 58%, transparent);
}

.rm-footer-zh-home__main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.25rem 2rem;
    padding-top: 3rem;
    padding-bottom: 2.5rem;
}

@media (min-width: 640px) {
    .rm-footer-zh-home__main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .rm-footer-zh-home__main {
        grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
        gap: 2.5rem 3rem;
        padding-top: 3.25rem;
        padding-bottom: 2.75rem;
    }
}

.rm-footer-zh-home__wordmark {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.rm-footer-zh-home__logo {
    width: 2rem;
    height: 2rem;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(145deg, #0f766e, #115e59);
    box-shadow: 2px 2px 0 rgba(28, 25, 23, 0.12);
}

.rm-footer-zh-home__title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #115e59;
}

.rm-footer-zh-home__title span {
    color: #0f766e;
}

.rm-footer-zh-home__tagline {
    font-size: 0.8125rem;
    line-height: 1.65;
    color: #57534e;
    max-width: 22rem;
    margin: 0 0 1rem;
}

.rm-footer-zh-home__regions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
}

.rm-footer-zh-home__regions span {
    font-size: 0.6875rem;
    padding: 0.2rem 0.45rem;
    border-radius: 2px;
    border: 1px solid rgba(15, 90, 85, 0.16);
    color: #4a5754;
    background: rgba(247, 252, 251, 0.55);
}

.rm-footer-zh-home__mail {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1c1917 !important;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    border-radius: 999px;
    background: rgba(247, 252, 251, 0.78);
    border: 1px solid rgba(15, 90, 85, 0.12);
    box-shadow: 2px 2px 0 rgba(15, 90, 85, 0.05);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.rm-footer-zh-home__mail:hover {
    background: #f9fdfc;
    border-color: rgba(15, 118, 110, 0.38);
    color: var(--primary) !important;
}

.rm-footer-zh-home__heading {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #1c1917;
}

.rm-footer-zh-home__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.rm-footer-zh-home__col a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #57534e !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

.rm-footer-zh-home__col a:hover {
    color: var(--primary) !important;
}

.rm-footer-zh-home__col .fa-angle-right {
    font-size: 0.5625rem;
    opacity: 0.55;
    width: 0.65rem;
    flex-shrink: 0;
}

.rm-footer-zh-home__bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid rgba(15, 90, 85, 0.16);
    font-size: 0.75rem;
    color: #5c6966;
}

@media (min-width: 640px) {
    .rm-footer-zh-home__bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.rm-footer-zh-home__copy {
    margin: 0;
}

.rm-footer-zh-home__credit {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #5c6966;
}

.rm-footer-zh-home__credit-sep {
    color: rgba(15, 90, 85, 0.28);
    font-weight: 300;
}
