:root {
    --brand: #072178;
    /* 標頭藍 */
    --brand-2: #1f409b;
    /* 次要藍 */
    --brand-3: #ED6C00;
    /* 橘色 */
    --text: #333333;
    --grey1: #f6f7f9;
    --grey2: #d5d5d5;
    --grey3: #888888;
    --white: #ffffff;
    --red: #DC3545;
}

.survey-container {
    max-width: 1200px;
    margin: auto;
    padding: 24px;
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

    .survey-container .cardTop {
        background: var(--white);
        border-radius: 14px;
        overflow: hidden;
        margin-bottom: 20px
    }

    .survey-container .card__header {
        color: var(--text);
        padding: 16px 20px;
    }

    .survey-container h1 {
        margin: 0;
        font-size: 32px !important;
        text-align: center;
    }

    .survey-container h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 500;
    }

    .survey-container .section {
        padding: 20px
    }

    .survey-container .note {
        margin: 8px 0 0
    }

    /* 身分 chips */
    .survey-container .chips {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

        .survey-container .chips p {
            margin-bottom: inherit;
            color: inherit;
            line-height: 1.6;
            font-size: 16px;
            padding: 24px;
            padding-left: 0;
            padding-right: 0;
        }

        .survey-container .chips label {
            align-items: center;
            justify-content: center;
            display: flex;
        }

        .survey-container .chips label span {
            font-size: 13px;
            padding-left: 3px;
        }

        .survey-container .chips.Remark {
            text-align: center;
            justify-content: center;
            padding-top: 20px;
        }

    .survey-container .chip {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        background: var(--white)
    }
        .survey-container .chip.terms {
            justify-content: center;
            border-top:1px solid var(--grey3);
            padding-top:15px;
            margin-top:15px;


        }

    .survey-container .chips .chip:first-of-type {
        padding-left: 3px;
    }

    .survey-container .chip input {
        transform: scale(1.1)
    }



    .survey-container .legend {
        margin: 0;
    }

    /* 表格 */
    .survey-container .table-wrap {
        overflow: auto
    }

    .survey-container table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0
    }

    .survey-container thead th {
        background: var(--brand);
        border-bottom: 1px solid var(--white);
        text-align: left;
        padding: 14px 12px;
        position: sticky;
        top: 0;
        font-weight: 500;
        color: var(--white);
    }

        .survey-container thead th:nth-child(1) {
            width: 8%;
        }

        .survey-container thead th:nth-child(2) {
            width: 20%;
        }

        .survey-container thead th:nth-child(3) {
            width: 45%;
        }

        .survey-container thead th:nth-child(4) {
            width: 27%;
        }

    .survey-container tbody td {
        background: var(--white);
        border-bottom: 1px solid var(--grey2);
        padding: 14px 12px;
        vertical-align: top
    }

    .survey-container .badge {
        display: inline-block;
        padding: 8px;
        border-radius: 10px;
        background: #eef6ff;
        color: var(--brand-2);
        font-weight: 600;
    }

    .survey-container .rating {
        display: flex;
        gap: 14px;
        align-items: center;
        flex-wrap: wrap
    }

        .survey-container .rating .opt {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px
        }

        .survey-container .rating input {
            width: 20px;
            height: 20px
        }

    /* 表單底部 */
    .survey-container .actions {
        display: flex;
        gap: 12px;
        justify-content: center;
        margin-top: 20px
    }

    .survey-container .btn {
        appearance: none;
        border: 1px solid var(--grey2);
        background: var(--white);
        border-radius: 10px;
        padding: 10px 16px;
        cursor: pointer;
        font-weight: 400
    }

        .survey-container .btn:hover {
            appearance: none;
            border: 1px solid var(--grey2);
            background: var(--white);
            border-radius: 10px;
            padding: 10px 16px;
            cursor: pointer;
            font-weight: 400
        }

        .survey-container .btn.primary {
            background: var(--brand);
            color: var(--white);
            border-color: var(--brand)
        }

        .survey-container .btn.grey {
            background: var(--grey2);
            color: var(--text);
            border-color: var(--grey3)
        }

    /* === 表單輸入欄位（文字、下拉、文字框）統一配色 === */
    .survey-container input[type="text"],
    .survey-container select,
    .survey-container textarea {
        padding: 10px 12px;
        /* 同 checkbox 的藍色系邊框 */
        border-radius: 8px;
        border: 1px solid var(--grey3);
        font-size: 15px;
        transition: all 0.25s ease;
        box-sizing: border-box;
        margin-right: 20px;
        margin-left: 5px;
    }

    .survey-container input[type="text"],
    .survey-container select {
        width: 35%;
    }

    .survey-container textarea {
        width: 90%;
    }

        /* hover 狀態 */
        .survey-container input[type="text"]:hover,
        .survey-container select:hover,
        .survey-container textarea:hover {
            background-color: #f0f4ff;
        }

        /* focus（點選輸入）狀態 */
        .survey-container input[type="text"]:focus,
        .survey-container select:focus,
        .survey-container textarea:focus {
            outline: none;
            background-color: #eef3ff;
            box-shadow: 0 0 0 3px rgba(7, 33, 120, 0.15);
        }

        /* placeholder 顏色 */
        .survey-container input[type="text"]::placeholder,
        .survey-container textarea::placeholder {
            color: #999;
        }

    /* 下拉選單箭頭樣式 */
    .survey-container select {
        appearance: none;
        background-image: url("data:image/svg+xml;utf8,<svg fill='%23444444' height='25' viewBox='0 0 24 24' width='25' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 25px;
        padding-right: 36px;
    }

    /* 多行文字框 */
    .survey-container textarea {
        resize: vertical;
        min-height: 120px;
    }

    .survey-container .TextWarning {
        color: var(--red);
        position: relative;
        top: -18px;
    }

/* 黑色遮罩 */
.popup-mask-feedback {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}
    /* 顯示用的 class */
    .popup-mask-feedback.show {
        display: flex;
    }

    /* 彈窗本體 */
    .popup-mask-feedback .popup-box {
        background: #ffffff;
        border-radius: 12px;
        padding: 28px 32px;
        max-width: 480px;
        width: 100%;
        text-align: center;
        box-shadow: 0 10px 30px rgba(0,0,0,0.20);
    }

#thank-popup.popup-mask-feedback .popup-box h3 {
    margin: 0 0 12px !important;
    font-size: 20px !important;
    color: #111 !important;
    font-weight: 500 !important;
}

