@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Fira+Sans:wght@300;400;500;600;700&display=swap');
@import url('script.css');

:root {
    /* Director Mode Palette */
    --bg-dark: #09090b;
    /* Zinc 950 */
    --bg-panel: #18181b;
    /* Zinc 900 */
    --bg-hover: #27272a;
    /* Zinc 800 */
    --border: #3f3f46;
    /* Zinc 700 */

    --primary: #3b82f6;
    /* Blue 500 */
    --primary-rgb: 59, 130, 246;
    --primary-5: rgba(59, 130, 246, 0.05);
    --primary-10: rgba(59, 130, 246, 0.1);
    --primary-light: #60a5fa;
    --primary-hover: #2563EB;
    /* Blue 600 */
    --accent: #f59e0b;
    /* Amber 500 */
    --accent-rgb: 245, 158, 11;

    --text-main: #e4e4e7;
    /* Zinc 200 */
    --text-sub: #a1a1aa;
    /* Zinc 400 */
    --text-muted: #71717a;
    /* Zinc 500 */

    --bg-card: #1c1c1f;
    --border-light: rgba(255, 255, 255, 0.08);

    --dock-bg: rgba(24, 24, 27, 0.8);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

/* --- Animations --- */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Fira Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Smart Linking --- */
.smart-link {
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s;
    padding: 0 2px;
    border-radius: 2px;
}

.smart-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-color: currentColor;
}

.smart-link.link-role {
    color: #00bfff; /* 天蓝色 / Deep Sky Blue */
    font-weight: 500;
}

.smart-link.link-scene {
    color: #4ade80; /* Emerald 400 */
}

.smart-link.link-prop {
    color: #fb923c; /* Orange 400 */
}

/* --- Common UI Components --- */
.hidden {
    display: none !important;
}

/* Buttons */
.btn-icon {
    color: var(--text-sub);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    text-decoration: none;
}

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

.btn-icon-sm {
    padding: 2px;
    font-size: 0.8rem;
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 4px;
}

.btn-icon.btn-sm {
    padding: 4px;
    width: 28px;
    height: 28px;
}

.btn-icon.btn-sm .material-icons-round {
    font-size: 18px;
}

.btn-icon-sm:hover {
    color: var(--text-main);
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-sub);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.btn-primary .material-icons-round,
.btn-secondary .material-icons-round {
    font-size: 1.2rem;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-ghost-block {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-sub);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-ghost-block:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--border);
}

.btn-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-sub);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
}

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

