<style>.story-container-RenamedCL{flex:0 1 calc(33% - 20px);display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;gap:20px;margin-bottom:35px;opacity:0;transform:scale(.95);transition:opacity 0.3s ease,transform 0.3s ease;z-index:1}.story-container-RenamedCL.visible{opacity:1;transform:scale(1)}.story-cover-RenamedCL{position:relative;width:200px;height:auto;aspect-ratio:2 / 3;overflow:hidden;border-radius:10px;flex-shrink:0}.story-cover-RenamedCL img{width:100%;height:100%;object-fit:cover;border-radius:10px;transition:transform 0.3s ease}.story-cover-RenamedCL img:hover{transform:scale(1.1)}.story-info-RenamedCL{display:flex;flex-direction:column;justify-content:flex-start;flex-grow:1}.story-title-RenamedCL{text-align:left;font-size:16px;font-weight:700;color:var(--bodyC)!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;width:100%;line-height:1.2}.story-title-RenamedCL:hover{color:var(--linkB)}.story-info-text{font-size:12px;color:var(--bodyC)}.story-description-RenamedCL p{font-size:12px;color:var(--bodyC);line-height:1.2;display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;max-height:calc(1.2em * 3);margin-top:6px!important;margin-bottom:6px!important}.story-genre-RenamedCL{display:grid;grid-template-rows:repeat(2,auto);grid-auto-flow:column;gap:6px;max-height:calc(2 * 34px + 6px);max-width:100%;overflow-x:auto;overflow-y:hidden;-ms-overflow-style:none}.story-genre-RenamedCL::-webkit-scrollbar{height:0}.story-genre-RenamedCL::-webkit-scrollbar-thumb{display:none}.genre-label{display:inline-block;border:1px solid var(--contentL);background:var(--contentB);color:var(--bodyC);padding:0 8px;font-size:12px;border-radius:35px;height:28px;line-height:28px;text-align:center;white-space:nowrap}.genre-label:hover{background-color:var(--linkB);color:#fff;cursor:pointer}.story-author-RenamedCL{font-size:12px;color:var(--darkTa);font-weight:700}@media (max-width:600px){.story-container-RenamedCL{flex:0 1 calc(100% - 20px);flex-direction:row;align-items:center}.story-cover-RenamedCL{width:115px}.story-info-RenamedCL{width:calc(100% - 150px)}.story-title-RenamedCL{font-size:14px;text-align:left}.story-info-text,.story-description-RenamedCL p,.story-genre-RenamedCL,.story-author-RenamedCL{font-size:12px}}@media (min-width:601px) and (max-width:1024px){.story-container-RenamedCL{flex:0 1 calc(50% - 20px)}.story-cover-RenamedCL{width:120px}.story-info-RenamedCL{width:calc(100% - 200px)}.story-title-RenamedCL{font-size:15px}.story-info-text,.story-description-RenamedCL p,.story-genre-RenamedCL,.story-author-RenamedCL{font-size:13px}}@media (min-width:1025px){.story-container-RenamedCL{flex:0 1 calc(33% - 20px)}.story-cover-RenamedCL{width:140px}.story-info-RenamedCL{width:calc(100% - 200px)}.story-title-RenamedCL{font-size:16px}.story-info-text,.story-description-RenamedCL p,.story-genre-RenamedCL,.story-author-RenamedCL{font-size:14px}}.ribbon-RenamedCL{position:absolute;top:0;right:0;background:linear-gradient(135deg,#FFA726,#FB8C00);color:#fff;font-weight:700;text-transform:uppercase;transform:translateY(-11px);padding-top:0;padding-right:0;padding-bottom:0;padding-left:8px;border-bottom-left-radius:8px;border-bottom-right-radius:8px;z-index:1}.ribbon-RenamedCL span{font-size:8px;padding-right:21px;margin:0;line-height:1;display:inline-block;vertical-align:top;position:relative;top:15px}.circle-RenamedCL{position:absolute;top:-3px;right:-5px;width:23px;height:23px;background-color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;z-index:2}.circle-RenamedCL svg{width:13px;height:13px;margin-top:4px;margin-left:-4px}.loader-RenamedCL{display:none;border:4px solid rgb(0 0 0 / .1);border-left-color:var(--linkB);border-radius:50%;width:24px;height:24px;animation:loader 1s linear infinite;margin:0 auto}@keyframes loader{to{transform:rotate(360deg)}}</style>

<div id="searchInfo">
    <div><span style="color: var(--darkTa);"></span> <span id="searchInfo" style="font-weight: bold;"></span></div>
</div><br>

<div style="position: relative; width: 100%; overflow: hidden;">
  <div class="loader-RenamedCL"></div> <!-- Loader -->
  <div id="story-list-RenamedCL"></div>
</div>
<script>const urlParams=new URLSearchParams(window.location.search);const theloai=urlParams.get('theloai');const tiendo=urlParams.get('tiendo');const tacgia=urlParams.get('tacgia');const tacphamortacgia=urlParams.get('tacphamortacgia');let apiUrlRenamedCL='';if(tacphamortacgia){apiUrlRenamedCL=`https://script.google.com/macros/s/AKfycbwBh7zyZU8FiRJeJndUMqwzQQEEztqwpLrXXF69B1xg7mPDcUku_b8Qol_ptveuaDpQZw/exec?tac-gia=${tacphamortacgia}`}else if(tacgia){apiUrlRenamedCL=`https://script.google.com/macros/s/AKfycbwBh7zyZU8FiRJeJndUMqwzQQEEztqwpLrXXF69B1xg7mPDcUku_b8Qol_ptveuaDpQZw/exec?tac-gia=${tacgia}`}else if(tiendo){apiUrlRenamedCL=`https://script.google.com/macros/s/AKfycbwBh7zyZU8FiRJeJndUMqwzQQEEztqwpLrXXF69B1xg7mPDcUku_b8Qol_ptveuaDpQZw/exec?tien-do=${tiendo}`}else if(theloai){apiUrlRenamedCL=`https://script.google.com/macros/s/AKfycbwBh7zyZU8FiRJeJndUMqwzQQEEztqwpLrXXF69B1xg7mPDcUku_b8Qol_ptveuaDpQZw/exec?the-loai=${theloai}`}else{apiUrlRenamedCL=``}
console.log(apiUrlRenamedCL);const searchInfo=document.getElementById('searchInfo');if(theloai||tiendo||tacgia||tacphamortacgia){const theloaiText=theloai?`<span style="color: var(--linkB); font-weight: bold;">${theloai}</span>`:'';const tiendoText=tiendo?`<span style="color: var(--linkB); font-weight: bold;">${tiendo}</span>`:'';const tacgiaText=tacgia?`<span style="color: var(--linkB); font-weight: bold;">${tacgia}</span>`:'';const tacphamortacgiaText=tacphamortacgia?`<span style="color: var(--linkB); font-weight: bold;">${tacphamortacgia}</span>`:'';searchInfo.innerHTML=`<span style="color: var(--darkTa); font-weight: bold;">Tìm kiếm:</span> ${theloaiText} ${tiendoText} ${tacgiaText} ${tacphamortacgiaText}`.trim()}else{searchInfo.textContent='Không có dữ liệu...'}
function getRibbonRenamedCL(status){let background,gradientId,svgPath,label;switch(status){case "Đang viết":gradientId="gradient-writing";svgPath=`  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
  <defs>
    <linearGradient id="gradient-writing" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#FFA726" />
      <stop offset="100%" stop-color="#FB8C00" />
    </linearGradient>
  </defs>
  <!-- Đường chữ nhật -->
  <rect x="4" y="16" width="16" height="4" rx="2" fill="none" stroke="url(#gradient-writing)" stroke-width="3"></rect>
  <!-- Hình tam giác -->
  <path d="M4.90949 11.3642L8 16H16L19.0905 11.3642C19.5259 10.7112 19.7436 10.3847 19.7083 10.0289C19.6731 9.67311 19.3956 9.39561 18.8406 8.84062L12 2L5.15938 8.84062C4.60439 9.39561 4.32689 9.67311 4.29166 10.0289C4.25643 10.3847 4.47412 10.7112 4.90949 11.3642Z" fill="none" stroke="url(#gradient-writing)" stroke-width="3"></path>
  <!-- Hình tròn -->
  <circle cx="12" cy="11" r="2" fill="none" stroke="url(#gradient-writing)" stroke-width="3"></circle>
  <!-- Đường thẳng -->
  <path d="M12 2V9" fill="none" stroke="url(#gradient-writing)" stroke-width="3"></path>
</svg>  `;background="linear-gradient(135deg, #FFA726, #FB8C00)";label="Đang viết";break;case "Tạm ngừng":gradientId="gradient-paused";svgPath=` <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.149 512.149" fill="none">
  <defs>
    <linearGradient id="gradient-paused" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#FF5252" />
      <stop offset="100%" stop-color="#D32F2F" />
    </linearGradient>
  </defs>
  <g transform="translate(-1)">
    <g>
      <path d="M504.427,111.44l-1.253-1.254c-11.776-11.776-30.967-11.802-42.814,0.035l-46.089,46.574 c-2.428,2.436-6.312,2.534-8.845,0.203l-64.618-59.657c-6.276-5.8-14.442-8.987-22.996-8.987h-96.124 c-2.269,0-4.44,0.865-6.082,2.419l-81.47,77.356c-11.935,11.944-12.756,31.197-1.818,42.92 c5.844,6.268,13.736,9.719,22.219,9.719h0.15c8.413-0.044,16.499-3.619,22.087-9.728l57.538-60.893h20.595L120.63,300.218H37.81 c-19.633,0-35.778,14.68-36.758,33.421c-0.521,9.79,2.904,19.094,9.64,26.191c6.638,7,15.969,11.008,25.618,11.008h123.586 c2.436,0,4.767-1.006,6.444-2.798l63.32-67.593l53.248,55.684l-16.075,102.735c-4.052,17.02,4.114,34.357,19.412,41.198 c4.714,2.119,9.719,3.178,14.698,3.178c5.358,0,10.69-1.227,15.598-3.655c9.481-4.696,16.296-13.285,18.776-23.967 l27.463-147.306c0.53-2.86-0.38-5.809-2.445-7.865l-73.295-73.198l58.227-58.138l40.589,40.58 c11.335,11.335,31.091,11.335,42.417,0l76.156-76.147c5.623-5.623,8.722-13.109,8.722-21.054 C513.149,124.54,510.05,117.063,504.427,111.44z" fill="url(#gradient-paused)" />
      <path d="M407.065,114.837c29.211,0,52.966-23.755,52.966-52.966c0-29.211-23.755-52.966-52.966-52.966 c-29.21,0-52.966,23.755-52.966,52.966C354.1,91.082,377.855,114.837,407.065,114.837z" fill="url(#gradient-paused)" />
    </g>
  </g>
</svg>   `;background="linear-gradient(135deg, #FF5252, #D32F2F)";label="Tạm ngừng";break;case "Hoàn thành":gradientId="gradient-completed";svgPath=`       <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <linearGradient id="gradient-complete" x1="0%" y1="0%" x2="100%" y2="100%">
      <stop offset="0%" stop-color="#42A5F5" />
      <stop offset="100%" stop-color="#1E88E5" />
    </linearGradient>
  </defs>
  <path
    d="M16.19 2H7.81C4.17 2 2 4.17 2 7.81V16.18C2 19.83 4.17 22 7.81 22H16.18C19.82 22 21.99 19.83 21.99 16.19V7.81C22 4.17 19.83 2 16.19 2ZM11.5 17.25C11.5 17.61 11.14 17.85 10.81 17.71C9.6 17.19 8.02 16.71 6.92 16.57L6.73 16.55C6.12 16.47 5.62 15.9 5.62 15.28V7.58C5.62 6.81 6.24 6.24 7 6.3C8.25 6.4 10.1 7 11.26 7.66C11.42 7.75 11.5 7.92 11.5 8.09V17.25ZM18.38 15.27C18.38 15.89 17.88 16.46 17.27 16.54L17.06 16.56C15.97 16.71 14.4 17.18 13.19 17.69C12.86 17.83 12.5 17.59 12.5 17.23V8.08C12.5 7.9 12.59 7.73 12.75 7.64C13.91 6.99 15.72 6.41 16.95 6.3H16.99C17.76 6.3 18.38 6.92 18.38 7.69V15.27Z"
    stroke="url(#gradient-complete)"
    fill="none"
    stroke-width="3"
  />
</svg>   `;background="linear-gradient(135deg, #42A5F5, #1E88E5)";label="Hoàn thành";break;default:svgPath=`       <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" fill="none">
          <defs>
            <!-- Gradient bạc chói sáng -->
            <linearGradient id="silverGradient" x1="0" y1="0" x2="1" y2="1">
              <stop offset="0%" style="stop-color:#ffffff; stop-opacity:1" />
              <stop offset="30%" style="stop-color:#d9d9d9; stop-opacity:1" />
              <stop offset="50%" style="stop-color:#b3b3b3; stop-opacity:1" />
              <stop offset="70%" style="stop-color:#e6e6e6; stop-opacity:1" />
              <stop offset="100%" style="stop-color:#ffffff; stop-opacity:1" />
            </linearGradient>
            <!-- Hiệu ứng ánh sáng lan tỏa -->
            <radialGradient id="lightGlow" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
              <stop offset="0%" style="stop-color:rgba(255, 255, 255, 0.8); stop-opacity:1" />
              <stop offset="70%" style="stop-color:rgba(255, 255, 255, 0.1); stop-opacity:0" />
            </radialGradient>
          </defs>
          <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
          <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
          <g id="SVGRepo_iconCarrier">
            <!-- Ánh sáng lan tỏa -->
            <circle cx="256" cy="256" r="256" fill="url(#lightGlow)" />
            <!-- Hình biểu tượng -->
            <path fill="url(#silverGradient)" d="M256.313 29.844c-16.47-.022-32.95 2.724-49.282 8.343l5.69 16.563L17.53 123l6.19 17.656L231.405 68.03l-5.562-15.905c19.548-4.75 38.93-4.86 58.5-.5l-5.72 16.406 207.688 72.626L492.47 123 299.624 55.562l5.906-17.374c-16.29-5.517-32.75-8.322-49.217-8.344zm-.657 49.593L46.25 152.844l42.406 29.53c70.69-11.9 160.54 31.24 166.906-90.25 2.175 32.524 10.254 53.188 22.282 66.282 6.658 7.576 14.5 12.432 23.687 15.688.04.015.086.016.126.03.216.077.44.145.656.22 33.978 12.23 80.744 1.187 121.344 8.03l41.406-29.155-209.406-73.782zm.47 81.032c-.263.413-.516.842-.782 1.25-12.194 18.6-29.79 28.466-48.656 33.03-3.486.843-7.013 1.528-10.594 2.094l41.437 74.094-67.25 16.78 31.345 61.594-61.813-54L283.938 496.75l-61.875-143.625 52.438 69.5L235.03 320l58.5-10.094-17.092-52.75 93.468 141.28-81.47-196.748 56.845 83.406L323 197.75c-5.9-.68-11.71-1.63-17.375-3-18.865-4.564-36.494-14.43-48.688-33.03-.27-.413-.548-.832-.812-1.25z"></path>
          </g>
        </svg>
  `;background="linear-gradient(#ffffff, #d9d9d9, #b3b3b3, #e6e6e6)";label="Oneshot"}
return `
    <div class="ribbon-RenamedCL" style="background: ${background}">
      <span>${label}</span>
    </div>
    <div class="circle-RenamedCL">
      ${svgPath} <!-- SVG sẽ được thêm vào đây -->
    </div>
  `}
async function fetchBooksRenamedCL(){const loader=document.querySelector('.loader-RenamedCL');const scrollButtons=document.querySelectorAll('.scroll-button-RenamedCL');try{loader.style.display='block';const response=await fetch(apiUrlRenamedCL);const data=await response.json();const storyList=document.getElementById('story-list-RenamedCL');storyList.innerHTML='';data.data.forEach(book=>{const storyContainer=document.createElement('div');storyContainer.className='story-container-RenamedCL visible';const progressStatus=book.tienDo||"Không rõ";const ribbon=getRibbonRenamedCL(progressStatus);storyContainer.innerHTML=`
        <div class="story-cover-RenamedCL">
          ${ribbon} <!-- Thêm ribbon và circle vào bìa -->
          <a href="${book.cotJ}" target="_black">
            <img src="${book.urlBia}" alt="${book.tacPham}">
          </a>
        </div>
        <div class="story-info-RenamedCL">
          <div class="story-title-RenamedCL">
            <a href="${book.cotJ}" target="_blank">${book.tacPham}</a>
          </div>
          <div class="story-author-RenamedCL">✑ ${book.tacGia}</div>
          <div class="story-description-RenamedCL">
            <p>${book.gioiThieu}</p>
          </div>
          <div class="story-genre-RenamedCL">
            ${book.theLoai.split(',').map(genre => `<span class="genre-label">${genre}</span>`).join('')}
          </div>
        </div>
      `;storyList.appendChild(storyContainer)})}catch(error){console.error('Lỗi khi tải dữ liệu:',error)}finally{loader.style.display='none'}
document.querySelectorAll('.genre-label').forEach(label=>{label.addEventListener('click',(event)=>{const genre=event.target.textContent;const url=`https://www.kunsnovel.pro.vn/p/search.html?theloai=${encodeURIComponent(genre)}`;window.location.href=url})});document.querySelectorAll('.story-author-RenamedCL').forEach(author=>{author.addEventListener('click',(event)=>{const authorName=event.target.textContent;const url=`https://www.kunsnovel.pro.vn/p/search.html?tacgia=${encodeURIComponent(authorName)}`;window.location.href=url})})}
fetchBooksRenamedCL();</script>