/* ============================================================
   product.css - 產品管理系統
   包含：我的產品、產品市集、版本管理、頁籤、表單、詳情頁、限制條件
   ============================================================ */

/* ============================================================
   區塊 1：通用變數與重置
   ============================================================ */
:root {
    --primary: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #e8f5e9;
    --blue: #1565c0;
    --blue-dark: #0d47a1;
    --blue-light: #e3f2fd;
    --red: #c62828;
    --red-light: #fde8e8;
    --orange: #e65100;
    --gray: #616161;
    --gray-dark: #424242;
    --gray-light: #f5f5f5;
    --border: #ddd;
    --border-light: #f0f0f0;
    --text: #333;
    --text-light: #666;
    --text-muted: #888;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ============================================================
   區塊 2：搜尋區塊
   ============================================================ */
.search-area {
    background: #f8f9fa;
    padding: 20px 25px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px 20px;
    box-shadow: var(--shadow);
}

.search-area .search-left {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    flex: 2;
}

.search-area .search-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.search-area .search-item label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}
.search-area .search-item .input-full,
.search-area .search-item select {
    padding: 9px 14px;
    border: 1px solid #d0d5dd;
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.search-area .search-item .input-full {
    width: 100%;
    min-width: 220px;
}
.search-area .search-item .input-full:focus,
.search-area .search-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}
.search-area .search-item select {
    min-width: 150px;
    cursor: pointer;
    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;
    padding-right: 35px;
}

.search-area .search-keyword { flex: 2; min-width: 200px; }
.search-area .search-keyword .input-full { min-width: unset; width: 100%; }

.search-area .search-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.search-area .search-btn { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.search-area .search-btn .gray-btn {
    padding: 9px 20px;
    font-size: 14px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    background: var(--gray);
    color: #fff !important;
    text-decoration: none;
}
.search-area .search-btn .gray-btn:hover {
    background: var(--gray-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 市集搜尋 */
.market-search-area {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: var(--radius);
    border: 1px solid #d0d5dd;
    margin-bottom: 20px;
}
.market-search-area .search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 15px;
}
.market-search-area .search-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.market-search-area .search-keyword { flex: 2; min-width: 200px; }
.market-search-area .search-item select,
.market-search-area .search-item .input-full {
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    min-width: 140px;
    box-sizing: border-box;
}
.market-search-area .search-item select:focus,
.market-search-area .search-item .input-full:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}
.market-search-area .search-item .input-full { width: 100%; }
.market-search-area .search-btn { flex-direction: row; align-items: center; gap: 8px; }
.market-search-area .search-btn .gray-btn {
    padding: 8px 18px;
    font-size: 14px;
    border-radius: 6px;
    background: var(--gray);
    color: #fff !important;
    border: none;
    cursor: pointer;
}
.market-search-area .search-btn .gray-btn:hover { background: var(--gray-dark); }

/* ============================================================
   區塊 3：表格
   ============================================================ */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0;
}

.formtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--border);
}
.formtable th,
.formtable td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    vertical-align: middle;
}
.formtable th.label-col {
    width: 15%;
    background: #f8f9fa;
    text-align: left;
    color: var(--text);
    font-weight: normal;
}
.formtable td.input-col {
    width: 85%;
    text-align: left;
    background: #fff;
}
.formtable .section-title {
    background: #e9ecef;
    color: #495057;
    font-weight: bold;
    text-align: center;
    font-size: 15px;
    letter-spacing: 1px;
    padding: 10px 0;
}

/* 表格底部 */
.table-footer { margin-top: 10px; font-size: 14px; color: var(--text-muted); }

/* ============================================================
   區塊 4：按鈕
   ============================================================ */
.green-btn {
    background: var(--primary);
    color: #fff !important;
    padding: 5px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: 26px;
    min-height: 26px;
    transition: background 0.2s;
}
.green-btn:hover { background: var(--primary-dark); }

.blue-btn {
    background: var(--blue);
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: 26px;
    min-height: 26px;
    transition: background 0.2s;
}
.blue-btn:hover { background: var(--blue-dark); }