.popup-mask-feedback .popup-box p {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 22px;
}

.popup-box p strong {
    font-weight: 500;
    color: #000;
}

.popup-mask-feedback .btn.primary {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand)
}

/* RWD：窄版改卡片（以 td 的 data-th 作為標籤） */
@media (max-width: 992px) {
    .survey-container thead th:nth-child(1) {
        width: 10%;
    }

    .survey-container thead th:nth-child(2) {
        width: 18%;
    }

    .survey-container thead th:nth-child(3) {
        width: 38%;
    }

    .survey-container thead th:nth-child(4) {
        width: 34%;
    }

    .survey-container input[type="text"],
    .survey-container select {
        width: 30%;
    }

    .survey-container textarea {
        width: 83%;
    }
}

@media (max-width: 768px) {
    .survey-container thead {
        display: none;
    }

    .survey-container table,
    .survey-container tbody,
    .survey-container tr,
    .survey-container td {
        display: block;
        width: 100%
    }

        .survey-container tbody tr {
            border: 1px solid var(--grey2);
            border-radius: 12px;
            margin: 0 0 14px;
            overflow: hidden;
            background: var(--white);
        }

        .survey-container tbody td {
            border: none;
            border-bottom: 1px solid var(--grey2);
            box-sizing: border-box;
        }

            .survey-container tbody td:last-child {
                border-bottom: none
            }

    .survey-container .col-no {
        background: var(--grey1);
        color: var(--white);
        font-weight: 700;
    }

    .survey-container tbody td[data-th]::before {
        content: attr(data-th) "\FF1A";
        display: inline;
        color: var(--text);
        margin-bottom: 6px;
    }

    .survey-container tbody td[data-th]::before {
        content: attr(data-th) "\FF1A";
        display: inline;
        color: var(--text);
        margin-bottom: 6px;
    }

    .survey-container .rating {
        display: inline-flex;
    }

    .survey-container .chips {
        gap: 0px 3px;
    }

    .survey-container .badge {
        background: var(--brand-2);
        color: var(--white);
    }

    .survey-container .btn {
        width: 100%;
    }

    .survey-container input[type="text"],
    .survey-container select {
        width: 100%;
    }

    .survey-container textarea {
        width: 100%;
    }

    .survey-container select[name="type"],
    .survey-container input[name="name"] {
        margin-bottom: 20px;
    }

    .survey-container .chip {
        gap: 1px;
        padding: 8px 2px;
    }

    .survey-container .chips.mb-0 {
        margin-bottom: 20px;
    }

        .survey-container .chips.mb-0 p {
            margin-bottom: 6px;
        }

        .survey-container .chips.mb-0 .chip {
            padding-bottom: 0;
        }

    .survey-container .TextWarning {
        top: -10px;
    }
}
