/* =============================================================
   VidFrom — hệ thống giao diện
   Nguyên tắc: giấy & mực, đường kẻ mảnh, một màu nhấn duy nhất.
   Không gradient trang trí, không bóng đổ mềm, không icon thừa.
   ============================================================= */

:root {
  /* Mực */
  --ink:        #16171b;   /* tiêu đề, nút chính */
  --ink-2:      #34363d;   /* chữ thường */
  --ink-3:      #6f7179;   /* chữ phụ */

  /* Giấy */
  --paper:      #ffffff;
  --canvas:     #f7f6f3;   /* nền ấm, không ngả xanh */
  --rule:       #e2e0da;   /* đường kẻ */
  --rule-soft:  #edebe5;

  /* Nhấn — xanh rêu đậm: hue duy nhất không trùng brand nền tảng nào */
  --accent:      #0e5c42;
  --accent-dark: #0a4531;
  --accent-soft: #eaf1ed;

  --danger:      #9d2b21;
  --danger-soft: #fbf2f0;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --lift: 0 1px 2px rgba(22, 23, 27, .05);
  --pop:  0 18px 40px -24px rgba(22, 23, 27, .35);

  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.22; letter-spacing: -.021em; font-weight: 700; }
img { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 3px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Cột chữ hẹp nhưng vẫn ăn mép trái của lưới chung: thu hẹp bằng padding
   thay vì bằng max-width, nên mọi mục trên trang thẳng một đường dọc. */
.container-narrow { max-width: var(--maxw); }
@media (min-width: 1000px) {
  .container-narrow { padding-right: calc(var(--maxw) - 720px); }
  [dir="rtl"] .container-narrow { padding-right: 24px; padding-left: calc(var(--maxw) - 720px); }
  .hero .container-narrow { padding-right: 24px; }
  [dir="rtl"] .hero .container-narrow { padding-left: 24px; }
}

/* Nhãn nhỏ chữ hoa — dùng cho eyebrow, đầu bảng */
.eyebrow {
  display: block;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 66px; }

.logo {
  display: inline-flex; align-items: center;
  font-size: 1.28rem; font-weight: 700; color: var(--ink);
  letter-spacing: -.03em; white-space: nowrap;
}
.logo span { color: var(--accent); }
.logo:hover { color: var(--ink); }
/* Logo ảnh: cao cố định, rộng tự do — ăn được cả logo vuông lẫn logo ngang */
.logo img { height: 30px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.logo-footer img { height: 28px; max-width: 180px; }

.main-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.main-nav a {
  position: relative;
  color: var(--ink-3); font-weight: 500; font-size: .93rem;
  padding: 8px 12px; border-radius: var(--r-sm);
  transition: color .15s;
}
.main-nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 1px; background: var(--ink); transform: scaleX(0);
  transform-origin: left; transition: transform .18s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule);
  border-radius: var(--r-sm); cursor: pointer; padding: 8px 9px; margin-left: auto;
}
.nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--ink); border-radius: 2px; }
.nav-toggle span + span { margin-top: 4px; }

/* ===== Chọn ngôn ngữ (dropdown) ===== */
.lang-switch { position: relative; flex-shrink: 0; }

.lang-switch summary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; cursor: pointer; list-style: none;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-2);
  font-size: .76rem; font-weight: 600; letter-spacing: .04em;
  transition: border-color .15s, color .15s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary:hover { border-color: var(--ink-3); color: var(--ink); }
.lang-switch[open] summary { border-color: var(--ink); color: var(--ink); }

/* Mũi tên vẽ bằng viền, không dùng icon dựng sẵn */
.lang-caret {
  width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(45deg); transition: transform .18s ease;
}
.lang-switch[open] .lang-caret { transform: rotate(-135deg); margin-top: 2px; }

