* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 80px 1.5rem 2rem;
    margin: 0;
}
.navbar {
    height: 80px !important;
}
.container-main {
    max-width: 1400px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
	margin-top: 20px;
}


h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: #333;
    text-align: center;
}
 h1 i {
    color: #0D6EFD;
    margin-right: 10px;
}

.subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: auto;
}

.tool-intro {
    margin-bottom: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: #f0f7ff;
    border-radius: 10px;
    border-left: 4px solid #0D6EFD;
}

.tool-intro p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.tool-intro strong {
    color: #0b1a33;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

/* ===== 左侧控制面板 ===== */
.control-panel {
    flex: 0 0 420px;
    background: #f8f9fa;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e9edf4;
}

.panel-title {
    font-weight: 600;
    color: #0b1a33;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid #0D6EFD;
    padding-bottom: 0.3rem;
    display: inline-block;
}

/* 输入区域 */
.input-area textarea {
    width: 100%;
    min-height: 160px;
    padding: 0.8rem;
    border: 1px solid #dce2ec;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    background: #ffffff;
    color: #0b1a33;
    outline: none;
    line-height: 1.8;
}

.input-area textarea:focus {
    border-color: #0D6EFD;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.input-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.btn-import {
    padding: 0.3rem 0.8rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-import:hover {
    background: #0b5ed7;
}

.btn-sample {
    padding: 0.3rem 0.8rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-sample:hover {
    background: #059669;
}

.btn-clear {
    padding: 0.3rem 0.8rem;
    background: #e9edf4;
    color: #475569;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-clear:hover {
    background: #dce2ec;
}

.member-count {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* 设置组 */
.setting-group {
    background: #ffffff;
    border-radius: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0;
}

.setting-row label {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

.group-count-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.count-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #dce2ec;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.count-btn:hover {
    border-color: #0D6EFD;
    color: #0D6EFD;
    background: #f0f4ff;
}

#groupCount {
    width: 50px;
    text-align: center;
    padding: 0.2rem;
    border: 1px solid #dce2ec;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    outline: none;
}

#groupCount:focus {
    border-color: #0D6EFD;
}

.info-display {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0b1a33;
    background: #f1f4f9;
    padding: 0.1rem 1rem;
    border-radius: 1rem;
}

/* 避免同组 */
.avoid-group {
    background: #ffffff;
    border-radius: 0.6rem;
    padding: 0.8rem 1rem;
    border: 1px solid #e2e8f0;
}

.avoid-input-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.avoid-input {
    flex: 1;
    min-width: 60px;
    padding: 0.3rem 0.6rem;
    border: 1px solid #dce2ec;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    outline: none;
}

.avoid-input:focus {
    border-color: #0D6EFD;
}

.avoid-sep {
    color: #94a3b8;
    font-size: 0.8rem;
}

.btn-add-avoid {
    padding: 0.3rem 0.6rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-add-avoid:hover {
    background: #0b5ed7;
}

.avoid-list {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.avoid-tag {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 1rem;
    padding: 0.15rem 0.6rem 0.15rem 0.8rem;
    font-size: 0.8rem;
    color: #991b1b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.avoid-tag .remove-tag {
    cursor: pointer;
    color: #ef4444;
    font-size: 0.7rem;
}

.avoid-tag .remove-tag:hover {
    color: #dc2626;
}

.avoid-hint {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: #94a3b8;
}

.avoid-hint i {
    margin-right: 0.2rem;
}

/* 主按钮 */
.btn-primary {
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

.btn-primary:hover {
    background: #0b5ed7;
    transform: scale(1.01);
}

.btn-primary:active {
    transform: scale(0.97);
}

/* ===== 右侧结果面板 ===== */
.result-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e9edf4;
    display: flex;
    flex-direction: column;
}

.result-stats {
    display: flex;
    gap: 1.2rem;
    padding: 0.4rem 0.8rem;
    background: #ffffff;
    border-radius: 0.4rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

.result-stats strong {
    color: #0b1a33;
}

.result-container {
    flex: 1;
    background: #ffffff;
    border-radius: 1rem;
    border: 2px solid #e2e8f0;
    min-height: 350px;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
}

.result-container::-webkit-scrollbar {
    width: 6px;
}

.result-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.result-container .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 250px;
    color: #94a3b8;
}

.result-container .placeholder i {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.result-container .placeholder span {
    font-size: 0.95rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 0.2rem;
}

.group-card {
    background: #f8fafc;
    border-radius: 0.8rem;
    padding: 0.8rem 1rem;
    border: 1px solid #e9edf4;
    transition: 0.15s;
}

.group-card:hover {
    border-color: #0D6EFD;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.group-card .group-header {
    font-weight: 600;
    color: #0D6EFD;
    font-size: 0.9rem;
    border-bottom: 1px solid #e9edf4;
    padding-bottom: 0.3rem;
    margin-bottom: 0.4rem;
    display: flex;
    justify-content: space-between;
}

.group-card .group-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.group-card .group-members .member-tag {
    background: #ffffff;
    padding: 0.1rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    color: #0b1a33;
    border: 1px solid #e2e8f0;
}

.group-card .group-members .member-tag.highlight {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* 结果操作按钮 */
.result-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.btn-regenerate {
    padding: 0.4rem 1.2rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-regenerate:hover {
    background: #0b5ed7;
}

.btn-export {
    padding: 0.4rem 1.2rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-export:hover {
    background: #059669;
}

.btn-copy-result {
    padding: 0.4rem 1.2rem;
    background: #8b5cf6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-copy-result:hover {
    background: #7c3aed;
}


@media (max-width: 992px) { .d-lg-flex { display: none; } }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    .control-panel {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .container-main {
        padding: 1rem;
    }
    .control-panel,
    .result-panel {
        padding: 1rem;
    }
    .header h1 {
        font-size: 1.3rem;
    }
    .header .subtitle {
        display: none;
    }
    .result-grid {
        grid-template-columns: 1fr;
    }
    .avoid-input-row {
        flex-wrap: wrap;
    }
    .avoid-input {
        min-width: 50px;
    }
    .result-actions {
        flex-wrap: wrap;
    }
    .result-actions button {
        flex: 1;
        min-width: 100px;
    }
    .result-stats {
        gap: 0.5rem;
        font-size: 0.75rem;
    }
}