/* =========================================================
   客户门户样式。深色 + 蓝色主调，与插件主界面视觉一致。
   ⚠ 门户与后台共用本文件（admin.html 也引它），改样式两边都受影响。
   ========================================================= */

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, "Segoe UI", sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- 通用控件 ---------- */
.btn {
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.btn:hover { background: #30363d; border-color: #8b949e; }
.btn.primary { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.btn.primary:hover { background: #388bfd; border-color: #388bfd; }
.btn.ghost { background: transparent; }
.btn.danger { background: #da3633; border-color: #da3633; color: #fff; }
.btn.danger:hover { background: #f85149; }
.btn.mini { padding: 3px 9px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 6px; padding: 10px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

input, select {
  width: 100%;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #c9d1d9;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: #1f6feb; }

code {
  font-family: Consolas, Monaco, monospace;
  background: #161b22;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

.muted { color: #8b949e; font-size: 12px; }
.req { color: #f85149; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, #161b22 0%, #0d1117 60%);
}
.auth-card {
  width: 100%;
  max-width: 480px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.brand { text-align: center; margin-bottom: 22px; }
.logo {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #1f6feb, #388bfd);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 20px; color: #fff;
}
.logo.small { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; margin: 0; }
.brand h1 { font-size: 19px; color: #f0f6fc; font-weight: 600; }
.brand .sub { color: #8b949e; font-size: 12.5px; margin-top: 6px; }

.tabs {
  display: flex;
  background: #0d1117;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 18px;
}
.tabs .tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #8b949e;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
}
.tabs .tab.active { background: #21262d; color: #f0f6fc; }

.form .field { margin-bottom: 13px; }
.form .row { display: flex; gap: 12px; }
.form .row .field { flex: 1; }
.form label { display: block; font-size: 12.5px; color: #8b949e; margin-bottom: 5px; }
.err {
  color: #f85149;
  font-size: 12.5px;
  min-height: 18px;
  margin-bottom: 4px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.tb-title { color: #f0f6fc; font-size: 14px; font-weight: 600; }
.tb-right { display: flex; align-items: center; gap: 12px; }
.who { color: #8b949e; font-size: 13px; }

/* ---------- 容器 / 卡片 ---------- */
.container { max-width: 940px; margin: 0 auto; padding: 22px 20px 60px; }
.card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card.highlight { border-color: #1f6feb44; background: linear-gradient(180deg, #161b22, #0d1117); }
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.card-h h2 { font-size: 14.5px; color: #f0f6fc; font-weight: 600; }
.card-h-right { display: flex; align-items: center; gap: 12px; }
.tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px;
  background: #21262d; color: #8b949e;
}
.tag.ok { background: #1a7f3722; color: #3fb950; border: 1px solid #1a7f3766; }
.tag.warn { background: #9e6a0322; color: #d29922; border: 1px solid #9e6a0366; }
.tag.off { background: #da363322; color: #f85149; border: 1px solid #da363366; }

.lic-box {
  display: flex; align-items: center; gap: 12px;
  background: #0d1117; border: 1px dashed #30363d;
  border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
}
.lic-box code {
  flex: 1; background: transparent; font-size: 17px;
  letter-spacing: 1.5px; color: #58a6ff; font-weight: 600;
}
.hint { color: #8b949e; font-size: 12.5px; }

/* ---------- 权益包列表 ---------- */
.plans-list { display: flex; flex-direction: column; gap: 10px; }
.plan-item {
  border: 1px solid #21262d; border-radius: 8px;
  padding: 12px 14px; background: #0d1117;
}
.plan-item.expired { opacity: .5; }
.plan-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-name { color: #f0f6fc; font-weight: 600; font-size: 13.5px; }
.plan-meta { color: #8b949e; font-size: 12px; }
.plan-feats { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
/* 「我的权益」里"待分配"分组的小标题 */
.myplans-sub {
  margin: 14px 0 2px; color: #8b949e; font-size: 12px;
  border-top: 1px solid #21262d; padding-top: 12px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: #1f6feb22; border: 1px solid #1f6feb55; color: #58a6ff;
  font-size: 12px; padding: 3px 10px; border-radius: 20px;
}
.chip.plain { background: #21262d; border-color: #30363d; color: #8b949e; }

/* ---------- 表格 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #21262d; }
th { color: #8b949e; font-weight: normal; font-size: 12px; }
tbody tr:hover { background: #1c2128; }

.empty {
  text-align: center; color: #6e7681; font-size: 13px;
  padding: 26px 10px;
}
.empty b { color: #8b949e; }

/* ---------- 弹窗 ---------- */
.modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
  background: #161b22; border: 1px solid #30363d;
  border-radius: 10px; padding: 22px;
  width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto;
}
.modal-box h3 {
  color: #f0f6fc; font-size: 15px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-box h3 .close {
  background: none; border: none; color: #8b949e;
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-box .foot {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px;
}
.note {
  background: #0d1117; border-left: 3px solid #1f6feb;
  padding: 10px 12px; font-size: 12.5px; color: #8b949e;
  border-radius: 4px; margin-bottom: 14px;
}

/* ---------- 轻提示 ---------- */
#toast {
  display: none; position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  background: #21262d; color: #f0f6fc;
  border: 1px solid #30363d; border-radius: 8px;
  padding: 10px 20px; font-size: 13px; z-index: 200;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
#toast.ok { border-color: #1a7f37; }
#toast.err { border-color: #da3633; }

/* ---------------- 软件下载区（2026-10-21） ----------------
   与全站暗色保持一致（GitHub 暗色系，色值抄自上方既有规则）。 */
.dl-list { display: flex; flex-direction: column; gap: 10px; }

.dl-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: #0d1117; border: 1px solid #30363d; border-radius: 8px;
  padding: 13px 15px;
}
/* 无权限的条目压暗，但仍可读 —— 让客户知道"有这个东西，但我的包不含"，
   ⛔ 直接隐藏会让人以为软件不存在。 */
.dl-item.dl-locked { opacity: .62; }

.dl-main { flex: 1; min-width: 0; }

.dl-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 600; color: #f0f6fc; margin-bottom: 5px;
}
.dl-size { color: #8b949e; font-size: 12px; font-weight: 400; }

.dl-note { color: #c9d1d9; font-size: 12.5px; margin-bottom: 4px; }
.dl-reason { color: #d29922; font-size: 12px; margin-top: 4px; }
.dl-notes {
  color: #8b949e; font-size: 12px; margin-top: 5px;
  white-space: pre-wrap;   /* 更新说明是多行文本，⛔ 不要挤成一行 */
}
.dl-install { color: #8b949e; font-size: 11.5px; margin-top: 6px; }

.dl-btn { white-space: nowrap; align-self: center; text-decoration: none; }

@media (max-width: 560px) {
  .form .row { flex-direction: column; gap: 0; }
  .lic-box { flex-direction: column; align-items: stretch; }
  /* 窄屏：按钮换到下一行，避免挤压文字 */
  .dl-item { flex-direction: column; align-items: stretch; }
  .dl-btn { align-self: stretch; text-align: center; }
}
