/* Homepage-only styles (subset of line_name_card.css). Sync nav/carousel/footer blocks when editing line_name_card.css for the landing page. */
:root {
    --line-green: #06C755;
    --line-gray: #8C8C8C;
    --line-dark: #1E1E1E;
    --line-border: #EBEBEB;
    --page-bg: #F7F7F7;
    --success-green: #4CAF50;
    --bs-primary: #06C755;
    --bs-primary-hover: #28c589;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Mac: SF + PingFang. Windows: skip Apple fonts → loaded Noto Sans TC
       (not JhengHei, which hints poorly in Chromium). Do not set
       -webkit-font-smoothing: antialiased — it thins/blurs text on Windows. */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
    font-synthesis: none;
}

/* Milligram 對 .row 在 @media (min-width: 40rem) 設了 width: calc(100% + 2rem)，
   原意是搭配 -1rem 負邊距互相抵銷。但版面用 Bootstrap 風格 grid 並以 mx-0 把左右
   margin 歸零後，這 2rem 額外寬度無人抵銷，使每個 .row.mx-0 比容器寬 20px，撐爆
   .page 的 padding → 整頁出現橫向卷軸（≥640px 才發生）。還原滿版寬即可修正。 */
@media (min-width: 40rem) {
    .row.mx-0 {
        width: 100%;
    }
}
.main {
    background-color: #bfe8cda9;
    height: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.preview-hint{
    height: 51.2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.nav-link {
    color: var(--line-gray);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    /* gap between each icon and its label (desktop; labels are hidden on mobile) */
    gap: 8px;
}

.nav-link i,
.nav-link .home-i {
    font-size: 16px;
}

.nav-link:hover {
    color: var(--line-green);
}

nav.main-nav {
    background-color: #fff;
    /* px (not rem) so left/right inset matches across legacy + React pages —
       rem would be 20px on milligram's 62.5% base vs 32px on the React 16px base. */
    padding: 12px 24px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 65.55px;
    position: fixed;
    max-width: 100vw;
    top: 0;
    z-index: 1000;
    width: 100%;
    align-self: flex-start;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
}

nav .logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

nav .logo-container img {
    width: 130px;
    height: 40px;
}

nav .logo-container span {
    font-size: 2rem;
    font-weight: 600;
    color: var(--line-green);
}

/* 編輯模式在品牌字標右側顯示「我的名片」麵包屑（連結回 /my-cards），對應
   React portal 的 nav-page-title。此頁為 milligram 62.5% 基準（1rem=10px），故用
   固定 px；沿用 line-green、不加底線，避免被上方 .logo-container span 規則影響。 */
/* 登入後的 nav（與 sitenav.css 的 .nav-tabs / .nav-tab / .nav-new-card 同款；此檔為
   milligram 62.5% 基準，故用 px）。分頁跟在品牌右側，不用絕對定位。 */
.nav-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
}
@media (min-width: 769px) {
    nav.main-nav {
        justify-content: flex-start;
    }
    nav.main-nav .logo-container {
        flex-shrink: 0;
    }
    .nav-tabs {
        margin-left: 4px;
        margin-right: 8px;
    }
}
@media (min-width: 769px) and (max-width: 1023px) {
    .main-nav:has([data-brand-section]:not([data-brand-section="name-card"])) .nav-link.nav-tab {
        padding: 6px 8px;
        gap: 0;
    }
    .main-nav:has([data-brand-section]:not([data-brand-section="name-card"])) .nav-tab span {
        display: none !important;
    }
}
.nav-link.nav-tab {
    padding: 6px 12px;
    border-radius: 999px;
}
.nav-link.nav-tab.active {
    background: rgba(6, 199, 85, 0.12);
    color: var(--line-green, #06C755);
    font-weight: 600;
}
.nav-link.nav-new-card {
    background: var(--line-green, #06C755);
    color: #fff;
    border-radius: 999px;
    padding: 6px 14px;
    margin-right: 16px;
    font-weight: 600;
    font-size: 14px;
}
.nav-link.nav-new-card:hover {
    color: #fff;
    filter: brightness(0.95);
}
.nav-link.nav-blog-link {
    /* 與管理名片／分享給朋友共用中性色；只有互動時才轉成 LINE 綠。 */
    margin-right: 0;
    padding: 6px 8px;
    border-radius: 999px;
}
.nav-link.nav-blog-link:hover,
.nav-link.nav-blog-link:focus-visible {
    color: var(--line-green);
    background: rgba(6, 199, 85, 0.08);
}
@media (max-width: 768px) {
    .nav-share--desktop-only {
        display: none !important;
    }
    .nav-tabs {
        order: 2;
        margin-left: auto;
        gap: 0;
        flex-shrink: 0;
    }
    .nav-link.nav-tab {
        padding: 6px 8px;
    }
    .nav-link.nav-new-card {
        padding: 6px 9px;
        margin-right: 4px;
    }
    .nav-link.nav-blog-link {
        width: 28px;
        height: 28px;
        padding: 0;
        justify-content: center;
    }
    .nav-link.nav-blog-link i {
        font-size: 14px;
    }
}

nav .logo-container .nav-page-title {
    margin-left: 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--line-green);
    white-space: nowrap;
    text-decoration: none;
}
@media screen and (max-width: 576px) {
    nav .logo-container .nav-page-title {
        margin-left: 8px;
        font-size: 16px;
    }
}

/* Match the live linenamecard.com wordmark: "LINE" in brand green +
   "數位名片" in dark, with optically balanced weight and scale. */
nav .logo-container .brand-text-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
    /* Pin the typeface so legacy pages and React pages resolve the wordmark
       to the SAME font (Mac native, Windows Noto). */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;
}

/* Absolute px (not rem) so the wordmark renders the SAME size on every page —
   this legacy page loads milligram (html font-size:62.5%, 1rem=10px) while the
   React portal pages use the 16px default, so rem would diverge. px keeps them
   identical. */
nav .logo-container .brand-text-logo .brand-line {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--line-green);
}
nav .logo-container .brand-text-logo .brand-name {
    font-size: 24px;
    font-weight: 700;
    color: #1f2a37;
}
@media screen and (max-width: 768px) {
    nav .logo-container .brand-text-logo .brand-line { font-size: 20px; }
    nav .logo-container .brand-text-logo .brand-name { font-size: 17px; }
}
@media screen and (max-width: 576px) {
    nav .logo-container .brand-text-logo .brand-line { font-size: 18px; }
    nav .logo-container .brand-text-logo .brand-name { font-size: 16px; }
}

