/* Version Tag Styles */
.group-version {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
}

.version-match {
    background-color: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.version-mismatch {
    background-color: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
}

.group-title:hover .group-actions {
    display: flex;
}

.group-title:hover .group-version {
    display: none;
}

/* Group Settings Dashboard */
.group-dashboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    background: var(--bg-base);
    padding: 40px 48px;
    color: var(--text-main);
    overflow-y: auto;
}

.dashboard-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
    animation: logSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 20px;
}

.dashboard-icon {
    font-size: 32px;
    color: var(--primary);
    background: var(--bg-focus);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(79, 70, 229, 0.3);
}

.dashboard-title-group h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
}

.dashboard-title-group p {
    margin: 0;
    font-size: 13px;
    color: var(--text-sub);
}

.dashboard-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
}

.dashboard-field textarea {
    width: 100%;
    min-height: 160px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-main);
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.dashboard-field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Centered Mode Styles (When one or both sidebars are closed) */
.centered-mode .dashboard-card {
    max-width: 900px;
    margin: 0 auto;
}

.centered-mode .card-list-wrapper,
.centered-mode .add-card-btn {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
}

.centered-mode .add-card-btn {
    display: block;
}

/* Group Accordion Transition */
.group-expand-enter-active,
.group-expand-leave-active {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-out;
    overflow: hidden;
}

.group-expand-enter-from,
.group-expand-leave-to {
    max-height: 0;
    opacity: 0;
}

.group-expand-enter-to,
.group-expand-leave-from {
    max-height: 320px;
    opacity: 1;
}

/* Dialogue Switch Fade Transition */
.dialogue-fade-enter-active,
.dialogue-fade-leave-active {
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dialogue-fade-enter-from {
    opacity: 0;
    transform: translateY(8px);
}

.dialogue-fade-leave-to {
    opacity: 0;
    transform: translateY(-8px);
}

/* Binding Styles */
.locked-input {
    opacity: 0.85;
    cursor: default;
    pointer-events: none;
}

.card-action-bind {
    color: var(--text-muted);
}

.card-action-bind:hover {
    color: var(--primary) !important;
}

.card-action-bind.active {
    color: var(--primary);
}

.char-item-actions {
    position: absolute;
    right: 6px;
    top: 6px;
    display: flex;
    gap: 4px;
}

.char-item-actions .icon-btn {
    position: static !important;
    font-size: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--text-sub);
    opacity: 0;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.char-item:hover .char-item-actions .icon-btn {
    opacity: 1;
}

.char-item-actions .char-del-btn:hover {
    background: #fef2f2;
    color: var(--danger);
}

.char-item-actions .char-bind-btn:hover {
    background: #eff6ff;
    color: var(--primary);
}

/* Character Item Layout Redesign & Beautification */
.char-item {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm, 8px);
    padding: 14px 12px 12px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: grab;
    overflow: hidden;
}

.char-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.char-item:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.char-item:hover::before {
    opacity: 1;
}

.char-item:active {
    cursor: grabbing;
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.char-item-content {
    width: 100%;
}

.char-item-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-main);
    text-align: left;
    display: flex;
    align-items: center;
}

.char-item-name .fa-user {
    color: var(--primary);
    opacity: 0.8;
}

.char-item-name input,
.char-item-name span {
    text-align: left;
}

.char-item-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.char-item-title {
    font-size: 12px;
    color: var(--text-sub);
    text-align: left;
}

.char-item-title input,
.char-item-title span {
    text-align: left;
}

.char-bind-badge {
    font-size: 11px;
    background: var(--bg-hover);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 12px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-hover-highlight {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
    transform: translateX(4px);
    transition: all 0.2s ease;
}

/* 对白类型动态背景与样式 */
.dialogue-type-normal {
    background-color: rgb(0 0 0 / 0);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 0;
}

.dialogue-type-black {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.3s;
    position: relative;
    z-index: 0;
}

.dialogue-type-white {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.3s;
    position: relative;
    z-index: 0;
}

/* 列表与节点卡片特定演出效果 */
.card-type-black {
    background-color: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff !important;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.col:first-child .card-type-black:hover,
.inline-dialogue-list .card-type-black:hover {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

.col:first-child .card-type-black.active,
.inline-dialogue-list .card-type-black.active {
    background-color: rgba(20, 15, 40, 0.8) !important;
    /* 带有主色调暗色 */
    box-shadow: 0 0 0 6px var(--bg-panel), inset 0 0 0 2px var(--primary);
}

.card-type-black .list-name-span,
.card-type-black .inline-item-text,
.card-type-black .del-inline-btn {
    color: #fff !important;
}

.card-type-white {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    color: #111 !important;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.col:first-child .card-type-white:hover,
.inline-dialogue-list .card-type-white:hover {
    background-color: rgba(255, 255, 255, 0.85) !important;
}

.col:first-child .card-type-white.active,
.inline-dialogue-list .card-type-white.active {
    background-color: rgba(240, 245, 255, 0.9) !important;
    /* 带有主色调亮色 */
    box-shadow: 0 0 0 6px var(--bg-panel), inset 0 0 0 2px var(--primary);
}

.card-type-white .list-name-span,
.card-type-white .inline-item-text,
.card-type-white .del-inline-btn {
    color: #111 !important;
}

/* 保证底部的新增按钮也不受背景干扰 */
.col:first-child .add-btn-full {
    position: relative;
    z-index: 2;
    background-color: var(--bg-panel);
}

.col:first-child .add-btn-full:hover {
    background-color: var(--bg-focus);
}

/* 左侧栏对白列表 - 通用纯 CSS 白缝隙逻辑（适用于所有类型的卡片） */
.col:first-child .list-item,
.inline-dialogue-list .list-item {
    margin-bottom: 6px;
    box-shadow: 0 0 0 6.4px var(--bg-panel);
    /* 魔法：用底色的阴影完美填补所有卡片之间的缝隙！ */
    z-index: 2;
    /* 保证在::after之上 */
    border: none !important;
    /* 去除边框，统一使用阴影填充缝隙 */
}

/* 左侧栏对白列表 - 纯 CSS 白缝隙透视窗效果 (仅针对普通卡片) */
.col:first-child .list-item:not(.card-type-black):not(.card-type-white),
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) {
    background-color: rgba(255, 255, 255, 0.45) !important;
    /* 恢复浅色毛玻璃透明 */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-main) !important;
    /* 恢复原本的文字颜色 */
    transition: background-color 0.3s;
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white):hover,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white):hover {
    background-color: rgba(255, 255, 255, 0.65) !important;
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white).active,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white).active {
    /* background-color: rgba(255, 255, 255, 0.15) !important; */
    box-shadow: 0 0 0 6px var(--bg-panel), inset 0 0 0 2px var(--primary);
    /* 内嵌主色边框 */
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white) .list-name-span,
.col:first-child .list-item:not(.card-type-black):not(.card-type-white) .invisible-input,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) .list-name-span,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) .invisible-input,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) .inline-item-text {
    color: var(--text-main) !important;
    text-shadow: none;
    font-weight: 500;
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white).active .list-name-span,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white).active .list-name-span {
    color: var(--primary) !important;
    font-weight: bold;
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white) .delete-btn,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) .del-inline-btn {
    color: var(--text-sub) !important;
}

