/* ========== index-worldbuilding.css ========== */
/* 世界观页面（worldbuilding）的CSS样式 */
/* 从 public/index.php $page==='worldbuilding' 区域提取 */

/* ========== 项目选择列表 ========== */
.world-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.world-project-card {
    text-decoration: none;
    display: block;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s;
}

.world-project-card-title {
    color: #333;
    margin-bottom: 8px;
}

.world-project-card-meta {
    color: #666;
    font-size: 13px;
}

/* ========== 页面头部 ========== */
.world-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.world-header-title {
    margin: 0;
}

.world-header-desc {
    color: #666;
    margin-top: 8px;
}

/* ========== AI数据用途说明 ========== */
.world-data-notice {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 12px;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 类别统计卡片 ========== */
.world-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.world-category-card {
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
}

.world-category-name {
    font-weight: 600;
}

.world-category-desc {
    font-size: 12px;
    color: #888;
}

.world-category-count {
    font-size: 20px;
    font-weight: 700;
    margin-top: 8px;
}

/* ========== 操作按钮栏 ========== */
.world-actions-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.world-sync-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.world-sync-btn-green {
    border: 1px solid #10b981;
    background: #ecfdf5;
    color: #10b981;
}

.world-sync-btn-amber {
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #f59e0b;
}

.world-hint-tag {
    color: #888;
    font-size: 12px;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 6px;
}

.world-hint-tag-success {
    color: #10b981;
    margin-left: 4px;
}

.world-hint-link {
    color: #4f46e5;
}

.world-hint-text {
    color: #888;
    font-size: 13px;
}

.world-filter-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.world-batch-mode-btn {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 13px;
}

/* ========== 批量操作工具栏 ========== */
.world-batch-toolbar {
    background: #fef2f2;
    padding: 12px 24px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 16px;
}

.world-batch-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.world-batch-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.world-batch-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-batch-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.world-batch-selected-count {
    color: #666;
    font-size: 13px;
}

.world-batch-delete-btn {
    padding: 8px 16px;
    border: 1px solid #dc2626;
    border-radius: 6px;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.world-batch-cancel-btn {
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

/* ========== 境界体系分析结果 ========== */
.world-realm-result-meta {
    margin-bottom: 16px;
}

.world-realm-result-tags {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.world-realm-tag-purple {
    background: #f5f3ff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.world-realm-tag-amber {
    background: #fef3c7;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.world-realm-tag-green {
    background: #dcfce7;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.world-realm-sub-levels {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.world-realm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.world-realm-card {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #c4b5fd;
    border-radius: 8px;
    padding: 12px;
}

.world-realm-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.world-realm-order-badge {
    background: #8b5cf6;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.world-realm-name {
    font-weight: 600;
    color: #6d28d9;
}

.world-realm-sub-badge {
    background: #ddd6fe;
    color: #7c3aed;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
}

.world-realm-card-body {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.world-realm-card-desc {
    margin-bottom: 4px;
}

.world-realm-card-subs {
    margin-bottom: 4px;
    color: #7c3aed;
}

.world-realm-card-features {
    color: #888;
}

.world-realm-success-msg {
    color: #10b981;
    font-size: 13px;
    margin-top: 16px;
}

.world-realm-error-msg {
    color: #dc2626;
}

/* ========== 已保存的境界体系 ========== */
.world-realm-saved-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.world-realm-saved-title {
    margin: 0;
}

.world-realm-saved-arrow {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
}

.world-realm-saved-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.world-realm-saved-date {
    font-size: 12px;
    color: #888;
}

.world-realm-saved-count-badge {
    background: #dcfce7;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.world-realm-saved-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.world-realm-edit-btn {
    padding: 6px 12px;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.world-realm-sync-btn {
    padding: 6px 12px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
    color: #f59e0b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    margin-left: 8px;
}

.world-realm-saved-tags-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.world-realm-saved-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.world-realm-chip {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #c4b5fd;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.world-realm-chip-order {
    background: #8b5cf6;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
}

.world-realm-chip-name {
    font-weight: 500;
    color: #6d28d9;
    font-size: 13px;
}

/* ========== 空境界体系提示 ========== */
.world-realm-empty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-realm-empty-title {
    margin: 0 0 8px;
}

.world-realm-empty-desc {
    color: #888;
    font-size: 13px;
    margin: 0;
}

.world-realm-empty-add-btn {
    padding: 8px 16px;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* ========== 境界编辑弹窗 ========== */
.world-realm-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.world-realm-editor-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.world-realm-editor-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-realm-editor-title {
    margin: 0;
    font-size: 18px;
}

.world-realm-editor-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.world-realm-editor-form {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.world-realm-editor-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.world-realm-editor-list-header {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-realm-editor-add-btn {
    padding: 6px 12px;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.world-realm-editor-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.world-realm-editor-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.world-realm-editor-cancel-btn {
    padding: 10px 20px;
    background: #f3f4f6;
    color: #666;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.world-realm-editor-save-btn {
    padding: 10px 20px;
    background: #8b5cf6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* ========== 境界详情弹窗 ========== */
.world-realm-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.world-realm-detail-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.world-realm-detail-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-realm-detail-title {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.world-realm-detail-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.world-realm-detail-body {
    padding: 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    overflow-y: auto;
    flex: 1;
}

/* ========== 要素统计弹窗 ========== */
.world-stats-info-section {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.world-stats-info-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #333;
}

.world-stats-info-body {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
}

.world-stats-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.world-stats-ref-section {
    background: #f0fdf4;
    padding: 20px;
    border-radius: 12px;
}

.world-stats-ref-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-stats-ref-count {
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.world-stats-ref-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.world-stats-chars-section {
    background: #fef3c7;
    padding: 20px;
    border-radius: 12px;
}

.world-stats-chars-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-stats-chars-count {
    background: #fde68a;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.world-stats-chars-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.world-stats-tags-section {
    background: #eef2ff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
}

.world-stats-tags-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #4f46e5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-stats-tags-count {
    background: #c7d2fe;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.world-stats-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.world-stats-script-section {
    background: #fff;
    border: 2px solid #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    margin-top: 24px;
}

.world-stats-script-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.world-stats-script-body {
    color: #666;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ========== 演绎工作台弹窗 ========== */
.world-workbench-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
}

.world-workbench-content {
    background: #fff;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.world-workbench-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.world-workbench-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.world-workbench-header-title {
    margin: 0;
    font-size: 18px;
}

.world-workbench-header-subtitle {
    font-size: 12px;
    color: #888;
}

.world-workbench-close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.world-workbench-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧信息面板 */
.world-workbench-sidebar {
    width: 320px;
    border-right: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.world-workbench-sidebar-title {
    margin: 0 0 12px;
    color: #333;
}

.world-workbench-sidebar-body {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.world-workbench-sidebar-section-title {
    margin: 20px 0 12px;
    color: #333;
}

.world-workbench-sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.world-workbench-sidebar-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

/* AI生成设置 */
.world-workbench-ai-box {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.world-workbench-ai-hint {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.6;
}

.world-workbench-ai-model-label {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 4px;
}

.world-workbench-ai-model-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
}

.world-workbench-ai-estimate {
    background: #f0fdf4;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.world-workbench-ai-estimate-label {
    font-size: 12px;
    color: #166534;
}

.world-workbench-ai-estimate-value {
    font-size: 14px;
    font-weight: 600;
    color: #166534;
}

.world-workbench-ai-debug-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #f3f4f6;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

/* 右侧编辑区 */
.world-workbench-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.world-workbench-editor-header {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-workbench-editor-label {
    font-weight: 600;
    color: #333;
}

.world-workbench-editor-hint {
    font-size: 12px;
    color: #888;
}

.world-workbench-editor-textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
}

.world-workbench-editor-footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========== AI确认/调试弹窗 ========== */
.world-ai-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1002;
    align-items: center;
    justify-content: center;
}

.world-ai-confirm-content {
    background: #fff;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    padding: 24px;
}

.world-ai-confirm-title {
    margin: 0 0 16px;
    font-size: 16px;
    color: #333;
}

.world-ai-confirm-body {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.world-ai-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.world-debug-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 800px;
    max-width: 95%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
}

.world-debug-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.world-debug-modal-title {
    margin: 0;
    font-size: 16px;
}

.world-debug-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.world-debug-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.world-debug-section {
    margin-bottom: 16px;
}

.world-debug-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.world-debug-pre {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.world-debug-pre-tall {
    max-height: 200px;
}

.world-debug-pre-response {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.world-debug-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

/* ========== 境界编辑器行（JS动态创建） ========== */
.world-realm-row {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.world-realm-row-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
}

.world-realm-row-index {
    background: #8b5cf6;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

.world-realm-row-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.world-realm-row-btn {
    padding: 4px 8px;
    background: #e0e7ff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.world-realm-row-move-btn {
    padding: 4px 8px;
    background: #e2e8f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.world-realm-row-remove-btn {
    padding: 4px 8px;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.world-realm-row-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.world-realm-row-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.world-realm-row-field {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.world-realm-row-field-full {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.world-realm-row-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

/* ========== 深色模式适配 ========== */
body.dark-mode .world-project-card { background: #1a1a3e; border-color: #2a2a4a; }
body.dark-mode .world-project-card-title { color: #e0e0e0; }
body.dark-mode .world-project-card-meta { color: #aaa; }

body.dark-mode .world-header-title { color: #e0e0e0; }
body.dark-mode .world-header-desc { color: #aaa; }
body.dark-mode .world-data-notice { background: #0a1a2e; border-color: #1e40af; color: #93c5fd; }

body.dark-mode .world-category-card { background: #1a1a3e; }
body.dark-mode .world-category-name { color: #e0e0e0; }
body.dark-mode .world-category-desc { color: #888; }

body.dark-mode .world-sync-btn-green { background: #0a2e1a; border-color: #166534; color: #6ee7b7; }
body.dark-mode .world-sync-btn-amber { background: #2e1a0a; border-color: #854d0e; color: #fcd34d; }
body.dark-mode .world-hint-tag { background: #1a1a3e; color: #888; }
body.dark-mode .world-hint-text { color: #888; }
body.dark-mode .world-filter-select { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-batch-mode-btn { background: #1a1a3e; border-color: #2a2a4a; color: #aaa; }

body.dark-mode .world-batch-toolbar { background: #2e0a0a; border-color: #991b1b; }
body.dark-mode .world-batch-selected-count { color: #aaa; }
body.dark-mode .world-batch-btn { background: #1a1a3e; border-color: #2a2a4a; color: #ccc; }
body.dark-mode .world-batch-cancel-btn { background: #1a1a3e; border-color: #2a2a4a; color: #ccc; }

body.dark-mode .world-realm-tag-purple { background: #1a0a2e; color: #c4b5fd; }
body.dark-mode .world-realm-tag-amber { background: #2e1a0a; color: #fcd34d; }
body.dark-mode .world-realm-tag-green { background: #0a2e1a; color: #6ee7b7; }
body.dark-mode .world-realm-sub-levels { color: #aaa; }
body.dark-mode .world-realm-card { background: linear-gradient(135deg, #1a0a2e, #16213e); border-color: #4c1d95; }
body.dark-mode .world-realm-name { color: #c4b5fd; }
body.dark-mode .world-realm-card-body { color: #aaa; }
body.dark-mode .world-realm-card-subs { color: #a78bfa; }

body.dark-mode .world-realm-chip { background: linear-gradient(135deg, #1a0a2e, #16213e); border-color: #4c1d95; }
body.dark-mode .world-realm-chip-name { color: #c4b5fd; }

body.dark-mode .world-realm-editor-content { background: #16213e; }
body.dark-mode .world-realm-editor-header { border-bottom-color: #2a2a4a; }
body.dark-mode .world-realm-editor-title { color: #e0e0e0; }
body.dark-mode .world-realm-editor-close { color: #aaa; }
body.dark-mode .world-realm-editor-form { color: #e0e0e0; }
body.dark-mode .world-realm-editor-footer { border-top-color: #2a2a4a; }
body.dark-mode .world-realm-editor-cancel-btn { background: #1a1a3e; color: #ccc; }

body.dark-mode .world-realm-detail-content { background: #16213e; }
body.dark-mode .world-realm-detail-body { color: #aaa; }

body.dark-mode .world-stats-info-section { background: #1a1a3e; }
body.dark-mode .world-stats-info-title { color: #e0e0e0; }
body.dark-mode .world-stats-info-body { color: #aaa; }
body.dark-mode .world-stats-ref-section { background: #0a2e1a; }
body.dark-mode .world-stats-ref-title { color: #6ee7b7; }
body.dark-mode .world-stats-chars-section { background: #2e1a0a; }
body.dark-mode .world-stats-chars-title { color: #fcd34d; }
body.dark-mode .world-stats-tags-section { background: #0a1a2e; }
body.dark-mode .world-stats-tags-title { color: #a78bfa; }
body.dark-mode .world-stats-script-section { background: #16213e; border-color: #2a2a4a; }
body.dark-mode .world-stats-script-title { color: #e0e0e0; }
body.dark-mode .world-stats-script-body { color: #aaa; }

body.dark-mode .world-workbench-content { background: #1a1a2e; }
body.dark-mode .world-workbench-header { background: #16213e; border-bottom-color: #2a2a4a; }
body.dark-mode .world-workbench-header-title { color: #e0e0e0; }
body.dark-mode .world-workbench-header-subtitle { color: #888; }
body.dark-mode .world-workbench-close-btn { color: #aaa; }
body.dark-mode .world-workbench-sidebar { background: #16213e; border-right-color: #2a2a4a; }
body.dark-mode .world-workbench-sidebar-title { color: #e0e0e0; }
body.dark-mode .world-workbench-sidebar-body { color: #aaa; }
body.dark-mode .world-workbench-sidebar-section-title { color: #e0e0e0; }
body.dark-mode .world-workbench-sidebar-input { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-workbench-ai-box { background: #1a1a3e; border-color: #2a2a4a; }
body.dark-mode .world-workbench-ai-hint { color: #aaa; }
body.dark-mode .world-workbench-ai-model-label { color: #aaa; }
body.dark-mode .world-workbench-ai-model-select { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-workbench-ai-estimate { background: #0a2e1a; }
body.dark-mode .world-workbench-ai-debug-btn { background: #1a1a3e; border-color: #2a2a4a; color: #aaa; }
body.dark-mode .world-workbench-editor-label { color: #e0e0e0; }
body.dark-mode .world-workbench-editor-hint { color: #888; }
body.dark-mode .world-workbench-editor-textarea { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }

body.dark-mode .world-ai-confirm-content { background: #16213e; }
body.dark-mode .world-ai-confirm-title { color: #e0e0e0; }
body.dark-mode .world-ai-confirm-body { color: #aaa; }
body.dark-mode .world-debug-modal-content { background: #16213e; }
body.dark-mode .world-debug-modal-header { border-bottom-color: #2a2a4a; }
body.dark-mode .world-debug-modal-title { color: #e0e0e0; }
body.dark-mode .world-debug-modal-close { color: #aaa; }
body.dark-mode .world-debug-label { color: #e0e0e0; }
body.dark-mode .world-debug-pre { background: #1a1a3e; border-color: #2a2a4a; color: #e0e0e0; }
body.dark-mode .world-debug-pre-response { background: #0a2e1a; border-color: #166534; }
body.dark-mode .world-debug-modal-footer { border-top-color: #2a2a4a; }

body.dark-mode .world-realm-row { background: #1a1a3e; border-color: #2a2a4a; }
body.dark-mode .world-realm-row-input { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-realm-row-btn { background: #0a1a2e; color: #93c5fd; }
body.dark-mode .world-realm-row-move-btn { background: #1a1a3e; color: #ccc; }
body.dark-mode .world-realm-row-remove-btn { background: #2e0a0a; color: #fca5a5; }
body.dark-mode .world-realm-row-field { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-realm-row-field-full { background: #0f3460; color: #e0e0e0; border-color: #2a2a4a; }
body.dark-mode .world-realm-row-details { border-top-color: #2a2a4a; }


/* ========== 响应式适配 ========== */
@media (max-width: 768px) {
    .world-project-grid {
        grid-template-columns: 1fr;
    }
    .world-header-row {
        flex-direction: column;
    }
    .world-category-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .world-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .world-batch-toolbar-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .world-realm-grid {
        grid-template-columns: 1fr;
    }
    .world-realm-editor-grid-2 {
        grid-template-columns: 1fr;
    }
    .world-stats-grid-2 {
        grid-template-columns: 1fr;
    }
    .world-workbench-body {
        flex-direction: column;
    }
    .world-workbench-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 300px;
    }
    .world-realm-editor-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    .world-realm-row-header {
        flex-wrap: wrap;
    }
    .world-realm-row-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .world-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