.orange-btn {
    background: var(--orange);
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: 26px;
    min-height: 26px;
    transition: background 0.2s;
}
.orange-btn:hover { background: #bf360c; }

.red-btn {
    background: var(--red);
    color: #fff !important;
    padding: 4px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: 26px;
    min-height: 26px;
    transition: background 0.2s;
}
.red-btn:hover { background: #b71c1c; }

.gray-btn {
    background: var(--gray);
    color: #fff !important;
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    display: inline-block;
    line-height: 26px;
    min-height: 26px;
    transition: background 0.2s;
}
.gray-btn:hover { background: var(--gray-dark); }

.btn-group { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }

/* 取消按鈕 */
.cancel-btn {
    display: inline-block;
    padding: 8px 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
    transition: background 0.2s;
    background: #757575;
    color: #fff !important;
}
.cancel-btn:hover { background: #555; }

.cancel-btn-sm {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.5;
    transition: background 0.2s;
    background: #757575;
    color: #fff !important;
}
.cancel-btn-sm:hover { background: #555; }

.btn-sm {
    padding: 6px 14px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-sm:hover { background: #eee; }

.btn-add-tag {
    padding: 8px 18px;
    background: #e8f0fe;
    color: #1a5a9c;
    border: 1px solid #c5d8ed;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-add-tag:hover { background: #d0e0f5; border-color: #8ab3d9; }

/* ============================================================
   區塊 5：頁籤 (Tab)
   ============================================================ */
.tagwrap { width: 100%; margin-bottom: 20px; }
.taghead {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 6px 6px 0 0;
    padding: 5px 5px 0 5px;
}
.tagitem {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    background: transparent;
}
.tagitem:hover { background: var(--primary-light); color: #1a2332; }
.tagitem.on {
    background: #fff;
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.tagitem .tagin { display: inline-block; padding: 2px 0; }
.tagbody { background: #fff; border-radius: 0 0 6px 6px; padding: 5px 0 0 0; }
.tagbodyin { padding: 0 5px; }

/* ============================================================
   區塊 6：產品市集卡片
   ============================================================ */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}
.market-card {
    background: #fff;
    border-radius: 12px;
    border: 2px solid #c0c8d4;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}
.market-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: var(--primary);
}
.market-card-image {
    height: 160px;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.market-card-image img { width: 100%; height: 100%; object-fit: cover; }
.market-card-image-placeholder { font-size: 48px; color: #ccc; }
.market-card-body { padding: 16px 18px 12px; flex: 1; }
.market-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.market-card-header h3 { font-size: 17px; color: #1a2332; margin: 0; line-height: 1.3; flex: 1; }
.market-card-category {
    font-size: 12px;
    color: #fff;
    background: var(--primary);
    padding: 2px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.market-card-description {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.5;
    margin: 6px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.market-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}
.market-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.market-card-tags .tag {
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    background: #f0f4f9;
    color: #555;
}
.tag-sensitivity { background: var(--red-light); color: var(--red); }
.tag-frequency { background: var(--primary-light); color: var(--primary); }
.tag-availability { background: var(--blue-light); color: var(--blue); }

.market-card-status {
    padding: 8px 18px 4px 18px;
    border-top: 1px solid #f0f0f0;
    margin-top: 6px;
    text-align: left;
}
.status-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}
.status-none { background: #f0f0f0; color: #888; border: 1px solid #e0e0e0; }
.status-pending { background: #fff3cd; color: #856404; border: 1px solid #f5c6cb; }
.status-approved { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.status-rejected { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.market-card-footer {
    padding: 12px 18px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
}
.market-card-footer .blue-btn,
.market-card-footer .green-btn { flex: 1; text-align: center; padding: 8px 12px; font-size: 13px; }

.empty-state { text-align: center; padding: 60px 20px; background: #f8f9fa; border-radius: 12px; border: 1px solid #e8ecf1; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-state h3 { font-size: 20px; color: #1a2332; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-size: 15px; }

/* ============================================================
   區塊 7：產品詳情頁
   ============================================================ */
.detail-back { margin-bottom: 15px; }
.product-detail { background: #fff; border-radius: var(--radius); padding: 20px; }

.detail-main {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}
.detail-image {
    width: 300px;
    height: 200px;
    background: #f5f7fa;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image-placeholder { font-size: 56px; color: #ccc; }
.detail-info { flex: 1; }
.detail-info h2 { font-size: 24px; color: #1a2332; margin: 0 0 10px; }

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
}
.detail-meta span { font-size: 14px; color: var(--text-light); }
.detail-category { background: var(--primary-light); padding: 2px 12px; border-radius: 12px; color: var(--primary); }

.detail-info h4 { font-size: 15px; color: #1a2332; margin: 12px 0 6px; }
.detail-info p { font-size: 14px; color: #555; line-height: 1.6; margin: 0; }

.detail-version-info {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid #e8ecf1;
    margin-top: 10px;
}
.detail-version-info h3 { font-size: 17px; color: #1a2332; margin: 0 0 12px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 20px;
    margin-bottom: 16px;
}
.detail-grid-item { display: flex; flex-direction: column; gap: 2px; }
.detail-grid-item .detail-label { font-size: 12px; color: var(--text-muted); }
.detail-grid-item .detail-value { font-size: 14px; color: var(--text); font-weight: 500; }

.detail-policy h4 { font-size: 15px; color: #1a2332; margin: 0 0 6px; }
.detail-policy p { font-size: 14px; color: #555; line-height: 1.6; margin: 0 0 10px; }

.detail-actions { display: flex; flex-direction: column; gap: 4px; }
.action-group { font-size: 14px; color: #555; }
.action-label { font-weight: 500; color: var(--text); }

.detail-apply-section { margin-top: 25px; padding-top: 20px; border-top: 2px solid #f0f0f0; }
.apply-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: var(--radius);
    flex-wrap: wrap;
    gap: 12px;
}
.apply-box p { margin: 0; font-size: 15px; font-weight: 500; }
.apply-box-empty { background: #f0f7ff; border: 1px solid #b8d4f0; }
.apply-box-pending { background: #fff3cd; border: 1px solid #f5c6cb; }
.apply-box-approved { background: #d4edda; border: 1px solid #c3e6cb; }
.apply-box-rejected { background: #f8d7da; border: 1px solid #f5c6cb; }

/* 詳情頁 - 版本完整資訊 */
.detail-version-full { margin-top: 20px; }
.detail-hr { border: none; border-top: 2px solid #e8ecf1; margin: 20px 0; }
.detail-section-title { font-size: 20px; color: #1a2332; margin-bottom: 16px; }
.detail-section {
    margin-bottom: 24px;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius);
    overflow: hidden;
}
.detail-sub-title {
    background: #f8f9fa;
    padding: 10px 16px;
    margin: 0;
    font-size: 15px;
    color: #1a2332;
    border-bottom: 1px solid #e8ecf1;
}
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table tr { border-bottom: 1px solid #f0f0f0; }
.detail-table tr:last-child { border-bottom: none; }
.detail-label-cell {
    width: 20%;
    padding: 12px 16px;
    background: #fafafa;
    font-size: 13px;
    color: #555;
    vertical-align: top;
}
.detail-value-cell {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    word-break: break-all;
    vertical-align: top;
}
.detail-value-cell .redtext { color: var(--red); }

/* 範例區塊 */
.example-block { padding: 12px 16px; background: #f0f7ff; border-bottom: 1px solid #e8ecf1; }
.example-content { font-size: 13px; }
.example-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    margin-top: 4px;
}
.example-label { color: #555; font-weight: 500; }
.example-value {
    color: #2d3748;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    word-break: break-all;
}

/* Action 標籤 */
.action-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.action-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}
.action-tag.allowed { background: #d4edda; color: #155724; }
.action-tag.prohibited { background: #f8d7da; color: #721c24; }

/* Constraints 顯示 */
.constraint-tags-display { display: flex; flex-wrap: wrap; gap: 6px; }
.constraint-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 13px;
}
.constraint-tag .tag-key { color: #2b6cb0; font-weight: 600; }
.constraint-tag .tag-value { color: #2c5282; background: #bee3f8; padding: 0 6px; border-radius: 2px; }

/* ============================================================
   區塊 8：表單輸入框
   ============================================================ */
.formtable td input[type="text"],
.formtable td input[type="password"],
.formtable td textarea,
.formtable td select {
    width: 90%;
    max-width: 500px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    height: 38px;
    margin: 2px 0;
}
.formtable td textarea { height: auto; min-height: 80px; resize: vertical; padding: 10px 12px; line-height: 1.5; }
.formtable td select {
    height: 38px;
    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;
    padding-right: 35px;
    cursor: pointer;
}
.formtable td input:focus,
.formtable td textarea:focus,
.formtable td select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}
.formtable td input:hover,
.formtable td textarea:hover,
.formtable td select:hover { border-color: #bbb; }

/* 表單按鈕區 */
.form-actions {
    padding: 20px 0 10px 0;
    text-align: center;
    border-top: 2px solid #f0f0f0;
    margin-top: 10px;
}
.form-actions .cancel-btn { margin-right: 12px; }

/* ============================================================
   區塊 9：版本編輯 UI
   ============================================================ */
.form-title { font-size: 20px; font-weight: bold; margin: 0 0 8px 0; color: var(--text); }
.form-hr { border: none; border-top: 2px solid #e8e8e8; margin: 0 0 20px 0; }

.input-full {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.input-full:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.input-small {
    width: 200px;
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.input-small:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.textarea-full {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}
.textarea-full:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.select-full {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.select-full:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.input-date {
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}
.input-date:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.field-en { display: block; font-weight: normal; font-size: 12px; color: #999; margin-top: 2px; }
.unit-text { display: inline-block; margin-left: 8px; font-size: 14px; color: var(--text-light); }

.hint-text { display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.hint-text .key-hint { color: #1a73e8; font-weight: bold; }

/* 取代內聯 style 的 class */
.tag-input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tag-input-field { flex: 1; }
.keyword-count { margin-left: 16px; color: #999; font-size: 13px; }
.date-range-wrapper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.date-range-sep { color: #999; }
.schema-select-wrapper { display: flex; gap: 8px; }
.schema-select-field { flex: 1; }

.tag-input-wrapper { width: 100%; }
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    min-height: 40px;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f0fe;
    color: #1a5a9c;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid #c5d8ed;
}
.tag-chip .tag-remove { cursor: pointer; font-weight: bold; color: #999; font-size: 16px; line-height: 1; }
.tag-chip .tag-remove:hover { color: #c00; }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 4px 0; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }

/* ============================================================
   區塊 10：限制條件 (Constraints)
   ============================================================ */
.constraints-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.select-constraint {
    flex: 2;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    height: 38px;
    background: #fff;
    color: #1a202c;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select-constraint:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
}
.select-constraint option { color: #1a202c; background: #fff; padding: 4px 8px; }
.select-constraint option:checked { background: #4299e1; color: #fff; }
.select-constraint .type-tag { color: #a0aec0; font-size: 11px; margin-left: 4px; }

.input-value {
    flex: 2;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1a202c;
    background: #fff;
    height: 38px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-value:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
}
.input-value::placeholder { color: #a0aec0; font-size: 13px; }

.btn-add {
    flex: 0 0 auto;
    padding: 8px 24px;
    background: #4299e1;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    height: 38px;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
.btn-add:hover { background: #3182ce; }
.btn-add:active { transform: scale(0.97); }
.btn-add:disabled { background: #cbd5e0; cursor: not-allowed; }
.btn-add.btn-update { background: #48bb78; }
.btn-add.btn-update:hover { background: #38a169; }

.constraint-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    min-height: 50px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background: #f7fafc;
    margin: 6px 0 8px 0;
    transition: border-color 0.2s, background 0.2s;
}
.constraint-tags:hover { border-color: #a0aec0; }
.constraint-tags .empty-hint { color: #a0aec0; font-size: 14px; width: 100%; text-align: center; padding: 6px 0; }

.constraint-tags .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ebf8ff;
    border: 1.5px solid #bee3f8;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.constraint-tags .tag:hover {
    border-color: #4299e1;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.2);
    transform: translateY(-1px);
    background: #dbeafe;
}
.constraint-tags .tag .tag-label { color: #2b6cb0; font-weight: 600; font-size: 13px; }
.constraint-tags .tag .tag-value {
    color: #2c5282;
    background: #bee3f8;
    padding: 1px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.constraint-tags .tag .tag-remove {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
    margin-left: 2px;
    transition: transform 0.2s, color 0.2s;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.constraint-tags .tag .tag-remove:hover { transform: scale(1.3); color: #c53030; background: rgba(229, 62, 62, 0.1); }

.constraint-status {
    margin: 6px 0 8px 0;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
    font-weight: 500;
    transition: all 0.3s;
}
.constraint-status.show { display: block; animation: fadeSlideIn 0.3s ease; }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.constraint-status.success { background: #f0fff4; color: #22543d; border: 1px solid #c6f6d5; }
.constraint-status.error { background: #fff5f5; color: #742a2a; border: 1px solid #fed7d7; }
.constraint-status.info { background: #ebf8ff; color: #2a4365; border: 1px solid #bee3f8; }

#jsonPreview {
    font-family: monospace;
    font-size: 13px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
}

/* ============================================================
   區塊 11：快照區塊 (操作紀錄)
   ============================================================ */
.toggle-snapshot { color: #1565c0; font-size: 13px; text-decoration: none; }
.toggle-snapshot:hover { text-decoration: underline; }
.snapshot-content {
    display: none;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 12px;
    max-height: 200px;
    overflow: auto;
    text-align: left;
}
.snapshot-content.show { display: block; }
.snapshot-pre { margin: 0; white-space: pre-wrap; word-break: break-all; }
.snapshot-empty { color: #999; }
.change-summary { text-align: left; padding-left: 10px; }
.audit-footer { margin-top: 10px; }

/* ============================================================
   區塊 12：操作紀錄列表
   ============================================================ */
.log-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; }
.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 700px;
}
.log-table thead { background: #f8f9fa; }
.log-table th { padding: 12px 10px; text-align: left; font-weight: 600; color: var(--text); border-bottom: 2px solid #e8ecf1; font-size: 13px; white-space: nowrap; }
.log-table td { padding: 10px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; font-size: 13px; }
.log-table tbody tr:hover { background: #f8f9fa; }

.log-col-no { width: 5%; text-align: center; }
.log-col-action { width: 10%; text-align: center; }
.log-col-desc { width: 20%; }
.log-col-summary { width: 25%; }
.log-col-user { width: 10%; text-align: center; }
.log-col-time { width: 15%; text-align: center; font-size: 12px; color: var(--text-light); }
.log-col-toggle { width: 15%; text-align: center; }

.log-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.log-badge-create { background: #d4edda; color: #155724; }
.log-badge-update { background: #cce5ff; color: #004085; }
.log-badge-delete { background: #f8d7da; color: #721c24; }
.log-badge-publish { background: #d4edda; color: #155724; }
.log-badge-unpublish { background: #fff3cd; color: #856404; }
.log-badge-switch { background: #d1ecf1; color: #0c5460; }
.log-badge-default { background: #e2e3e5; color: #383d41; }

.log-toggle-btn {
    padding: 4px 14px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.log-toggle-btn:hover { background: var(--blue-dark); transform: translateY(-1px); }

.log-detail-row { display: none; background: #fafafa; }
.log-detail-cell { padding: 0 !important; border-bottom: 2px solid #e8ecf1 !important; }
.log-detail-content { padding: 15px 20px; max-height: 500px; overflow: auto; }
.log-detail-inner { background: #f8f9fa; border-radius: 6px; padding: 15px; }
.log-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-detail-table tr { border-bottom: 1px solid #e9ecef; }
.log-detail-table tr:last-child { border-bottom: none; }
.log-detail-label {
    padding: 6px 10px;
    font-weight: 600;
    color: #555;
    width: 15%;
    vertical-align: top;
    white-space: nowrap;
}
.log-detail-value { padding: 6px 10px; color: var(--text); word-break: break-all; }
.log-snapshot {
    background: #f1f3f5;
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
    border: 1px solid #e0e0e0;
    margin: 5px 0;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}
.log-empty { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 15px; background: #fafafa; border-radius: var(--radius); border: 1px dashed var(--border); }
.log-footer { text-align: right; padding: 10px 5px; color: var(--text-muted); font-size: 13px; }

/* ============================================================
   區塊 13：審核頁面
   ============================================================ */
.review-detail { background: #fff; border-radius: var(--radius);  }
.review-detail h2 { font-size: 22px; color: #1a2332; margin: 0 0 20px; }
.review-info { margin-bottom: 25px; }
.review-info .formtable th { width: 15%; background: #f8f9fa; text-align: left; padding: 10px 15px; }
.review-info .formtable td { padding: 10px 15px; }
.review-form { border-top: 2px solid #f0f0f0; padding-top: 20px; }
.review-form h3 { font-size: 18px; color: #1a2332; margin: 0 0 15px; }

.radio-group { display: flex; gap: 20px; padding: 5px 0; }
.radio-label { cursor: pointer; font-size: 15px; }
.radio-label input[type="radio"] { margin-right: 5px; }

.review-note {
    font-size: 12px;
    color: #721c24;
    background: #f8d7da;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
    border-left: 3px solid var(--red);
}

/* ============================================================
   區塊 14：RWD 響應式
   ============================================================ */
@media screen and (max-width: 768px) {
    .search-area {
        flex-direction: column;
        align-items: stretch;
        padding: 16px 18px;
        gap: 12px;
    }
    .search-area .search-left {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .search-area .search-item .input-full {
        min-width: unset;
        width: 100%;
    }
    .search-area .search-item select {
        width: 100%;
        min-width: unset;
    }
    .search-area .search-keyword { flex: unset; min-width: unset; }
    .search-area .search-right { width: 100%; }
    .search-area .search-btn { width: 100%; flex-direction: row; }
    .search-area .search-btn .gray-btn { flex: 1; justify-content: center; padding: 10px 16px; }

    .market-grid { grid-template-columns: 1fr; gap: 15px; }
    .market-card-image { height: 130px; }
    .market-card-header h3 { font-size: 16px; }
    .market-card-footer { flex-direction: column; }
    .market-card-footer .blue-btn,
    .market-card-footer .green-btn { flex: unset; width: 100%; text-align: center; }

    .market-search-area .search-row { flex-direction: column; align-items: stretch; }
    .market-search-area .search-item { width: 100%; }
    .market-search-area .search-keyword { flex: unset; min-width: unset; }
    .market-search-area .search-item select { width: 100%; min-width: unset; }
    .market-search-area .search-btn { flex-direction: row; justify-content: center; }

    .formtable th, .formtable td { padding: 6px 5px; font-size: 13px; }
    .green-btn, .blue-btn, .orange-btn, .red-btn, .gray-btn {
        padding: 3px 8px;
        font-size: 12px;
    }

    .taghead { flex-wrap: wrap; gap: 3px; padding: 5px 5px 0 5px; border-radius: 4px 4px 0 0; }
    .tagitem { padding: 8px 14px; font-size: 13px; border-radius: 4px 4px 0 0; }
    .tagitem .tagin { font-size: 13px; }

    .detail-main { flex-direction: column; gap: 16px; }
    .detail-image { width: 100%; height: 180px; }
    .detail-info h2 { font-size: 20px; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .apply-box { flex-direction: column; text-align: center; }

    .log-table { font-size: 13px; min-width: 600px; }
    .log-table th, .log-table td { padding: 8px 6px; font-size: 12px; }
    .log-detail-content { padding: 10px 12px; max-height: 400px; }
    .log-detail-inner { padding: 10px; }
    .log-detail-table { font-size: 12px; }
    .log-detail-label { width: 25%; padding: 4px 6px; font-size: 12px; }
    .log-detail-value { padding: 4px 6px; font-size: 12px; }
    .log-snapshot { font-size: 11px; padding: 8px; max-height: 200px; }

    .constraints-selector { flex-direction: column; align-items: stretch; }
    .select-constraint, .input-value, .btn-add { width: 100%; min-width: unset; }
    .constraint-tags .tag { font-size: 12px; padding: 4px 10px; }
    .constraint-tags .tag .tag-value { max-width: 100px; font-size: 11px; }

    .radio-group { flex-direction: column; gap: 8px; }
    .checkbox-group { flex-direction: column; gap: 5px; }

    .formtable .label-col { display: block; width: 100%; padding: 8px 0 4px 0; border-bottom: none; }
    .formtable .input-col { display: block; width: 100%; padding: 0 0 12px 0; }
    .input-small { width: 100%; }
    .form-actions { text-align: center; }
    .form-actions .cancel-btn { display: block; width: 100%; text-align: center; margin-bottom: 8px; margin-right: 0; }
    .form-actions .green-btn { width: 100%; }

    .detail-label-cell { width: 30%; padding: 8px 10px; font-size: 12px; }
    .detail-value-cell { padding: 8px 10px; font-size: 13px; }
    .example-grid { grid-template-columns: 1fr; gap: 2px; }
    .action-tags { gap: 4px; }
    .action-tag { font-size: 12px; padding: 2px 8px; }
    .constraint-tag { font-size: 12px; padding: 2px 8px; }
}

@media screen and (max-width: 480px) {
    .search-area { padding: 12px 14px; }
    .search-area .search-btn { flex-direction: column; }
    .search-area .search-btn .gray-btn { width: 100%; justify-content: center; padding: 10px 16px; }
    .constraint-tags .tag { font-size: 11px; padding: 3px 8px; }
    .constraint-tags .tag .tag-value { max-width: 70px; font-size: 10px; padding: 0 4px; }
    .constraint-tags .tag .tag-remove { font-size: 14px; width: 18px; height: 18px; }
}
.schema-json-preview {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    max-height: 300px;
    overflow: auto;
}
.schema-json-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}
/* ============================================================
   產品詳情頁 + 申請表單樣式
   ============================================================ */

/* --- 通用文字顏色 --- */
.text-muted {
    color: #999;
}

/* --- 詳情頁主容器 --- */
.product-detail {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

.detail-back {
    margin-bottom: 15px;
}

/* --- 主區塊 --- */
.detail-main {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.detail-image {
    width: 300px;
    height: 200px;
    background: #f5f7fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-image-placeholder {
    font-size: 56px;
    color: #ccc;
}

.detail-info {
    flex: 1;
}
.detail-info h2 {
    font-size: 24px;
    color: #1a2332;
    margin: 0 0 10px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 16px;
}
.detail-meta span {
    font-size: 14px;
    color: #666;
}
.detail-category {
    background: #e8f5e9;
    padding: 2px 12px;
    border-radius: 12px;
    color: #2e7d32;
}

.detail-info h4 {
    font-size: 15px;
    color: #1a2332;
    margin: 12px 0 6px;
}
.detail-info p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

/* --- 版本詳細資訊 --- */
.detail-version-full {
    margin-top: 20px;
}

.detail-hr {
    border: none;
    border-top: 2px solid #e8ecf1;
    margin: 20px 0;
}

.detail-section-title {
    font-size: 20px;
    color: #1a2332;
    margin-bottom: 16px;
}

.detail-section {
    margin-bottom: 24px;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    overflow: hidden;
}

.detail-sub-title {
    background: #f8f9fa;
    padding: 10px 16px;
    margin: 0;
    font-size: 15px;
    color: #1a2332;
    border-bottom: 1px solid #e8ecf1;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}
.detail-table tr {
    border-bottom: 1px solid #f0f0f0;
}
.detail-table tr:last-child {
    border-bottom: none;
}

.detail-label-cell {
    width: 20%;
    padding: 12px 16px;
    background: #fafafa;
    font-size: 13px;
    color: #555;
    vertical-align: top;
}

.detail-value-cell {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    word-break: break-all;
    vertical-align: top;
}

.field-en {
    display: block;
    font-weight: normal;
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* --- 關鍵字和標籤 --- */
.action-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.action-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}
.action-tag.allowed {
    background: #d4edda;
    color: #155724;
}
.action-tag.prohibited {
    background: #f8d7da;
    color: #721c24;
}

.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #f0f4f9;
    color: #555;
}

/* --- Constraints 標籤 --- */
.constraint-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.constraint-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 13px;
}
.constraint-tag .tag-key {
    color: #2b6cb0;
    font-weight: 600;
}
.constraint-tag .tag-value {
    color: #2c5282;
    background: #bee3f8;
    padding: 0 6px;
    border-radius: 2px;
}

/* --- Schema JSON 預覽 --- */
.schema-json-preview {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    max-height: 300px;
    overflow: auto;
    margin-top: 8px;
}
.schema-json-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

/* --- 詳情頁 meta grid --- */
.detail-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}
.detail-meta-grid div {
    font-size: 14px;
    color: #555;
}
.detail-meta-grid strong {
    color: #333;
}

/* ============================================================
   申請表單樣式
   ============================================================ */

/* 申請表單主容器 */
.apply-form {
    display: block;
    margin-top: 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 表單群組 */
.apply-form .form-group {
    margin-bottom: 18px;
}
.apply-form .form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* Checkbox 群組 */
.apply-form .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 4px 0;
}
.apply-form .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}
.apply-form .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2e7d32;
}

/* 限制輸入區 */
.apply-form .constraint-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.apply-form .constraint-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}
.apply-form .constraint-input-row:last-child {
    border-bottom: none;
}

.apply-form .constraint-label {
    min-width: 120px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}
.apply-form .max-hint {
    color: #888;
    font-size: 13px;
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
}

/* 輸入框 */
.apply-form .constraint-input-row input[type="text"],
.apply-form .constraint-input-row input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    width: 180px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.apply-form .constraint-input-row input[type="text"]:focus,
.apply-form .constraint-input-row input[type="number"]:focus {
    border-color: #2e7d32;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}
.apply-form .constraint-input-row input[type="text"]::placeholder,
.apply-form .constraint-input-row input[type="number"]::placeholder {
    color: #aaa;
    font-size: 13px;
}

/* 按鈕區 */
.apply-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}
.apply-form .form-actions .green-btn {
    padding: 10px 28px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.apply-form .form-actions .green-btn:hover {
    background: #1b5e20;
}

/* 申請狀態提示 */
.apply-box {
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.apply-box p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.apply-box-empty {
    background: #f0f7ff;
    border: 1px solid #b8d4f0;
}
.apply-box-pending {
    background: #fff3cd;
    border: 1px
}	
/* 布林值唯讀行 */
.constraint-input-row.constraint-readonly {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px dashed #ddd;
}
.constraint-input-row.constraint-readonly .max-hint {
    color: #2e7d32;
    font-weight: 500;
}
/* 布林值唯讀行 */
.constraint-input-row.constraint-readonly {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px dashed #ddd;
}
.constraint-input-row.constraint-readonly .max-hint {
    color: #2e7d32;
    font-weight: 500;
}
/* ============================================================
   審核頁面樣式
   ============================================================ */

/* 比對區塊 */
.compare-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compare-version {
    background: #f0f7ff;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #2e7d32;
}

.compare-apply {
    background: #fff8e1;
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid #ed6c02;
}

.compare-label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.compare-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.compare-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.compare-item {
    font-size: 14px;
    padding: 2px 0;
}

.compare-item .item-key {
    font-weight: 500;
    color: #555;
}

.compare-item .item-value {
    color: #333;
}

.compare-item.over-limit {
    background: #ffebee;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ef9a9a;
}

.over-hint {
    color: #d32f2f;
    font-weight: 600;
    font-size: 13px;
}

.action-tag.invalid {
    background: #ffcdd2;
    color: #c62828;
    border-color: #ef9a9a;
}

/* 審核表單 */
.review-detail {
    max-width: 1000px;
    margin: 0 auto;
}

.review-detail h2 {
    font-size: 22px;
    color: #1a2332;
    margin-bottom: 20px;
}

.review-info {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e8ecf1;
}

.review-info h3 {
    font-size: 16px;
    color: #1a2332;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8ecf1;
}

.review-form {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e8ecf1;
    margin-top: 20px;
}

.review-form h3 {
    font-size: 18px;
    color: #1a2332;
    margin: 0 0 16px 0;
}

.review-form .form-group {
    margin-bottom: 16px;
}

.review-form .form-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #333;
}

.radio-group {
    display: flex;
    gap: 20px;
    padding: 5px 0;
}

.radio-label {
    cursor: pointer;
    font-size: 15px;
}

.radio-label input[type="radio"] {
    margin-right: 5px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 15px;
    padding: 5px 0;
}

.checkbox-label {
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 4px;
}

.review-form .form-control {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
}

.review-form .form-control:focus {
    border-color: #2e7d32;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.review-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e8ecf1;
}

.review-form .form-actions .cancel-btn {
    padding: 10px 24px;
    background: #757575;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.review-form .form-actions .cancel-btn:hover {
    background: #555;
}

.review-form .form-actions .green-btn {
    padding: 10px 28px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.review-form .form-actions .green-btn:hover {
    background: #1b5e20;
}

.error-msg {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
    margin-bottom: 12px;
}

.success-msg {
    background: #d4edda;
    color: #155724;
    padding: 12px 16px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
    margin-bottom: 12px;
}

/* 手機版 RWD */
@media screen and (max-width: 768px) {
    .compare-section {
        gap: 12px;
    }
    
    .compare-version,
    .compare-apply {
        padding: 10px 12px;
    }
    
    .compare-items {
        gap: 4px 10px;
    }
    
    .compare-item {
        font-size: 13px;
        width: 100%;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .checkbox-group {
        flex-direction: column;
        gap: 4px;
    }
    
    .review-form .form-actions {
        flex-direction: column;
    }
    
    .review-form .form-actions .cancel-btn,
    .review-form .form-actions .green-btn {
        width: 100%;
        text-align: center;
    }
    
    .review-form .form-control {
        max-width: 100%;
    }
}
/* 聯絡資訊儲存格 */
.contact-info-cell {
    font-size: 12px;
}

/* 審核資訊區塊上邊距 */
.review-info-top {
    margin-top: 20px;
}

/* 隱藏元素 */
.hidden {
    display: none;
}

/* 表單群組上邊距 */
.form-group-top {
    margin-top: 10px;
}