@import url('https://fonts.googleapis.com/css2?family=Afacad:wght@400&display=swap');

:root{--cream:#f2f0e3;--green:#3c605e;--dark:#333;--gray:#616161;--gold:#d9c96b;--light:#efebdf}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--cream);font-family:"Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;color:var(--dark);line-height:1.75;overflow:auto!important;height:auto!important;}
a{text-decoration:none;color:inherit}
img{display:block;max-width:100%}
.page{width:100%;margin:0;background:var(--cream);overflow:hidden}

/* ===== Services content only: header / footer / floating 已抽離 ===== */
.services{position:relative;background:var(--cream);padding:112px 0 64px 9vw;overflow:hidden}
.services-inner{display:grid;grid-template-columns:390px 1fr;gap:70px;width:100%;margin:0}
.section-title{color:var(--green);margin-bottom:34px}
.section-title h1,.section-title h2{margin:0;font-size:45px;letter-spacing:.2em;line-height:1;font-weight:700;white-space:nowrap}
.section-title span{display:block;margin-top:16px;font-family:Afacad,Arial,sans-serif;font-size:31px;letter-spacing:.15em;line-height:1;white-space:nowrap}
.service-copy{font-size:16px;letter-spacing:.13em;line-height:2.05;font-weight:600;color:#555;text-align:justify;padding-right:0}
.service-stage{position:relative;min-width:0;padding-top:22px;overflow:visible}
.service-viewport{width:calc(100vw - 9vw - 390px - 70px);height:550px;overflow:hidden}
.service-track{display:flex;gap:5px;width:max-content;height:545px;align-items:stretch;overflow:visible;transition:transform .45s ease}
.service-card{position:relative;flex:0 0 282px;width:282px;border:0;overflow:hidden;padding:0;background:transparent;cursor:pointer;transition:flex-basis .38s ease,width .38s ease,transform .38s ease;box-shadow:none}
.service-card.active,.service-card:hover{flex-basis:378px;width:378px;transform:translateY(-2px);margin-top:3px;margin-bottom:3px}
.service-card img{width:100%;height:100%;object-fit:cover;transition:.35s ease}
.service-card .normal{display:block}
.service-card .wide{display:none}
.service-card.active .normal,.service-card:hover .normal{display:none}
.service-card.active .wide,.service-card:hover .wide{display:block}
.service-next{position:absolute;right:28px;top:50%;transform:translateY(-50%);width:48px;height:48px;border:0;border-radius:50%;background:rgba(255,255,255,0);display:grid;place-items:center;cursor:pointer;z-index:5;box-shadow:0 3px 10px rgba(0,0,0,0)}
.service-next img{width:50px}

.other{position:relative;padding:0 0 98px 9vw;background:var(--cream);overflow:hidden}
.other-inner{width:100%;margin:0}
.other .section-title{margin-bottom:56px}
.other-wrap{position:relative;padding:0;min-width:1140px;width:100%;overflow:hidden}
.other-track{display:flex;align-items:flex-start;gap:30px;width:max-content;overflow:visible;transition:transform .45s ease;margin-left:45px;margin-right:45px}
.other-item{flex:0 0 148px;text-align:center;cursor:pointer}
.other-icon{width:140px;height:140px;margin:0 auto 17px;border-radius:50%;overflow:hidden;transition:.25s;filter:drop-shadow(0 5px 8px rgba(0,0,0,.08))}
.other-item:hover .other-icon{transform:translateY(-6px) scale(1.04)}
.other-icon img{width:100%;height:100%;object-fit:cover}
.other-item strong{display:block;color:var(--green);font-size:19px;letter-spacing:.05em;line-height:1.2}
.other-item .detail{max-height:0;overflow:hidden;color:var(--green);font-size:12px;line-height:1.65;letter-spacing:.18em;font-weight:700;transition:max-height .3s ease;margin-top:0}
.other-item.active strong{color:var(--green)}
.other-item-active strong:hover{color:#7D733E!important}
.other-item.active .detail{max-height:120px;text-align:left;padding-left:6%}
.other-arrow{position:absolute;top:55px;width:55px;height:55px;border:0;border-radius:50%;background:rgba(255,255,255,0);box-shadow:0 3px 10px rgba(0,0,0,0);cursor:pointer;display:grid;place-items:center;z-index:2}
.other-arrow.left{left:-13px}
.other-arrow.right{right:25px;transform:rotate(180deg)}
.other-arrow img{width:55px}

@media(max-width:900px) and (min-width:521px){
  .services{padding:55px 0 40px 22px}
  .services-inner{display:block}
  .section-title h1,.section-title h2{font-size:30px;letter-spacing:.45em}
  .section-title span{font-size:24px}
  .service-copy{font-size:14px;letter-spacing:.1em;padding-right:22px}
  .service-stage{margin-top:25px}
  .service-track{width:calc(100vw - 22px);height:430px;gap:18px;overflow-x:auto}
  .service-card{flex:0 0 180px;width:180px}
  .service-next{display:none}
  .other{padding:20px 0 70px 22px}
  .other-wrap{padding:0}
  .other-track{gap:28px;width:calc(100vw - 22px);overflow-x:auto}
  .other-arrow{display:none}
}

/* ===== Mobile Services content only ===== */
@media(max-width:520px){
  html,body{width:100%;overflow-x:hidden;background:#f2f0e3}
  .page{width:100%;overflow:hidden;background:#f2f0e3}

  .services{padding:42px 27px 0!important;background:#f2f0e3!important;overflow:visible!important}
  .services-inner{display:block;width:100%;margin:0}
  .services .section-title{position:relative!important;display:block!important;margin:0 0 22px!important;min-height:34px!important;color:#3c605e}
  .services .section-title h1{display:block!important;margin:0!important;font-size:30px!important;letter-spacing:.30em!important;line-height:1!important;font-weight:900!important;color:#3c605e!important;white-space:nowrap}
  .services .section-title h1::after{content:'SERVICES'!important;position:absolute!important;right:0!important;top:6px!important;margin:0!important;font-family:Afacad,Arial,sans-serif!important;font-size:18px!important;font-weight:500!important;letter-spacing:.25em!important;color:#3c605e!important}
  .service-copy{font-size:14px!important;line-height:2.16!important;letter-spacing:.055em!important;font-weight:500!important;color:#2e2e2e!important;text-align:justify!important;padding:0!important;margin:0!important}
  .service-copy br{display:block;content:'';margin-bottom:16px}

  .service-stage{width:100vw!important;margin:44px 0 0 -32px!important;padding:0!important;overflow:hidden!important}
  .service-viewport{width:100vw!important;height:309px!important;overflow:hidden!important;touch-action:pan-y}
  .service-track{scrollbar-width:none;height:319px!important;gap:15px!important;align-items:stretch!important;padding-left:32px!important;padding-right:32px!important;transform:translateX(0)!important;transition:transform .38s ease!important;width:calc(100vw + 4px);overflow:auto}
  .service-track::-webkit-scrollbar{display:none}
  .service-card,.service-card.active,.service-card:hover{flex:0 0 104px!important;width:104px!important;border-radius:999px!important;transform:none!important;margin-top:0!important;margin-bottom:0!important;overflow:hidden;background:transparent}
  .service-card .normal,.service-card .wide,.service-card.active .normal,.service-card:hover .normal{display:block!important;width:100%;height:100%;object-fit:contain}
  .service-card .wide,.service-card.active .wide,.service-card:hover .wide{display:none!important}
  .service-card img{width:104px!important;height:309px!important;object-fit:contain!important}
  .service-next{display:grid!important;right:18px!important;top:154px!important;width:30px!important;height:30px!important;z-index:8!important;background:transparent!important;box-shadow:none!important;border-radius:50%;transform:none!important;padding:0}
  .service-next img{width:30px!important;height:30px!important;content:url('https://yi-tian.tw/assets/mobile-services/服務項目按鍵01.png')}
  .service-stage:before{content:'';position:absolute;left:18px!important;top:140px!important;width:30px!important;height:30px!important;background:url('https://yi-tian.tw/assets/mobile-services/服務項目按鍵02.png') center/contain no-repeat;z-index:8;pointer-events:none}

  .service-card:nth-child(1) .normal{content:url('https://yi-tian.tw/assets/mobile-services/service-tax.svg')}
  .service-card:nth-child(2) .normal{content:url('https://yi-tian.tw/assets/mobile-services/service-transfer.svg')}
  .service-card:nth-child(3) .normal{content:url('https://yi-tian.tw/assets/mobile-services/service-asset.svg')}
  .service-card:nth-child(4) .normal{content:url('https://yi-tian.tw/assets/mobile-services/service-will.svg')}
  .service-card:nth-child(5) .normal{content:url('https://yi-tian.tw/assets/mobile-services/service-trust.svg')}

  .other{padding:64px 25px 76px!important;background:#f2f0e3!important;overflow:hidden}
  .other-inner{width:100%;margin:0}
  .other .section-title{display:block;text-align:center;margin:0 0 38px!important;color:#3c605e}
  .other .section-title h2{font-size:30px!important;letter-spacing:.32em!important;line-height:1;font-weight:900;margin:0}
  .other .section-title h2::after{content:'OTHER SERVICES';display:block;font-family:Afacad,Arial,sans-serif;font-size:18px!important;font-weight:500;letter-spacing:.30em!important;margin-top:15px!important}
  .other-wrap{min-width:320px;padding:0;overflow:visible}
  .other-track{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:34px 28px!important;width:100%!important;transform:none!important;transition:none!important;margin-left:0;margin-right:0}
  .other-track .other-item:nth-child(n+7){display:none}
  .other-item{flex:none;width:auto;text-align:center;cursor:default}
  .other-icon{width:90px!important;height:90px!important;margin:0 auto 12px!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;filter:none!important;overflow:visible!important}
  .other-icon img{display:block!important;width:90px!important;height:90px!important;object-fit:contain!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;filter:none!important}
  .other-item:nth-child(1) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/分割合併.png')}
  .other-item:nth-child(2) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/用地變更.png')}
  .other-item:nth-child(3) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/特殊案件.png')}
  .other-item:nth-child(4) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/買賣移轉.png')}
  .other-item:nth-child(5) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/贈與繼承.png')}
  .other-item:nth-child(6) .other-icon img{content:url('https://yi-tian.tw/assets/mobile-services/保存登記.png')}
  .other-item:hover .other-icon{transform:none}
  .other-item strong{font-size:13px!important;line-height:1.35!important;letter-spacing:.08em!important;color:#3c605e!important;font-weight:800!important}
  .other-item .detail{display:none!important}
  .other-arrow{display:none!important}
}

/* ===== Desktop other services hover fix ===== */
@media(min-width:521px){
  .other-item .detail{
    max-height:0!important;
    overflow:hidden!important;
    margin-top:0!important;
    padding-left:0!important;
    transition:max-height .28s ease, margin-top .28s ease, padding-left .28s ease!important;
  }
  .other-item:hover strong,
  .other-item.active strong{
    color:#7D733E!important;
  }
  .other-item:hover .detail,
  .other-item.active .detail{
    max-height:140px!important;
    margin-top:8px!important;
    text-align:left!important;
    padding-left:6%!important;
  }
  .other-item:not(:hover):not(.active) .detail{
    max-height:0!important;
    margin-top:0!important;
    padding-left:0!important;
  }
  .other-item:not(:hover):not(.active) strong{
    color:#3C605E!important;
  }
  .other-item .detail ul{
    margin:0!important;
    padding-left:2.5em!important;
  }
  .other-item .detail li{
    color:#3C605E!important;
    font-size:14px!important;
    line-height:1.7!important;
    letter-spacing:.08em!important;
    font-weight:700!important;
  }
}