.btn-text {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-text-sm {
    font-size: 0.75rem;
    padding: 2px 8px;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.btn-text-sm:hover {
    background: var(--primary);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-sub);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.form-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-group select option {
    background-color: var(--bg-panel);
    color: var(--text-main);
}

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

.radio-group {
    display: flex;
    gap: 16px;
    padding: 6px 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin: 0;
    color: var(--text-main);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-xl {
    width: 800px;
    max-height: 800px; /* 将固定高度改为最大高度 */
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.close-modal-x {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    padding: 4px;
}

.close-modal-x:hover {
    color: var(--text-main);
}

.scene-detail-content{
    overflow: scroll;
    scrollbar-width: none;
}

.prop-detail-content{
    overflow: scroll;
    scrollbar-width: none;
}

/* --- Director Mode Specifics --- */
.director-mode {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Status Bar */
.status-bar {
    height: 48px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    flex-shrink: 0;
    z-index: 50;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.status-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.divider {
    width: 1px;
    height: 16px;
    background: var(--border);
    margin: 0 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Workspace & Panels */
.workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.panel {
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.panel-left {
    min-width: 48px;
    max-width: 320px;
    border-right: none;
}

.panel-right {
    flex: 1;
    min-width: 0; /* 防止内容撑破 flex 容器 */
    border-left: 1px solid var(--border);
    border-right: none;
    transition: none;
}

.panel-header-actions{
    display: flex;
}

.panel.collapsed {
    width: 48px !important;
    overflow: hidden;
}

.panel.collapsed .panel-title,
.panel.collapsed .panel-footer .btn-text-label,
.panel.collapsed .chapter-info {
    display: none;
}

.panel.collapsed .list-item {
    justify-content: flex-start;
    padding: 0;
}

.panel.collapsed .btn-ghost-block {
    padding: 0;
    justify-content: flex-start;
}

/* Splitter */
.panel-splitter {
    width: 8px;
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    cursor: col-resize;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    position: relative;
}

.panel-splitter:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.panel-splitter::after {
    content: '';
    width: 2px;
    height: 24px;
    background: var(--border);
    border-radius: 1px;
    pointer-events: none;
}

.panel-splitter:hover::after {
    background: white;
}

/* Dragging state */
.panel-splitter.dragging {
    background: var(--primary);
    border-color: var(--primary);
}

.panel-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.panel-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
}

.panel-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.loading-placeholder{
    text-align: center;
    padding: 10px;
}

/* Stage */
.stage {
    min-width: 330px;
    flex: none;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: none;
}

.stage-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--dock-bg);
    backdrop-filter: blur(12px);
    position: absolute;
    border-bottom: 1px solid var(--border);
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
}

#center-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
    flex: 1;
    min-width: 0;
    display: block;
}

.stage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    flex-shrink: 0;
}

/* Stage Content */
.stage-content {
    flex: 1;
    padding: 40px 0 0 0;
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1.1rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chapter-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    scrollbar-width: none;
    border: none;
    color: var(--text-main);
    padding: 20px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.8;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.overview-container {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100%;
}

/* Stage Footer */
.stage-footer {
    height: 32px;
    background: var(--dock-bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 10%;
    font-size: 0.75rem;
    color: var(--text-muted);
    z-index: 5;
    transition: all 0.3s ease;
}

.stage-footer.is-overview {
    justify-content: space-between;
}
.stage-footer.is-overview .footer-left {
    display: none;
}
.stage-footer.is-overview .footer-right {
    display: flex;
    justify-content: flex-center;
}

.stage-footer.is-chapter .footer-left {
    display: flex;
    gap: 20px;
}
.stage-footer.is-chapter .footer-right {
    display: flex;
    justify-content: flex-end;
}

.footer-left {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.footer-left span {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.footer-right {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.btn-scroll-top {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.btn-scroll-top:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-scroll-top .material-icons-round {
    font-size: 1rem;
}

.content-scroll::-webkit-scrollbar {
    width: 6px;
}

.content-scroll::-webkit-scrollbar-thumb {
    background: var(--bg-dark);
    border-radius: 3px;
}

/* Summary Cards */
.summary-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.summary-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.summary-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.summary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.summary-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.summary-card-index {
    background: var(--bg-dark);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

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

.summary-card-ai-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card-ai-btn .material-icons-round {
    font-size: 16px;
}

.summary-card-ai-btn:hover {
    background: none;
    color: var(--text-muted);
}

.summary-card-body {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Dock */
.dock-container {
    position: relative;
    width: 50px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    flex-shrink: 0; /* 禁止收缩 */
}

.dock {
    /* background: var(--dock-bg); */
    /* backdrop-filter: blur(12px); */
    /* border: 1px solid rgba(255, 255, 255, 0.1); */
    /* padding: 12px 6px; */
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    /* border-radius: 12px; */
    cursor: pointer;
    color: var(--text-sub);
    transition: all 0.2s;
    position: relative;
}

.dock-item .dock-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
    line-height: 1;
}

.dock:hover .dock-item {
    height: 48px;
}

.dock:hover .dock-label {
    display: block;
}

.dock-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    /* transform: scale(1.05); */
}

.dock-item.active {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.dock-item .material-icons-round {
    font-size: 22px;
}

.dock-separator {
    width: 24px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px auto;
}

/* --- Workbench Dashboard --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
}

.dashboard-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dashboard-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-info {
    flex: 1;
    min-width: 0;
}

.dashboard-count {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-section {
    padding: 12px;
}

.section-header-with-action{
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.info-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.info-value {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.85rem;
}

/* --- Core Info Container --- */
.core-info-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-bottom: 32px;
}

.core-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
    max-height: calc(50vh - 90px);
    display: flex;
    flex-direction: column;
}

.core-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.core-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
    padding-bottom: 8px;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.core-card-header span.material-icons-round {
    font-size: 20px;
    opacity: 0.9;
}

.core-card-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-sub);
    text-align: left;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

/* 自定义卡片内部滚动条 */
.core-card-body::-webkit-scrollbar {
    width: 4px;
}

.core-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.core-card-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.core-card-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.formatted-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.formatted-list li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 0;
}

.formatted-list li:last-child {
    margin-bottom: 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid, .core-info-container {
        grid-template-columns: 1fr;
    }
}

/* Lists & Cards */
.list-group {
    padding: 0;
}

.list-item {
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    transition: background 0.15s;
    position: relative;
    height: 48px;
    min-width: 0;
    border-bottom: 1px solid var(--border);
}

.list-item:hover {
    background: var(--bg-hover);
}

.list-item.active {
    background: var(--bg-hover);
}

.chapter-num-box {
    width: 48px;
    height: 48px;
    background: var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-top: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.list-item.active .chapter-num-box {
    background: var(--primary);
    color: white;
    border-right-color: var(--primary);
}

.list-item:hover .chapter-num-box {
    background: var(--bg-hover);
    color: var(--text-main);
}

.list-item.active:hover .chapter-num-box {
    background: var(--primary-hover);
    color: white;
}

.chapter-info {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    overflow: hidden;
}

.chapter-subtitle-text {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Panel Footer */
.panel-footer {
    padding: 0;
    border-top: 1px solid var(--border);
    height: 48px;
    display: flex;
    align-items: stretch;
}

.btn-ghost-block {
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    border: none;
    justify-content: flex-start;
}

.btn-ghost-block .material-icons-round {
    width: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-right: 1px solid transparent;
}

.btn-text-label {
    padding-left: 12px;
}

/* Collapsed State Overrides */
.panel.collapsed .btn-ghost-block .material-icons-round {
    border-right: none;
}

.panel.collapsed .list-item {
    justify-content: flex-start;
}

/* Hide scrollbars but keep scroll functionality */
#chapter-list::-webkit-scrollbar,
.stage-content::-webkit-scrollbar,
.overview-container::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

#chapter-list,
.stage-content,
.overview-container {
    scrollbar-width: none;
}

/* Card Grid & Masonry Layout */
.card-masonry {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 30px;
    overflow-y: auto;
    height: 100%;
    scrollbar-width: none;
}

.tool-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-content.hidden {
    display: none !important;
}

.core-info-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    padding: 10px;
}

.core-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.core-card:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.core-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.core-card-header .material-icons-round {
    font-size: 1.2rem;
}

.core-card-body {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.6;
}

.formatted-list {
    margin: 0;
}

.formatted-list li {
    margin-bottom: 4px;
}

.formatted-list li:last-child {
    margin-bottom: 0;
}

/* 角色卡片 (role-card) */
.role-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-card:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.role-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.role-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.role-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.role-tags {
    display: flex;
    gap: 4px;
}

.role-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 场景卡片 (scene-card) */
.scene-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.scene-card:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.scene-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #10b981;
}

.scene-id {
    font-family: monospace;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.scene-name {
    font-size: 0.95rem;
}

.scene-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
}

.scene-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 道具卡片 (prop-card) */
.prop-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.prop-card:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.prop-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #f59e0b;
}

.prop-id {
    font-family: monospace;
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.prop-name {
    font-size: 0.95rem;
}

.prop-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* 关系卡片 (relation-card) */
.relation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    padding: 10px;
}

.relation-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.relation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.relation-card:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.relation-card:hover::before {
    opacity: 1;
}

.relation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
}

.relation-source, .relation-target {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
}

.relation-card:hover .relation-source,
.relation-card:hover .relation-target {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.relation-arrow {
    display: flex;
    align-items: center;
    color: var(--primary);
    opacity: 0.8;
    animation: pulse-arrow 2s infinite ease-in-out;
}

@keyframes pulse-arrow {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(4px); opacity: 1; }
}

.relation-type-tag {
    align-self: center;
    font-size: 0.75rem;
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
    margin: 0 4px;
    white-space: nowrap;
}

.relation-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    margin-top: 4px;
    position: relative;
}

.relation-desc::after {
    content: '"';
    position: absolute;
    top: 4px;
    right: 12px;
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.1;
    font-family: serif;
}

/* 剧本样式 (script-list) */
.script-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
}

.script-card {
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.script-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.scene-header-text {
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.script-chars {
    display: flex;
    gap: 6px;
}

.char-tag {
    cursor: pointer;
}

.char-tag:hover {
    text-decoration: underline;
    color: var(--primary);
}

.script-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.script-line {
    font-size: 1rem;
    line-height: 1.6;
}


.script-line.action {
    color: var(--text-sub);
    font-style: italic;
}

.script-line.note {
    color: var(--text-muted);
    font-size: 0.85rem;
    border-left: 2px solid var(--border);
    padding-left: 12px;
}

.chapter-group-header {
    background: var(--bg-dark);
    padding: 8px 16px;
    font-weight: bold;
    color: var(--primary);
    border-radius: 4px;
}

.info-card {
    background: var(--bg-panel);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.info-card h4 {
    margin: 0 0 12px 0;
    color: var(--primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.kv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kv-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px dashed #333;
    padding-bottom: 4px;
}

.kv-item .label {
    color: var(--text-sub);
}

.kv-item .value {
    color: var(--text-main);
    font-weight: 500;
}

/* Log Panel Styling */
.log-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: height 0.3s ease;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    overflow: hidden;
}

.log-panel.collapsed {
    height: 32px;
}

.log-panel:not(.collapsed) {
    height: 200px;
}

.log-header {
    height: 32px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    user-select: none;
}

.log-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.log-title .material-icons-round {
    font-size: 1.1rem;
    color: var(--primary);
}

.log-actions {
    display: flex;
    gap: 4px;
}

.log-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    background: #0d0d0f;
    color: #e2e8f0;
    scrollbar-width: none;
}

.log-placeholder {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding-top: 20px;
}

.log-item {
    margin-bottom: 4px;
    line-height: 1.4;
    display: flex;
    gap: 8px;
}

.log-time {
    color: var(--text-muted);
    flex-shrink: 0;
}

.log-msg {
    word-break: break-all;
}

.log-msg.info { color: #38bdf8; }
.log-msg.success { color: #4ade80; }
.log-msg.warning { color: #fbbf24; }
.log-msg.error { color: #f87171; }
.log-msg.ai { color: #c084fc; font-style: italic; }

/* Character Detail Modal */
.character-detail-modal {
    width: 900px !important;
    height: auto !important;
    /* max-height: 800px !important; */
    background: #1a1a1a !important;
    display: flex;
    flex-direction: column;
}

.character-detail-body{
    overflow: scroll;
    scrollbar-width: none;
}


.character-detail-split {
    display: flex;
    height: calc(100% - 60px); /* Subtract header/toolbar height */
    overflow: hidden;
}

.char-detail-left {
    width: 300px;
    flex-shrink: 0;
    padding: 24px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
}

.char-detail-right {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.char-detail-avatar {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-hover);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    position: relative;
}

.char-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.char-detail-avatar:hover img {
    transform: scale(1.05);
}

.char-detail-avatar span {
    font-size: 4rem;
    color: var(--text-sub);
    font-weight: 600;
}

.char-detail-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    letter-spacing: 0.5px;
    margin-top: -8px;
}

.char-badges {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.char-badge-pill {
    font-size: 0.75rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-sub);
    font-weight: 500;
}

.char-basic-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

.info-label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    color: var(--text-main);
    font-weight: 600;
    text-align: left;
}

.char-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.char-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    /* background: var(--primary); */
    opacity: 0.5;
}

.char-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
    padding-bottom: 0;
}

.char-section-title .material-icons-round {
    font-size: 1.2rem;
    color: var(--primary);
}

.char-section-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-sub);
}

.char-arc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
    padding-left: 0;
}

.char-arc-list::before {
    display: none;
}

.arc-item {
    position: relative;
    font-size: 0.9rem;
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
}

.arc-item::before {
    display: none;
}

/* Edit Mode Grid */
.edit-mode-grid {
    padding: 32px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    overflow-y: auto;
    height: calc(100% - 61px); /* 减去顶部 toolbar 高度 */
    box-sizing: border-box;
    scrollbar-width: none;
}

.form-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.modal-toolbar {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.char-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.char-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Character Library Clickable Card */
.role-item.character-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.role-item.character-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: var(--primary);
}

.role-item.character-card:active {
    transform: translateY(0);
}

/* Import Modal Split View */
.split-view {
    display: flex;
    flex: 1;
    padding: 24px;
    gap: 24px;
    height: calc(100% - 60px);
    box-sizing: border-box;
}

.drop-zone {
    flex: 1;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: border-color 0.2s;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.split-right {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

textarea#novel-paste-area {
    height: 100%;
    background: #131316;
    color: #fff;
    padding: 10px;
    border: none;
    scrollbar-width: none;
}

/* --- Homepage Specifics (Index.php) --- */
.batch-analyze-overlay {
    position: absolute;
    top: 50%;
    right: 100%; /* Move to left */
    transform: translateY(-50%) translateX(-10px);
    background: transparent;
    padding-right: 5px; 
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 110;
    white-space: nowrap;
}

/* 桥接层：防止鼠标移动到按钮过程中悬停状态丢失 */
.batch-analyze-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -10px;
    width: 20px;
    background: transparent;
}

/* 内部真正的内容面板 */
.batch-analyze-overlay .overlay-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lg);
}

