/* ext.vpsttt.com: cùng nhận diện với tiện ích Proxy Nhanh (tím VPSTTT #8100ff, Inter, biểu tượng Material). */

/* Font Inter (OFL 1.1, fonts/LICENSE-OFL.txt): Latin, Latin mở rộng, tiếng Việt. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-vietnamese-wght-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --tim: #8100ff;          /* chữ trắng trên nền này: 6.2:1 */
  --tim-dam: #6a00d6;      /* rê chuột nút chính: chữ trắng 8.1:1 */
  --tim-chu: #7000dd;      /* chữ tím trên nền sáng: >= 6.5:1 */
  --tim-nhat: #f3e8ff;
  --nen: #f6f5f9;
  --nen-the: #ffffff;
  --nen-phu: #efedf4;
  --vien: #dad6e3;
  --chu: #1c1826;
  --chu-phu: #565166;
  --do: #b42318;
  --do-nen: #fdecea;
  --do-vien: #f4b8b2;
  --vang: #7a4d00;
  --vang-nen: #fff6dc;
  --vang-vien: #f0d58a;
  --xanh: #0a7558;
  --xanh-nen: #e3f5ef;
  --bong: 0 1px 2px rgb(0 0 0 / 6%), 0 2px 8px rgb(0 0 0 / 5%);
  --bo: 12px;
  --focus: 0 0 0 3px rgb(129 0 255 / 40%);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-feature-settings: 'cv11';
  font-size: 15px;
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --tim: #b47aff;
    --tim-dam: #8100ff;
    --tim-chu: #c99dff;
    --tim-nhat: #2a1747;
    --nen: #131119;
    --nen-the: #1c1924;
    --nen-phu: #26222f;
    --vien: #3a3547;
    --chu: #ece9f2;
    --chu-phu: #b0aabd;
    --do: #ff8a80;
    --do-nen: #3a1715;
    --do-vien: #6e2a25;
    --vang: #f5cf6b;
    --vang-nen: #342a0f;
    --vang-vien: #6a5520;
    --xanh: #4fd8ad;
    --xanh-nen: #12352b;
    --bong: 0 1px 2px rgb(0 0 0 / 40%);
    --focus: 0 0 0 3px rgb(180 122 255 / 55%);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--nen); }
