/* 重置和基礎樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8f7ff 0%, #f3f1ff 25%, #f5f5f5 50%, #f0fdfa 75%, #fff8f0 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 導航欄 */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #333;
    padding: 0.5rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -1px 10px rgba(0,0,0,0.1);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 300px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
    gap: 0;
}

.nav-tab {
    background: none;
    border: none;
    color: #666;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    flex: 1;
    position: relative;
    border-bottom: 3px solid transparent;
}

.nav-tab:hover {
    color: #8b5cf6;
    border-bottom-color: rgba(139, 92, 246, 0.3);
}

.nav-tab:active {
    color: #7c3aed;
    border-bottom-color: rgba(139, 92, 246, 0.5);
}

.nav-tab.active {
    color: #8b5cf6;
    border-bottom-color: #8b5cf6;
    font-weight: 600;
}

.nav-tab.active:hover {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* 主內容區域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 6rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 搜尋區域 */
.search-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    z-index: 2;
    pointer-events: none;
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: relative;
}

.search-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.95);
}

.search-input:focus + .search-icon {
    color: #8b5cf6;
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #999;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.clear-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    border-radius: 50%;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
    color: #666;
}

.clear-btn:hover::before {
    left: 100%;
}

.clear-btn:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

/* 篩選器 */
.search-filters, .manage-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.75rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* 快速篩選按鈕 */
.quick-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quick-filter-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.quick-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s;
}

.quick-filter-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
}

.quick-filter-btn:hover::before {
    left: 100%;
}

.quick-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.quick-filter-btn.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.8);
    color: #7c3aed;
    font-weight: 600;
}

/* 結果區域 */
.results-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.results-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

#resultsCount {
    font-weight: 500;
    color: #666;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.sort-select {
    padding: 0.5rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.export-btn {
    background: rgba(6, 182, 212, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    position: relative;
    overflow: hidden;
}

.export-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.export-btn:hover {
    background: rgba(6, 182, 212, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.5);
}

.export-btn:hover::before {
    left: 100%;
}

.export-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 1);
}

.search-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.stat-item {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    font-weight: 500;
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

/* 分頁控制項 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
    margin: 0 1rem;
}

.pagination-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

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

.pagination-btn:disabled {
    background: rgba(0, 0, 0, 0.1);
    color: #999;
    border-color: rgba(0, 0, 0, 0.1);
    cursor: not-allowed;
    transform: none;
}

.pagination-btn.active {
    background: rgba(139, 92, 246, 0.8);
    color: white;
    border-color: rgba(139, 92, 246, 0.8);
}

.pagination-btn.active:hover {
    background: rgba(139, 92, 246, 0.9);
}

/* 圖片卡片 */
.image-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.image-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.image-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.image-card .download-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(139, 92, 246, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
    opacity: 0;
    transform: scale(0.8);
}

.image-card:hover .download-btn {
    opacity: 1;
    transform: scale(1);
}

.image-card .download-btn:hover {
    background: rgba(139, 92, 246, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.image-card .download-btn:active {
    transform: scale(0.95);
}

.image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-info {
    padding: 0.75rem;
}

.image-name {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tag {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* 管理頁面 */
.manage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.manage-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.manage-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.action-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

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

.save-btn {
    background: rgba(6, 182, 212, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    position: relative;
    overflow: hidden;
}

.save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.save-btn:hover {
    background: rgba(6, 182, 212, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.5);
}

.save-btn:hover::before {
    left: 100%;
}

.save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 1);
}

.manage-form {
    width: 100%;
}

.image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.manage-image-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.manage-image-card.selected {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 25px rgba(139, 92, 246, 0.2);
}

.manage-image-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.05);
}

.manage-image-info {
    padding: 1rem;
}

.manage-image-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.manage-image-tags {
    margin-bottom: 0.5rem;
}

/* 管理表單輸入欄位 */
.manage-form-group {
    margin-bottom: 1rem;
}

.manage-form-compact .manage-form-group {
    margin-bottom: 0.75rem;
}

.manage-form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.manage-form-compact .manage-form-group label {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.manage-form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.manage-form-input.compact {
    padding: 0.5rem;
    font-size: 0.85rem;
    border-width: 1px;
}

.manage-form-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.manage-form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.manage-form-compact .manage-form-checkbox {
    margin-top: 0.25rem;
}

.manage-form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}

.manage-form-checkbox label {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.manage-form-compact .manage-form-checkbox label {
    font-size: 0.8rem;
}

.manage-image-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.manage-image-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.manage-image-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
}

.manage-image-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manage-edit-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #8b5cf6;
    font-size: 0.8rem;
}

.manage-edit-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.manage-image-preview-container {
    position: relative;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
}

.manage-image-preview {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
}

.manage-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 0.5rem;
    color: white;
    font-size: 0.75rem;
}

