:root {
  --fg: #1b1f2a; --muted: #5d6578; --line: #e3e7f1; --accent: #e8335a; --accent-fg: #fff;
  --ok: #1a8f4d; --err: #c62828; --go: #12b886; --go-dark: #0e9a70; --link: #2b59d9; --purple: #6c5bc4;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--fg); font: 16px/1.6 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; }
.inner { max-width: 960px; margin: 0 auto; padding: 0 20px; }
a { color: var(--link); }
[hidden] { display: none !important; }

.topbar { background: var(--accent); color: var(--accent-fg); text-align: center; padding: 8px 12px; font-size: 14px; }
.topbar a { color: var(--accent-fg); font-weight: 700; margin-left: 10px; text-decoration: underline; }

/* nền gradient xanh dương → xanh lá, chữ trắng to đậm như trang mẫu */
.hero { background: linear-gradient(150deg, #4a90e2 0%, #2fa3b8 50%, #14b887 100%); color: #fff; text-align: center;
        min-height: min(100vh, 780px); display: flex; flex-direction: column; }
.hero.small { min-height: 0; padding-bottom: 36px; }
.head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 18px; flex-wrap: wrap; }
.brand { font-weight: 900; font-size: 20px; color: #fff; text-decoration: none; text-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.head nav a { color: rgba(255, 255, 255, .85); text-decoration: none; margin-left: 18px; font-size: 15px; font-weight: 500; }
.head nav a.on, .head nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.herobody { width: 100%; max-width: 1000px; margin: auto; padding-top: 24px; padding-bottom: 56px; }
.hero h1 { font-size: 58px; line-height: 1.18; font-weight: 700; margin: 0 auto 22px; max-width: 880px;
           text-shadow: 0 6px 24px rgba(0, 0, 0, .28); }
.hero .lead { max-width: 900px; margin: 0 auto 38px; font-size: 19px; line-height: 1.75; opacity: .97; }
.hero.small h1 { font-size: 38px; }
.hero.small .lead { margin-bottom: 0; font-size: 17px; }

/* trang công cụ: ẩn tiêu đề + mô tả trên màn hình (22/11/2026 người dùng), khung tải nằm giữa.
   Tiêu đề vẫn nằm trong HTML (ẩn bằng kiểu "chỉ cho máy đọc") để Google còn đọc được. */
.hero:not(.small) h1 { font-size: 19px; font-weight: 500; line-height: 1.7; max-width: 900px; margin: 0 auto 30px;
                       text-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.hero:not(.small) .herobody { padding-top: 0; padding-bottom: 40px; }
.tool-wrap { max-width: 900px; margin: 0 auto; }
.selwrap { display: flex; justify-content: center; margin-bottom: 22px; }
#platform { appearance: none; border: 0; border-radius: 14px; padding: 16px 44px 16px 22px; min-width: 200px; font: 700 17px Roboto, sans-serif;
            color: #172033; background: #f3fbf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231b1f2a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 18px center;
            box-shadow: 0 8px 24px rgba(0, 0, 0, .14); cursor: pointer; }
.inputbox { position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 14px 14px 14px 12px;
            box-shadow: 0 14px 40px rgba(0, 0, 0, .2); }
#url { flex: 1; min-width: 0; border: 0; outline: 0; font: 400 18px Roboto, sans-serif; padding: 14px 40px 14px 18px; color: var(--fg); background: transparent; }
#url::placeholder { color: #9aa1b5; }
.clear { position: absolute; right: 330px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0;
         background: #e9ecf3; color: #555; cursor: pointer; font-size: 18px; line-height: 1; }
.btns { display: flex; gap: 10px; flex: none; }
.btn { font: 700 16px Roboto, sans-serif; padding: 16px 22px; border-radius: 12px; border: 0; cursor: pointer; text-align: center;
       text-decoration: none; display: inline-block; white-space: nowrap; }
.btn.soft { background: #e1e6ff; color: #3b44c4; }
.btn.go { background: var(--go); color: #fff; }
.btn.go:hover { background: var(--go-dark); }
.btn:disabled { opacity: .75; cursor: wait; }
.btn.go:disabled::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
                           border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.big { padding: 15px 28px; font-size: 17px; margin: 6px 0; }
.q { display: inline-block; margin-top: 16px; font-size: 14px; opacity: .95; }
.q select { margin-left: 8px; padding: 7px 12px; border-radius: 8px; border: 0; font: 500 14px Roboto, sans-serif; background: rgba(255, 255, 255, .94); color: var(--fg); }
.tip { display: block; width: fit-content; max-width: 100%; margin: 20px auto 0; padding: 12px 22px; border-radius: 999px; font-size: 15px;
       background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .32); }
.status { margin-top: 18px; }
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 3%; background: #fff; transition: width .3s; }
#msg { margin: 8px 0 0; font-size: 14px; }
#msg.err { background: #fff; color: var(--err); border-radius: 10px; padding: 8px 14px; display: inline-block; }
.result { margin-top: 18px; background: #fff; color: var(--fg); border-radius: 16px; padding: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.ok { color: var(--ok); margin: 0 0 8px; word-break: break-word; }
.note { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }

/* hộp quảng cáo nổi góc dưới phải, đè lên nút Dán / Tải: khách bấm X mới dùng được */
.tool-wrap { position: relative; }
/* popup quảng cáo khi vào trang: nổi góc phải dưới (trên nút Zalo) */
.popup { position: fixed; right: 24px; bottom: 96px; z-index: 50; width: 220px; background: #fff; color: var(--fg); border-radius: 16px;
         overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); text-align: center; animation: pop .35s ease-out; }
.popup.shake { animation: shake .4s; }
@keyframes pop { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.popup-media { position: relative; background: linear-gradient(135deg, #dff1ff, #ffe6f1); min-height: 140px; }
.popup-media img { display: block; width: 100%; height: 190px; object-fit: cover; }
.popup-media .ph { display: flex; align-items: center; justify-content: center; height: 150px; font-size: 56px; }
.popup-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
           background: rgba(0, 0, 0, .7); color: #fff; font-size: 20px; line-height: 1; }
.popup-body { padding: 12px 14px 8px; color: var(--purple); font-weight: 700; font-size: 14px; line-height: 1.5; }
.popup-body p { margin: 0; }
.popup-foot { margin: 4px 12px 0; padding: 10px 0 12px; border-top: 1px dashed #ddd; }
.popup-btn { display: inline-block; padding: 7px 16px; border-radius: 999px; background: #1aa6d1; color: #fff; font-weight: 700; font-size: 12px; text-decoration: none; }
.popup-foot small { display: block; margin-top: 6px; color: #888; font-size: 11px; }
.popup-dim { display: none; }

/* nút Zalo nổi góc phải dưới */
.zalo { position: fixed; right: 24px; bottom: 24px; z-index: 51; width: 56px; height: 56px; border-radius: 50%; display: flex;
        align-items: center; justify-content: center; background: #0068ff; color: #fff; font: 700 14px Roboto, sans-serif;
        text-decoration: none; border: 3px solid #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); animation: zalo-pulse 2s infinite; }
@keyframes zalo-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 104, 255, .5), 0 8px 20px rgba(0, 0, 0, .3); }
                        50% { box-shadow: 0 0 0 10px rgba(0, 104, 255, 0), 0 8px 20px rgba(0, 0, 0, .3); } }

/* hộp báo lỗi "Thử lại ngay" */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px;
         background: rgba(15, 23, 36, .55); }
.modal[hidden] { display: none; }
.modal-box { width: min(500px, 100%); background: #fff; color: var(--fg); border-radius: 22px; padding: 26px 26px 22px; text-align: center;
             box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal-icon { width: 70px; height: 70px; margin: 0 auto 10px; border-radius: 50%; border: 4px solid #f0a020; color: #f0a020;
              font: 900 40px/62px Roboto, sans-serif; }
.modal-box h3 { margin: 4px 0 10px; font-size: 22px; }
.modal-box > p { margin: 0 0 12px; color: #4a5263; font-size: 15px; text-align: left; }
.modal-tip { text-align: left; background: #ecfbf3; border: 1px solid #b7ebcf; color: #1d6b43; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.modal-count { color: #7a8497 !important; font-size: 13px !important; text-align: center !important; margin-top: 12px !important; }
.modal-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.mbtn { font: 700 15px Roboto, sans-serif; padding: 13px 26px; border-radius: 12px; border: 0; cursor: pointer; text-decoration: none; color: #fff; }
.mbtn.gray { background: #6b7587; }
.mbtn.blue { background: #0b5ed7; }
.mbtn.green { background: #12b886; }
.mbtn[hidden] { display: none; }

.tools { padding-left: 20px; }
.tools li { margin: 6px 0; }

/* Câu hỏi thường gặp */
.faq { margin: 26px 0 10px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; color: #1f2a3c; }
.faq details[open] summary { color: var(--accent); }
.faq details p { margin: 8px 0 0; color: #4a5263; }

/* mục Tin tức */
.posts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 12px; }
.posts li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.posts li a { color: #1b1f2a; text-decoration: none; font-size: 17px; }
.posts li a:hover { color: var(--accent); }
.posts li span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.post-date { color: var(--muted); font-size: 13px; margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; text-align: left; }
.cards-wrap { max-width: 900px; margin: 18px auto 0; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: #fff; color: var(--fg); border: 1px solid var(--line);
        border-radius: 12px; text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card span { color: var(--muted); font-size: 14px; }
.card em { color: var(--accent); font-style: normal; font-weight: 600; font-size: 14px; margin-top: auto; }

.content { padding-top: 40px; padding-bottom: 20px; max-width: 860px; }
.content h2 { font-size: 22px; margin: 22px 0 8px; }
.content li { margin: 4px 0; }
.foot { background: #f6f7fb; margin-top: 30px; padding: 22px 0 28px; color: var(--muted); font-size: 13px; }
.foot nav a { color: var(--muted); text-decoration: none; margin: 0 14px 0 0; }
.foot nav a:hover { color: var(--accent); }

/* khung kết quả: Preview Video + các nút tải (giống trang mẫu) */
.rescard { margin-top: 22px; background: rgba(255, 255, 255, .97); color: var(--fg); border-radius: 22px; padding: 22px 22px 18px;
           box-shadow: 0 18px 50px rgba(0, 0, 0, .28); text-align: center; }
.rescard h2 { margin: 0 0 14px; font-size: 24px; color: #1f2a3c; }
.rescard video { display: block; width: min(500px, 100%); max-height: 62vh; margin: 0 auto; border-radius: 16px; background: #000;
                 box-shadow: 0 10px 28px rgba(0, 0, 0, .25); }
.caption { margin: 14px auto 0; padding: 12px 16px; max-width: 760px; background: #f4f6fa; border: 1px solid #e6e9f1; border-radius: 14px;
           font-size: 14px; color: #566074; word-break: break-word; }
.actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 12px auto 0; padding: 14px 10px;
           max-width: 860px; background: #f4f6fa; border: 1px solid #e6e9f1; border-radius: 14px; }
.caption + .actions { margin-top: 0; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.abtn { display: inline-flex; align-items: center; gap: 6px; font: 700 15px Roboto, sans-serif; padding: 14px 22px; border-radius: 999px;
        border: 0; cursor: pointer; text-decoration: none; color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.abtn small { font-weight: 400; opacity: .85; font-size: 12px; }
.abtn.green { background: linear-gradient(135deg, #12b886, #0b9a6e); }
.abtn.blue { background: linear-gradient(135deg, #1565d8, #0b3fb8); }
.abtn.dark { background: linear-gradient(135deg, #1f2a3c, #0f1724); }
.abtn.purple { background: linear-gradient(135deg, #9b5cf6, #6d28d9); }
.abtn:disabled { opacity: .7; cursor: wait; }
.rescard .note { margin: 12px 0 4px; }
/* khối thông tin dưới video: ảnh đại diện, tên kênh, mô tả 1 dòng, thời lượng, 4 nút (giống trang mẫu) */
.vmeta { position: relative; margin: 14px auto 0; max-width: 860px; padding: 16px 16px 18px; background: #f4f6fa;
         border: 1px solid #e6e9f1; border-radius: 14px; }
.avatar { position: absolute; left: 16px; top: 16px; width: 46px; height: 46px; border-radius: 50%; overflow: hidden;
          border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); background: linear-gradient(135deg, #4a90e2, #14b887);
          display: flex; align-items: center; justify-content: center; color: #fff; font: 700 18px Roboto, sans-serif; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.uploader { margin: 0 64px 4px; font-weight: 700; font-size: 16px; color: #1f2a3c; }
.vmeta .caption { margin: 0 64px; padding: 0; background: none; border: 0; font-size: 13px; color: #5d6578;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duration { margin: 10px 0 0; font-size: 12px; color: #7a8497; }
.vmeta .actions { margin: 12px 0 0; padding: 0; background: none; border: 0; min-height: 60px; }
/* khung kết quả gọn: ngay dưới ô dán, chỉ có tên video + 2 nút (720p, Full HD) */
.rescard.compact { margin-top: 16px; padding: 14px 16px 10px; border-radius: 18px; }
.rescard.compact .caption { margin: 0 auto; max-width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
                            border-bottom: 0; text-align: center; font-size: 13px; }
.rescard.compact .actions { margin-top: 0; padding: 22px 10px; min-height: 96px; align-items: center; }
.rescard.compact .tip { display: none; }
/* hộp quảng cáo nằm giữa nút Tải video HD; X chỉ đóng hộp */
.ad { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(420px, 94%); display: grid;
      grid-template-columns: 52px 1fr; grid-template-areas: "img text" "btn btn"; gap: 6px 10px; align-items: center; text-align: left;
      padding: 12px 14px 8px; background: #fff; border: 2px solid #12b886; border-radius: 16px; box-shadow: 0 14px 36px rgba(0, 0, 0, .3); }
.ad[hidden] { display: none; }
.ad-img { grid-area: img; display: block; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #eef1f6; }
.ad-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-img .ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 26px; }
.ad-text { grid-area: text; color: #1b1f2a; text-decoration: none; padding-right: 22px; }
.ad-text b { display: block; font-size: 13px; line-height: 1.35; }
.ad-text small { display: block; margin-top: 3px; color: #7a8497; font-size: 12px; }
.ad-btn { grid-area: btn; justify-self: center; background: #12b886; color: #fff; text-decoration: none; font-weight: 700; font-size: 12px;
          padding: 6px 16px; border-radius: 999px; }
.ad-tag { grid-area: btn; justify-self: end; align-self: end; font-size: 10px; color: #9aa1b5; }
.ad-x { position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; cursor: pointer;
        background: #12b886; color: #fff; font-size: 19px; line-height: 1; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }

@media (max-width: 760px) {
  .rescard { padding: 16px 12px 14px; }
  .avatar { width: 38px; height: 38px; left: 10px; top: 12px; }
  .uploader, .vmeta .caption { margin-left: 52px; margin-right: 8px; text-align: left; }
  .abtn { padding: 12px 16px; font-size: 14px; }
  .ad { width: 96%; }
  .hero h1 { font-size: 34px; }
  .hero .lead { font-size: 16px; margin-bottom: 26px; }
  .hero.small h1 { font-size: 28px; }
  .inputbox { flex-direction: column; align-items: stretch; padding: 10px; }
  #url { padding: 12px 40px 8px 10px; font-size: 17px; }
  .clear { right: 14px; top: 28px; transform: none; }
  .btns .btn { flex: 1; }
  .tip { border-radius: 18px; text-align: left; }
  /* điện thoại: hộp quảng cáo nằm giữa màn hình trên lớp mờ */
  /* điện thoại: popup nhỏ hơn, nằm góc phải dưới, ảnh thấp lại để không che ô dán link */
  .popup { right: 12px; bottom: 84px; width: 180px; }
  .popup-media img { height: 120px; }
  .popup-media .ph { height: 96px; font-size: 40px; }
  .popup-body { font-size: 12px; padding: 8px 10px 4px; }
  .zalo { right: 12px; bottom: 16px; }
}
