
/*Max-Width
========================================== */

.max-w-none {
  max-width: none !important;
}

.max-w-xs {
  max-width: 20rem !important;
}

.max-w-sm {
  max-width: 24rem !important;
}

.max-w-md {
  max-width: 28rem !important;
}

.max-w-lg {
  max-width: 32rem !important;
}

.max-w-xl {
  max-width: 36rem !important;
}

.max-w-2xl {
  max-width: 42rem !important;
}

.max-w-3xl {
  max-width: 48rem !important;
}

.max-w-4xl {
  max-width: 56rem !important;
}

.max-w-5xl {
  max-width: 64rem !important;
}

.max-w-6xl {
  max-width: 72rem !important;
}

.max-w-7xl {
  max-width: 80rem !important;
}

.max-w-8xl {
  max-width: 88rem !important;
}

.max-w-9xl {
  max-width: 96rem !important;
}

.max-w-full {
  max-width: 100% !important;
}


/*video-iframe-box
========================================== */
/* 封面容器 */
.video-iframe-box {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 3 / 2;
    margin: 10px auto;
    display: grid;
    place-items: center;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);

    /* 更有質感的外陰影（不會太重） */
    box-shadow:
        0 12px 30px rgba(0, 0, 0, .22),
        0 2px 8px rgba(0, 0, 0, .12);
}




/* 半透明遮罩 + 微暗角，讓按鈕更突出 */
.video-iframe-box::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        radial-gradient(1200px 500px at 50% 30%, rgba(0, 0, 0, .08), rgba(0, 0, 0, .45)),
        linear-gradient(180deg, rgba(0, 0, 0, .10), rgba(0, 0, 0, .22));
}

/* 可選：加一點柔和高光，讓封面更像卡片 */
.video-iframe-box::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto -20%;
    height: 55%;
    z-index: 1;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

/* 按鈕 */
.video-iframe-btn {
    font-family: anton, sans-serif;
    font-weight: 400;
    position: relative;
    z-index: 2;

    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;

    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: clamp(5px, 1vw, 10px) clamp(12px, 2vw, 20px);
    border: 0;
    border-radius: 4px;
    color: #fff;
    font-size: clamp(15px, 2vw, 24px);
    line-height: 1;

    /* 漸層更細緻 */
    background: linear-gradient(135deg, #4c85ff, #22c55e, #06b6d4);
    background-size: 250% 250%;
    animation: videoBtnGradient 4.5s ease infinite;

    /* 玻璃感 + 陰影 */
    box-shadow:
        0 18px 30px rgba(0, 0, 0, .38),
        0 2px 0 rgba(255, 255, 255, .18) inset;

    transform: translateY(0);
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

/* 圓形播放 icon */
.video-iframe-btn::before {
    content: "▶";
    width: 38px;
    height: 38px;

    display: inline-grid;
    place-items: center;

    border-radius: 4px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .55);

    box-shadow:
        0 1px 0 rgba(255, 255, 255, .35) inset,
        0 10px 18px rgba(0, 0, 0, .20);

    /* 讓三角形更置中一點（視覺上會偏左） */
    padding-left: 2px;
}

/* Hover：更浮起、更亮 */
.video-iframe-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05) saturate(1.05);
    box-shadow:
        0 24px 40px rgba(0, 0, 0, .42),
        0 2px 0 rgba(255, 255, 255, .20) inset;
}

/* Active：按下去回饋 */
.video-iframe-btn:active {
    transform: translateY(0);
    filter: brightness(.98);
    box-shadow:
        0 14px 26px rgba(0, 0, 0, .35),
        0 2px 0 rgba(255, 255, 255, .16) inset;
}

/* 鍵盤可及性（SEO/可用性加分） */
.video-iframe-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .85);
    outline-offset: 4px;
}

/* 避免使用者偏好降低動畫時仍狂動 */
userfiles/ @media (prefers-reduced-motion: reduce) {
    .video-iframe-btn {
        animation: none;
    }

    .video-iframe-btn:hover,
    .video-iframe-btn:active {
        transform: none;
    }
}

/* 漸層動畫 */
@keyframes videoBtnGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}