.dock-item:hover .batch-analyze-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.btn-batch-analyze {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-batch-analyze:hover {
    background: var(--primary-hover);
}

.btn-batch-analyze .material-icons-round {
    font-size: 1rem;
}

/* Audio Player */
#audio-player {
    display: none;
}

/* Character Grid & Items */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    padding: 10px;
    padding-bottom: 56px;
}

/* Scene Grid & Items */
.scene-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 10px;
    padding: 10px;
    padding-bottom: 56px;
}

.scene-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.scene-item:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.scene-avatar {
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Prop Grid & Items */
.prop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 10px;
    padding: 10px;
    padding-bottom: 56px;
}

.prop-item {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.prop-item:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.prop-avatar {
    width: 40px;
    height: 40px;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Storyboard Table Styles */
.storyboard-table-container {
    width: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding-bottom: 56px;
    box-sizing: border-box;
}

.storyboard-header-wrapper {
    width: 100%;
    overflow: hidden; 
    border: 1px solid var(--border);
    border-bottom: none;
}

.storyboard-top-scrollbar {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-top: none;
    border-bottom: none;
    border-radius: 0;
}

.storyboard-top-scrollbar::-webkit-scrollbar {
    height: 6px;
}

.storyboard-top-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.storyboard-scrollbar-content {
    height: 1px;
}

.storyboard-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.storyboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1300px;
    font-size: 0.9rem;
    table-layout: fixed;
}

.storyboard-table th, 
.storyboard-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    word-break: break-all;
    white-space: normal;
    box-sizing: border-box;
}