.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 190px; max-height: min(62vh, 380px); overflow-y: auto;
  margin: 0; padding: 5px; list-style: none;
  background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: var(--pop);
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: .88rem; font-weight: 500;
  white-space: nowrap;
}
.lang-menu a:hover { background: var(--canvas); color: var(--ink); }
.lang-menu a.is-current { color: var(--ink); font-weight: 600; }
.lang-menu a.is-current .lang-name::after {
  content: ""; display: inline-block; vertical-align: middle;
  width: 4px; height: 8px; margin-left: 8px;
  border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg) translateY(-1px);
}
.lang-code { font-size: .7rem; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.lang-menu a:hover .lang-code { color: var(--ink-2); }

/* ===== Hero ===== */
.hero {
  background: var(--paper);
  padding: 80px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.hero h1 {
  font-size: clamp(2rem, 1.35rem + 2.7vw, 3.05rem);
  letter-spacing: -.033em;
  margin: 0 auto 16px;
  max-width: 820px;
  text-wrap: balance;
}
.hero-sub {
  font-size: 1.06rem; color: var(--ink-3);
  max-width: 560px; margin: 0 auto 32px;
  text-wrap: pretty;
}
.hero-platform { padding: 60px 0 56px; }

/* ===== Ô nhập link ===== */
.dl-box { max-width: 620px; margin: 0 auto; text-align: left; }
.dl-form { display: flex; gap: 10px; }

.dl-field {
  flex: 1; min-width: 0;
  display: flex; align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  transition: border-color .15s, box-shadow .15s;
}
.dl-field:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 23, 27, .07);
}
.dl-field input[type="url"] {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-family: inherit; font-size: .97rem; color: var(--ink);
  padding: 14px 4px 14px 16px;
}
.dl-field input::placeholder { color: #9a9ca3; }

.btn-paste {
  flex-shrink: 0;
  border: none; border-left: 1px solid var(--rule-soft);
  background: none; cursor: pointer;
  font-family: inherit; font-size: .84rem; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-3); padding: 0 16px; margin: 8px 0;
  transition: color .15s;
}
.btn-paste:hover { color: var(--ink); }
/* Trạng thái xóa: nhạt hơn một chút để không tranh chú ý với nút Tải xuống */
.btn-paste[data-mode="clear"] { color: var(--ink-3); opacity: .85; }
.btn-paste[data-mode="clear"]:hover { color: var(--danger, #9d2b21); opacity: 1; }

.btn-submit {
  flex-shrink: 0;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--ink); color: #fff;
  font-family: inherit; font-size: .95rem; font-weight: 600;
  padding: 14px 26px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-submit:hover { background: #000; border-color: #000; color: #fff; }
.btn-submit:disabled { opacity: .45; cursor: wait; }
.btn-inline { display: inline-block; margin-top: 20px; text-decoration: none; }

/* Dòng cam kết dưới ô nhập */
.dl-trust {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  list-style: none; margin: 18px 2px 0;
  font-size: .83rem; color: var(--ink-3);
}
.dl-trust li { display: flex; align-items: center; gap: 8px; }
.dl-trust li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

.dl-error {
  margin-top: 16px; padding: 13px 16px;
  border: 1px solid #ecd6d2; border-left: 3px solid var(--danger);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--danger-soft); color: var(--danger);
  font-size: .92rem;
}

/* ===== Thẻ kết quả ===== */
.dl-result { margin-top: 24px; }
.result-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--pop);
  padding: 20px;
  display: flex; gap: 20px; align-items: flex-start;
  color: var(--ink-2);
}
.result-card > img {
  width: 150px; border-radius: var(--r-sm); flex-shrink: 0;
  border: 1px solid var(--rule-soft); background: var(--canvas);
}
.result-info { flex: 1; min-width: 0; }
.result-info h3 { font-size: .99rem; line-height: 1.45; margin-bottom: 3px; word-break: break-word; }
.result-duration {
  color: var(--ink-3); font-size: .82rem; margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.media-list { display: flex; flex-direction: column; }
.media-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 12px 2px;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink); font-weight: 500; font-size: .92rem;
  transition: color .15s;
}
.media-btn:first-child { border-top: none; }
.media-btn:hover { color: var(--accent); }
.media-btn .dl-icon {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  color: var(--accent); font-size: .84rem; font-weight: 600;
}
.media-btn:hover .dl-icon .arr { transform: translateY(2px); }
.arr { transition: transform .15s ease; }
.dl-ads { margin-top: 20px; }

