.theme-center {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--c-bg) 0%, var(--c-surface-2) 100%);
    backdrop-filter: blur(24px);
    animation: tc-fade-in 200ms ease;
}
.theme-center.u-hidden { display: none; }

@keyframes tc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-surface);
}
.tc-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tc-header__text {
    display: flex;
    flex-direction: column;
}
.tc-header__title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--c-text);
}
.tc-header__sub {
    font-size: var(--fs-md);
    color: var(--c-text-3);
}
.tc-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: var(--c-surface-2);
    color: var(--c-text-2);
    cursor: pointer;
    font-size: var(--fs-4xl);
    transition: all 140ms;
}
.tc-close:hover {
    background: var(--c-danger);
    color: #fff;
}

.tc-body {
    flex: 1;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 260px;
    gap: 24px;
    padding: 28px;
    max-width: none;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

.tc-left {
    overflow-y: auto;
    padding: 0 16px 0 12px;
}
.tc-left::-webkit-scrollbar { width: 6px; }
.tc-left::-webkit-scrollbar-thumb {
    background: var(--c-surface-3);
    border-radius: 3px;
}

.tc-section {
    margin-bottom: 24px;
}
.tc-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.tc-section__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: var(--fs-md);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tc-section__title {
    font-size: var(--fs-xl);
    font-weight: 600;
    color: var(--c-text);
}

.tc-skins {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.tc-skin-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 140ms, border-color 140ms;
}
.tc-skin-item:hover {
    transform: translateY(-2px);
}
.tc-skin-item.is-active {
    border-color: var(--c-primary);
}
.tc-skin-item.is-active::after,
.tc-person-item.is-active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.tc-skin-item__bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}
.tc-skin-item__label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 6px 4px;
    font-size: var(--fs-xs);
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.tc-persons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.tc-group-back {
    grid-column: 1 / -1;
    padding: 8px 12px;
    font-size: var(--fs-sm);
    color: var(--c-text-2);
    cursor: pointer;
    border-radius: 8px;
    background: var(--c-surface-2);
    margin-bottom: 2px;
    transition: color 140ms, background 140ms;
}
.tc-group-back:hover {
    color: var(--c-primary);
    background: var(--c-surface-3);
}
.tc-group-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 140ms, border-color 140ms;
}
.tc-group-item:hover {
    transform: translateY(-2px);
}
.tc-group-item.is-active {
    border-color: var(--c-primary);
}
.tc-group-item.is-active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.tc-group-item__active {
    display: none;
}
.tc-group-item__avatar {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    background-color: var(--c-surface-3);
}
.tc-group-item__label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 6px 4px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.tc-group-item__count {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}
.tc-group-item__active {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-primary, #667eea);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}
.tc-person-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: transform 140ms, border-color 140ms;
}
.tc-person-item:hover {
    transform: translateY(-2px);
}
.tc-person-item.is-active {
    border-color: var(--c-primary);
}
.tc-person-item__avatar {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center;
    background-color: var(--c-surface-3);
}
.tc-person-item__label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 6px 4px;
    font-size: var(--fs-xs);
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.tc-setting-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    gap: 12px;
}
.tc-setting-label {
    font-size: var(--fs-lg);
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 72px;
}
.tc-setting-val {
    font-size: var(--fs-md);
    color: var(--c-text-3);
    min-width: 36px;
    text-align: right;
}

.tc-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}
.tc-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.tc-switch__track {
    position: absolute;
    inset: 0;
    background: var(--c-surface-3);
    border-radius: 12px;
    transition: background 160ms;
}
.tc-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 160ms;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tc-switch input:checked + .tc-switch__track {
    background: var(--c-primary);
}
.tc-switch input:checked + .tc-switch__track .tc-switch__thumb {
    transform: translateX(20px);
}

.tc-seg {
    display: flex;
    background: var(--c-surface-2);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    position: relative;
}
.tc-seg__btn {
    padding: 6px 14px;
    font-size: var(--fs-md);
    border: none;
    background: transparent;
    color: var(--c-text-2);
    border-radius: 6px;
    cursor: pointer;
    transition: color 200ms;
    position: relative;
    z-index: 1;
}
.tc-seg__btn.is-active {
    color: #fff;
}

.tc-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--c-surface-3);
    border-radius: 2px;
    outline: none;
    margin-top: 4px;
}
.tc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-primary);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.tc-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-primary);
    cursor: pointer;
    border: 2px solid #fff;
}

.tc-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}

.tc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: var(--fs-lg);
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 140ms;
}
.tc-btn--ghost {
    background: var(--c-surface-2);
    color: var(--c-text);
}
.tc-btn--ghost:hover {
    background: var(--c-surface-3);
}
.tc-btn--cancel {
    background: #6b7280;
    color: #fff;
}
.tc-btn--cancel:hover {
    background: #4b5563;
    transform: translateY(-1px);
}
.tc-btn--primary {
    background: var(--c-primary);
    color: #fff;
}
.tc-btn--primary:hover {
    background: var(--c-primary-2);
    transform: translateY(-1px);
}

.tc-center {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tc-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tc-preview__frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
    background: var(--c-bg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform-origin: center center;
    overflow: hidden;
}

.tc-right {
    overflow-y: auto;
    padding: 0 12px 0 16px;
}
.tc-highlights__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xl2);
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--c-border);
}
.tc-highlights__title i {
    color: var(--c-primary);
    font-size: var(--fs-3xl);
}
.tc-highlights__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tc-highlight {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 12px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    transition: transform 140ms;
}
.tc-highlight:hover {
    transform: translateX(-4px);
}
.tc-highlight__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--c-primary) 12%, transparent);
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-3xl);
    flex-shrink: 0;
}
.tc-highlight__name {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--c-text);
    margin-bottom: 4px;
}
.tc-highlight__desc {
    font-size: var(--fs-sm);
    color: var(--c-text-3);
    line-height: 1.4;
}

.tc-footer {
    text-align: center;
    padding: 10px;
    font-size: var(--fs-sm);
    color: var(--c-text-3);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}

@media (max-width: 1100px) {
    .tc-body {
        grid-template-columns: 300px 1fr;
    }
    .tc-right { display: none; }
}
@media (max-width: 768px) {
    .tc-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
    .tc-center { display: none; }
    .tc-section:nth-child(2),
    .tc-section:nth-child(3) {
        display: none;
    }
}