.storyboard-table th {
    background: var(--bg-dark);
    color: var(--primary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 2px solid var(--primary);
}

.storyboard-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Storyboard Column Widths */
.col-shot { width: 60px; text-align: center; }
.col-scene { width: 100px; text-align: center; }
.col-preview { width: 120px; text-align: center; }
.col-role { width: 140px; text-align: center; }
.col-size { width: 80px; text-align: center; }
.col-angle { width: 80px; text-align: center; }
.col-duration { width: 80px; text-align: center; }
.col-content { width: 400px; }
.col-dialogue { width: 350px; }

.dialogue-item {
    margin-bottom: 6px;
    line-height: 1.5;
    word-break: break-word;
}

.dialogue-item:last-child {
    margin-bottom: 0;
}

.storyboard-preview-img {
    width: 100px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.storyboard-preview-img:hover {
    transform: scale(1.1);
    border-color: var(--primary);
}

.no-preview {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}
.storyboard-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.storyboard-scroll-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.storyboard-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.storyboard-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Storyboard list (old grid) - hidden or renamed */
.storyboard-list {
    display: none;
}

.role-item {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: all 0.2s;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.role-item:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.role-avatar {
    width: 48px;
    height: 48px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    flex-shrink: 0;
}

.relation-avatar {
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-size: 0.9rem;
}

.role-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.role-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}

.role-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
}

.role-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
}

.tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
}

.tag-setting {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.tag-scene {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.tag-items, .tag-characters {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-style: italic;
    text-align: left;
}

.scene-panorama-links {
    display: flex;
    gap: 12px;
    margin: 4px 0;
}

.panorama-link {
    font-size: 1.1rem;
    opacity: 0.2;
    cursor: default;
    filter: grayscale(1);
}

.panorama-link.active {
    opacity: 1;
    filter: none;
    cursor: pointer;
}

.prop-usage {
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    text-align: left;
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

/* Character Specific */
.character-card {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 12px;
}

.role-avatar-wrapper {
    width: 60px;
    height: 60px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.npc-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid var(--bg-panel);
}

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

.role-gender {
    font-size: 0.8rem;
    font-weight: bold;
}

.role-gender.gender-male { color: #3b82f6; }
.role-gender.gender-female { color: #ec4899; }

.count-badge {
    font-size: 0.75rem;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 500;
}

/* Relation Specific */
.relation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 10px;
    padding: 10px;
    padding-bottom: 56px;
}

.relation-group-header {
    grid-column: 1 / -1;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), transparent);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 24px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    border-left: 4px solid var(--primary);
}

.relation-group-header:first-child {
    margin-top: 0;
}

.relation-group-header::before {
    content: "👥";
    margin-right: 8px;
}

.relation-card-item {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    cursor: pointer;
}

.relation-card-item:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.relation-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relation-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.rel-char {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    text-align: left;
    min-width: 0;
}

.rel-char.target {
    flex-direction: row-reverse;
    text-align: right;
}

.rel-avatar-sm {
    width: 32px;
    height: 32px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary);
    flex-shrink: 0;
}
.rel-char-info {
    flex: 1;
    min-width: 0;
}

/* Settings Modal Refactor */
.settings-modal {
    width: 900px !important;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.settings-modal .modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-panel);
}

