/**
 * PilotRun Design System
 *
 * 現代化 CSS 設計系統，用於逐步取代舊版 Bootstrap 2.x 浮動佈局
 *
 * 使用方式：
 * 1. 在模板 <head> 中引入此檔案（放在 css-min.css 之後）
 * 2. 使用 .pr-* 類別取代舊的 .span*, .account-management 等
 * 3. 參考 login.tpl 作為實作範例
 *
 * 版本：1.0.0
 * 建立日期：2025-11-26
 */

/* ============================================
   1. CSS 變數定義 (Design Tokens)
   ============================================ */
:root {
    /* 顏色系統 */
    --pr-color-primary: #5cb85c;
    --pr-color-primary-hover: #4cae4c;
    --pr-color-secondary: #6c757d;
    --pr-color-success: #5cb85c;
    --pr-color-warning: #ffc107;
    --pr-color-danger: #d9534f;
    --pr-color-info: #5bc0de;

    /* 文字顏色 */
    --pr-color-text: #333;
    --pr-color-text-secondary: #666;
    --pr-color-text-muted: #888;
    --pr-color-text-heading: #373839;

    /* 背景顏色 */
    --pr-color-bg: #f5f5f5;
    --pr-color-bg-white: #fff;
    --pr-color-bg-light: #f8f9fa;

    /* 邊框 */
    --pr-border-color: #bcbcbc;
    --pr-border-color-light: #dadce0;
    --pr-border-radius: 5px;
    --pr-border-radius-sm: 4px;

    /* 陰影 */
    --pr-shadow: 0 0 6px 3px #dedede;
    --pr-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --pr-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);

    /* 間距系統 (8px 基準) */
    --pr-spacing-xs: 4px;
    --pr-spacing-sm: 8px;
    --pr-spacing-md: 16px;
    --pr-spacing-lg: 24px;
    --pr-spacing-xl: 32px;
    --pr-spacing-2xl: 48px;

    /* 字體 (包含中文字體支援) */
    --pr-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    --pr-font-size-base: 14px;
    --pr-font-size-sm: 12px;
    --pr-font-size-lg: 16px;
    --pr-font-size-xl: 18px;
    --pr-font-size-h1: 18pt;
    --pr-font-size-h2: 14pt;

    /* 過渡動畫 */
    --pr-transition: 0.2s ease;

    /* 容器寬度 */
    --pr-container-sm: 450px;
    --pr-container-md: 600px;
    --pr-container-lg: 900px;
    --pr-container-xl: 1200px;

    /* 三欄佈局變數 (統一尺寸) */
    --pr-layout-max-width: 1400px;
    --pr-layout-gap: 24px;
    --pr-sidebar-width: 220px;
    --pr-aside-width: 220px;
}

/* ============================================
   2. 基礎佈局組件
   ============================================ */

/**
 * 頁面容器 - 基礎頁面設定
 * 注意：不使用 display: flex，因為會與舊版 css-min.css 衝突
 */
body.pr-page {
    min-height: 100vh;
    background: var(--pr-color-bg) !important;
}

/**
 * Header 區域修正 - 修正舊版 Bootstrap float 佈局導致的高度問題
 */
body.pr-page .header-wrap {
    overflow: hidden; /* 觸發 BFC 清除浮動 */
}

body.pr-page .header-wrap .row {
    display: flex;
    align-items: center;
    min-height: 50px;
}

body.pr-page .header-wrap .row::after {
    content: "";
    display: table;
    clear: both;
}

body.pr-page .header-wrap .span4,
body.pr-page .header-wrap .span20 {
    float: none;
    display: flex;
    align-items: center;
}

body.pr-page .header-wrap .span4 {
    flex: 0 0 auto;
}

body.pr-page .header-wrap .span20 {
    flex: 1;
    justify-content: flex-end;
}

/**
 * 主內容區域 - 自動填滿剩餘空間並置中內容
 */
.pr-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: var(--pr-spacing-xl) var(--pr-spacing-md);
}

/**
 * 置中容器 - 限制最大寬度並置中
 */
.pr-center {
    width: 100%;
    max-width: var(--pr-container-lg);
    margin: 0 auto;
}

.pr-center--sm { max-width: var(--pr-container-sm); }
.pr-center--md { max-width: var(--pr-container-md); }
.pr-center--lg { max-width: var(--pr-container-lg); }
.pr-center--xl { max-width: var(--pr-container-xl); }

/* ============================================
   3. 卡片組件
   ============================================ */

/**
 * 基礎卡片 - 白色背景帶邊框陰影
 */
.pr-card {
    background: var(--pr-color-bg-white) !important;
    border: 1px solid var(--pr-border-color) !important;
    border-radius: var(--pr-border-radius);
    box-shadow: var(--pr-shadow) !important;
    padding: var(--pr-spacing-lg) var(--pr-spacing-xl);
    box-sizing: border-box;
    width: 100%;
}

/**
 * 卡片標題
 */
.pr-card__title {
    font-size: var(--pr-font-size-h1);
    color: var(--pr-color-text-heading);
    margin: 0 0 var(--pr-spacing-md) 0;
    text-align: center;
}

.pr-card__subtitle {
    font-size: var(--pr-font-size-h2);
    color: var(--pr-color-text-heading);
    margin: 0 0 var(--pr-spacing-md) 0;
    text-align: center;
}

/**
 * 卡片區塊分隔
 */
.pr-card__section {
    padding: var(--pr-spacing-md) 0;
}

.pr-card__divider {
    border: none;
    border-top: 1px solid var(--pr-border-color-light);
    margin: var(--pr-spacing-lg) 0;
}

