﻿/* ════════════════════════════════
   全域重置 & 頁面背景
   ════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

.oq-page-bg {
    min-height: 100vh;
    background: #f4f6f2;
    padding: 168px 16px 80px;
}
@media (max-width: 767px) {
    .oq-page-bg { padding: 120px 12px 64px; }
}

/* ════════════════════════════════
   主卡片
   ════════════════════════════════ */
.oq-wrap { max-width: 680px; margin: 0 auto; }

.oq-card {
    background: #fff;
    border-radius: 20px;
    box-shadow:
        0 1px 3px rgba(0,0,0,.06),
        0 8px 32px rgba(103,141,88,.10);
    overflow: hidden;
}

/* 頂部裝飾條 */
.oq-card-header {
    background: linear-gradient(135deg, #678d58 0%, #8ab575 100%);
    padding: 36px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.oq-card-header::before {
    content: '';
    position: absolute;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.07);
    top: -60px; right: -40px;
}
.oq-card-header::after {
    content: '';
    position: absolute;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    bottom: -30px; left: 20px;
}
.oq-header-icon {
    width: 56px; height: 56px;
    background: rgba(255,255,255,.2);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
    position: relative; z-index: 1;
}
.oq-header-icon svg { width: 28px; height: 28px; }
.oq-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    position: relative; z-index: 1;
    letter-spacing: .3px;
}
.oq-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,.8);
    margin: 0;
    line-height: 1.6;
    position: relative; z-index: 1;
}

/* 卡片內容區 */
.oq-card-body { padding: 36px 40px 40px; }
@media (max-width: 767px) {
    .oq-card-header { padding: 28px 24px 24px; }
    .oq-card-body   { padding: 28px 20px 32px; }
}

/* ════════════════════════════════
   步驟進度條
   ════════════════════════════════ */
.oq-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 36px;
    gap: 0;
}
.oq-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 130px;
}
.oq-step-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #eef0ec;
    color: #bbb;
    font-size: 14px;
    font-weight: 700;
    line-height: 38px;
    text-align: center;
    transition: background .35s, color .35s, transform .35s;
    border: 2px solid transparent;
    position: relative;
}
/* 完成狀態：打勾 */
.oq-step.done .oq-step-circle {
    background: #678d58;
    color: #fff;
    font-size: 0;
}
.oq-step.done .oq-step-circle::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -58%) rotate(45deg);
    width: 7px; height: 12px;
    border-right: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
}
/* 進行中狀態 */
.oq-step.active .oq-step-circle {
    background: #678d58;
    color: #fff;
    border-color: #a6c48a;
    box-shadow: 0 0 0 4px rgba(103,141,88,.18);
    transform: scale(1.08);
}
.oq-step-label {
    font-size: 11px;
    color: #bbb;
    margin-top: 8px;
    white-space: nowrap;
    letter-spacing: .2px;
    transition: color .3s;
    font-weight: 500;
}
.oq-step.active .oq-step-label { color: #678d58; }
.oq-step.done   .oq-step-label { color: #a6c48a; }

.oq-step-line {
    flex: 1;
    height: 2px;
    background: #eef0ec;
    margin-top: 18px; /* 對齊圓圈中心 */
    border-radius: 1px;
    transition: background .4s;
}
.oq-step-line.done { background: #a6c48a; }

/* ════════════════════════════════
   區塊切換
   ════════════════════════════════ */
.oq-section        { display: none; }
.oq-section.active { display: block; }

/* ════════════════════════════════
   表單元素
   ════════════════════════════════ */
.oq-form-group { margin-bottom: 22px; }

.oq-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    letter-spacing: .2px;
    text-transform: uppercase;
}
.oq-label-icon {
    width: 14px; height: 14px;
    opacity: .5;
    flex-shrink: 0;
}

.oq-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    border: 1.5px solid #e4e8e2;
    border-radius: 12px;
    transition: border-color .2s, box-shadow .2s, background .2s;
    outline: none;
    -webkit-appearance: none;
    letter-spacing: .5px;
}
.oq-input::placeholder { color: #c0c0c0; font-size: 14px; letter-spacing: 0; }
.oq-input:hover { border-color: #c0d0b8; background: #fff; }
.oq-input:focus {
    border-color: #678d58;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(103,141,88,.12);
}

/* 驗證碼輸入群組 */
.oq-code-group { display: flex; gap: 10px; }
.oq-code-group .oq-input {
    flex: 1;
    letter-spacing: 4px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
}

#btn-send-code {
    flex: 0 0 auto;
    min-width: 110px;
    height: 48px;
    padding: 0 18px;
    border: 1.5px solid #678d58;
    border-radius: 12px;
    background: #fff;
    color: #678d58;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s;
    white-space: nowrap;
    letter-spacing: .3px;
}
#btn-send-code:hover:not(:disabled) {
    background: #678d58;
    color: #fff;
}
#btn-send-code:disabled {
    border-color: #ddd;
    color: #bbb;
    cursor: not-allowed;
}