.manage-image-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.manage-image-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.manage-tag {
    background: rgba(139, 92, 246, 0.8);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.manage-no-tags {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.manage-more-tags {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.manage-image-theme {
    margin-top: 0.25rem;
}

.manage-theme {
    background: rgba(16, 185, 129, 0.8);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.manage-no-theme {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.manage-form-compact {
    margin-bottom: 1rem;
}

.edit-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #8b5cf6;
    border: 2px solid rgba(139, 92, 246, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
    position: relative;
    overflow: hidden;
    font-weight: 500;
}

.edit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.5s;
}

.edit-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.8);
    color: #7c3aed;
}

.edit-btn:hover::before {
    left: 100%;
}

.edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 1);
}

/* 模態框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e5e9;
}

.modal-header h3 {
    color: #333;
    font-size: 1.2rem;
}

.close-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.close-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
}

.close-btn:hover::before {
    left: 100%;
}

.close-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 1);
}

.modal-body {
    padding: 1.5rem;
}

.image-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.hashtag-input-container {
    position: relative;
}

.hashtag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 2rem;
}

.hashtag-tag {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.remove-tag {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.remove-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.3s;
    border-radius: 50%;
}

.remove-tag:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
    border-color: rgba(139, 92, 246, 0.4);
}

.remove-tag:hover::before {
    left: 100%;
}

.remove-tag:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 1);
}

.hashtag-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.hashtag-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.95);
}

.hashtag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(240, 240, 240, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s;
}

.suggestion-item:hover {
    background: rgba(139, 92, 246, 0.05);
    transform: translateX(5px);
}

.suggestion-item:hover::before {
    left: 100%;
}

.suggestion-item:active {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(2px);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.theme-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.theme-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.95);
}

/* 背景設定選項 */
.background-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.background-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.background-label {
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    line-height: 1.4;
    margin: 0;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid rgba(225, 229, 233, 0.8);
}

.filename-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(225, 229, 233, 0.8);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.filename-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.95);
}

.filename-suggestions {
    margin-top: 0.5rem;
    display: none;
}

.filename-suggestion-item {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    color: #666;
}

.filename-suggestion-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s;
}

.filename-suggestion-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.4);
    color: #8b5cf6;
    transform: translateX(5px);
}

.filename-suggestion-item:hover::before {
    left: 100%;
}

.filename-suggestion-item:active {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(2px);
}

.filename-suggestion-label {
    font-weight: 500;
    color: #8b5cf6;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.filename-suggestion-text {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
}

.json-display {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-json-btn {
    background: rgba(6, 182, 212, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}

.copy-json-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.copy-json-btn:hover {
    background: rgba(6, 182, 212, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.5);
}

.copy-json-btn:hover::before {
    left: 100%;
}

.copy-json-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 1);
}

/* 查看模態框樣式 */
.view-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 90vw;
    height: 90vh;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* 為底部導航欄留出空間 */
}

.view-image-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.view-image-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.view-image-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 1;
}

.view-image-wrapper img {
    position: relative;
    z-index: 2;
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
}

.view-info {
    margin-bottom: 1.5rem;
}

.view-filename, .view-tags, .view-theme {
    margin-bottom: 1rem;
}

.view-filename label, .view-tags label, .view-theme label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.view-filename span, .view-theme span {
    color: #666;
    font-size: 0.9rem;
}

.view-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-picker-section {
    margin-bottom: 1.5rem;
}

.color-picker-section label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#backgroundColorPicker {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

#backgroundColorPicker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#backgroundColorPicker::-webkit-color-swatch {
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
}

.reset-color-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-color-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.download-merged-btn {
    background: rgba(6, 182, 212, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 1rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
    justify-content: center;
}

.download-merged-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.download-merged-btn:hover {
    background: rgba(6, 182, 212, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.3);
    border-color: rgba(6, 182, 212, 0.5);
}

.download-merged-btn:hover::before {
    left: 100%;
}

.download-merged-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 1);
}