/* ===== Lưới ảnh (album, carousel) ===== */
.gallery-card { flex-direction: column; align-items: stretch; gap: 0; }
.gallery-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
}
.gallery-head h3 { font-size: .99rem; line-height: 1.45; word-break: break-word; }
.gallery-count {
  flex-shrink: 0; font-size: .76rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px;
}
.gallery-item {
  position: relative; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--r-sm); background: var(--canvas);
  border: 1px solid var(--rule);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-blank {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--ink-3); font-weight: 600; font-size: .8rem; letter-spacing: .06em;
}
.gallery-badge {
  position: absolute; top: 6px; left: 6px;
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  font-size: .64rem; font-weight: 700; letter-spacing: .07em;
  padding: 3px 6px; border-radius: 4px;
}
.gallery-badge.is-video { background: rgba(22, 23, 27, .86); color: #fff; }
.gallery-index {
  position: absolute; top: 6px; right: 6px;
  color: #fff; font-size: .66rem; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  font-variant-numeric: tabular-nums;
}
.gallery-dl {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 22px 8px 9px;
  background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent);
  color: #fff; font-size: .78rem; font-weight: 600;
  opacity: 0; transition: opacity .15s;
}
.gallery-dl:hover { color: #fff; }
.gallery-item:hover .gallery-dl, .gallery-item:focus-within .gallery-dl { opacity: 1; }
@media (hover: none) { .gallery-dl { opacity: 1; } }

.gallery-more {
  display: block; width: 100%; margin-top: 14px;
  padding: 11px 16px;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: .87rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gallery-more:hover { border-color: var(--ink); background: var(--canvas); }

/* ===== Kết quả YouTube (2 bước) ===== */
.yt-card { flex-direction: row; gap: 26px; align-items: flex-start; }
.yt-left { flex: 0 0 200px; max-width: 200px; }
.yt-left img {
  width: 100%; display: block; border-radius: var(--r-sm);
  border: 1px solid var(--rule-soft);
}
.yt-title {
  font-size: .86rem; font-weight: 600; color: var(--ink);
  margin-top: 12px; line-height: 1.45; word-break: break-word;
}
.yt-right { flex: 1; min-width: 0; }

.yt-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.yt-tab {
  padding: 0 0 12px;
  font-family: inherit; font-size: .88rem; font-weight: 600; letter-spacing: .01em;
  color: var(--ink-3); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.yt-tab:hover { color: var(--ink); }
.yt-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.yt-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.yt-table th {
  text-align: left; padding: 12px 10px 8px;
  font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}
.yt-table th:last-child, .yt-table td:last-child { text-align: right; }
.yt-table td {
  padding: 11px 10px; border-top: 1px solid var(--rule-soft);
  vertical-align: middle; color: var(--ink);
}
.yt-table td:first-child, .yt-table th:first-child { padding-left: 0; }
.yt-table td:last-child, .yt-table th:last-child { padding-right: 0; }

.yt-fmt-badge { color: var(--ink-3); font-size: .84rem; }

.btn-yt-dl {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-weight: 600; font-size: .85rem;
  border: none; border-radius: var(--r-sm); cursor: pointer;
  transition: background .15s; white-space: nowrap;
}
.btn-yt-dl:hover:not(:disabled) { background: var(--accent-dark); }
.btn-yt-dl:disabled { opacity: .5; cursor: wait; }

@keyframes yt-spin { to { transform: rotate(360deg); } }
.yt-spinner {
  display: inline-block; width: 11px; height: 11px;
  border: 1.5px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  border-radius: 50%; animation: yt-spin .7s linear infinite;
  vertical-align: middle;
}

/* ===== Section ===== */
.section { padding: 68px 0; border-top: 1px solid var(--rule-soft); }
.section:first-of-type { border-top: none; }
.section-alt, .howto { background: var(--canvas); border-top-color: var(--rule); }

.section h2 {
  font-size: clamp(1.35rem, 1.16rem + .68vw, 1.72rem);
  margin-bottom: 32px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 20px; margin-bottom: 32px;
}
.section-head h2 { margin-bottom: 0; }
.link-more { font-weight: 600; font-size: .9rem; color: var(--accent); white-space: nowrap; }
.link-more:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.page-head { padding: 56px 0 0; }
.page-head h1 { font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.3rem); }
.empty-note { color: var(--ink-3); padding: 32px 0; }

/* ===== Lưới nền tảng ===== */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0; }
.platform-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 24px 22px 26px;
  color: var(--ink-2);
  border: 1px solid var(--rule-soft);
  margin: -1px 0 0 -1px;              /* gộp viền thành lưới liền mạch */
  background: var(--paper);
  transition: background .15s, border-color .15s;
}
.section-alt .platform-card, .platform-card { background: transparent; }
.platform-card:hover { background: var(--paper); border-color: var(--rule); z-index: 1; }
.platform-card h3 { font-size: 1rem; }
.platform-card p { font-size: .86rem; color: var(--ink-3); line-height: 1.55; }
.platform-card::after {
  content: ""; position: absolute; right: 22px; top: 28px;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--ink-3); border-top: 1.5px solid var(--ink-3);
  transform: rotate(45deg); opacity: 0;
  transition: opacity .15s, transform .15s;
}
.platform-card:hover::after { opacity: 1; transform: rotate(45deg) translate(2px, -2px); }