.fw-nav__right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.fw-nav__dev-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.fw-nav__dev-badge-wrap {
    display: inline-flex;
    align-items: center;
    /* a bit of breathing room before the 管理名片 action group (desktop;
       overridden by the absolute positioning on mobile) */
    margin-right: 16px;
}

.fw-nav__cta {
    background: #2196F3;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.fw-nav__cta:hover {
    background: #1e88e5;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.3);
    transform: translateY(-1px);
}

nav button {
    background: var(--bs-primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 24px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0;
    line-height: 1.5;
}

nav button:hover {
    background-color: var(--bs-primary-hover);
}

.page {
    width: 100%;
    padding: 24px 16px;

    border-radius: 12px;
    margin-top: 62px;
    margin-right: auto;
    margin-left: auto;
}

#page1 {
    max-width: 1100px;

}

#page2 {
    background-color: transparent;
    width: 100%;
    box-shadow: none;

}

/* 桌機讓 wizard 能撐到 1300px：解除 Bootstrap .container 的 max-width 上限，
   實際寬度由 .wizard 的 max-width 控制（手機/平板已是 100%，不受影響）。 */
#page2 .container {
    max-width: 100%;
}

#page-invitation {
    max-width: 500px;
}

.thankyou-card,
.main-card {
    background: white;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 16px;
}

.toolbar {
    background-color: #f4f4f4;
    border-top: 1px solid #EBEBEB;
    border-bottom: 1px solid #EBEBEB;
    position: fixed;
    top: 62px;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 20px;
    flex-wrap: wrap;
    max-width: 100vw;
}

.toolbar.bottom-toolbar {
    top: initial;
    bottom: 0;

}

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

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 16px;
}

