/* ============================================================
   ئورتاق قارا ئىلغار ئۇسلۇب · 全站黑色高级维语 RTL 样式
   ============================================================ */

:root {
  --bg: #06090e;
  --bg-soft: #0b1017;
  --card: rgba(255, 255, 255, 0.045);
  --card-solid: #0e141d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --txt: #e9eef5;
  --txt-2: #9aa7b6;
  --txt-3: #5f6b7a;
  --green: #00e676;
  --green-2: #07c160;
  --green-dim: rgba(0, 230, 118, 0.14);
  --red: #ff5c5c;
  --red-dim: rgba(255, 92, 92, 0.14);
  --amber: #ffb020;
  --radius: 16px;
  --shadow-glow: 0 0 24px rgba(0, 230, 118, 0.35), 0 8px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(0, 230, 118, 0.10), transparent 60%),
    radial-gradient(700px 500px at 5% 110%, rgba(0, 150, 255, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--txt);
  font-family: "Noto Naskh Arabic", "UKIJ Tuz Tom", "UKIJ Ekran", "Alpida Unicode", "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  min-height: 100vh;
}

h1, h2, h3, .kufi {
  font-family: "Noto Kufi Arabic", "Noto Naskh Arabic", "UKIJ Tuz Tom", Tahoma, sans-serif;
  line-height: 1.5;
}

a { color: inherit; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(6, 9, 14, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--green), var(--green-2));
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.4);
  color: #04140c;
}
.brand .logo svg { width: 19px; height: 19px; }
.top-actions { display: flex; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--txt);
  border-radius: 11px;
  padding: 9px 16px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.09); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(145deg, #12f085, #06b45a);
  border-color: transparent;
  color: #04130b;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.25), var(--shadow-glow);
}
.btn-primary:hover { background: linear-gradient(145deg, #2aff9a, #07c463); }
.btn-block { width: 100%; padding: 13px; font-size: 17px; border-radius: 13px; }
.btn-danger { color: var(--red); border-color: rgba(255, 92, 92, 0.35); background: rgba(255, 92, 92, 0.08); }
.btn-danger:hover { background: rgba(255, 92, 92, 0.16); border-color: rgba(255, 92, 92, 0.55); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.icon-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 11px;
}

/* ---------- 布局容器 ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 22px 18px 60px; }
.page-head { margin: 6px 2px 20px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--txt-2); font-size: 14px; }

/* ---------- 玻璃卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
}
.card + .card { margin-top: 16px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; color: var(--txt-2); font-size: 14px; margin-bottom: 7px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg {
  position: absolute; right: 13px; width: 18px; height: 18px; color: var(--txt-3);
  pointer-events: none;
}
input, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--txt);
  padding: 12px 44px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: var(--txt-3); }
input:focus {
  outline: none;
  border-color: rgba(0, 230, 118, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.13);
}
input[type="date"] { color-scheme: dark; }

/* ---------- 提示条 ---------- */
.alert {
  display: none;
  border-radius: 11px; padding: 10px 14px; font-size: 14px;
  margin-top: 14px; line-height: 1.7;
}
.alert.show { display: block; }
.alert.err { background: var(--red-dim); border: 1px solid rgba(255, 92, 92, 0.3); color: #ff8f8f; }
.alert.ok { background: var(--green-dim); border: 1px solid rgba(0, 230, 118, 0.3); color: #62f0a8; }

/* ---------- 网站列表 ---------- */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 26px 4px 12px; color: var(--txt-2); font-size: 14px;
}
.site {
  display: flex; align-items: center; gap: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color .2s, transform .12s;
}
.site:hover { border-color: var(--line-strong); }
.site .globe {
  width: 42px; height: 42px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.22);
  color: var(--green);
}
.site .globe svg { width: 21px; height: 21px; }
.site .meta { flex: 1; min-width: 0; }
.site .n { font-weight: 700; font-size: 16px; }
.site .d { color: var(--txt-2); font-size: 13.5px; direction: ltr; text-align: right;
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site .t { color: var(--txt-3); font-size: 12.5px; }
.site .ops { display: flex; gap: 6px; }
.site .ops button {
  border: 0; background: transparent; color: var(--txt-3);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.site .ops button:hover { background: rgba(255, 92, 92, 0.12); color: var(--red); }
.site .ops svg { width: 17px; height: 17px; }

.badge {
  font-size: 13px; padding: 4px 13px; border-radius: 30px;
  font-family: "Noto Kufi Arabic", Tahoma, sans-serif; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-dim); color: var(--green); border: 1px solid rgba(0, 230, 118, 0.3); }
.badge.err { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255, 92, 92, 0.3); }
.badge.wait { background: rgba(255, 255, 255, 0.06); color: var(--txt-3); border: 1px solid var(--line); }
.badge.wait::before { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.empty {
  text-align: center; color: var(--txt-3); padding: 42px 16px;
  border: 1px dashed var(--line); border-radius: 14px; font-size: 14.5px;
}
.empty svg { width: 40px; height: 40px; display: block; margin: 0 auto 10px; opacity: .5; }

/* ---------- 居中弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(3, 6, 10, 0.7);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.mask.show { display: flex; }
.modal {
  width: 250px;
  background: linear-gradient(180deg, #121924, #0c121a);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 32px 22px 28px;
  text-align: center;
  animation: pop .22s cubic-bezier(.2, 1.4, .4, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(0, 230, 118, .12);
}
@keyframes pop { from { transform: scale(.82); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .tick {
  width: 66px; height: 66px; margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #12f085, #06b45a);
  color: #04140c;
  box-shadow: 0 0 30px rgba(0, 230, 118, .55);
}
.modal .tick svg { width: 34px; height: 34px; }
.modal .txt { font-size: 18px; font-weight: 700; font-family: "Noto Kufi Arabic", Tahoma, sans-serif; }

/* ---------- 登录页专用 ---------- */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 18px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 32px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  backdrop-filter: blur(14px);
}
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 16px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #12f085, #06a352);
  color: #04140c;
  box-shadow: 0 0 34px rgba(0, 230, 118, .5);
}
.auth-logo svg { width: 33px; height: 33px; }
.auth-card h1 { text-align: center; margin: 0; font-size: 21px; }
.auth-card .sub { text-align: center; color: var(--txt-2); font-size: 14px; margin: 6px 0 24px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--txt-3); font-size: 12.5px; }