.settings-modal .modal-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.25rem;
}

.settings-body {
    display: flex;
    flex: 1;
    background: var(--bg-panel);
    overflow: hidden;
}

.settings-sidebar {
    width: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
    padding: 12px 0;
    overflow-y: auto;
}

.settings-nav {
    display: flex;
    flex-direction: column;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.settings-nav-item .material-icons-round {
    margin-right: 12px;
    font-size: 20px;
    color: var(--text-muted);
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.settings-nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

.settings-nav-item.active .material-icons-round {
    color: var(--primary);
}

.settings-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    overflow-y: auto;
}

.settings-panels {
    flex: 1;
    padding: 24px;
}

.settings-panel {
    display: none;
}

.settings-panel.active {
    display: block;
    animation: settingsFadeIn 0.3s ease;
}

/* Tab Header in Panel */
.panel-header-tabs {
    display: flex;
    justify-content: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.category-tabs {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 12px;
}

.category-tab {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    opacity: 0.6;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    opacity: 1;
}

.category-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.category-tab .tab-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Provider Group Content */
.provider-group-content {
    display: none;
}

.provider-group-content.active {
    display: block;
}

/* Two Column Model Grid */
.model-grid.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.model-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.model-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: var(--text-muted);
}

.model-card.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.model-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.model-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    flex-shrink: 0;
}

.model-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.model-status-text {
    font-size: 11px;
    color: var(--text-muted);
}

.model-card.active .model-status-text {
    color: var(--primary);
}

.model-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