/* ============================================
   4. 表單組件
   ============================================ */

/**
 * 表單容器
 */
.pr-form {
    width: 100%;
}

/**
 * 表單群組 - 包含 label + input
 */
.pr-form__group {
    margin-bottom: var(--pr-spacing-md);
}

/**
 * 表單標籤
 */
.pr-form__label {
    display: block;
    font-weight: bold;
    margin-bottom: var(--pr-spacing-xs);
    color: var(--pr-color-text);
}

/**
 * 表單輸入框
 */
.pr-form__input,
.pr-form__select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: var(--pr-border-radius-sm);
    font-size: var(--pr-font-size-base);
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    transition: border-color var(--pr-transition), box-shadow var(--pr-transition);
    height: auto !important;
    min-height: 44px;
}

.pr-form__input:focus,
.pr-form__select:focus {
    border-color: var(--pr-color-primary);
    outline: none;
    box-shadow: 0 0 3px rgba(92, 184, 92, 0.3);
}

/**
 * 表單提交區
 */
.pr-form__actions {
    text-align: center;
    margin-top: var(--pr-spacing-lg);
}

/* ============================================
   5. 按鈕組件
   ============================================ */

/**
 * 基礎按鈕
 */
.pr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: var(--pr-font-size-base);
    font-weight: 500;
    border: none;
    border-radius: var(--pr-border-radius-sm);
    cursor: pointer;
    transition: background-color var(--pr-transition), box-shadow var(--pr-transition);
    text-decoration: none;
}

/**
 * 主要按鈕（綠色）
 */
.pr-btn--primary {
    background: var(--pr-color-primary);
    color: var(--pr-color-bg-white);
}

.pr-btn--primary:hover {
    background: var(--pr-color-primary-hover);
}

/**
 * 次要按鈕（灰色）
 */
.pr-btn--secondary {
    background: var(--pr-color-secondary);
    color: var(--pr-color-bg-white);
}

.pr-btn--secondary:hover {
    background: #5a6268;
}

/**
 * 外框按鈕
 */
.pr-btn--outline {
    background: var(--pr-color-bg-white);
    color: var(--pr-color-text);
    border: 1px solid var(--pr-border-color-light);
}

.pr-btn--outline:hover {
    background: var(--pr-color-bg-light);
    box-shadow: var(--pr-shadow-sm);
}

/**
 * 全寬按鈕
 */
.pr-btn--block {
    width: 100%;
}

/**
 * 按鈕尺寸
 */
.pr-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

.pr-btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/**
 * 成功按鈕（綠色）
 */
.pr-btn--success {
    background: var(--pr-color-primary);
    color: var(--pr-color-bg-white);
}

.pr-btn--success:hover {
    background: var(--pr-color-primary-hover);
}

/**
 * 危險按鈕（紅色）
 */
.pr-btn--danger {
    background: #dc3545;
    color: var(--pr-color-bg-white);
}

.pr-btn--danger:hover {
    background: #c82333;
}

/**
 * Google 登入按鈕
 */
.pr-btn--google {
    background: var(--pr-color-bg-white);
    color: #3c4043;
    border: 1px solid var(--pr-border-color-light);
    padding: 12px 20px;
    width: 100%;
    max-width: 280px;
}

.pr-btn--google:hover {
    background: var(--pr-color-bg-light);
    box-shadow: var(--pr-shadow-sm);
}

.pr-btn--google svg {
    margin-right: 12px;
}

/* ============================================
   6. 工具類別
   ============================================ */

/* 文字對齊 */
.pr-text-center { text-align: center; }
.pr-text-left { text-align: left; }
.pr-text-right { text-align: right; }

/* 間距 */
.pr-mt-sm { margin-top: var(--pr-spacing-sm); }
.pr-mt-md { margin-top: var(--pr-spacing-md); }
.pr-mt-lg { margin-top: var(--pr-spacing-lg); }
.pr-mt-xl { margin-top: var(--pr-spacing-xl); }

.pr-mb-sm { margin-bottom: var(--pr-spacing-sm); }
.pr-mb-md { margin-bottom: var(--pr-spacing-md); }
.pr-mb-lg { margin-bottom: var(--pr-spacing-lg); }
.pr-mb-xl { margin-bottom: var(--pr-spacing-xl); }

.pr-p-sm { padding: var(--pr-spacing-sm); }
.pr-p-md { padding: var(--pr-spacing-md); }
.pr-p-lg { padding: var(--pr-spacing-lg); }
.pr-p-xl { padding: var(--pr-spacing-xl); }

/* 顯示 */
.pr-hidden { display: none; }
.pr-flex { display: flex; }
.pr-flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   7. 訊息組件
   ============================================ */

.pr-alert {
    padding: var(--pr-spacing-sm) var(--pr-spacing-md);
    border-radius: var(--pr-border-radius-sm);
    font-size: var(--pr-font-size-sm);
    text-align: center;
    margin-top: var(--pr-spacing-md);
}

.pr-alert--warning {
    background: #fff3cd;
    border: 1px solid var(--pr-color-warning);
    color: #856404;
}

.pr-alert--error {
    background: #f8d7da;
    border: 1px solid var(--pr-color-danger);
    color: #721c24;
}

.pr-alert--success {
    background: #d4edda;
    border: 1px solid var(--pr-color-success);
    color: #155724;
}

.pr-alert--info {
    background: #d1ecf1;
    border: 1px solid var(--pr-color-info);
    color: #0c5460;
}