/* ---------- 返回链接 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--txt-2); text-decoration: none; font-size: 14.5px; margin-bottom: 16px;
}
.back-link:hover { color: var(--green); }
.back-link svg { width: 17px; height: 17px; transform: scaleX(-1); }

/* ---------- 卡片页通用：统一登录页风格 ---------- */
.auth-card.wide { max-width: 440px; }

/* 卡片内紧凑网站列表 */
.sites { margin-top: 20px; text-align: right; }
.sites-title {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--txt-3); font-size: 12.5px; margin: 0 2px 8px;
  font-family: "Noto Kufi Arabic", Tahoma, sans-serif;
}
.sites-title .rule { flex: 1; height: 1px; background: var(--line); margin: 0 10px; }
.site-item { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.site-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.site-l1 { display: flex; align-items: center; gap: 9px; }
.site-name {
  flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-domain {
  direction: ltr; text-align: right; display: block;
  color: var(--txt-2); font-size: 12.5px; margin-top: 3px;
  padding-right: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-date { color: var(--txt-3); font-size: 12px; margin-top: 1px; padding-right: 18px; }
.site-item .badge { font-size: 11.5px; padding: 2px 10px; flex: none; }
.site-del {
  flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--txt-3); width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-family: inherit;
  transition: background .15s, color .15s;
}
.site-del:hover { background: rgba(255, 92, 92, 0.12); color: var(--red); }
.site-del svg { width: 16px; height: 16px; }

.empty-mini {
  color: var(--txt-3); font-size: 13.5px; text-align: center;
  padding: 20px 10px 6px; line-height: 1.9;
}
.empty-mini svg { width: 34px; height: 34px; display: block; margin: 0 auto 8px; opacity: .45; }

/* 卡片底部小链接（返回 / 设置 / 退出） */
.foot-links {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 20px; flex-wrap: wrap;
}
.foot-links a, .foot-links button {
  color: var(--txt-2); background: none; border: 0; padding: 4px 6px;
  font-family: inherit; font-size: 13.5px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.foot-links a:hover, .foot-links button:hover { color: var(--green); }
.foot-links .logout:hover { color: var(--red); }
.foot-links svg { width: 15px; height: 15px; }
.foot-links .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--txt-3); }

@media (max-width: 480px) {
  .wrap { padding: 16px 12px 50px; }
  .card { padding: 18px 15px; }
  .brand span { display: none; }
  .site .d { max-width: 150px; }
}
