/* === 預售試算外掛樣式 v2.0 === */
*, *::before, *::after { box-sizing: border-box; }

.psc-wrap {
    max-width: 860px;
    margin: 0 auto;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    color: #1f2937;
}

/* card */
.psc-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px 28px;
    margin: 20px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.psc-card h3 {
    margin: 0 0 18px;
    color: #1e3a5f;
    font-size: 17px;
    border-left: 4px solid #2563eb;
    padding-left: 10px;
}

/* field */
.psc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 14px 0;
}
.psc-field > label {
    font-weight: 700;
    font-size: 14px;
    color: #374151;
}
.psc-field .psc-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

/* input 保留 padding */
.psc-field input[type="number"],
.psc-field input[type="text"],
.psc-field input[type="tel"],
.psc-field input[type="email"] {
    width: 100%;
    max-width: 380px;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
    color: #1f2937;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    appearance: auto;
}

/* select: 不設 padding，還原瀏覽器預設外觀 */
.psc-field select {
    width: 100%;
    max-width: 380px;
    padding: 0;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: 15px;
    color: #1f2937;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    cursor: pointer;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    background-image: none;
}

.psc-field input:focus,
.psc-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    background: #fff;
}
.psc-field input::placeholder { color: #b0b7c3; font-size: 14px; }

/* radio 統一高度 */
.psc-field .psc-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 2px;
    align-items: center;
}
.psc-field .psc-radio-group label {
    font-weight: 400;
    font-size: 14px;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    height: 32px;
    line-height: 32px;
    margin: 0;
    padding: 0;
}
.psc-field input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    vertical-align: middle;
}

/* unit toggle */
.psc-unit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.psc-unit-row input[type="number"] {
    flex: 1;
    min-width: 120px;
    max-width: 220px;
}
.psc-unit-toggle { display: flex; }
.psc-unit-toggle button {
    padding: 9px 16px;
    border: 1.5px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: background .15s, color .15s;
    line-height: 1;
}
.psc-unit-toggle button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.psc-unit-toggle button:first-child { border-radius: 7px 0 0 7px; }
.psc-unit-toggle button:last-child  { border-radius: 0 7px 7px 0; border-left: none; }

/* buttons */
.psc-btn {
    display: inline-block;
    padding: 11px 26px;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 6px 4px;
    transition: background .18s, transform .1s;
}
.psc-btn:active { transform: scale(.97); }
.psc-btn-primary   { background: #2563eb; color: #fff; }
.psc-btn-primary:hover { background: #1d4ed8; }
.psc-btn-secondary { background: #6b7280; color: #fff; }
.psc-btn-secondary:hover { background: #4b5563; }
.psc-btn-danger    { background: #ef4444; color: #fff; font-size: 13px; padding: 6px 14px; }
.psc-btn-danger:hover { background: #dc2626; }

/* other blocks */
.psc-other-block {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 16px;
    position: relative;
}
.psc-other-block h4 {
    margin: 0 0 14px;
    color: #1e3a5f;
    font-size: 15px;
    border-left: 3px solid #93c5fd;
    padding-left: 8px;
}
.psc-remove-btn { position: absolute; top: 14px; right: 14px; }

/* config display */
.psc-config-display {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 7px;
    padding: 10px 16px;
    font-size: 13px;
    color: #1d4ed8;
    margin-top: 4px;
    line-height: 1.8;
}
.psc-config-display strong { color: #1e3a5f; }

/* disclaimer */
.psc-disclaimer {
    color: #9ca3af;
    font-size: 13px;
    margin: 2px 0 18px;
    line-height: 1.6;
}

/* messages */
.psc-msg { padding: 11px 14px; border-radius: 7px; font-size: 14px; margin-top: 8px; }
.psc-msg.success { background: #dcfce7; color: #166534; }
.psc-msg.error   { background: #fee2e2; color: #991b1b; }

/* result table */
.psc-result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.psc-result-table th {
    background: #1e3a5f;
    color: #fff;
    padding: 12px 10px;
    text-align: center;
    font-size: 14px;
}
.psc-result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}
.psc-result-table tr:nth-child(even) td { background: #f8fafc; }
.psc-result-table .highlight-row td    { background: #fef9c3 !important; font-weight: 700; }
.psc-result-table .dark-row td         { background: #1e3a5f !important; color: #fff; font-weight: 700; }
.psc-result-table .section-title-row td {
    background: #f1f5f9;
    font-weight: 700;
    color: #1e3a5f;
    font-size: 13px;
    text-align: left;
    padding: 8px 12px;
    border-top: 2px solid #cbd5e1;
}
.psc-winner {
    background: #16a34a;
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 5px;
    vertical-align: middle;
}

/* summary */
.psc-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 8px 0;
}
.psc-summary-item { text-align: center; padding: 12px; background: #f8fafc; border-radius: 8px; }
.psc-summary-item .label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.psc-summary-item .value { font-size: 22px; font-weight: 700; color: #1e3a5f; }

/* detail table */
.psc-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.psc-detail-table th { background: #374151; color: #fff; padding: 8px; text-align: center; }
.psc-detail-table td { padding: 6px 8px; border-bottom: 1px solid #e5e7eb; text-align: right; }
.psc-detail-table td:first-child { text-align: center; }
.psc-grace-row td { background: #fef3c7; }

/* lead form */
.psc-lead-form h3 { margin-top: 0; }
.psc-result-actions { margin: 12px 0; }

/* responsive */
@media (max-width: 600px) {
    .psc-field input[type="number"],
    .psc-field input[type="text"],
    .psc-field input[type="tel"],
    .psc-field input[type="email"],
    .psc-field select { max-width: 100%; }
    .psc-result-table { font-size: 12px; }
    .psc-result-table td, .psc-result-table th { padding: 7px 6px; }
    .psc-summary-grid { grid-template-columns: 1fr 1fr; }
}
