/*
 * rx-issue-kit 問題回報 widget 樣式
 *
 * 設計原則：
 *  - 全部 class 以 .rxi- 開頭，且屬性都寫死（含 font/box-sizing/line-height），
 *    避免被兩站既有 CSS（尤其 training 的 Bootstrap 4）汙染或汙染回去。
 *  - 浮層 z-index 高於一切內容（依平台浮層基線），並加邊框＋陰影與底層區隔。
 *  - ≤640px 改全螢幕表單，點擊區 ≥44px。
 */

.rxi-root, .rxi-root * {
    box-sizing: border-box;
}

/* ---------- 右下角觸發鈕 ---------- */

.rxi-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    background: #ea5514;
    color: #fff;
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
    transition: background .15s ease, transform .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.rxi-fab:hover, .rxi-fab:focus {
    background: #cf4610;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.rxi-fab svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: currentColor;
}

/* ---------- 遮罩與對話框 ---------- */

.rxi-overlay {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 2147483100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    background: rgba(17, 17, 17, .55);
}

.rxi-overlay.rxi-open {
    display: flex;
}

.rxi-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: auto;
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
}

.rxi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.rxi-head h2 {
    margin: 0;
    padding: 0;
    color: #333;
    font-size: 19px;
    font-weight: bold;
    line-height: 1.4;
}

.rxi-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #888;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.rxi-close:hover {
    background: #f2f2f2;
    color: #333;
}

.rxi-body {
    padding: 18px 20px 20px;
}

.rxi-intro {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdf3ee;
    color: #7a4326;
    font-size: 13px;
    line-height: 1.7;
}

/* ---------- 表單 ---------- */

.rxi-field {
    margin-bottom: 14px;
}

.rxi-field > label {
    display: block;
    margin: 0 0 6px;
    color: #444;
    font-size: 14px;
    font-weight: bold;
}

.rxi-req {
    color: #d33;
    font-weight: bold;
}

.rxi-input,
.rxi-select,
.rxi-textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
}

.rxi-textarea {
    min-height: 120px;
    resize: vertical;
}

.rxi-input:focus,
.rxi-select:focus,
.rxi-textarea:focus {
    border-color: #ea5514;
    outline: 2px solid rgba(234, 85, 20, .18);
    outline-offset: 0;
}

.rxi-hint {
    margin: 6px 0 0;
    color: #888;
    font-size: 12px;
    line-height: 1.6;
}

/* 蜜罐：對人隱形，機器人才會填 */
.rxi-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* ---------- 附件清單 ---------- */

.rxi-files {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.rxi-files li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    padding: 7px 10px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
}

.rxi-file-del {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #c33;
    font-size: 13px;
    cursor: pointer;
}

.rxi-file-del:hover {
    background: #fdeaea;
}

/* ---------- 訊息與按鈕 ---------- */

.rxi-msg {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-all;
}

.rxi-msg.rxi-show {
    display: block;
}

.rxi-msg.rxi-err {
    border: 1px solid #f0c2c2;
    background: #fdeaea;
    color: #b02a2a;
}

.rxi-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.rxi-btn {
    flex: 1 1 auto;
    min-height: 46px;
    padding: 12px 16px;
    border: 0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.rxi-btn-primary {
    background: #ea5514;
    color: #fff;
}

.rxi-btn-primary:hover {
    background: #cf4610;
}

.rxi-btn-primary[disabled] {
    background: #d9a68e;
    cursor: not-allowed;
}

.rxi-btn-ghost {
    flex: 0 0 auto;
    min-width: 96px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
}

.rxi-btn-ghost:hover {
    background: #f4f4f4;
}

/* ---------- 送出成功 ---------- */

.rxi-done {
    padding: 26px 20px 30px;
    text-align: center;
}

.rxi-done-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e8f6ec;
    color: #2f9e56;
    font-size: 32px;
    font-weight: bold;
    line-height: 58px;
}

.rxi-done h3 {
    margin: 0 0 10px;
    color: #333;
    font-size: 19px;
    font-weight: bold;
}

.rxi-done p {
    margin: 0 0 6px;
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.rxi-no {
    display: inline-block;
    margin: 6px 0 12px;
    padding: 7px 16px;
    border-radius: 6px;
    background: #f4f4f4;
    color: #ea5514;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* ---------- 手機 ---------- */

@media only screen and (max-width: 640px) {
    .rxi-fab {
        right: 12px;
        bottom: 12px;
        padding: 12px 16px;
        font-size: 14px;
    }

    .rxi-overlay {
        padding: 0;
    }

    .rxi-dialog {
        min-height: 100%;
        max-width: none;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .rxi-actions {
        flex-direction: column-reverse;
    }

    .rxi-btn-ghost {
        width: 100%;
    }
}

/* 列印時不要出現 */
@media print {
    .rxi-fab, .rxi-overlay {
        display: none !important;
    }
}