body { margin: 0; min-height: 100vh; color: var(--chu); background: var(--nen); }
a { color: var(--tim-chu); }
h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; }
h2 { font-size: 17px; }
p { margin: 0; }
code { padding: 1px 5px; border-radius: 5px; background: var(--nen-phu); font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
.phu { color: var(--chu-phu); font-size: 13.5px; }
.ma, .ma-kiem { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.bo-qua { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 8px 12px; background: var(--nen-the); border-radius: 8px; }
.bo-qua:focus { top: 12px; }

/* ---------- Biểu tượng ---------- */
.bt { flex: none; width: 20px; height: 20px; }
.bt-nho { width: 15px; height: 15px; }
.bt-lon { width: 44px; height: 44px; color: var(--tim); }

/* ---------- Đầu trang ---------- */
.dau { position: sticky; top: 0; z-index: 10; background: var(--nen-the); border-bottom: 1px solid var(--vien); }
.dau-trong { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(1100px, 100% - 32px); margin-inline: auto; min-height: 64px; }
.thuong-hieu { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.thuong-hieu img { display: block; width: 130px; height: auto; }
.vien-thuoc { padding: 3px 10px; border-radius: 999px; background: var(--tim-nhat); color: var(--tim-chu); font-size: 13px; font-weight: 700; }
.dieu-huong { display: flex; align-items: center; gap: 4px; }
.dieu-huong form { margin: 0; }
.dieu-huong a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  color: var(--chu-phu); font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s;
}
.dieu-huong a:hover { background: var(--nen-phu); color: var(--chu); }
.dieu-huong a.dang-o { background: var(--tim-nhat); color: var(--tim-chu); }

/* ---------- Bố cục ---------- */
.noi-dung { display: flex; flex-direction: column; gap: 16px; width: min(1100px, 100% - 32px); margin: 24px auto 80px; outline: none; }
.muc-dau { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.muc-dau > div:first-child:not(.tien-ich-tieu-de) { display: flex; flex-direction: column; gap: 4px; }
.tieu-de-muc { margin: 8px 0 0; }
.the { padding: 18px; border: 1px solid var(--vien); border-radius: var(--bo); background: var(--nen-the); box-shadow: var(--bong); }
.hang-nut { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hang-nut form { margin: 0; }
.hang-nut.cuoi { justify-content: flex-end; }
.quay-lai { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--chu-phu); font-weight: 600; text-decoration: none; }
.quay-lai:hover { color: var(--tim-chu); }

/* ---------- Nút ---------- */
.nut {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 15px 8px 13px;
  border: 1px solid var(--vien); border-radius: 10px; background: var(--nen-the); color: var(--chu);
  font: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.nut:hover:not(:disabled) { background: var(--nen-phu); }
.nut:disabled { opacity: .55; cursor: not-allowed; }
.nut-nho { min-height: 34px; padding: 5px 11px 5px 9px; font-size: 14px; }
.nut-chinh { background: var(--tim); border-color: var(--tim); color: #fff; }
.nut-chinh:hover:not(:disabled) { background: var(--tim-dam); border-color: var(--tim-dam); }
@media (prefers-color-scheme: dark) {
  .nut-chinh { background: #8100ff; border-color: #8100ff; }
  .nut-chinh:hover:not(:disabled) { background: #6a00d6; border-color: #6a00d6; }
}
.nut-nguy { color: var(--do); border-color: var(--do-vien); }
.nut-nguy:hover:not(:disabled) { background: var(--do-nen); }
.nut-chu { border-color: transparent; background: transparent; color: var(--chu-phu); }
.nut-bieu-tuong { min-width: 40px; padding-inline: 8px; }
.nut-rong { width: 100%; }
.nut[aria-busy='true'] { cursor: progress; }

/* ---------- Form ---------- */
.form-doc, .form-tai-len { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.o { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type='text'], input[type='password'], input[type='url'], textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--vien); border-radius: 10px;
  background: var(--nen-the); color: var(--chu); font: inherit; font-weight: 400;
}
input:focus-visible, textarea:focus-visible { border-color: var(--tim); }
textarea { resize: vertical; }
.luoi-tep { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.o-tep {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px dashed var(--vien); border-radius: 10px;
  background: var(--nen); transition: border-color .15s, background-color .15s;
}
.o-tep:hover, .o-tep:focus-within { border-color: var(--tim); background: var(--tim-nhat); }
.o-tep-nhan { font-weight: 700; }
.o-tep input[type='file'] { font: inherit; color: var(--chu-phu); max-width: 100%; }
.o-tep input[type='file']::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: 1px solid var(--vien); border-radius: 8px;
  background: var(--nen-the); color: var(--chu); font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Khung mở / đóng (details) có hiệu ứng ---------- */
.khung-mo { padding: 0; }
.khung-mo > summary {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 18px; border-radius: var(--bo);
  font-weight: 700; cursor: pointer; list-style: none;
}
.khung-mo > summary::-webkit-details-marker { display: none; }
.khung-mo > summary::after { content: '+'; margin-left: auto; font-size: 20px; color: var(--chu-phu); transition: transform .18s; }
.khung-mo[open] > summary::after { transform: rotate(45deg); }
.khung-mo > summary:hover { background: var(--nen-phu); }
.khung-mo > :not(summary) { padding: 0 18px 18px; }
.khung-mo::details-content {
  opacity: 0; block-size: 0; overflow: clip;
  transition: opacity .18s ease, block-size .18s ease, content-visibility .18s allow-discrete;
}
.khung-mo[open]::details-content { opacity: 1; block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }

/* ---------- Thông báo ---------- */
.bao {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid; border-radius: 10px;
  font-weight: 500; transition: opacity .18s ease, transform .18s ease;
}
.bao-chu { flex: 1; }
.bao-tot { background: var(--xanh-nen); border-color: var(--xanh); color: var(--xanh); }
.bao-loi { background: var(--do-nen); border-color: var(--do-vien); color: var(--do); }
.bao-canh { background: var(--vang-nen); border-color: var(--vang-vien); color: var(--vang); }
.bao .nut { color: inherit; }
.bao.dang-an { opacity: 0; transform: translateY(-6px); }

/* ---------- Trang đăng nhập ---------- */
.trang-dang-nhap .noi-dung { min-height: 100vh; margin: 0 auto; justify-content: center; padding: 24px 0; }
.khung-dang-nhap { display: flex; justify-content: center; }
.the-dang-nhap { display: flex; flex-direction: column; gap: 16px; width: min(420px, 100%); padding: 28px; }
.dang-nhap-dau { display: flex; flex-direction: column; gap: 8px; }
.dang-nhap-dau img { width: 170px; height: auto; margin-bottom: 8px; }
.dang-nhap-dau h1 { font-size: 22px; }

/* ---------- Danh sách tiện ích ---------- */
.luoi-tien-ich { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.the-tien-ich { display: flex; flex-direction: column; gap: 12px; }
.tien-ich-dau { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.tien-ich-dau img { border-radius: 12px; }
.tien-ich-dau > span { display: flex; flex-direction: column; gap: 2px; }
.tien-ich-ten { font-size: 17px; font-weight: 700; }
.tien-ich-dau:hover .tien-ich-ten { color: var(--tim-chu); }
.tien-ich-mo-ta { color: var(--chu-phu); font-size: 14px; }
.tien-ich-tieu-de { display: flex; align-items: center; gap: 14px; }
.tien-ich-tieu-de > div { display: flex; flex-direction: column; gap: 4px; }
.tien-ich-tieu-de img { border-radius: 14px; }
.hang-link { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.hang-link a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; font-weight: 600; text-decoration: none; }
.hang-link a:hover { text-decoration: underline; }

/* ---------- Phiên bản ---------- */
.ds-ban { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ban { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.ban-moi-nhat { border-color: var(--tim); }
.ban-an { opacity: .65; }
.ban-dau { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ban-dau > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ban-so { font-size: 17px; font-weight: 800; }
.ban-ghi-chu { padding-left: 12px; border-left: 3px solid var(--vien); white-space: normal; }
.ban-tep { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; font-size: 13px; color: var(--chu-phu); }
.ban-tep div { display: flex; flex-wrap: wrap; gap: 6px; }
.ban-tep dt { white-space: nowrap; }
.ban-tep dt { font-weight: 700; color: var(--chu); }
.ban-tep dd { margin: 0; }
.nhan { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--nen-phu); color: var(--chu-phu); font-size: 12px; font-weight: 700; }
.nhan-tim { background: #8100ff; color: #fff; }

/* ---------- Bảng (nhật ký) ---------- */
.khung-bang { padding: 0; overflow-x: auto; }
.bang { width: 100%; border-collapse: collapse; font-size: 14px; }
.bang th, .bang td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--vien); vertical-align: top; }
.bang th { color: var(--chu-phu); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--nen-phu); }
.bang tr:last-child td { border-bottom: 0; }
.khong-xuong { white-space: nowrap; }
.dong-loi td { color: var(--do); }

/* ---------- Trạng thái rỗng ---------- */
.rong { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 18px; text-align: center; }
.rong-tieu-de { font-size: 17px; font-weight: 700; }

/* ---------- Hộp xác nhận: ~180 ms cả lúc mở lẫn lúc đóng ---------- */
.hop-thoai {
  width: min(92vw, 440px); padding: 22px; border: 1px solid var(--vien); border-radius: 14px;
  background: var(--nen-the); color: var(--chu); box-shadow: 0 12px 40px rgb(0 0 0 / 30%);
  opacity: 0; transform: translateY(8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease, overlay .18s allow-discrete, display .18s allow-discrete;
}
.hop-thoai[open] { opacity: 1; transform: none; }
@starting-style { .hop-thoai[open] { opacity: 0; transform: translateY(8px) scale(.98); } }
.hop-thoai::backdrop { background: rgb(0 0 0 / 0%); transition: background-color .18s, overlay .18s allow-discrete, display .18s allow-discrete; }
.hop-thoai[open]::backdrop { background: rgb(0 0 0 / 45%); }
@starting-style { .hop-thoai[open]::backdrop { background: rgb(0 0 0 / 0%); } }
.hop-thoai-chu { margin-bottom: 18px; font-weight: 500; }

/* ---------- Màn hình hẹp: nút chỉ còn biểu tượng (chữ vẫn cho trình đọc màn hình, rê chuột thấy title) ---------- */
@media (max-width: 720px) {
  .thu-gon .nhan-nut, .dieu-huong .nhan-nut {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .thu-gon, .dieu-huong a, .dieu-huong .nut { min-width: 44px; min-height: 44px; padding-inline: 10px; }
  .thuong-hieu img { width: 104px; }
  .vien-thuoc { font-size: 12px; }
  h1 { font-size: 21px; }
  .the { padding: 14px; }
  .luoi-tien-ich { grid-template-columns: 1fr; }
  /* Màn hình cảm ứng: chỗ bấm tối thiểu 44px. */
  .nut, .nut-nho, input[type='text'], input[type='password'], input[type='url'] { min-height: 44px; }
  /* Nhật ký: mỗi dòng thành một thẻ (bảng 4 cột không vừa màn hình điện thoại). */
  .bang thead { display: none; }
  .bang tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--vien); }
  .bang tr:last-child { border-bottom: 0; }
  .bang td { display: block; padding: 2px 14px; border: 0; }
  .bang td:first-child { color: var(--chu-phu); font-size: 12.5px; }
  .bang td:nth-child(2) { font-weight: 700; }
  .bang td:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
