/* ==========================================================================
   commission.css  —  網頁委託頁樣式（對應 commission.html / commission.js）
   ========================================================================== */

/* ---------- 頁首 ------------------------------------------------------ */
.page-hero {
    position: relative;
    padding: calc(var(--nav-h) + 96px) 0 96px;
    background: transparent;
    overflow: hidden;
}
.page-hero__title {
    font-size: clamp(44px, 8vw, 96px);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.04em;
}
.page-hero__sub {
    max-width: 560px;
    margin: 28px 0 36px;
    font-size: clamp(17px, 2vw, 21px);
    color: var(--muted);
}
/* 右側直條裝飾已移至 common.css（body::after），全站固定、淺色。 */
.page-hero .wrap { position: relative; z-index: 1; }

/* ---------- 服務項目 -------------------------------------------------- */
.services { background: transparent; }
.services__grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}
.svc {
    padding: 44px 40px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transition: background 0.3s var(--ease);
}
.svc:hover { background: rgba(0,0,0,0.035); }
.svc__no {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--c-silver);
}
.svc h3 { font-size: 24px; font-weight: 700; margin: 14px 0 10px; }
.svc p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 42ch; }

/* ---------- 合作流程 -------------------------------------------------- */
.process { background: transparent; }
.process__list {
    margin-top: 56px;
    list-style: none;
    display: grid;
    gap: 20px;
    counter-reset: step;
}
.step {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.step:hover { transform: translateX(8px); border-color: var(--c-ink); }
.step__mark {
    flex-shrink: 0;
    width: 60px; height: 60px;
    display: grid; place-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.step__mark .step__icon {
    width: 30px; height: 30px;
    color: var(--c-ink);
    transition: color 0.3s var(--ease);
}
.step__no {
    font-size: 12px; font-weight: 700;
    letter-spacing: 0.14em; color: var(--c-silver);
}
.step__body h3 { font-size: 21px; font-weight: 700; margin: 4px 0 6px; }
.step__body p { color: var(--muted); font-size: 15px; }

/* ---------- 方案 ------------------------------------------------------ */
.plans { background: transparent; }
.plans__grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: stretch;
}
.plan {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 40px 32px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.plan:hover { transform: translateY(-6px); border-color: var(--c-ink); }
.plan--featured { background: transparent; color: inherit; border-color: var(--c-ink); border-width: 2px; }
.plan__badge {
    position: absolute; top: -12px; left: 32px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
    padding: 6px 14px; border-radius: 980px;
    background: var(--c-ink); color: var(--c-paper);
    border: 1px solid var(--c-ink);
}
.plan h3 { font-size: 24px; font-weight: 700; }
.plan__desc { color: var(--muted); font-size: 14px; margin-top: 4px; }
.plan--featured .plan__desc { color: var(--muted); }
.plan__price {
    font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
    margin: 24px 0 24px;
}
.plan__price span { font-size: 15px; font-weight: 500; color: var(--muted); }
.plan--featured .plan__price span { color: var(--muted); }
.plan ul {
    list-style: none;
    display: grid; gap: 12px;
    margin-bottom: 32px;
    flex-grow: 1;
}
.plan li {
    font-size: 15px; padding-left: 26px; position: relative;
}
.plan li::before {
    content: ""; position: absolute; left: 0; top: 8px;
    width: 8px; height: 8px; background: var(--c-ink);
}
.plan--featured li::before { background: var(--c-ink); }
.plan .btn { width: 100%; justify-content: center; margin-top: auto; }
/* 主打方案的實心按鈕（透明化後回歸標準黑底白字） */
.btn--invert.btn--solid { background: var(--c-ink); color: var(--c-paper); }
.btn--invert.btn--solid:hover { background: #333; }
/* 方案區的框架語 / 詳細報價導引 */
.plans .section__lead a { color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }
.plans__note {
    margin-top: 32px;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}
.plans__cta {
    color: var(--c-ink);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}
.plans__cta:hover { opacity: 0.7; }

/* ---------- 委託表單 -------------------------------------------------- */
.form-sec { background: transparent; }
.form-sec__inner {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 64px;
    align-items: start;
}
/* 委託表單整體往左收攏、左對齊（貼合本頁左對齊的視覺調性），不置中、不貼右緣 */
.form-sec .form-sec__inner { max-width: var(--maxw); margin-inline: 0; }
.form-sec__intro { position: sticky; top: 96px; }

.cform {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
    display: grid;
    gap: 22px;
}
.cform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--c-graphite); }
.field input,
.field select,
.field textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--c-ink);
    padding: 13px 14px;
    background: rgba(255,255,255,0.45);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--c-ink);
    background: rgba(255,255,255,0.85);
}
.field.is-invalid input,
.field.is-invalid textarea { border-color: #b00020; background: rgba(255,225,225,0.55); }
.field__err { font-size: 12px; color: #b00020; min-height: 14px; }
.cform__submit { justify-content: center; margin-top: 4px; }
.cform__note { font-size: 14px; font-weight: 600; min-height: 20px; }
.cform__note.is-ok { color: #0a7d2c; }

/* ---------- 響應式 ---------------------------------------------------- */
@media (max-width: 1180px) {
    .plans__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .services__grid { grid-template-columns: 1fr; }
    .plans__grid { grid-template-columns: 1fr; }
    .plan--featured { order: -1; }
    .form-sec__inner { grid-template-columns: 1fr; gap: 40px; }
    .form-sec__intro { position: static; }
}
@media (max-width: 520px) {
    .cform { padding: 28px 20px; }
    .cform__row { grid-template-columns: 1fr; }
    .step { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ==========================================================================
   DEMO 案例區 + 聚焦詳細（Modal，背景高斯模糊）
   ========================================================================== */
.demos { background: transparent; }
/* 同意展示聲明（大標題下方，含包豪斯小方塊標記） */
.demos__consent {
    margin-top: 14px;
    font-size: 13px;
    color: var(--c-slate);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.demos__consent::before {
    content: "";
    width: 7px; height: 7px;
    background: var(--c-ink);
    flex-shrink: 0;
}
.demos__grid {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* 案例卡 */
.demo-card {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    outline: none;
    -webkit-backdrop-filter: blur(2.5px) brightness(0.95);
    backdrop-filter: blur(2.5px) brightness(0.95);
    transition: transform 0.35s var(--ease), border-color 0.35s var(--ease),
                box-shadow 0.35s var(--ease);
}
.demo-card:hover,
.demo-card:focus-visible {
    transform: translateY(-6px);
    border-color: var(--c-ink);
    box-shadow: 0 24px 60px rgba(0,0,0,0.10);
}
.demo-card__thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--c-fog);
}
.demo-card__thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.5s var(--ease);
}
.demo-card:hover .demo-card__thumb img { transform: scale(1.05); }
.demo-card__meta { padding: 20px 22px 24px; }
.demo-card__tag {
    font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--c-silver);
}
.demo-card__name { font-size: 21px; font-weight: 700; margin: 8px 0 6px; }
.demo-card__sub { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* ---- 聚焦 Modal ---- */
.demo-modal { position: fixed; inset: 0; z-index: 2000; display: none; }
.demo-modal.is-open { display: block; }

/* 背景層：把「聚焦框以外」的整頁高斯模糊掉 */
.demo-modal__backdrop {
    position: absolute; inset: 0;
    background: rgba(245, 245, 247, 0.45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: demoFade 0.3s var(--ease);
}

/* 聚焦框（內容清晰） */
.demo-modal__panel {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(940px, calc(100vw - 40px));
    max-height: calc(100vh - 56px);
    overflow: auto;
    background: var(--c-paper);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.28);
    animation: demoPop 0.35s var(--ease);
}
.demo-modal__close {
    position: absolute; top: 14px; right: 16px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 24px; line-height: 1; color: var(--c-ink);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: grid; place-items: center;
    transition: background 0.2s var(--ease), transform 0.25s var(--ease);
}
.demo-modal__close:hover { background: var(--c-fog); transform: rotate(90deg); }

@keyframes demoFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes demoPop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Modal 內容（由 <template> 注入） */
.demo-full { display: grid; grid-template-columns: 1.05fr 1fr; }
.demo-full__media { background: var(--c-fog); min-height: 100%; }
.demo-full__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-full__info { padding: 44px 40px; }
.demo-full__tag {
    font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--c-silver);
}
.demo-full__title {
    font-size: clamp(26px, 3vw, 34px); font-weight: 800;
    letter-spacing: -0.02em; margin: 12px 0 14px; line-height: 1.1;
}
.demo-full__lead { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.demo-full__desc { font-size: 15px; color: var(--muted); line-height: 1.7; margin-bottom: 26px; }
.demo-full__meta { list-style: none; display: grid; gap: 10px; margin-bottom: 28px; }
.demo-full__meta li { font-size: 14px; display: flex; gap: 14px; }
.demo-full__meta li span { min-width: 48px; font-weight: 700; color: var(--c-graphite); }
.demo-full__link { align-self: flex-start; }
.demo-full__link[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.demo-full__note { margin-top: 10px; font-size: 12px; color: var(--c-silver); }
/* 警示提示（如 AI key 到期）：中性色塊，維持黑白灰調性 */
.demo-full__note--warn {
    margin-top: 16px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--c-graphite);
    background: rgba(0, 0, 0, 0.045);
    border: 1px solid var(--line);
    border-radius: 10px;
}

/* 開啟時鎖住背景捲動 */
body.demo-lock { overflow: hidden; }

/* DEMO 響應式 */
@media (max-width: 860px) {
    .demos__grid { grid-template-columns: 1fr 1fr; }
    .demo-full { grid-template-columns: 1fr; }
    .demo-full__media { aspect-ratio: 16 / 9; }
}
@media (max-width: 520px) {
    .demos__grid { grid-template-columns: 1fr; }
    .demo-full__info { padding: 28px 22px; }
}