.platform-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.02rem; color: #fff; background: var(--ink);
}
.platform-tiktok .platform-icon, .platform-tiktok-mp3 .platform-icon { background: #111014; }
.platform-youtube .platform-icon,
.platform-youtube-to-mp3 .platform-icon,
.platform-youtube-shorts .platform-icon { background: #e02f2f; }
.platform-facebook .platform-icon { background: #1877f2; }
.platform-douyin .platform-icon { background: #15101a; }
.platform-instagram .platform-icon, .platform-instagram-reels .platform-icon { background: #d62976; }
.platform-pinterest .platform-icon { background: #d3122a; }

/* ===== Các bước ===== */
/* Dòng thời gian: số bước nằm trên một đường kẻ chạy nối các bước với nhau,
   để mắt đọc theo đúng thứ tự 1 → 2 → 3 thay vì thấy ba cột rời rạc. */
.steps {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0 40px;
  counter-reset: step;
}
.step { position: relative; padding-top: 62px; }

/* đoạn kẻ nối sang bước kế tiếp */
.step::after {
  content: "";
  position: absolute; top: 20px; left: 52px; right: -40px;
  height: 1px; background: var(--rule);
}
.step:last-child::after { content: none; }

.step-num {
  position: absolute; top: 0; left: 0;
  width: 41px; height: 41px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: 50%;
  background: var(--paper); color: var(--ink);
  font-size: .95rem; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Trạng thái tĩnh (khi tắt hiệu ứng): tô đậm bước đầu để biết bắt đầu từ đâu */
.step:first-child .step-num {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* Vệt xanh chạy lần lượt 1 → 2 → 3 rồi quay lại, gợi ý trình tự thao tác.
   Ba số dùng chung một chu kỳ, lệch pha nhau 1/3 bằng animation-delay âm
   để ngay từ lúc tải trang mỗi số đã ở đúng giai đoạn của nó. */
@keyframes step-cycle {
  0%,  28%  { background: var(--accent); border-color: var(--accent); color: #fff; }
  34%, 94%  { background: var(--paper);  border-color: var(--rule);   color: var(--ink); }
  100%      { background: var(--accent); border-color: var(--accent); color: #fff; }
}
.step-num { animation: step-cycle 4.5s linear infinite; }
.step:nth-child(2) .step-num { animation-delay: -3s; }
.step:nth-child(3) .step-num { animation-delay: -1.5s; }

/* Tôn trọng thiết lập giảm chuyển động của hệ điều hành */
@media (prefers-reduced-motion: reduce) {
  .step-num { animation: none; }
}

.step h3 { font-size: 1.05rem; margin-bottom: 8px; letter-spacing: -.01em; }
.step p { font-size: .92rem; color: var(--ink-3); max-width: 36ch; }

/* ===== Điểm mạnh ===== */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 40px; }
.feature { padding-top: 18px; border-top: 1px solid var(--ink); }
.feature h3 { font-size: .98rem; margin-bottom: 6px; }
.feature p { font-size: .89rem; color: var(--ink-3); }

/* ===== FAQ ===== */
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-of-type { border-bottom: 1px solid var(--rule); }
.faq-item summary {
  cursor: pointer; list-style: none;
  font-weight: 600; color: var(--ink); font-size: .98rem;
  padding: 18px 44px 18px 0; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before,
.faq-item summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  background: var(--ink-3); transition: transform .2s ease, opacity .2s ease;
}
.faq-item summary::before { width: 13px; height: 1.5px; margin-top: -.75px; }
.faq-item summary::after { width: 1.5px; height: 13px; margin-top: -6.5px; right: 11.75px; }
.faq-item[open] summary::after { transform: rotate(90deg); opacity: 0; }
.faq-item[open] summary { color: var(--ink); }
.faq-item p { padding: 0 44px 20px 0; color: var(--ink-3); font-size: .94rem; }

/* ===== Blog ===== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 36px 28px; }
.post-card { display: block; color: var(--ink-2); }
.post-card img {
  width: 100%; aspect-ratio: 3/2; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--rule-soft);
  margin-bottom: 16px; background: var(--canvas);
  transition: opacity .2s;
}
.post-card:hover img { opacity: .88; }
.post-card h3 { font-size: 1.03rem; line-height: 1.4; margin-bottom: 7px; }
.post-card:hover h3 { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-card p { font-size: .89rem; color: var(--ink-3); margin-bottom: 10px; }
.post-card time { font-size: .78rem; color: var(--ink-3); letter-spacing: .03em; }

.post-header { margin-bottom: 26px; }
.post-header h1 { font-size: clamp(1.6rem, 1.25rem + 1.7vw, 2.35rem); margin-bottom: 10px; }
.post-header time { color: var(--ink-3); font-size: .86rem; }
.post-thumb { width: 100%; border-radius: var(--r); margin-bottom: 30px; border: 1px solid var(--rule-soft); }

.pagination { display: flex; gap: 6px; margin-top: 44px; }
.pagination a {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 600; font-size: .88rem;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}
.pagination a:hover { border-color: var(--ink); color: var(--ink); }
.pagination a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ===== Nội dung dài ===== */
.prose { font-size: 1rem; color: var(--ink-2); }
.prose h2 { font-size: 1.32rem; margin: 36px 0 12px; }
.prose h3 { font-size: 1.09rem; margin: 26px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-dark); }
.prose ul, .prose ol { margin: 0 0 16px 20px; }
.prose li { margin-bottom: 7px; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 20px; margin: 0 0 16px;
  color: var(--ink-3);
}
.prose img { border-radius: var(--r-sm); margin: 12px 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: .93rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 10px 12px 10px 0; text-align: left; }
.prose th { color: var(--ink); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 32px 0; }

/* ===== Khối CTA cuối bài ===== */
.cta-box {
  margin-top: 48px; padding: 36px 34px;
  background: var(--ink); border-radius: var(--r-lg);
  color: #b9bcc4;
}
.cta-box h2 { color: #fff; font-size: 1.3rem; margin-bottom: 10px; }
.cta-box p { font-size: .95rem; max-width: 480px; }
.cta-box .btn-submit {
  background: #fff; border-color: #fff; color: var(--ink);
}
.cta-box .btn-submit:hover { background: var(--canvas); border-color: var(--canvas); color: var(--ink); }

/* ===== 404 ===== */
.error-page { text-align: left; }
.error-page h1 {
  font-size: clamp(3.4rem, 2.4rem + 4vw, 5.2rem);
  color: var(--ink); line-height: 1; margin-bottom: 14px; letter-spacing: -.045em;
}
.error-page p { color: var(--ink-3); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
  font-size: .82rem; color: var(--ink-3); margin-bottom: 18px;
}
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb span { color: #c3c1ba; }
.breadcrumb-dark { justify-content: flex-start; margin-bottom: 14px; }

/* ===== Footer ===== */
.site-footer { background: var(--ink); color: #9b9ea6; margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1.9fr 1fr 1fr;
  gap: 40px; padding: 64px 24px 44px;
}
/* Cột công cụ dài hơn hẳn ba cột kia — chia đôi cho cân footer */
.footer-grid > div:nth-child(2) { column-count: 2; column-gap: 28px; }
.footer-grid > div:nth-child(2) h4 { column-span: all; }
.logo-footer { color: #fff; display: inline-block; margin-bottom: 12px; }
.logo-footer:hover { color: #fff; }
.logo-footer span { color: #7fb79f; }
.site-footer h4 {
  color: #fff; font-size: .74rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; margin-bottom: 16px;
}
.site-footer a { display: block; color: #9b9ea6; font-size: .89rem; padding: 5px 0; transition: color .15s; }
.site-footer a:hover { color: #fff; }
.site-footer p { font-size: .89rem; max-width: 300px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 22px 24px; }
.footer-bottom p { font-size: .81rem; color: #74777f; max-width: none; }

/* ===== Spinner ===== */
.spinner {
  width: 22px; height: 22px; margin: 20px auto 0;
  border: 2px solid var(--rule); border-top-color: var(--ink);
  border-radius: 50%; animation: yt-spin .7s linear infinite;
}

/* ===== RTL ===== */
[dir="rtl"] .main-nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .nav-toggle { margin-left: 0; margin-right: auto; }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .lang-caret { border-right: none; border-left: 1.4px solid currentColor; transform: rotate(-45deg); }
[dir="rtl"] .lang-switch[open] .lang-caret { transform: rotate(135deg); }
[dir="rtl"] .lang-menu a.is-current .lang-name::after { margin: 0 8px 0 0; }
[dir="rtl"] .dl-trust, [dir="rtl"] .dl-box { text-align: right; }
[dir="rtl"] .dl-field input[type="url"] { padding: 14px 16px 14px 4px; }
[dir="rtl"] .btn-paste { border-left: none; border-right: 1px solid var(--rule-soft); }
[dir="rtl"] .step-num { left: auto; right: 0; }
[dir="rtl"] .step::after { left: -40px; right: 52px; }
[dir="rtl"] .platform-card { margin: -1px -1px 0 0; }
[dir="rtl"] .platform-card::after { right: auto; left: 22px; transform: rotate(-135deg); }
[dir="rtl"] .platform-card:hover::after { transform: rotate(-135deg) translate(2px, -2px); }
[dir="rtl"] .faq-item summary { padding: 18px 0 18px 44px; }
[dir="rtl"] .faq-item summary::before { right: auto; left: 6px; }
[dir="rtl"] .faq-item summary::after { right: auto; left: 11.75px; }
[dir="rtl"] .faq-item p { padding: 0 0 20px 44px; }
[dir="rtl"] .prose blockquote { border-left: none; border-right: 2px solid var(--accent); padding: 2px 20px 2px 0; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { margin: 0 20px 16px 0; }
[dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; padding: 10px 0 10px 12px; }
[dir="rtl"] .yt-table th, [dir="rtl"] .yt-table td { text-align: right; }
[dir="rtl"] .yt-table th:last-child, [dir="rtl"] .yt-table td:last-child { text-align: left; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  /* Xếp dọc: đường nối chuyển thành cột dọc chạy qua các số bước */
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { padding: 0 0 30px 60px; }
  .step:last-child { padding-bottom: 0; }
  .step::after {
    top: 49px; bottom: 6px; left: 20px; right: auto;
    width: 1px; height: auto;
  }
  .step p { max-width: none; }
  [dir="rtl"] .step { padding: 0 60px 30px 0; }
  [dir="rtl"] .step::after { left: auto; right: 20px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 28px 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .yt-card { flex-direction: column; }
  .yt-left { flex: none; max-width: 220px; }
}

@media (max-width: 660px) {
  .container { padding: 0 18px; }
  .nav-toggle { display: block; }
  .lang-switch { margin-left: auto; }
  .nav-toggle { margin-left: 12px; }
  .main-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    flex-direction: column; padding: 8px 18px 16px; gap: 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 0; border-top: 1px solid var(--rule-soft); border-radius: 0; }
  .main-nav a::after { display: none; }

  .hero { padding: 52px 0 48px; }
  .hero-platform { padding: 40px 0 44px; }
  .section { padding: 48px 0; }

  .dl-form { flex-wrap: wrap; }
  .dl-field { flex-basis: 100%; }
  .btn-submit { flex: 1; }

  .result-card { flex-direction: column; padding: 18px; }
  .result-card > img { width: 100%; }
  .platform-grid { grid-template-columns: 1fr 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 48px 18px 36px; }
  .footer-grid > div:nth-child(2) { column-count: 1; }
  .cta-box { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
