/* 白米龜芳名錄工具 — 前端樣式 v1.2 */

.rtd-wrapper {
    max-width: 800px;
    margin: 30px auto;
    font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
    /* 底圖：取消註解下面這行並改成你要的圖片路徑 */
    /* background: url('/wp-content/uploads/rtd-bg-desktop.jpg') center top / 100% auto repeat-y; */
    /* padding: 30px 5%; */
}

/* ===== 進度條 ===== */
.rtd-progress-section {
    background: linear-gradient(135deg, #FFF8E7, #FDF0E0);
    border: 1px solid #C8962E;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
}
.rtd-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.rtd-progress-title {
    font-size: 18px;
    font-weight: bold;
    color: #8B0000;
}
.rtd-progress-numbers {
    font-size: 16px;
    font-weight: bold;
    color: #C8962E;
}
.rtd-progress-bar {
    background: #E0D5C0;
    border-radius: 20px;
    height: 24px;
    overflow: hidden;
}
.rtd-progress-fill {
    background: linear-gradient(90deg, #C8962E, #E8B84E);
    height: 100%;
    border-radius: 20px;
    transition: width 0.8s ease;
}
.rtd-progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* ===== 捐贈表單 ===== */
.rtd-donate-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.rtd-donate-title {
    font-size: 22px;
    color: #8B0000;
    margin: 0 0 8px;
}
.rtd-donate-desc {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}
.rtd-label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    font-size: 15px;
}
.rtd-jin-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.rtd-jin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 90px;
    font-family: inherit;
}
.rtd-jin-btn:hover {
    border-color: #C8962E;
    background: #FFF8E7;
}
.rtd-jin-btn.rtd-jin-active {
    border-color: #8B0000;
    background: #FFF0F0;
    color: #8B0000;
    box-shadow: 0 0 0 1px #8B0000;
}
.rtd-jin-price {
    font-size: 12px;
    font-weight: normal;
    color: #999;
    margin-top: 4px;
}
/* 下拉選單 */
.rtd-jin-dropdown-wrap {
    margin-top: 12px;
}
.rtd-label-more {
    margin-bottom: 6px;
}
.rtd-jin-dropdown {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    color: #333;
    background: #f9f9f9;
    cursor: pointer;
    appearance: auto;
}
.rtd-jin-dropdown:focus {
    border-color: #8B0000;
    outline: none;
    box-shadow: 0 0 0 1px #8B0000;
}
.rtd-jin-dropdown.rtd-dropdown-active {
    border-color: #8B0000;
    background: #FFF0F0;
    color: #8B0000;
    font-weight: bold;
}
.rtd-jin-active .rtd-jin-price {
    color: #8B0000;
}
.rtd-amount-display {
    font-size: 20px;
    text-align: center;
    margin: 15px 0;
    color: #333;
}
.rtd-total-amount {
    font-weight: bold;
    color: #8B0000;
    font-size: 26px;
}
.rtd-submit-btn {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #8B0000, #A52A2A) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 10px;
    font-size: 20px !important;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}
.rtd-submit-btn:hover {
    background: linear-gradient(135deg, #6B0000, #8B0000) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139,0,0,0.3);
}
.rtd-submit-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.rtd-submit-btn.rtd-loading {
    opacity: 0.7;
    pointer-events: none;
}
.rtd-note {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 10px;
}

/* ===== 芳名錄（仿古直書格式） ===== */
.rtd-donors-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 每一行的容器 — 由右至左 */
.rtd-honor-row {
    display: flex !important;
    flex-direction: row-reverse !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    background: #F5ECD7;
    border: 2px solid #C8962E;
    border-radius: 6px;
    padding: 8px 4px;
    margin-bottom: 4px;
}
.rtd-honor-row > .rtd-roll-col {
    flex-shrink: 0;
}

/* 每一欄共通 */
.rtd-roll-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 3px;
    min-width: 38px;
    border-left: 1px solid rgba(200,150,46,0.25);
}
.rtd-roll-col:last-child {
    border-left: none;
}

/* 直排字元 */
.rtd-v-char {
    display: block;
    text-align: center;
    line-height: 1.5;
    font-size: 16px;
    color: #1a1a1a;
    font-weight: bold;
}

/* 上方水平標題「芳名錄」 */
.rtd-roll-title {
    width: 100%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #8B0000;
    padding: 12px 0;
    border-bottom: 2px solid #C8962E;
    margin-bottom: 8px;
    letter-spacing: 8px;
}
/* 第二欄：欄位標題（斤數｜敬獻芳名） */
.rtd-roll-label-col {
    background: rgba(139,0,0,0.08);
    border-left: 2px solid #C8962E !important;
    min-width: 40px;
}
.rtd-roll-label-col .rtd-v-char {
    color: #8B0000;
    font-weight: bold;
    font-size: 15px;
}

/* 斤數分組標題欄 */
.rtd-roll-group-header {
    background: rgba(139,0,0,0.08);
    min-width: 38px;
    border-left: 2px solid #C8962E !important;
}
.rtd-roll-group-header .rtd-v-char {
    color: #8B0000;
    font-size: 15px;
    font-weight: bold;
}
.rtd-roll-group-header .rtd-v-count {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(139,0,0,0.3);
}

/* 捐贈者欄 */
.rtd-roll-donor {
    gap: 0;
}
/* 斤數（上半） */
.rtd-roll-jin {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(200,150,46,0.5);
    margin-bottom: 4px;
}
.rtd-roll-jin .rtd-v-char {
    font-size: 14px;
    color: #8B0000;
    font-weight: bold;
    line-height: 1.4;
}
/* 姓名（下半） */
.rtd-roll-name {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.rtd-roll-name .rtd-v-char {
    font-size: 16px;
    color: #1a1a1a;
    font-weight: bold;
    line-height: 1.5;
}

/* 空狀態 */
.rtd-donors-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* 統計 */
.rtd-donors-stats {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #C8962E;
    font-size: 15px;
    color: #666;
    font-weight: bold;
}

/* ===== 提示訊息 ===== */
.rtd-notice {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}
.rtd-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}
.rtd-message-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}
.rtd-message-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* ===== RWD ===== */
@media (max-width: 600px) {
    .rtd-wrapper {
        margin: 15px 10px;
        /* 手機版底圖：取消註解下面這行 */
        /* background-image: url('/wp-content/uploads/rtd-bg-mobile.jpg') !important; */
    }
    .rtd-donate-section,
    .rtd-donors-section,
    .rtd-progress-section { padding: 15px; border-radius: 8px; }
    .rtd-jin-options { gap: 8px; }
    .rtd-jin-btn { min-width: calc(33.33% - 8px); padding: 10px 8px; font-size: 14px; }
    .rtd-roll-col { min-width: 32px; padding: 6px 2px; }
    .rtd-v-char { font-size: 14px; }
    .rtd-roll-header-col .rtd-v-char { font-size: 17px; }
    .rtd-progress-header { flex-direction: column; gap: 5px; }
}
