/* HomePal 好伴 官網 */
:root {
    --primary: #1677ff;
    --primary-dark: #0d5bd6;
    --primary-light: #e8f1ff;
    --text: #1a1a2e;
    --text-muted: #5c6370;
    --bg: #ffffff;
    --bg-alt: #f4f8fc;
    --border: #e8ecf0;
    --shadow: 0 4px 24px rgba(22, 119, 255, 0.08);
    --shadow-lg: 0 12px 48px rgba(22, 119, 255, 0.12);
    --radius: 12px;
    --radius-lg: 20px;
    --header-h: 72px;
    --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Helvetica Neue", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-white {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
}

.btn-white:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-white {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
}

.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 16px;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
    border-color: var(--border);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
}

.logo:hover {
    color: var(--text);
}

.logo-img {
    display: block;
    height: 44px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.logo-img-footer {
    height: 52px;
}

.nav-desktop {
    display: none;
    gap: 32px;
}

.nav-desktop a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-desktop a:hover {
    color: var(--primary);
}

.nav-cta {
    display: none;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px 24px;
    background: #fff;
    border-top: 1px solid var(--border);
}

.nav-mobile.open {
    display: flex;
}

.nav-mobile a {
    padding: 12px 0;
    color: var(--text);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.nav-mobile a:last-child {
    border: none;
    margin-top: 8px;
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 48px) 0 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(22, 119, 255, 0.15), transparent),
        radial-gradient(ellipse 50% 40% at 10% 80%, rgba(64, 150, 255, 0.1), transparent),
        linear-gradient(180deg, #f0f6ff 0%, #fff 60%);
    z-index: -1;
}

.hero-content {
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 999px;
    font-weight: 500;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero h1 span {
    color: var(--primary);
}

.hero-tagline {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-desc {
    max-width: 560px;
    margin: 0 auto 32px;
    color: var(--text-muted);
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 56px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    list-style: none;
    max-width: 640px;
    margin: 0 auto;
    padding: 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-stats li {
    text-align: center;
}

.hero-stats strong {
    display: block;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.hero-stats span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Sections */
.section {
    padding: 88px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--text);
}

.section-sub {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 16px;
}

/* Intro */
.intro-grid {
    display: grid;
    gap: 40px;
}

.intro-main p {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 17px;
}

.intro-main strong {
    color: var(--text);
}

.intro-aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.highlight-card {
    padding: 24px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s, transform 0.3s;
}

.section-alt .highlight-card {
    background: #fff;
}

.highlight-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.highlight-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.highlight-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
}

.highlight-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Media */
.media-grid {
    display: grid;
    gap: 20px;
}

.media-card {
    padding: 28px;
    background: #fff;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.media-card:hover {
    transform: translateY(-3px);
}

.media-card p {
    font-size: 15px;
    color: var(--text);
    line-height: 1.75;
    margin-bottom: 16px;
    font-style: italic;
}

.media-card p::before {
    content: "\201C";
    color: var(--primary);
    font-size: 1.4em;
    font-style: normal;
}

.media-card footer {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
}

/* Reviews */
.reviews-grid {
    display: grid;
    gap: 20px;
}

.review-card {
    padding: 28px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.section-alt + .section .review-card,
#reviews .review-card {
    background: #fff;
}

.review-card:hover {
    box-shadow: var(--shadow);
}

.stars {
    color: #faad14;
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.review-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 16px;
}

.review-card footer {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* Features */
.features-grid {
    display: grid;
    gap: 24px;
}

.feature-card {
    padding: 32px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.feature-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature-num {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    opacity: 0.6;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.75;
}

/* Timeline */
.timeline {
    list-style: none;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
}

.timeline li {
    position: relative;
    padding-bottom: 40px;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -32px;
    top: 6px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.timeline-year {
    display: inline-block;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.timeline-body p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.7;
}

.timeline-body strong {
    color: var(--primary);
}

/* Services */
.services-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.tab-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.service-panel {
    padding: 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-cloud span {
    padding: 8px 18px;
    font-size: 14px;
    color: var(--text);
    background: var(--bg-alt);
    border-radius: 999px;
    transition: all 0.2s;
}

.tag-cloud span:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* CTA */
.cta {
    padding: 88px 0;
    background: linear-gradient(135deg, var(--primary) 0%, #4096ff 50%, #0958d9 100%);
    text-align: center;
    color: #fff;
}

.cta h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.cta > .container > p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.cta-note {
    font-size: 14px;
    opacity: 0.75;
}

.cta-phone {
    margin-top: 16px;
    font-size: 16px;
    opacity: 0.9;
}

.cta-phone a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.cta-phone a:hover {
    text-decoration: underline;
}

/* Footer */
.site-footer {
    padding: 48px 0 32px;
    background: #0f1729;
    color: rgba(255, 255, 255, 0.7);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-brand .logo-img {
    flex-shrink: 0;
}

.footer-brand strong {
    display: block;
    color: #fff;
    font-size: 18px;
    margin-bottom: 4px;
}

.footer-brand p {
    font-size: 13px;
}

.footer-company {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.65;
    line-height: 1.5;
}

.footer-phone {
    margin-top: 10px;
    font-size: 14px;
}

.footer-phone a {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.footer-phone a:hover {
    text-decoration: underline;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 12px;
    opacity: 0.5;
}

/* Legal pages */
.legal-page .site-header {
    border-color: var(--border);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.legal-main {
    padding: calc(var(--header-h) + 40px) 0 80px;
    min-height: 60vh;
    background: var(--bg-alt);
}

.legal-article {
    max-width: 800px;
    padding: 40px 32px 48px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.legal-article h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.legal-article h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 12px;
}

.legal-article p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.85;
    margin-bottom: 12px;
}

.legal-article ul {
    margin: 0 0 16px 1.25em;
    padding: 0;
}

.legal-article li {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 8px;
}

.legal-article strong {
    color: var(--text);
}

.legal-loading,
.legal-error {
    text-align: center;
    color: var(--text-muted);
    padding: 48px 0;
}

.legal-error a {
    color: var(--primary);
}

.legal-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 960px;
}

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.legal-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-alt);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.legal-nav__link:hover {
    color: var(--primary);
    background: rgba(22, 119, 255, 0.08);
}

.legal-nav__link--active {
    color: #fff;
    background: var(--primary);
    font-weight: 600;
}

.legal-divider {
    height: 1px;
    margin: 40px 0;
    background: var(--border);
}

.legal-section {
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-meta {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.75;
}

.legal-article a {
    color: var(--primary);
    text-decoration: none;
}

.legal-article a:hover {
    text-decoration: underline;
}

@media (min-width: 768px) {
    .legal-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }

    .legal-nav {
        flex-direction: column;
        flex: 0 0 200px;
        position: sticky;
        top: calc(var(--header-h) + 24px);
    }

    .legal-article {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .legal-article {
        padding: 28px 20px 36px;
        border-radius: var(--radius);
    }
}

/* Toast */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    z-index: 9999;
    max-width: calc(100% - 48px);
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    background: rgba(15, 23, 41, 0.92);
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (min-width: 640px) {
    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .nav-desktop {
        display: flex;
    }

    .nav-cta {
        display: inline-flex;
    }

    .nav-toggle {
        display: none;
    }

    .nav-mobile {
        display: none !important;
    }

    .intro-grid {
        grid-template-columns: 1.2fr 1fr;
        align-items: start;
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .reviews-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1100px) {
    .media-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