.oq-countdown {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #a0a0a0;
    margin-top: 6px;
    min-height: 18px;
    padding-left: 2px;
}
.oq-countdown::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #678d58;
    flex-shrink: 0;
    display: none;
}
.oq-countdown.ticking::before { display: block; }

/* ════════════════════════════════
   按鈕
   ════════════════════════════════ */
.oq-btn-primary {
    display: block;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #678d58 0%, #7fa56c 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    margin-top: 10px;
    letter-spacing: .4px;
    box-shadow: 0 4px 16px rgba(103,141,88,.30);
}
.oq-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(103,141,88,.38);
}
.oq-btn-primary:active:not(:disabled) { transform: translateY(0); }
.oq-btn-primary:disabled {
    background: #c8c8c8;
    box-shadow: none;
    cursor: not-allowed;
}

.oq-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: 1.5px solid #c8d8c0;
    border-radius: 10px;
    color: #678d58;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    letter-spacing: .2px;
}
.oq-btn-ghost:hover {
    background: #f0f7ec;
    border-color: #678d58;
    color: #678d58;
    text-decoration: none;
}

/* ════════════════════════════════
   提示訊息
   ════════════════════════════════ */
.oq-alert {
    display: none;
    align-items: flex-start;
    gap: 10px;
    border-radius: 12px;
    padding: 13px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.oq-alert-error {
    background: #fef5f5;
    border: 1px solid #fcc;
    color: #c0392b;
}
.oq-alert-info {
    background: #f2f9f0;
    border: 1px solid #c0d8b4;
    color: #3a6630;
}
.oq-alert.is-visible { display: flex; }

/* ════════════════════════════════
   載入動畫
   ════════════════════════════════ */
.oq-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    gap: 12px;
}
.oq-loading.is-visible { display: flex; }
.oq-spinner {
    width: 38px; height: 38px;
    border: 3px solid #e8ede5;
    border-top-color: #678d58;
    border-radius: 50%;
    animation: oq-spin .75s linear infinite;
}
@keyframes oq-spin { to { transform: rotate(360deg); } }
.oq-loading-text { font-size: 13px; color: #999; }

/* ════════════════════════════════
   查詢結果：標頭摘要列
   ════════════════════════════════ */
.oq-result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f0f0f0;
}
.oq-summary-left h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0 0 4px;
}
.oq-summary-left p {
    font-size: 12.5px;
    color: #999;
    margin: 0;
    line-height: 1.4;
}
.oq-summary-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f2f9f0;
    border: 1px solid #c0d8b4;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #3a6630;
    white-space: nowrap;
}

/* ════════════════════════════════
   訂單卡片
   ════════════════════════════════ */
.oq-order-list { display: flex; flex-direction: column; gap: 16px; }

.oq-order-card {
    border: 1.5px solid #eaeaea;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .25s, border-color .25s;
    background: #fff;
}
.oq-order-card:hover {
    border-color: #c8d8c0;
    box-shadow: 0 4px 20px rgba(103,141,88,.10);
}