.text-editor a {
    text-decoration: underline;
}

.text-editor a:hover {
    text-decoration: none;
    color: var(--primary-color)
}

.text-editor ul {
    list-style-type: none !important;
    padding: 20px !important;
    background-color: var(--gray-color-100);
    border-radius: 4px
}

.text-editor ul *{
    color: #000;
}

.text-editor ul li {
    position: relative;
    list-style-position: outside !important;
    padding: 6px 0 6px 35px
}

.text-editor ul li::before {
    content: "✪";
    color: var(--secondary-color-500);
    position: absolute;
    top: -3px;
    left: -5px;
    font-size: 26px
}

.text-editor ol strong, .text-editor ol>li:before, .text-editor ul strong {
    color: var(--secondary-color-700)
}

.text-editor ul li ul li::before {
    position: absolute;
    top: 6px;
    left: -16;
    font-size: 20px
}

.text-editor ul li h3 {
    margin-top: 0 !important
}

.text-editor ol {
    background-color: var(--gray-color-100);
    counter-reset: myCounter;
    margin-left: 0;
    padding: 10px 10px 10px 35px;
    border-radius: 4px;
    margin: 20px 0;
}

.text-editor ol *{
    color: #000;
}

@media only screen and (min-width:1400px) {
    .text-editor ul {
        padding: 20px 20px 20px 35px !important
    }

    .text-editor ol {
        padding: 20px 3vw !important
    }
}

.text-editor ol li {
    position: relative;
    padding: 5px 0 5px 12px;
    list-style: none;
    -webkit-transition: .2s ease-in-out;
    transition: .2s ease-in-out
}

.text-editor ol>li:before {
    content: counter(myCounter);
    counter-increment: myCounter;
    position: absolute;
    top: 6px;
    left: -25px;
    width: 22px;
    height: 22px;
    padding: 1px;
    background-color: #fff;
    color: #000!important;
    text-align: center;
    border-radius: 50px;
    border: 1px solid #fff;
    line-height: 1.5;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid var(--secondary-color-200)
}

.text-editor ol ul {
    border-left: 1px solid var(--secondary-color-200) !important;
    border-radius: 0
}

.text-editor ol ul li::before {
    content: "—";
    color: var(--secondary-color-200);
    left: -17px
}

.text-editor ol ol, .text-editor ol ul, .text-editor ul ol, .text-editor ul ul {
    border: 0;
    margin: 0 !important;
    padding: 0 0 0 15px !important
}




/* ==================================================
   table 系統
================================================== */

.text-editor .table-box {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    display: block;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--gray-color-300);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
    margin: 2vw 0;
}

.text-editor > table {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    display: table;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--gray-color-300);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
    margin-bottom: 20px;
    overflow: hidden;
    color: #000;
}

.text-editor .table-box table {
    margin: 0;
    background: 0 0;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 100%;
    table-layout: auto;
    color: #000;
    border-radius: 4px;
    overflow: hidden;
}

.text-editor .table-box td,
.text-editor .table-box th,
.text-editor > table td,
.text-editor > table th {
    padding: clamp(5px, .5vw, 8px);
    line-height: 1.4;
}


.text-editor .table-box th,
.text-editor > table th {
    font-size: 90%;
    border-right: 1px solid rgba(255, 255, 255, .4);
    border-bottom: 1px solid rgba(255, 255, 255, .4);
}

.text-editor .table-box td,
.text-editor > table td {
    border-right: 1px solid var(--gray-color-300);
    border-bottom: 1px solid var(--gray-color-300);
}




.text-editor .table-box tr > :last-child,
.text-editor > table tr > :last-child {
    border-right: 0;
}

.text-editor .table-box table > :last-child > tr:last-child > *,
.text-editor > table > :last-child > tr:last-child > * {
    border-bottom: 0;
}

.text-editor .table-box th,
.text-editor > table th {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 700;
    line-height: 1.2;
}

.text-editor .table-box tbody tr:nth-child(odd) > *,
.text-editor > table tbody tr:nth-child(odd) > * {
    background-color: var(--gray-color-200);
}

