.neh-container {
    max-width: 800;
    margin: 20px auto;
    padding: 30px;
    background: #fdfcfb;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', sans-serif;
    border: 2px solid #d4af37; /* Màu vàng đồng phong thủy */
}

.neh-title {
    text-align: center;
    color: #8b0000; /* Đỏ đô */
    font-weight: 800;
    margin-bottom: 25px;
}

.neh-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.neh-input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.neh-btn-submit {
    display: block;          /* Chuyển sang dạng khối để dùng được margin auto */
    margin: 20px auto;       /* Căn giữa theo chiều ngang và tạo khoảng cách trên dưới */
    background: #8b0000;
    color: #fff;
    border: none;
    padding: 15px 40px;      /* Tăng padding trái phải để nút trông cân đối hơn */
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    min-width: 220px;        /* Đảm bảo nút có độ dài tối thiểu đẹp mắt */
    text-transform: uppercase; /* Viết hoa chữ cho trang trọng */
}

.neh-btn-submit:hover {
    background: #a50000;
    transform: translateY(-2px); /* Hiệu ứng nổi lên nhẹ khi di chuột */
    box-shadow: 0 5px 15px rgba(139, 0, 0, 0.3);
}

/* Theme màu sắc theo Mệnh */
.neh-theme-Kim { border-left: 10px solid #ffd700; }
.neh-theme-Mộc { border-left: 10px solid #228b22; }
.neh-theme-Thủy { border-left: 10px solid #0000ff; }
.neh-theme-Hỏa { border-left: 10px solid #ff4500; }
.neh-theme-Thổ { border-left: 10px solid #8b4513; }

.neh-result-card {
    margin-top: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
    text-align: justify;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.neh-res-header { text-align: center; margin-bottom: 20px; }
.neh-badge { 
    background: #8b0000; color: #fff; padding: 4px 12px; 
    font-size: 11px; border-radius: 20px; font-weight: bold;
}
.neh-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}
.neh-info-box {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
}
.neh-label { display: block; font-size: 12px; color: #666; margin-bottom: 5px; }
.neh-val { display: block; font-size: 18px; font-weight: bold; color: #333; }
.neh-divider { height: 2px; background: #eee; margin: 20px 0; position: relative; }
.neh-divider::after {
    content: "☯"; position: absolute; top: -10px; left: 50%;
    transform: translateX(-50%); background: #fff; padding: 0 10px; color: #ccc;
}
.neh-detail-content { line-height: 1.7; color: #444; text-align: justify; }
.neh-detail-content strong { color: #8b0000; }

.neh-form-grid {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.neh-person-box { flex: 1; background: #fff; padding: 15px; border-radius: 10px; border: 1px solid #eee; }
.neh-vs { font-size: 30px; color: #8b0000; font-weight: bold; }
.neh-comp-header {
    padding: 15px; text-align: center; color: #fff; font-weight: bold;
    border-radius: 8px 8px 0 0; margin: -20px -20px 20px -20px;
}
.neh-couple-info {
    display: flex; justify-content: space-around; text-align: center;
    margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed #ccc;
}
.neh-p strong { font-size: 18px; color: #8b0000; }

/* Hiệu ứng mờ nội dung */
.neh-locked-section {
    position: relative;
    min-height: 250px;
    overflow: hidden;
}

.neh-blurred-content {
    filter: blur(8px);
    opacity: 0.3;
    pointer-events: none;
    user-select: none;
}

.neh-unlock-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10;
    display: flex; justify-content: center; align-items: flex-start;
    padding-top: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0.9) 70%);
}

.neh-unlock-box {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    border: 2px solid #8b0000;
}

.neh-btn-unlock {
    background: #444; /* Màu xám đậm như mẫu */
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.neh-btn-unlock:hover { background: #222; }

.neh-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: neh-spin 0.8s linear infinite;
}

.neh-btn-unlock.is-loading .neh-spinner { display: block; }
.neh-btn-unlock.is-loading .neh-btn-text { opacity: 0.8; }

@keyframes neh-spin { to { transform: rotate(360deg); } }


@keyframes neh-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.neh-locked-section.neh-is-unlocked .neh-blurred-content {
    filter: blur(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    user-select: auto !important;
}

.neh-locked-section.neh-is-unlocked .neh-unlock-overlay {
    display: none !important;
}

/* TÌM VÀ THAY THẾ TOÀN BỘ CSS MODAL CŨ */
.neh-modal { display: none; position: fixed; z-index: 999999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.7); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.neh-modal-content { background-color: #fff; margin: 20px auto; padding: 20px; border: 1px solid #888; width: 660px; text-align: center; font-size: 16px; border-radius: 12px; position: relative; box-shadow: 0 5px 30px rgba(0,0,0,0.5); }
.neh-modal-inner { width: 100%; max-width: 620px; margin: auto; text-align: left; }
.neh-modal-close { color: #aaa; position: absolute; right: 15px; top: 5px; font-size: 28px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.neh-modal-close:hover { color: #8b0000; }
.neh-txt-highlight { color: #8b0000; font-size: 16px; text-align: center; display: block; font-weight: 800; margin-bottom: 15px; text-transform: uppercase; }
.neh-txt-step { font-weight: 700; color: #333; }
.neh-txt-danger, .neh-keyword-text { color: #8b0000; font-weight: 700; }

.neh-task-form-input { display: flex; margin: 20px auto; justify-content: center; gap: 10px; align-items: center; }
input.neh-keypass-input { width: 250px; padding: 12px; font-size: 16px; border: 2px solid #ddd; border-radius: 8px; outline: none; }
input.neh-keypass-input:focus { border-color: #8b0000; }
.neh-task-submit-btn { background: #8b0000; color: #fff; padding: 12px 25px; border-radius: 8px; cursor: pointer; font-weight: bold; border: none; transition: 0.3s; }
.neh-task-submit-btn:hover { background: #a50000; }
.neh-task-disabled { opacity: 0.6; pointer-events: none; }

.neh-image-demo-search { text-align: center; position: relative; margin: 15px 0; background: #f9f9f9; padding: 10px; border-radius: 8px; }
.neh-image-demo-search img { max-width: 100%; border: 1px solid #eee; }
.neh-keyword-overlay { position: absolute; left: 24%; top: 70%; font-size: 14px; color: #333; font-weight: bold; }

.neh-box-img-result { text-align: center; margin-top: 15px; }
.neh-box-img-result .neh-task-image { display: inline-block; border: 3px solid #8b0000; border-radius: 8px; padding: 5px; margin-bottom: 15px; }
.neh-box-img-result img { max-width: 100%; border-radius: 4px; }

.neh-copy-btn, .neh-change-task-btn { font-size: 11px; background: #eee; padding: 3px 8px; border-radius: 4px; cursor: pointer; border: 1px solid #ccc; margin-left: 5px; }
.neh-copy-btn:hover { background: #ddd; }

.neh-iframe-tutorials { width: 100%; height: 350px; border-radius: 8px; margin-top: 15px; border: 1px solid #eee; }
.neh-keypass-warning { color: #d9534f; font-weight: bold; font-size: 14px; text-align: center; margin-top: 10px; display: none; }

.neh-body-no-scroll { overflow: hidden; }

@media screen and (max-width: 700px) {
    .neh-modal-content { width: 95%; margin: 10px auto; padding: 15px; }
    .neh-task-form-input { flex-direction: column; }
    input.neh-keypass-input { width: 100%; }
    .neh-task-submit-btn { width: 100%; }
    .neh-keyword-overlay { left: 22%; top: 46%; font-size: 12px; }
}


/* Tối ưu lại form nhập */
.neh-form {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 25px;
}

.neh-input {
    width: 100%;
    margin-bottom: 10px;
    border: 2px solid #f0f0f0;
    transition: 0.3s;
    box-sizing: border-box;
}

.neh-input:focus {
    border-color: #8b0000;
    outline: none;
}

/* Giao diện chọn nhanh năm sinh */
.neh-quick-section {
    margin-top: 25px;
    text-align: center;
}

.neh-quick-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    position: relative;
    font-weight: 700;
    font-style: italic;
}

.neh-quick-title::before, .neh-quick-title::after {
    content: "";
    position: absolute;
    top: 50%; width: 20%;
    height: 1px; background: #eee;
}
.neh-quick-title::before { left: 0; }
.neh-quick-title::after { right: 0; }

.neh-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    max-height: 250px; /* Giới hạn chiều cao */
    overflow-y: auto; /* Cuộn nếu quá nhiều */
    padding: 10px;
    background: #fdfdfd;
    border: 1px inset #f0f0f0;
    border-radius: 8px;
}

.neh-btn-year {
    background: #34495e;
    color: #fff;
    border: none;
    padding: 8px 5px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
}

.neh-btn-year:hover {
    background: #8b0000;
    transform: translateY(-2px);
}

/* Custom thanh cuộn cho danh sách năm */
.neh-year-grid::-webkit-scrollbar { width: 5px; }
.neh-year-grid::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
/* Tối ưu lại form nhập */
.neh-form {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 25px;
}

.neh-input {
    width: 100%;
    margin-bottom: 10px;
    border: 2px solid #f0f0f0;
    transition: 0.3s;
    box-sizing: border-box;
}

.neh-input:focus {
    border-color: #8b0000;
    outline: none;
}

/* Giao diện chọn nhanh năm sinh */
.neh-quick-section {
    margin-top: 25px;
    text-align: center;
}

.neh-quick-title {
    font-size: 14px;
    color: #888;
    margin-bottom: 15px;
    position: relative;
}

.neh-quick-title::before, .neh-quick-title::after {
    content: "";
    position: absolute;
    top: 50%; width: 20%;
    height: 1px; background: #eee;
}
.neh-quick-title::before { left: 0; }
.neh-quick-title::after { right: 0; }

.neh-year-grid {
    display: flex;
    flex-wrap: nowrap; /* Không xuống dòng */
    overflow-x: auto;  /* Cho phép cuộn ngang */
    gap: 10px;
    padding: 15px 5px;
    -webkit-overflow-scrolling: touch; /* Cuộn mượt trên iPhone */
    scrollbar-width: thin; /* Thanh cuộn nhỏ trên Firefox */
}

/* Tùy chỉnh thanh cuộn cho đẹp */
.neh-year-grid::-webkit-scrollbar {
    height: 6px;
}
.neh-year-grid::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 10px;
}

.neh-btn-year {
    flex: 0 0 auto; /* Không cho nút bị co lại */
    min-width: 60px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.neh-btn-year:hover {
    background: #8b0000;
    color: #fff;
    border-color: #8b0000;
}

.neh-full-content, .neh-blurred-content {
    color: #222 !important; /* Màu đen đậm */
    line-height: 1.8;
    font-size: 16px;
    text-align: left; /* Căn lề trái cho dễ đọc trên mobile */
}

/* Container kết quả */
.neh-result-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    margin-top: 30px;
}

/* Header mẫu mới - Chung cho cả đơn và đôi */
.neh-new-header {
    text-align: center;
    padding: 40px 25px;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
}

.neh-new-header h2 {
    margin: 0;
    font-size: 26px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
}

.neh-header-divider {
    width: 60px;
    height: 4px;
    margin: 20px auto;
    border-radius: 2px;
}

.neh-header-slogan {
    font-style: italic;
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Theme màu sắc cho Header theo Mệnh */
/* Kim */
.neh-head-Kim { background: linear-gradient(135deg, #f5f5f5 0%, #cfd8dc 100%); border-color: #90a4ae; }
.neh-head-Kim h2 { color: #455a64; }
.neh-head-Kim .neh-header-divider { background: #90a4ae; }
.neh-head-Kim .neh-header-slogan { color: #546e7a; }

/* Mộc */
.neh-head-Mộc { background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%); border-color: #4caf50; }
.neh-head-Mộc h2 { color: #2e7d32; }
.neh-head-Mộc .neh-header-divider { background: #4caf50; }
.neh-head-Mộc .neh-header-slogan { color: #388e3c; }

/* Thủy */
.neh-head-Thủy { background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); border-color: #2196f3; }
.neh-head-Thủy h2 { color: #1565c0; }
.neh-head-Thủy .neh-header-divider { background: #2196f3; }
.neh-head-Thủy .neh-header-slogan { color: #1976d2; }

/* Hỏa */
.neh-head-Hỏa { background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%); border-color: #f44336; }
.neh-head-Hỏa h2 { color: #c62828; }
.neh-head-Hỏa .neh-header-divider { background: #f44336; }
.neh-head-Hỏa .neh-header-slogan { color: #d32f2f; }

/* Thổ */
.neh-head-Thổ { background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); border-color: #ffc107; }
.neh-head-Thổ h2 { color: #8d6e63; }
.neh-head-Thổ .neh-header-divider { background: #ffc107; }
.neh-head-Thổ .neh-header-slogan { color: #795548; }

/* Đảm bảo phần Header không bị mờ */
.neh-result-card > .neh-new-header {
    filter: none !important;
    opacity: 1 !important;
}

/* Phần nội dung phía dưới */
.neh-body-content {
    padding: 30px;
}

#neh_show_result, #neh_couple_result {
    opacity: 1 !important; /* Ép buộc luôn hiển thị rõ nét */
    filter: none !important;
}

/* Chỉ mờ khi có class locked của nhiệm vụ */
.neh-locked-section .neh-blurred-content {
    /* Code này chỉ chạy khi BẬT nhiệm vụ */
    filter: blur(8px);
    opacity: 0.3;
}

.neh-body-content h2, h3, h4 {
    font-weight: 900;
}

.neh-image-guide img {
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    margin: 10px 0;
}

.neh-note-small {
    font-size: 13px;
    color: #007fff;
    text-align: center;
    margin-top: 5px;
}

/* Fix nút quay liên tục bị lệch hoặc không hiển thị */
.neh-btn-unlock {
    position: relative;
    background: #8b0000 !important;/* Màu xám như mẫu */
    color: #fff !important;
    padding: 15px 30px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 250px;
    /* Hiệu ứng nhịp tim (Pulse) */
    animation: neh-pulse 2s infinite; 
    
}

.neh-btn-unlock.is-loading .neh-spinner {
    display: inline-block;
    margin-right: 10px;
}

.neh-btn-unlock.is-loading .neh-btn-text {
    opacity: 0.7;
}

.neh-body-content p {
    text-align: justify;
}
.neh-unlock-box p {
    text-align: center;
}

/* GIAO DIỆN TABS LIÊN KẾT */
.neh-tabs-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: -2px; /* Đẩy sát vào viền container */
    position: relative;
    z-index: 1;
}

.neh-tab-link {
    background: #f1f1f1;
    border: 2px solid #d4af37;
    border-bottom: none;
    padding: 12px 25px;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    border-radius: 12px 12px 0 0;
    transition: 0.3s;
    font-size: 15px;
}

.neh-tab-link.is-active {
    background: #8b0000;
    color: #fff;
    border-color: #8b0000;
}

.neh-tab-link:hover:not(.is-active) {
    background: #e9e9e9;
}

/* Ẩn nội dung tab mặc định */
.neh-tab-content {
    display: none;
}

.neh-tab-content.is-active {
    display: block;
}

/* Chỉnh lại bo góc container khi dùng tab */
.neh-container {
    border-top-left-radius: 0 !important;
}

@media screen and (max-width: 600px) {
    .neh-tab-link {
        padding: 10px 15px;
        font-size: 13px;
        flex: 1;
        text-align: center;
    }
}

/* BLOCK MIỄN TRỪ TRÁCH NHIỆM */
.neh-disclaimer-box {
    margin-top: 40px;
    padding: 25px;
    background: #fdfdfd;
    border-top: 1px dashed #ccc;
    border-radius: 0 0 20px 20px;
    font-size: 13px;
    line-height: 1.7;
    color: #666;
    text-align: center;
}

.neh-disclaimer-title {
    display: block;
    font-weight: 800;
    color: #8b0000;
    margin-bottom: 10px;
    font-size: 14px;
}

.neh-disclaimer-text {
    font-style: italic;
    max-width: 600px;
    margin: 0 auto;
}