/* 圖片編輯控制項 */
.image-edit-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.image-edit-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

/* 編輯控制項 */
.edit-controls {
    margin-bottom: 1rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.control-group label {
    min-width: 60px;
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.slider {
    flex: 1;
    min-width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(139, 92, 246, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #7c3aed;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.slider::-moz-range-thumb:hover {
    background: #7c3aed;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.control-group span {
    min-width: 50px;
    text-align: right;
    font-weight: 500;
    color: #8b5cf6;
    font-size: 0.8rem;
}

/* 變換控制項 */
.transform-controls {
    margin-bottom: 1rem;
}

.transform-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.transform-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.transform-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: left 0.3s;
}

.transform-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
}

.transform-btn:hover::before {
    left: 100%;
}

.transform-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

/* 裁剪控制項 */
.crop-controls {
    margin-bottom: 1rem;
}

.crop-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crop-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(6, 182, 212, 0.3);
    color: #0891b2;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.crop-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
    transition: left 0.3s;
}

.crop-btn:hover {
    background: rgba(6, 182, 212, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.6);
}

.crop-btn:hover::before {
    left: 100%;
}

.crop-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

/* 重置控制項 */
.reset-controls {
    text-align: center;
}

.reset-all-btn {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #dc2626;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.reset-all-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
    transition: left 0.3s;
}

.reset-all-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.6);
}

.reset-all-btn:hover::before {
    left: 100%;
}

.reset-all-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* 裁剪模式樣式 */
.crop-mode .view-image-wrapper {
    position: relative;
    cursor: crosshair;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: none;
}

.crop-selection {
    position: absolute;
    border: 2px dashed #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    cursor: move;
    display: none;
}

.crop-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #8b5cf6;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
}

.crop-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.crop-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.crop-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.crop-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

/* 配件功能樣式 */
.accessories-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.accessories-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.accessories-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.add-accessory-btn {
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.add-accessory-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s;
}