h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--line-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.free-badge {
    background: #c70616;
    color: white;
    padding: 12px;
    border-radius: 50%;
    font-size: 14px;
    left: 70%;
    top: -40px;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-button{
    padding: 0;
   
}
.preview-hint{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 4px;
    text-align: center;
    background-color: rgba(0, 0, 0);
    z-index: 10;
}
.preview-hint h3{
    font-size: 16px !important;
    margin-bottom: 0;
}
.preview-hint  p{
    margin-bottom: 0;
    color: #fd4343;
}
.preview-hint+.main-nav{
    top: 51px;
}
.preview-hint h3{
    color: white;
}
.sticky-bar{
    position: sticky;
    background-color: #fffffff0;
    z-index: 5;
    width: 100%;
    border-top: 1px solid #EBEBEB;
}
.sticky-bar.bottom{
    bottom: 0;
    border-radius: 0 0 .625rem .625rem;
}
div:where(.swal2-icon).swal2-question{
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

/* 底線強調效果 */
.underline-emphasis {
    position: relative;
    display: inline-block;
}

.underline-emphasis::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 4px;
    background-color: var(--line-green);

}

.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: shine 3s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes shine {
    0% {
        left: -100%;
        opacity: 0;
    }

    25% {
        opacity: 0.8;
    }

    50% {
        left: 100%;
        opacity: 0;
    }

    75% {
        opacity: 0.8;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.subtitle {
    color: var(--line-gray);
    font-size: 16px;
}

/* Carousel/Swiper Styles */
.swiper {
    width: 100%;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
}

.swiper-slide {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.namecard-preview {
    width: 100%;
    height: auto;
    display: block;
}

.swiper-pagination {
    bottom: 16px !important;
}

.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: white;
    opacity: 1;
}

.preview {
    text-align: center;
}

.template-preview {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    display: inline-block;
    text-align: initial;
}

/* create step2 預覽：flex2html 預設 .lyItem 為 width:80%（上限 300px），
   會隨欄寬縮小。改為 100%（上限 300px 不變），名片即可在較窄的欄位中仍維持
   滿版 300px，讓左欄可以縮窄、分隔線左移而不縮小名片。 */
#content2 .preview .lyItem {
    width: 100%;
}

/* .lyInner 是 flex（預設 justify-content:flex-start），名片 .lyItem 為 flex:none、
   max-width 上限後會被靠左釘住，.preview 的 text-align:center 對 flex 子元素無效，
   名片因此偏左。改成置中對齊、清掉 lyItem 左邊距與尾端 7px 佔位，名片才會真正水平置中。 */
#content2 .preview .lyInner {
    justify-content: center;
}

#content2 .preview .lyInner > .lyItem {
    margin-left: 0;
}

#content2 .preview .lyInner::after {
    display: none;
}

/* create step3 預覽（#confirm-flex，wizard-router.js 用 flex2html 即時渲染）沿用 step2
   同樣的滿版處理：預設 .lyItem 為 width:80%，手機上欄寬 <300px 時名片被縮到 ~274px，
   導致並排的「加 LINE 聯繫」按鈕文字被 ellipsis 截斷。改 100%（仍受 max-width:300px 上限）
   讓 step3 與 step2 一致維持滿版 300px，名片並置中。 */
#confirm-flex .lyItem {
    width: 100%;
}

#confirm-flex .lyInner {
    justify-content: center;
}

#confirm-flex .lyInner > .lyItem {
    margin-left: 0;
}

#confirm-flex .lyInner::after {
    display: none;
}

.btn-hint {
    max-width: 400px;
    margin: 0 auto;
    border-top: 1px dashed #ccc;
    padding-top: 16px;
    color: var(--line-gray);
    font-size: 13px;
}

/* Value Props */
.value-props {
    padding: 0 16px;
    margin-bottom: 32px;
}

.value-prop-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.value-prop-item h3 {
    color: var(--line-dark);
    font-size: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.value-prop-item h3::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bs-primary);
    color: white;
    border-radius: 50%;
    font-size: 14px;
}

.value-prop-item p {
    color: var(--line-gray);
    font-size: 15px;
}

.main-title {
    padding: 0 16px;
}

/* Features */
.features {
    display: flex;
    justify-content: space-around;

    padding: 0 16px;
}

.feature-item {
    text-align: center;
}

.feature-item i,
.feature-item .home-i {
    font-size: 24px;
    color: var(--bs-primary);
    margin-bottom: 8px;
}

.feature-item p {
    color: var(--line-gray);
    font-size: 14px;
}

/* Social Icons */
.icon-container {
    text-align: center;
    margin-bottom: 32px;
}

.icon-container i {
    font-size: 24px;
    color: var(--line-gray);
    margin: 0 12px;
    transition: color 0.2s;
}