/* ============================================
   8. 頁尾組件
   ============================================ */

.pr-footer {
    padding: var(--pr-spacing-md);
    text-align: center;
    color: var(--pr-color-text-muted);
    font-size: var(--pr-font-size-sm);
}

/* ============================================
   9. 舊版相容覆寫
   ============================================ */

/**
 * 覆寫 .account-management 的固定高度問題
 * 當頁面同時使用舊版類別和新設計系統時使用
 */
.pr-page .account-management,
.pr-main .account-management {
    height: auto !important;
    min-height: 300px;
    padding-bottom: var(--pr-spacing-2xl) !important;
}

/**
 * 覆寫 span 類別的浮動
 */
.pr-page [class*="span"],
.pr-main [class*="span"] {
    float: none;
}

/**
 * 強制覆寫 body 和基礎元素樣式
 * 確保 .pr-page 內的元素不受舊版 CSS 影響
 */
body.pr-page {
    background: var(--pr-color-bg) !important;
    color: var(--pr-color-text) !important;
}

.pr-page .pr-card,
.pr-page .pr-main .pr-card {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--pr-color-bg-white) !important;
    color: var(--pr-color-text) !important;
}

.pr-page h1,
.pr-page h2,
.pr-page p,
.pr-page label,
.pr-page .pr-card__title,
.pr-page .pr-card__subtitle {
    color: var(--pr-color-text-heading) !important;
    visibility: visible !important;
}

.pr-page .pr-form__label {
    color: var(--pr-color-text) !important;
}

/**
 * 覆寫 .row 的負 margin 和 clearfix
 */
.pr-page .row {
    margin-left: 0 !important;
}

/**
 * 確保 .pr-main 作為 flex 容器正常工作
 */
.pr-page .pr-main {
    display: flex !important;
    flex: 1 !important;
}

/* ============================================
   10. 管理頁面佈局系統
   ============================================ */

/**
 * 管理頁面主容器
 * 用於有側邊欄的管理介面
 */
.pr-admin-layout {
    display: flex;
    gap: var(--pr-layout-gap);
    padding: 0 20px 40px;
    max-width: var(--pr-layout-max-width);
    margin: 0 auto;
}

/**
 * 頁面標題
 */
.pr-page-title {
    font-size: 24px;
    font-weight: normal;
    color: var(--pr-color-text);
    margin: 20px auto;
    padding-left: 20px;
    max-width: 1100px;
}

/**
 * 側邊欄 (左側)
 */
.pr-sidebar {
    width: var(--pr-sidebar-width);
    flex-shrink: 0;
    background: var(--pr-color-bg);
    border-radius: 8px;
    overflow: hidden;
}

.pr-sidebar__title {
    background: #666;
    color: #fff;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
}

.pr-sidebar__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pr-sidebar__item {
    border-bottom: 1px solid #e0e0e0;
}

.pr-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--pr-color-text);
    text-decoration: none;
    font-size: 13px;
    transition: background var(--pr-transition);
}

.pr-sidebar__link:hover {
    background: #e8e8e8;
}

.pr-sidebar__link--active {
    background: var(--pr-color-accent, #f5a623);
    color: #fff;
}

.pr-sidebar__link--active:hover {
    background: #e09520;
}

.pr-sidebar__section-title {
    padding: 12px 16px 8px;
    font-size: 12px;
    color: var(--pr-color-text-muted);
    font-weight: bold;
}

.pr-sidebar__icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.8;
}

.pr-sidebar__link--active .pr-sidebar__icon {
    opacity: 1;
    filter: brightness(0) invert(1);
}

.pr-sidebar__emoji {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.pr-sidebar__text {
    flex: 1;
}

/**
 * 主內容區（管理頁面）
 */
.pr-admin-content {
    flex: 1;
    min-width: 0; /* 防止 flex 項目溢出 */
}

/**
 * 右側欄 (統一寬度)
 * 使用此類別確保三欄佈局的右側欄寬度一致
 */
.pr-aside {
    flex: 0 0 var(--pr-aside-width);
    width: var(--pr-aside-width);
}

/**
 * 表單容器（適配現有 game-manage 表單結構）
 */
.pr-form-container {
    width: 100%;
}

/* 讓現有的 collapsible-section 樣式使用設計系統變數 */
.pr-admin-content .collapsible-section {
    background: var(--pr-color-bg-white);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--pr-shadow-sm);
    overflow: hidden;
}

.pr-admin-content .collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: var(--pr-color-bg-white);
    border-bottom: 1px solid transparent;
    transition: background var(--pr-transition);
}

.pr-admin-content .collapsible-section.expanded .collapsible-header {
    border-bottom-color: #f0f0f0;
}

.pr-admin-content .collapsible-header:hover {
    background: #fafafa;
}

.pr-admin-content .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pr-admin-content .section-icon {
    font-size: 24px;
}

.pr-admin-content .section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--pr-color-text);
    margin: 0;
}

.pr-admin-content .section-subtitle {
    font-size: 12px;
    color: var(--pr-color-text-muted);
    margin-top: 2px;
}

.pr-admin-content .header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pr-admin-content .required-badge {
    background: #ff9800;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.pr-admin-content .optional-badge {
    background: #e0e0e0;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.pr-admin-content .status-icon {
    color: var(--pr-color-success);
    font-size: 16px;
}

.pr-admin-content .toggle-icon {
    color: var(--pr-color-text-muted);
    font-size: 12px;
    transition: transform var(--pr-transition);
}

.pr-admin-content .collapsible-section.expanded .toggle-icon {
    transform: rotate(0deg);
}