.model-card.active .model-status-dot {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.model-source-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.model-source-tag.source-official {
    background: rgba(161, 161, 170, 0.1);
    color: #a1a1aa;
    border: 1px solid rgba(161, 161, 170, 0.2);
}

/* Config Section */
.group-config-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.provider-section-mini {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.provider-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.provider-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}

.key-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    margin-left: 8px;
}

.key-link:hover {
    text-decoration: underline;
}

.empty-settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.empty-settings .material-icons-round {
    font-size: 64px;
    margin-bottom: 16px;
}

.settings-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

.min-width-0 {
    min-width: 0;
}

.rel-char-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rel-char-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rel-link-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 0 8px;
}

.rel-link-text {
    font-size: 0.85rem;
    color: var(--primary);
    white-space: nowrap;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.rel-line {
    display: none;
}

.relation-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.role-desc.single-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
    display: block;
}

.loading {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

/* Model Toggle Selector Styles */
.model-toggle-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid transparent;
    background: rgba(var(--bg-card-rgb), 0.5);
}

.model-toggle-item:hover {
    transform: scale(1.1);
    background: rgba(var(--primary-rgb), 0.1);
}

.model-toggle-item.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.15);
}

.model-toggle-item.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.4);
}

.model-logo img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.model-logo-text {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
}



.rotating {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast Notification - Top Center */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast .material-icons-round {
    font-size: 20px;
}

.toast-info {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), var(--bg-panel));
}

.toast-info .material-icons-round {
    color: var(--primary);
}

.toast-success {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--bg-panel));
}

.toast-success .material-icons-round {
    color: #10b981;
}

.toast-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--bg-panel));
}

.toast-error .material-icons-round {
    color: #ef4444;
}

.toast-warn {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--bg-panel));
}

.toast-warn .material-icons-round {
    color: #f59e0b;
}

.toast-ai {
    border-color: #a855f7;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), var(--bg-panel));
}

.toast-ai .material-icons-round {
    color: #a855f7;
}

/* Audit Matrix Styles */
.audit-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--border);
}

.audit-table-container {
    overflow-y: auto;
    scrollbar-width: none;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.audit-table th {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-hover);
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.audit-table td {
    text-align: center;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.audit-table td.chapter-name-cell {
    text-align: left;
    padding-left: 15px !important;
}

.chapter-idx {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    margin-right: 8px;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.chapter-title {
    font-weight: 500;
}

.audit-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s;
    background: var(--border);
}

.status-dot:hover {
    transform: scale(1.3);
}

.status-dot.done { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.status-dot.missing { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

.audit-summary {
    font-size: 0.9rem;
    color: var(--text-sub);
}

/* Agent Mode Styles */
.agent-container {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.3s ease-out;
    max-height: 500px;
    position: relative;
    z-index: 10;
    margin-bottom: 35px;
}

.agent-container.hidden {
    display: none;
}

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

.agent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.agent-header span:nth-child(2) {
    flex: 1;
}

.agent-workflow {
    padding: 10px 0;
}

.workflow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    opacity: 0.5;
    transition: all 0.3s;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 1;
    color: #10b981;
}

.step-item.error {
    opacity: 1;
    color: #ef4444;
}

.step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.step-item.active .step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.4);
}

.step-item.completed .step-dot {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.step-item.error .step-dot {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.step-label {
    font-size: 0.65rem;
    text-align: center;
    white-space: nowrap;
}

.step-line {
    height: 2px;
    background: var(--border);
    flex: 1;
    margin-bottom: 24px;
}

.step-item.completed + .step-line {
    background: #10b981;
}

.agent-actions {
    margin-top: 5px;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.agent-log {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}

.log-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-content {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.7rem;
    line-height: 1.5;
    overflow-y: auto;
    max-height: 150px;
    color: var(--text-muted);
    scrollbar-width: none;
}

.log-item {
    margin-bottom: 4px;
    word-break: break-all;
}

.log-item.system { color: var(--text-secondary); }
.log-item.info { color: #3b82f6; }
.log-item.success { color: #10b981; }
.log-item.error { color: #ef4444; }
.log-item.ai { color: var(--primary); }
.log-item.warn { color: #f59e0b; }

.rotating {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

