/**
 * MatorrIMG 管理后台样式
 * 现代化、响应式设计
 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar h1 {
    font-size: 24px;
    font-weight: 600;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
}

.navbar .nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.navbar .nav-links a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

tr:hover {
    background-color: #f9fafb;
}

/* 图片预览 */
.image-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

/* 表单操作按钮区域 */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
    justify-content: flex-start;
}

.form-actions .btn {
    min-width: 120px;
    font-weight: 600;
}

/* 现代化表单样式 */
.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #374151;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-input:hover:not(:focus) {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 现代化的textarea样式 */
textarea.form-input {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* 现代化的select样式 */
.form-select, select.form-input {
    width: 100%;
    padding: 16px 48px 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23374151"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    cursor: pointer;
}

.form-select:focus, select.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23667eea"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>');
}

.form-select:hover:not(:focus), select.form-input:hover:not(:focus) {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 搜索框 */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box input {
    padding-left: 40px;
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* 新的搜索表单样式 */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-group .form-input {
    flex: 1;
    margin: 0;
}

.search-input-group .btn {
    white-space: nowrap;
    margin: 0;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 警告框 */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #f0f9f4;
    color: #166534;
    border-left-color: #22c55e;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1f2937;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

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

.image-info {
    padding: 16px;
}

.image-info h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.image-actions {
    display: flex;
    gap: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 16px;
    }
    
    .card {
        padding: 16px;
    }
    
    .table-container {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .login-card {
        margin: 20px;
        padding: 30px;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input-group .btn {
        width: 100%;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #374151;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 分组和标签管理样式 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.page-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.stats-summary {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* 颜色显示样式 */
.color-indicator, .color-box {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.color-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-name {
    display: flex;
    align-items: center;
}

/* 数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 标签网格样式 */
.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tag-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.tag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
}

.tag-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tag-actions {
    display: flex;
    gap: 8px;
}

.tag-stats {
    padding: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

/* 热门标签样式 */
.popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.popular-tag-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-link:hover {
    transform: translateY(-1px);
}

.usage-count {
    font-size: 12px;
    color: #666;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 8px;
}

.text-muted {
    color: #999 !important;
}

.text-center {
    text-align: center;
}

/* 表单行样式 */
.form-horizontal .form-row {
    display: flex;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.form-horizontal .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 15px;
    color: #666;
}

.modal-content .warning {
    color: #e74c3c;
    font-size: 14px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

/* 分组和标签管理响应式设计 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .form-horizontal .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-horizontal .form-row .form-group {
        margin-bottom: 20px;
    }
    
    .tags-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .popular-tags {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 颜色输入组样式 */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.color-input-group input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
}

.color-input-group input[type="text"] {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    background-color: #f8f9fa;
}

/* 图片编辑页面布局 */
.edit-image-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-top: 30px;
    min-height: 600px;
}

.image-preview-card {
    height: fit-content;
    position: sticky;
    top: 20px;
}

.image-preview-content {
    text-align: center;
    padding: 25px;
}

.image-preview-content img {
    max-width: 100%;
    max-height: 450px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.image-preview-content img:hover {
    transform: scale(1.02);
}

.image-basic-info {
    text-align: left;
    margin-top: 20px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
}

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

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

.info-item .label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.info-item .value {
    color: #1f2937;
    font-weight: 500;
    font-size: 14px;
}

/* 标签相关样式 */
.tags-input-container {
    position: relative;
}

.current-tags {
    margin: 15px 0;
}

.current-tags label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

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

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background-color: #e9ecef;
    color: white;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.tag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.tag-quick-btn {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-quick-btn:hover {
    background-color: #f8fafc;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.tag-quick-btn.selected {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tag-quick-btn .usage-count {
    font-size: 11px;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.form-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* 现代化图片编辑页面样式 */
.image-preview-section {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.preview-card, .edit-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    transition: all 0.3s ease;
}

.preview-card:hover, .edit-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.preview-header, .edit-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    font-weight: 600;
    border: none;
}

.preview-header h3, .edit-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-content {
    padding: 24px;
}

.image-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.image-wrapper img:hover {
    transform: scale(1.02);
}

.image-metadata {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
}

.meta-grid {
    display: grid;
    gap: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.meta-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.meta-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.meta-value {
    font-size: 13px;
    color: #1e293b;
    font-weight: 600;
}

/* 现代化表单样式 */
.modern-form {
    padding: 24px;
}

.form-section {
    margin-bottom: 32px;
}

.section-title {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.section-title h4 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:has(.form-field:nth-child(2)) {
    grid-template-columns: 1fr 1fr;
}

.form-field {
    position: relative;
}

.form-field.full-width {
    grid-column: 1 / -1;
}

.field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-text {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
}

.label-optional {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 12px;
}

.label-help {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    font-style: italic;
}

.field-input, .field-select, .field-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.field-input:focus, .field-select:focus, .field-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.field-input:hover:not(:focus), .field-select:hover:not(:focus), .field-textarea:hover:not(:focus) {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.field-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.field-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23374151"><path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" /></svg>');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 50px;
    cursor: pointer;
}

/* 标签管理区域样式 */
.current-tags-section {
    margin: 16px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.current-tags-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}

.current-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.current-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quick-select-section {
    margin-top: 20px;
}

.quick-select-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 16px;
}

.quick-tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.quick-tag-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quick-tag-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-tag-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.tag-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.tag-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-count {
    font-size: 11px;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.quick-tag-btn.active .tag-count {
    background: rgba(255, 255, 255, 0.2);
}

/* 按钮增强 */
.btn-large {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-large span {
    font-size: 14px;
}

/* 移动端响应式增强 */
@media (max-width: 768px) {
    .edit-image-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row:has(.form-field:nth-child(2)) {
        grid-template-columns: 1fr;
    }
    
    .quick-tags-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .quick-tag-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .preview-content, .modern-form {
        padding: 16px;
    }
    
    .image-preview-section {
        position: static;
    }
}

/* 压缩设置样式 */
.range-value {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-weight: 500;
    color: #495057;
    text-align: center;
}

.range-value span {
    color: #007bff;
    font-weight: 600;
}

/* Range slider 样式 */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin: 10px 0;
}

input[type="range"]:hover {
    opacity: 1;
}

/* Webkit浏览器 */
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 123, 255, 0.4);
}

/* Firefox */
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* 压缩选项卡片样式 */
.compression-options {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.compression-options h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.compression-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.compression-toggle input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.compression-toggle label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.compression-toggle label:hover {
    background: #e9ecef;
}

.compression-preview {
    margin-top: 15px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 14px;
    color: #6c757d;
}

.compression-preview.enabled {
    border-color: #28a745;
    background: #f8fff9;
}

.compression-preview.disabled {
    border-color: #6c757d;
    background: #f8f9fa;
}

/* 尺寸预设按钮样式 */
.size-presets {
    margin-bottom: 15px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.preset-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    color: #495057;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.preset-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.preset-btn.custom-btn {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
}

.preset-btn.custom-btn:hover {
    background: linear-gradient(45deg, #218838, #1da688);
    border-color: #1e7e34;
}

.preset-btn.custom-btn.active {
    background: linear-gradient(45deg, #155724, #0f5132);
    border-color: #155724;
    box-shadow: 0 3px 10px rgba(21, 87, 36, 0.4);
}

/* 目标宽度输入框样式优化 */
#compression_target_width {
    font-weight: 600;
    color: #667eea;
}

#compression_target_width:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 响应式设计增强 */
@media (max-width: 768px) {
    .preset-buttons {
        justify-content: center;
    }
    
    .preset-btn {
        flex: 1;
        min-width: 70px;
        font-size: 0.8em;
        padding: 6px 12px;
    }
}