.pr-admin-content .collapsible-section:not(.expanded) .toggle-icon {
    transform: rotate(-90deg);
}

.pr-admin-content .collapsible-content {
    padding: 20px;
}

.pr-admin-content .collapsible-section:not(.expanded) .collapsible-content {
    display: none;
}

/* 表單輸入樣式 */
.pr-admin-content .enhanced-input {
    margin-bottom: 20px;
}

.pr-admin-content .enhanced-input > label {
    display: block;
    font-weight: 600;
    color: var(--pr-color-text);
    margin-bottom: 8px;
    font-size: 14px;
}

.pr-admin-content .enhanced-input .required-indicator {
    color: var(--pr-color-danger);
}

.pr-admin-content .form-input-wrapper {
    position: relative;
}

.pr-admin-content .enhanced-input input[type="text"],
.pr-admin-content .enhanced-input input[type="number"],
.pr-admin-content .enhanced-input input[type="date"],
.pr-admin-content .enhanced-input input[type="time"],
.pr-admin-content .enhanced-input textarea,
.pr-admin-content .enhanced-input select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color var(--pr-transition), box-shadow var(--pr-transition);
    background: var(--pr-color-bg-white);
}

.pr-admin-content .enhanced-input input:focus,
.pr-admin-content .enhanced-input textarea:focus,
.pr-admin-content .enhanced-input select:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.2);
}

.pr-admin-content .field-help {
    font-size: 12px;
    color: var(--pr-color-text-muted);
    margin-top: 6px;
}

.pr-admin-content .validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pr-color-success);
}

/* Sticky 提交按鈕容器 */
.pr-admin-content .sticky-submit-container {
    position: sticky;
    bottom: 0;
    background: var(--pr-color-bg-white);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.pr-admin-content .sticky-submit-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pr-admin-content .sticky-submit-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pr-admin-content .btn-submit {
    background: var(--pr-color-primary);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--pr-transition);
}

.pr-admin-content .btn-submit:hover {
    background: var(--pr-color-primary-hover);
}

.pr-admin-content .btn-draft {
    color: var(--pr-color-text-muted);
    text-decoration: none;
    padding: 12px 16px;
}

.pr-admin-content .btn-draft:hover {
    color: var(--pr-color-danger);
}

/* ============================================
   11. 彈性欄位佈局系統
   ============================================ */

/**
 * 欄位行
 */
.pr-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/**
 * 欄位 - 基礎
 */
.pr-col {
    flex: 1;
    min-width: 0;
}

/**
 * 欄位寬度變體
 */
.pr-col--narrow {
    flex: 0 0 120px;
}

.pr-col--small {
    flex: 0 0 160px;
}

.pr-col--medium {
    flex: 0 0 220px;
}

.pr-col--half {
    flex: 0 0 calc(50% - 10px);
}

.pr-col--third {
    flex: 0 0 calc(33.333% - 14px);
}

.pr-col--quarter {
    flex: 0 0 calc(25% - 15px);
}

/* ============================================
   12. 可折疊區塊組件
   ============================================ */

/**
 * 可折疊區塊容器
 */
.pr-section {
    background: var(--pr-color-bg-white);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: var(--pr-shadow-sm);
    overflow: hidden;
}

/**
 * 區塊標題列
 * 2025-11-27: 添加漸變背景和左邊框
 */
.pr-section__header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: linear-gradient(to right, #fafafa, #ffffff);
    border-left: 4px solid var(--pr-color-primary);
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.pr-section__header:hover {
    background: linear-gradient(to right, #f0f9f0, #ffffff);
}

/**
 * 區塊圖示
 */
.pr-section__icon {
    width: 32px;
    height: 32px;
    background: var(--pr-color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.pr-section__icon--orange { background: #f5a623; }
.pr-section__icon--purple { background: #9c27b0; }
.pr-section__icon--blue { background: #2196f3; }
.pr-section__icon--red { background: var(--pr-color-danger); }

/**
 * 區塊標題群組
 */
.pr-section__title-group {
    flex: 1;
}

.pr-section__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pr-color-text);
    margin: 0;
}

.pr-section__subtitle {
    font-size: 12px;
    color: var(--pr-color-text-muted);
    margin: 2px 0 0 0;
}

/**
 * 區塊徽章
 */
.pr-section__badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pr-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.pr-badge--required {
    background: #f5a623;
    color: #fff;
}

.pr-badge--optional {
    background: #e0e0e0;
    color: #666;
}

.pr-section__check {
    color: var(--pr-color-primary);
    font-size: 18px;
    margin-left: 8px;
}

.pr-section__toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    font-size: 10px;
    margin-left: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pr-section__header:hover .pr-section__toggle {
    background: #e5e7eb;
}

/**
 * 折疊狀態
 */
.pr-section--collapsed .pr-section__toggle {
    transform: rotate(-90deg);
}

.pr-section--collapsed .pr-section__body {
    display: none;
}

/**
 * 區塊內容
 */
.pr-section__body {
    padding: 20px;
}

/* ============================================
   13. 進階表單元件
   ============================================ */

/**
 * 表單群組（進階版）
 */
.pr-form-group {
    margin-bottom: 20px;
}

.pr-form-group:last-child {
    margin-bottom: 0;
}

/**
 * 表單標籤（進階版）
 * 2025-11-27: 調整字體大小提升可讀性
 */
.pr-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--pr-color-text);
}

.pr-label__required {
    color: var(--pr-color-danger);
    font-weight: 600;
}

.pr-label__optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 13px;
}

/**
 * 輸入框包裝器（帶驗證圖示）
 */
.pr-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/**
 * 輸入框
 * 2025-11-27: 優化高度、邊框、Focus 狀態
 */
.pr-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: var(--pr-font-size-base);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
    box-sizing: border-box;
    background-color: var(--pr-color-bg-white);
}

.pr-input:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
    transform: translateY(-1px);
}