.text-editor .table-box tbody tr:hover > *,
.text-editor > table tbody tr:hover > * {
    background-color: var(--gray-color-100);
}

/* 表格四角圓角 4px */
.text-editor .table-box tr:first-child > :first-child,
.text-editor .table-box table tr:first-child > :first-child,
.text-editor > table tr:first-child > :first-child {
    border-top-left-radius: 4px;
}

.text-editor .table-box tr:first-child > :last-child,
.text-editor .table-box table tr:first-child > :last-child,
.text-editor > table tr:first-child > :last-child {
    border-top-right-radius: 4px;
}

.text-editor .table-box tr:last-child > :first-child,
.text-editor .table-box table tr:last-child > :first-child,
.text-editor > table tr:last-child > :first-child {
    border-bottom-left-radius: 4px;
}

.text-editor .table-box tr:last-child > :last-child,
.text-editor .table-box table tr:last-child > :last-child,
.text-editor > table tr:last-child > :last-child {
    border-bottom-right-radius: 4px;
}

.text-center {
    text-align: center
}

/* ==================================================
   tag（內文區）
================================================== */

.text-editor a.tag-item:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.text-editor .tag-item {
    color: var(--gray-color-800);
    border-color: color-mix(in srgb, var(--primary-color) 35%, var(--gray-color-300));
    background: color-mix(in srgb, var(--primary-color) 10%, var(--gray-color-100));
}

/* ==================================================
   bonus-content 內文區版面
================================================== */

@media only screen and (min-width: 768px) {
    .bonus-content .text-editor {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
    }
}

/* 內文區 — 呼應側欄平面線框與章節層次 */
.bonus-content .text-editor {
    counter-reset: article-chapter num;
    padding: clamp(18px, 2.2vw, 28px);
    border: 1px solid var(--gray-color-300);
    border-radius: 4px;
    background: #fff;
    font-size: clamp(15px, 0.95vw, 16px);
    line-height: 1.65;
    min-width: 0;
}

.bonus-content .text-editor > p {
}

.bonus-content .text-editor > p strong {
    color: var(--gray-color-900);
}

.bonus-content .text-editor > p:has(> img) {
    margin-top: clamp(14px, 2vw, 20px);
    margin-bottom: clamp(6px, 1vw, 10px);
    text-align: center;
}

.bonus-content .text-editor > p:has(> em:only-child) {
    margin-top: 0;
    margin-bottom: clamp(14px, 2vw, 20px);
    text-align: center;
    font-size: 0.9em;
    color: var(--gray-color-600);
}

.bonus-content .text-editor > h2 {
    counter-increment: article-chapter;
    counter-reset: article-section;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: clamp(22px, 2.8vw, 32px) 0 clamp(14px, 2vw, 18px);
    padding: 12px 14px;
    font-size: clamp(17px, 1.5vw, 22px);
    font-weight: 700;
    line-height: 1.4;
    color: var(--gray-color-900);
    background: var(--gray-color-50);
    border: 1px solid var(--gray-color-300);
    border-radius: 4px;
}

.bonus-content .text-editor > h2::before {
    content: counter(article-chapter, decimal-leading-zero);
    flex-shrink: 0;
    min-width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--primary-color);
    background: #fff;
    border: 1px solid var(--gray-color-300);
    border-radius: 4px;
}

.bonus-content .text-editor > h2:first-of-type {
    margin-top: clamp(18px, 2.2vw, 24px);
    padding-top: clamp(18px, 2.2vw, 24px);
    border-top: 1px solid var(--gray-color-300);
}

.bonus-content .text-editor > h3 {
    counter-increment: article-section;
    margin: clamp(18px, 2vw, 24px) 0 clamp(10px, 1.2vw, 14px);
    padding: 6px 0 6px 16px;
    font-size: clamp(15px, 1.15vw, 18px);
    font-weight: 600;
    line-height: 1.45;
    color: var(--gray-color-800);
    border-left: 3px solid var(--gray-color-300);
}

.bonus-content .text-editor > h3::before {
    content: counter(article-chapter) "." counter(article-section) " ";
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-color-500);
    margin-right: 6px;
}