.col:first-child .list-item:not(.card-type-black):not(.card-type-white) .delete-btn:hover,
.inline-dialogue-list .list-item:not(.card-type-black):not(.card-type-white) .del-inline-btn:hover {
    color: #ff4d4f !important;
}

/* 新版台词编辑面板样式 (站桩对话类型 && 非简洁模式) */
.dialogue-type-normal:not(.simple-mode) .dialogue-card {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
    color: white;
    backdrop-filter: blur(4px);
    /* 给卡片自身也加一点毛玻璃质感 */
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .speaker-input {
    color: #ffd700;
    /* 金色 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .title-input {
    color: #ffd700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .title-line {
    background: #ffd700;
    opacity: 0.6;
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .text-input {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .char-counter,
.dialogue-type-normal:not(.simple-mode) .dialogue-card .meta-row,
.dialogue-type-normal:not(.simple-mode) .dialogue-card .meta-row i {
    color: rgba(255, 255, 255, 0.8);
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .card-action-btn {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .card-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card .card-action-del:hover {
    background: rgba(255, 77, 79, 0.8);
    border-color: #ff4d4f;
    color: white;
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card:hover {
    background: rgba(0, 0, 0, 0.4);
    /* 悬浮时背景微微加深 */
    border-color: rgba(255, 255, 255, 0.3);
    /* 边框微微提亮 */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    /* 阴影更柔和 */
}

.dialogue-type-normal:not(.simple-mode) .dialogue-card.card-active {
    background: rgba(0, 0, 0, 0.5);
    border-color: #ffd700 !important;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.4) !important;
}

/* =========================================
   新版台词编辑面板样式 (黑幕模式 && 非简洁模式) 
   ========================================= */
.dialogue-type-black:not(.simple-mode) .dialogue-card {
    background: rgba(25, 25, 25, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 20px 24px;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .card-center {
    margin-top: 0;
    width: 100%;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .text-input {
    color: #ffffff;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    text-shadow: none;
    font-size: 17px;
    letter-spacing: 1px;
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .text-input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .char-counter {
    color: rgba(255, 255, 255, 0.3);
    bottom: -10px;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .meta-row,
.dialogue-type-black:not(.simple-mode) .dialogue-card .meta-row i {
    color: rgba(255, 255, 255, 0.5);
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .card-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.dialogue-type-black:not(.simple-mode) .dialogue-card .card-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dialogue-type-black:not(.simple-mode) .dialogue-card:hover {
    background: rgba(35, 35, 35, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}

.dialogue-type-black:not(.simple-mode) .dialogue-card.card-active {
    background: rgba(15, 15, 15, 0.8);
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

/* =========================================
   新版台词编辑面板样式 (白幕模式 && 非简洁模式) 
   ========================================= */
.dialogue-type-white:not(.simple-mode) .dialogue-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    color: #333333;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 20px 24px;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .card-center {
    margin-top: 0;
    width: 100%;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .text-input {
    color: #111111;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    text-shadow: none;
    font-size: 17px;
    letter-spacing: 1px;
    padding: 16px 20px;
    transition: all 0.3s ease;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .text-input:focus {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .char-counter {
    color: rgba(0, 0, 0, 0.3);
    bottom: -10px;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .meta-row,
.dialogue-type-white:not(.simple-mode) .dialogue-card .meta-row i {
    color: rgba(0, 0, 0, 0.5);
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .card-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.6);
}

.dialogue-type-white:not(.simple-mode) .dialogue-card .card-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #111;
}

.dialogue-type-white:not(.simple-mode) .dialogue-card:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.dialogue-type-white:not(.simple-mode) .dialogue-card.card-active {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
}