.pr-input:hover:not(:focus) {
    border-color: #9ca3af;
}

.pr-input--valid {
    border-color: var(--pr-color-primary);
}

.pr-input--error {
    border-color: var(--pr-color-danger);
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.15);
}

/**
 * 輸入框驗證圖示
 * 2025-11-27: 添加彈出動畫
 */
@keyframes pr-checkmark-pop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.pr-input-check {
    position: absolute;
    right: 12px;
    color: var(--pr-color-primary);
    font-size: 16px;
    animation: pr-checkmark-pop 0.3s ease;
}

.pr-input-error {
    position: absolute;
    right: 12px;
    color: var(--pr-color-danger);
    font-size: 16px;
    animation: pr-checkmark-pop 0.3s ease;
}

/**
 * 文字區域
 * 2025-11-27: 統一樣式與輸入框一致
 */
.pr-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: var(--pr-font-size-base);
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    background-color: var(--pr-color-bg-white);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.pr-textarea:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

.pr-textarea:hover:not(:focus) {
    border-color: #9ca3af;
}

/**
 * 下拉選單
 * 2025-11-27: 統一樣式與輸入框一致
 */
.pr-select {
    width: 100%;
    min-height: 44px;
    padding: 10px 36px 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: var(--pr-font-size-base);
    line-height: 1.5;
    background-color: var(--pr-color-bg-white);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.pr-select:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

.pr-select:hover:not(:focus) {
    border-color: #9ca3af;
}

/**
 * 說明文字
 * 2025-11-27: 調整顏色提升可讀性
 */
.pr-help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.5;
}

/* ============================================
   14. Radio/Checkbox 卡片組件
   ============================================ */

/**
 * Radio 群組
 */
.pr-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/**
 * Radio 卡片 - 卡片化選擇設計
 * 用於任務分配模式等需要更清晰視覺呈現的選擇場景
 */
.pr-radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pr-radio-card:hover {
    border-color: var(--pr-color-primary);
    background: #f0fdf4;
}

.pr-radio-card--selected {
    border-color: var(--pr-color-primary);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

.pr-radio-card__label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    width: 100%;
}

.pr-radio-card__input {
    /* 隱藏原生 radio button，使用右側自定義指示器 */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pr-radio-card__content {
    flex: 1;
}

.pr-radio-card__icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 10px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.pr-radio-card--selected .pr-radio-card__icon {
    background: var(--pr-color-primary);
    color: white;
}

.pr-radio-card__indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d1d5db;
    transition: all 0.2s ease;
}

.pr-radio-card--selected .pr-radio-card__indicator {
    background: var(--pr-color-primary);
    border-color: var(--pr-color-primary);
    color: #fff;
    font-size: 12px;
}

.pr-radio-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--pr-color-text);
    margin-bottom: 4px;
}

.pr-radio-card__title-icon {
    font-size: 16px;
}

.pr-radio-card__desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/**
 * Checkbox 群組
 */
.pr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/**
 * Checkbox 標籤
 */
.pr-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--pr-font-size-base);
    color: var(--pr-color-text);
}

.pr-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   15. 圖片上傳組件
   2025-11-27: 添加虛線邊框和 hover 效果
   ============================================ */

/**
 * 圖片上傳容器
 */
.pr-image-upload {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 16px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.pr-image-upload:hover {
    border-color: var(--pr-color-primary);
    background: #f0fdf4;
}

/**
 * 圖片預覽
 */
.pr-image-preview {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--pr-color-bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pr-color-text-muted);
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.pr-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/**
 * 圖片上傳資訊
 */
.pr-image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/**
 * 上傳按鈕
 */
.pr-btn-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--pr-color-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(92, 184, 92, 0.2);
}

.pr-btn-upload:hover {
    background: var(--pr-color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(92, 184, 92, 0.3);
}

.pr-btn-upload:active {
    transform: translateY(0);
}

/**
 * 圖片規格說明
 */
.pr-image-specs {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
}

/* ============================================
   16. 主題選擇卡片
   ============================================ */

/**
 * 主題卡片網格
 */
.pr-theme-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/**
 * 主題卡片
 */
.pr-theme-card {
    width: 100px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--pr-transition);
}

.pr-theme-card:hover {
    border-color: #ccc;
}

.pr-theme-card--selected {
    border-color: #f5a623;
}

.pr-theme-card__preview {
    height: 60px;
    background: #e0e0e0;
}

.pr-theme-card__name {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--pr-color-text);
    background: var(--pr-color-bg);
}

.pr-theme-card--selected .pr-theme-card__name {
    background: #fff8e1;
    font-weight: 500;
}

/* ============================================
   17. 管理頁面底部操作區
   ============================================ */

/**
 * 底部操作區
 */
.pr-admin-footer {
    background: var(--pr-color-bg-white);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--pr-shadow-sm);
}

.pr-admin-footer__progress {
    font-size: 13px;
    color: var(--pr-color-text-secondary);
}

.pr-admin-footer__actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   18. 附加表單元件樣式
   ============================================ */

/**
 * 輸入框後綴（如：分）
 */
.pr-input-wrapper--suffix {
    position: relative;
}

.pr-input-wrapper--suffix .pr-input {
    padding-right: 36px;
}

