﻿/* 周易起名专用样式 */

/* 标签页 */
.naming-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.naming-tab {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}

.naming-tab:hover { color: var(--ink); }

.naming-tab.active {
    color: var(--red);
    border-bottom-color: var(--red);
    font-weight: 600;
}

/* 表单 */
.naming-form { display: none; }
.naming-form.active { display: block; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-item-full {
    grid-column: 1 / -1;
}

.form-item label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.form-item input,
.form-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    color: var(--ink);
    background: rgba(255,252,245,.8);
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-item input:focus,
.form-item select:focus {
    outline: none;
    border-color: var(--red);
    background: #fff;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding: 8px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    cursor: pointer;
    font-weight: normal;
    color: var(--ink);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    accent-color: var(--red);
}

/* 结果列表 */
.name-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.name-card-item {
    background: rgba(255,252,245,.8);
    border: 1px solid var(--line);
    border-radius: 12px 4px 12px 4px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.name-card-item:hover {
    border-color: var(--red);
    background: rgba(255,252,245,1);
    transform: translateY(-1px);
}

.name-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.name-card-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--red-dark);
    letter-spacing: 0.15em;
}

.name-card-score {
    background: linear-gradient(135deg, #c9a227, #8b6914);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.name-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.name-card-full {
    font-size: 12px;
    color: var(--muted);
}

.element-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.element-tag.木 { background: #d4edda; color: #155724; }
.element-tag.火 { background: #f8d7da; color: #721c24; }
.element-tag.土 { background: #fff3cd; color: #856404; }
.element-tag.金 { background: #e2e3e5; color: #383d41; }
.element-tag.水 { background: #d1ecf1; color: #0c5460; }

.name-card-wuge {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}

.name-card-wuge span {
    white-space: nowrap;
}

.name-card-meaning {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-content {
    background: #fff8eb;
    border-radius: 16px 4px 16px 4px;
    padding: 24px;
    max-width: 460px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--line);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
}

.modal-close:hover { color: var(--red); }

#modalBody h3 {
    color: var(--red-dark);
    font-size: 22px;
    margin: 0 0 16px;
    text-align: center;
    letter-spacing: 0.15em;
}

.detail-section {
    margin-bottom: 18px;
}

.detail-section h4 {
    color: var(--red);
    font-size: 14px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detail-item {
    padding: 8px 10px;
    background: rgba(255,252,245,.8);
    border-radius: 8px;
    font-size: 12px;
}

.detail-item .label {
    color: var(--muted);
    margin-right: 6px;
}

.detail-item .value {
    color: var(--ink);
    font-weight: 500;
}

.wuge-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.wuge-table th,
.wuge-table td {
    padding: 7px 5px;
    text-align: center;
    border: 1px solid var(--line);
}

.wuge-table th {
    background: rgba(255,252,245,.9);
    color: var(--red);
    font-weight: 600;
}

.grade-吉, .grade-大吉 { color: #27ae60; font-weight: 600; }
.grade-半吉 { color: #f39c12; font-weight: 600; }
.grade-凶, .grade-大凶 { color: var(--red); font-weight: 600; }

.char-detail {
    padding: 10px;
    background: rgba(255,252,245,.8);
    border-radius: 8px;
    margin-bottom: 8px;
}

.char-detail .char-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--red-dark);
    margin-bottom: 4px;
}

.char-detail .char-meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}

.char-detail .char-meaning {
    font-size: 12px;
    color: var(--ink);
    line-height: 1.6;
}

/* 响应式 */
@media (max-width: 360px) {
    .form-grid { grid-template-columns: 1fr; }
    .naming-tab { font-size: 12px; padding: 8px 4px; }
}
