/* ============ 前台樣式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
    background: #f2f5fa;
    color: #2b3445;
    line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ============ 投票首頁（1:1 復刻參考站） ============ */
.vote-page { background: #efefef; }
.vt-head {
    background: #f7941d; color: #fff; text-align: center;
    font-size: 15.5px; font-weight: 700; letter-spacing: 2px;
    padding: 9px 12px;
}
.vt-banner img { width: 100%; height: 150px; object-fit: cover; display: block; }
@media (min-width: 900px) { .vt-banner img { height: 190px; } }

.vt-main { max-width: 1080px; margin: 0 auto; padding: 0 12px 34px; }

.vt-rules {
    display: block; max-width: 430px; margin: 22px auto 4px; text-align: center;
    background: linear-gradient(180deg, #ff9d2e, #ff7300); color: #fff;
    font-size: 14.5px; font-weight: 600; padding: 8px 0; border-radius: 6px;
    box-shadow: 0 2px 6px rgba(255,115,0,.35); letter-spacing: 4px;
}
.vt-rules:hover { filter: brightness(1.05); }

.vt-ribbon { text-align: center; margin: 26px 0 20px; }
.vt-ribbon-icon { display: block; font-size: 24px; margin-bottom: -10px; position: relative; z-index: 1; }
.vt-ribbon-text {
    display: inline-block; background: #3cb54a; color: #fff;
    font-size: 16.5px; font-weight: 700; letter-spacing: 8px; text-indent: 8px;
    padding: 9px 40px;
    clip-path: polygon(2% 8%, 98% 0%, 100% 45%, 97% 100%, 3% 92%, 0% 55%);
    box-shadow: 0 2px 6px rgba(60,181,74,.35);
}

.works-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .works-grid { grid-template-columns: 1fr 1fr; gap: 16px; } }

.work-card {
    background: #fff; border-radius: 10px; padding: 10px 10px 12px;
    box-shadow: 0 1px 5px rgba(0,0,0,.08);
}
.work-thumb { display: block; aspect-ratio: 21 / 5; border-radius: 5px; overflow: hidden; background: #faf8f4; }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-no { text-align: center; font-size: 14px; color: #333; margin-top: 10px; }
.work-votes { text-align: center; font-size: 13px; color: #333; margin-top: 3px; }
.work-votes b { font-weight: 400; }
.btn-vote {
    display: block; margin-top: 10px; text-align: center;
    background: linear-gradient(180deg, #ffa03c, #ff7300); color: #fff;
    font-size: 13.5px; font-weight: 600; letter-spacing: 2px;
    padding: 7px 0; border-radius: 5px;
}
.btn-vote:hover { filter: brightness(1.05); }
.btn-vote:active { transform: scale(.99); }

.vt-foot { text-align: center; color: #9ca3af; font-size: 12px; padding: 8px 12px 26px; }

/* 活動規則彈窗 */
.vt-modal { position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.vt-modal[hidden] { display: none; }
.vt-modal-box { background: #fff; border-radius: 12px; max-width: 420px; width: 100%; padding: 22px 24px; }
.vt-modal-box h3 { text-align: center; color: #ff7300; font-size: 17px; margin-bottom: 12px; letter-spacing: 2px; }
.vt-modal-box ol { padding-left: 20px; font-size: 13.5px; color: #444; line-height: 1.9; }
.vt-modal-close {
    display: block; width: 100%; margin-top: 16px; border: none; cursor: pointer;
    background: linear-gradient(180deg, #ff9d2e, #ff7300); color: #fff;
    font-size: 14px; font-weight: 600; padding: 9px 0; border-radius: 6px; font-family: inherit;
}

/* ============ 二步驗證頁 ============ */
.verify-page { background: #eef2f9; }
.verify-header {
    background: #fff; border-bottom: 1px solid #e2e8f0; padding: 14px 24px;
    display: flex; align-items: baseline; gap: 12px;
}
.vh-brand { font-size: 19px; font-weight: 800; color: #1d4ed8; }
.vh-sub { font-size: 12px; color: #94a3b8; letter-spacing: 1px; }
.verify-main { max-width: 620px; margin: 30px auto 60px; padding: 0 16px; }

.steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; }
.step { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #94a3b8; }
.step i {
    font-style: normal; width: 24px; height: 24px; border-radius: 50%;
    background: #cbd5e1; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.step.active { color: #1d4ed8; font-weight: 700; }
.step.active i { background: #2563eb; }
.step.done { color: #16a34a; }
.step.done i { background: #22c55e; }

.verify-card { background: #fff; border-radius: 14px; box-shadow: 0 4px 18px rgba(30,41,59,.1); padding: 28px 30px; }
.verify-work { display: flex; gap: 16px; align-items: center; padding-bottom: 18px; border-bottom: 1px dashed #e2e8f0; margin-bottom: 20px; }
.verify-work.hidden { display: none; }
.verify-work img { width: 150px; height: 112px; object-fit: cover; border-radius: 8px; }
.vw-label { font-size: 12px; color: #94a3b8; }
.verify-work h2 { font-size: 19px; color: #1e293b; }
.vw-meta { font-size: 13px; color: #64748b; }
.vw-meta b { color: #dc2626; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.req { color: #dc2626; }
.field input {
    width: 100%; padding: 11px 14px; font-size: 15px; border: 1.5px solid #cbd5e1;
    border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; background: #f8fafc;
}
.field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); background: #fff; }
.field input.invalid { border-color: #dc2626; }
.hint { font-size: 12px; color: #94a3b8; margin-top: 5px; }
.err { display: none; font-size: 12.5px; color: #dc2626; margin-top: 5px; }
.err.show { display: block; }

/* 驗證碼輸入列 */
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; letter-spacing: 3px; font-size: 17px; }
.btn-send {
    flex: 0 0 auto; white-space: nowrap; cursor: pointer;
    border: 1.5px solid #2563eb; color: #2563eb; background: #fff;
    font-size: 13.5px; font-weight: 600; padding: 0 16px; border-radius: 9px;
    transition: background .15s, color .15s;
}
.btn-send:hover:not(:disabled) { background: #eff6ff; }
.btn-send:disabled { border-color: #cbd5e1; color: #94a3b8; background: #f8fafc; cursor: not-allowed; }

/* 示範環境驗證碼提示 */
.demo-tip {
    display: none; background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
    font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-bottom: 16px;
}
.demo-tip.show { display: block; }
.demo-tip .mono { font-family: Consolas, monospace; letter-spacing: 2px; font-size: 15px; }

/* 後台推送的提示（前台浮窗） */
.notice-toast {
    position: fixed; left: 50%; top: 16px; z-index: 9999;
    display: none; width: calc(100% - 32px); max-width: 420px;
    background: #fff; border-radius: 12px; border-left: 4px solid #ef4444;
    box-shadow: 0 12px 34px rgba(17,24,39,.22);
    padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: #b91c1c;
    align-items: flex-start; gap: 8px;
    transform: translate(-50%, -18px); opacity: 0;
}
.notice-toast.show { display: flex; animation: toastIn .3s cubic-bezier(.2,.9,.3,1.15) forwards; }
.notice-toast .nt-icon { font-size: 16px; line-height: 1.2; }
.notice-toast .nt-body { flex: 1; }
.notice-toast .nt-close {
    margin-left: auto; cursor: pointer; color: #ef4444; opacity: .55;
    font-size: 15px; line-height: 1; padding: 2px 3px;
}
.notice-toast .nt-close:hover { opacity: 1; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -18px); } to { opacity: 1; transform: translate(-50%, 0); } }
.notice-toast.hide { animation: toastOut .22s ease-in forwards; }
@keyframes toastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -14px); } }

/* 文字按鈕（未收到驗證碼） */
.btn-link {
    background: none; border: none; padding: 0; margin-top: 7px; cursor: pointer;
    color: #2563eb; font-size: 12.5px; font-family: inherit;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { color: #94a3b8; cursor: default; text-decoration: none; }

.btn-primary {
    width: 100%; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
    border: none; font-size: 16px; font-weight: 700; padding: 13px; border-radius: 10px; cursor: pointer;
    display: inline-block; text-align: center;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.back-link { text-align: center; margin-top: 14px; font-size: 13px; }

.success-box { text-align: center; padding: 20px 0; }
.success-icon { font-size: 54px; }
.success-box h2 { color: #16a34a; margin: 10px 0 6px; }
.success-box p { color: #64748b; font-size: 14px; margin-bottom: 20px; }

.site-footer { background: #1e293b; color: #94a3b8; text-align: center; font-size: 13px; padding: 18px 0; }

@media (max-width: 560px) {
    .verify-work { flex-direction: column; align-items: flex-start; }
    .steps { flex-wrap: wrap; }
}

/* ============ LINE授權投票頁（1:1 復刻參考站） ============ */
.lv-page { background: #fff; min-height: 100vh; display: flex; flex-direction: column; }

.lv-header {
    position: sticky; top: 0; z-index: 20;
    background: linear-gradient(90deg, #f7981d, #f5820b);
    color: #fff; height: 48px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.lv-back {
    position: absolute; left: 0; top: 0; height: 100%;
    width: 48px; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px; line-height: 1;
}
.lv-title { font-size: 18px; font-weight: 700; letter-spacing: 1px; }

.lv-main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 40px 16px 0; }

.lv-logo { display: flex; justify-content: center; }
.lv-logo svg { filter: drop-shadow(0 3px 8px rgba(6,199,85,.28)); }

.lv-heading { text-align: center; font-size: 21px; font-weight: 800; color: #111; margin-top: 22px; }
.lv-desc { text-align: center; font-size: 13.5px; color: #333; line-height: 1.7; margin: 10px auto 26px; max-width: 430px; }

.lv-card {
    background: #fff; border: 1px solid #ececec; border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.07);
    padding: 20px 18px 22px;
}
.lv-step { font-size: 16px; font-weight: 800; color: #111; margin-bottom: 14px; }

.lv-label { display: block; font-size: 13.5px; color: #333; margin: 4px 0 2px; }
.lv-label i { color: #e02020; font-style: normal; margin-right: 2px; }
.lv-input {
    width: 100%; border: 0; border-bottom: 1px solid #e5e5e5;
    padding: 12px 2px; font-size: 14.5px; color: #333;
    background: transparent; outline: none; border-radius: 0;
    transition: border-color .2s;
}
.lv-input::placeholder { color: #c3c3c3; }
.lv-input:focus { border-bottom-color: #f5820b; }
.lv-input.invalid { border-bottom-color: #e02020; }

.lv-code-row { display: flex; align-items: flex-end; gap: 10px; }
.lv-code-row .lv-input { flex: 1; }
.lv-send {
    flex-shrink: 0; border: 1px solid #dcdcdc; background: #f2f2f2; color: #666;
    font-size: 13.5px; padding: 8px 16px; border-radius: 4px; white-space: nowrap;
}
.lv-send:hover { background: #e8e8e8; }
.lv-send:disabled { opacity: .55; cursor: not-allowed; }

.lv-resend {
    display: inline-block; margin-top: 8px; border: 0; background: none;
    color: #999; font-size: 12px; text-decoration: underline; cursor: pointer;
}
.lv-resend:hover { color: #f5820b; }
.lv-resend:disabled { opacity: .5; cursor: not-allowed; }

.lv-tip {
    margin-top: 12px; background: #f0faf3; border: 1px solid #bfe8cd; color: #1a7f42;
    font-size: 13px; line-height: 1.6; padding: 9px 12px; border-radius: 6px;
}
.lv-tip .mono { font-family: Consolas, monospace; letter-spacing: 2px; font-size: 15px; }

.lv-confirm {
    display: block; width: 100%; margin-top: 22px;
    background: linear-gradient(90deg, #f7981d, #f5820b);
    color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 6px;
    padding: 13px 0; border-radius: 5px; text-align: center;
    box-shadow: 0 3px 8px rgba(245,130,11,.3);
}
.lv-confirm:hover { filter: brightness(1.05); }
.lv-confirm:active { transform: scale(.99); }
.lv-confirm:disabled { opacity: .6; cursor: wait; }

.lv-footer-art { width: 100%; line-height: 0; margin-top: 30px; }
.lv-footer-art img { width: 100%; display: block; }

/* 驗證成功頁（复用 lv 卡片） */
.success-box { text-align: center; padding: 10px 0 4px; }
.success-box h2 { font-size: 19px; color: #111; margin-top: 8px; }
.success-box p { font-size: 13px; color: #666; margin: 8px 0 16px; line-height: 1.7; }
.success-box .lv-confirm { letter-spacing: 2px; }

@media (max-width: 480px) {
    .lv-main { padding-top: 30px; }
    .lv-heading { font-size: 19px; }
    .lv-desc { font-size: 12.5px; }
}
