/* ===== 管理界面样式 ===== */
.chart-generator-admin-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.admin-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

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

.admin-card h3 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.server-status-section,
.chart-generator-admin-footer {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.server-status-section {
    margin: 30px 0;
}

.chart-generator-admin-footer {
    margin-top: 35px;
}

.server-status-section:hover,
.chart-generator-admin-footer:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.server-status-section h3,
.chart-generator-admin-footer h3 {
    margin: 0 0 25px 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

.status-list p {
    margin: 12px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.status-list strong {
    color: #374151;
    min-width: 160px;
    display: inline-block;
    font-weight: 600;
}

.status-list span[style*="color: green"] {
    font-weight: 600;
    color: #10b981 !important;
}

.status-list span[style*="color: red"] {
    font-weight: 600;
    color: #ef4444 !important;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.error-message ul {
    margin: 12px 0 0 0;
    padding-left: 20px;
}

.error-message li {
    margin: 6px 0;
    color: #dc2626;
    line-height: 1.5;
}

.error-message code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #1e293b;
    font-size: 12px;
}

.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.step {
    background: #f8fafc;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    transition: all 0.3s ease;
}

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

.step h4 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 17px;
    font-weight: 600;
}

.step p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 表格样式 ===== */
.widefat {
    margin-top: 15px;
    border-collapse: collapse;
    width: 100%;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.widefat th {
    font-weight: 600;
    background: #f8fafc;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5e9;
    color: #374151;
}

.widefat td {
    padding: 16px;
    border-bottom: 1px solid #e1e5e9;
    color: #4b5563;
}

.widefat code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #1e293b;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* ===== 表单样式 ===== */
.form-table th {
    padding: 25px 15px 25px 0;
    width: 220px;
    font-weight: 600;
    color: #374151;
}

.form-table td {
    padding: 20px 15px;
}

.form-table tr {
    transition: background-color 0.2s ease;
}

.form-table tr:hover {
    background-color: #f8fafc;
}

.regular-text {
    width: 100%;
    max-width: 450px;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.small-text {
    width: 100px;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.regular-text:focus,
.small-text:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

input[type="password"] {
    font-family: monospace;
    letter-spacing: 1px;
}

input[type="checkbox"] {
    margin-top: 1px;
    transform: scale(1.1);
}

select {
    padding: 10px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

label {
    font-weight: 500;
    color: #374151;
}

.description {
    color: #6b7280;
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.5;
}

/* ===== 设置页面样式 ===== */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.wrap h1 {
    color: #1e293b;
    margin-bottom: 25px;
    font-size: 32px;
    font-weight: 700;
}

.wrap h2 {
    color: #374151;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-top: 35px;
    font-size: 24px;
    font-weight: 600;
}

.chart_generator_api_section,
.chart_generator_general_section {
    background: white;
    padding: 25px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.chart_generator_api_section:hover,
.chart_generator_general_section:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.chart_generator_api_section h2,
.chart_generator_general_section h2 {
    margin-top: 0;
    color: #1e293b;
    font-size: 20px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
}

/* ===== 按钮样式 ===== */
.button {
    transition: all 0.3s ease;
    border-radius: 6px;
}

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

.submit .button-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #3b82f6;
    padding: 12px 24px;
    height: auto;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.submit .button-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#check-server-status {
    margin-top: 20px;
    padding: 10px 20px;
    border-radius: 6px;
}

/* ===== 通知和状态样式 ===== */
.notice {
    margin: 20px 0 !important;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.notice-success {
    border-left-color: #10b981;
}

.notice-error {
    border-left-color: #ef4444;
}

.status-success {
    color: #10b981;
    font-weight: 600;
}

.status-error {
    color: #ef4444;
    font-weight: 600;
}

.status-warning {
    color: #f59e0b;
    font-weight: 600;
}

/* ===== 信息卡片样式 ===== */
.research-roadmap-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.file-upload-info {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.research-roadmap-info p,
.file-upload-info p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.6;
}

.research-roadmap-info ul,
.file-upload-info ul {
    margin: 0;
    padding-left: 20px;
}

.research-roadmap-info li,
.file-upload-info li {
    margin: 8px 0;
    font-size: 14px;
}

/* ===== 代码样式 ===== */
code {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #1e293b;
    font-size: 13px;
}

/* ===== 前端图表生成器样式 ===== */
.chart-generator-pro-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    position: relative;
    min-height: 700px;
}

.chart-generator-wrapper {
    display: flex;
    height: 100%;
    min-height: 700px;
    gap: 0;
}

/* 左侧输入区域 */
.chart-input-section {
    flex: 0 0 380px;
    padding: 30px 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    min-width: 380px;
    max-width: 380px;
}

.section-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    font-size: 24px;
    color: #3b82f6;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    margin-bottom: 4px;
}

.input-group select,
.input-group textarea {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
    background-image: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
    background-image: none !important;
}

/* 自定义下拉箭头 */
.input-group select {
    background: white url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 16px center;
    background-size: 16px;
    padding-right: 44px;
}

.input-group select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

#chart-prompt {
    width: 100%;
    height: 140px;
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
    background-image: none !important;
}

.prompt-examples {
    margin-top: 10px;
}

.prompt-examples strong {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-bottom: 6px;
}

.example-tag {
    display: inline-block;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin: 4px 6px 4px 0;
    cursor: pointer;
    border: 1px solid #dbeafe;
    transition: all 0.3s ease;
    font-weight: 500;
}

.example-tag:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* 文件上传区域 */
.file-upload-section {
    margin-top: 15px;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    padding: 20px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

.file-upload-section:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.file-upload-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.file-upload-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.file-upload-icon {
    font-size: 20px;
    color: #3b82f6;
}

.file-upload-area {
    text-align: center;
    padding: 20px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}

.file-upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: scale(1.02);
}

.file-upload-text {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.file-upload-text strong {
    color: #3b82f6;
}

.file-upload-hint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.uploaded-files {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.uploaded-file-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.file-icon.image {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.file-icon.document {
    background: linear-gradient(135deg, #10b981, #059669);
}

.file-icon.data {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.file-icon.other {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: #6b7280;
}

.file-type {
    text-transform: uppercase;
    font-weight: 600;
}

.file-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove:hover {
    background: #fef2f2;
    transform: scale(1.1);
}

.file-upload-progress {
    margin-top: 10px;
    background: #e5e7eb;
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.file-upload-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.file-uploading {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.drag-overlay::before {
    content: "释放文件以上传";
    font-size: 16px;
}

/* 图表选项面板 */
.chart-options-panel {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.option-group h4 {
    margin: 0 0 18px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.option-group h4:hover {
    color: #3b82f6;
}

.toggle-advanced {
    cursor: pointer;
    transition: transform 0.3s ease;
    color: #6b7280;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
}

.toggle-advanced:hover {
    background: #f1f5f9;
    color: #374151;
}

.toggle-advanced.active,
.toggle-advanced.collapsed {
    transform: rotate(180deg);
}

.toggle-advanced.collapsed {
    transform: rotate(0deg);
}

.option-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.option-item {
    flex: 1;
}

.option-item label {
    font-size: 14px;
    color: #4b5563;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 6px 0;
}

.option-item label:hover {
    color: #374151;
}

.option-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.1);
    cursor: pointer;
}

.option-item.size-option {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-item.size-option label {
    margin-bottom: 0;
    min-width: 60px;
    white-space: nowrap;
}

.option-item.size-option select {
    flex: 1;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.option-item.size-option select:focus {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
}

.advanced-content {
    display: block;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    animation: slideDown 0.3s ease;
}

.advanced-content.collapsed {
    display: none;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 按钮样式 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: nowrap;
    align-items: stretch;
}

.chart-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
}

.chart-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    flex: 2;
    min-width: 140px;
}

.chart-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.chart-btn.secondary {
    background: white;
    color: #374151;
    border: 2px solid #e2e8f0;
    flex: 1;
    min-width: 100px;
}

.chart-btn.secondary:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

.chart-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.action-btn {
    padding: 10px 16px;
    font-size: 13px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

/* 右侧输出区域 */
.chart-output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 600px;
}

.chart-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8fafc;
    flex-shrink: 0;
}

.chart-preview-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-preview-header h3 i {
    font-size: 22px;
    color: #3b82f6;
}

.chart-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chart-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.preview-container-wrapper {
    flex: 1;
    min-height: 500px;
    max-height: 70vh;
    border-bottom: 1px solid #e1e5e9;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-preview-container {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: auto;
    min-height: 500px;
}

.chart-preview {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    transition: all 0.3s ease;
    overflow: auto;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chart-preview:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

.chart-preview svg,
.chart-preview img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    object-fit: contain;
}

.chart-preview:hover svg {
    transform: scale(1.01);
}

.preview-placeholder {
    text-align: center;
    color: #9ca3af;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.preview-placeholder p {
    font-size: 16px;
    margin-bottom: 8px;
    color: #6b7280;
}

.preview-placeholder small {
    font-size: 13px;
    color: #9ca3af;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
    color: #6b7280;
    height: 100%;
    width: 100%;
    background: white;
    border-radius: 12px;
}

.preview-loading .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.preview-loading p {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.preview-loading small {
    font-size: 13px;
    color: #9ca3af;
}

.preview-loading .loading-dots {
    display: flex;
    gap: 4px;
    margin-top: 16px;
}

.preview-loading .loading-dots span {
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.preview-loading .loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.preview-loading .loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 代码编辑器区域 */
.code-editor-wrapper {
    flex: 1;
    min-height: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid #e1e5e9;
}

.code-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 600px;
    overflow: hidden;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e5e9;
    flex-shrink: 0;
}

.code-header h4 {
    margin: 0;
    color: #374151;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.code-header h4 i {
    font-size: 18px;
    color: #3b82f6;
}

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

.code-btn {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.code-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    border-color: #3b82f6;
    color: #3b82f6;
}

.code-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.code-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

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

.code-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-1px);
}

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

.code-btn.success:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
}

.code-btn.info {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.code-btn.info:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.code-btn.info:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.code-btn .btn-icon {
    margin-right: 4px;
    font-size: 12px;
}

.code-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#svg-code {
    flex: 1;
    width: 100%;
    padding: 20px;
    border: none;
    background: #1f2937;
    color: #e5e7eb;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 500px;
    border-radius: 0;
    overflow: auto;
    background-image: none !important;
}

#svg-code:focus {
    box-shadow: inset 0 0 0 2px #3b82f6;
    background-image: none !important;
}

.code-status {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin-right: 15px;
    background: white;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-valid {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-invalid {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.status-edited {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* 文件输入框样式 */
#svg-import-input {
    position: absolute;
    top: -1000px;
    left: -1000px;
}

/* ===== 优秀图表展示区域样式 ===== */
.chart-gallery-section {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.gallery-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gallery-controls select {
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 140px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.5s ease forwards;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: #3b82f6;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.chart-card:hover::before {
    transform: scaleX(1);
}

.chart-card:nth-child(1) { animation-delay: 0.1s; }
.chart-card:nth-child(2) { animation-delay: 0.2s; }
.chart-card:nth-child(3) { animation-delay: 0.3s; }
.chart-card:nth-child(4) { animation-delay: 0.4s; }
.chart-card:nth-child(5) { animation-delay: 0.5s; }
.chart-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-image {
    position: relative;
    width: 100%;
    height: 180px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #e1e5e9;
    flex-shrink: 0;
}

.chart-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-image img.loaded {
    opacity: 1;
}

.chart-image img.error {
    opacity: 0;
}

.chart-card:hover .chart-image img {
    transform: scale(1.05);
}

.chart-image img.error + .chart-placeholder {
    display: flex;
}

.chart-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 48px;
}

.chart-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 160px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.title-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.chart-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.chart-views, .chart-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 15px;
}

.chart-tag {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #dbeafe;
    white-space: nowrap;
    flex-shrink: 0;
}

.chart-tag.category {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

.chart-tag.type {
    background: #fef7cd;
    color: #92400e;
    border-color: #fde68a;
}

.chart-tag.private {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.chart-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
    flex-wrap: wrap;
}

.use-chart-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.use-chart-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

.view-chart-btn,
.like-btn {
    padding: 8px 12px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex: 1;
    min-width: 70px;
}

.view-chart-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

.like-btn:hover:not(:disabled) {
    border-color: #ef4444;
    color: #ef4444;
    transform: translateY(-1px);
}

.like-btn.liked {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.like-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 画廊状态样式 */
.gallery-loading,
.gallery-empty,
.gallery-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gallery-loading .loading-spinner,
.gallery-empty .empty-icon,
.gallery-error .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.gallery-loading p,
.gallery-empty p,
.gallery-error p {
    margin: 0;
    font-size: 16px;
    color: #6b7280;
}

.gallery-loading small,
.gallery-empty small,
.gallery-error small {
    font-size: 13px;
    color: #9ca3af;
}

.gallery-error .error-icon {
    opacity: 0.6;
}

.gallery-error p {
    margin: 0 0 20px 0;
}

.loading-more {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

.loading-more .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* 保存图表模态框样式 */
#save-chart-modal .modal-content {
    max-width: 500px;
    margin: 50px auto;
}

#save-chart-form .input-group {
    margin-bottom: 20px;
}

#save-chart-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

#save-chart-form input[type="text"],
#save-chart-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#save-chart-form input[type="text"]:focus,
#save-chart-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#save-chart-form textarea {
    resize: vertical;
    min-height: 80px;
}

#save-chart-form .input-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

#save-chart-form input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

/* 标签样式增强 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid #e5e7eb;
}

.chart-stats-extended {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 模态框样式 ===== */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    height: 95%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 64px rgba(0,0,0,0.3);
    overflow: hidden;
    max-width: 95vw;
    max-height: 95vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8fafc;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #374151;
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    overflow: auto;
    position: relative;
}

.fullscreen-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
    min-height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.modal-body svg {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    object-fit: contain;
    display: block;
    margin: auto;
}

.modal-body.scrollable {
    align-items: flex-start;
    justify-content: flex-start;
}

.modal-body.scrollable .fullscreen-preview-container {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
}

.modal-body.scrollable svg {
    margin: 0;
}

/* ===== 图表类型特定样式 ===== */
.chart-preview.roadmap svg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.chart-preview.architecture svg {
    background: #1a202c;
    border-radius: 8px;
}

.chart-preview.mindmap svg {
    background: #f0f9ff;
    border-radius: 8px;
}

.chart-preview.flowchart svg {
    background: #f8fafc;
    border-radius: 8px;
}

.chart-preview.bar svg {
    background: #f8fafc;
    border-radius: 8px;
}

.chart-preview.line svg {
    background: #f8fafc;
    border-radius: 8px;
}

.chart-preview.pie svg {
    background: #f8fafc;
    border-radius: 8px;
}

/* ===== 其他组件样式 ===== */
.chart-generator-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    margin: 10px 0;
    text-align: center;
}

.chart-generator-error a {
    color: #2563eb;
    text-decoration: underline;
    margin-left: 10px;
    font-weight: 500;
}

.chart-notification {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.4s ease;
    color: white;
    font-weight: 600;
    max-width: 350px;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
}

.chart-notification.show {
    transform: translateX(0);
}

.export-status {
    text-align: center;
    padding: 30px;
}

.export-success {
    color: #10b981;
}

.export-error {
    color: #ef4444;
}

.download-link {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.download-link:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.chart-loading {
    display: none;
}

.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    background: #3b82f6;
    border-radius: 2px 0 0 0;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-preview:hover .resize-handle,
.code-editor:hover .resize-handle {
    opacity: 0.5;
}

.resize-handle:hover {
    opacity: 1 !important;
}

/* ===== 滚动条样式 ===== */
.chart-preview::-webkit-scrollbar,
.chart-preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.chart-preview::-webkit-scrollbar-track,
.chart-preview-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.chart-preview::-webkit-scrollbar-thumb,
.chart-preview-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chart-preview::-webkit-scrollbar-thumb:hover,
.chart-preview-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#svg-code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#svg-code::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

#svg-code::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

#svg-code::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.modal-body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-body::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

.uploaded-files::-webkit-scrollbar {
    width: 6px;
}

.uploaded-files::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.uploaded-files::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.uploaded-files::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== 输入框占位符样式 ===== */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
}

::-ms-input-placeholder {
    color: #9ca3af;
}

/* ===== 焦点状态优化 ===== */
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== 平滑过渡 ===== */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* ===== 打印样式 ===== */
@media print {
    .chart-input-section,
    .chart-actions,
    .code-section {
        display: none !important;
    }
    
    .chart-output-section {
        width: 100% !important;
    }
    
    .chart-preview {
        border: none !important;
        box-shadow: none !important;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
    .chart-generator-admin-header {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .usage-steps {
        grid-template-columns: 1fr;
    }
    
    .form-table th {
        width: 100%;
        padding: 15px 0 10px 0;
    }
    
    .form-table td {
        padding: 10px 0 15px 0;
    }
    
    .server-status-section,
    .chart-generator-admin-footer {
        padding: 20px;
    }
}

@media (max-width: 1200px) {
    .chart-generator-wrapper {
        flex-direction: column;
        min-height: 900px;
    }
    
    .chart-input-section {
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        max-height: 450px;
        min-width: auto;
        max-width: none;
        flex: none;
    }
    
    .chart-output-section {
        min-width: auto;
        flex: 1;
    }
    
    .preview-container-wrapper {
        min-height: 300px;
        max-height: 50vh;
    }
    
    .code-editor-wrapper {
        min-height: 300px;
        max-height: 50vh;
    }
    
    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .admin-card {
        padding: 20px;
    }
    
    .step {
        padding: 20px;
    }
    
    .widefat th,
    .widefat td {
        padding: 12px;
        font-size: 13px;
    }
    
    .chart-generator-pro-container {
        border-radius: 12px;
        margin: 10px;
    }
    
    .chart-preview-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 16px 20px;
    }
    
    .chart-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .chart-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }
    
    .chart-btn.primary {
        flex: 1 1 100%;
        order: -1;
    }
    
    .option-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .chart-input-section,
    .chart-output-section {
        padding: 20px;
    }
    
    .code-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 12px 20px;
    }
    
    .code-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .code-status {
        margin-right: 0;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .code-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .chart-btn {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .chart-preview-container {
        padding: 16px;
    }
    
    .modal-content {
        width: 98%;
        height: 98%;
        border-radius: 12px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .option-item.size-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .option-item.size-option label {
        min-width: auto;
    }
    
    .option-item.size-option select {
        width: 100%;
    }
    
    .file-upload-area {
        padding: 15px;
    }
    
    .file-upload-text {
        font-size: 13px;
    }
    
    .file-upload-hint {
        font-size: 11px;
    }
    
    .uploaded-file-item {
        padding: 10px;
    }
    
    .file-name {
        font-size: 12px;
    }
    
    .file-meta {
        font-size: 10px;
    }
    
    .chart-gallery-section {
        padding: 20px;
        margin-top: 30px;
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .gallery-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .gallery-controls select {
        flex: 1;
        min-width: auto;
    }
    
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chart-title {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .title-text {
        font-size: 14px;
    }
    
    .chart-stats {
        font-size: 11px;
        gap: 8px;
    }
    
    .chart-meta {
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .chart-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .use-chart-btn,
    .view-chart-btn,
    .like-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .chart-generator-pro-container {
        border-radius: 8px;
        margin: 5px;
    }
    
    .chart-input-section,
    .chart-output-section {
        padding: 16px;
    }
    
    .code-header {
        padding: 10px 16px;
    }
    
    .chart-preview-container {
        padding: 12px;
    }
    
    .chart-preview-header {
        padding: 12px 16px;
    }
    
    #svg-code {
        padding: 16px;
        font-size: 12px;
    }
    
    .chart-input-section {
        gap: 18px;
    }
    
    .action-buttons {
        gap: 8px;
    }
    
    .chart-btn {
        padding: 12px 16px;
        font-size: 13px;
        flex: 1 1 100%;
    }
    
    .chart-btn.primary {
        flex: 1 1 100%;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .gallery-controls select {
        width: 100%;
    }
    
    .chart-gallery-section {
        padding: 15px;
        margin-top: 20px;
    }
    
    .pagination-pages {
        display: none;
    }
    
    .chart-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .title-text {
        width: 100%;
    }
    
    .chart-stats {
        align-self: flex-start;
    }
    
    .chart-meta {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* 大屏幕优化 */
@media (min-width: 1400px) {
    .chart-generator-wrapper {
        min-height: 800px;
    }
    
    .chart-input-section {
        flex: 0 0 420px;
        min-width: 420px;
        max-width: 420px;
    }
    
    .preview-container-wrapper {
        min-height: 400px;
        max-height: 65vh;
    }
    
    .code-editor-wrapper {
        min-height: 400px;
        max-height: 65vh;
       }
}

@media (min-width: 1920px) {
    .chart-generator-pro-container {
        max-width: 1800px;
        margin: 0 auto;
    }
}

/* 滚动条样式优化 */
.chart-preview::-webkit-scrollbar,
.chart-preview-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.chart-preview::-webkit-scrollbar-track,
.chart-preview-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.chart-preview::-webkit-scrollbar-thumb,
.chart-preview-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.chart-preview::-webkit-scrollbar-thumb:hover,
.chart-preview-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

#svg-code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

#svg-code::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

#svg-code::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

#svg-code::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 全屏模态框滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 6px;
    border: 2px solid #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-body::-webkit-scrollbar-corner {
    background: #f1f5f9;
}

/* 上传文件区域滚动条 */
.uploaded-files::-webkit-scrollbar {
    width: 6px;
}

.uploaded-files::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.uploaded-files::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.uploaded-files::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 输入框占位符样式 */
::placeholder {
    color: #9ca3af;
    opacity: 1;
}

:-ms-input-placeholder {
    color: #9ca3af;
}

::-ms-input-placeholder {
    color: #9ca3af;
}

/* 焦点状态优化 */
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 平滑过渡 */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* 打印样式 */
@media print {
    .chart-input-section,
    .chart-actions,
    .code-section {
        display: none !important;
    }
    
    .chart-output-section {
        width: 100% !important;
    }
    
    .chart-preview {
        border: none !important;
        box-shadow: none !important;
    }
}

/* 调整手柄样式 */
.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 15px;
    height: 15px;
    background: #3b82f6;
    border-radius: 2px 0 0 0;
    cursor: nwse-resize;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-preview:hover .resize-handle,
.code-editor:hover .resize-handle {
    opacity: 0.5;
}

.resize-handle:hover {
    opacity: 1 !important;
}

/* 文件上传进度动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.file-uploading {
    animation: pulse 2s infinite;
}

/* 拖拽上传状态 */
.drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.drag-overlay::before {
    content: "释放文件以上传";
    font-size: 16px;
}
/* 确保在 chart-generator.css 中添加以下样式 */
.code-btn.info {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.code-btn.info:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.code-btn.info:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* 按钮图标样式 */
.code-btn .btn-icon {
    margin-right: 4px;
    font-size: 12px;
}

/* 文件输入框样式 */
#svg-import-input {
    position: absolute;
    top: -1000px;
    left: -1000px;
}
/* 优秀图表展示区域样式 */
.chart-gallery-section {
    margin-top: 40px;
    padding: 30px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.gallery-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.gallery-controls select {
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    min-width: 140px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 确保图表卡片有清晰的外框线 */
.chart-card {
    background: white !important;
    border: 2px solid #e1e5e9 !important; /* 确保边框存在 */
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
    position: relative;
    transition: all 0.3s ease;
    margin: 0 !important; /* 移除可能的外边距 */
    padding: 0 !important; /* 移除可能的内边距 */
}

/* 悬停时边框更明显 */
.chart-card:hover {
    border-color: #3b82f6 !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
    transform: translateY(-4px);
}

/* 修复图片容器边框 */
.chart-image {
    width: 100% !important;
    height: 180px !important;
    background: #f8fafc !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
    border-bottom: 2px solid #e1e5e9 !important; /* 图片区域底部边框 */
    position: relative;
}

/* 确保图片不会超出容器 */
.chart-image img {
    max-width: 95% !important; /* 留出边距，确保边框可见 */
    max-height: 95% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    border: 1px solid #f1f5f9 !important; /* 图片本身也有细边框 */
    border-radius: 6px;
    background: white;
    padding: 4px;
    box-sizing: border-box;
}

/* 修复图片加载后的状态 */
.chart-image img.loaded {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* 确保占位符不会覆盖图片 */
.chart-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 48px;
    z-index: 1; /* 占位符在图片下层 */
}

/* 当图片加载时隐藏占位符 */
.chart-image img.loaded + .chart-placeholder,
.chart-image img:not([src=""]) + .chart-placeholder {
    display: none !important;
}

/* 修复可能的内容覆盖问题 */
.chart-info {
    position: relative;
    z-index: 2;
    background: white !important;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 24px;
}

.title-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.chart-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.chart-views, .chart-likes {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.chart-tag {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #dbeafe;
    white-space: nowrap;
    flex-shrink: 0;
}

.chart-tag.category {
    background: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

.chart-tag.type {
    background: #fef7cd;
    color: #92400e;
    border-color: #fde68a;
}

.chart-tag.private {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
}

.chart-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.use-chart-btn {
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.use-chart-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
}

.view-chart-btn {
    padding: 8px 12px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.view-chart-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

/* 画廊加载状态 */
.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gallery-empty .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.gallery-empty p {
    margin: 0;
    font-size: 16px;
    color: #6b7280;
}

/* ===== 分页样式 ===== */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 18px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 100px;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #f8fafc;
    border-color: #e5e7eb;
    color: #9ca3af;
}

.pagination-info {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    margin: 0 15px;
    white-space: nowrap;
}

.pagination-pages {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-number {
    padding: 8px 14px;
    border: 2px solid #e1e5e9;
    background: white;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 42px;
    text-align: center;
}

.page-number:hover:not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.page-number.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-color: #3b82f6;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.page-ellipsis {
    padding: 8px 6px;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
}
/* 保存图表模态框样式 */
#save-chart-modal .modal-content {
    max-width: 500px;
    margin: 50px auto;
}

#save-chart-form .input-group {
    margin-bottom: 20px;
}

#save-chart-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

#save-chart-form input[type="text"],
#save-chart-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#save-chart-form input[type="text"]:focus,
#save-chart-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#save-chart-form textarea {
    resize: vertical;
    min-height: 80px;
}

#save-chart-form .input-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

#save-chart-form input[type="checkbox"] {
    margin: 0;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .chart-gallery-section {
        padding: 20px;
        margin-top: 30px;
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .gallery-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .gallery-controls select {
        flex: 1;
        min-width: auto;
    }
    
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .chart-title {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .title-text {
        font-size: 14px;
    }
    
    .chart-stats {
        font-size: 11px;
        gap: 8px;
    }
    
    .chart-meta {
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .chart-actions {
        flex-direction: row;
        width: 100%;
    }
    
    .use-chart-btn,
    .view-chart-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    .gallery-pagination {
        gap: 8px;
        padding: 15px;
    }
    
    .pagination-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .page-number {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 36px;
    }
    
    .pagination-info {
        font-size: 13px;
        margin: 0 10px;
    }
    
    .pagination-pages {
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: 1fr;
    }
    
    .gallery-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .gallery-controls select {
        width: 100%;
    }
    
    .chart-gallery-section {
        padding: 15px;
        margin-top: 20px;
    }
    
    .pagination-pages {
        display: none;
    }
    .chart-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .title-text {
        width: 100%;
    }
    
    .chart-stats {
        align-self: flex-start;
    }
    
    .chart-meta {
        width: 100%;
        flex-wrap: wrap;
    }
    .gallery-pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-pages {
        order: -1;
        margin-bottom: 10px;
    }
    
    .pagination-info {
        margin: 0;
    }
    
    .page-ellipsis {
        display: none;
    }
}

/* 分页动画效果 */
@keyframes paginationFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-pagination {
    animation: paginationFadeIn 0.5s ease;
}

/* 分页加载状态 */
.pagination-loading {
    opacity: 0.7;
    pointer-events: none;
}

.pagination-loading .pagination-btn,
.pagination-loading .page-number {
    position: relative;
    overflow: hidden;
}

.pagination-loading .pagination-btn::after,
.pagination-loading .page-number::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 分页焦点状态 */
.pagination-btn:focus-visible,
.page-number:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-color: #3b82f6;
}

/* 分页激活状态 */
.page-number:active {
    transform: scale(0.95);
}

/* 分页禁用状态增强 */
.pagination-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
    color: #9ca3af;
}

/* 分页信息样式增强 */
.pagination-info strong {
    color: #374151;
    font-weight: 600;
}

/* 分页按钮组样式 */
.pagination-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 分页分隔线 */
.pagination-divider {
    width: 1px;
    height: 24px;
    background: #e1e5e9;
    margin: 0 8px;
}

/* 分页下拉菜单样式 */
.pagination-dropdown {
    position: relative;
    display: inline-block;
}

.pagination-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-dropdown select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 分页工具提示 */
.pagination-tooltip {
    position: relative;
}

.pagination-tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #374151;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
}

.pagination-tooltip:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #374151;
    margin-bottom: 0;
}
/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-card {
    animation: fadeInUp 0.5s ease forwards;
}

.chart-card:nth-child(1) { animation-delay: 0.1s; }
.chart-card:nth-child(2) { animation-delay: 0.2s; }
.chart-card:nth-child(3) { animation-delay: 0.3s; }
.chart-card:nth-child(4) { animation-delay: 0.4s; }
.chart-card:nth-child(5) { animation-delay: 0.5s; }
.chart-card:nth-child(6) { animation-delay: 0.6s; }

/* 加载更多动画 */
.loading-more {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

.loading-more .loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* 标签样式增强 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    border: 1px solid #e5e7eb;
}

/* 图表统计信息样式增强 */
.chart-stats-extended {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 悬停效果增强 */
.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.chart-card:hover::before {
    transform: scaleX(1);
}
/* 画廊错误状态样式 */
.gallery-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.gallery-error .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.gallery-error p {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #6b7280;
}

/* 优化加载状态 */
.gallery-loading small {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

/* 图片懒加载优化 */
.chart-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-image img.loaded {
    opacity: 1;
}

.chart-image img.error {
    opacity: 0;
}

.chart-image img.error + .chart-placeholder {
    display: flex;
}
/* ===== 前端英雄横幅样式 ===== */
.chart-generator-hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    margin: 20px 0;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.chart-generator-hero-banner::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.chart-generator-hero-banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 2;
}

.hero-main {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.hero-icon {
    font-size: 80px;
    flex-shrink: 0;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    background: linear-gradient(45deg, #fff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin: 0 0 25px 0;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.5;
}

.hero-features {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 10px 16px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.feature-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.feature-icon {
    font-size: 1.2rem;
}

.hero-actions {
    flex-shrink: 0;
}

.hero-cta-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: center;
    white-space: nowrap;
}

.hero-cta-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.hero-cta-btn:active {
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .hero-container {
        gap: 30px;
    }
    
    .hero-features {
        gap: 20px;
    }
    
    .feature-item {
        padding: 8px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 1024px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .hero-main {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    
    .hero-icon {
        font-size: 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-features {
        justify-content: center;
        width: 100%;
    }
    
    .hero-actions {
        width: 100%;
    }
    
    .hero-cta-btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .chart-generator-hero-banner {
        padding: 30px 20px;
        margin: 15px 0;
        border-radius: 16px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .feature-item {
        justify-content: center;
        padding: 8px 12px;
        width: 200px;
    }
    
    .hero-cta-btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .chart-generator-hero-banner {
        padding: 25px 15px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-icon {
        font-size: 50px;
    }
    
    .feature-item {
        font-size: 0.85rem;
        width: 180px;
    }
    
    .hero-cta-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* 确保与现有样式协调 */
.chart-generator-pro-container {
    margin-top: 20px;
}

/* 滚动动画增强 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chart-generator-hero-banner {
    animation: fadeInUp 0.8s ease-out;
}
/* 立即体验按钮聚焦样式 */
#chart-prompt:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}
/* 画廊搜索框样式 */
.gallery-search-box {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 15px;
    flex-grow: 1;
    max-width: 400px;
}

#gallery-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 200px;
}

#gallery-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#gallery-search-btn {
    white-space: nowrap;
    padding: 8px 16px;
}

#clear-gallery-search {
    white-space: nowrap;
    padding: 8px 16px;
    background: #6b7280;
    border-color: #6b7280;
}

#clear-gallery-search:hover {
    background: #4b5563;
    border-color: #4b5563;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .gallery-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .gallery-search-box {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    
    #gallery-search-input {
        min-width: auto;
    }
}

/* 搜索结果提示 */
.gallery-search-results {
    margin: 10px 0;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.gallery-search-results strong {
    color: #3b82f6;
}

/* 无搜索结果样式 */
.gallery-empty-search {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.gallery-empty-search .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.gallery-empty-search p {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 500;
}

.gallery-empty-search small {
    font-size: 14px;
    color: #9ca3af;
}
/* 编辑器模态框样式 */
#chart-editor-modal .modal-content {
    max-width: 95vw !important;
    max-height: 95vh !important;
    width: 95vw !important;
    height: 95vh !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#chart-editor-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#chart-editor-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

#chart-editor-modal #close-editor-modal {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chart-editor-modal #close-editor-modal:hover {
    color: #333;
}

#chart-editor-modal .modal-body {
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 编辑器工具栏样式 */
#editor-toolbar {
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.editor-btn {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.editor-btn:hover {
    background: #e9e9e9;
}

.editor-btn:active {
    transform: scale(0.98);
}

/* 编辑器主区域样式 */
#chart-editor-modal .modal-body > div:last-child {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SVG预览容器样式 */
#editor-svg-container {
    width: 70% !important; /* 增加预览区域宽度 */
    height: 100% !important;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: auto !important;
    position: relative;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}
#chart-editor-modal .modal-body > div:last-child > div:last-child {
    width: 30% !important; /* 代码区域宽度 */
    display: flex;
    flex-direction: column;
    border-left: 1px solid #dee2e6;
    background: #fff;
}

/* 选中元素样式 */
#editor-svg-container .selected {
    outline: 2px solid #ff4757 !important;
    outline-offset: 2px;
}

#editor-svg-container .multi-selected {
    outline: 2px solid #4096ff !important;
    outline-offset: 2px;
    box-shadow: 0 0 8px rgba(64, 150, 255, 0.4);
}

/* 可拖拽元素样式 */
#editor-svg-container text,
#editor-svg-container circle,
#editor-svg-container rect,
#editor-svg-container ellipse,
#editor-svg-container line,
#editor-svg-container path,
#editor-svg-container polygon,
#editor-svg-container polyline,
#editor-svg-container g {
    cursor: move;
    user-select: none;
}

#editor-svg-container line:hover,
#editor-svg-container path:hover {
    filter: brightness(1.2);
    cursor: pointer;
}

#editor-svg-container text:hover,
#editor-svg-container circle:hover,
#editor-svg-container rect:hover,
#editor-svg-container ellipse:hover,
#editor-svg-container line:hover,
#editor-svg-container path:hover,
#editor-svg-container polygon:hover,
#editor-svg-container polyline:hover,
#editor-svg-container g:hover {
    opacity: 0.8;
}

/* 调整面板样式 */
#editor-adjustment-panel {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    display: none;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    width: 280px;
    font-size: 12px;
}

#editor-adjustment-panel-handle {
    background: #f8f9fa;
    padding: 5px;
    margin: -10px -10px 8px -10px;
    text-align: center;
    cursor: move;
    font-size: 12px;
    color: #666;
    border-bottom: 1px solid #ddd;
}

#editor-adjustment-panel label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

#editor-adjustment-panel input[type="number"] {
    width: 65px;
    padding: 3px 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: right;
}

#editor-adjustment-panel input[type="color"] {
    width: 50px;
    height: 24px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

#editor-adjustment-panel input[type="range"] {
    flex: 1;
    margin: 0 8px;
}

#editor-adjustment-panel textarea {
    width: 100%;
    padding: 5px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    min-height: 40px;
}

#editor-adjustment-panel button {
    padding: 4px 8px;
    font-size: 11px;
    margin-top: 2px;
}

/* 代码编辑器区域样式 */
#editor-svg-input {
    width: 100%;
    height: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#editor-svg-input:focus {
    border-color: #4096ff;
    box-shadow: 0 0 0 2px rgba(64, 150, 255, 0.1);
}
/* 确保SVG预览可以滚动 */
#editor-svg-container svg {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: auto;
}

/* 调整预览容器内的SVG显示 */
#editor-svg-container svg {
    transform-origin: center;
    transition: transform 0.3s ease;
}

/* 鼠标悬停时可缩放提示 */
#editor-svg-container:hover svg {
    cursor: move;
}

