/*
 * [INPUT]: public/admin/editor.html - 编辑器页面结构
 * [OUTPUT]: 编辑器布局与基础组件样式
 * [POS]: 编辑器主体布局样式
 *
 * [自指声明]
 * 1. 一旦我被更新，必须更新本文件 Header
 * 2. 影响外部接口则更新所属 folder/CLAUDE.md
 * 3. 架构级变动则更新根目录 CLAUDE.md
 * 4. 若依赖的文件 POS 变化，需检查本文件 INPUT 是否仍然准确
 *
 * [PROTOCOL]: 变更时更新此头部，然后检查 CLAUDE.md
 */
/* 通用样式 */
        .sidebar-section {
            margin-bottom: 2rem;
        }

        .section-title {
            font-size: 1rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.9);
            margin-bottom: 1rem;
        }

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

        .form-group label {
            display: block;
            font-size: 0.875rem;
            color: rgba(255, 255, 255, 0.7);
            margin-bottom: 0.5rem;
        }

        .form-group input[type="text"],
        .form-group input[type="date"],
        .form-group textarea {
            width: 100%;
            padding: 0.75rem;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.875rem;
            transition: all 0.3s ease;
        }

        .form-group input[type="text"]:focus,
        .form-group input[type="date"]:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #8B5CF6;
            background: rgba(0, 0, 0, 0.3);
        }

        /* 日期输入框特殊样式 */
        .date-input {
            color-scheme: dark;
            cursor: pointer;
            position: relative;
        }

        /* 日期输入框容器 */
        .date-input-container {
            position: relative;
            display: flex;
            align-items: center;
        }

        .date-input-container .calendar-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            color: rgba(255, 255, 255, 0.7);
            pointer-events: none;
            z-index: 1;
        }

        /* 隐藏原生日期选择器时显示自定义图标 */
        .date-input:not(.native) {
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            padding-right: 45px;
        }

        .date-input:not(.native)::-webkit-calendar-picker-indicator {
            display: none;
        }

        /* 保留原生日期选择器 */
        .date-input.native {
            -webkit-appearance: initial;
            -moz-appearance: initial;
            appearance: initial;
        }

        .date-input.native::-webkit-calendar-picker-indicator {
            filter: invert(1);
            cursor: pointer;
            opacity: 1;
            width: 20px;
            height: 20px;
        }

        /* 根据模式显示/隐藏自定义图标 */
        .date-input.native + .calendar-icon {
            display: none;
        }

        .date-input:not(.native) + .calendar-icon {
            display: block;
        }

        /* Firefox 日期选择器样式 */
        .date-input::-moz-calendar-picker-indicator {
            cursor: pointer;
            opacity: 1;
        }

        /* 确保日期输入框的交互性 */
        .date-input:focus {
            outline: none;
            border-color: #8B5CF6;
        }

        .form-group textarea {
            min-height: 100px;
            resize: vertical;
        }

        /* 分类容器 */
        .tags-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        /* 分类选择器 */
        .category-select {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.875rem;
            appearance: none;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
            background-position: right 8px center;
            background-repeat: no-repeat;
            background-size: 16px;
        }

        .category-select:focus {
            outline: none;
            border-color: rgba(139, 92, 246, 0.6);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        .category-select option {
            background: #2a2a2a;
            color: white;
        }

        /* 分类列表 */
        .category-list {
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.05);
        }

        .category-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.5rem 0.75rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            transition: background 0.2s ease;
        }

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

        .category-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .category-item-left {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex: 1;
            cursor: pointer;
        }

        .category-name {
            font-size: 0.875rem;
            color: rgba(255, 255, 255, 0.9);
        }

        .category-count {
            font-size: 0.75rem;
            color: rgba(255, 255, 255, 0.6);
            background: rgba(255, 255, 255, 0.1);
            padding: 0.125rem 0.375rem;
            border-radius: 10px;
            min-width: 1.5rem;
            text-align: center;
        }

        .category-actions {
            display: flex;
            gap: 0.25rem;
        }

        .btn-icon {
            padding: 0.25rem;
            border: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.6);
            cursor: pointer;
            border-radius: 4px;
            font-size: 0.75rem;
            width: 1.5rem;
            height: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .btn-icon:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
        }

        .btn-icon.delete:hover {
            background: rgba(220, 38, 38, 0.2);
            color: #fca5a5;
        }

        .btn-icon.edit:hover {
            background: rgba(59, 130, 246, 0.2);
            color: #93c5fd;
        }

        /* 快速添加分类 */
        .quick-add-category {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .new-category-input {
            flex: 1;
        }

        /* 按钮样式 */
        .btn-toggle {
            background: transparent;
            border: none;
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.75rem;
            cursor: pointer;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .btn-toggle:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
        }

        .btn-sm {
            padding: 0.375rem 0.75rem;
            font-size: 0.8rem;
            white-space: nowrap;
        }

        .btn-success {
            background: #059669;
            border-color: #059669;
            color: white;
        }

        .btn-success:hover {
            background: #047857;
            border-color: #047857;
        }

        /* 编辑分类模态框 */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            z-index: 10000;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: #1a1a1a;
            border-radius: 8px;
            padding: 1.5rem;
            min-width: 300px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .modal-header {
            margin-bottom: 1rem;
        }

        .modal-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.9);
        }

        .modal-body {
            margin-bottom: 1.5rem;
        }

        .modal-footer {
            display: flex;
            gap: 0.5rem;
            justify-content: flex-end;
        }

        .btn-cancel {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: rgba(255, 255, 255, 0.7);
            padding: 0.5rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.875rem;
        }

        .btn-cancel:hover {
            background: rgba(255, 255, 255, 0.1);
            color: rgba(255, 255, 255, 0.9);
        }

        .btn-primary {
            background: #3b82f6;
            border: 1px solid #3b82f6;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.875rem;
        }

        .btn-primary:hover {
            background: #2563eb;
            border-color: #2563eb;
        }

        /* 编辑器中的可编辑标签 */
        .tag-item {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem 0.75rem;
            background: rgba(139, 92, 246, 0.2);
            border-radius: 6px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.875rem;
            transition: all 0.3s ease;
            position: relative;
            padding-right: 2rem;
        }

        .tag-item:hover {
            background: rgba(139, 92, 246, 0.3);
        }

        .tag-item .tag-text {
            margin-right: 0.25rem;
        }

        .tag-item .tag-remove {
            position: absolute;
            right: 0.5rem;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0.7;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.9);
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.1);
            transition: all 0.2s ease;
        }

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

        /* 展示用的标签样式 */
        .tool-tag {
            display: inline-flex;
            align-items: center;
            padding: 4px 12px;
            background: rgba(139, 92, 246, 0.15);
            border-radius: 6px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.75rem;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .tool-tag:hover {
            background: rgba(139, 92, 246, 0.25);
        }

        /* 标签输入框样式 */
        #tags {
            width: 100%;
            padding: 0.75rem;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.875rem;
            transition: all 0.3s ease;
        }

        #tags:focus {
            outline: none;
            border-color: #8B5CF6;
            background: rgba(0, 0, 0, 0.3);
        }

        /* 标签容器样式 */
        .tool-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }

        /* 按钮样式统一 */
        .btn {
            padding: 0.75rem 1rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            border: none;
        }

        .btn-primary {
            background: #8B5CF6;
            color: white;
        }

        .btn-primary:hover {
            background: #7C3AED;
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        /* 媒体上传按钮 */
        .media-upload-btn {
            width: 100%;
            padding: 1rem;
            border: 2px dashed rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            background: rgba(0, 0, 0, 0.2);
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .media-upload-btn:hover {
            border-color: #8B5CF6;
            color: rgba(255, 255, 255, 0.9);
        }

        /* 资源拖拽区域样式 - 黑白主题 */
        .resource-drop-zone {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
            min-height: 150px;
            border: 2px dashed #333;
            border-radius: 8px;
            padding: 16px;
            transition: all 0.3s ease;
            position: relative;
            background: #fafafa;
        }

        .resource-drop-zone.empty {
            display: flex;
            align-items: center;
            justify-content: center;
            background: #fafafa;
        }

        .resource-drop-zone.drag-over {
            border-color: #000;
            background: #f0f0f0;
            border-style: solid;
        }

        /* 媒体预览容器 - 保留旧样式名以兼容 */
        .media-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
            min-height: 120px;
            border: 2px dashed rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            padding: 16px;
            transition: all 0.3s ease;
            position: relative;
        }

        .media-container.drag-over {
            border-color: var(--primary-color);
            background-color: rgba(139, 92, 246, 0.1);
        }

        .media-drop-hint {
            text-align: center;
            padding: 1rem;
        }