/* 卡片頂部：訂單號 + 日期 */
.oq-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px;
    background: #f9fbf8;
    border-bottom: 1.5px solid #eef0ec;
}
.oq-order-num {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.oq-order-num strong {
    color: #678d58;
    font-size: 14px;
    letter-spacing: .3px;
}
.oq-order-date {
    font-size: 12px;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 卡片主體 */
.oq-order-body { padding: 16px 20px 14px; }

.oq-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

/* 標籤 */
.oq-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
}
.oq-tag::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .6;
    flex-shrink: 0;
}
.oq-tag-paid    { background: #eaf5e8; color: #2e7d32; }
.oq-tag-unpaid  { background: #fff4e3; color: #c8680a; }
.oq-tag-recon   { background: #e5f1fc; color: #1565c0; }
.oq-tag-fail    { background: #fdecea; color: #c62828; }
.oq-tag-process { background: #f3f3f3; color: #666; }
.oq-tag-done    { background: #eaf5e8; color: #2e7d32; }
.oq-tag-ship    { background: #e4f3ff; color: #0066aa; }
.oq-tag-cancel  { background: #f3f3f3; color: #999; }

/* 物流資訊列 */
.oq-ship-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fbf8;
    border: 1px solid #e8ede5;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 12.5px;
    color: #777;
}
.oq-ship-info svg { flex-shrink: 0; opacity: .5; }

/* 商品明細展開按鈕 */
.oq-detail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #678d58;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 0;
    transition: opacity .2s;
}
.oq-detail-toggle:hover { opacity: .75; }
.oq-detail-toggle .oq-toggle-arrow {
    width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    background: #f0f7ec;
    border-radius: 50%;
    transition: transform .22s;
    font-size: 10px;
    color: #678d58;
}
.oq-detail-toggle.open .oq-toggle-arrow { transform: rotate(180deg); }

/* 商品明細表 */
.oq-detail-wrap {
    display: none;
    margin-top: 12px;
    border: 1.5px solid #eef0ec;
    border-radius: 10px;
    overflow: hidden;
}
.oq-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.oq-detail-table thead tr {
    background: #f4f7f2;
}
.oq-detail-table th {
    padding: 9px 13px;
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-align: left;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-bottom: 1.5px solid #eef0ec;
    white-space: nowrap;
}
.oq-detail-table td {
    padding: 10px 13px;
    color: #444;
    border-bottom: 1px solid #f4f4f4;
    vertical-align: middle;
    line-height: 1.4;
}
.oq-detail-table tbody tr:last-child td { border-bottom: none; }
.oq-detail-table tbody tr:nth-child(even) { background: #fafbfa; }
.oq-mini-tag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}
.oq-mini-gift { background: #eaf5e8; color: #2e7d32; }
.oq-mini-add  { background: #e4f3ff; color: #0066aa; }

/* 卡片底部：金額 */
.oq-order-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    background: #f9fbf8;
    border-top: 1.5px solid #eef0ec;
}
.oq-total-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}
.oq-total-right {
    display: flex;
    align-items: baseline;
    gap: 3px;
}
.oq-currency { font-size: 12px; color: #678d58; font-weight: 600; }
.oq-total-price {
    font-size: 22px;
    font-weight: 700;
    color: #678d58;
    line-height: 1;
}

/* ════════════════════════════════
   空狀態
   ════════════════════════════════ */
.oq-empty {
    text-align: center;
    padding: 52px 0;
}
.oq-empty-icon {
    width: 64px; height: 64px;
    background: #f0f7ec;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.oq-empty-icon svg { width: 28px; height: 28px; opacity: .4; }
.oq-empty p { font-size: 15px; color: #bbb; margin: 0 0 4px; font-weight: 600; }
.oq-empty small { font-size: 13px; color: #ccc; }

/* ════════════════════════════════
   重新查詢列
   ════════════════════════════════ */
.oq-restart-row { text-align: center; margin-top: 28px; }

/* ════════════════════════════════
   RWD
   ════════════════════════════════ */
@media (max-width: 600px) {
    .oq-code-group { flex-direction: column; }
    #btn-send-code { min-width: auto; width: 100%; }
    .oq-result-summary { flex-direction: column; align-items: flex-start; }
    .oq-detail-table th:nth-child(4),
    .oq-detail-table td:nth-child(4) { display: none; }
}