:root{--tw-blue:#071849;--tw-blue-2:#111f63;--tw-orange:#f33d00;--tw-cream:#fff0bc;--tw-red:#ef4a31;--tw-text:#142033}
*{box-sizing:border-box}
html{background:#04102f;scroll-behavior:smooth}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"PingFang TC","Noto Sans TC","Microsoft JhengHei",Arial,sans-serif;color:var(--tw-text)}
a{text-decoration:none;color:inherit}button{font:inherit;cursor:pointer}
.tw-front-body{min-height:100vh;background:radial-gradient(circle at 50% 20%,#0f2d78 0,#06143f 45%,#02091e 100%)}
.tw-top-banner-shell{position:relative;width:min(1170px,100%);margin:0 auto;overflow:hidden;background:#0b1747;box-shadow:0 0 46px rgba(0,0,0,.38)}.tw-top-banner-shell .slides{border-radius:0;box-shadow:none}
.tw-site-shell{position:relative;width:min(1170px,100%);min-height:100vh;margin:0 auto;overflow:hidden;background-color:#101d5c;background-image:var(--tw-site-background);background-repeat:no-repeat;background-position:center top;background-size:100% auto;box-shadow:0 0 46px rgba(0,0,0,.38)}
.tw-hero{position:relative;min-height:300px;padding:0 34px;color:#fff}
.tw-header{height:82px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:26px}
.tw-logo-link{display:block;width:94px;min-width:94px}.tw-site-logo{display:block;width:100%;height:auto;max-height:70px;object-fit:contain;filter:drop-shadow(0 2px 4px rgba(0,0,0,.28))}
.tw-main-nav{display:flex;align-items:center;gap:26px;font-weight:800;font-size:19px;text-shadow:0 2px 5px rgba(0,0,0,.65)}.tw-main-nav a{position:relative;padding:12px 0}.tw-main-nav a::after{content:"";position:absolute;left:50%;right:50%;bottom:4px;height:2px;background:#ffd54b;transition:.2s}.tw-main-nav a:hover::after,.tw-main-nav a.active::after{left:0;right:0}
.tw-header-right{display:flex;align-items:center;justify-content:flex-end;min-width:185px}
.tw-today{font-size:16px;font-weight:700;white-space:nowrap;text-shadow:0 2px 5px rgba(0,0,0,.6)}
.tw-next-panel{position:absolute;right:40px;top:78px;width:350px;text-align:center}.tw-next-title{display:flex;align-items:center;justify-content:center;gap:12px;font-size:20px;font-weight:800}.tw-next-title strong{display:inline-flex;align-items:center;gap:8px;padding:6px 18px;border-radius:999px;background:var(--tw-cream);color:#15213c;font-size:18px;text-shadow:none}.tw-next-title em{font-style:normal;color:#ef4a31;font-size:20px}
.tw-countdown-wrap{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:10px}.tw-countdown-wrap>b{font-size:32px}.tw-countdown-box{display:grid;place-items:center;width:83px;height:68px;border-radius:8px;background:#0b242c;border:1px solid rgba(255,255,255,.18);box-shadow:inset 0 -5px 0 rgba(0,0,0,.13),0 5px 10px rgba(0,0,0,.18)}.tw-countdown-box span{font-family:Impact,"Arial Black",sans-serif;font-size:44px;line-height:1;color:#ffe716;letter-spacing:2px}
.tw-current-draw{position:relative;min-height:258px;background:var(--tw-orange);color:#fff;clip-path:ellipse(86% 62% at 50% 50%);margin:-18px -115px 0;padding:34px 145px 28px}.tw-current-inner{width:760px;max-width:100%;margin:0 auto;text-align:center}.tw-current-issue{display:inline-flex;align-items:center;justify-content:center;padding:7px 30px;border-radius:999px;background:var(--tw-cream);color:#13203a;font-size:19px;font-weight:900}.tw-current-issue span{margin:0 4px;color:#ef4a31}.tw-draw-ball-area{min-height:104px;display:grid;place-items:center;margin-top:12px}.draw-balls-v3{display:flex;align-items:flex-start;justify-content:center;gap:12px;flex-wrap:nowrap}.draw-number-item{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:62px}.draw-ball{position:relative;display:block;width:64px;height:64px;font-weight:900;font-size:24px;color:#16202b;text-shadow:0 1px 0 #fff}.ball-image{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 5px 4px rgba(0,0,0,.25))}.ball-number{position:absolute;z-index:2;left:50%;width:100%;line-height:1;text-align:center;transform:translate(-50%,-50%)}.draw-ball-red .ball-number,.tw-mini-ball-red .ball-number{top:46.2%}.draw-ball-blue .ball-number,.tw-mini-ball-blue .ball-number{top:47.4%}.draw-ball-green .ball-number,.tw-mini-ball-green .ball-number{top:44.5%}.draw-ball-pending{border-radius:50%;background:#e9eef3!important;color:#39485a;box-shadow:inset 0 0 0 5px #fff;filter:none}.draw-ball-pending>.ball-number{top:50%}.draw-attribute{font-size:19px;font-weight:900;color:#fff;white-space:nowrap}.draw-plus{align-self:center;margin:18px -6px 0 0;font-size:29px;font-weight:900;color:#fff}.empty{padding:18px;color:rgba(255,255,255,.85);font-weight:700}
.tw-lower-content{position:relative;min-height:760px;padding:16px 44px 32px;color:#fff;background:linear-gradient(to bottom,rgba(10,25,81,.35),rgba(7,18,64,.68) 32%,rgba(4,10,35,.9) 100%)}
.tw-lower-actions{display:flex;align-items:center;justify-content:center;gap:18px;flex-wrap:wrap;margin:2px auto 14px}.tw-lower-actions a{padding:8px 25px;border:1px solid #fff;border-radius:4px;background:rgba(5,18,65,.22);font-size:16px;font-weight:800;transition:.2s}.tw-lower-actions a:hover{background:#fff;color:#17337a}
.tw-notice{display:flex;align-items:center;gap:9px;width:min(900px,100%);margin:0 auto 12px;padding:8px 13px;border-radius:8px;background:rgba(2,11,44,.66);border:1px solid rgba(255,255,255,.18);overflow:hidden}.tw-notice-icon{color:#ffd641;font-size:11px}.tw-notice .marquee{position:relative;overflow:hidden;flex:1;white-space:nowrap}.marquee-single-v33{display:inline-block;min-width:100%;padding-left:100%;animation:marquee-single-v33 var(--notice-duration,10s) linear infinite;will-change:transform}.marquee-single-v33 span{display:inline-block;padding-right:24px}.notice-led-v33 .marquee{position:relative;overflow:hidden;white-space:nowrap}@keyframes marquee-single-v33{from{transform:translate3d(0,0,0)}to{transform:translate3d(-100%,0,0)}}
.tw-recent-section{width:min(1080px,100%);margin:0 auto}.tw-recent-section>h2{margin:0 0 16px;text-align:center;color:#fff;font-size:26px;text-shadow:0 3px 8px rgba(0,0,0,.55)}.tw-recent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.tw-history-card{min-width:0;padding:14px 20px 12px;border-radius:9px;background:rgba(255,255,255,.97);color:#162033;box-shadow:0 8px 24px rgba(0,0,0,.18)}.tw-history-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.tw-history-head strong{display:inline-flex;padding:5px 28px;border-radius:999px;background:#fff0bd;font-size:18px}.tw-history-head em{font-style:normal;color:#ef4a31}.tw-history-head time{font-size:14px;color:#293544}.tw-mini-balls{display:flex;align-items:flex-start;justify-content:center;gap:8px;white-space:nowrap}.tw-mini-item{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:40px}.tw-mini-ball{position:relative;display:block;width:38px;height:38px;font-size:15px;font-weight:900;color:#17212c}.tw-mini-ball .ball-image{filter:drop-shadow(0 2px 2px rgba(0,0,0,.2))}.tw-mini-item small{font-size:16px;color:#253141}.tw-mini-plus{align-self:center;margin:8px -2px 0;font-size:24px;font-weight:900}.tw-more-history{display:block;width:max-content;margin:17px auto 0;padding:9px 24px;border:1px solid rgba(255,255,255,.7);border-radius:6px;background:rgba(5,15,55,.55);font-weight:800}.tw-empty-card{padding:24px;text-align:center;border-radius:10px;background:rgba(255,255,255,.94);color:#4b5563}
.tw-banner-section{width:min(1020px,100%);margin:28px auto 0}.banner-slider{width:100%}.slides{position:relative;overflow:hidden;border-radius:12px;background:#0b1747;box-shadow:0 10px 34px rgba(0,0,0,.28);aspect-ratio:2048/682}.slide{position:absolute;inset:0;display:block;opacity:0;visibility:hidden;transition:opacity .45s ease}.slide.active{opacity:1;visibility:visible}.slide img{display:block;width:100%;height:100%;object-fit:cover}
.tw-gallery-preview{width:min(1020px,100%);margin:28px auto 0}.tw-gallery-preview-direct{margin-top:0}.tw-section-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.tw-section-heading h2{margin:0;font-size:24px}.tw-section-heading a{padding:7px 13px;border:1px solid rgba(255,255,255,.5);border-radius:6px}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.template-card{overflow:hidden;border-radius:10px;background:#fff;color:#172033;box-shadow:0 8px 22px rgba(0,0,0,.18)}.image-open{display:block;width:100%;padding:0;border:0;background:#f3f5f8}.template-card img{display:block;width:100%;height:auto}.template-name{padding:8px 10px;text-align:center;font-weight:800}.tw-footer{display:flex;align-items:center;justify-content:center;gap:14px;margin:30px 0 0;padding:20px 0 2px;border-top:1px solid rgba(255,255,255,.22);font-weight:700}.tw-footer small{opacity:.75;font-weight:400}
.image-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.82)}.image-modal.hidden{display:none}.image-modal-inner{position:relative;display:flex;flex-direction:column;width:min(820px,100%);max-height:94vh;border-radius:10px;background:#fff;color:#172033;overflow:hidden}.image-modal-title{padding:13px 70px 13px 16px;font-weight:900}.close-btn{position:absolute;right:11px;top:8px;padding:6px 13px;border:0;border-radius:999px;background:#eef2f6}.image-modal-scroll{overflow:auto;padding:10px;background:#edf1f5}.image-modal-scroll img{display:block;width:100%;height:auto}
/* 內頁共用 */
.tw-inner-shell{width:min(1170px,100%);min-height:100vh;margin:0 auto;background:#0d1d5b var(--tw-site-background) center top/100% auto no-repeat;color:#fff}.tw-inner-header{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:24px;padding:8px 30px;background:rgba(2,12,43,.55);backdrop-filter:blur(5px)}.tw-inner-header .tw-logo-link{width:85px;min-width:85px}.tw-inner-title{margin:0;text-align:center;font-size:28px}.tw-back-link{padding:8px 14px;border:1px solid rgba(255,255,255,.65);border-radius:7px;font-weight:800}.tw-inner-main{padding:28px 34px 50px;background:linear-gradient(rgba(8,21,74,.52),rgba(2,8,31,.94));min-height:calc(100vh - 82px)}.tw-history-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;max-width:1080px;margin:0 auto}.tw-history-list .tw-history-card{padding:17px 20px}.tw-history-list .tw-mini-ball{width:44px;height:44px;font-size:17px}.tw-history-list .tw-mini-item{min-width:47px}.tw-history-list .tw-mini-item small{font-size:17px}.tw-page-empty{max-width:720px;margin:40px auto;padding:28px;border-radius:10px;background:rgba(255,255,255,.95);color:#475569;text-align:center}.tw-gallery-head{text-align:center;margin:0 0 20px}.tw-gallery-head h1{margin:0 0 6px;font-size:30px}.tw-gallery-head p{margin:0;opacity:.8}.tw-gallery-banner{max-width:1000px;margin:0 auto 24px}.tw-gallery-grid{column-count:2;column-gap:14px;max-width:1040px;margin:0 auto}.tw-gallery-grid .template-card{break-inside:avoid;margin:0 0 14px}
@media(max-width:820px){
  .tw-site-shell{background-size:100% auto}
  .tw-hero{min-height:255px;padding:0 16px}.tw-header{height:76px;grid-template-columns:95px 1fr}.tw-logo-link{width:95px;min-width:95px}.tw-site-logo{max-height:68px}.tw-main-nav{display:none}.tw-header-right{min-width:0}.tw-today{justify-self:end;font-size:14px}
  .tw-next-panel{right:18px;top:76px;width:330px;max-width:calc(100% - 36px)}.tw-next-title{font-size:18px}.tw-next-title strong{padding:6px 16px}.tw-countdown-box{width:70px;height:59px}.tw-countdown-box span{font-size:38px}.tw-countdown-wrap{gap:9px}
  .tw-current-draw{min-height:246px;margin:-8px -58px 0;padding:28px 70px 24px;clip-path:ellipse(92% 60% at 50% 50%)}.tw-current-inner{width:100%}.draw-balls-v3{gap:6px}.draw-number-item{min-width:45px}.draw-ball{width:49px;height:49px;font-size:19px}.draw-attribute{font-size:17px}.draw-plus{font-size:24px;margin:13px -4px 0}
  .tw-lower-content{padding:14px 16px 28px}.tw-recent-grid{grid-template-columns:1fr}.tw-history-card{padding:13px 15px}.tw-mini-balls{gap:5px}.tw-mini-item{min-width:36px}.tw-mini-ball{width:35px;height:35px;font-size:14px}.tw-mini-item small{font-size:15px}.tw-mini-plus{font-size:21px}.tw-history-head strong{padding:5px 23px}.tw-recent-section>h2{font-size:23px}.tw-banner-section{margin-top:22px}.tw-gallery-preview{margin-top:22px}
  .tw-inner-header{grid-template-columns:75px 1fr auto;padding:7px 12px;gap:10px}.tw-inner-header .tw-logo-link{width:72px;min-width:72px}.tw-inner-title{font-size:21px}.tw-back-link{padding:7px 9px;font-size:13px}.tw-inner-main{padding:20px 12px 40px}.tw-history-list{grid-template-columns:1fr}.tw-gallery-grid{column-gap:9px}.tw-gallery-grid .template-card{margin-bottom:9px}
}
@media(max-width:430px){
  .tw-hero{min-height:260px;padding:0 10px}.tw-header{grid-template-columns:92px 1fr;height:72px}.tw-logo-link{width:92px;min-width:92px}.tw-header-right{min-width:0}.tw-today{font-size:13px;letter-spacing:-.4px}.tw-next-panel{top:72px;right:10px;width:calc(100% - 20px)}.tw-next-title{gap:8px}.tw-next-title>span{font-size:17px}.tw-next-title strong{font-size:17px;padding:5px 14px}.tw-next-title em{font-size:19px}.tw-countdown-wrap{margin-top:14px;gap:7px}.tw-countdown-wrap>b{font-size:26px}.tw-countdown-box{width:64px;height:58px}.tw-countdown-box span{font-size:37px}
  .tw-current-draw{min-height:238px;margin:-2px -45px 0;padding:25px 53px 21px}.tw-current-issue{padding:6px 24px;font-size:18px}.tw-draw-ball-area{min-height:91px;margin-top:8px}.draw-balls-v3{gap:2px;width:100%}.draw-number-item{min-width:40px;flex:1}.draw-ball{width:45px;height:45px;font-size:18px}.draw-attribute{font-size:16px}.draw-plus{font-size:21px;margin:13px -5px 0}
  .tw-lower-content{padding:13px 10px 24px}.tw-notice{font-size:13px}.tw-history-card{padding:12px 10px}.tw-history-head{margin-bottom:8px}.tw-history-head strong{font-size:17px;padding:5px 20px}.tw-history-head time{font-size:13px}.tw-mini-balls{gap:2px}.tw-mini-item{min-width:34px;flex:1}.tw-mini-ball{width:34px;height:34px;font-size:13px}.tw-mini-item small{font-size:15px}.tw-mini-plus{font-size:20px;margin-left:-3px;margin-right:-3px}.tw-footer{flex-direction:column;gap:4px}.template-grid{gap:8px}.template-name{font-size:13px;padding:7px 5px}.tw-gallery-grid{column-count:2}
}
@media(max-width:350px){.draw-ball{width:40px;height:40px;font-size:16px}.draw-number-item{min-width:36px}.draw-attribute{font-size:14px}.tw-mini-ball{width:30px;height:30px}.tw-mini-item small{font-size:13px}}




/* v0.4.9：圖片與文字原子顯示、球號精準置中、文字模板資料庫 */
.tw-gallery-preview-direct{margin-top:0!important}
.tw-text-template-list{display:grid;gap:14px;max-width:920px;margin:0 auto}
.tw-text-template-card{overflow:hidden;border-radius:10px;background:rgba(255,255,255,.97);color:#172033;box-shadow:0 8px 24px rgba(0,0,0,.18)}
.tw-text-template-card>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;border-bottom:1px solid #e8edf2;background:#fff4cd}
.tw-text-template-card h2{margin:0;font-size:20px}.tw-text-template-card time{font-size:13px;color:#647184;white-space:nowrap}
.tw-text-template-content{padding:18px;font-size:17px;line-height:1.85;white-space:normal;word-break:break-word}
@media(max-width:540px){.tw-text-template-card>header{align-items:flex-start;flex-direction:column}.tw-text-template-content{padding:14px;font-size:16px}}

/* v0.4.9：期號左對齊首球，手機端功能按鈕移入藍色區域 */
.tw-site-logo{background:transparent!important}
.tw-logo-link{background:transparent!important}
.tw-current-draw{
  min-height:262px;
  margin:0;
  padding:30px 34px 24px;
  background:transparent!important;
  clip-path:none!important;
}
.tw-current-inner{position:relative;z-index:1;width:max-content;max-width:100%;margin:0 auto;text-align:left}
.tw-current-issue{width:max-content;margin-left:0}
.tw-draw-ball-area{place-items:start}
.draw-balls-v3{width:max-content;max-width:100%;justify-content:flex-start}
.tw-lower-content{margin:0}

@media(max-width:820px){
  /* 固定放大主背景，讓手機端藍色區、橙紅色帶與內容位置保持一致。 */
  .tw-site-shell{
    background-size:960px auto;
    background-position:center top;
  }
  .tw-hero{min-height:231px}
  .tw-current-draw{
    min-height:158px;
    margin:0;
    padding:11px 12px 8px;
  }
  .tw-lower-content{padding-top:70px}
  .tw-lower-actions{gap:8px;margin:0 auto 12px}
  .tw-lower-actions a{padding:7px 12px;font-size:13px}
  .draw-number-item{flex:0 0 auto}
  .tw-current-issue{padding:4px 22px;font-size:17px}
  .tw-draw-ball-area{min-height:72px;margin-top:4px}
  .draw-ball{width:43px;height:43px;font-size:17px}
  .draw-attribute{font-size:15px;line-height:1.1}
  .draw-number-item{gap:3px;min-width:39px}
  .draw-plus{font-size:20px;margin:11px -5px 0}
}

@media(max-width:430px){
  .tw-site-shell{background-size:960px auto;background-position:center top}
  .tw-hero{min-height:231px}
  .tw-current-draw{min-height:158px;margin:0;padding:11px 7px 8px}
  .tw-lower-content{padding:70px 10px 24px}
  .draw-balls-v3{gap:1px}
  .draw-number-item{min-width:38px}
  .draw-ball{width:42px;height:42px;font-size:17px}
}

/* 圖片正式資料為空時自動顯示臨時圖片樣板 */
.tw-template-showcase{width:min(1020px,100%);margin:18px auto 0}
.tw-demo-notice{margin:0 0 10px;padding:9px 12px;border:1px dashed rgba(255,255,255,.55);border-radius:8px;background:rgba(2,15,60,.58);font-size:13px;color:#fff6b7}
.tw-template-showcase-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,.8fr);gap:18px;align-items:start}
.tw-template-module{min-width:0;padding:16px;border-radius:14px;background:rgba(255,255,255,.97);color:#172033;box-shadow:0 12px 32px rgba(0,0,0,.24)}
.tw-module-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px}
.tw-module-heading h2{display:flex;align-items:center;gap:9px;margin:0;color:#2764df;font-size:23px}.tw-module-heading h2 small{padding:2px 7px;border-radius:999px;background:#eef3ff;color:#5673c9;font-size:11px;font-weight:800}
.tw-module-heading a{color:#4b6fe8;font-size:14px;font-weight:800}
.tw-module-icon{display:grid;place-items:center;width:28px;height:28px;border:2px solid currentColor;border-radius:5px;font-size:15px}
.tw-image-thumb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tw-image-thumb{display:block;min-width:0;overflow:hidden;border:1px solid #e0e5ec;border-radius:9px;background:#f5f7fa;box-shadow:0 4px 12px rgba(17,31,58,.08)}
.tw-image-thumb img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;object-position:top center;background:#fff}
.tw-image-thumb span{display:block;padding:8px 7px;text-align:center;color:#26344a;font-size:14px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tw-text-module .tw-module-heading h2{color:#7543e5}
.tw-best-text-card{display:block;border:1px solid #dcd5f2;border-radius:10px;background:linear-gradient(180deg,#fff,#faf8ff);color:#26344a;overflow:hidden}
.tw-best-text-top{display:flex;align-items:center;gap:9px;padding:14px;border-bottom:1px solid #ebe6f6}
.tw-best-text-top strong{color:#6d42d7;font-size:19px}
.tw-streak-badge{display:inline-flex;align-items:center;padding:4px 9px;border-radius:999px;background:#641b9d;color:#fff;font-size:12px;font-weight:900;white-space:nowrap;vertical-align:middle;margin-right:8px}
.tw-best-text-content{padding:15px;font-size:15px;line-height:1.85;white-space:normal;word-break:break-word}
.tw-best-text-card time{display:block;padding:0 15px 14px;color:#8a93a2;font-size:12px}
@media(max-width:820px){
  .tw-template-showcase-grid{grid-template-columns:1fr}
  .tw-template-module{padding:13px}
  .tw-module-heading h2{font-size:21px}
}
@media(max-width:430px){
  .tw-template-showcase{margin-top:12px}
  .tw-template-showcase-grid{gap:12px}
  .tw-template-module{padding:10px;border-radius:10px}
  .tw-image-thumb-grid{gap:8px}
  .tw-image-thumb img{aspect-ratio:1/1.18}
  .tw-image-thumb span{padding:6px 5px;font-size:12px}
  .tw-best-text-top{align-items:flex-start;flex-direction:column;padding:12px}
  .tw-best-text-content{padding:12px;font-size:15px}
}

/* v0.6.1：文字模板較明亮藍紫色調（v0.7.2 由後方白底樣式覆蓋） */
.tw-best-text-link{display:block;color:inherit;text-decoration:none}.tw-best-text-link:hover{transform:translateY(-1px)}
.kh-text-library{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start;max-width:1080px;margin:0 auto}
.kh-text-card{overflow:hidden;border:1px solid rgba(255,122,142,.82);border-radius:10px;background:linear-gradient(155deg,rgba(31,80,165,.88),rgba(35,48,126,.84));color:#f8fbff;box-shadow:0 10px 28px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.12);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.kh-text-card-title{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:linear-gradient(90deg,rgba(151,29,58,.9),rgba(51,91,177,.9));border-bottom:1px solid rgba(255,255,255,.24)}
.kh-text-card-title h2{margin:0;color:#ffe67d;font-size:20px;font-weight:900;letter-spacing:.5px}.kh-streak{flex:0 0 auto;padding:3px 9px;border-radius:999px;background:#fff0b8;color:#a21d1d;font-size:13px;font-weight:900}
.kh-text-rows{display:grid}.kh-text-row{padding:9px 12px 10px;border-bottom:1px solid rgba(255,255,255,.19);background:rgba(255,255,255,.025)}.kh-text-row:nth-child(even){background:rgba(255,255,255,.065)}.kh-text-row:last-child{border-bottom:0}
.kh-text-row-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:3px;font-size:18px;font-weight:900;line-height:1.35}.kh-text-row-head strong{color:#ffe08a}.kh-text-row-head span{color:#ff8f8f;white-space:nowrap}.kh-text-row.status-hit .kh-text-row-head span{color:#ffe45d}.kh-text-row.status-pending .kh-text-row-head span{color:#b7d7ff}
.kh-text-row-body{color:#f9fbff;font-size:18px;font-weight:800;line-height:2.15;text-align:center;word-break:break-word}.kh-text-row-body mark{padding:1px 5px;border-radius:4px;background:#ffe94f;color:#d20e0e;font-weight:950;box-shadow:0 0 0 1px rgba(255,255,255,.45)}
.kh-number-cloud{letter-spacing:.5px}
.kh-style-circle{border-width:2px;border-color:#ff5353}.kh-style-circle .kh-text-row{margin:7px;border:2px solid rgba(255,91,91,.78);border-radius:10px;background:rgba(255,255,255,.07)}
.kh-style-category{border-color:#f2a43a}.kh-style-category .kh-text-card-title{background:linear-gradient(90deg,rgba(128,68,0,.92),rgba(17,52,104,.82))}.kh-style-category .kh-text-row-head strong,.kh-style-category .kh-text-row-head span{color:#ffc86b}.kh-style-category .kh-text-row{background:rgba(255,186,73,.045)}
.kh-style-tricolor{border-color:#9f1428}.kh-style-tricolor .kh-text-card-title{background:#7f0d24}.kh-style-tricolor .kh-text-card-title h2{color:#ffe34f}
.kh-style-killzone{border:2px solid #111;box-shadow:inset 0 0 0 2px #a20d1f,0 10px 28px rgba(0,0,0,.3)}.kh-style-killzone .kh-text-card-title{background:#720918}.kh-style-killzone .kh-text-row-head strong,.kh-style-killzone .kh-text-row-head span{color:#ffe75b}
.kh-text-card.is-compact .kh-text-card-title{padding:9px 12px}.kh-text-card.is-compact .kh-text-card-title h2{font-size:19px}.kh-text-card.is-compact .kh-text-row{padding:7px 10px}.kh-text-card.is-compact .kh-text-row-head,.kh-text-card.is-compact .kh-text-row-body{font-size:16px}.kh-text-card.is-compact .kh-text-row-body{line-height:1.85}
.tw-text-module .kh-text-card{background:linear-gradient(155deg,rgba(40,96,190,.94),rgba(52,55,146,.91));border-color:rgba(255,139,157,.9)}
@media(max-width:820px){.kh-text-library{grid-template-columns:1fr}.kh-text-row-body{line-height:2.05}.kh-text-card-title h2{font-size:19px}.kh-text-row-head,.kh-text-row-body{font-size:17px}}
@media(max-width:430px){.kh-text-card-title{padding:9px 10px}.kh-text-row{padding:8px 9px}.kh-text-row-head{font-size:16px}.kh-text-row-body{font-size:16px;line-height:2.05}.kh-streak{font-size:12px;padding:3px 7px}.kh-text-card.is-compact .kh-text-row-head,.kh-text-card.is-compact .kh-text-row-body{font-size:15px}.kh-text-card.is-compact .kh-text-row-body{line-height:1.8}}


/* v0.7.2：圖庫管家／資料庫頁首改為最新開獎號碼；文字模板改為白底 */
.tw-inner-draw-summary{width:min(920px,100%);margin:0 auto 24px;padding:4px 12px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}
.tw-inner-draw-summary .tw-current-issue{margin:0 auto;padding:6px 28px;background:#fff0bd;color:#172033;box-shadow:0 5px 16px rgba(0,0,0,.18)}
.tw-inner-draw-summary .tw-draw-ball-area{width:100%;min-height:92px;margin:0;place-items:center}
.tw-inner-draw-summary .draw-balls-v3{width:max-content;max-width:100%;justify-content:center;gap:10px}
.tw-inner-draw-summary .draw-number-item{flex:0 0 auto;min-width:58px}
.tw-inner-draw-summary .draw-ball{width:58px;height:58px;font-size:22px}
.tw-inner-draw-summary .draw-attribute{font-size:18px;text-shadow:0 2px 4px rgba(0,0,0,.35)}
.tw-inner-draw-summary .draw-plus{margin:16px -5px 0;font-size:27px}
.tw-inner-draw-empty{margin:0 auto}

.kh-text-card{background:rgba(255,255,255,.98);color:#1f2937;border-color:#e34b60;box-shadow:0 10px 28px rgba(0,0,0,.2);backdrop-filter:none;-webkit-backdrop-filter:none}
.kh-text-card-title{background:linear-gradient(90deg,#fff5f3,#fffaf0);border-bottom:1px solid #efc7cd}
.kh-text-card-title h2{color:#8f1937;text-shadow:none}
.kh-streak{background:#fff0b8;color:#9f1c1c;border:1px solid #f1d58b}
.kh-text-row{background:#fff;border-bottom:1px solid #dfe5ee}
.kh-text-row:nth-child(even){background:#f8fafc}
.kh-text-row-head strong{color:#9a3412}
.kh-text-row-head span{color:#cf334f}
.kh-text-row.status-hit .kh-text-row-head span{color:#b77900}
.kh-text-row.status-pending .kh-text-row-head span{color:#64748b}
.kh-text-row-body{color:#1f2937;text-shadow:none}
.kh-text-row-body mark{background:#ffe45c;color:#d20e0e;box-shadow:0 0 0 1px #e5c735}
.kh-style-circle{border-color:#ff5353}
.kh-style-circle .kh-text-row{background:#fff;border-color:#ff6666}
.kh-style-category{border-color:#e79a32}
.kh-style-category .kh-text-card-title{background:linear-gradient(90deg,#fff2df,#fffaf0)}
.kh-style-category .kh-text-row-head strong,.kh-style-category .kh-text-row-head span{color:#ad5d00}
.kh-style-category .kh-text-row{background:#fffdf8}
.kh-style-tricolor{border-color:#9f1428}
.kh-style-tricolor .kh-text-card-title{background:#fff1f3}
.kh-style-tricolor .kh-text-card-title h2{color:#8d0f27}
.kh-style-killzone{background:#fff;border:2px solid #111;box-shadow:inset 0 0 0 2px #a20d1f,0 10px 28px rgba(0,0,0,.24)}
.kh-style-killzone .kh-text-card-title{background:#fff0f2}
.kh-style-killzone .kh-text-card-title h2{color:#720918}
.kh-style-killzone .kh-text-row-head strong,.kh-style-killzone .kh-text-row-head span{color:#9f172a}
.tw-text-module .kh-text-card{background:#fff;border-color:#e34b60}

@media(max-width:640px){
  .tw-inner-draw-summary{margin-bottom:18px;padding:0 0 12px;gap:5px}
  .tw-inner-draw-summary .tw-current-issue{padding:5px 22px;font-size:17px}
  .tw-inner-draw-summary .tw-draw-ball-area{min-height:76px}
  .tw-inner-draw-summary .draw-balls-v3{gap:1px;width:100%;justify-content:center}
  .tw-inner-draw-summary .draw-number-item{min-width:39px;flex:0 0 auto}
  .tw-inner-draw-summary .draw-ball{width:42px;height:42px;font-size:17px}
  .tw-inner-draw-summary .draw-attribute{font-size:15px}
  .tw-inner-draw-summary .draw-plus{font-size:20px;margin:11px -4px 0}
}

/* v0.7.2：僅「臺灣圖庫管家／臺灣資料庫」的開獎號碼向下滑動時置頂 */
.tw-sticky-draw{
  position:sticky;
  top:0;
  z-index:90;
  isolation:isolate;
  transition:background-color .2s ease,box-shadow .2s ease,border-color .2s ease,padding .2s ease,border-radius .2s ease;
}
.tw-sticky-draw.is-stuck{
  width:min(980px,calc(100% + 18px));
  margin-left:auto;
  margin-right:auto;
  padding:8px 14px 10px;
  border:1px solid rgba(255,255,255,.22);
  border-top:0;
  border-radius:0 0 14px 14px;
  background:linear-gradient(180deg,rgba(4,24,87,.96),rgba(8,40,113,.91));
  box-shadow:0 12px 28px rgba(0,0,0,.36);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.tw-sticky-draw.is-stuck .tw-current-issue{
  padding:4px 22px;
  font-size:16px;
  box-shadow:0 3px 10px rgba(0,0,0,.2);
}
.tw-sticky-draw.is-stuck .tw-draw-ball-area{min-height:68px}
.tw-sticky-draw.is-stuck .draw-ball{width:48px;height:48px;font-size:18px}
.tw-sticky-draw.is-stuck .draw-number-item{min-width:49px}
.tw-sticky-draw.is-stuck .draw-attribute{font-size:15px}
.tw-sticky-draw.is-stuck .draw-plus{margin-top:12px;font-size:22px}

@media(max-width:640px){
  .tw-sticky-draw{top:0}
  .tw-sticky-draw.is-stuck{
    width:calc(100% + 12px);
    margin-left:-6px;
    margin-right:-6px;
    padding:6px 5px 8px;
    border-radius:0 0 11px 11px;
  }
  .tw-sticky-draw.is-stuck .tw-current-issue{padding:3px 18px;font-size:15px}
  .tw-sticky-draw.is-stuck .tw-draw-ball-area{min-height:61px}
  .tw-sticky-draw.is-stuck .draw-balls-v3{gap:0;width:100%}
  .tw-sticky-draw.is-stuck .draw-number-item{min-width:36px;flex:1 1 0}
  .tw-sticky-draw.is-stuck .draw-ball{width:38px;height:38px;font-size:15px}
  .tw-sticky-draw.is-stuck .draw-attribute{font-size:13px}
  .tw-sticky-draw.is-stuck .draw-plus{margin:9px -3px 0;font-size:18px}
}
@media(max-width:365px){
  .tw-sticky-draw.is-stuck .draw-ball{width:34px;height:34px;font-size:14px}
  .tw-sticky-draw.is-stuck .draw-number-item{min-width:32px}
  .tw-sticky-draw.is-stuck .draw-attribute{font-size:12px}
}
.tw-sticky-draw-sentinel{display:block;width:1px;height:1px;margin-bottom:-1px;pointer-events:none;visibility:hidden}

/* v0.7.8.3：臺灣資料庫置頂開獎欄右側返回頂部按鈕 */
.tw-sticky-back-top{
  display:none;
  position:absolute;
  right:14px;
  top:50%;
  z-index:4;
  align-items:center;
  justify-content:center;
  min-width:92px;
  padding:8px 14px;
  border:1px solid rgba(255,255,255,.65);
  border-radius:7px;
  background:rgba(4,24,87,.7);
  color:#fff;
  font:inherit;
  font-weight:800;
  line-height:1.2;
  cursor:pointer;
  transform:translateY(-50%);
}
.tw-sticky-draw.is-stuck .tw-sticky-back-top{display:inline-flex}
.tw-sticky-back-top:hover{background:rgba(255,255,255,.12)}
@media(max-width:760px){
  .tw-sticky-back-top{
    right:6px;
    top:7px;
    min-width:0;
    padding:5px 7px;
    font-size:12px;
    transform:none;
  }
  .tw-sticky-draw.is-stuck .tw-current-issue{margin-left:auto;margin-right:auto}
}


/* v0.7.2：所有判定为错的结果统一红色 */
.kh-text-row.status-miss .kh-text-row-head span,
.kh-style-category .kh-text-row.status-miss .kh-text-row-head span,
.kh-style-tricolor .kh-text-row.status-miss .kh-text-row-head span,
.kh-style-killzone .kh-text-row.status-miss .kh-text-row-head span{
  color:#dc2626!important;
}


/* v0.7.2：首页移除日期星期，倒數區移至原右上角日期位置 */
.tw-header{grid-template-columns:auto 1fr}
.tw-header-right,.tw-today{display:none!important}
.tw-next-panel{
  top:12px;
  right:34px;
  width:350px;
  z-index:3;
}
.tw-next-title{justify-content:flex-end}
.tw-countdown-wrap{justify-content:flex-end}

@media(max-width:820px){
  .tw-header{grid-template-columns:95px 1fr}
  .tw-next-panel{
    top:8px;
    right:16px;
    width:300px;
    max-width:calc(100% - 112px);
  }
  .tw-next-title{justify-content:flex-end;gap:7px}
  .tw-next-title>span{font-size:17px}
  .tw-next-title strong{padding:5px 13px;font-size:16px}
  .tw-next-title em{font-size:18px}
  .tw-countdown-wrap{justify-content:flex-end;margin-top:8px;gap:6px}
  .tw-countdown-wrap>b{font-size:24px}
  .tw-countdown-box{width:61px;height:52px}
  .tw-countdown-box span{font-size:34px}
  
}
@media(max-width:430px){
  .tw-header{grid-template-columns:88px 1fr;height:68px}
  .tw-logo-link{width:88px;min-width:88px}
  .tw-site-logo{max-height:64px}
  .tw-next-panel{
    top:6px;
    right:8px;
    width:268px;
    max-width:calc(100% - 100px);
  }
  .tw-next-title{gap:5px;white-space:nowrap}
  .tw-next-title>span{font-size:15px}
  .tw-next-title strong{padding:4px 10px;font-size:15px}
  .tw-next-title em{font-size:17px}
  .tw-countdown-wrap{margin-top:7px;gap:4px}
  .tw-countdown-wrap>b{font-size:21px}
  .tw-countdown-box{width:54px;height:48px;border-radius:6px}
  .tw-countdown-box span{font-size:31px;letter-spacing:1px}
  
}
@media(max-width:360px){
  .tw-header{grid-template-columns:80px 1fr}
  .tw-logo-link{width:80px;min-width:80px}
  .tw-next-panel{right:6px;width:250px;max-width:calc(100% - 88px)}
  .tw-next-title>span{font-size:14px}
  .tw-next-title strong{font-size:14px;padding:4px 8px}
  .tw-countdown-box{width:49px;height:45px}
  .tw-countdown-box span{font-size:29px}
  
}


/* v0.7.5：資料庫文字模板真正全寬，直接貼齊網站左右邊緣 */
.tw-database-main{
  padding-left:0;
  padding-right:0;
}
.tw-database-main .tw-inner-draw-summary,
.tw-database-main > .tw-page-empty{
  box-sizing:border-box;
  width:calc(100% - 68px);
  max-width:920px;
  margin-left:auto;
  margin-right:auto;
}
.tw-database-main .kh-text-library{
  box-sizing:border-box;
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}
.tw-database-main .kh-text-card{
  border-radius:0;
}
@media(max-width:820px){
  .tw-database-main .tw-inner-draw-summary,
  .tw-database-main > .tw-page-empty{
    width:calc(100% - 24px);
  }
}

/* v0.7.8 图片模板：数据库排版覆盖层 + 真正双列瀑布流 */
.template-image-stage{position:relative;display:block;width:100%;overflow:hidden;line-height:1;background:#fff}
.template-image-stage>img{display:block;width:100%;height:auto}
.template-overlay-layer{position:absolute;inset:0;z-index:2;overflow:hidden;pointer-events:none}
.template-front-overlay{position:absolute;visibility:hidden;z-index:3;max-width:96%;font-family:"Microsoft YaHei","PingFang SC","Noto Sans CJK TC",sans-serif;font-weight:800;line-height:1.12;white-space:pre-line;transform-origin:left top;pointer-events:none}
.template-composite-ready .template-front-overlay{visibility:visible}
.tw-gallery-grid.template-grid{display:block!important;column-count:2;column-gap:14px;max-width:1040px;margin:0 auto;padding:0}
.tw-gallery-grid.template-grid .template-card{display:inline-block;width:100%;height:auto;vertical-align:top;break-inside:avoid;page-break-inside:avoid;margin:0 0 14px}
.tw-gallery-grid.template-grid .image-open{display:block;width:100%;height:auto}
.tw-gallery-grid.template-grid .template-name{display:block}
.image-modal-stage{width:100%;height:auto}
.image-modal-stage>img{display:block;width:100%;height:auto}
.tw-image-thumb .template-image-stage{width:100%}
.tw-image-thumb .template-image-stage>img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;object-position:top center;background:#fff}
@media(max-width:640px){
  .tw-gallery-grid.template-grid{column-gap:9px}
  .tw-gallery-grid.template-grid .template-card{margin-bottom:9px}
  .tw-image-thumb .template-image-stage>img{aspect-ratio:1/1.18}
}


/* v0.7.8.4：首頁縮略圖與圖庫頁共用原圖比例，文字排版位置保持一致 */
.tw-image-thumb .template-image-stage>img{
  width:100%;
  height:auto;
  aspect-ratio:auto;
  object-fit:contain;
  object-position:center top;
}
@media(max-width:640px){
  .tw-image-thumb .template-image-stage>img{
    height:auto;
    aspect-ratio:auto;
    object-fit:contain;
  }
}

/* v0.7.8.4：圖庫管家與資料庫置頂開獎欄均顯示返回頂部按鈕 */
.tw-sticky-draw.is-stuck .tw-sticky-back-top{display:inline-flex}

/* v0.7.9.1：手機圖片查看器、白色主題與不透明全屏背景 */
html.image-modal-open,
body.image-modal-open{
  overflow:hidden!important;
  background:#fff!important;
  color-scheme:light;
}
.image-modal{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:stretch;
  justify-content:stretch;
  padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:#fff!important;
  overscroll-behavior:none;
}
.image-modal.hidden{display:none!important}
.image-modal-inner{
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  height:100%;
  max-width:none;
  max-height:none;
  border-radius:0;
  background:#fff!important;
  color:#172033;
  overflow:hidden;
}
.image-modal-title{
  flex:0 0 auto;
  min-height:56px;
  display:flex;
  align-items:center;
  padding:12px 78px 12px 18px;
  border-bottom:1px solid #e6ebf0;
  background:#fff!important;
  color:#172033!important;
  font-weight:900;
}
.image-modal .close-btn{
  position:absolute;
  z-index:5;
  right:max(12px,env(safe-area-inset-right));
  top:9px;
  padding:7px 14px;
  border:1px solid #dce6ef;
  border-radius:999px;
  background:#f4f8fb!important;
  color:#1683bd!important;
  box-shadow:none;
}
.image-modal-scroll{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  padding:0!important;
  background:#fff!important;
  touch-action:none;
  overscroll-behavior:none;
}
.image-modal-stage{
  position:relative;
  flex:0 0 auto;
  margin:0;
  overflow:visible;
  background:#fff;
  transform-origin:center center;
  will-change:transform;
  cursor:zoom-in;
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.image-modal-stage.is-zoomed{cursor:grab}
.image-modal-stage.is-zoomed:active{cursor:grabbing}
.image-modal-stage>img{
  display:block;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
  -webkit-user-select:none;
  -webkit-user-drag:none;
}
.image-modal-stage .template-overlay-layer{pointer-events:none}

/* 圖庫內容區使用白色底，兩欄高度不同時不再露出深藍空白。 */
.tw-gallery-page{background:#fff!important;color-scheme:light}
.tw-gallery-page .tw-inner-shell{background-color:#fff}
.tw-gallery-page .tw-gallery-grid.template-grid{
  background:#fff;
}
@media(max-width:640px){
  .image-modal-title{min-height:54px;padding:11px 72px 11px 14px}
  .image-modal .close-btn{right:max(10px,env(safe-area-inset-right));top:8px}
}


/* v0.7.9.2：图库全宽、首页6张、电脑端资料库双列瀑布流 */
/* 1. 臺灣圖庫管家：模板区横向贴齐网站左右边缘，维持双列瀑布流与原图比例。 */
.tw-gallery-page .tw-inner-main{
  padding-left:0;
  padding-right:0;
}
.tw-gallery-page .tw-inner-main > .tw-inner-draw-summary,
.tw-gallery-page .tw-inner-main > .tw-page-empty{
  box-sizing:border-box;
  width:calc(100% - 68px);
  max-width:920px;
  margin-left:auto;
  margin-right:auto;
}
.tw-gallery-page .tw-gallery-grid.template-grid{
  box-sizing:border-box;
  width:100%;
  max-width:none;
  margin-left:0;
  margin-right:0;
  padding-left:0;
  padding-right:0;
}
.tw-gallery-page .tw-gallery-grid.template-grid .template-card{
  border-radius:0;
}

/* 2. 首页图库缩略图固定只显示前6张，避免局部刷新时重新出现第7、8张。 */
.tw-image-module .tw-image-thumb-grid > .tw-image-thumb:nth-child(n+7){
  display:none!important;
}

/* 3. 电脑端臺灣資料庫：两列分别连续向下排列，每个模板保持自己的真实高度。 */
@media(min-width:821px){
  .tw-database-main .kh-text-library{
    display:block!important;
    column-count:2;
    column-gap:14px;
  }
  .tw-database-main .kh-text-library > .kh-text-card{
    display:inline-block;
    box-sizing:border-box;
    width:100%;
    margin:0 0 14px;
    vertical-align:top;
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
@media(max-width:820px){
  .tw-gallery-page .tw-inner-main > .tw-inner-draw-summary,
  .tw-gallery-page .tw-inner-main > .tw-page-empty{
    width:calc(100% - 24px);
  }
  .tw-database-main .kh-text-library{
    display:block!important;
    column-count:1;
  }
  .tw-database-main .kh-text-library > .kh-text-card{
    display:block;
    width:100%;
    margin:0;
    break-inside:avoid;
    page-break-inside:avoid;
  }
}
/* 图片与其叠加文字必须作为一个整体显示，禁止出现文字先于图片。 */
.media-sync-enabled [data-sync-group]:not(.sync-ready){visibility:hidden!important}
.media-sync-enabled [data-sync-group].sync-ready{visibility:visible!important}
.media-sync-enabled [data-sync-group].sync-failed{visibility:hidden!important}

/* v0.8.1.8：首页下期开奖时间两行卡片（唯一生效规则） */
.tw-cutoff{
  box-sizing:border-box;
  display:grid!important;
  grid-template-columns:1fr!important;
  justify-items:end;
  align-items:center;
  gap:3px;
  width:max-content;
  max-width:100%;
  margin:8px 0 0 auto;
  padding:6px 10px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:8px;
  background:rgba(4,24,87,.58);
  box-shadow:0 3px 10px rgba(0,0,0,.13);
  color:#fff;
  line-height:1.2;
  white-space:nowrap;
  text-align:right;
}
.tw-cutoff-label{
  display:block!important;
  color:rgba(255,255,255,.88);
  font-size:13px;
  font-weight:800;
  letter-spacing:.5px;
}
.tw-cutoff strong{
  display:block!important;
  margin:0;
  color:#fff;
  font-size:15px;
  font-weight:900;
  letter-spacing:.35px;
}

/* 图片采用真实文件优先、失败重试；最终失败时显示清晰提示而不是空白。 */
.template-image-stage-failed{
  min-height:180px;
  display:grid;
  place-items:center;
  background:#f7f8fa;
}
.template-image-stage-failed::after{
  content:'圖片載入失敗，請重新整理頁面';
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  padding:20px;
  color:#667085;
  font-size:14px;
  font-weight:700;
  text-align:center;
}
.template-image-stage-failed>img.template-image-load-failed{visibility:hidden}

@media(max-width:820px){
  .tw-cutoff{gap:2px;margin-top:7px;padding:5px 9px;border-radius:7px}
  .tw-cutoff-label{font-size:12px}
  .tw-cutoff strong{font-size:14px}
}
@media(max-width:430px){
  .tw-cutoff{margin-top:5px;padding:4px 7px}
  .tw-cutoff-label{font-size:11px}
  .tw-cutoff strong{font-size:13px}
}
@media(max-width:360px){
  .tw-cutoff-label{font-size:10px}
  .tw-cutoff strong{font-size:12px}
}



/* v0.12.0：图片底图与动态叠字原子显示。
 * JS 在真实图片完成加载和解码、叠字完成定位后才一次性加入
 * template-composite-ready。未完成前只保留等比例占位，不允许底图或
 * 文字任何一方单独出现。 */
.template-composite-enabled .template-image-stage[data-template-stage] > img,
.template-composite-enabled .template-image-stage[data-template-stage] > .template-overlay-layer{
  opacity:0!important;
  visibility:hidden!important;
  transition:none!important;
}
.template-composite-enabled .template-image-stage[data-template-stage].template-composite-ready > img,
.template-composite-enabled .template-image-stage[data-template-stage].template-composite-ready > .template-overlay-layer{
  opacity:1!important;
  visibility:visible!important;
}
.template-composite-enabled .template-image-stage[data-template-stage]:not(.template-composite-ready) .template-front-overlay{
  visibility:hidden!important;
}
.template-composite-enabled .template-image-stage[data-template-stage].template-composite-ready .template-front-overlay{
  visibility:visible!important;
}
.template-composite-enabled .template-image-stage[data-template-stage].template-image-stage-failed > img,
.template-composite-enabled .template-image-stage[data-template-stage].template-image-stage-failed > .template-overlay-layer{
  opacity:0!important;
  visibility:hidden!important;
}
