/* ===== 随机分组器 team-splitter ===== */
.ts-setup {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.ts-names-col > label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
    margin-bottom: 7px;
}
.ts-textarea {
    width: 100%;
    min-height: 132px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    outline: none;
    resize: vertical;
}
.ts-textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.ts-names-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ts-count { font-size: 12.5px; color: var(--c-text-muted); }
.ts-count b { color: #0a96a8; font-size: 14px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 9px; }

.ts-opts-col { display: flex; flex-direction: column; gap: 12px; }
.ts-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.ts-seg button {
    height: 43px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all .16s ease;
}
.ts-seg button:hover { border-color: #0a96a8; color: #0a96a8; }
.ts-seg button.is-active {
    background: linear-gradient(135deg, rgba(10,150,168,.16), rgba(10,150,168,.07));
    border-color: rgba(10,150,168,.55);
    color: #0a7f8c;
}
.ts-numline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--c-text-sub); }
.ts-stepper { display: flex; align-items: center; gap: 6px; }
.ts-step {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}
.ts-step:active { transform: scale(.94); }
.ts-num {
    width: 64px; height: 38px;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    -moz-appearance: textfield;
}
.ts-num::-webkit-outer-spin-button, .ts-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ts-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ts-actions .btn-primary { height: 48px; padding: 0 26px; font-weight: 800; }
.ts-actions .btn-ghost { font-weight: 700; }

/* 结果 */
.ts-result {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.ts-team {
    border: 1px solid var(--c-border);
    border-radius: 16px;
    background: var(--c-surface-soft);
    overflow: hidden;
}
.ts-team-head {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ts-team-head span:last-child { font-size: 12px; font-weight: 600; opacity: .88; }
.ts-members { list-style: none; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ts-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    font-size: 13.5px;
    font-weight: 600;
}
.ts-member.is-leader { border-color: rgba(245,159,93,.6); background: rgba(245,159,93,.1); }
.ts-member .nm { flex: 1; min-width: 0; word-break: break-all; }
.ts-crown {
    border: none; background: none; cursor: pointer;
    font-size: 15px;
    opacity: .35;
    padding: 0 2px;
    line-height: 1;
}
.ts-crown.is-on { opacity: 1; }
.ts-crown:hover { opacity: 1; transform: scale(1.15); }

/* 打印区 */
#tsPrintArea { display: none; }
@media print {
    body * { visibility: hidden; }
    #tsPrintArea, #tsPrintArea * { visibility: visible; }
    #tsPrintArea { display: block; position: absolute; left: 0; top: 0; width: 100%; padding: 10mm; }
    .ts-print-title { text-align: center; font-size: 20pt; margin-bottom: 4pt; }
    .ts-print-meta { text-align: center; font-size: 10pt; color: #444; margin-bottom: 12pt; }
    .ts-print-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8pt; }
    .ts-print-team { border: 1.5pt solid #333; border-radius: 4pt; padding: 8pt; break-inside: avoid; }
    .ts-print-team h3 { font-size: 13pt; margin-bottom: 5pt; border-bottom: 1pt dashed #999; padding-bottom: 3pt; }
    .ts-print-team p { font-size: 11.5pt; line-height: 1.9; }
    .ts-print-team b { color: #b8651a; }
}

@media (max-width: 760px) {
    .ts-setup { grid-template-columns: 1fr; }
    .ts-actions .btn-primary, .ts-actions .btn-ghost { width: 100%; }
}
