/* ===== 生肖起名 / 星座起名 / 定字起名 通用表单与结果卡样式 =====
   使用方：/shengxiao/、/xingzuo/、/dingzi/
   主题色通过容器上的 --nm-accent / --nm-accent-2 / --nm-soft 覆盖 */

.nm-section {
    --nm-accent: #059669;
    --nm-accent-2: #f59e0b;
    --nm-soft: #ecfdf5;
    --nm-line: #d1fae5;
    background: #fff;
    border: 1px solid var(--nm-line);
    border-radius: 20px;
    padding: 26px 20px 22px;
    box-shadow: 0 10px 30px rgba(15, 118, 110, .06);
    margin-bottom: 32px;
}

/* ---------- 红色主题（/shengxiao/、/xingzuo/ 起名表单）：主题色统一为红色，标题用黑体 ---------- */
.nm-section.nm-red {
    --nm-accent: #e54646;
    --nm-accent-2: #c62828;
    --nm-soft: #fff2f1;
    --nm-line: #f9d6d3;
    box-shadow: 0 10px 30px rgba(229, 70, 70, .07);
}
.nm-section.nm-red .nm-head h2 {
    font-family: 'SimHei', 'Heiti SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    font-weight: 800;
    color: #000;
    letter-spacing: .4px;
}

