:root {
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-hover: #f8fafc;
    
    --border-light: #e2e8f0;
    --border-focus: #0f172a;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    
    --accent-dark: #0f172a;
    --accent-blue: #0284c7;
    --accent-amber: #d97706;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.12);
    
    --font-main: 'Plus Jakarta Sans', 'Noto Sans SC', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background-color: var(--text-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo i { width: 20px; height: 20px; }

.brand-info h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-info .sub-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-search {
    flex: 1;
    max-width: 380px;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search .search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-subtle);
    width: 16px;
    height: 16px;
}

.nav-search input {
    width: 100%;
    padding: 8px 36px 8px 38px;
    background-color: var(--bg-subtle);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.nav-search input:focus {
    background-color: var(--bg-surface);
    border-color: var(--border-focus);
}

.search-shortcut {
    position: absolute;
    right: 10px;
    font-size: 0.7rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-subtle);
}

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

/* Workspace Layout */
.workspace {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 60px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Injector Card Section */
.injector-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
}

.injector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.injector-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.injector-title h2 {
    font-size: 1.08rem;
    font-weight: 700;
}

.title-icon {
    color: var(--accent-blue);
    width: 20px;
    height: 20px;
}

.injector-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
    background-color: var(--bg-subtle);
    padding: 4px 10px;
    border-radius: 20px;
}

.injector-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.input-meta-row select {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    font-size: 0.85rem;
    background-color: var(--bg-page);
    color: var(--text-main);
    outline: none;
    font-weight: 500;
}

.split-rule-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

#quick-input {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    font-family: inherit;
    background-color: var(--bg-page);
    color: var(--text-main);
    outline: none;
    resize: vertical;
    line-height: 1.6;
}

#quick-input:focus {
    border-color: var(--border-focus);
    background-color: #fff;
}

/* Split Preview Box */
.split-preview-box {
    background-color: var(--bg-subtle);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 12px 14px;
}

.preview-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 140px;
    overflow-y: auto;
}

.preview-item {
    font-size: 0.82rem;
    color: var(--text-main);
    background: #fff;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.injector-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-lg {
    padding: 9px 20px;
    font-size: 0.9rem;
    background-color: var(--text-main);
    color: #fff;
}

.btn-lg:hover {
    background-color: #1e293b;
}

/* View Switcher Bar (Tab 切换) */
.view-switch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background-color: var(--bg-surface);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.tab-btn:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
}

.tab-btn.active {
    background-color: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.tab-badge {
    font-size: 0.75rem;
    padding: 1px 7px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.tab-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.tab-btn.active .tab-badge.warning {
    background-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-pill {
    padding: 4px 12px;
    border-radius: 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.cat-pill:hover { background-color: var(--bg-subtle); color: var(--text-main); }
.cat-pill.active { background-color: var(--text-main); color: #fff; border-color: var(--text-main); }

/* Prompt List Items */
.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-item {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.prompt-item.is-trash {
    background-color: #fafafa;
    border-color: #e2e8f0;
}

.prompt-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.prompt-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.prompt-index {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-subtle);
    min-width: 24px;
}

.prompt-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

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

.cat-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
}

.trash-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #fee2e2;
    color: #991b1b;
}

.prompt-title {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.prompt-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-light);
    font-size: 0.88rem;
    color: #334155;
    white-space: pre-wrap;
    line-height: 1.6;
    background-color: var(--bg-subtle);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.prompt-body.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    background: none;
    padding: 0;
    margin-top: 6px;
    border-top: none;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}

.btn-primary { background-color: var(--text-main); color: #fff; }
.btn-primary:hover { background-color: #1e293b; }
.btn-secondary { background-color: var(--bg-surface); color: var(--text-main); border: 1px solid var(--border-light); }
.btn-secondary:hover { background-color: var(--bg-subtle); }

.btn-restore {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.btn-restore:hover {
    background-color: #d1fae5;
}

.btn-danger { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background-color: #fee2e2; }

.btn-copy { background-color: #0f172a; color: #fff; padding: 7px 16px; }
.btn-copy:hover { background-color: #334155; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
}
.icon-btn:hover { background-color: var(--bg-subtle); color: var(--text-main); }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--text-main);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 300;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: stretch; }
    .nav-search { max-width: 100%; }
    .view-switch-bar { flex-direction: column; align-items: stretch; }
    .prompt-header { flex-direction: column; align-items: flex-start; }
    .prompt-right { width: 100%; justify-content: flex-end; }
}
