/* ============================================
   建投阜康养 - 共用样式表
   基于 Material Design 3 色彩体系
   ============================================ */

/* 补充 Tailwind 缺失的 aspect-square 基础类 */
.aspect-square {
    aspect-ratio: 1 / 1;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* 安全呼吸区 */
.safe-breathing-zone {
    padding: 64px 40px;
}

@media (max-width: 768px) {
    .safe-breathing-zone {
        padding: 40px 16px;
    }
}

/* 页面基础样式 */
body {
    font-family: 'Source Han Sans SC', 'Source Han Sans CN', '思源黑体', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
    background-color: #fbf9f4;
}

/* 统一导航栏 */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
    background-color: #fbf9f4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(191, 202, 186, 0.3);
    height: 80px;
    transition: box-shadow 0.2s ease;
}

.main-header.is-scrolled {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.main-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header .brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

.main-header .brand-logo {
    width: 140px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.main-header .nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
}

.main-header .nav-links a {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    color: #40493d;
    transition: color 0.2s;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.main-header .nav-links a:hover {
    color: #0d631b;
}

.main-header .nav-links a.active {
    color: #0d631b;
    font-weight: 700;
    border-bottom-color: #0d631b;
}

.main-header .hotline {
    font-size: 13px;
    font-weight: 600;
    color: #0d631b;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(13, 99, 27, 0.2);
    border-radius: 999px;
    background: rgba(205, 230, 209, 0.24);
    text-decoration: none;
    white-space: nowrap;
}

.main-header .hotline .material-symbols-outlined {
    font-size: 18px;
}

@media (max-width: 1024px) {
    .main-header .nav-links { display: none; }
    .main-header .header-inner { padding: 0 16px; }
}

/* 移动端汉堡菜单 */
.mobile-menu-btn {
    display: none;
    border: 0;
    background: transparent;
    color: #0d631b;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.mobile-menu-btn:hover {
    background-color: rgba(205, 230, 209, 0.35);
}

@media (max-width: 1024px) {
    .mobile-menu-btn { display: block; }
    .main-header .hotline { display: none; }
}

.mobile-menu-overlay {
    position: fixed;
    inset: 80px 0 0;
    z-index: 60;
    background: rgba(27, 28, 25, 0.5);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s var(--motion-ease), visibility 0.24s var(--motion-ease);
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-panel {
    width: min(320px, 86vw);
    height: 100%;
    padding: 24px;
    overflow-y: auto;
    background: #fbf9f4;
    box-shadow: -8px 0 32px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.28s var(--motion-ease);
    will-change: transform;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-panel a {
    display: block;
    padding: 14px 0;
    color: #40493d;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 1px solid #e4e2dd;
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.24s var(--motion-ease), transform 0.24s var(--motion-ease), color 0.18s var(--motion-ease);
}

.mobile-menu-overlay.is-open .mobile-menu-panel a {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(1) { transition-delay: 0.04s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(2) { transition-delay: 0.07s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(3) { transition-delay: 0.10s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(4) { transition-delay: 0.13s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(5) { transition-delay: 0.16s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(6) { transition-delay: 0.19s; }
.mobile-menu-overlay.is-open .mobile-menu-panel a:nth-child(7) { transition-delay: 0.22s; }

.mobile-menu-panel a.active {
    color: #0d631b;
    font-weight: 700;
}

body.menu-open {
    overflow: hidden;
}

/* 侧边快捷栏 */
.side-nav {
    position: fixed;
    right: 24px;
    bottom: 96px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border: 1px solid rgba(191, 202, 186, 0.3);
    background-color: #fbf9f4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    z-index: 40;
}

.side-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #40493d;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Source Han Sans SC', 'Source Han Sans CN', '思源黑体', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

@media (hover: hover) and (pointer: fine) {
    .side-nav button:hover {
        background-color: rgba(205, 230, 209, 0.3);
        transform: scale(1.05);
    }
}

/* 触屏/鼠标按下反馈：:active 兜底（无 JS 时仍生效），.is-pressed 由 JS 保证移动端可见 */
.side-nav button:active,
.side-nav button.is-pressed {
    background-color: rgba(205, 230, 209, 0.3);
    transform: scale(1.05);
}

.side-nav button span.material-symbols-outlined {
    margin-bottom: 4px;
}

.side-nav button span.label {
    font-size: 12px;
    font-weight: 500;
}

/* 统一页脚 */
.main-footer {
    width: 100%;
    padding: 48px 40px 24px;
    background-color: #30312e;
    color: #fbf9f4;
    border-top: 1px solid #707a6c;
}

.main-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.main-footer .footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
    gap: 32px;
    margin-bottom: 48px;
}

.main-footer .footer-brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #fbf9f4;
}

.main-footer .footer-desc {
    font-size: 16px;
    line-height: 26px;
    margin-bottom: 16px;
    color: rgba(228, 226, 221, 0.8);
}

.main-footer .footer-badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(13, 99, 27, 0.2);
    border: 1px solid rgba(13, 99, 27, 0.3);
    border-radius: 4px;
    color: #88d982;
    font-size: 14px;
    font-weight: 700;
}

.main-footer h4 {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    color: #ffdea5;
    margin-bottom: 20px;
}

.main-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-footer ul li {
    margin-bottom: 12px;
}

.main-footer ul li a {
    color: rgba(228, 226, 221, 0.8);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 15px;
}

.main-footer ul li a:hover {
    color: #fbf9f4;
}

.main-footer .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(228, 226, 221, 0.8);
    font-size: 15px;
    margin-bottom: 12px;
}

.main-footer .contact-item .material-symbols-outlined {
    font-size: 18px;
}

.main-footer .contact-item a {
    color: rgba(228, 226, 221, 0.8);
    text-decoration: none;
}

.main-footer .contact-item a:hover {
    color: #fbf9f4;
}

.main-footer .footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(228, 226, 221, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: rgba(228, 226, 221, 0.6);
    font-size: 13px;
}

.main-footer .footer-bottom a {
    color: rgba(228, 226, 221, 0.6);
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.main-footer .footer-bottom div {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.main-footer .footer-bottom a:hover {
    color: #fbf9f4;
}

.main-footer .footer-bottom .ga-icon {
    height: 16px;
    width: auto;
    margin-right: 4px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .main-footer {
        padding: 40px 16px 24px;
    }
    .main-footer .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .main-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* 页面内容区 */
.page-content {
    padding-top: 80px; /* 补偿固定导航栏高度 */
    min-height: calc(100vh - 80px);
}

/* 动画相关 */
:root {
    --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity 0.68s var(--motion-ease), transform 0.68s var(--motion-ease), filter 0.68s var(--motion-ease);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}

.reveal-scale {
    transform: scale(0.97);
    filter: saturate(0.92);
}

.reveal.revealed {
    opacity: 1;
    transform: none;
    filter: none;
}

html[data-page="home"] .hero-copy > *,
html[data-page="about"] .page-content > section:first-child h1,
html[data-page="about"] .page-content > section:first-child p,
html[data-page="culture"] .page-content > section:first-child h1,
html[data-page="culture"] .page-content > section:first-child p,
html[data-page="services"] .page-content > section:first-child .inline-block,
html[data-page="services"] .page-content > section:first-child h1,
html[data-page="services"] .page-content > section:first-child p,
html[data-page="services"] .page-content > section:first-child .flex.gap-stack-sm {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    animation: heroTextIn 0.75s var(--motion-ease) forwards;
}

html[data-page="home"] .hero-copy > :nth-child(1),
html[data-page="about"] .page-content > section:first-child h1,
html[data-page="culture"] .page-content > section:first-child h1,
html[data-page="services"] .page-content > section:first-child .inline-block {
    animation-delay: 0.08s;
}

html[data-page="home"] .hero-copy > :nth-child(2),
html[data-page="about"] .page-content > section:first-child p,
html[data-page="culture"] .page-content > section:first-child p,
html[data-page="services"] .page-content > section:first-child h1 {
    animation-delay: 0.18s;
}

html[data-page="home"] .hero-copy > :nth-child(3),
html[data-page="services"] .page-content > section:first-child p {
    animation-delay: 0.28s;
}

html[data-page="services"] .page-content > section:first-child .flex.gap-stack-sm {
    animation-delay: 0.38s;
}

html[data-page="home"] .home-hero-image,
html[data-page="about"] .page-content > section:first-child > img,
html[data-page="culture"] .page-content > section:first-child img,
html[data-page="services"] .page-content > section:first-child img {
    animation: heroImageIn 1.05s var(--motion-ease) both;
}

@keyframes heroTextIn {
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes heroImageIn {
    from {
        opacity: 0.88;
        transform: scale(1.025);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 卡片hover效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.service-btn {
    position: relative;
    text-decoration: none;
    transition: transform 0.22s var(--motion-ease), box-shadow 0.22s var(--motion-ease), background-color 0.22s var(--motion-ease), border-color 0.22s var(--motion-ease), color 0.22s var(--motion-ease);
}

.service-btn:hover {
    transform: translateY(-3px);
}

.service-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.service-btn-primary:hover {
    background-color: #005312;
    box-shadow: 0 14px 30px rgba(13, 99, 27, 0.26);
}

.service-btn-outline:hover {
    color: #ffffff;
    background-color: #0d631b;
    border-color: #0d631b;
    box-shadow: 0 12px 28px rgba(13, 99, 27, 0.18);
}

.service-btn-soft:hover {
    color: #ffffff;
    background-color: #4d6453;
    box-shadow: 0 12px 28px rgba(77, 100, 83, 0.2);
}

.news-page {
    padding-top: 128px;
}

.news-search {
    outline: none !important;
    transition: border-color 0.2s var(--motion-ease), box-shadow 0.2s var(--motion-ease), background-color 0.2s var(--motion-ease);
}

.news-search:focus {
    border-color: #0d631b !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(13, 99, 27, 0.12), 0 8px 22px rgba(13, 99, 27, 0.08) !important;
    --tw-ring-color: rgba(13, 99, 27, 0.12) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
}

.news-search::placeholder {
    color: #707a6c;
}

.news-filter,
.job-filter {
    min-height: 38px;
    border: 1px solid #bfcaba;
    color: #40493d;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 99, 27, 0);
    cursor: pointer;
    line-height: 20px;
    transition: color 0.18s var(--motion-ease), background-color 0.18s var(--motion-ease), border-color 0.18s var(--motion-ease), box-shadow 0.18s var(--motion-ease);
}

.news-filter:hover,
.job-filter:hover {
    color: #0d631b;
    border-color: rgba(13, 99, 27, 0.45);
    background-color: rgba(205, 230, 209, 0.32);
}

.news-filter.is-active,
.job-filter.is-active {
    color: #ffffff;
    border-color: #0d631b;
    background-color: #0d631b;
    box-shadow: 0 4px 12px rgba(13, 99, 27, 0.18);
}

.news-featured-card,
.news-card {
    cursor: pointer;
    transition: transform 0.24s var(--motion-ease), box-shadow 0.24s var(--motion-ease), border-color 0.24s var(--motion-ease);
}

.news-featured-card:hover,
.news-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 99, 27, 0.42);
    box-shadow: 0 16px 36px rgba(13, 99, 27, 0.12);
}

.news-link {
    cursor: pointer;
    text-decoration: none;
}

.news-link:hover {
    gap: 0.5rem;
    text-decoration: underline;
}

.job-card {
    cursor: pointer;
    transition: transform 0.24s var(--motion-ease), box-shadow 0.24s var(--motion-ease), border-color 0.24s var(--motion-ease);
}

.job-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 99, 27, 0.42);
    box-shadow: 0 16px 36px rgba(13, 99, 27, 0.12);
}

.job-link {
    cursor: pointer;
    text-decoration: none;
}

@media (max-width: 768px) {
    .news-page {
        padding-top: 112px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-scale,
    html[data-page="home"] .hero-copy > *,
    html[data-page="about"] .page-content > section:first-child h1,
    html[data-page="about"] .page-content > section:first-child p,
    html[data-page="culture"] .page-content > section:first-child h1,
    html[data-page="culture"] .page-content > section:first-child p,
    html[data-page="services"] .page-content > section:first-child .inline-block,
    html[data-page="services"] .page-content > section:first-child h1,
    html[data-page="services"] .page-content > section:first-child p,
    html[data-page="services"] .page-content > section:first-child .flex.gap-stack-sm,
    html[data-page="home"] .home-hero-image,
    html[data-page="about"] .page-content > section:first-child > img,
    html[data-page="culture"] .page-content > section:first-child img,
    html[data-page="services"] .page-content > section:first-child img,
    .mobile-menu-overlay,
    .mobile-menu-panel,
    .mobile-menu-panel a {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
        transition: none;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f0eee9;
}

::-webkit-scrollbar-thumb {
    background: #bfcaba;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #707a6c;
}

/* 选中文字颜色 */
::selection {
    background: rgba(13, 99, 27, 0.15);
    color: #1b1c19;
}
