/**
 * [OUTPUT]: index.html 页面级样式（上传表单/分类选择器等）
 * [POS]: 原 index.html 内联 <style> 抽取；必须作为第 5 个样式表最后加载（级联顺序）
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */

        /* Upload Form Styles */
        .upload-form-container {
            padding: 0;
        }
        .category-selection-row {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
        }
        .category-select-wrapper {
            flex: 1;
        }
        .category-select-wrapper label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: #333;
        }
        .category-select-wrapper select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            background: white;
            cursor: pointer;
        }
        .upload-drop-zone {
            border: 2px dashed #999;
            border-radius: 8px;
            padding: 40px 20px;
            text-align: center;
            background: #fafafa;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .upload-drop-zone:hover {
            border-color: #666;
            background: #f5f5f5;
        }
        .upload-drop-zone.drag-over {
            border-color: #333;
            background: #f0f0f0;
        }
        .upload-icon {
            color: #333;
            margin-bottom: 15px;
        }
        .upload-text {
            font-size: 16px;
            font-weight: 500;
            color: #333;
            margin: 0 0 8px 0;
        }
        .upload-hint {
            font-size: 13px;
            color: #666;
            margin: 0;
        }
        /* File Preview Card Styles */
        .file-preview-card {
            background: #fff;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 10px;
            position: relative;
        }
        .file-preview-image {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 4px;
            background: #f0f0f0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .file-preview-image img,
        .file-preview-image video {
            max-width: 100%;
            max-height: 100%;
            border-radius: 4px;
        }
        .file-preview-name {
            margin-top: 8px;
            padding: 8px;
            font-size: 12px;
            color: #333;
            word-break: break-all;
            border: 1px solid transparent;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s ease;
            background: #f8f9fa;
        }
        .file-preview-name:hover {
            background: #e9ecef;
            border-color: #ddd;
        }
        .file-preview-name.editing {
            background: white;
            border-color: #333;
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
        }
        .file-preview-name .filename-part {
            color: #333;
            font-weight: 500;
        }
        .file-preview-name .extension-part {
            color: #999;
            font-weight: normal;
            margin-left: 1px;
        }
        .file-preview-name .filename-part:focus {
            outline: none;
        }
        .file-preview-prompt {
            margin-top: 8px;
            padding: 0;
        }
        .file-preview-prompt label {
            display: block;
            font-size: 11px;
            color: #666;
            margin-bottom: 4px;
            font-weight: 500;
        }
        .file-preview-prompt textarea {
            width: 100%;
            min-height: 50px;
            padding: 6px 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 12px;
            color: #333;
            resize: vertical;
            font-family: inherit;
            transition: all 0.2s ease;
            box-sizing: border-box;
        }
        .file-preview-prompt textarea:focus {
            outline: none;
            border-color: #333;
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
        }
        .file-preview-prompt textarea::placeholder {
            color: #999;
            font-size: 11px;
        }
        .file-preview-remove {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(220, 53, 69, 0.9);
            color: white;
            border: none;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            line-height: 1;
            padding: 0;
        }
        .file-preview-remove:hover {
            background: #dc3545;
        }
        /* Detail Image Upload Button */
        .add-detail-btn {
            position: absolute;
            bottom: 80px;
            right: 10px;
            background: rgba(52, 152, 219, 0.9);
            color: white;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            line-height: 1;
            padding: 0;
            transition: all 0.3s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        .file-preview-card:hover .add-detail-btn {
            display: flex;
        }
        .add-detail-btn:hover {
            background: #3498db;
            transform: scale(1.1);
        }
        /* Upload Mode Toggle Switch */
        .upload-mode-toggle {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-bottom: 8px;
        }
        .upload-mode-label {
            font-size: 13px;
            color: #666;
            font-weight: 500;
            transition: color 0.3s ease;
        }
        .upload-mode-label.active {
            color: #333;
            font-weight: 600;
        }
        .toggle-switch {
            position: relative;
            width: 40px;
            height: 20px;
            background: #333;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.3s ease;
        }
        .toggle-switch.fabric-mode {
            background: #3498db;
        }
        .toggle-switch::after {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: white;
            border-radius: 50%;
            transition: transform 0.3s ease;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }
        .toggle-switch.fabric-mode::after {
            transform: translateX(20px);
        }

        /* Fabric Mode Style Selector Panel */
        .fabric-style-panel {
            position: fixed;
            top: 0;
            right: -400px;
            width: 400px;
            height: 100vh;
            background: white;
            box-shadow: -4px 0 20px rgba(0,0,0,0.15);
            z-index: 10100;
            transition: right 0.3s ease;
            display: flex;
            flex-direction: column;
        }
        .fabric-style-panel.visible {
            right: 0;
        }
        .fabric-panel-header {
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #f8f9fa;
        }
        .fabric-panel-header h4 {
            margin: 0;
            font-size: 16px;
            color: #333;
        }
        .fabric-panel-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            padding: 0;
            line-height: 1;
        }
        .fabric-panel-close:hover {
            color: #333;
        }
        .fabric-panel-filters {
            padding: 12px 20px;
            border-bottom: 1px solid #e0e0e0;
            background: #fafafa;
        }
        .fabric-factory-filter {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .fabric-factory-btn {
            padding: 6px 12px;
            border: 1px solid #ddd;
            border-radius: 20px;
            background: white;
            cursor: pointer;
            font-size: 12px;
            color: #666;
            transition: all 0.2s ease;
        }
        .fabric-factory-btn:hover {
            border-color: #333;
            color: #333;
        }
        .fabric-factory-btn.active {
            background: #333;
            border-color: #333;
            color: white;
        }
        .fabric-panel-content {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }
        .fabric-style-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        .fabric-style-item {
            position: relative;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .fabric-style-item:hover {
            border-color: #999;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        .fabric-style-item.selected {
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
        }
        .fabric-style-item img {
            width: 100%;
            aspect-ratio: 3/4;
            object-fit: cover;
        }
        .fabric-style-item .style-check {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            background: #3498db;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            color: white;
        }
        .fabric-style-item.selected .style-check {
            display: flex;
        }
        .fabric-style-info {
            padding: 8px;
            background: rgba(255,255,255,0.95);
        }
        .fabric-style-info .style-id {
            font-size: 12px;
            font-weight: 600;
            color: #333;
            margin: 0;
        }
        .fabric-style-info .style-factory {
            font-size: 11px;
            color: #999;
            margin: 2px 0 0 0;
        }
        .fabric-panel-footer {
            padding: 16px 20px;
            border-top: 1px solid #e0e0e0;
            background: #f8f9fa;
        }
        .fabric-confirm-btn {
            width: 100%;
            padding: 12px;
            background: #3498db;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.2s ease;
        }
        .fabric-confirm-btn:hover {
            background: #2980b9;
        }
        .fabric-confirm-btn:disabled {
            background: #ccc;
            cursor: not-allowed;
        }
        .fabric-selected-preview {
            margin-top: 12px;
            padding: 10px;
            background: #e8f4fc;
            border-radius: 6px;
            display: none;
        }
        .fabric-selected-preview.visible {
            display: block;
        }
        .fabric-selected-preview p {
            margin: 0;
            font-size: 13px;
            color: #2980b9;
        }
        .fabric-no-styles {
            text-align: center;
            padding: 40px 20px;
            color: #999;
        }
        .fabric-no-styles svg {
            width: 48px;
            height: 48px;
            margin-bottom: 12px;
            opacity: 0.5;
        }
        .fabric-loading {
            text-align: center;
            padding: 40px 20px;
            color: #666;
        }
        .fabric-panel-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.3);
            z-index: 10099;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        .fabric-panel-overlay.visible {
            opacity: 1;
            visibility: visible;
        }

        /* Detail Images Preview */
        .detail-images-container {
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid #e0e0e0;
        }
        .detail-images-label {
            font-size: 11px;
            color: #666;
            margin-bottom: 4px;
            font-weight: 500;
        }
        .detail-images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
            gap: 4px;
        }
        .detail-image-item {
            position: relative;
            width: 50px;
            height: 50px;
            border-radius: 4px;
            overflow: hidden;
            border: 1px solid #ddd;
        }
        .detail-image-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .detail-image-remove {
            position: absolute;
            top: -4px;
            right: -4px;
            background: rgba(220, 53, 69, 0.9);
            color: white;
            border: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 12px;
            line-height: 1;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .detail-image-remove:hover {
            background: #dc3545;
        }
        /* ═══════════════════════════════════════════════════════════════
           样品管理界面放大样式 (+30%)
           ═══════════════════════════════════════════════════════════════ */
        #uploadModal .sample-table {
            font-size: 15px;
        }
        #uploadModal .sample-table th {
            padding: 14px 10px;
            font-size: 14px;
        }
        #uploadModal .sample-table td {
            padding: 12px 10px;
        }
        #uploadModal .sample-thumbnail {
            width: 78px;
            height: 78px;
        }
        #uploadModal .manage-toolbar {
            padding: 12px 0;
            gap: 12px;
        }
        #uploadModal .manage-toolbar input {
            padding: 10px 12px;
            font-size: 14px;
        }
        #uploadModal .manage-btn {
            padding: 10px 16px;
            font-size: 14px;
        }
        #uploadModal .tab-btn {
            padding: 12px 20px;
            font-size: 15px;
        }
        #uploadModal .sample-list-container {
            max-height: 55vh;
        }
        /* ═══════════════════════════════════════════════════════════════
           表头筛选器样式
           ═══════════════════════════════════════════════════════════════ */
        .th-filter-wrapper {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .table-filter-select {
            padding: 4px 6px;
            border: 1px solid #ddd;
            border-radius: 3px;
            font-size: 12px;
            background: white;
            cursor: pointer;
            min-width: 80px;
        }
        .table-filter-select:focus {
            outline: none;
            border-color: #333;
        }
