.tkd {
  --tkd-accent: #F88C00;
  --tkd-accent-hover: #E07E00;
  --tkd-accent-soft: #FFF4E5;
  --tkd-accent-line: #FCD9A8;
  --tkd-dark: #161823;
  --tkd-purple: #A24BF0;
  --tkd-text: #161823;
  --tkd-muted: #6B6F7B;
  --tkd-bg: #FFFFFF;
  --tkd-line: #E6E7EB;
  --tkd-radius: 20px;
  max-width: 1100px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--tkd-text);
  line-height: 1.5;
  text-align: left;
}
/* Reset để theme không ghi đè */
.tkd button, .tkd input, .tkd a, .tkd p, .tkd ul, .tkd li, .tkd img {
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-shadow: none;
  min-height: 0;
  line-height: 1.4;
}
.tkd button, .tkd a { box-shadow: none; text-decoration: none; }
.tkd p { margin: 0; }
.tkd img { max-width: 100%; border: 0; box-shadow: none; }
.tkd [hidden] { display: none !important; }
.tkd *, .tkd *::before, .tkd *::after { box-sizing: border-box; }
.tkd svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Ô nhập link ---------- */
.tkd .tkd-box,
.tkd .tkd-card {
  background: var(--tkd-bg);
  border: 1px solid var(--tkd-line);
  border-radius: var(--tkd-radius);
  box-shadow: 0 1px 3px rgba(22, 24, 35, .06);
}
.tkd .tkd-box { padding: 20px; }

.tkd .tkd-form { display: flex; gap: 12px; margin: 0; }
.tkd .tkd-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.tkd .tkd-input {
  width: 100%;
  height: 56px;
  margin: 0;
  padding: 0 112px 0 18px;
  font: inherit;
  font-size: 16px;
  color: var(--tkd-text);
  background: var(--tkd-bg);
  border: 1.5px solid var(--tkd-line);
  border-radius: 14px;
  outline: none;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.tkd .tkd-input::placeholder { color: #A0A3AD; }
.tkd .tkd-input:focus {
  border-color: var(--tkd-accent);
  box-shadow: 0 0 0 4px rgba(248, 140, 0, .15);
}
.tkd .tkd-paste {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--tkd-accent);
  background: var(--tkd-accent-soft);
  border: 1px solid var(--tkd-accent-line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.tkd .tkd-paste svg { width: 18px; height: 18px; }
.tkd .tkd-paste:hover { background: #FFEACC; }

.tkd .tkd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  margin: 0;
  padding: 0 28px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--tkd-accent);
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}
.tkd .tkd-btn:hover { background: var(--tkd-accent-hover); }
.tkd .tkd-btn:active { transform: translateY(1px); }
.tkd .tkd-btn:disabled { opacity: .7; cursor: wait; }
.tkd .tkd-btn.tkd-loading svg { display: none; }
.tkd .tkd-btn.tkd-loading::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tkd-spin .7s linear infinite;
}
@keyframes tkd-spin { to { transform: rotate(360deg); } }

.tkd .tkd-hint { margin: 10px 2px 0; font-size: 14px; color: var(--tkd-muted); }
.tkd .tkd-msg { margin: 6px 2px 0; font-size: 14px; color: var(--tkd-muted); }
.tkd .tkd-msg:empty { display: none; }
.tkd .tkd-msg.tkd-err { color: #D92D20; font-weight: 500; }

/* ---------- Kết quả ---------- */
.tkd .tkd-result { margin-top: 24px; }
.tkd .tkd-card {
  display: flex;
  gap: 28px;
  padding: 24px;
  animation: tkd-in .25s ease-out;
}
@keyframes tkd-in { from { opacity: 0; transform: translateY(6px); } }

.tkd .tkd-thumb {
  flex: 0 0 300px;
  aspect-ratio: 9 / 16;
  max-height: 540px;
  border-radius: 14px;
  overflow: hidden;
  background: #F1F2F4;
}
.tkd .tkd-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tkd .tkd-info { flex: 1; min-width: 0; }
.tkd .tkd-author { display: flex; align-items: center; gap: 16px; }
.tkd .tkd-avatar {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tkd-accent-soft);
}
.tkd .tkd-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--tkd-accent);
}
.tkd .tkd-names { min-width: 0; }
.tkd .tkd-nick { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.tkd .tkd-user { font-size: 16px; color: var(--tkd-muted); overflow-wrap: anywhere; }

.tkd .tkd-title {
  margin: 18px 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tkd .tkd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 15px;
  color: var(--tkd-muted);
}
.tkd .tkd-stats li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.tkd .tkd-stats svg { width: 17px; height: 17px; }

.tkd .tkd-links { display: flex; flex-direction: column; gap: 14px; }
.tkd .tkd-dl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  font-size: 17px;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 14px;
  transition: filter .15s, transform .1s;
}
.tkd .tkd-dl:hover { filter: brightness(1.08); }
.tkd .tkd-dl:active { transform: translateY(1px); }
.tkd .tkd-dl small { margin-left: auto; font-size: 13px; font-weight: 500; opacity: .8; }
.tkd .tkd-links .tkd-dl { display: flex; width: 100%; }
.tkd .tkd-dl-hd { background: var(--tkd-accent); }
.tkd .tkd-dl-sd { background: var(--tkd-dark); }
.tkd .tkd-dl-sd:hover { filter: brightness(1.35); }
.tkd .tkd-dl-mp3 { background: var(--tkd-purple); }
.tkd .tkd-dl-zip { background: var(--tkd-accent); }

/* ---------- Bài đăng ảnh ---------- */
.tkd .tkd-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.tkd .tkd-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--tkd-accent-soft);
}
.tkd .tkd-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tkd .tkd-photo.tkd-broken img { display: none; }
.tkd .tkd-photo-n {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 24px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: rgba(22, 24, 35, .6);
  border-radius: 999px;
}
.tkd .tkd-photo.tkd-broken .tkd-photo-n {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--tkd-accent);
  background: none;
  font-size: 22px;
}
.tkd .tkd-photo-dl {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff !important;
  background: var(--tkd-accent);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: background .15s, transform .1s;
}
.tkd .tkd-photo-dl:hover { background: var(--tkd-accent-hover); }
.tkd .tkd-photo-dl:active { transform: scale(.95); }
.tkd .tkd-photo-dl svg { width: 20px; height: 20px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  .tkd .tkd-photos { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tkd .tkd-photo-dl { width: 34px; height: 34px; }
  .tkd .tkd-box { padding: 16px; }
  .tkd .tkd-form { flex-direction: column; }
  .tkd .tkd-btn { width: 100%; }
  .tkd .tkd-card { flex-direction: column; gap: 18px; padding: 16px; }
  .tkd .tkd-thumb { flex-basis: auto; width: 100%; max-width: 280px; max-height: none; margin: 0 auto; }
  .tkd .tkd-avatar { width: 56px; height: 56px; }
  .tkd .tkd-title { font-size: 18px; }
  .tkd .tkd-links { flex-direction: column; }
  .tkd .tkd-links .tkd-dl { justify-content: center; }
  .tkd .tkd-dl small { margin-left: 0; }
}