.add-accessory-btn:hover {
    background: rgba(34, 197, 94, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.add-accessory-btn:hover::before {
    left: 100%;
}

.clear-accessories-btn {
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.clear-accessories-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.3s;
}

.clear-accessories-btn:hover {
    background: rgba(239, 68, 68, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.clear-accessories-btn:hover::before {
    left: 100%;
}

.accessories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.accessory-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.accessory-item:hover {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.4);
}

.accessory-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.accessory-info {
    flex: 1;
    min-width: 0;
}

.accessory-name {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accessory-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.accessory-controls button {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.accessory-controls button:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.accessory-controls button.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

/* 配件庫 */
.accessories-library {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.accessories-library .library-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 90vw;
    max-height: 85vh;
    width: 800px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.library-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.library-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.library-header h5 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.library-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.close-library-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.close-library-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
    padding: 2rem;
    max-height: 60vh;
    background: #f8fafc;
}

.accessories-grid::-webkit-scrollbar {
    width: 8px;
}

.accessories-grid::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.accessories-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.accessories-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.accessory-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.accessory-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(124, 58, 237, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.accessory-option:hover {
    border-color: #8b5cf6;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.15);
}

.accessory-option:hover::before {
    opacity: 1;
}

.accessory-option:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.2);
}

.accessory-option img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.accessory-option:hover img {
    transform: scale(1.05);
}

.accessory-option .name {
    font-size: 0.8rem;
    color: #475569;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.accessory-option:hover .name {
    color: #8b5cf6;
}

/* 配件在圖片上的顯示 */
.accessory-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.accessory-element {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    user-select: none;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.accessory-element:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.accessory-element.selected {
    border-color: rgba(139, 92, 246, 0.8);
}

.accessory-element img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.accessory-resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(139, 92, 246, 0.8);
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: none;
}

.accessory-element.selected .accessory-resize-handle {
    display: block;
}

.accessory-resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.accessory-resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.accessory-resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.accessory-resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

.accessory-rotate-handle {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: rgba(139, 92, 246, 0.8);
    border: 1px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: none;
}

.accessory-element.selected .accessory-rotate-handle {
    display: block;
}

/* 載入指示器 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    display: none;
}

.loading.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cancel-btn {
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #666;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.cancel-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.cancel-btn:hover {
    background: rgba(245, 245, 245, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.2);
}

.cancel-btn:hover::before {
    left: 100%;
}

.cancel-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: rgba(245, 245, 245, 1);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.7rem;
    }
    
    .main-content {
        padding: 0.5rem;
        padding-bottom: 5rem;
    }
    
    .search-container, .results-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }
    
    .image-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .manage-image-card {
        padding: 0.5rem;
    }
    
    .manage-image-preview {
        height: 100px;
    }
    
    .manage-form-compact .manage-form-group {
        margin-bottom: 0.5rem;
    }
    
    .manage-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .save-btn {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
    
    .search-filters, .manage-filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    /* 圖片編輯控制項響應式 */
    .image-edit-section {
        padding: 0.75rem;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .control-group label {
        min-width: auto;
        text-align: left;
    }
    
    .slider {
        min-width: auto;
        width: 100%;
    }
    
    .transform-buttons, .crop-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .transform-btn, .crop-btn {
        justify-content: center;
        width: 100%;
    }
    
    /* 配件功能響應式 */
    .accessories-section {
        padding: 0.75rem;
    }
    
    .accessories-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .add-accessory-btn, .clear-accessories-btn {
        width: 100%;
        justify-content: center;
    }
    
    .accessory-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .accessory-controls {
        justify-content: center;
        width: 100%;
    }
    
    .accessories-library {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .accessories-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.5rem;
    }
    
    .accessory-option img {
        height: 40px;
    }
    
    .accessory-option .name {
        font-size: 0.6rem;
    }

    /* 分頁響應式設計 */
    .sort-options {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .sort-options label {
        font-size: 0.8rem;
    }

    .sort-select {
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .pagination-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .pagination-info {
        font-size: 0.8rem;
        margin: 0 0.5rem;
        text-align: center;
        width: 100%;
        order: -1;
    }
    
    /* 批量編輯移動端優化 */
    .batch-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 0.25rem;
        max-height: 150px;
    }
    
    .batch-mode label {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .save-btn,
    .modal-footer .cancel-btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .nav-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.65rem;
    }
    
    .main-content {
        padding-bottom: 4.5rem;
    }
    
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .image-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .image-card img {
        height: 80px;
    }
    
    .manage-image-card img {
        height: 120px;
    }
}

/* 批量編輯樣式 */
.batch-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #8b5cf6;
}

.batch-info p {
    margin: 0;
    font-weight: 500;
    color: #374151;
}

.batch-mode {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.batch-mode label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.batch-mode label:hover {
    background: #f3f4f6;
}

.batch-mode input[type="radio"] {
    margin: 0;
}

.batch-preview {
    margin-top: 1.5rem;
}

.batch-preview h4 {
    margin-bottom: 1rem;
    color: #374151;
    font-size: 1rem;
}

.batch-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.batch-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.batch-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-preview-item.selected {
    border-color: #8b5cf6;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.modal-footer .save-btn,
.modal-footer .cancel-btn {
    min-width: 120px;
}

/* localStorage 模態框樣式 */
.localStorage-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item strong {
    color: #374151;
    font-weight: 600;
}

.info-item span {
    color: #6b7280;
    font-family: monospace;
}

.localStorage-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.localStorage-actions .action-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.localStorage-preview {
    margin-top: 1rem;
}

.localStorage-preview h4 {
    margin-bottom: 0.5rem;
    color: #374151;
}

.json-preview {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 底部編輯導航欄 */
.edit-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-top: 1px solid #34495e;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.75rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.edit-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #bdc3c7;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    min-width: 60px;
}

.edit-nav-item:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.edit-nav-item.active {
    color: #3498db;
    background: rgba(52, 152, 219, 0.2);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.edit-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.edit-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

/* 工具面板 */
.edit-tool-panel {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #34495e;
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.edit-tool-panel.show {
    transform: translateY(0);
}

.tool-content {
    padding: 1rem;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #34495e;
}

.tool-header h4 {
    color: #ecf0f1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.close-tool-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-tool-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.tool-body {
    color: #ecf0f1;
}

/* 調整工具面板中的控制項樣式 */
.adjust-controls .control-group {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(52, 73, 94, 0.5);
    border-radius: 8px;
    border: 1px solid #34495e;
}

.adjust-controls .control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #bdc3c7;
    font-size: 0.9rem;
    font-weight: 500;
}

.adjust-controls .slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #34495e;
    outline: none;
    -webkit-appearance: none;
    margin: 0.5rem 0;
}

.adjust-controls .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.adjust-controls .slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.adjust-controls span {
    display: inline-block;
    min-width: 50px;
    text-align: right;
    color: #3498db;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 變形工具按鈕樣式 */
.transform-controls .transform-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.transform-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.transform-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

/* 裁剪工具按鈕樣式 */
.crop-controls .crop-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.crop-btn {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.crop-btn:hover {
    background: linear-gradient(135deg, #d35400, #a04000);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4);
}

/* 背景顏色工具樣式 */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(52, 73, 94, 0.5);
    border-radius: 8px;
    border: 1px solid #34495e;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-picker-container input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

.color-picker-container input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.reset-color-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-color-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* 配件工具樣式 */
.accessories-selector {
    padding: 1rem;
    background: rgba(52, 73, 94, 0.5);
    border-radius: 8px;
    border: 1px solid #34495e;
}

.accessories-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.add-accessory-btn, .clear-accessories-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.add-accessory-btn:hover, .clear-accessories-btn:hover {
    background: linear-gradient(135deg, #8e44ad, #7d3c98);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.4);
}

/* 下載工具樣式 */
.download-actions {
    padding: 1rem;
    background: rgba(52, 73, 94, 0.5);
    border-radius: 8px;
    border: 1px solid #34495e;
}

.download-merged-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.download-merged-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.4);
}

/* 重置按鈕樣式 */
.reset-controls {
    margin-top: 1rem;
    text-align: center;
}

.reset-all-btn, .reset-adjust-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-all-btn:hover, .reset-adjust-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .edit-bottom-nav {
        padding: 0.5rem 0;
    }
    
    .edit-nav-item {
        padding: 0.4rem 0.5rem;
        min-width: 50px;
    }
    
    .edit-nav-item i {
        font-size: 1rem;
    }
    
    .edit-nav-item span {
        font-size: 0.7rem;
    }
    
    .edit-tool-panel {
        max-height: 250px;
    }
    
    .tool-content {
        padding: 0.75rem;
    }
    
    .transform-controls .transform-buttons {
        grid-template-columns: 1fr;
    }
    
    .crop-controls .crop-buttons {
        flex-direction: column;
    }
    
    .accessories-header {
        flex-direction: column;
    }
    
    /* 配件庫響應式設計 */
    .accessories-library {
        padding: 1rem;
    }
    
    .accessories-library .library-container {
        width: 95vw;
        max-height: 90vh;
    }
    
    .library-header {
        padding: 1rem 1.5rem;
    }
    
    .library-header h5 {
        font-size: 1.1rem;
    }
    
    .accessories-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 1rem;
        padding: 1.5rem;
        max-height: 70vh;
    }
    
    .accessory-option {
        padding: 0.75rem;
    }
    
    .accessory-option img {
        height: 60px;
    }
    
    .accessory-option .name {
        font-size: 0.7rem;
    }
}

/* 動畫效果 */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.edit-tool-panel.show {
    animation: slideUp 0.3s ease forwards;
}

.edit-tool-panel.hide {
    animation: slideDown 0.3s ease forwards;
}

/* 編輯頁面樣式 */
.edit-page-container {
    display: flex;
    gap: 2rem;
    height: calc(100vh - 8rem);
    margin-top: 1rem;
}

.edit-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-display-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.edit-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.image-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffffff;
    border-radius: 8px;
    z-index: -1;
}

.info-panel {
    width: 300px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(139, 92, 246, 0.1);
    overflow: hidden;
}

.info-header {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 1rem;
    text-align: center;
}

.info-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.info-content {
    padding: 1.5rem;
}

.info-group {
    margin-bottom: 1.5rem;
}

.info-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.info-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.info-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.info-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
}

.info-actions .save-btn,
.info-actions .reset-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.info-actions .save-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.info-actions .save-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.info-actions .reset-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.info-actions .reset-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* 響應式設計 */
@media (max-width: 1024px) {
    .edit-page-container {
        flex-direction: column;
        height: auto;
    }
    
    .info-panel {
        width: 100%;
        order: -1;
    }
    
    .image-display-area {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .edit-page-container {
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    .image-display-area {
        padding: 1rem;
        min-height: 300px;
    }
    
    .info-content {
        padding: 1rem;
    }
    
    .info-actions {
        flex-direction: column;
    }
}

/* 手機版編輯頁面樣式 */
.edit-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px; /* 為底部導航留出空間 */
}

/* 頂部操作欄 */
.edit-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.back-btn, .download-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #333;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover, .download-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 主要內容區域 */
.edit-main {
    margin-top: 70px;
    padding: 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* 圖片顯示區域 */
.image-display-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.image-background {
    position: relative;
    width: 100%;
    height: 400px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.edit-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none; /* 禁止移動主要圖片 */
}

/* 配件容器 */
.accessories-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.accessory-element {
    position: absolute;
    pointer-events: auto;
    cursor: grab;
    transition: all 0.3s ease;
    z-index: 10;
}

.accessory-element:hover {
    z-index: 20;
}

.accessory-element img {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

.accessory-controls {
    position: absolute;
    top: -30px;
    right: -30px;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.accessory-element:hover .accessory-controls {
    opacity: 1;
}

.control-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

/* 裁剪覆蓋層 */
.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.crop-selection {
    position: absolute;
    border: 2px solid #fff;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: grab;
    z-index: 101;
}

.crop-selection:active {
    cursor: grabbing;
}

.crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border: 1px solid #333;
    border-radius: 50%;
    cursor: pointer;
}

.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.crop-handle.e { right: -6px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
.crop-handle.w { left: -6px; top: 50%; transform: translateY(-50%); cursor: w-resize; }

/* 底部導航欄 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

/* 隱藏變形按鈕後的佈局優化 */
.bottom-nav .nav-item[data-tool="transform"] {
    display: none !important;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-size: 0.8rem;
    min-width: 60px;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.nav-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-item i {
    font-size: 1.2rem;
}

/* 下載按鈕特殊樣式 */
.download-nav-btn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border: 2px solid #28a745 !important;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3) !important;
    font-weight: 600 !important;
}

.download-nav-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085) !important;
    border-color: #218838 !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4) !important;
    transform: translateY(-1px) !important;
}

.download-nav-btn:active {
    background: linear-gradient(135deg, #1e7e34, #1a7a6b) !important;
    border-color: #1e7e34 !important;
    transform: translateY(0) !important;
}

.download-nav-btn i {
    color: white !important;
}

.download-nav-btn span {
    color: white !important;
}

/* 工具面板 */
.tool-panel {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.tool-content {
    display: none;
}

.tool-content.active {
    display: block;
}

/* 調整控制項 */
.adjustment-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-container span {
    color: white;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

/* 變形控制項 */
.transform-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.transform-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.transform-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.transform-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
}

.transform-btn i {
    font-size: 1.2rem;
}

/* 裁剪控制項 */
.crop-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crop-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.crop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.crop-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
}

.action-btn.success {
    background: #10b981;
    color: white;
}

.action-btn.danger {
    background: #ef4444;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 配件控制項 */
.accessory-controls {
    display: flex;
    gap: 0.75rem;
}

.accessory-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.accessory-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.accessory-btn.danger {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.5);
}

.accessory-btn.danger:hover {
    background: rgba(239, 68, 68, 1);
}

/* 背景控制項 */
.background-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.background-controls label {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker-container input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.reset-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 配件庫模態框 */
.accessories-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.accessories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.accessory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.accessory-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

.accessory-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}

.accessory-item span {
    font-size: 0.8rem;
    color: #333;
    text-align: center;
}

/* 資訊面板 */
.info-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.info-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.info-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.info-content {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-field label {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.info-field input[type="text"] {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.info-field input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 標籤相關 */
.hashtag-input-container {
    position: relative;
}

.hashtag-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.suggestion-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.hashtag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hashtag-tag {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-tag {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.remove-tag:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .edit-main {
        padding: 0.5rem;
    }
    
    .image-container {
        max-width: 100%;
    }
    
    .image-background {
        height: 300px;
    }
    
    .transform-controls {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .accessories-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }
    
    .accessory-item img {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem;
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    .nav-item {
        min-width: 50px;
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .transform-controls {
        grid-template-columns: 1fr;
    }
    
    .accessory-controls {
        flex-direction: column;
    }
}