.pr-input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pr-color-text-muted);
    font-size: 13px;
    pointer-events: none;
}

/**
 * 行內 Radio 組（水平排列）
 */
.pr-radio-inline {
    display: flex;
    gap: 24px;
    align-items: center;
}

.pr-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--pr-color-text);
}

.pr-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--pr-color-primary);
    cursor: pointer;
}

/**
 * 選填標籤樣式
 */
.pr-badge--optional {
    background: #e0e0e0;
    color: #666;
}

/**
 * 文字輔助類別
 */
.pr-text-muted {
    color: var(--pr-color-text-muted);
}

.pr-text-sm {
    font-size: 12px;
}

.pr-mt-sm {
    margin-top: 8px;
}

/**
 * 小型圖片預覽
 */
.pr-image-preview--small {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/**
 * 禁用按鈕樣式
 */
.pr-btn-upload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
 * 19. 主題選擇器樣式
 * ============================================ */

/**
 * 主題選擇網格
 */
.pr-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    max-width: 600px;
}

/**
 * 主題選項
 */
.pr-theme-option {
    cursor: pointer;
}

.pr-theme-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pr-theme-option__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--pr-color-bg-white);
    transition: all 0.2s ease;
}

.pr-theme-option__color {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.pr-theme-option__name {
    font-size: 12px;
    color: var(--pr-color-text-secondary);
    text-align: center;
    font-weight: 500;
}

/* Hover 狀態 */
.pr-theme-option:hover .pr-theme-option__card {
    border-color: var(--pr-color-primary);
    background: #fff8e1;
}

/* 選中狀態 */
.pr-theme-option input[type="radio"]:checked + .pr-theme-option__card {
    border-color: var(--pr-color-primary);
    background: #fff8e1;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.2);
}

.pr-theme-option input[type="radio"]:checked + .pr-theme-option__card .pr-theme-option__name {
    color: var(--pr-color-primary);
    font-weight: 600;
}

/* 選中狀態的勾選標記 */
.pr-theme-option input[type="radio"]:checked + .pr-theme-option__card::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--pr-color-primary);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-theme-option__card {
    position: relative;
}

/* ============================================
   底部操作列 (Action Bar)
   用於表單底部的操作按鈕區域
   ============================================ */
.pr-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    bottom: 20px;
    margin-top: 24px;
    z-index: 10;
}

.pr-action-bar__progress {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pr-action-bar__progress strong {
    color: var(--pr-color-primary);
    font-size: 18px;
}

.pr-action-bar__buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* 刪除按鈕 - 降低視覺權重 */
.pr-btn--delete {
    background: transparent;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pr-btn--delete:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* 主要漸變按鈕 */
.pr-btn--primary-gradient {
    padding: 12px 32px;
    background: linear-gradient(135deg, #5cb85c 0%, #4cae4c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(92, 184, 92, 0.3);
    transition: all 0.2s ease;
}

.pr-btn--primary-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(92, 184, 92, 0.4);
}

.pr-btn--primary-gradient:active {
    transform: translateY(0);
}

/* 次要按鈕 */
.pr-btn--secondary-outline {
    padding: 10px 20px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pr-btn--secondary-outline:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

/* 響應式操作列 */
@media (max-width: 768px) {
    .pr-action-bar {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }

    .pr-action-bar__buttons {
        width: 100%;
        flex-direction: column;
    }

    .pr-action-bar__buttons .pr-btn--primary-gradient,
    .pr-action-bar__buttons .pr-btn--delete {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   微動效增強 (Micro-interactions)
   提升使用者互動體驗的動畫效果
   ============================================ */

/* 區塊展開/收合動畫 - Opt-in 模式
 * 需要在 .pr-section 上加 .pr-section--animated 才會啟用動畫
 * 避免影響現有不使用此動畫的區塊
 */
.pr-section--animated .pr-section__body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease,
                padding 0.3s ease;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.pr-section--animated.pr-section--expanded .pr-section__body {
    max-height: 5000px;
    opacity: 1;
    padding-top: inherit;
    padding-bottom: inherit;
}

/* 卡片 hover 浮起效果 */
.pr-card--hoverable {
    transition: all 0.2s ease;
}

.pr-card--hoverable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 按鈕點擊漣漪效果 */
.pr-btn--ripple {
    position: relative;
    overflow: hidden;
}

.pr-btn--ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.pr-btn--ripple:active::after {
    width: 200%;
    height: 200%;
}

/* 載入動畫 - 旋轉 */
@keyframes pr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pr-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--pr-color-primary);
    border-radius: 50%;
    animation: pr-spin 0.8s linear infinite;
}

.pr-spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
}

.pr-spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* 淡入動畫 */
@keyframes pr-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pr-fade-in {
    animation: pr-fade-in 0.3s ease forwards;
}

/* 脈衝動畫 - 用於提示 */
@keyframes pr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.pr-pulse {
    animation: pr-pulse 1.5s ease-in-out infinite;
}

/* 成功提示動畫 */
@keyframes pr-success-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pr-success-icon {
    animation: pr-success-bounce 0.4s ease;
}

/* 搖晃動畫 - 用於錯誤提示 */
@keyframes pr-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

.pr-shake {
    animation: pr-shake 0.4s ease;
}

/* 進度條動畫 */
.pr-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.pr-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pr-color-primary), #4cae4c);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* 骨架屏載入效果 */
@keyframes pr-skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.pr-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: pr-skeleton 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* 工具提示淡入 */
.pr-tooltip {
    position: relative;
}

.pr-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.pr-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* 表單群組 focus-within 效果 */
.pr-form__group--focusable {
    transition: background 0.2s ease;
    padding: 12px;
    margin: -12px;
    border-radius: 8px;
}

.pr-form__group--focusable:focus-within {
    background: #f0fdf4;
}

/* ============================================
   12. 共用面板組件 (從各模板提取)
   ============================================ */

/**
 * 側邊欄面板容器
 * 用於: UserManage, LeaderboardManage, MissionsManage, CreditsManage, Crowd
 */
.pr-sidebar-panel {
    background: var(--pr-color-bg-white);
    border-radius: 12px;
    box-shadow: var(--pr-shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

/**
 * 面板標題列
 * 漸層背景，白色文字
 */
.pr-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
}

.pr-panel-header.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.pr-panel-header.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.pr-panel-header.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.pr-panel-header.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

/**
 * 面板內容區
 */
.pr-panel-body {
    padding: 16px;
}

/**
 * 面板表單群組
 */
.pr-panel-form-group {
    margin-bottom: 14px;
}

.pr-panel-form-group:last-child {
    margin-bottom: 0;
}

.pr-panel-form-group label {
    display: block;
    font-size: 13px;
    color: var(--pr-color-text);
    margin-bottom: 6px;
}

/**
 * 面板下拉選單
 */
.pr-panel-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    height: auto;
    min-height: 42px;
    background: white;
}

.pr-panel-select:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

/**
 * 面板輸入框
 */
.pr-panel-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    height: auto;
    min-height: 42px;
    box-sizing: border-box;
}

