/* ======= 名字生成器：专属样式（三语共享） =======
   只写本工具专属部件；.btn / .toast / .info-card / .feature-grid / .tutorial-steps /
   .scenario-grid / .glossary-item / .faq-item / .related-tools / .tool-card 等共享类在 /style.css。 */

.ng-tool-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ---------- 模式切换 ---------- */

.ng-tabs {
    display: inline-flex;
    gap: 0.3rem;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    align-self: flex-start;
    flex-wrap: wrap;
}

.ng-tab {
    padding: 0.45rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.ng-tab:hover {
    color: var(--primary-color);
}

.ng-tab.is-active {
    background: var(--bg-white);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---------- 参数面板 ---------- */

.ng-panel {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.ng-panel[hidden] {
    display: none;
}

.ng-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ng-field-label {
    flex: 0 0 auto;
    min-width: 4.5rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 分段按钮组 */
.ng-seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ng-seg-btn {
    padding: 0.36rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.ng-seg-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ng-seg-btn.is-active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* 姓输入 */
.ng-surname-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ng-input {
    width: 8.5rem;
    padding: 0.42rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.ng-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.12);
}

.ng-select {
    padding: 0.42rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
}

.ng-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.ng-mini-btn {
    padding: 0.36rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.ng-mini-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ---------- 操作区 ---------- */

.ng-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--border-color);
}

.ng-generate {
    padding: 0.55rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.ng-generate:hover {
    background: var(--primary-light);
    box-shadow: 0 3px 10px rgba(45, 140, 240, 0.28);
}

.ng-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ---------- 结果区 ---------- */

.ng-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ng-results-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ng-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.ng-card {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    transition: var(--transition-fast);
}

.ng-card:hover {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 2px 10px rgba(45, 140, 240, 0.1);
}

.ng-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ng-name {
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    word-break: break-word;
}

.ng-tools {
    display: inline-flex;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.ng-star,
.ng-copy {
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-muted);
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ng-star:hover,
.ng-copy:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.ng-star.is-on {
    border-color: #f5a623;
    color: #f5a623;
    background: #fffbf0;
}

.ng-meta {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
}

/* 五格 */
.ng-g5 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.ng-g5-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18rem;
    padding: 0.16rem 0.42rem;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.ng-g5-item b {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.74rem;
}

.ng-lv-J {
    border-color: #cfe8cd;
    background: #f2faf1;
    color: #3d8b37;
}

.ng-lv-B {
    border-color: #f3e2bd;
    background: #fdf8ec;
    color: #a8791b;
}

.ng-lv-X {
    border-color: #f2d2d2;
    background: #fdf3f3;
    color: #b54a4a;
}

.ng-score {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.ng-means {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.ng-mean-item {
    font-size: 0.76rem;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.14rem 0.4rem;
}

.ng-mean-item b {
    color: var(--primary-color);
    margin-right: 0.22rem;
    font-weight: 600;
}

.ng-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.ng-tag {
    font-size: 0.74rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.ng-empty {
    grid-column: 1 / -1;
    padding: 1.6rem 1rem;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.ng-empty-sm {
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
}

/* ---------- 收藏 ---------- */

.ng-fav-block {
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border-color);
}

.ng-fav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.ng-fav-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ng-fav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ng-fav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.3rem 0.22rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-white);
    font-size: 0.84rem;
    color: var(--text-primary);
}

.ng-fav-del {
    width: 1.15rem;
    height: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.ng-fav-del:hover {
    background: #fdeaea;
    color: #b54a4a;
}

/* ---------- 速查表 ---------- */

.ng-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.ng-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.ng-table th,
.ng-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    color: var(--text-secondary);
}

.ng-table thead th {
    background: var(--bg-light);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.ng-table tbody tr:last-child td {
    border-bottom: none;
}

.ng-table td:first-child {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.ng-table-note {
    margin: 0.75rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
    .ng-results {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .ng-field {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .ng-field-label {
        min-width: 0;
    }

    .ng-tab {
        padding: 0.42rem 0.7rem;
        font-size: 0.84rem;
    }

    .ng-name {
        font-size: 1.15rem;
    }

    .ng-input {
        width: 100%;
    }
}