.nm-head { text-align: center; margin-bottom: 20px; }
.nm-head h2 {
    font-size: 20px; font-weight: 700; color: #1f2937; margin: 0 0 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.nm-head h2::before {
    content: ''; width: 6px; height: 22px; border-radius: 999px;
    background: linear-gradient(180deg, var(--nm-accent), var(--nm-accent-2));
}
.nm-head p { font-size: 14px; color: #6b7280; line-height: 1.9; margin: 0; }

/* ---------- 表单：行式布局（左黑标签 + 右描边输入框，整体窄栏居中） ---------- */
.nm-form { max-width: 372px; margin: 0 auto; padding: 2px 0 4px; }

.nm-row {
    display: flex; align-items: center; gap: 14px;
    padding: 7px 0;
}
.nm-row-label {
    flex: 0 0 76px; font-size: 15px; font-weight: 500; color: #111827;
    white-space: nowrap; line-height: 22px;
}
.nm-row-label .nm-req { color: #ef4444; }

/* 输入框 / 下拉 / 日期 / 出生时间：统一白底描边圆角框，聚焦跟随主题色 */
.nm-form .nm-row-input,
.nm-form .nm-row-select-wrap,
.nm-form .nm-date input[type="date"],
.nm-form .nm-date select,
.nm-form .gdt-wrap.gdt-line {
    flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 14px;
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; outline: 0;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.nm-form .nm-row-input {
    font-size: 15px; line-height: 44px; color: #111827;
}
.nm-form .nm-row-input::placeholder { color: #bbbfc6; font-weight: 400; }

.nm-form .nm-row-input:hover,
.nm-form .nm-row-select-wrap:hover,
.nm-form .nm-date input[type="date"]:hover,
.nm-form .nm-date select:hover,
.nm-form .gdt-wrap.gdt-line:hover { border-color: #d6dae1; }

.nm-form .nm-row-input:focus,
.nm-form .nm-row-select-wrap:focus-within,
.nm-form .nm-date input[type="date"]:focus,
.nm-form .nm-date select:focus,
.nm-form .gdt-wrap.gdt-line:focus-within {
    border-color: var(--nm-accent);
    box-shadow: 0 0 0 3px var(--nm-soft, #f3f4f6);
}

/* 下拉（生肖 / 星座） */
.nm-row-select-wrap { position: relative; display: flex; align-items: center; }
.nm-row-select {
    flex: 1 1 auto; width: 100%; border: 0; outline: 0; background: transparent;
    font-size: 15px; line-height: 22px; color: #111827;
    padding: 0 22px 0 0; cursor: pointer;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.nm-row-select::-ms-expand { display: none; }
.nm-row-select-wrap::after {
    content: ''; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px;
    border-right: 1.5px solid #b6bcc6; border-bottom: 1.5px solid #b6bcc6;
    transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* 出生时间滚轮触发框（nm 表单内）：与其它输入框同一描边样式 */
.nm-form .gdt-wrap.gdt-line .gdt-trigger {
    border: 0; border-radius: 0; height: 44px; padding: 0 26px 0 0;
    background: transparent; font-size: 15px; line-height: 44px;
}
.nm-form .gdt-wrap.gdt-line .gdt-arrow { right: 14px; color: #b6bcc6; }
.nm-form .gdt-wrap.gdt-line.on-focus { border-color: var(--nm-accent); }

/* 单选（圆圈 + 勾） */
.nm-radio { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; flex: 1 1 auto; }
.nm-radio-item {
    display: inline-flex; align-items: center; gap: 6px; padding: 0;
    border: 0; background: none; cursor: pointer; user-select: none;
    font-size: 15px; line-height: 21px; color: #374151;
    transition: color .16s ease;
}
.nm-radio-item i {
    width: 19px; height: 19px; border-radius: 50%; border: 1px solid #d6dae1;
    background: #fff; display: inline-block; position: relative; flex: 0 0 auto;
    transition: all .16s ease;
}
.nm-radio-item.on { color: var(--nm-accent); font-weight: 600; }
.nm-radio-item.on i { border-color: var(--nm-accent); background: var(--nm-accent); }
.nm-radio-item.on i::after {
    content: ''; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px;
    border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg);
}

/* 提交 */
.nm-actions { margin-top: 22px; }
.nm-submit {
    width: 100%; max-width: 286px; height: 48px; margin: 0 auto; padding: 0 18px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: linear-gradient(to right, var(--nm-accent), var(--nm-accent-2));
    color: #fff; font-size: 16px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .16);
}
.nm-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(15, 23, 42, .22); }
.nm-submit:disabled { opacity: .62; cursor: not-allowed; transform: none; }
.nm-submit-quota {
    font-size: 12px; font-weight: 600; line-height: 18px; padding: 1px 9px;
    border-radius: 999px; background: rgba(255, 255, 255, .26); white-space: nowrap;
}
.nm-submit-quota.none { background: rgba(0, 0, 0, .2); }
.nm-hint {
    margin: 12px 0 0; font-size: 12px; color: #a3a9b3; line-height: 1.8; text-align: center;
}
.nm-hint a { color: var(--nm-accent); text-decoration: underline; }

.nm-error {
    display: none; margin-top: 12px; font-size: 13px; color: #dc2626; line-height: 1.7;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 13px;
}
.nm-error.on { display: block; }
.nm-error a { color: #b91c1c; font-weight: 700; text-decoration: underline; }

/* 宜忌字根 */
.nm-roots { margin-top: 18px; border-top: 1px dashed #e5e7eb; padding-top: 16px; }
.nm-roots-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.nm-roots-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.nm-roots-tag {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-top: 1px;
}
.nm-roots-tag.yi { background: #ecfdf5; color: #047857; }
.nm-roots-tag.ji { background: #fef2f2; color: #b91c1c; }
.nm-roots-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-root-chip {
    font-size: 12px; padding: 3px 9px; border-radius: 8px; border: 1px solid #d1fae5;
    background: #f0fdf4; color: #047857; cursor: default;
}
.nm-root-chip.ji { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.nm-root-intro { font-size: 13px; color: #6b7280; line-height: 1.9; margin: 10px 0 0; }

/* 结果区 */
.nm-result { margin-top: 20px; }
.nm-empty { text-align: center; color: #9ca3af; font-size: 14px; padding: 26px 0; }
.nm-result-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.nm-result-title { font-size: 15px; font-weight: 700; color: #1f2937; }
.nm-result-title em { font-style: normal; color: var(--nm-accent); }
.nm-refresh {
    height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--nm-line);
    background: var(--nm-soft); color: var(--nm-accent); font-size: 13px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.nm-refresh:hover { background: #fff; }

.nm-cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .nm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.nm-card {
    border: 1px solid #eef0f4; border-radius: 14px; padding: 14px 16px; background: #fff;
    transition: all .2s ease;
}
.nm-card:hover { border-color: var(--nm-line); box-shadow: 0 10px 24px rgba(15, 23, 42, .06); transform: translateY(-2px); }
.nm-card-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nm-card-name { font-size: 22px; font-weight: 700; color: #111827; letter-spacing: 2px; }
.nm-card-py { font-size: 12px; color: #9ca3af; letter-spacing: .5px; }
.nm-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nm-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #f3f4f6; color: #4b5563;
}
.nm-badge.yi { background: #ecfdf5; color: #047857; }
.nm-badge.wx { background: #eff6ff; color: #1d4ed8; }
.nm-card-src { font-size: 12px; color: #6b7280; margin-top: 8px; }
.nm-card-shici {
    font-size: 13px; color: #374151; line-height: 1.8; margin-top: 4px;
    padding-left: 10px; border-left: 3px solid var(--nm-line);
}
.nm-card-meaning { font-size: 12px; color: #9ca3af; line-height: 1.8; margin-top: 6px; }

.nm-skeleton { height: 96px; border-radius: 14px; background: linear-gradient(90deg, #f3f4f6 25%, #f9fafb 37%, #f3f4f6 63%); background-size: 400% 100%; animation: nm-shimmer 1.2s ease infinite; }
@keyframes nm-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (max-width: 640px) {
    .nm-section { padding: 20px 14px 18px; border-radius: 16px; }
    .nm-head h2 { font-size: 18px; }
    .nm-card-name { font-size: 20px; }
    .nm-row { gap: 12px; padding: 6px 0; }
    .nm-row-label { flex: 0 0 68px; font-size: 14px; }
    .nm-form .nm-pair input { padding: 0 10px; font-size: 13px; }
    .nm-radio { gap: 14px; }
    .nm-radio-item, .nm-row-input, .nm-row-select { font-size: 14px; }
}

/* ---------- 双姓起名（/shuangxing/）：粉橙主题 + 父母双姓氏输入行 ---------- */
.nm-section.nm-pink {
    --nm-accent: #db2777;
    --nm-accent-2: #f97316;
    --nm-soft: #fdf2f8;
    --nm-line: #fbd5e4;
    box-shadow: 0 10px 30px rgba(219, 39, 119, .07);
}

.nm-pair { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.nm-pair input {
    flex: 1 1 0; min-width: 0; height: 46px; padding: 0 14px;
    border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; outline: 0;
    font-size: 15px; line-height: 44px; color: #111827; font-family: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.nm-pair input::placeholder { color: #bbbfc6; }
.nm-pair input:hover { border-color: #d6dae1; }
.nm-pair input:focus { border-color: var(--nm-accent); box-shadow: 0 0 0 3px var(--nm-soft, #f3f4f6); }
.nm-pair-sign { flex: 0 0 auto; font-size: 13px; color: #c7cbd1; }
/* 双姓 hero：表单窄栏在桌面端略放宽，避免大卡片里留白过多 */
.nm-section.nm-pink .nm-form { max-width: 430px; }
@media (max-width: 640px) { .nm-section.nm-pink .nm-form { max-width: 100%; } }

/* 出生时间（公历）：日期输入 + 时辰下拉（选填） */
.nm-date { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.nm-form .nm-date input[type="date"] {
    font-size: 15px; line-height: 44px; color: #111827; font-family: inherit; cursor: pointer;
}
.nm-form .nm-date input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.nm-form .nm-date select {
    flex: 0 0 auto; max-width: 118px; font-size: 14px; color: #374151;
    font-family: inherit; cursor: pointer;
}
@media (max-width: 400px) { .nm-form .nm-date select { max-width: 96px; font-size: 13px; } }

.nm-card-actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f3f4f6; display: flex; justify-content: flex-end; }
.nm-card-detail {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--nm-accent, #e11d48);
    background: var(--nm-soft, #fff1f2);
    border: 1px solid var(--nm-line, #fecdd3);
    padding: 5px 12px; border-radius: 999px; cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}
.nm-card-detail:hover { border-color: var(--nm-accent, #e11d48); }