.pr-panel-input:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

/**
 * 面板資訊列
 */
.pr-panel-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.pr-panel-info:last-of-type {
    border-bottom: none;
}

.pr-panel-info-label {
    color: var(--pr-color-text-muted);
}

.pr-panel-info-value {
    font-weight: 600;
    color: var(--pr-color-text);
}

/**
 * 面板操作區
 */
.pr-panel-actions {
    margin-top: 16px;
}

/**
 * 空狀態組件
 * 用於: PhotosManage, LeaderboardManage, Crowd, Chart, MissionsManage
 */
.pr-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--pr-color-text-muted);
}

.pr-empty-state__icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pr-empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--pr-color-text);
    margin-bottom: 8px;
}

.pr-empty-state__desc {
    font-size: 14px;
    line-height: 1.5;
}

/* ============================================
   25. 通知提示 (Notice/Alert)
   ============================================ */
.pr-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: var(--pr-border-radius-md, 8px);
    margin-bottom: 16px;
    background-color: var(--pr-color-bg-light);
    border: 1px solid var(--pr-border-color-light);
}

.pr-notice--info {
    background-color: #e3f2fd;
    border-color: #90caf9;
}

.pr-notice--success {
    background-color: #e8f5e9;
    border-color: #a5d6a7;
}

.pr-notice--warning {
    background-color: #fff3e0;
    border-color: #ffcc80;
}

.pr-notice--error {
    background-color: #ffebee;
    border-color: #ef9a9a;
}

.pr-notice__icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.pr-notice__content {
    flex: 1;
    min-width: 0;
}

.pr-notice__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pr-color-text);
    margin-bottom: 4px;
}

.pr-notice__text {
    font-size: 13px;
    color: var(--pr-color-text-secondary);
    line-height: 1.5;
}

.pr-notice__text strong {
    color: var(--pr-color-primary);
    font-weight: 600;
}

/* ==================== HR 任務組合包樣式 (v2.4.0) ==================== */

.pr-bundle-section {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.pr-bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pr-bundle-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pr-bundle-icon-main {
    font-size: 24px;
}

.pr-bundle-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--pr-color-text);
}

.pr-bundle-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.pr-bundle-toggle-icon {
    font-size: 10px;
    margin-left: 4px;
}

.pr-bundle-panel {
    margin-top: 16px;
}

.pr-bundle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.pr-bundle-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pr-bundle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.pr-bundle-card-icon {
    font-size: 36px;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 10px;
}

.pr-bundle-card-info {
    flex: 1;
    min-width: 0;
}

.pr-bundle-card-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--pr-color-text);
}

.pr-bundle-card-desc {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--pr-color-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pr-bundle-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pr-bundle-count {
    font-size: 12px;
    color: var(--pr-color-primary);
    font-weight: 500;
}

.pr-bundle-required {
    font-size: 11px;
    color: #f59e0b;
    background: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
}

.pr-bundle-add-btn {
    flex-shrink: 0;
    align-self: center;
}

.pr-bundle-loading,
.pr-bundle-empty,
.pr-bundle-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 32px;
    color: var(--pr-color-text-muted);
    font-size: 14px;
}

.pr-bundle-error {
    color: #dc3545;
}

/* Toast 通知樣式 */
.pr-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 90%;
    white-space: pre-line;
}

.pr-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pr-toast--success {
    background: #28a745;
}

.pr-toast--error {
    background: #dc3545;
}

.pr-toast--warning {
    background: #ffc107;
    color: #333;
}

.pr-toast--info {
    background: #17a2b8;
}

.pr-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.pr-toast-message {
    font-size: 14px;
    line-height: 1.4;
}

/* 配對建議 Toast 樣式 */
.pr-pair-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 380px;
    width: calc(100% - 48px);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.pr-pair-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.pr-pair-toast-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pr-pair-toast-icon {
    font-size: 20px;
}

.pr-pair-toast-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.pr-pair-toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.pr-pair-toast-close:hover {
    opacity: 1;
}