/* 调整调整面板位置 */
#editor-adjustment-panel {
    min-width: 280px !important;
    max-width: 350px !important;
    z-index: 10000 !important;
}

/* 工具栏调整 */
#editor-toolbar {
    padding: 10px 20px !important;
    background: #fff !important;
    border-bottom: 1px solid #dee2e6 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center !important;
    min-height: 50px !important;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    #chart-editor-modal .modal-body > div:last-child {
        flex-direction: column;
    }
    
    #editor-svg-container {
        width: 100% !important;
        height: 60% !important;
    }
    
    #chart-editor-modal .modal-body > div:last-child > div:last-child {
        width: 100% !important;
        height: 40% !important;
    }
}

@media (max-width: 768px) {
    #chart-editor-modal .modal-body > div:last-child {
        flex-direction: column;
    }
    
    #editor-svg-container {
        width: 100% !important;
        height: 50% !important;
    }
    
    #chart-editor-modal .modal-body > div:last-child > div:last-child {
        width: 100% !important;
        height: 50% !important;
    }
}
/* 分页样式 */
.page-ellipsis {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    color: #6b7280;
    font-size: 14px;
    user-select: none;
}

.pagination-info {
    margin-left: 20px;
    color: #6b7280;
    font-size: 14px;
    display: inline-block;
    vertical-align: middle;
}

/* 确保分页按钮和省略号对齐 */
.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 30px;
    padding: 15px;
}

.pagination-btn, .page-number {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

.pagination-btn:hover, .page-number:hover {
    background: #f3f4f6;
    border-color: #6b7280;
}

.page-number.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}