.bonus-content .text-editor > p,
.bonus-content .text-editor > ul,
.bonus-content .text-editor > ol,
.bonus-content .text-editor > table,
.bonus-content .text-editor > .table-box,
.bonus-content .text-editor > .btn-box,
.bonus-content .text-editor > .video-iframe-box {
    margin-bottom: clamp(12px, 1.5vw, 16px);
}

.bonus-content .text-editor > p:first-child {
    margin-top: 0;
}

.bonus-content .text-editor > table,
.bonus-content .text-editor > .table-box {
    margin-top: clamp(14px, 1.8vw, 18px);
    margin-bottom: clamp(14px, 1.8vw, 18px);
    max-width: 100%;
}

.bonus-content .text-editor > .table-box {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* FAQ — details 直接放在 .text-editor 內，無需 .faq 包一層 */
.bonus-content .text-editor > details {
    max-width: 100%;
    background-color: var(--gray-color-900);
    padding: 8px 12px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.bonus-content .text-editor > details,
.bonus-content .text-editor > details * {
    color: #fff;
}

.bonus-content .text-editor > details:first-of-type {
    margin-top: 8px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.bonus-content .text-editor > details:last-of-type,
.bonus-content .text-editor > details[open] {
    padding-bottom: 8px;
}

.bonus-content .text-editor > details:last-of-type {
    margin-bottom: 8px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.bonus-content .text-editor > details:only-of-type {
    border-radius: 4px;
}

.bonus-content .text-editor > details summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    min-height: 36px;
    padding: 4px 28px 4px 0;
}

.bonus-content .text-editor > details summary > * {
    flex: 1;
    min-width: 0;
}

.bonus-content .text-editor > details summary::after {
    counter-increment: num;
    content: counter(num);
    flex-shrink: 0;
    order: -1;
    background-color: var(--secondary-color);
    color: #fff;
    font-weight: 700;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.bonus-content .text-editor > details summary h3 {
    font-size: clamp(15px, 1vw, 18px);
}

.bonus-content .text-editor > details[open] {
    background-color: var(--gray-color-800);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.bonus-content .text-editor > details[open] summary h3 {
    font-size: clamp(15px, 1vw, 18px);
}

.bonus-content .text-editor > details[open] summary::after {
    background-color: var(--primary-color);
    color: #fff;
}

.bonus-content .text-editor > details summary:hover::after {
    background-color: var(--primary-color);
    color: #fff;
}

.bonus-content .text-editor > details:not([open]):hover {
    background-color: var(--gray-color-800);
}

.bonus-content .text-editor > details[open] > p,
.bonus-content .text-editor > details[open] > ul,
.bonus-content .text-editor > details[open] > ol {
    background-color: var(--gray-color-950);
    border-left: 3px solid var(--primary-color);
    margin: 8px 20px 0 44px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.88);
}

.bonus-content .text-editor > details[open] > ul,
.bonus-content .text-editor > details[open] > ol {
    padding-left: 26px;
}

.bonus-content .text-editor > details summary::-webkit-details-marker {
    display: none;
}

.bonus-content .text-editor > details summary::marker {
    content: none;
}

.bonus-content .text-editor > details summary::before {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    text-align: center;
    font-size: 1.4em;
    line-height: 1;
}

.bonus-content .text-editor > details[open] summary::before {
    content: "–";
    color: #fff;
}

/* 內文區 — 電腦版加大區塊間距 */
@media only screen and (min-width: 768px) {
    .bonus-content .text-editor {
        padding: clamp(28px, 2.8vw, 42px);
    }

    .bonus-content .text-editor > h2 {
        margin-top: clamp(32px, 3.2vw, 44px);
        margin-bottom: clamp(20px, 2.2vw, 28px);
        padding: 14px 16px;
    }

    .bonus-content .text-editor > h2:first-of-type {
        margin-top: clamp(28px, 2.8vw, 36px);
        padding-top: clamp(24px, 2.6vw, 32px);
    }

    .bonus-content .text-editor > h3 {
        margin-top: clamp(24px, 2.4vw, 32px);
        margin-bottom: clamp(14px, 1.6vw, 20px);
        padding: 8px 0 8px 18px;
    }

    .bonus-content .text-editor > p {
        margin-bottom: clamp(16px, 1.8vw, 22px);
        line-height: 1.65;
    }

    .bonus-content .text-editor > ul,
    .bonus-content .text-editor > ol {
        margin-top: clamp(20px, 2vw, 28px);
        margin-bottom: clamp(24px, 2.6vw, 34px);
    }

    .bonus-content .text-editor > table,
    .bonus-content .text-editor > .table-box {
        margin-top: clamp(22px, 2.4vw, 32px);
        margin-bottom: clamp(28px, 2.8vw, 38px);
    }

    .bonus-content .text-editor > .btn-box,
    .bonus-content .text-editor > .video-iframe-box {
        margin-top: clamp(18px, 2vw, 26px);
        margin-bottom: clamp(24px, 2.6vw, 34px);
    }

    .bonus-content .text-editor > p + ul,
    .bonus-content .text-editor > p + ol,
    .bonus-content .text-editor > h3 + ul,
    .bonus-content .text-editor > h3 + ol {
        margin-top: clamp(14px, 1.6vw, 20px);
    }

    .bonus-content .text-editor > details:last-of-type {
        margin-bottom: 16px;
    }
}

/* list-content 手機版內文節奏 */
@media only screen and (max-width: 767px) {
    .bonus-content .text-editor {
        padding: clamp(10px, 2.5vw, 14px);
        font-size: 15px;
        line-height: 1.62;
    }

    .bonus-content .text-editor > h2 {
        gap: 10px;
        margin-top: clamp(18px, 4.5vw, 26px);
        margin-bottom: clamp(10px, 2.5vw, 14px);
        padding: 8px 10px;
        font-size: clamp(16px, 4.2vw, 18px);
    }

    .bonus-content .text-editor > h2::before {
        min-width: 26px;
        height: 26px;
        font-size: 10px;
    }

    .bonus-content .text-editor > h2:first-of-type {
        margin-top: clamp(12px, 3vw, 16px);
        padding-top: clamp(12px, 3vw, 16px);
    }

    .bonus-content .text-editor > h3 {
        margin-top: clamp(18px, 4.5vw, 24px);
        margin-bottom: clamp(10px, 2.5vw, 14px);
        padding-left: 14px;
        font-size: clamp(15px, 3.8vw, 17px);
    }

    .bonus-content .text-editor > p,
    .bonus-content .text-editor > ul,
    .bonus-content .text-editor > ol {
        margin-bottom: clamp(14px, 3.5vw, 18px);
    }

    .bonus-content .text-editor > ul,
    .bonus-content .text-editor > ol {
        margin-top: clamp(14px, 3.5vw, 20px);
        margin-bottom: clamp(18px, 4vw, 24px);
    }

    .bonus-content .text-editor > table,
    .bonus-content .text-editor > .table-box {
        margin-top: clamp(16px, 4vw, 22px);
        margin-bottom: clamp(20px, 5vw, 28px);
    }

    .bonus-content .text-editor > details,
    .bonus-content .text-editor > details[open] {
        padding-left: 8px;
        padding-right: 8px;
    }

    .bonus-content .text-editor > details[open] {
        padding-bottom: 4px;
    }

    .bonus-content .text-editor > details summary {
        min-height: 28px;
        padding-right: 24px;
    }

    .bonus-content .text-editor > details summary::after {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .bonus-content .text-editor > details[open] > p,
    .bonus-content .text-editor > details[open] > ul,
    .bonus-content .text-editor > details[open] > ol {
        margin: 4px 0 0 8px;
        padding: 6px 8px;
    }

    .bonus-content .text-editor > details[open] > ul,
    .bonus-content .text-editor > details[open] > ol {
        padding-left: 18px;
    }
}

/* ==================================================
   圖片
================================================== */

.text-editor img {
    border-radius: 4px;
    margin: 10px auto;
    border: 1px solid var(--gray-color-300);
}

.bonus-content .text-editor img {
    display: block;
    max-width: 100%;
    height: auto;
}