.pr-pair-toast-body {
    padding: 16px;
}

.pr-pair-toast-body p {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

.pr-pair-toast-body p:last-child {
    margin-bottom: 0;
}

.pr-pair-toast-mission {
    background: #f3f4f6;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px !important;
    font-size: 14px !important;
    color: #1f2937 !important;
}

.pr-pair-toast-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.pr-pair-toast-actions .pr-btn {
    flex: 1;
    justify-content: center;
    font-size: 13px;
    padding: 8px 12px;
}

.pr-pair-toast-actions .pr-btn--secondary {
    background: white;
    border: 1px solid #d1d5db;
    color: #6b7280;
}

.pr-pair-toast-actions .pr-btn--secondary:hover {
    background: #f3f4f6;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .pr-bundle-grid {
        grid-template-columns: 1fr;
    }

    .pr-bundle-card {
        flex-direction: column;
        text-align: center;
    }

    .pr-bundle-card-icon {
        margin: 0 auto;
    }

    .pr-bundle-card-meta {
        justify-content: center;
    }

    .pr-bundle-add-btn {
        width: 100%;
        margin-top: 12px;
    }

    /* 配對 Toast 響應式 */
    .pr-pair-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
        width: auto;
    }

    .pr-pair-toast-actions {
        flex-direction: column;
    }

    .pr-pair-toast-actions .pr-btn {
        width: 100%;
    }
}

/* ============================================
   20. 搜尋框組件
   ============================================ */

.pr-search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.pr-search-box__input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.pr-search-box__input:focus {
    outline: none;
    border-color: var(--pr-color-primary);
    box-shadow: 0 0 0 3px rgba(92, 184, 92, 0.15);
}

.pr-search-box__icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pr-color-text-muted);
    pointer-events: none;
}

/* ============================================
   21. 標籤雲組件
   ============================================ */

.pr-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pr-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pr-tag:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.pr-tag--active {
    background: var(--pr-color-primary);
    color: white;
}

.pr-tag--remove {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.pr-tag--remove:hover {
    opacity: 1;
}

/* ============================================
   22. 進度指示器
   ============================================ */

.pr-progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pr-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pr-color-primary), #4cae4c);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.pr-progress__bar--animated {
    background: linear-gradient(90deg, var(--pr-color-primary), #4cae4c, var(--pr-color-primary));
    background-size: 200% 100%;
    animation: pr-progress-shine 2s ease-in-out infinite;
}

@keyframes pr-progress-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pr-progress__label {
    font-size: 12px;
    color: var(--pr-color-text-secondary);
    margin-top: 4px;
    text-align: center;
}

/* ============================================
   23. 統計卡片
   ============================================ */

.pr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.pr-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border-left: 4px solid var(--pr-color-primary);
}

.pr-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pr-stat-card__label {
    font-size: 13px;
    color: var(--pr-color-text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.pr-stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--pr-color-text);
    line-height: 1;
    margin-bottom: 4px;
}

.pr-stat-card__change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pr-stat-card__change--positive {
    color: var(--pr-color-primary);
}

.pr-stat-card__change--negative {
    color: var(--pr-color-danger);
}

.pr-stat-card--blue { border-left-color: #3b82f6; }
.pr-stat-card--purple { border-left-color: #9333ea; }
.pr-stat-card--orange { border-left-color: #f59e0b; }
.pr-stat-card--red { border-left-color: #ef4444; }

/* ============================================
   24. 時間軸組件
   ============================================ */

.pr-timeline {
    position: relative;
    padding-left: 40px;
}

.pr-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.pr-timeline__item {
    position: relative;
    padding-bottom: 24px;
}

.pr-timeline__item:last-child {
    padding-bottom: 0;
}

.pr-timeline__marker {
    position: absolute;
    left: -34px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--pr-color-primary);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--pr-color-primary);
}

.pr-timeline__marker--completed {
    background: var(--pr-color-primary);
    box-shadow: 0 0 0 2px var(--pr-color-primary);
}

.pr-timeline__marker--pending {
    background: #e5e7eb;
    box-shadow: 0 0 0 2px #e5e7eb;
}

.pr-timeline__content {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pr-timeline__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--pr-color-text);
    margin-bottom: 4px;
}

.pr-timeline__desc {
    font-size: 13px;
    color: var(--pr-color-text-secondary);
    line-height: 1.5;
}

.pr-timeline__time {
    font-size: 12px;
    color: var(--pr-color-text-muted);
    margin-top: 6px;
}

/* ============================================
   25. 快速操作面板
   ============================================ */

.pr-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.pr-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.pr-quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.pr-quick-action__icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.pr-quick-action__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pr-color-text);
    text-align: center;
}

/* ============================================
   26. 表格增強組件
   ============================================ */

.pr-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pr-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.pr-table thead {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.pr-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--pr-color-text);
    border-bottom: 2px solid #e5e7eb;
}

.pr-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--pr-color-text-secondary);
    border-bottom: 1px solid #f0f0f0;
}

.pr-table tr:hover {
    background: #f9fafb;
}

.pr-table tr:last-child td {
    border-bottom: none;
}

.pr-table__actions {
    display: flex;
    gap: 6px;
}

.pr-table__action-btn {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
}

.pr-table__action-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.pr-table__action-btn--primary {
    background: #dcfce7;
    color: #166534;
}

.pr-table__action-btn--primary:hover {
    background: #bbf7d0;
}

.pr-table__action-btn--danger {
    background: #fee2e2;
    color: #991b1b;
}

.pr-table__action-btn--danger:hover {
    background: #fecaca;
}