.icon-container i:hover {
    color: var(--line-green);
}

.cta-button {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 6px;
    background-color: var(--bs-primary);
    color: white;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(36, 180, 126, 0.2);
    animation: pulse 3s infinite;
}

/* 懸停效果 */
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 180, 126, 0.3);
    background-color: #28c589;
    color: white;
}

/* 點擊效果 */
.cta-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(36, 180, 126, 0.2);
}

/* 定義動畫 */
@keyframes pulse {
    0% {
        transform: scale(.9);

    }

    50% {
        transform: scale(1);

    }

    100% {
        transform: scale(.9);

    }
}

/* Add these carousel styles */
.carousel-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    overflow: hidden;

}

.carousel-slide {
    display: none;
    width: 100%;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: none;
}

.dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--line-gray);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    opacity: 1;
    background: var(--line-green);
}
.custom-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 1rem;
    border-right: 1px solid #dee2e6;
    padding-right: 1rem;
    font-size: 14px;
  }
  .custom-dropdown-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    padding: 0.5rem 0;
    background: none;
    border: none;
    font: inherit;
    outline: none;
  }
  .custom-dropdown-toggle:after {
    content: "▼";
    font-size: 0.7em;
    margin-left: 0.5em;
    transition: transform 0.2s;
  }
  .custom-dropdown:focus-within .custom-dropdown-toggle:after,
  .custom-dropdown:hover .custom-dropdown-toggle:after {
    transform: rotate(180deg);
  }
  .custom-dropdown-menu {
    display: none;
    position: absolute;
   top:24px;   
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 100;
    margin-top: 0.3rem;
    padding: 0.5rem 0;
  }
  .custom-dropdown:focus-within .custom-dropdown-menu,
  .custom-dropdown:hover .custom-dropdown-menu {
    display: block;
  }
  .custom-dropdown-menu li {
    list-style: none;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0;
    
  }
  .custom-dropdown-menu li:last-child {
    border-bottom: none;
  }
  .custom-dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
   color:var(--line-gray);
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 0.25rem;
    gap: 0.5rem;
  }
  .custom-dropdown-menu a:hover {
    background: #f5f5f5;
  }
  .custom-dropdown-menu i,
  .custom-dropdown-menu .home-i {
    margin-right: 0.5em;
    width: 1.5rem;
    text-align: center;
  }
.brand-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
}

.brand-dropdown-toggle {
    color: var(--line-green);
    font-weight: 600;
    font-size: 16px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    user-select: none;
    cursor: pointer;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    width: 168px;
    height: 36px;
    transition: background-color 0.2s;
}

.brand-dropdown-toggle:hover {
    background: #f7f7f7;
}

/* Brand badge links to home; no dropdown, so no caret. */
.brand-dropdown-toggle:after {
    display: none;
}

.nav-end {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-end .fw-nav__dev-badge-wrap {
    margin-left: 0;
}
.nav-modes-wrapper {
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
    padding: 4px;
    margin-left: 12px;
    gap: 8px;
}
nav.main-nav > .nav-modes-wrapper {
    margin-left: auto;
}

.nav-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 16px;
    border-radius: 8px;
    background: transparent;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-home-link:hover {
    color: #333;
    background: transparent;
}

.nav-home-link.is-active {
    background: #e7f5ef;
    color: var(--line-green);
    font-weight: 600;
}

.nav-home-link + .nav-home-link {
    margin-left: 2px;
}

/* 移動端：導航模式換行顯示 */
@media (max-width: 768px) {
    nav.main-nav {
        flex-wrap: nowrap;
        height: auto !important;
        padding-top: 10px;
        padding-bottom: 10px;
        row-gap: 8px;
        justify-content: flex-start !important;
        column-gap: 8px;
    }
    /* logo + 品牌選單維持為同一個「左側群組」並 flex-grow，
       讓右側的 action icons 被推到第一列的最右邊（對齊 sitenav.css 的做法）。
       原本用 display:contents 會讓子元素散開，右側圖示無法穩定靠右。 */
    nav.main-nav .logo-container {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1 1 auto;
        min-width: 0;
        margin: 0;
    }
    /* 限制 brand-dropdown 寬度，避免過度撐開，並確保文字不換行且縮小字體 */
    nav.main-nav .brand-dropdown {
        flex: 0 1 auto;
        max-width: 130px; /* 稍微再縮小一點 */
        margin-left: 0; /* 間距改由 logo-container 的 gap 提供 */
    }
    nav.main-nav .brand-dropdown-toggle {
        white-space: nowrap;
        font-size: 12px; /* 字體再縮小一點 */
        padding-left: 6px;
        padding-right: 6px;
    }
    .nav-modes-wrapper {
        order: 3;
        /* 第一列右側：靠右、不縮放，跟 logo 群組同一行 */
        margin-left: auto;
        justify-content: flex-end;
        flex: 0 0 auto;
        gap: 4px;
    }
    /* 手機上只剩圖示：移除 管理名片 與 分享 之間的分隔線/內距，
       但保留兩個圖示之間的間隔 */
    nav.main-nav .custom-dropdown {
        margin-right: 10px;
        padding-right: 0;
        border-right: none;
    }
    /* Development Site 脫離文本流：浮在 nav 列正下方置中，
       讓 nav-modes-wrapper 縮小、與 logo 維持同一行 */
    .fw-nav__dev-badge-wrap {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin: 4px 0 0;
        pointer-events: none;
    }
    /* 移動端縮小 Development Site 字體 */
    .fw-nav__dev-badge {
        font-size: 10px;
        padding: 2px 6px;
        pointer-events: auto;
    }
}

/* 中小螢幕（含 S25 edge ~412px、iPhone 等）：對齊 1-page-profile 風格
   行 1：logo + dropdown (緊湊版)
   行 2：nav 連結 + 右側圖示
   行 3：Development Site 整行置中 */
@media (max-width: 640px) {
    nav.main-nav {
        column-gap: 8px;
        row-gap: 14px;
        padding-left: 12px;
        padding-right: 12px;
    }
    /* logo 放大（維持比例：鎖高度、寬度自動） */
    nav.main-nav .logo-container img,
    nav.main-nav .logo-img {
        width: auto !important;
        height: 42px !important;
    }
    /* dropdown：保留文字但更緊湊 */
    nav.main-nav .brand-dropdown {
        max-width: none;
        margin-left: 0 !important;
    }
    nav.main-nav .brand-dropdown-toggle {
        white-space: nowrap;
        font-size: 14px;
        padding: 7px 6px 7px 10px;
        width: auto !important;
    }
    nav.main-nav .brand-dropdown-toggle:after {
        margin-left: 2px;
    }
    /* 行 2：nav 連結靠左、右側圖示靠右 */
    .nav-modes-wrapper {
        flex: 0 1 auto !important;
    }
    /* Development Site 脫離文本流：浮在 nav 列正下方置中，nav 維持單行 */
    .fw-nav__dev-badge-wrap {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        margin: 4px 0 0;
        pointer-events: none;
    }
    .fw-nav__dev-badge {
        flex: 0 0 auto;
        order: 0;
        text-align: center;
        margin: 0;
        font-size: 10px !important;
        padding: 2px 8px !important;
        pointer-events: auto;
    }
}
@media screen and (max-width: 1280px) {
    .main {
        align-items: flex-start;
        gap: 2rem;
    }
}
.footer-services,
.svc-sheet,
.svc-sheet-backdrop {
    --primary:       #2AB5A0;
    --primary-dark:  #1E9E8B;
    --primary-light: #EAF8F6;
    --text:          #1F2D3A;
    --text-muted:    #5A6E7B;
    --svc-sheet-sub: #6B6B6B;   /* svc-sheet 副標：中灰，三站共用 */
    --white:         #fff;
}
/* milligram 會給所有 <button> 加 height:3.8rem / uppercase / letter-spacing / line-height，
   逐字移植的按鈕需先歸零，避免版型走樣（後面各自規則再覆寫細節）。 */
.footer-svc,
.svc-sheet__close,
.svc-sheet__tab,
.svc-sheet__cta {
    height: auto;
    min-height: 0;
    padding: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    margin-bottom: 0;
}

/* ── Footer service links ─────────────────────────────────── */
/* Desktop: logo + copyright centered as a group · service links pinned to the page's far right (matches nav) */
.footer-bar { justify-content: center; }
.footer-bar .footer-copy { flex: 0 1 auto; }
.footer-services {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 28px;
    /* In-flow flex item; sits after the copyright with a 120px gap, whole row centered */
    margin-left: 120px;
}
.footer-svc {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: 0;
    padding: 2px 0;
    margin: 0;
    font-family: inherit;
    font-size: 13.6px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .15s ease;
}
.footer-svc:hover { opacity: .66; }
.footer-svc__line { color: #06C755; }               /* LINE green */
.footer-svc__page { color: var(--primary); }         /* 1 PAGE teal (site title) */
.footer-svc__ai   { color: #F19A4B; }                /* AI bright orange */

/* ── Service bottom sheet ─────────────────────────────────── */
.svc-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 30, 40, .44);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.svc-sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.svc-sheet {
    --sheet-accent: var(--primary);
    --sheet-accent-dark: var(--primary-dark);
    --sheet-accent-soft: var(--primary-light);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 901;
    margin: 0 auto;
    width: min(460px, 100%);
    max-height: 86vh;
    overflow-y: auto;
    padding: 0;
    background: var(--white);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -18px 50px rgba(15, 30, 40, .22);
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.22, .61, .36, 1);
    pointer-events: none;
}
.svc-sheet.is-open { transform: translateY(0); pointer-events: auto; }
.svc-sheet__grip {
    width: 42px;
    height: 5px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #d7e2e0;
}
/* Brand bar：品牌名 + 副標 + 關閉同一列，永遠在最上方 */
.svc-sheet__brandbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 12px 22px;
}
.svc-sheet__brandtext {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.svc-sheet__brandname {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 16.3px;
    font-weight: 800;
    letter-spacing: .01em;
}
.svc-sheet__brandsub {
    color: var(--svc-sheet-sub);
    font-size: 13.1px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: .01em;
}
.svc-sheet__close {
    flex: 0 0 auto;
    margin-top: 1px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f1f5f4;
    color: var(--text-muted);
    font-size: 19.2px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease;
}
.svc-sheet__close:hover { background: #e6edec; }
/* 底線分頁：品牌名（品牌色）+ 服務（黑字） */
.svc-sheet__tabs {
    display: flex;
    gap: 20px;
    padding: 0 22px;
    border-bottom: 1px solid #eef2f1;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.svc-sheet__tabs::-webkit-scrollbar { display: none; }
.svc-sheet__tab {
    position: relative;
    flex: 0 0 auto;
    background: none;
    border: 0;
    padding: 12px 2px;
    font-family: inherit;
    font-size: 14.4px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text);
    cursor: pointer;
}
.svc-sheet__tab-brand { font-weight: 800; }
.svc-sheet__tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--sheet-accent);
    transform: scaleX(0);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
}
.svc-sheet__tab.is-active::after { transform: scaleX(1); }
/* Body：上排（圖＋說明）＋下排（tags＋前往看看） */
.svc-sheet__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 22px 22px;
}
/* 上排：左圖右文 */
.svc-sheet__top {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 0;
}
.svc-sheet__img {
    flex: 0 0 46%;
    width: 46%;
    align-self: center;
    object-fit: contain;
    background: transparent;
}
.svc-sheet__text {
    flex: 1 1 auto;
    min-width: 0;
}
/* 下排：tags 靠左、前往看看 靠右同列 */
.svc-sheet__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
/* Metaphor：粗體黑字 */
.svc-sheet__metaphor {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 16.8px;
    font-weight: 700;
    line-height: 1.5;
}
.svc-sheet__desc {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.7px;
    line-height: 1.8;
}
.svc-sheet__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    min-width: 0;
}
.svc-sheet__chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--sheet-accent-soft);
    color: var(--sheet-accent-dark);
    font-size: 12.2px;
    font-weight: 700;
}
/* CTA：低調小按鈕（不搶眼），有興趣者才點開新分頁 */
.svc-sheet__cta {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    padding: 8px 16px;
    white-space: nowrap;
    border-radius: 10px;
    background: var(--sheet-accent-dark);
    color: #fff;
    font-size: 13.1px;
    font-weight: 700;
    transition: filter .18s ease, transform .18s ease;
}
.svc-sheet__cta:hover { filter: brightness(.92); color: #fff; transform: translateY(-1px); }
/* 已在本服務：同位置改為低調「本服務」徽章（非按鈕、不可點） */
.svc-sheet__cta--self {
    background: #e8eaed;
    color: var(--text-muted);
    cursor: default;
    pointer-events: none;
    font-weight: 800;
    letter-spacing: .04em;
}
.svc-sheet__cta--self:hover { filter: none; color: var(--text-muted); transform: none; }
/* Desktop：置中、加寬、四角圓角的對話框 */
@media (min-width: 600px) {
    .svc-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(600px, 94vw);
        height: 450px;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        border-radius: 20px;
        box-shadow: 0 24px 70px rgba(15, 30, 40, .3);
        transform: translate(-50%, -46%);
        opacity: 0;
        transition: transform .3s cubic-bezier(.22, .61, .36, 1), opacity .3s ease;
    }
    .svc-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; }
    .svc-sheet__grip { display: none; }
    .svc-sheet__brandbar { flex: 0 0 auto; padding: 14px 18px 12px 26px; }
    .svc-sheet__brandname { font-size: 17.9px; }
    .svc-sheet__brandsub { font-size: 14.1px; }
    .svc-sheet__tabs { flex: 0 0 auto; padding: 0 26px; gap: 26px; }
    .svc-sheet__tab { font-size: 15.2px; }
    .svc-sheet__body {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        grid-template-columns: 46% 1fr;
        grid-template-rows: auto 1fr auto;
        grid-template-areas:
            "img  text"
            "img  tags"
            "cta  cta";
        gap: 10px 20px;
        padding: 22px 26px 22px;
    }
    /* 讓 top / foot 的子元素直接進 grid 定位 */
    .svc-sheet__top,
    .svc-sheet__foot { display: contents; }
    .svc-sheet__img { grid-area: img; width: auto; align-self: stretch; min-height: 0; }
    .svc-sheet__text { grid-area: text; align-self: start; margin-top: 10px; }
    /* tags 放右欄、desc 下方 */
    .svc-sheet__chips { grid-area: tags; align-self: start; margin: 0; }
    /* 前往看看 獨立底部一列、跨整個寬度、靠右 */
    .svc-sheet__cta { grid-area: cta; justify-self: end; align-self: end; }
    .svc-sheet__metaphor { font-size: 18.4px; }
    .svc-sheet__desc { font-size: 15.4px; }
}

/* ── 首頁 footer：對齊 xeditor 外觀 ──────────────────────────
   只作用於首頁（.footer--home），不影響 portal 共用的 footer.css。
   用複合選擇器提高權重，蓋過稍後載入的 footer.css。px 單位（本頁 1rem=10px）。 */
.footer.footer--home {
    border-top: 1px solid rgba(226, 232, 240, .9);
    padding: 18px 24px;
    gap: 14px 20px;
}
.footer--home .footer-copy { color: #5A6E7B; }
.footer--home .footer-brand img,
.footer--home .footer-logo img { height: 30px; width: auto; }
/* 服務列與 logo／版權同一列置中，不外推、不換行到下一列 */
.footer--home .footer-services { margin: 0; }

/* ── 首頁聯絡資訊列 ────────────────────────────────────────
   淡綠色整條延伸，內容保持小巧置中，不做卡片框線。 */
.home-contact-bar {
    width: 100%;
    margin: 0;
    overflow-x: auto;
    background: #eef8f3;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.home-contact-bar__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 1.6vw, 22px);
    width: max-content;
    min-width: 100%;
    min-height: 42px;
    padding: 6px 14px;
    color: #5a6e7b;
    font-size: clamp(12px, .95vw, 14px);
    line-height: 1.35;
    white-space: nowrap;
}

.home-contact-bar__inner address {
    margin: 0;
    font-style: normal;
}

.home-contact-bar__inner a {
    color: #159b8a;
    font-weight: 600;
    text-decoration: none;
}

.home-contact-bar__inner a:hover,
.home-contact-bar__inner a:focus-visible {
    color: #087b6d;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .home-contact-bar {
        overflow-x: hidden;
    }

    .home-contact-bar__inner {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        min-width: 0;
        min-height: 0;
        gap: 4px 12px;
        padding: 8px 12px;
        font-size: 12px;
        white-space: normal;
    }

    .home-contact-bar__inner address {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* milligram 的 button:hover/:focus 會塗上灰底(#606c76)，滲進移植的按鈕。
   這裡逐一還原各按鈕在 hover/focus/active 的原樣（載入序在 milligram 之後 → 同權重勝出）。 */
.footer-svc:hover, .footer-svc:focus, .footer-svc:active {
    background: none;
    border-color: transparent;
    color: var(--text);
    outline: 0;
    opacity: .66;
}
.svc-sheet__tab:hover, .svc-sheet__tab:focus, .svc-sheet__tab:active {
    background: none;
    border-color: transparent;
    color: var(--text);
    outline: 0;
}
.svc-sheet__close:hover, .svc-sheet__close:focus, .svc-sheet__close:active {
    background: #e6edec;
    border-color: transparent;
    color: var(--text-muted);
    outline: 0;
}
.svc-sheet__cta:hover, .svc-sheet__cta:focus, .svc-sheet__cta:active {
    background: var(--sheet-accent-dark);
    border-color: transparent;
    color: #fff;
    outline: 0;
}

/* 首頁 footer mobile：對齊 xeditor —— 服務列掉到自己整寬一列、置中、上方分隔線。
   （覆寫 footer.css 在 ≤899.98px 的 .footer{flex-wrap:nowrap} 擠壓） */
@media (max-width: 899.98px) {
    .footer.footer--home {
        flex-wrap: wrap;
        gap: 8px 14px;
    }
    .footer--home .footer-copy { text-align: center; }
    .footer--home .footer-services {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        gap: 10px 24px;
        margin: 12px 0 0;
        padding-top: 14px;
        border-top: 1px solid rgba(226, 232, 240, .9);
    }
}

/* LINE 數位名片／攻略：跨首頁、製作流程與 React 頁面的共用品牌切換器。 */
.brand-switcher {
    position: relative;
    display: inline-flex;
    min-width: 0;
}
.brand-switcher__toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    height: auto !important;
    min-height: 38px;
    margin: 0 !important;
    padding: 4px 7px 4px 0 !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit !important;
    line-height: 1 !important;
    text-transform: none !important;
    cursor: pointer;
}
.brand-switcher__toggle:hover {
    background: rgba(6, 199, 85, 0.07) !important;
}
.brand-switcher__toggle:focus-visible {
    outline: 2px solid rgba(6, 199, 85, 0.45) !important;
    outline-offset: 3px;
}
.brand-switcher__toggle .brand-text-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    transform: translateY(-1px);
}
nav .logo-container .brand-switcher__divider {
    display: block;
    width: 1px;
    height: 22px;
    background: #d6dde2;
    color: transparent !important;
    font-size: 0 !important;
}
nav .logo-container .brand-switcher__section {
    position: relative;
    top: 1px;
    color: #425466 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    white-space: nowrap;
}
nav .logo-container .brand-switcher__caret {
    display: block;
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin: 0 1px 0 0;
    border-right: 1.5px solid #71808c;
    border-bottom: 1.5px solid #71808c;
    color: transparent !important;
    font-size: 0 !important;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}
.brand-switcher.open .brand-switcher__caret {
    transform: rotate(225deg);
}
.brand-switcher__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1200;
    width: 256px;
    overflow: hidden;
    padding: 6px;
    border: 1px solid #e3e8ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(31, 42, 55, 0.16);
}
.brand-switcher.open .brand-switcher__menu {
    display: block;
}
.brand-switcher__menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #263442;
    text-decoration: none;
    text-align: left;
}
.brand-switcher__menu a:hover,
.brand-switcher__menu a:focus-visible {
    background: #f4f8f6;
    outline: none;
}
.brand-switcher__menu a.is-current {
    background: rgba(6, 199, 85, 0.09);
}
nav .logo-container .brand-switcher__menu-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
    color: inherit !important;
    font-size: inherit !important;
    line-height: 1.25;
}
.brand-switcher__menu-copy strong {
    color: #263442;
    font-size: 14px;
    font-weight: 700;
}
.brand-switcher__menu-copy small {
    color: #73808c;
    font-size: 11px;
    font-weight: 400;
}
nav .logo-container .brand-switcher__check {
    color: var(--line-green, #06c755) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}
@media (max-width: 768px) {
    nav .logo-container .brand-text-logo .brand-line {
        flex-shrink: 0;
    }
    nav .logo-container .brand-text-logo .brand-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .brand-switcher__toggle {
        gap: 6px;
        min-height: 34px;
        padding-right: 4px !important;
    }
    nav .logo-container .brand-switcher__divider {
        height: 18px;
    }
    nav .logo-container .brand-switcher__section {
        font-size: 14px !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .brand-switcher__menu {
        width: min(256px, calc(100vw - 24px));
    }
}
